query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
use for view the ligin page on admin
public function loginAdminAction(){ if(!empty($_POST)){ $user = new User(); if(!$user->login(true)){ $_SESSION['error'] = 'Login/Passwort ist falsch'; } if(User::isAdmin()){ redirect(ADMIN); }else{ redirect(); } } $this->layout = 'login'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function admin_page()\n {\n }", "public function admin_page()\n {\n }", "public function admin_page()\n {\n echo $this->return_admin_page();\n }", "public function show_admin_page() {\n\t\t$this->view->render();\n\t}", "public function admin_page() {\n echo $this->generateView('main', []);\n }", "static function adminMenuPage()\n {\n // Include the view for this menu page.\n include PROJECTEN_PLUGIN_ADMIN_VIEWS_DIR . '/admin_main.php';\n }", "public function loket()\n\t{\n\n\t\t$data['data_loket'] = $this->model_admin->get_loket();\n\t\t$data['halaman'] = 'view_loket';\n\t\t$this->load->view('admin/page', $data);\n\t}", "function adminSpecial() {\n\t\t$this->adminDefault();\n\t\t$this->baseLink = CMS_WWW_URI.'admin/special.php?module=picture_gallery';\n\t\t$this->setView('admin_list');\n\t}", "public function admin_page()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n echo $this->return_admin_page();\n }", "public function load_admin_page()\n {\n include 'admin-page.html';\n }", "public function admin(){\n $data = array('page_title' => \"Admin home\");\n $this->view->load_admin('home/admin/admin_view', $data);\n }", "public function page() {\n\t\t$this->page = $this->plugin->factory->adminPage;\n\t\t$this->page->show();\n\t}", "public function page(){\n\t\t$pageLoader = $this->plugin->library('Page');\n\t\t$pageLoader->load('admin/settings');\n\t}", "function bit_admin_page() {\n\t//Creates admin page\n}", "public function adminPanel() {\n $posts = $this->postManager->getPosts();\n $comments = $this->commentManager->getFlaggedComments();\n $view = new View(\"Administration\");\n $view->generate(array('posts' => $posts, 'comments' => $comments));\n }", "public function config_page() {\n\t\trequire HS_DOCS_API_DIR_PATH . 'admin/views/admin-page.php';\n\t}", "public function adminmenu()\n {\n\n $vue = new ViewAdmin(\"Administration\");\n $vue->generer(array());\n }", "public function displayAdminPanel() {}", "public function adminindex() {\n $current_page = 'Admin';\n $content = \"<div class='alert alert-success'>The content of Admin Section</div>\";\n \n \n $menu = $this->buildmenu();//building a dynamic menu\n return view('pages.admin')->with('current_page', $current_page)\n ->with('page_content', $content)\n ->with('pages', $menu);\n }", "public function admin_index() {\n\n\t\t\t/*get all data from table \"modules\"*/\n\t\t\t$modules=$this->Module->find(\"all\");\n\n\t\t\t/*set variables of page*/\n\t\t\t$this->set(\"title\", \"Gestion\");\n\t\t\t$this->set(\"legend\", \"Modules manager\");\n\t\t\t$this->set(\"modules\", $modules);\n\t\t\t}", "public function render_admin_page() {\n $option_name = $this->name; \n include_once( dirname( __FILE__ ) . '/views/admin-page.php' );\n }", "function load_sailthru_admin_display() {\n\n\t\t$active_tab = empty( $this->views[ current_filter() ] ) ? '' : $this->views[ current_filter() ];\n\t\t// display html\n\t\tinclude SAILTHRU_PLUGIN_PATH . 'views/admin.php';\n\n\t}", "function printAdminPage() {\n require ('adminPage.php');\n adminPage($this);\n }", "public function admin()\n {\n $this->template_admin->displayad('admin');\n }", "function admin_page_load() {\n\t\t$this->jetpack->admin_page_load();\n\t}", "function admin()\n{\n global $app;\n\n $app->render('admin.html', [\n 'page' => mkPage(getMessageString('admin'), 0, 1),\n 'isadmin' => is_admin()]);\n}", "public function action_view()\n {\n // Correct page has been loaded in the before() function\n $pagename = Wi3::inst()->routing->args[0];\n $this->prepareForViewing($pagename);\n // Render page\n $renderedInAdminArea = false;\n $this->request->response = Wi3_Renderer::renderPage($pagename, $renderedInAdminArea);\n // Page caching will be handled via an Event. See bootstrap.php and the Caching plugin\n }", "public function adminIndexAction()\r\n {\r\n $pages=$this->getDoctrine()->getRepository(\"AppBundle:Page\")->findAll();\r\n $view=array('pages' => $pages,\r\n );\r\n return $this->render('page/adminIndex.html.twig', $view);\r\n }", "function ozh_yourls_gsb_admin_page() {\n include_once dirname( __FILE__ ) . '/includes/admin-page.php';\n ozh_yourls_gsb_display_page();\n}", "public function settingsPage()\n {\n include 'views/admin.php';\n }", "function index(){\n set_theme();\n A(\"Taskadmin/Fun\")->islogin();//检测是否登录\n $access = I('get.access','000000');\n A(\"Api/Fun\")->isAccess($access);//判断菜单权限\n $this->display();\n }", "public function index() {\n\t\t$data = $this->load_module_info ();\n\t\t\n\t\t$this->layout->display_admin ( $this->folder . $this->module . \"-list\", $data );\n\t}", "public function display_page() {\n include_once JPID_PLUGIN_DIR . 'includes/admin/pages/views/html-jpid-admin-settings-page.php';\n }", "public function index()\n {\n return view('adminlte::page');\n }", "public function index()\n\t\t{\n\t\t\t$pageHeader = \tarray( 'pagetitle' => 'Page Listing',\n\t\t\t'slug'=>'pages',\n\t\t\t'font_icon'=>'book',\n\t\t\t);\n\t\t\t\n\t\t\t//Get All pages data\n\t\t\t$data['pagesdata'] = $this->AdminPageModel->GetAllPages();\n\t\t\t\n\t\t\t$this->load->view('admin/share-template/header', $pageHeader);\n\t\t\t$this->load->view('admin/admin_pages_listing_view', $data);\n\t\t\t$this->load->view('admin/share-template/footer');\n\t\t\t\n\t\t}", "public function register_admin_page()\n {\n }", "public static function adminPage(){\n\t\tif(!self::isAdmin()){\n\t\t\theader(\"Location: index.php\");\n\t\t\texit;\n\t\t}\n\t}", "protected function get_admin_url()\n {\n }", "function admin_cms_list(){\r\r\n\t\t\r\r\n\t\t$this->layout='backend/backend';\r\r\n\t\t$this->set(\"title_for_layout\",CMS_PAGE_LISTING);\r\r\n\t\tApp::import(\"Model\",\"CmsPage\");\r\r\n\t\t$this->CmsPage = new CmsPage();\r\r\n\t\t$conditions = array(\"CmsPage.is_deleted\"=>\"0\");\r\r\n\t\t\r\r\n\t\t$this->paginate = array('recursive'=>-1,'conditions'=>$conditions,'limit' =>CMS_PAGE_LIMIT,'order'=>array(\"CmsPage.page_order\"=>\"asc\"));\r\r\n\t\t$cms_page_data = $this->paginate('CmsPage'); \r\r\n\t\t$this->set('cms_page_data',$cms_page_data);\r\r\n\t}", "public function index()\n\t{\n\t\tView::render('admin');\n\t}", "function superadmin(){\n $this->auth(SUPER_ADM_LEVEL);\n $data['title'] = 'superadmin';\n $this->load->view('include/v_header', $data);\n $this->load->view('admin/superadmin/v_main');\n $this->load->view('include/v_footer');\n }", "function mmf_admin() {\n\t\tinclude('mmf_admin_page.php');\n\t}", "public function adminIndex()\n {\n $config['list'] = VRPages::get()->toArray();\n $config['pageTitle'] = trans('app.pages');\n $config['route'] = route('app.pages.create');\n\n $config['edit'] = 'app.pages.edit';\n $config['delete'] = 'app.pages.delete';\n//dd($config);\n return view('admin.list', $config);\n }", "public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }", "public function admin()\n {\n $this->view->books = $this->help->getBookList();\n $this->view->title = $this->lang->help->common;\n $this->display();\n }", "public function menu_html()\n {\n echo '<h1>'.get_admin_page_title().'</h1>';\n echo '<p>Bienvenue sur la page d\\'accueil de la lettre d\\'informations.</p>';\n }", "function index(){\r\n $id_level=$this->session->level;\r\n\t\tif($this->session->level==1 AND $this->session->id_user==1)\r\n {\r\n \t\r\n \t $data['modulmenu']='active';\r\n $data['modul']='active';\r\n $data['title']='Menu';\r\n $data['id_level']=$id_level;\r\n $data['link']=$link;\r\n $data['ctrl']='modul';\r\n \t $data['record']=$this->model_app->view_ordering('simpeg_modul','id_modul','ASC');\r\n\t\t $this->template->load('admin','admin/mod_modul/modul',$data);\r\n\t\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tredirect('dashboard');\r\n\t\t}\r\n }", "public function admincp_index(){\n\t\tpermission_force_check('r');\n\t\t$default_func = 'created';\n\t\t$default_sort = 'DESC';\n\t\t$data = array(\n\t\t\t'module'=>$this->module,\n\t\t\t'module_name'=>$this->session->userdata('Name_Module'),\n\t\t\t'default_func'=>$default_func,\n\t\t\t'default_sort'=>$default_sort\n\t\t);\n\t\t$this->template->write_view('content','BACKEND/index',$data);\n\t\t$this->template->render();\n\t}", "public function getAdminpage() {\n\t\t // $result = mysqli_query($this->connect(), $sql);\n\t\t\t// return $result;\n\t\t}", "function admin_index()\n\t{\n\t $this->set('pagetitle',\"Manage Pages\");\n\t $this->paginate=array('order'=>'Page.name ASC');\n\t $lists = $this->paginate('Page');\n\t $this->set('list', $lists);\n\t \n\t if((isset($this->data[\"Page\"][\"setStatus\"])))\n\t {\n\t\t$status = ife($_POST['active'],1,0);\n\t\t$record = $this->data[\"Page\"][\"Record\"];\n\t\t$CheckedList=$_POST['box1'];\n\t\t$controller= $this->params['controller'];\n\t\t$action='index'; \n\t\t$prefix='admin';\n\t\t$model='Page';\n\t\t$relation=null;\n\t\t\n\t\tswitch($status)\n\t\t{ \n\t\t case '1': \n\t\t\t$this->setStatus('1',$CheckedList,$model,$relation,$controller,$action,$prefix,$record); \n\t\t break;\n\t\t case '0':\n\t\t\t$this->setStatus('0',$CheckedList,$model,$relation,$controller,$action,$prefix,$record); \n\t\t break; \n\t\t}\n\t }\n\t}", "public function admin_home()\n {\n if ( ! file_exists(APPPATH.'views/pages/admin_home.php'))\n {\n // Whoops, we don't have a page for that!\n show_404();\n }\n if (!isset($this->session->userdata['user_role']) || $this->session->userdata['user_role'] < 40)\n {\n $this->session->set_flashdata('message', 'Vous devez avoir les droits de superviseur');\n redirect($_SERVER['HTTP_REFERER']); \n }\n \n $data['title'] = 'Page Administrateur';\n $data['unactive_member'] = $this->member_model->get_unactive_member();\n $data['unactive_ad'] = $this->ad_model->get_unactive_ad();\n\n // breadcrumb\n $data['breadcrumbs'] = $this->breadcrumbs();\n\n $this->load->template('pages/admin_home',$data);\n\n }", "function admin_html()\n {\n }", "public function ListView()\n\t{\n\t\tif($this->GetCurrentUser())\n\t\t{\t\t\t\t\t\t\n\t\t\t//require 'translate/en.php';\n\t\t\t$lang=file_get_contents('libs/translate/en.php');\n\t\t\t$this->Assign(\"currentUser\", $this->GetCurrentUser());\n\t\t\t$this->Assign(\"lang\",$lang);\n\t\t\t$this->Render();\n\t\t}else{\t\t\t\n\t\t\t$this->Render('Login');\t\n\t\t}\n\t}", "public function adminPluginOptionsPage()\n {\n echo $this->_loadView('admin-settings-page');\n }", "public function lists_page()\n\t\t{\n\t\t\tif (!@include 'lists-page.php'):\n\t\t\t\tprintf(__('<div id=\"message\" class=\"updated fade\"><p>The lists page for the <strong>Mailgun</strong> plugin cannot be displayed. The file <strong>%s</strong> is missing. Please reinstall the plugin.</p></div>',\n\t\t\t\t\t'mailgun'), dirname(__FILE__) . '/lists-page.php');\n\t\t\tendif;\n\t\t}", "public function nav()\n {\n $PagesAdmin=new LaraPagesController;\n $PagesAdmin->modelId='media';\n return $PagesAdmin->nav();\n }", "static function adminSubMenuProjecten()\n {\n // include the view for this submenu page.\n include PROJECTEN_PLUGIN_ADMIN_VIEWS_DIR . '/pp_admin_projecten.php';\n }", "public function render_admin_page () {\n\t\tif (!Upfront_Permissions::current(Upfront_Permissions::BOOT)) wp_die(\"Nope.\");\n\n\t\tif (!class_exists('Thx_Sanitize')) require_once (dirname(__FILE__) . '/class_thx_sanitize.php');\n\t\tif (!class_exists('Thx_Template')) require_once (dirname(__FILE__) . '/class_thx_template.php');\n\n\t\tload_template(Thx_Template::plugin()->path('create_edit'));\n\t}", "public static function admin_menu() {\n\t\t$title = 'Micropub';\n\t\t// If the IndieWeb Plugin is installed use its menu.\n\t\tif ( class_exists( 'IndieWeb_Plugin' ) ) {\n\t\t\t$options_page = add_submenu_page(\n\t\t\t\t'indieweb',\n\t\t\t\t$title,\n\t\t\t\t$title,\n\t\t\t\t'manage_options',\n\t\t\t\t'micropub',\n\t\t\t\tarray( static::class, 'settings_page' )\n\t\t\t);\n\t\t} else {\n\t\t\t$options_page = add_options_page(\n\t\t\t\t$title,\n\t\t\t\t$title,\n\t\t\t\t'manage_options',\n\t\t\t\t'micropub',\n\t\t\t\tarray( static::class, 'settings_page' )\n\t\t\t);\n\t\t}\n\n\t}", "public static function admin()\n {\n HRHarvardTheme::get_template_part( 'admin', 'nav-widget' );\n }", "function index()\n{\n $this->load->module('site_security');\n $this->site_security->_make_sure_is_admin();\n\n $data['query'] = $this->get('date');\n \n $data['flash'] = $this->session->flashdata('delete');\n $data['headline'] = 'Blog';\n $data['view_module'] = 'blog';\n $data['view_file'] = 'manage';\n $this->load->module('templates');\n $this->templates->admin($data);\n}", "function showPage($page_name, $data)\n\t{\n\t\t$instance_name = & get_instance();\n\t\t$instance_name->load->view(\"admin/header\", $data);\n\t\t$instance_name->load->view(\"admin/navbar\", $data);\n\t\t$instance_name->load->view(\"admin/{$page_name}\", $data);\n\t\t$instance_name->load->view(\"admin/footer\", $data);\n\t}", "function list_view()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $data = '';\n $this->global['pageTitle'] = '轮播图列表';\n $this->global['pageName'] = 'carousel';\n\n $this->loadViews(\"carousel\", $this->global, $data, NULL);\n }\n }", "public function laporan()\n\t{\n\n\t\t$data['halaman'] = 'view_laporan';\n\t\t$this->load->view('admin/page', $data);\n\t}", "function admin_menu() {\n\t\t// The designation of add_MANAGEMENT_page causes the menu item to be listed under the Tools menu!\n\t\tadd_management_page('Revitalize Orders Output', 'Revitalize Orders', 'edit_posts', basename(__FILE__), array(&$this, 'page_handler'));\n\t}", "function admin_landing_page() {\n add_menu_page( 'Welcome | All Cycles Admin', 'Welcome', 'manage_options', 'admin_landing_page', 'create_admin_page', 'dashicons-menu', 5 );\n}", "function list_view()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '订单管理';\n $this->global['pageName'] = 'order';\n\n $data['searchType'] = '0';\n $data['searchName'] = '';\n $data['searchStatus'] = '0';\n $data['searchMethod'] = '0';\n\n $this->loadViews(\"order_manage/order\", $this->global, $data, NULL);\n }\n }", "public function mainpage()\n {\n return view('admin.adminmainpage');\n }", "public function index()\n\t{\n\t\t$this->load->view(\"admin_view\");\n\t}", "public function indexAction()\n {\n $this->tag->setTitle(__('Admin panel'));\n $this->siteDesc = __('Admin panel');\n }", "public function admincp_index(){\n\t\tmodules::run('admincp/chk_perm',$this->session->userdata('ID_Module'),'r',0);\n\t\t$default_func = 'created';\n\t\t$default_sort = 'DESC';\n\t\t$data = array(\n\t\t\t'module'=>$this->module,\n\t\t\t'module_name'=>$this->session->userdata('Name_Module'),\n\t\t\t'default_func'=>$default_func,\n\t\t\t'default_sort'=>$default_sort\n\t\t);\n\t\t$this->template->write_view('content','BACKEND/index',$data);\n\t\t$this->template->render();\n\t}", "public function load_admin_page() {\n\t \t\n\t\t// determine the action from either the GET parameter (for sub-menu entries, and the main admin menu entry)\n\t\t$action = ( ! empty( $_GET['action'] ) ) ? $_GET['action'] : 'list'; // default action is list\n\t\t\n\t\tif ( $this->is_top_level_page ) {\n\t\t\t// or for sub-menu entry of an admin menu \"IggoGrid\" entry, get it from the \"page\" GET parameter\n\t\t\tif ( 'iggogrid' !== $_GET['page'] ) {\n\t\t\t\t\n\t\t\t\t// actions that are top-level entries, but don't have an action GET parameter (action is after last _ in string)\n\t\t\t\t$action = substr( $_GET['page'], 9 ); // $_GET['page'] has the format 'iggogrid_{$action}'\n\t\t\t}\n\t\t} else {\n\t\t\t// do this here in the else-part, instead of adding another if ( ! $this->is_top_level_page ) check\n\t\t\t$this->init_i18n_support(); // done here, as for sub menu admin pages this is the first time translated strings are needed\n\t\t\t$this->init_view_actions(); // for top-level menu entries, this has been done above, just like init_i18n_support()\n\t\t}\n\t\t\n\t\t// check if action is a supported action, and whether the user is allowed to access this screen\n\t\tif ( ! isset( $this->view_actions[ $action ] ) || ! current_user_can( $this->view_actions[ $action ]['required_cap'] ) ) {\n\t\t\twp_die( __( 'You do not have sufficient permissions to access this page.', 'default' ) );\n\t\t}\n\t\t\n\t\t// changes current screen ID and pagenow variable in JS, to enable automatic meta box JS handling\n\t\tset_current_screen( \"iggogrid_{$action}\" );\n\n\t\t// pre-define some table data\n\t\t$data = array(\n\t\t\t'view_actions' => $this->view_actions,\n\t\t\t'message' => ( ! empty( $_GET['message'] ) ) ? $_GET['message'] : false,\n\t\t);\n\t\t\n\t\t// depending on action, load more necessary data for the corresponding view\n\t\tswitch ( $action ) {\n\t\t\tcase 'list':\n\t\t\t\t$data['table_id'] = ( ! empty( $_GET['table_id'] ) ) ? $_GET['table_id'] : false;\n\t\t\t\t$data['table_ids'] = IggoGrid::$model_table->load_all( true ); // Prime the post meta cache for cached loading of last_editor\n\t\t\t\t$data['messages']['first_visit'] = IggoGrid::$model_options->get( 'message_first_visit' );\n\t\t\t\tif ( current_user_can( 'iggogrid_import_tables_wptr' ) ) {\n\t\t\t\t\t$data['messages']['wp_table_reloaded_warning'] = is_plugin_active( 'wp-table-reloaded/wp-table-reloaded.php' ); // check if WP-Table Reloaded is activated\n\t\t\t\t} else {\n\t\t\t\t\t$data['messages']['wp_table_reloaded_warning'] = false;\n\t\t\t\t}\n\t\t\t\t$data['messages']['show_plugin_update'] = IggoGrid::$model_options->get( 'message_plugin_update' );\n\t\t\t\t$data['messages']['plugin_update_message'] = IggoGrid::$model_options->get( 'message_plugin_update_content' );\n\t\t\t\t$data['messages']['donation_message'] = $this->maybe_show_donation_message();\n\t\t\t\t$data['table_count'] = count( $data['table_ids'] );\n\t\t\t\tbreak;\n\t\t\tcase 'about':\n\t\t\t\t$data['plugin_languages'] = $this->get_plugin_languages();\n\t\t\t\t$data['first_activation'] = IggoGrid::$model_options->get( 'first_activation' );\n// \t\t\t\t$exporter = IggoGrid::load_class( 'IggoGrid_Export', 'class-export.php', 'classes' );\n// \t\t\t\t$data['zip_support_available'] = $exporter->zip_support_available;\n\t\t\t\tbreak;\n\t\t\tcase 'options':\n\t\t\t\t// Maybe try saving \"Custom CSS\" to a file:\n\t\t\t\t// (called here, as the credentials form posts to this handler again, due to how request_filesystem_credentials() works)\n\t\t\t\tif ( isset( $_GET['item'] ) && 'save_custom_css' == $_GET['item'] ) {\n\t\t\t\t\tIggoGrid::check_nonce( 'options', $_GET['item'] ); // nonce check here, as we don't have an explicit handler, and even viewing the screen needs to be checked\n\t\t\t\t\t$action = 'options_custom_css'; // to load a different view\n\t\t\t\t\t// try saving \"Custom CSS\" to a file, otherwise this gets the HTML for the credentials form\n\t\t\t\t\t$iggogrid_css = IggoGrid::load_class( 'IggoGrid_CSS', 'class-css.php', 'classes' );\n\t\t\t\t\t$result = $iggogrid_css->save_custom_css_to_file_plugin_options( IggoGrid::$model_options->get( 'custom_css' ), IggoGrid::$model_options->get( 'custom_css_minified' ) );\n\t\t\t\t\tif ( is_string( $result ) ) {\n\t\t\t\t\t\t$data['credentials_form'] = $result; // this will only be called if the save function doesn't do a redirect\n\t\t\t\t\t} elseif ( true === $result ) {\n\t\t\t\t\t\t// at this point, saving was successful, so enable usage of CSS in files again,\n\t\t\t\t\t\t// and also increase the \"Custom CSS\" version number (for cache busting)\n\t\t\t\t\t\tIggoGrid::$model_options->update( array(\n\t\t\t\t\t\t\t'use_custom_css_file' => true,\n\t\t\t\t\t\t\t'custom_css_version' => IggoGrid::$model_options->get( 'custom_css_version' ) + 1,\n\t\t\t\t\t\t) );\n\t\t\t\t\t\tIggoGrid::redirect( array( 'action' => 'options', 'message' => 'success_save' ) );\n\t\t\t\t\t} else { // leaves only $result = false\n\t\t\t\t\t\tIggoGrid::redirect( array( 'action' => 'options', 'message' => 'success_save_error_custom_css' ) );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$data['frontend_options']['use_custom_css'] = IggoGrid::$model_options->get( 'use_custom_css' );\n\t\t\t\t$data['frontend_options']['custom_css'] = IggoGrid::$model_options->get( 'custom_css' );\n\t\t\t\t$data['user_options']['parent_page'] = $this->parent_page;\n\t\t\t\t$data['user_options']['plugin_language'] = IggoGrid::$model_options->get( 'plugin_language' );\n\t\t\t\t$data['user_options']['plugin_languages'] = $this->get_plugin_languages();\n\t\t\t\tbreak;\n\t\t\tcase 'edit':\n\t\t\t\tif ( ! empty( $_GET['table_id'] ) ) {\n\t\t\t\t\t$data['table'] = IggoGrid::$model_table->load( $_GET['table_id'], true, true ); // Load table, with table data, options, and visibility settings\n// \t\t\t\t\tprint_r($data['table']);die;\n\t\t\t\t\tif ( is_wp_error( $data['table'] ) ) {\n\t\t\t\t\t\tIggoGrid::redirect( array( 'action' => 'list', 'message' => 'error_load_table' ) );\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! current_user_can( 'iggogrid_edit_table', $_GET['table_id'] ) ) {\n\t\t\t\t\t\twp_die( __( 'You do not have sufficient permissions to access this page.', 'default' ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tIggoGrid::redirect( array( 'action' => 'list', 'message' => 'error_no_table' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Filter the data that is passed to the current IggoGrid View.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param array $data Data for the view.\n\t\t * @param string $action The current action for the view.\n\t\t */\n\t\t$data = apply_filters( 'iggogrid_view_data', $data, $action );\n\t\t\n\t\t// prepare and initialize the view\n\t\t$this->view = IggoGrid::load_view( $action, $data );\n\t}", "function admin_index()\n {\n $perPage = 100;\n $this->lordModel('Post');\n $condition = array('type' => 'post');\n $d['posts'] = $this->Post->find(array(\n 'condition' => $condition,\n 'limit' => ($perPage * ($this->request->page - 1)) . ',' . $perPage\n ));\n $d['total'] = $this->Post->findCount($condition);\n $d['nbrPage'] = ceil($d['total'] / $perPage);\n //print_r($d);\n $this->setvars($d);\n //$this->setvars('phrase', 'bienvenue sur ma page');\n //$this->render('view');\n }", "function index()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //login check\n $this->__commonAdmin_LoggedInCheck();\n\n //uri - action segment\n $action = $this->uri->segment(4);\n\n //default page title\n $this->data['vars']['main_title'] = $this->data['lang']['lang_settings_company'];\n\n //re-route to correct method\n switch ($action) {\n case 'edit':\n $this->__editSettings();\n break;\n\n case 'view':\n $this->__viewSettings();\n break;\n\n default:\n $this->__viewSettings();\n }\n\n //css - active tab\n $this->data['vars']['css_active_tab_company'] = 'tab-active';\n\n //load view\n $this->__flmView('admin/main');\n\n }", "public function display_plugin_admin_page() {\n\t\t\tinclude_once( 'views/settings-page.php' );\n\t\t}", "function plugin_admin_panel_page(){\n $vm = [\n \"api_token\" => Helper::get_option(\"api_token\"),\n ];\n\n Helper::view(\"admin\", $vm);\n}", "function admin_menu() {\n\t\t// Set Admin Access Level\n\t\tif(!$this->options['access_level']): \n\t\t\t$access = 'edit_dashboard';\n\t\telse: \n\t\t\t$access = $this->options['access_level'];\n\t\tendif;\n\t\t\n\t\t// Create Menu Items \n\t\tadd_options_page('Escalate Network', 'Escalate Network', $access, 'escalate-network-options', array($this, 'settings_page'));\n\t}", "public function index(){\n\t\t$this->Layout('Management');\n\t\t\n\t}", "function index_template()\n {\n return 'photocrati-nextgen_admin#nextgen_admin_page';\n }", "public function index() {\n $content = $this->lgpp1->gpp_list();\n //Here ,0 means array position 0 will be active class\n $this->template->full_admin_html_view($content);\n }", "public function display_page() {\n include_once JPID_PLUGIN_DIR . 'includes/admin/pages/views/html-jpid-admin-customer-edit-page.php';\n }", "public function admin() {\r\n $ruta = new Ruta($this->adapter);\r\n\r\n //Conseguimos todos los usuarios\r\n $allrut = $ruta->getAll();\r\n //Cargamos la vista index y le pasamos valores\r\n $this->view(\"Ruta/admin\", array(\"allrut\" => $allrut));\r\n \r\n }", "public function index()\n {\n $number_of_items = $this->calculate->getTotalOfItemsAdmin();\n if (null != $this->request->ifParameter(\"id\")) {\n $items_current_page = $this->request->getParameter(\"id\");\n } else {\n $items_current_page = 1;\n }\n $items = $this->item->getItemsForAdmin($items_current_page);\n $page_previous_items = $items_current_page - 1;\n $page_next_items = $items_current_page + 1;\n $number_of_items_pages = $this->calculate->getNumberOfPagesOfExtAdmin();\n $this->generateadminView(array(\n 'items' => $items,\n 'number_of_items' => $number_of_items,\n 'items_current_page' => $items_current_page,\n 'page_previous_items' => $page_previous_items,\n 'page_next_items' => $page_next_items,\n 'number_of_items_pages' => $number_of_items_pages\n ));\n }", "public static function load() {\n\n\t\tadd_menu_page( self::TA_PAGE_TITLE, self::TA_TITLE, 'administrator', self::TA_SLUG, array(__CLASS__, 'makeAdmin'), self::asset('img/') . self::TA_ICON_URL, self::TA_POSITION );\n\t}", "public function getSearchAdminLinkForObject() {\n return getLinkAdminHref(\"pages\", \"list\", \"&systemid=\".$this->getSystemid());\n }", "public function adminActionGet() : object\n {\n $page = $this->app->page;\n $title = \"Redigera Inlägg\";\n $db = $this->app->db;\n $id = null;\n $doDelete = null;\n $doEdit = null;\n $db->connect();\n $sql = \"SELECT * FROM content;\";\n $resultset = $db->executeFetchAll($sql);\n\n $data = [\n \"resultset\" => $resultset ?? null,\n \"id\" => $id ?? null,\n \"doEdit\" => $doEdit ?? null,\n \"doDelete\" => $doDelete ?? null,\n \"content\" => $resultset\n ];\n \n $page->add(\"cms/header\");\n $page->add(\"cms/admin\", $data);\n \n return $page->render([\n \"title\" => $title\n ]);\n }", "public static function _options_page(){\n\t\tif( isset($_POST['urls']) ){\n\t\t\tself::updateUrls($_POST['urls']);\n\t\t}\n\t\t\n\t\t$vars = (object) array();\n\t\t$vars->messages = implode( \"\\n\", self::$messages );\n\t\t$vars->path = self::$path;\n\t\t$vars->urls = self::getUrls();\n\t\tself::render( 'admin', $vars );\n\t}", "function get_page_hook() {\n\t\treturn add_submenu_page(\n\t\t\tnull,\n\t\t\t__( 'Jetpack Settings', 'jetpack' ),\n\t\t\t__( 'Settings', 'jetpack' ),\n\t\t\t'jetpack_manage_modules',\n\t\t\t'jetpack_modules',\n\t\t\tarray( $this, 'render' )\n\t\t);\n\t}", "public function action_index() {\r\n\r\n\t$main_content = View::forge(\"account/simpleauth\");\r\n $main_sidebar = View::forge(\"vlog/sidebar\");\r\n\r\n\t$this->template->page_content = $main_content;\r\n $this->template->page_sidebar = $main_sidebar;\r\n }", "public static function display()\n {\n $page = self::getCurrentPage();\n\n template::serveTemplate('header');\n\n if (session::has('user') === FALSE) {\n user::setLoginUrl('~url::adminurl~');\n if (session::has('viewPage') === FALSE) {\n session::set('viewPage', $page);\n }\n user::process();\n return;\n }\n\n if (session::has('viewPage') === TRUE) {\n $page = session::get('viewPage');\n session::remove('viewPage');\n }\n\n /**\n * Set the default page title to nothing.\n * This is used for including extra information (eg the post subject).\n */\n template::setKeyword('header', 'pagetitle', '');\n\n $menuItems = array(\n '/' => array(\n 'name' => 'Home',\n 'selected' => TRUE,\n ),\n '/adminpost' => array(\n 'name' => 'Posts',\n ),\n '/admincomments' => array(\n 'name' => 'Comments',\n ),\n '/adminstats' => array(\n 'name' => 'Stats',\n ),\n );\n\n if (empty($page) === FALSE) {\n $bits = explode('/', $page);\n\n // Get rid of the '/admin' bit.\n array_shift($bits);\n\n if (empty($bits[0]) === FALSE) {\n $system = array_shift($bits);\n\n /**\n * Uhoh! Someone's trying to find something that\n * doesn't exist.\n */\n if (loadSystem($system, 'admin') === TRUE) {\n $url = '/'.$system;\n if (isset($menuItems[$url]) === TRUE) {\n $menuItems[$url]['selected'] = TRUE;\n unset($menuItems['/']['selected']);\n }\n\n $bits = implode('/', $bits);\n if (isValidSystem($system) === TRUE) {\n call_user_func_array(array($system, 'process'), array($bits));\n }\n } else {\n $url = '';\n if (isset($_SERVER['PHP_SELF']) === TRUE) {\n $url = $_SERVER['PHP_SELF'];\n }\n $msg = \"Unable to find system '\".$system.\"' for url '\".$url.\"'. page is '\".$page.\"'. server info:\".var_export($_SERVER, TRUE);\n messagelog::LogMessage($msg);\n template::serveTemplate('404');\n }\n }\n } else {\n // No page or default system?\n // Fall back to 'index'.\n template::serveTemplate('header');\n template::serveTemplate('index');\n }\n\n $menu = '';\n foreach ($menuItems as $url => $info) {\n $class = '';\n if (isset($info['selected']) === TRUE && $info['selected'] === TRUE) {\n $class = 'here';\n }\n\n $menu .= '<li class=\"'.$class.'\">';\n $menu .= '<a href=\"~url::adminurl~'.$url.'\">'.$info['name'].'</a>';\n $menu .= '</li>';\n $menu .= \"\\n\";\n }\n\n template::setKeyword('header', 'menu', $menu);\n\n template::serveTemplate('footer');\n template::display();\n\n }", "public function admin()\n {\n return $this->render('admin.twig');\n }", "function admin_index()\n\t{\n\t \n\t}", "protected function displayMaintenancePage()\n {\n }", "protected function displayMaintenancePage()\n {\n }", "protected function displayMaintenancePage()\n {\n }", "public function render_graphiql_admin_page()\n {\n }", "public function index()\n {\n return view('admin.pagelist');\n }", "public function index(){\n\t\t$data['meta_description']='';\n\t\t$data['menu']= $this->menu;\n\t\t// echo \"<pre>\";\n\t\t// print_r($this->user);\n\t\t// echo \"</pre>\";\n\t\t// die();\n\t\t$data['user'] = $this->user;\n\t\t$data['group'] = $this->group->name;\n\t\t$data['superviser']=$this->superviser_name;;\n\n\t\t$data['page']='dashboard'; //page view to load\n\t\t$data['pls'] = array(); //page level scripts\n\t\t$data['plugins'] = array(); //plugins\n\t\t$data['javascript'] = array(); //javascript\n\t\t$views= array('design/html_topbar','sidebar','design/page','design/html_footer');\n\t\t$this->layout->view($views, $data);\n\t}", "public static function publicPage(){\n\t\tif(self::isAdmin()){\n\t\t\theader(\"Location: admin_users.php\");\n\t\t\texit;\n\t\t}\n\t}", "function parent_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'parent_add';\n $page_data['page_title'] = get_phrase('add_parent');\n $this->load->view('backend/index', $page_data);\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}" ]
[ "0.81915724", "0.81915724", "0.7874509", "0.78125364", "0.764189", "0.7516504", "0.75145787", "0.7503055", "0.74744505", "0.7460312", "0.74223745", "0.739383", "0.7374204", "0.7305367", "0.7243842", "0.72071934", "0.7136846", "0.7133207", "0.7103007", "0.7096927", "0.7069379", "0.7065006", "0.705797", "0.7027019", "0.69889", "0.69527787", "0.6940819", "0.6930561", "0.69249547", "0.6924278", "0.6920154", "0.69091254", "0.68959993", "0.6891591", "0.68899906", "0.68731046", "0.6868879", "0.6849131", "0.684115", "0.68227667", "0.681364", "0.68060654", "0.67936057", "0.67925966", "0.67708933", "0.6770783", "0.6769079", "0.6764547", "0.6763818", "0.6741586", "0.67405677", "0.6737285", "0.6736738", "0.67356616", "0.672281", "0.67168325", "0.67158353", "0.67147005", "0.6709415", "0.6704375", "0.67009246", "0.6700702", "0.6696348", "0.6685449", "0.66820663", "0.66814107", "0.6680987", "0.668008", "0.6679513", "0.667388", "0.66721773", "0.66699344", "0.66670585", "0.666389", "0.6660967", "0.66546166", "0.6652069", "0.6647536", "0.6644458", "0.66413605", "0.66364527", "0.66241837", "0.6606357", "0.65996367", "0.6598203", "0.65958345", "0.6592747", "0.6590781", "0.6586938", "0.6585496", "0.6585222", "0.6581567", "0.6581545", "0.6581545", "0.6581545", "0.6581102", "0.65788877", "0.6578411", "0.65777385", "0.6577362", "0.6575842" ]
0.0
-1
Add the Meta Box
function pz_add_custom_meta_box() { add_meta_box( 'custom_meta_box', 'Custom Image Metabox', 'pz_custom_meta_box_callbacks', 'page', // page, post etc. 'normal', 'high'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function add_meta_box() {\n add_meta_box( \"CBMTheme\", \"CBM Theme Meta Box\", \"CBMAdmin::posts_page\" );\n }", "public static function add_meta_box() {\n\t\tadd_meta_box( 'sponsor-meta', __( 'Sponsor Meta', self::$text_domain ), array( __CLASS__, 'do_meta_box' ), self::$post_type_name , 'normal', 'high' );\n\t}", "public function addMetaBox()\r\n {\r\n add_meta_box($this->id, esc_html__($this->title, 'firalabs-tv-show'), array(\r\n $this,\r\n 'render'\r\n ), 'firalabs_tv_show', $this->context, 'default');\r\n }", "public static function add_meta_box() {\n add_meta_box(\n 'link_meta', // Unique ID\n 'Properties', // Box title\n [self::class, 'meta_html'], // Content callback, must be of type callable\n \"link\" // Post type\n );\n }", "function create_meta_box() {\n\tif ( function_exists('add_meta_box') ) {\n\t\tadd_meta_box( 'new-meta-boxes', '<div class=\"icon-small\"></div> '.PEXETO_THEMENAME.' PAGE SETTINGS', 'new_meta_boxes', 'page', 'normal', 'high' );\n\t}\n}", "public function addCustomBox() {\n add_meta_box( \n $this->post_type . '_meta',\n __( self::getLabel($this->post_type) . ' Meta', $this->post_type . '_meta' ),\n array($this, 'innerCustomBox'),\n $this->post_type,\n $this->fields_location, \n $this->fields_priority\n ); \n }", "public function setup_meta_box() {\n\t\t\tadd_meta_box( 'add-shortcode-section', __( 'Shortcode', IFLANG ), array( $this, 'meta_box' ), 'nav-menus', 'side', 'high' );\n\t\t}", "public function apb_add_meta_boxes() {\r\n\t}", "public static function registerMetaBoxes() {}", "function coolRahulSoni_meta_box_add()\n{\n add_meta_box( 'my-meta-box-id', 'My First Meta Box', 'cd_meta_box_cb', 'post', 'normal', 'high' );\n}", "public function create_meta_box() {\n\t\tadd_meta_box( 'slider_meta', 'Example metabox', array( $this, 'slider_meta_fields_callback' ), [ 'Page', 'post' ] );\n\n\t}", "public function kiwip_add_meta_box(){\t\t\t\n\t\tadd_meta_box(\n\t\t\t$this->id,\n\t\t\t$this->title,\n\t\t\tarray(&$this, 'kiwip_metabox_callback'),\n\t\t\t$this->cpt_name,\n\t\t\t$this->context,\n\t\t\t$this->priority\n\t\t);\n\t}", "public function register_meta_box() {\r\n add_meta_box( self::POST_TYPE . '-meta', 'Downloadable Resource URL', array ($this, 'meta_box_html'), self::POST_TYPE, 'side', 'default', '');\r\n }", "function rs_meta_box()\n{\n add_meta_box('rs_focus', 'Destaque na home', 'rs_focus', 'post', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'post', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'post_region', 'side');\n add_meta_box('rs_author', 'Autor', 'rs_author', 'event', 'side');\n}", "public function add_meta_boxes()\n {\n\n $this->_add_bitly_meta_box();\n\n }", "function add_meta_box() {\t\t\n\t\t\t/* Gets available public post types. */\n\t\t\t$post_types = get_post_types( array( 'public' => true ), 'objects' );\n\t\t\t\n\t\t\t$post_types = apply_filters( 'remove_youtube_white_label_meta_box', $post_types );\n\t\t\t\n\t\t\t/* For each available post type, create a meta box on its edit page if it supports '$prefix-post-settings'. */\n\t\t\tforeach ( $post_types as $type ) {\n\t\t\t\t/* Add the meta box. */\n\t\t\t\tadd_meta_box( self::DOMAIN . \"-{$type->name}-meta-box\", __( 'YouTube Embed Shortcode Creator (does not save meta)', self::DOMAIN ), array( $this, 'meta_box' ), $type->name, 'side', 'default' );\n\t\t\t}\n\t\t}", "function formulize_meta_box() {\n\t\tadd_meta_box('formulize_sectionid',\n\t __('Formulize', 'formulize_textlabel'),\n\t 'formulize_inner_custom_box',\n\t 'page'\n\t\t);\n}", "public function register_meta_box() {\n\n\t\t\tadd_meta_box($this->slug, $this->options['title'], array($this, 'setup_meta_box'), $this->screen, $this->options['context'], $this->options['priority']);\n\t\t\tremove_meta_box('postcustom', $this->screen, 'normal');\n\t\t}", "public static function createMetaBox() {\r\n add_meta_box( \r\n \\WPDisablePage\\Setup::PLUGIN_ID, // Metabox ID\r\n \\WPDisablePage\\Setup::PLUGIN_NAME, // Metabox Name\r\n array( __CLASS__, 'createView' ), // Metabox Callback\r\n apply_filters( strtolower( \\WPDisablePage\\Setup::PLUGIN_ID ) . '__post_types', self::POST_TYPES ), // Metabox Post Types\r\n self::POSITION, // Metabox Position\r\n self::PRIORITY // Metabox Priority\r\n );\r\n }", "function ahr_add_meta_box() {\r\n \r\n add_meta_box( 'ahr', 'Advaned https redirect', 'ahr_render_meta_box', null, 'normal', 'high', null );\r\n \r\n}", "function add_meta_boxes()\n {\n }", "function cinerama_edge_meta_box_add() {\n\t\tglobal $cinerama_edge_global_Framework;\n\n\t\tforeach ( $cinerama_edge_global_Framework->edgtMetaBoxes->metaBoxes as $key => $box ) {\n\t\t\t$hidden = false;\n\t\t\tif ( ! empty( $box->hidden_property ) ) {\n\t\t\t\tforeach ( $box->hidden_values as $value ) {\n\t\t\t\t\tif ( cinerama_edge_option_get_value( $box->hidden_property ) == $value ) {\n\t\t\t\t\t\t$hidden = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( is_string( $box->scope ) ) {\n\t\t\t\t$box->scope = array( $box->scope );\n\t\t\t}\n\n\t\t\tif ( is_array( $box->scope ) && count( $box->scope ) ) {\n\t\t\t\tforeach ( $box->scope as $screen ) {\n\t\t\t\t\tcinerama_edge_create_meta_box_handler( $box, $key, $screen );\n\n\t\t\t\t\tif ( $hidden ) {\n\t\t\t\t\t\tadd_filter( 'postbox_classes_' . $screen . '_edgtf-meta-box-' . $key, 'cinerama_edge_meta_box_add_hidden_class' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tadd_action( 'admin_enqueue_scripts', 'cinerama_edge_enqueue_meta_box_styles' );\n\t\tadd_action( 'admin_enqueue_scripts', 'cinerama_edge_enqueue_meta_box_scripts' );\n\t}", "public function registerMetaBox() {\n\n add_meta_box(\n 'post-clone',\n 'Clone',\n array($this, 'buildForm'),\n self::$post_types,\n 'side',\n 'low');\n }", "public function register_meta_boxes()\n {\n }", "public function add_meta_box() {\n\t\tif (count($post_types = $this->get_post_types())) {\n\t\t\t$this->load_textdomain();\n\t\t\tforeach ($post_types as $post_type)\n\t\t\t\tadd_meta_box('im8_additional_css_box', __(\"Additional CSS\", 'im8-additional-css'), array($this, 'print_meta_box'), $post_type, 'normal', 'high');\n\t\t}\n\t}", "function sp_add_custom_box() {\n\tif( function_exists( 'add_meta_box' )) {\n\t\tadd_meta_box( 'sp_custom_box_1', __( 'General Property Info', 'sp' ), 'sp_inner_custom_box_1', 'post', 'normal', 'high' );\n\t\tadd_meta_box( 'sp_custom_box_2', __( 'Property Details', 'sp' ), 'sp_inner_custom_box_2', 'post', 'normal', 'high' );\n\t\tadd_meta_box( 'sp_custom_box_3', __( 'Property Photos', 'sp' ), 'sp_inner_custom_box_3', 'post', 'normal', 'high' );\n\t}\n}", "function create_meta_post_box() {\n\tif ( function_exists('add_meta_box') ) {\n\t\tadd_meta_box( 'new-meta-post-boxes', '<div class=\"icon-small\"></div> '.PEXETO_THEMENAME.' POST SETTINGS', 'new_meta_post_boxes', 'post', 'normal', 'high' );\n\t}\n}", "function alpha_meta_box_add()\n{\n add_meta_box('alpha-beer-list', 'Beer List Properties', 'alpha_beer_list', 'ptf_bars', 'side', 'low');\n}", "function meta_boxes() {\n\t\tadd_meta_box( 'event-details', 'Event Details', array( $this , 'details_box' ), 'event', 'normal', 'high' );\n\t}", "public function add_meta_boxes() {\r\n\t\tadd_meta_box( 'zakra-page-setting', esc_html__( 'Page Settings', 'zakra' ), 'Zakra_Meta_Box_Page_Settings::render', array(\r\n\t\t\t'post',\r\n\t\t\t'page',\r\n\t\t) );\r\n\t}", "function add() {\n\t\tforeach ($this->_meta_box['pages'] as $page) {\n\t\t\tadd_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']);\n\t\t}\n\t}", "private function initMetaBox(){\n\t\t$path = get_template_directory() . '/sub/customfield/';\n\t\tif(function_exists('of_get_option')){\n\t\t\tif(of_get_option('is-seo',true)){\n\t\t\t\tnew WPO_MetaBox(array(\n\t\t\t\t 'id' => 'wpo_seo',\n\t\t\t\t 'title' => $this->l('SEO Fields'),\n\t\t\t\t 'types' => array('page','portfolio','post','video'),\n\t\t\t\t 'priority' => 'high',\n\t\t\t\t 'template' => $path . 'seo.php',\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\n\t\tnew WPO_MetaBox(array(\n\t\t 'id' => 'wpo_template',\n\t\t 'title' => $this->l('Advanced Configuration'),\n\t\t 'types' => array('page'),\n\t\t 'priority' => 'high',\n\t\t 'template' => $path . 'page-advanced.php'\n\t\t));\n\n\t\tnew WPO_MetaBox(array(\n\t\t 'id' => 'wpo_pageconfig',\n\t\t 'title' => $this->l('Page Configuration'),\n\t\t 'types' => array('page'),\n\t\t 'priority' => 'high',\n\t\t 'template' => $path . 'page.php',\n\t\t));\n\n\t\tnew WPO_MetaBox(array(\n\t\t 'id' => 'wpo_post',\n\t\t 'title' => $this->l('Embed Options'),\n\t\t 'types' => array('post','video'),\n\t\t 'priority' => 'high',\n\t\t 'template' => $path . 'post.php',\n\t\t));\n\t}", "public function add_meta_boxes()\n {\n /* Author Name */\n add_meta_box(\n 'testimonial_options',\n 'Testimonial Options',\n array ( $this , 'render_features_box'),\n 'testimonial',\n 'side',\n 'default'\n );\n /* Author email */\n /* approved [checkbox] */\n /* featured [checkbox] */\n }", "public function add_meta_boxes()\n \t{\n\n \t\t// Add this metabox to every selected post\n \t\tadd_meta_box( \n \t\t\tsprintf('WP_Custom_Login_Profile_%s_section', self::POST_TYPE),\n \t\t\tsprintf('%s Information', ucwords(str_replace(\"_\", \" \", self::POST_TYPE))),\n \t\t\tarray(&$this, 'add_inner_meta_boxes'),\n \t\t\tself::POST_TYPE\n \t );\t\n\n \t}", "function add_your_fields_meta_box(){\r\nadd_meta_box(\r\n'your_fields_meta_box',// $id\r\n'Auteur',// $title\r\n'show_your_fields_meta_box',// $callback\r\n'Livre',// $screen\r\n'normal',// $context\r\n'high'// $priority\r\n);\r\n}", "public function registerMetaBoxes()\n\t {\n\t \t$dataMetas = self::getDataMetas();\n\n\t \tif ( !empty($dataMetas) ) {\n\t \t\tforeach ($dataMetas as $key => $meta) {\n\t \t\t\t/* CHECK IF HAS PAGES */\n\t \t\t\tif ( isset($meta[\"_pages\"]) && !empty($meta[\"_pages\"][0]) ) {\n\t \t\t\t\tself::createMetasPages($meta);\n\t \t\t\t}\n\n\t \t\t\t/* POSTS TYPES REGISTER METAS */\n\t \t\t\tif ( isset($meta[\"_posts_types\"]) && !empty($meta[\"_posts_types\"][0]) ) {\n\t \t\t\t\tself::createMetasPostTypes($meta);\n\t \t\t\t}\n\n\t \t\t\t/* CHECK IF ALL POSTS IS true */\n\t \t\t\tif ( isset($meta[\"_all_posts\"]) && $meta['_all_posts'] == 'yes' ) {\n\t \t\t\t\tself::createMetasPosts($meta);\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\n\t }", "function wck_add_meta(){\n\t\tparent::wck_add_meta();\n\t}", "function pvplugin_add_meta_box() {\n\t\n\t$screens = array( 'policy' );\n\t\n\tforeach ( $screens as $screen ) {\n\t\n\t\tadd_meta_box(\n\t\t\t'myplugin_sectionid',\n\t\t\t__( 'Custom Meta Box', 'policy_library_plugin' ),\n\t\t\t array( &$this, 'pvplugin_meta_box_callback' ),\n\t\t\t$screen\n\t\t);\n\t\t\n\t\tadd_meta_box(\n\t\t\t'myplugin_side_sectionid',\n\t\t\t__( 'Policy Expire', 'policy_library_plugin' ),\n\t\t\t array( &$this, 'pvplugin_side_meta_box_callback' ),\n\t\t\t$screen,'side','high'\n\t\t);\n\t\t\n\t}\n\t}", "function add() {\n foreach ($this->_meta_box['pages'] as $page) {\n add_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']);\n }\n }", "function add() {\n foreach ($this->_meta_box['pages'] as $page) {\n add_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']);\n }\n }", "public function add_meta_boxes()\n \t{\n \t\t// Add this metabox to every selected post\n \t\tadd_meta_box( \n \t\t\tsprintf('wp_plugin_template_%s_section', self::POST_TYPE),\n \t\t\tsprintf('%s Information', ucwords(str_replace(\"_\", \" \", self::POST_TYPE))),\n \t\t\tarray($this, 'add_inner_meta_boxes'),\n \t\t\tself::POST_TYPE\n \t );\t\t\t\t\t\n \t}", "function fzproject_meta_box()\n{\n add_meta_box('fzproject_meta_box', 'New portfolio item', 'display_fzproject_meta_box', 'fzproject_post', 'normal', 'high');\n}", "public function register_meta() {\r\n\t\t\tforeach($this->customFields as $customField){\r\n\t\t\t\tadd_meta_box( 'ecf-'.$customField['name'], __( $customField['title'], 'exlist' ), $customField['callback'], $postTypes , 'advanced', 'high', $type = array($customField['name'], $customField['title'], $customField['type']) );\r\n\t\t\t}\r\n }", "public function setup_meta_box( $options ) {\n\t\t\n\t\t\t//add_meta_box\n\t\t\n\t\t}", "function load_meta_box(){\n\t\tadd_action('add_meta_boxes', array($this, 'meta_box_hook'));\n\t}", "public function add_meta_boxes() {\n add_meta_box( 'wc-product-label-gallery', __( 'Label gallery', 'wc-label-gallery' ), array( $this, 'gallery_output' ), 'product', 'side', 'low' );\n }", "function add_meta_box() {\n global $post;\n\n $post_types = get_post_types( array( 'public' => true ) );\n\n if ( !empty( $post ) ) {\n if ( $this->check_user_analytics_exist( $post ) ) {\n foreach ( $post_types as $post_type ) {\n add_meta_box( 'show_user_analytics', __( 'Post Author Analytics Info', 'wpuf-pro' ), array( $this, 'render_meta_box_content' ), $post_type, 'advanced', 'high' );\n }\n }\n }\n }", "function ilusix_my_custom_meta_box() {\n global $myMetaBoxPostTypes;\n\n foreach($myMetaBoxPostTypes as $postType) {\n add_meta_box(\n 'my_custom_meta_box_identifier' . '-' . $postType,\n 'Meta box title',\n 'ilusix_my_custom_meta_box_callback',\n $postType,\n 'normal',\n 'default'\n );\n }\n}", "function mmdyk_add_custom_box() {\n\n if( function_exists( 'add_meta_box' )) {\n add_meta_box( 'mmdyk_sectionid', __( 'Did You Know?', 'mmdyk_textdomain' ), \n 'mmdyk_inner_custom_box', 'post', 'advanced', 'high' );\n add_meta_box( 'mmdyk_sectionid', __( 'Did You Know?', 'mmdyk_textdomain' ), \n 'mmdyk_inner_custom_box', 'page', 'advanced', 'high' );\n }\n}", "function clix_uppe_add_meta_box() {\r\n\tif( function_exists('add_meta_box') ) {\r\n\t\tadd_meta_box( 'clix_uppe_meta_box', 'Clix Category Exclusion', 'clix_uppe_meta_box', post, 'side' );\r\n \t}\r\n}", "function add_meta_boxes() {\n\t\tif( function_exists( 'add_meta_box' ) ) {\n\t\t\tadd_meta_box( 'unit-info', __('Unit Information'), array( $this, '_display_unitinfo_meta'), 'units', 'normal', 'high');\n\t\t\tadd_meta_box( 'maps', __('Maps'), array( $this, '_display_maps_meta'), 'units', 'normal', 'high');\n\t\t\tadd_meta_box( 'gallery', __('Gallery'), array( $this, '_display_gallery_meta'), 'units', 'normal', 'low');\n\t\t\tadd_meta_box( 'unit-status', __('Availability'), array( $this, '_display_status_meta'), 'units', 'side', 'high');\n\t\t}\n\t}", "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 static function create_meta_box() {\n\t\t$content_types_array = self::_get_active_content_types();\n\t\tforeach ( $content_types_array as $content_type ) {\n\t\t\tadd_meta_box( 'custom-content-type-mgr-custom-fields'\n\t\t\t\t, __('Custom Fields', CCTM::txtdomain )\n\t\t\t\t, 'StandardizedCustomFields::print_custom_fields'\n\t\t\t\t, $content_type\n\t\t\t\t, 'normal'\n\t\t\t\t, 'high'\n\t\t\t\t, $content_type \n\t\t\t);\n\t\t}\n\t}", "function ev_gallery_add_box() {\n\tglobal $ev_gallery_metabox;\n\t\n\tadd_meta_box($ev_gallery_metabox['id'], $ev_gallery_metabox['title'], 'ev_gallery_show_box', $ev_gallery_metabox['page'], $ev_gallery_metabox['context'], $ev_gallery_metabox['priority']);\n}", "function myplugin_add_custom_box() {\n\t\t add_meta_box( \n\t\t 'myplugin_sectionid',\n\t\t __( 'My Post Section Title', 'myplugin_textdomain' ),\n\t\t 'myplugin_inner_custom_box',\n\t\t 'wpflexslider' \n\t\t );\n\t\t add_meta_box(\n\t\t 'myplugin_sectionid',\n\t\t __( 'My Post Section Title', 'myplugin_textdomain' ), \n\t\t 'myplugin_inner_custom_box',\n\t\t 'page'\n\t\t );\n\t\t add_meta_box('wpt_events_location', 'Event Location', 'wpt_events_location', 'events', 'side', 'default');\n\t\t}", "function kurama_custom_meta() {\n add_meta_box( 'kurama_meta', __( 'Display Options', 'kurama' ), 'kurama_meta_callback', 'page','side','high' );\n}", "function AP_Meta_Box_Setup() {\n\tadd_action('add_meta_boxes','AP_Meta_Box_Add');\n\n\tadd_action( 'save_post', 'AP_Meta_Box_Save', 10, 2 );\n}", "public function add_meta_boxes() {\n\t\t// Create the Slide Meta Boxes\n\t\tadd_meta_box( 'justart-slider-slide-settings-group', 'Slides', array( $this, 'create_slide_settings_meta_box' ), 'justart-slider', 'normal', 'default' );\n\t\tadd_filter( 'postbox_classes_justart-slider-slide-settings-group', array( $this, 'add_metabox_classes' ) );\n\t\t\n\t\t// Create the Shortcode Meta Box\n\t\tadd_meta_box( 'justart-slider-shortcode-group', 'Shortcode', array( $this, 'create_shortcode_meta_box' ), 'justart-slider', 'side', 'high' );\n\t\t\n\t\t// Create the Global Settings Meta Box\n\t\tadd_meta_box( 'justart-slider-global-settings-group', 'Global settings', array( $this, 'create_global_settings_meta_box' ), 'justart-slider', 'side', 'default' );\n\t}", "function create_meta_box() {\r\r\n global $key;\r\r\n\r\r\n if( function_exists( 'add_meta_box' ) ) {\r\r\n add_meta_box( 'new-page-boxes', ' Page Options', 'page_meta_boxes', 'page', 'normal', 'high' );\r\r\n add_meta_box( 'new-portfolio-boxes', ' Portfolio Options', 'portfolio_meta_boxes', 'portfolio', 'normal', 'high' );\r\r\n add_meta_box( 'new-slideshow-boxes', ' Slideshow Options', 'slideshow_meta_boxes', 'slideshow', 'normal', 'high' );\r\r\n add_meta_box( 'new-post-boxes', ' Post Options', 'post_meta_boxes', 'post', 'normal', 'high' );\r\r\n }\r\r\n}", "function caviar_add_meta_box() {\n\n\t$screens = array('page' );\n\n\tforeach ( $screens as $screen ) {\n\n\t\tadd_meta_box(\n\t\t\t'caviar_sectionid',\n\t\t\tesc_html__( 'Caviar Metabox Field Example', 'caviar_textdomain' ),\n\t\t\t'caviar_meta_box_callback',\n\t\t\t$screen\n\t\t);\n\n\t\tadd_meta_box(\n\t\t\t'caviar_2',\n\t\t\tesc_html__( 'Caviar Metabox 2', 'caviar_textdomain' ),\n\t\t\t'caviar_meta_box2_callback',\n\t\t\t$screen\n\t\t);\n\t}\n}", "function idem_pop_up_add_meta_box()\n{\n add_meta_box(\n 'idem-pop-up-meta-box', // id, used as the html id att\n __( 'Idem Pop Up' ), // meta box title, like \"Page Attributes\"\n 'idem_pop_up_meta_box_cb', // callback function, spits out the content\n 'page', // post type or page. We'll add this to pages only\n 'side', // context (where on the screen)\n 'high' // priority, where should this go in the context?\n );\n}", "function thmplt_carousel_slide_meta(){\r\n\tadd_meta_box(\"thmplt_carousel_meta_box1\", \"Slide Settings\", \"thmplt_carousel_slide_settings_html\", \"thmplt_carousel\", \"normal\", \"high\");\r\n\tadd_meta_box(\"thmplt_carousel_meta_box2\", \"Slide Images\", \"thmplt_carousel_slide_settings_html2\", \"thmplt_carousel\", \"normal\", \"high\");\r\n}", "public function add_meta_boxes() {\n\t\tadd_meta_box(\n\t\t\t$this->plugin_slug . '-post-metabox',\n\t\t\tesc_html__( 'Review Settings', $this->plugin_slug ),\n\t\t\tarray( $this, 'review_settings_view' ),\n\t\t\t'post',\n\t\t\t'normal',\n\t\t\t'core'\n \t \t);\n\t}", "static function add_custom_box() {\n\n // A meta box para os dados\n add_meta_box(\n 'agenda_data',\n 'Dados da Agenda',\n array( __CLASS__,'inner_custom_box_callback_function' ),\n 'agenda', // em que post type eles entram?\n 'side' // onde? side, normal, advanced\n //,'default' // 'high', 'core', 'default' or 'low'\n //,array('variáve' => 'valor') // variaveis que serão passadas para o callback\n );\n\n\n // A meta box que replica a taxonomia 'agenda_tipo', mas com radio buttons\n\t\tadd_meta_box(\n\t\t\t'agenda_tipo',\n\t\t\t_x( 'Tipo da Agenda', 'tipo do evento da agenda', 'panamazonica' ),\n\t\t\tarray( __CLASS__, 'agenda_tipo_callback_function' ),\n\t\t\t'agenda',\n\t\t\t'side',\n\t\t\t'core'\n\t\t);\n\n }", "function pg_add_custom_box() {\r\n\tif( function_exists( 'add_meta_box' )) {\r\n\t\tadd_meta_box( 'pg_custom_box_1', __( 'Edit Photocrati Galleries / Albums', 'photocrati' ), 'pg_inner_custom_box_1', 'page', 'normal', 'high' );\r\n\t\tadd_meta_box( 'pg_custom_box_2', __( 'Edit Photocrati Galleries / Albums', 'photocrati' ), 'pg_inner_custom_box_1', 'post', 'normal', 'high' );\r\n\t}\r\n}", "public function add_meta_box() {\n\t\tadd_meta_box(\n\t\t\t 'related_posts_meta_box'\n\t\t\t,__( 'Related Posts', self::LANG )\n\t\t\t,array( &$this, 'render_meta_box_content' )\n\t\t\t,'post'\n\t\t\t,'advanced'\n\t\t\t,'high'\n\t\t);\n\t}", "public function add_meta_boxes() {\n\t\t// init tooltips here since at this time the meta-box pre-registration is done,\n\t\t// we already know the current screen and the 'condition()' has been checked\n\t\t$this->init_tooltips();\n\n\t\t// Avoid appearance own meta fields on the standard Custom Fields metabox.\n\t\tadd_filter( 'is_protected_meta', array( $this, 'is_protected_meta' ), 10, 2 );\n\t}", "function add_actus_meta_box() {\n\tadd_meta_box(\n\t\t'fb_link', // $id\n\t\t'Lien Facebook', // $title\n\t\t'show_your_fields_meta_box', // $callback\n\t\t'actus', // $screen\n\t\t'normal', // $context\n\t\t'high' // $priority\n\t);\n}", "public function add_metabox() {\n\t\tadd_meta_box(\n\t\t\t'Word linkages',\n\t\t\t'Word linkages',\n\t\t\tarray(\n\t\t\t\t$this,\n\t\t\t\t'linkages_meta_box',\n\t\t\t),\n\t\t\t'questions',\n\t\t\t'side',\n\t\t\t'high'\n\t\t);\n\n\t\tadd_meta_box(\n\t\t\t'Answers',\n\t\t\t'Answers',\n\t\t\tarray(\n\t\t\t\t$this,\n\t\t\t\t'answers_meta_box',\n\t\t\t),\n\t\t\t'questions',\n\t\t\t'side',\n\t\t\t'high'\n\t\t);\n\t}", "function logo_meta_box() {\n add_meta_box(\n 'logo_meta_box', // $id\n 'Extras', // $title\n 'show_logo_meta_box', // $callback\n 'logo', // $logo\n 'normal', // $context\n 'high'); // $priority\n}", "function add_post_meta_box( ) {\n\t\t\tadd_meta_box('Course-Information', __( 'Course Information', $this->plugin_domain), array($this, 'setup_meta_english'), 'public-courses', 'normal', 'high');\n\t\t\tadd_meta_box('Arabic-Translations', __( 'Arabic Translations', $this->plugin_domain), array($this, 'setup_meta_translation'), 'public-courses', 'normal', 'high');\n\t\t\tadd_meta_box('Course-Dates', __( 'Course Dates', $this->plugin_domain), array($this, 'setup_meta_dates'), 'public-courses', 'normal', 'high');\n\t\t}", "public function meta_box_setup()\n {\n add_meta_box($this->token . '-data', __('Chiro Quiz Details', $this->token), [\n $this,\n 'meta_box_content'\n ], $this->token, 'normal', 'high');\n\n do_action($this->token . '_meta_boxes');\n }", "function wck_settings_page_add_meta_boxes() {\r\n global $post;\r\n\t\tdo_action( 'add_meta_boxes', $this->hookname, $post );\r\n\t}", "function add_meta_box($id, $title, $callback, $screen = \\null, $context = 'advanced', $priority = 'default', $callback_args = \\null)\n {\n }", "public function addMetaboxes() {}", "public function add_meta_boxes() {\n\t\tglobal $current_screen;\n\n\t\t$page_main = $this->_admin_pages[ 'vfb-pro' ];\n\n\t\tif ( $current_screen->id == $page_main && isset( $_REQUEST['form'] ) ) {\n\t\t\tadd_meta_box( 'vfb_form_switcher', __( 'Quick Switch', 'visual-form-builder-pro' ), array( &$this, 'meta_box_switch_form' ), $page_main, 'side', 'high' );\n\t\t\tadd_meta_box( 'vfb_form_items_meta_box', __( 'Form Items', 'visual-form-builder-pro' ), array( &$this, 'meta_box_form_items' ), $page_main, 'side', 'high' );\n\t\t\tadd_meta_box( 'vfb_form_media_button_tip', __( 'Display Forms', 'visual-form-builder-pro' ), array( &$this, 'meta_box_display_forms' ), $page_main, 'side', 'low' );\n\t\t}\n\t}", "function __construct() {\n $this->add_meta_box();\n }", "function add_adrotate_meta_box_to_page(){\n\t\tadd_meta_box(\"page_adrotate_block-meta\",\"AdRotate Block\",\"page_adrotate_block\",\"page\",\"side\",\"high\");\n\t\tadd_meta_box(\"page_adrotate_block-meta\",\"AdRotate Block\",\"page_adrotate_block\",\"social_conference\",\"side\",\"high\");\n\t\tadd_meta_box(\"page_adrotate_block-meta\",\"AdRotate Block\",\"page_adrotate_block\",\"social_exhibition\",\"side\",\"high\");\n\t}", "function add_meta_box() {\n\t\t \tadd_meta_box( 'woocommerce-product-addons', __('Product Add-ons', 'wc_product_addons'), array(&$this, 'meta_box'), 'product', 'side', 'default' );\n\t\t }", "function idem_pop_up_inner_add_meta_box()\n{\n add_meta_box(\n 'idem-pop-up-inner-meta-box', // id, used as the html id att\n __( 'Idem Pop Up Inner Meta Box' ), // meta box title, like \"Page Attributes\"\n 'idem_pop_up_inner_meta_box_cb', // callback function, spits out the content\n 'idem_pop_up', // post type or page. We'll add this to pages only\n 'side', // context (where on the screen)\n 'low' // priority, where should this go in the context?\n );\n}", "public function add_meta_boxes() {\n\t\t\t// Address\n\t\t\tadd_meta_box(\n\t\t\t\t'wpmeetup_address', \n\t\t\t\t'Adresse',\n\t\t\t\tarray( $this, 'meta_box_address' ),\n\t\t\t\t'wpmeetups', 'side', 'default'\n\t\t\t);\n\t\t\t\n\t\t\t// Location\n\t\t\tadd_meta_box(\n\t\t\t\t'wpmeetup_location', \n\t\t\t\t'Location',\n\t\t\t\tarray( $this, 'meta_box_location' ),\n\t\t\t\t'wpmeetups', 'side', 'default'\n\t\t\t);\n\t\t\t\n\t\t\t// Geodata\n\t\t\tadd_meta_box(\n\t\t\t\t'wpmeetup_geodata', \n\t\t\t\t'Geodaten',\n\t\t\t\tarray( $this, 'meta_box_geodata' ),\n\t\t\t\t'wpmeetups', 'side', 'default'\n\t\t\t);\n\t\t\t\n\t\t\t// Date\n\t\t\tadd_meta_box(\n\t\t\t\t'wpmeetup_dates', \n\t\t\t\t'Datum und Zeit der Meetups',\n\t\t\t\tarray( $this, 'meta_box_date' ),\n\t\t\t\t'wpmeetups', 'advanced', 'default'\n\t\t\t);\n\t\t\t\n\t\t\t// Gallery\n\t\t\tadd_meta_box(\n\t\t\t\t'meetup_gallery',\n\t\t\t\t'Gallerie',\n\t\t\t\tarray( $this, 'meta_box_gallery' ),\n\t\t\t\t'wpmeetups', 'advanced', 'default'\n\t\t\t);\n\t\t}", "function clonemaker_add_meta_box(){\r\n add_meta_box(\r\n 'clonemaker',\r\n 'Clone a Page',\r\n 'add_post_list',\r\n 'page',\r\n 'side'\r\n );\r\n\r\n\r\n}", "function mobile_kiosk_add_post_meta_boxes() {\n\t\n\t// Gallery Options\n\tadd_meta_box(\n\t\t'gallery-options',\n\t\tesc_html__( 'Gallery Options', 'gallery-options' ),\n\t\t'mobile_kiosk_gallery_options_meta_box', \n\t\t'kioskgallery', \n\t\t'normal', \n\t\t'high' \n\t);\n\t\n\t// Gallery Slides\n\tadd_meta_box(\n\t\t'gallery-slides',\n\t\tesc_html__( 'Gallery Slides', 'gallery-slides' ),\n\t\t'mobile_kiosk_gallery_slides_meta_box', \n\t\t'kioskgallery', \n\t\t'normal', \n\t\t'low' \n\t);\n\t\n}", "function cnew_custom_metabox_add() {\r\n add_meta_box(\r\n 'cnew_custom_metabox_workshop', \r\n __( 'Informações da Oficina', 'cnew' ), \r\n 'cnew_workshop_custom_metabox_callback', \r\n 'cnew_workshop', \r\n 'normal',\r\n 'high'\r\n );\r\n\r\n add_meta_box(\r\n 'cnew_custom_metabox_registration', \r\n __( 'Formulário de Inscrição', 'cnew' ), \r\n 'cnew_registration_custom_metabox_callback', \r\n 'cnew_registration', \r\n 'normal',\r\n 'high'\r\n );\r\n }", "public function add_metabox() {\n\t\tadd_meta_box(\n\t\t\t'Translation',\n\t\t\t'Translation',\n\t\t\tarray(\n\t\t\t\t$this,\n\t\t\t\t'meta_box',\n\t\t\t),\n\t\t\t'words',\n\t\t\t'side',\n\t\t\t'high'\n\t\t);\n\t}", "public function amazon_identifier_add_meta_box() {\n\t\tadd_meta_box(\n\t\t\t'amazon-identifier-post-class', \t\t\t\t\t\t// Unique ID\n\t\t\tesc_html__( 'Amazon Identifier', 'amazon_identifier' ), // Title\n\t\t\tarray( $this, 'amazon_identifier_meta_box' ), // Callback function\n\t\t\t'tribe_events', \t\t\t\t\t\t// Admin page (or post type)\n\t\t\t'side', \t\t\t\t\t\t\t\t// Context\n\t\t\t'default' \t\t\t\t\t\t\t\t// Priority\n\t\t);\n\n\t\tadd_meta_box(\n\t\t\t'amazon-product-image-url-post-class', \t\t\t\t\t\t// Unique ID\n\t\t\tesc_html__( 'Amazon Product Image URL', 'amazon_product_image_url' ), // Title\n\t\t\tarray( $this, 'amazon_product_image_url_meta_box' ), // Callback function\n\t\t\t'tribe_events', \t\t\t\t\t\t// Admin page (or post type)\n\t\t\t'side', \t\t\t\t\t\t\t\t// Context\n\t\t\t'default' \t\t\t\t\t\t\t\t// Priority\n\t\t);\n\t}", "function create_meta_box() {\n\n\tglobal $postmetas;\n\t\n\tif(!isset($_GET['post_type']) OR empty($_GET['post_type']))\n\t{\n\t\tif(isset($_GET['post']) && !empty($_GET['post']))\n\t\t{\n\t\t\t$post_obj = get_post($_GET['post']);\n\t\t\t$_GET['post_type'] = $post_obj->post_type;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_GET['post_type'] = 'post';\n\t\t}\n\t}\n\t\n\tif ( function_exists('add_meta_box') && isset($postmetas) && count($postmetas) > 0 ) { \n\t\tforeach($postmetas as $key => $postmeta)\n\t\t{\n\t\t\tif($_GET['post_type']==$key)\n\t\t\t{\n\t\t\t\tadd_meta_box( 'metabox', ucfirst($key).' Options', 'new_meta_box', $key, 'side', 'high' ); \n\t\t\t}\n\t\t}\n\t}\n\n}", "function bnk_create_slide_metabox() {\r\n\tglobal $slide_meta;\r\n \r\n\tadd_meta_box($slide_meta['id'], $slide_meta['title'], 'bnk_build_slide_metabox', $slide_meta['page'], $slide_meta['context'], $slide_meta['priority']);\r\n}", "public function add_meta_box(){\n\t\t\n\t\t/**\n\t\t * Includes our array of post types\n\t\t */\n\t\tinclude( 'q-and-a-post-types.php' );\n\t\t\n\t\tforeach ( $q_and_a_post_types as $post_type ) {\n\t\t\tadd_meta_box(\n\t\t\t\t'q-and-a',\n\t\t\t\t'Questions and Answers',\n\t\t\t\tarray( $this, 'display_meta_box' ),\n\t\t\t\t$post_type, \n\t\t\t\t'normal',\n\t\t\t\t'default'\n\t\t\t);\n\t\t}\n\t}", "function scalia_slides_register_meta_box($post) {\r\r\n\tremove_meta_box('postimagediv', 'scalia_slide', 'side');\r\r\n\tadd_meta_box('postimagediv', __('Slide Image', 'scalia'), 'post_thumbnail_meta_box', 'scalia_slide', 'normal', 'high');\r\r\n\tadd_meta_box('scalia_slide_settings', __('Slide Settings', 'scalia'), 'scalia_slide_settings_box', 'scalia_slide', 'normal', 'high');\r\r\n}", "public static function add_metaboxes(){}", "function tower_register_meta_boxes() {\n foreach (TOWER_CUSTOM_POSTS as $key => $custom_type) {\n $meta = $custom_type['meta'];\n add_meta_box(\n $meta['handle'],\n $meta['title'],\n $meta['callback'],\n $key\n );\n }\n}", "public function register_meta_box( $post ) {\n\t\tadd_meta_box(\n\t\t\t$this->meta_box['id'],\n\t\t\t$this->meta_box['title'],\n\t\t\t[$this, 'render_meta_box'],\n\t\t\t$this->post_type,\n\t\t\t$this->meta_box['context'],\n\t\t\t$this->meta_box['priority']\n\t\t);\n\t}", "function testimonials_meta_boxes() {\n\tadd_meta_box( 'testimonials_form', 'testimonials', 'normal', 'high' );\n}", "public function video_meta_boxes() {\n add_meta_box(\n 'metainfo',\n 'Meta Information',\n array($this, 'video_meta_information'),\n 'video',\n 'normal',\n 'high'\n );\n add_meta_box(\n 'featured_image_help',\n 'Note',\n array($this, 'video_featured_image_help'),\n 'video',\n 'side',\n 'low'\n );\n }", "public function add_metabox() {\r\n\t\tadd_meta_box(\r\n\t\t\t'stats', // ID\r\n\t\t\t'Stats', // Title\r\n\t\t\tarray(\r\n\t\t\t\t$this,\r\n\t\t\t\t'meta_box', // Callback to method to display HTML\r\n\t\t\t),\r\n\t\t\t'spam-stats', // Post type\r\n\t\t\t'normal', // Context, choose between 'normal', 'advanced', or 'side'\r\n\t\t\t'core' // Position, choose between 'high', 'core', 'default' or 'low'\r\n\t\t);\r\n\t}", "function sample_add_metabox() {\n\tadd_meta_box(\n\t\t'post-notes',\n\t\t__( 'Post Notes', 'textdomain' ),\n\t\t'sample_render_metabox',\n\t\t'post',\n\t\t'normal',\n\t\t'default'\n\t);\n}", "function add_guide_meta_box( $post ) {\n\tadd_meta_box(\n\t\t'api_data_meta_box',\n\t\t__( 'Data from LibGuides' ),\n\t\t__NAMESPACE__ . '\\\\render_guide_data_metabox',\n\t\t'guide',\n\t\t'normal',\n\t\t'high'\n\t);\n}", "public function add_order_meta_box() {\n\t\t\\add_meta_box(\n\t\t\t'bwcpp_profile_picture_box',\n\t\t\t__( 'Profile Picture', 'bwcpp' ),\n\t\t\tarray( $this, 'render_order_meta_box' ),\n\t\t\t'shop_order',\n\t\t\t'side',\n\t\t\t'default'\n\t\t);\n\t}", "public function add_meta() {\n\t\techo \"\\n<meta data-plugin='a04_vertical_button' name='description' content='a sample meta description for this website'/>\\n\\n\";\n\t}" ]
[ "0.83178455", "0.8289685", "0.82773095", "0.8273988", "0.8214805", "0.8178996", "0.8177539", "0.8156304", "0.81465673", "0.8138356", "0.81079465", "0.8104405", "0.8098265", "0.80884737", "0.8065247", "0.8029458", "0.8023977", "0.79432344", "0.79183185", "0.79106617", "0.79069465", "0.78991914", "0.7806743", "0.7798436", "0.7787327", "0.77705723", "0.7723183", "0.77219075", "0.7706891", "0.76963985", "0.7692436", "0.76581264", "0.76381487", "0.7621941", "0.76013774", "0.7597793", "0.75971645", "0.7594945", "0.759014", "0.759014", "0.7580097", "0.75781953", "0.75678784", "0.7567775", "0.75560987", "0.7554766", "0.75538194", "0.75518197", "0.75490195", "0.7540064", "0.75398076", "0.75396115", "0.75390977", "0.7536249", "0.7518616", "0.7508173", "0.75043523", "0.7503102", "0.7502749", "0.74958616", "0.74950856", "0.7490725", "0.74869263", "0.7484999", "0.748378", "0.7468467", "0.744316", "0.74311656", "0.7430681", "0.7425632", "0.7417242", "0.7412057", "0.7409945", "0.74022865", "0.73924166", "0.73821574", "0.7372858", "0.7367109", "0.7365405", "0.7364675", "0.73444396", "0.734438", "0.73439807", "0.7343631", "0.73336095", "0.73327637", "0.7330271", "0.7300011", "0.729807", "0.7294901", "0.7276989", "0.7276535", "0.7274487", "0.7273512", "0.72727406", "0.7265558", "0.7264195", "0.72614646", "0.72558016", "0.7241818" ]
0.7725593
26
Register admin scripts for custom fields
function pz_load_wp_admin_style() { wp_enqueue_media(); wp_enqueue_script('media-upload'); wp_enqueue_style('pz_admin_css', get_template_directory_uri() . '/pz_admin.css'); wp_enqueue_script('pz_admin_script', get_template_directory_uri() . '/pz_admin.js'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function admin_init() {\r\n register_setting($this->optionsName, $this->optionsName);\r\n wp_register_style('custom-page-extensions-admin-css', $this->pluginURL . '/includes/custom-page-extensions-admin.css');\r\n wp_register_script('custom-page-extensions-js', $this->pluginURL . '/js/custom-page-extensions.js');\r\n }", "function registerScripts() {\n\t\t//Comments custom column hook, for grade\n\t\tif($this->checkPermissions()) {\n\t\t\tadd_filter('manage_edit-comments_columns', array(&$this, 'addCommentsCustomColumn'), 10);\n\t\t\tadd_action('manage_comments_custom_column', array(&$this, 'manageCommentsCustomColumn'), 10, 2);\n\t\t}\n \twp_register_script('lepress-student-functions', lepress_http_abspath.'js/admin_functions-student.js');\n \twp_enqueue_script('lepress-student-functions');\n \tadd_settings_section('lepress-student-refresh', '', array(&$this, 'refreshIntervalHeader'), 'lepress');\n \tadd_settings_field('lepress-student-course-refresh', __(\"Courses\", lepress_textdomain), array(&$this, 'addRefreshTimeField'), 'lepress', 'lepress-student-refresh', 'courseRefreshTime');\n \tadd_settings_field('lepress-student-classmates-refresh', __(\"Classmates\", lepress_textdomain), array(&$this, 'addRefreshTimeField'), 'lepress', 'lepress-student-refresh', 'classmatesRefreshTime');\n \tadd_settings_field('lepress-student-assignments-refresh', __(\"Assignments\", lepress_textdomain), array(&$this, 'addRefreshTimeField'), 'lepress', 'lepress-student-refresh', 'assignmentsRefreshTime');\n \t\n\t}", "public function setup_admin_scripts() {\n\n\t\t$asset_path = apply_filters( 'pr_cmb2_image_select_asset_path', plugins_url( '', __FILE__ ) );\n\n\t\tif (is_admin()) {\n\n wp_register_style( 'cmb2_imgselect-css', $asset_path . '/css/image_select_metafield.css', array(), '1.0.0' );\n\t\twp_enqueue_style( 'cmb2_imgselect-css', $asset_path . '/css/image_select_metafield.css', array(), self::VERSION ); // CMB2 Image_select Field Styling\n\n wp_register_script( 'cmb2_imgselect-js', $asset_path . '/js/image_select_metafield.js', array(), '1.0.0' );\n\t\twp_enqueue_script( 'cmb2_imgselect-js', $asset_path . '/js/image_select_metafield.js', array( 'cmb2-scripts' ), self::VERSION ); // CMB2 Image_select Event\n\n\t\t}\n\t}", "public function registerScriptsAdmin() {\n $v = Wpjb_Project::VERSION;\n $p = plugins_url().'/wpjobboard/public/js/';\n $x = plugins_url().'/wpjobboard/application/vendor/';\n \n //wp_register_script(\"wpjb-color-picker\", $p.\"jquery.colorPicker.js\" );\n wp_register_script(\"wpjb-color-picker\", $p.\"colorpicker.js\" );\n wp_register_script(\"wpjb-admin\", $p.\"admin.js\", array(\"jquery\"), $v);\n wp_register_script(\"wpjb-admin-job\", $p.\"admin-job.js\", array(\"jquery\", \"wpjb-suggest\", \"wpjb-vendor-datepicker\"), $v);\n wp_register_script(\"wpjb-admin-resume\", $p.\"admin-resume.js\", array(\"jquery\"), $v);\n wp_register_script(\"wpjb-admin-config-email\", $p.\"admin-config-email.js\", array(\"jquery\", \"jquery-ui-dialog\"), $v);\n wp_register_script(\"wpjb-admin-config-email-composer\", $p.\"admin-config-email-composer.js\", array(\"jquery\", \"iris\"), $v);\n wp_register_script(\"wpjb-admin-google-for-jobs\", $p.\"admin-google-for-jobs.js\", array(\"jquery\", \"wpjb-ace\", \"jquery-ui-dialog\", \"jquery-ui-sortable\", \"wp-util\"), $v);\n wp_register_script(\"wpjb-admin-medialibrary\", $p.\"admin-medialibrary.js\", array(\"jquery\", \"media-upload\"), $v);\n wp_register_script(\"wpjb-admin-config-email-editor\", $p.\"admin-config-email-editor.js\", array(\"jquery\", \"wpjb-ace\", \"jquery-ui-dialog\"), $v);\n wp_register_script(\"wpjb-admin-config-urls\", $p.\"admin-config-urls.js\", array(\"jquery\"), $v);\n wp_register_script(\"wpjb-admin-export\", $p.\"admin-export.js\", array(\"jquery\"), $v);\n wp_register_script(\"wpjb-admin-import\", $p.\"admin-import.js\", array(\"jquery\", \"wpjb-plupload\"));\n wp_register_script(\"wpjb-admin-apps\", $p.\"admin-apps.js\", array(\"jquery\"), $v, true);\n wp_register_script(\"wpjb-vendor-ve\", $x.\"visual-editor/visual-editor.js\", array(\"jquery\"));\n wp_register_script(\"wpjb-multi-level-accordion-menu\", $p.\"multi-level-accordion-menu.js\", array(\"jquery\"), $v);\n wp_register_script(\"wpjb-admin-user-register\", $p.\"admin-user-register.js\", array(\"jquery-ui-autocomplete\", \"jquery\"), $v);\n wp_register_script(\"wpjb-admin-alert\", $p.\"admin-alert.js\", array(\"jquery\", \"wp-util\"), $v);\n\n }", "public function admin_init() {\n\n\t\t\t$name = $this->options['slug'];\n\t\t\t$this->slug = strtolower(THEME_NAME.'_'.$name);\n\t\t\n\t\t\tadd_option($this->slug.'_fields', '', '', 'yes');\n\t\t\tupdate_option($this->slug.'_fields', $this->options['options']);\n\n\t\t\tadd_action('post_edit_form_tag', array($this, 'set_form_multipart'), 10, 1);\n\t\t\tadd_action('add_meta_boxes'.'_'.$this->screen, array($this, 'register_meta_box'));\n\t\t}", "function register_admin_scripts_and_styles() {\n\t\t\n\t}", "private function dc_define_admin_hooks() {\n\n\t\t$plugin_admin = new Dorancafe_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'dc_enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'dc_enqueue_scripts' );\n\n\t}", "function load_custom_wp_admin_files()\n{\n wp_enqueue_script('child-admin.js', get_stylesheet_directory_uri() . '/js/divi-admin.js', array('jquery'), true);\n wp_enqueue_style('child-admin.css', get_stylesheet_directory_uri() . '/admin.css', false, null);\n}", "private function define_admin_hooks() {\n\t\t$plugin_admin = new MySuperCalendar_Admin( $this->get_plugin_name() );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\t\t$this->loader->add_action( 'init', $plugin_admin, 'register_Calendar_post_type' );\n\t\t$this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'add_datepicker_meta_box' );\n\t\t$this->loader->add_action( 'save_post', $plugin_admin, 'save_calendar_post' );\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'register_plugin_menu_page' );\n\n\n\t}", "public function addScriptsAdmin($hook) \n\t\t{\n\t\t\twp_enqueue_style( 'ccs-multiple-select', plugin_dir_url( __FILE__ ) . 'inc/multiple-select/css/multi-select.css');\n\t\t\twp_enqueue_style( 'css-admin', plugin_dir_url( __FILE__ ) . 'css/metas-admin.css');\n\t\t\twp_enqueue_script( 'js-multiple-select', plugin_dir_url( __FILE__ ) . 'inc/multiple-select/js/jquery.multi-select.js', array('jquery'), '1.0.0', true );\n\t\t\twp_enqueue_script( 'add_scripts_admin', plugin_dir_url( __FILE__ ) . 'js/metas-admin.js', array('jquery','jquery-ui-sortable'), '1.0.0', true );\n\n\t\t\t$data['ajax_url'] = admin_url('admin-ajax.php' );\n\t\t\twp_localize_script( 'add_scripts_admin', 'variables', $data );\n\t\t}", "public function register_admin_scripts() {\n\t\t$scripts = array(\n\t\t\t'mpress-admin' => array(\n\t\t\t\t'src' => Utilities::uri( 'scripts/dist/mpress.admin.min.js' ),\n\t\t\t\t'deps' => array( 'jquery' ),\n\t\t\t\t'ver' => '1.0.0',\n\t\t\t\t'footer' => true,\n\t\t\t\t'localize' => true,\n\t\t\t),\n\t\t);\n\t\t// Normalize scripts\n\t\t$scripts = $this->normalize_scripts( $scripts, 'mpress_admin_scripts' );\n\t\t// Register Scripts\n\t\t$this->register_scripts( $scripts );\n\t}", "function register_meta_script(){\r\n\t\tglobal $post_type;\r\n\t\t\r\n\t\twp_enqueue_style('bootstrap', CP_PATH_URL.'/framework/stylesheet/bootstrap.css');\r\n\t\twp_enqueue_style('thickbox');\r\n\t\t\r\n\t\t//Font Awesome\r\n\t\twp_enqueue_style('cp-fontAW',CP_PATH_URL.'/frontend/cp_font/css/font-awesome.css');\r\n\t\twp_enqueue_style('cp-fontAW',CP_PATH_URL.'/frontend/cp_font/css/font-awesome-ie7.css');\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\twp_enqueue_style('admin-css',CP_PATH_URL.'/framework/stylesheet/admin-css.css');\r\n\t\t\r\n\t\t// register style and script when access to the \"page\" post_type page\r\n\t\tif( $post_type == 'page' ){\r\n\t\t\r\n\t\t\twp_enqueue_style('meta-css',CP_PATH_URL.'/framework/stylesheet/meta-css.css');\r\n\t\t\twp_enqueue_style('page-dragging',CP_PATH_URL.'/framework/stylesheet/page-dragging.css');\r\n\t\t\twp_enqueue_style('image-picker',CP_PATH_URL.'/framework/stylesheet/image-picker.css');\r\n\t\t\t\r\n\t\t\twp_register_script('image-picker', CP_PATH_URL.'/framework/javascript/image-picker.js', false, '1.0', true);\r\n\t\t\twp_enqueue_script('image-picker');\r\n\t\t\r\n\t\t\twp_register_script('page-dragging', CP_PATH_URL.'/framework/javascript/page-dragging.js', false, '1.0', true);\r\n\t\t\twp_enqueue_script('page-dragging');\r\n\t\t\t\r\n\t\t\twp_register_script('edit-box', CP_PATH_URL.'/framework/javascript/edit-box.js', false, '1.0', true);\r\n\t\t\twp_enqueue_script('edit-box');\r\n\t\t\t\r\n\t\t\twp_register_script('confirm-dialog', CP_PATH_URL.'/framework/javascript/jquery.confirm.js', false, '1.0', true);\r\n\t\t\twp_enqueue_script('confirm-dialog');\r\n\t\t\t\r\n\t\t\t\r\n\t\t// register style and script when access to the \"post\" post_type page\r\n\t\t}else if( $post_type == 'event' || $post_type == 'post' || $post_type == 'team' || $post_type == 'portfolio' || $post_type == 'cp_slider' || $post_type == 'gallery' || $post_type == 'product' ){\r\n\t\t\r\n\t\t\twp_deregister_style('admin-css');\r\n\t\t\twp_enqueue_style('meta-css',CP_PATH_URL.'/framework/stylesheet/meta-css.css');\r\n\t\t\twp_enqueue_style('image-picker',CP_PATH_URL.'/framework/stylesheet/image-picker.css');\r\n\t\t\twp_enqueue_style('confirm-dialog',CP_PATH_URL.'/framework/stylesheet/jquery.confirm.css');\r\n\t\t\t\r\n\t\t\twp_register_script('post-effects', CP_PATH_URL.'/framework/javascript/post-effects.js', false, '1.0', true);\r\n\t\t\twp_enqueue_script('post-effects');\r\n\t\t\t\r\n\t\t\twp_register_script('image-picker', CP_PATH_URL.'/framework/javascript/image-picker.js', false, '1.0', true);\r\n\t\t\twp_localize_script('image-picker', 'URL', array('crunchpress' => CP_PATH_URL ));\r\n\t\t\twp_enqueue_script('image-picker');\r\n\t\t\t\r\n\t\t\twp_register_script('confirm-dialog', CP_PATH_URL.'/framework/javascript/jquery.confirm.js', false, '1.0', true);\r\n\t\t\twp_enqueue_script('confirm-dialog');\r\n\t\t\r\n\t\t// register style and script when access to the \"testimonial\" post_type page\t\t\r\n\t\t}else if( $post_type == 'testimonial' ){\r\n\t\t\r\n\t\t\twp_enqueue_style('meta-css',CP_PATH_URL.'/framework/stylesheet/meta-css.css');\r\n\t\t\r\n\t\t}else if($post_type == 'albums'){\r\n\t\t\r\n\t\t\twp_register_script('contact-validation', CP_PATH_URL.'/frontend/js/jquery.validate.js', false, '1.0', true);\r\n\t\t\twp_enqueue_script('contact-validation');\r\n\t\t}\r\n\t\t\r\n\t}", "function admin() {\n \n add_action( 'genesis_theme_settings_metaboxes', array( $this, 'register_metabox' ) );\n add_filter( 'cmb_meta_boxes', array( $this, 'create_metaboxes' ) );\n add_action( 'init', array( $this, 'initialize_cmb_meta_boxes' ), 50 );\n \n }", "function create_custom_fields() {\n // Get all components to be listed\n $this->get_components();\n // Add components meta box\n if ( function_exists( 'add_meta_box' ) ) {\n foreach ( $this->postTypes as $postType ) {\n add_meta_box( 'wpnext', 'WPNext Builder', array( &$this, 'display_custom_fields' ), $postType, 'normal', 'high' );\n }\n }\n }", "public function register_admin_scripts() {\n if ( defined( 'NINJA_FORMS_JS_DEBUG' ) && NINJA_FORMS_JS_DEBUG ) {\n $suffix = '';\n $src = 'dev';\n } else {\n $suffix = '.min';\n $src = 'min';\n }\n\n wp_register_script( 'nf-admin-modal',\n NF_PLUGIN_URL . 'assets/js/' . $src . '/admin-modal' . $suffix . '.js',\n array( 'jquery', 'jquery-ui-core' ) );\n\n }", "function wds_bb_custom_field_hook() {\n\tif ( ! class_exists( 'FLBuilder' ) ) {\n\t\treturn;\n\t}\n\n\t$plugin = wds_bb_custom_field_plugin();\n\t$plugin->register_hooks();\n}", "public function admin_init()\n \t{\t\t\t\n \t\t// Add metaboxes\n \t\tadd_action('add_meta_boxes', array($this, 'add_meta_boxes'));\n\t\t\t\n\t\t\t// Add scripts\n\t\t\tadd_action( 'admin_enqueue_scripts', array($this, 'prfx_image_enqueue'));\n \t}", "function input_admin_enqueue_scripts() {\n\n\t\t$dir = plugin_dir_url( __FILE__ );\n\n\t\t// register & include JS\n//\t\twp_register_script( 'acf-address-render-field', \"{$dir}js/render_field.js\" );\n\t\twp_register_script( 'acf-address-render-field', \"{$dir}js/min/render_field-min.js\" );\n\t\twp_enqueue_script( 'acf-address-render-field' );\n\n\t\t// Adicionando o script personalizado para PT-BR\n\t\twp_register_script( 'acf-address-pt-br', \"{$dir}js/pt-br.js\" );\n\t\twp_enqueue_script( 'acf-address-pt-br' );\n\n\n\n\t\t// register & include CSS\n\t\twp_register_style( 'acf-input-address', \"{$dir}css/render_field.css\" );\n\t\twp_enqueue_style( 'acf-input-address' );\n\n\t}", "public function setup_admin_scripts() {\n wp_register_script( 'cmb-advanced-file-list-js', plugins_url( 'js/advanced-file-list.js', __FILE__ ), array( 'jquery' ), self::VERSION, true );\n wp_enqueue_script( 'cmb-advanced-file-list-js' );\n\n wp_enqueue_style( 'cmb-advanced-file-list-css', plugins_url( 'css/advanced-file-list.css', __FILE__ ), array(), self::VERSION );\n }", "public function enqueue_scripts()\n\t{\n\t\twp_enqueue_script( 'orghub-upload-extended-data', ORGANIZATION_HUB_PLUGIN_URL.'/admin-pages/scripts/upload-extended-data.js' );\t\t\n\t}", "function derefe_admin_init(){\n\t// add_action( 'add_meta_boxes', string $post_type, WP_Post $post )\n\n\t// The hook will only run when editing a specific post type. \n\t// add_action( \"add_meta_boxes_{$post_type}\", WP_Post $post )\n\n\tadd_action( 'add_meta_boxes_cus_pot_type', 'derefe_create_metaboxes');\n\tinclude( 'create_metaboxes.php');\n\tinclude( 'custom-post-type-options.php');\n\n}", "public function admin_scripts() {\n global $wp_query, $post;\n\n $screen = get_current_screen();\n $screen_id = $screen ? $screen->id : '';\n\n // Meta boxes\n if ( in_array( $screen_id, array( 'product', 'edit-product' ) ) ) {\n\n wp_enqueue_style( 'wc-admin-label-meta-box', $this->plugin_url() . '/assets/css/label-metabox.css', array( 'woocommerce_admin_styles' ) );\n wp_enqueue_media();\n wp_enqueue_script( 'wc-admin-label-meta-box', $this->plugin_url() . '/assets/js/label-metabox.js', array( 'wc-admin-product-meta-boxes', 'media-models' ) );\n\n $params = array(\n 'post_id' => isset( $post->ID ) ? $post->ID : '',\n 'plugin_url' => WC()->plugin_url(),\n 'ajax_url' => admin_url( 'admin-ajax.php' ),\n 'woocommerce_placeholder_img_src' => wc_placeholder_img_src(),\n 'i18n_choose_image' => esc_js( __( 'Choose an image', 'wc-label-gallery' ) ),\n );\n\n wp_localize_script( 'wc-admin-label-meta-box', 'wc_admin_label_meta_box', $params );\n }\n\n }", "function add_admin_scripts() {\n\t\tglobal $post;\n\t\t$post_type = $post->post_type;\n\t\tif ( 'product' == $post_type ) {\n\t\t\twp_enqueue_script(\n 'heweb17-admin',\n plugins_url( '/js/heweb17-admin.js', __FILE__ ),\n array( 'jquery' ) );\n\t\t}\n\t}", "public function loadMetaScripts(){\n global $post;\n add_action( 'admin_head', array( $this, 'simpulMetaUpload' ), 11);\n if( $post->post_type == $this->post_type || $_GET['post_type'] == $this->post_type ): //These scripts interfere with regular post insertion =(\n add_action( 'admin_print_scripts', array( $this, 'registerScripts' ) );\n \n add_action( 'admin_print_styles' , array( $this, 'registerStyles' ) );\n endif;\n }", "function petrica_custom_wp_admin_style_and_js_scripts() {\n wp_register_style( 'custom_wp_admin_css', plugin_dir_url(dirname( __FILE__ )) . 'css/style.css', false, '1.0.0' );\n wp_enqueue_style( 'custom_wp_admin_css' );\n wp_enqueue_script( 'script-name', plugin_dir_url(dirname( __FILE__ )) . '/js/petrica-plugin.js', array(), '1.0.0', true );\n }", "public function register_meta() {\r\n\t\t\tforeach($this->customFields as $customField){\r\n\t\t\t\tadd_meta_box( 'ecf-'.$customField['name'], __( $customField['title'], 'exlist' ), $customField['callback'], $postTypes , 'advanced', 'high', $type = array($customField['name'], $customField['title'], $customField['type']) );\r\n\t\t\t}\r\n }", "public function register_scripts()\n {\n }", "protected function getScripts() { \n\n $aJSArray = json_encode( $this->aFieldTypeSlugs );\n /* \n * The below function will be triggered when a new repeatable field is added. \n * \n * Use the registerAPFCallback method to register a callback.\n * Available callbacks are:\n * added_repeatable_field - triggered when a repeatable field gets repeated. Parameters 1. (object) the jQuery element object. 2. (string) the field type slug. 3. (string) the field tag id.\n * removed_repeatable_field - triggered when a repeatable field gets removed. Parameters 1. (object) the jQuery element object. 2. (string) the field type slug. 3. (string) the field tag id.\n * sorted_fields - triggered when a sortable field gets sorted. Parameters 1. (object) the jQuery element object. 2. (string) the field type slug. 3. (string) the field tag id.\n * */\n return \"\n jQuery( document ).ready( function(){\n jQuery().registerAPFCallback( { \n \n /**\n * The repeatable field callback.\n * \n * @param object oCopiedNode\n * @param string the field type slug\n * @param string the field container tag ID\n * @param integer the caller type. 1 : repeatable sections. 0 : repeatable fields.\n */\n added_repeatable_field: function( oCopiedNode, sFieldType, sFieldTagID, iCallType ) {\n \n /* If it is not this field type, do nothing. */\n if ( jQuery.inArray( sFieldType, {$aJSArray} ) <= -1 ) return;\n\n /* If the input tag is not found, do nothing */\n var nodeNewAutoComplete = oCopiedNode.find( 'input.autocomplete' );\n if ( nodeNewAutoComplete.length <= 0 ) return;\n \n /* Remove unnecessary elements */\n oCopiedNode.find( 'ul.token-input-list' ).remove();\n \n /* Bind the autocomplete script */\n var sFieldsID = oCopiedNode.closest( '.admin-page-framework-fields' ).attr( 'id' );\n var sOptionID = oCopiedNode.closest( '.admin-page-framework-sections' ).attr( 'id' ) + '_' + oCopiedNode.closest( '.admin-page-framework-fields' ).attr( 'id' ); // sections id + _ + fields id \n var aOptions = jQuery( '#' + nodeNewAutoComplete.attr( 'id' ) ).getTokenInputOptions( sOptionID );\n aOptions = jQuery.isArray( aOptions ) ? aOptions : [ [], [] ];\n \n jQuery( nodeNewAutoComplete ).tokenInput( \n aOptions[0], \n jQuery.extend( true, aOptions[1], {\n onAdd: function ( item ) {\n jQuery( nodeNewAutoComplete ).attr( 'value', JSON.stringify( jQuery( nodeNewAutoComplete ).tokenInput( 'get' ) ) );\n },\n onDelete: function ( item ) {\n jQuery( nodeNewAutoComplete ).attr( 'value', JSON.stringify( jQuery( nodeNewAutoComplete ).tokenInput( 'get' ) ) );\n },\n })\n );\n }, \n });\n }); \n \n \" . PHP_EOL;\n \n }", "function dfd_themes_admin_scripts($hook) {\n\t\twp_register_style('dfd-admin-style', get_template_directory_uri() . '/assets/css/admin-panel.css');\n\t\twp_enqueue_style('dfd-admin-style');\n\t\t\n\t\twp_register_script('dfd_post_metaboxes_gallery', get_template_directory_uri().'/assets/admin/js/posts-gallery.js', array( 'jquery' ), false, true);\n\t\twp_register_script('dfd_portfolio_metaboxes_gallery', get_template_directory_uri().'/assets/admin/js/portfolio-gallery.js', array( 'jquery' ), false, true);\n\t\twp_register_script('dfd_gallery_metaboxes_gallery', get_template_directory_uri().'/assets/admin/js/gallery-gallery.js', array( 'jquery' ), false, true);\n\t\t\n\t\twp_enqueue_script('dfd_admin_script', get_template_directory_uri().'/assets/admin/js/admin-scripts.js', array('jquery'), false, true);\n\t\t\n\t\tif(class_exists( 'Vc_Manager', false )) {\n\t\t\tglobal $dfd_native;\n\n\t\t\t$min = '.min';\n\t\t\t\n\t\t\tif(isset($dfd_native['dev_mode']) && $dfd_native['dev_mode'] == 'on' && defined('DFD_DEBUG_MODE') && DFD_DEBUG_MODE) {\n\t\t\t\t$min = '';\n\t\t\t}\n\t\t\t\n\t\t\tif(wp_script_is( 'vc-frontend-editor-min-js', 'enqueued' )) {\n\t\t\t\twp_enqueue_script('vc-inline-editor',get_template_directory_uri().'/assets/admin/js/vc-inline-editor'.$min.'.js',array('vc-frontend-editor-min-js'),'1.5',true);\n\t\t\t} elseif(wp_script_is( 'vc_inline_custom_view_js', 'enqueued' )) {\n\t\t\t\twp_enqueue_script('vc-inline-editor',get_template_directory_uri().'/assets/admin/js/vc-inline-editor.min.js',array('vc_inline_custom_view_js'),'1.5',true);\n\t\t\t}\n\n\t\t\tif($hook == \"post.php\" || $hook == \"post-new.php\" || $hook == \"edit.php\"){\n\t\t\t\twp_enqueue_script('dfd_vc_admin_scripts', get_template_directory_uri().'/assets/admin/js/vc_admin_scripts.js', array('jquery'), false, true);\n\t\t\t}\n\t\t\t\n\t\t\tif(function_exists('dfd_admin_custom_css')) {\n\t\t\t\tdfd_admin_custom_css();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(class_exists('cmb_Meta_Box') && function_exists('dfd_metaboxes_enctype')) {\n\t\t\tdfd_metaboxes_enctype();\n\t\t}\n\t}", "function input_admin_enqueue_scripts() {\n // vars\n $url = $this->settings['url'];\n $version = $this->settings['version'];\n\n // register & include JS\n wp_register_script('acf-input-cities', \"{$url}assets/js/input.js\", array('acf-input'), $version);\n wp_enqueue_script('acf-input-cities');\n }", "private function define_admin_hooks()\n {\n\n $plugin_admin = new myFOSSIL_Resources_Admin( $this->get_plugin_name(),\n $this->get_version() );\n\n $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin,\n 'enqueue_styles' );\n $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin,\n 'enqueue_scripts' );\n\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'register_menus' );\n\n /* Custom Post Types */\n $this->loader->add_action( 'init', $plugin_admin, 'create_events' );\n\n /* AJAX */\n $this->loader->add_action( 'wp_ajax_myfossil_resources_load_data', $plugin_admin,\n 'ajax_handler' );\n\n /* Advanced Custom Fields */\n\t\t$this->loader->add_filter( 'acf/settings/path', $plugin_admin, 'acf_settings_path' );\n\t\t$this->loader->add_filter( 'acf/settings/dir', $plugin_admin, 'acf_settings_dir' );\n add_filter('acf/settings/show_admin', '__return_false');\n }", "function omfg_mobile_pro_groovetheme_admin_script() {\n\n\t$posttypes = get_post_types( array( 'description' => 'OMFG Mobile Site - Omfg Mobile Groove Theme' ) );\n \n foreach ( $posttypes as $posttype ) {\n \n\t\twp_register_script('omfg-mobile-pro-groove-admin', OMFGMOBILEPRO . 'includes/template/groove-theme/js/admin.js', 'jquery');\n\t\twp_enqueue_script('omfg-mobile-pro-groove-admin'); \n \n }\n\n}", "function register() {\n\tadd_action( 'admin_menu', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\add_menu' );\n\tadd_action( 'admin_init', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\action_handler' );\n\tadd_action( 'admin_enqueue_scripts', '\\\\Sgdd\\\\Admin\\\\AdminPage\\\\register_style' );\n\n\t\\Sgdd\\Admin\\SettingsPages\\Basic\\register();\n\t\\Sgdd\\Admin\\SettingsPages\\Advanced\\register();\n\t\\Sgdd\\Admin\\Editor\\register();\n}", "function plugin_register_admin_scripts() {\r\n\t\t\twp_enqueue_script( 'jquery' );\r\n\t\t\t// Add custom scripts and styles to this page only\r\n\t\t\tadd_action('admin_print_scripts-' . $this->page, array(&$this, 'plugin_admin_scripts'));\r\n\t\t\tadd_action('admin_print_styles-' . $this->page,array(&$this, 'plugin_admin_styles'));\r\n\t\t\r\n\t\t\t\t// Add custom scripts and styles to the post editor pages\r\n\t\t\t\tadd_action('admin_print_scripts-post.php', array(&$this, 'plugin_post_new_scripts'));\r\n\t\t\t\tadd_action('admin_print_scripts-post-new.php',array(&$this, 'plugin_post_new_scripts'));\r\n\t\t\t\tadd_action('admin_print_styles-post.php', array(&$this, 'plugin_admin_styles'));\r\n\t\t\t\tadd_action('admin_print_styles-post-new.php',array(&$this, 'plugin_admin_styles'));\t\r\n\t\t\t\r\n\t\t}", "private function define_admin_hooks()\n {\n $this->loader->add_action('init',$this,'load_options');\n $this->loader->add_action('plugins_loaded','WordPress_Reactro_Admin', 'load_framework');\n }", "function sp_admin_scripts( $hook ) {\n\n\t//Custom javascript working on Shortcodes Manager popup\n\tif( $hook == 'post.php' || $hook == 'post-new.php' ) {\n\t\twp_register_script( 'tinymce_scripts', SP_BASE_URL . 'framework/shortcodes/tinymce/js/scripts.js', array('jquery'), false, true );\n\t\twp_enqueue_script('tinymce_scripts');\n\t}\n\n}", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new APS_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\n\t}", "private function define_admin_hooks() {\n\n $admin = new Online_Magazine_Manager_Admin( $this->version );\n\n $this->loader->add_action( 'admin_menu', $admin, 'register_admin_menu' );\n $this->loader->add_action( 'init', $admin, 'register_issue_post_type' );\n $this->loader->add_action( 'init', $admin, 'register_issue_article_post_type' );\n $this->loader->add_action( 'init', $admin, 'init_rewrite_rules' );\n $this->loader->add_action( 'parent_file', $admin, 'taxonomy_submenu_correction' );\n\n }", "function plugin_post_new_scripts() {\r\n\t// Register & enqueue our admin.js file along with its dependancies\r\n\t\t\twp_register_script('framework', $this->plugin_url .'framework.js', array('jquery','media-upload','thickbox','editor'));\r\n\t\t\twp_enqueue_script('framework');\r\n\t\t\twp_enqueue_script('farbtastic'); \r\n\t\t\twp_enqueue_script('suggest'); // Allow Jquery Chosen\r\n\t\t\t\r\n\t\t}", "private function define_admin_hooks() {\n\n\t\t//$theme_admin = new Wpt_Custom_Theme_Admin( $this->get_theme_name(), $this->get_version() );\n\n\t\t//$this->loader->add_action( 'admin_enqueue_scripts', $theme_admin, 'enqueue_styles' );\n\n\t}", "public function addAdminAssets() {\n\t\twp_enqueue_script( 'csframework-admin-upload' );\n\t}", "function meta_scripts_portfolio() {\n\twp_register_script('my-upload', get_template_directory_uri() . '/meta-boxes/js/upload-media.js', array('jquery','media-upload','thickbox'));\n\twp_enqueue_script('my-upload');\n}", "public function admin_init()\n \t{\t\t\t\n \t\t// Add metaboxes\n \t\t//add_action('add_meta_boxes', array(&$this, 'add_meta_boxes'));\n \t}", "function init_form_fields() {\n\n \tinclude ( SUMO_SAGEPLUGINPATH . 'includes/sagepay-form-admin.php' );\n\n }", "public function register_admin_scripts()\r\n\t{\r\n\t\t// wp_enqueue_script('jquery');\r\n\t\t// wp_enqueue_script( 'wp-fading-content-slider-admin-script', plugins_url( 'wp-fading-content-slider/js/admin.js' ) );\r\n\t}", "function cinerama_edge_admin_scripts_init() {\n\t\t\n\t\t//This part is required for field type address\n\t\t$enable_google_map_in_admin = apply_filters('cinerama_edge_filter_google_maps_in_backend', false);\n\t\tif($enable_google_map_in_admin) {\n\t\t\t//include google map api script\n\t\t\t$google_maps_api_key = cinerama_edge_options()->getOptionValue( 'google_maps_api_key' );\n\t\t\t$google_maps_extensions = '';\n\t\t\t$google_maps_extensions_array = apply_filters( 'cinerama_edge_filter_google_maps_extensions_array', array() );\n\t\t\tif ( ! empty( $google_maps_extensions_array ) ) {\n\t\t\t\t$google_maps_extensions .= '&libraries=';\n\t\t\t\t$google_maps_extensions .= implode( ',', $google_maps_extensions_array );\n\t\t\t}\n\t\t\tif ( ! empty( $google_maps_api_key ) ) {\n wp_enqueue_script( 'edgtf-admin-maps', '//maps.googleapis.com/maps/api/js?key=' . esc_attr( $google_maps_api_key ) . $google_maps_extensions, array(), false, true );\n wp_enqueue_script( 'geocomplete', get_template_directory_uri() . '/framework/admin/assets/js/jquery.geocomplete.min.js', array('edgtf-admin-maps'), false, true );\n\t\t\t}\n\t\t}\n\n\t\twp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/framework/admin/assets/js/bootstrap.min.js', array(), false, true );\n\t\twp_enqueue_script( 'bootstrap-select', get_template_directory_uri() . '/framework/admin/assets/js/bootstrap-select.min.js', array(), false, true );\n\t\twp_enqueue_script( 'select2', get_template_directory_uri() . '/framework/admin/assets/js/select2.min.js', array(), false, true );\n\t\twp_enqueue_script( 'edgtf-ui-admin', get_template_directory_uri() . '/framework/admin/assets/js/edgtf-ui/edgtf-ui.js', array(), false, true );\n\n\n\t\twp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/framework/admin/assets/css/font-awesome/css/font-awesome.min.css' );\n\t\twp_enqueue_style( 'select2', get_template_directory_uri() . '/framework/admin/assets/css/select2.min.css' );\n\n\t\t/**\n\t\t * @see CineramaEdgeClassSkinAbstract::registerScripts - hooked with 10\n\t\t * @see CineramaEdgeClassSkinAbstract::registerStyles - hooked with 10\n\t\t */\n\t\tdo_action( 'cinerama_edge_action_admin_scripts_init' );\n\t}", "public function custom_admin_init_action() {\n\t\t$args = array(\n\t\t\t'class' => 'widefat'\n\t\t);\n\n\t\t$this->add_settings_field( 'upload_description', __( 'Upload Description', $this->textdomain ), 'admin_setting_field_input', 'default', $args );\n\t}", "public function register_admin_scripts() {\n\t\n\t\twp_enqueue_script( 'jquery-ui-datepicker' );\n\t\t//wp_enqueue_script( 'wp-jquery', 'http://code.jquery.com/jquery-1.9.1.min.js' );\n\t\twp_enqueue_script( 'wp-jquery-migrate', 'http://code.jquery.com/jquery-migrate-1.2.1.js' );\n\t\twp_enqueue_script( 'wp-jquery-ui', 'http://code.jquery.com/ui/1.10.3/jquery-ui.min.js' );\n\t\twp_enqueue_script( 'wp-jquery-date-picker', plugins_url( 'WordPress-jQuery-Date-Picker/js/admin.js' ) );\n\t\twp_enqueue_script( 'wp-jquery-time-picker', plugins_url( 'WordPress-jQuery-Date-Picker/js/jquery-ui-timepicker.js' ) );\n\t\t\n\t}", "function wp_manager_admin_scripts() {\n wp_enqueue_script('media-upload');\n wp_enqueue_script('thickbox');\n wp_enqueue_script('jquery');\n }", "public function register(){\n add_action('admin_enqueue_scripts',array($this,'enqueue'));\n //load front end wp css & js\n add_action('wp_enqueue_scripts',array($this,'enqueue'));\n }", "function plugin_admin_scripts() {\r\n\t\t\t// Register & enqueue our admin.js file along with its dependancies\r\n\t\t\twp_register_script('framework', $this->framework_url .'framework.js', array('jquery','media-upload','thickbox','editor'));\r\n\t\t\twp_enqueue_script('framework');\r\n\t\t\t\t\twp_enqueue_script('farbtastic'); \r\n\t\t\twp_enqueue_script('suggest'); // Allow Jquery Chosen\r\n\t\t}", "function admin_print_scripts() {\r\n wp_enqueue_script('custom-page-extensions-js');\r\n }", "public static function register_assets() {\n\t\t$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === true ? '' : '.min' ;\n\t\t// Register the js assets\n\t\twp_register_script( 'wc-acf-admin', WC_ACF_URL.'/assets/js/app'.$suffix.'.js', array( 'jquery', 'backbone' ), WC_ACF_VERSION, true );\n\t\t\n\t\twp_localize_script( 'wc-acf-admin' , 'wc_acf_vars', array(\n\t\t\t'fields' => self::$field_types,\n\t\t\t'fields_data' => get_option( WC_ACF_OPTION_FIELDS_NAME, array() )\n\t\t) );\n\t\t// Register the css assets\n\t\twp_register_style( 'wc-acf-admin', WC_ACF_URL.'/assets/css/admin-page'.$suffix.'.css', array(), WC_ACF_VERSION );\n\t}", "function acf_register_admin_tool($class)\n{\n}", "static function admin_enqueue_scripts()\n\t{\n\t\tparent::admin_enqueue_scripts();\n\t\tMASHSB_RWMB_File_Upload_Field::admin_enqueue_scripts();\n\t\twp_enqueue_script( 'mashsb-rwmb-image-upload', MASHSB_RWMB_JS_URL . 'image-upload.js', array( 'mashsb-rwmb-file-upload', 'mashsb-rwmb-image-advanced' ), MASHSB_RWMB_VER, true );\n\t}", "public function enqueue_admin_scripts()\n {\n }", "public function enqueue_admin_scripts()\n {\n }", "public function enqueue_admin_scripts()\n {\n }", "public function enqueue_admin_scripts()\n {\n }", "public function enqueue_admin_scripts()\n {\n }", "public function enqueue_admin_scripts()\n {\n }", "public function enqueue_admin_scripts()\n {\n }", "function ARTEMIS_SWP_plugin_load_admin_scripts_and_styles() {\r\n\t/*generic admin css*/\r\n\twp_register_style( 'js_backend_css', plugins_url('/css/backend_style.css', __FILE__));\r\n\twp_enqueue_style( 'js_backend_css');\r\n\t\r\n\t/*alpha color picker*/\r\n\twp_register_script( 'alpha_color_picker', plugins_url('/js/alpha-color-picker.js', __FILE__), array('jquery', 'wp-color-picker'), '', true);\r\n\twp_enqueue_script( 'alpha_color_picker');\r\n\twp_enqueue_style( 'alpha_color_picker', plugins_url('/css/alpha-color-picker.css', __FILE__ ), array('wp-color-picker'));\r\n\r\n\t/*vc helper*/\r\n\twp_register_script( 'artemis_vc_helper', plugins_url('/js/artemis_vc_helper.js', __FILE__), array('jquery', 'wp-color-picker'), '', true);\r\n\twp_enqueue_script( 'artemis_vc_helper');\r\n}", "function sh_add_admin_page_callback(){\n //Generate custom settings admin page\n add_menu_page( 'Custom Options', 'Custom Settings', 'manage_options', 'custom_settings', 'sh_create_custom_settings_page' );\n}", "private function load_admin_scripts() {\n\n\t}", "function register_Oldsinks_admin_scripts() {\n wp_enqueue_script('widget-Oldsinks-admin', plugins_url('Oldsinksplugins/js/admin.min.js'));\n}", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new Admin_Hook( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\n\t}", "public function admin_scripts() {\n wp_enqueue_script('jquery-ui-sortable');\n wp_enqueue_script('postbox');\n wp_enqueue_script('jquery-form-validation', SWPM_FORM_BUILDER_URL . '/js/jquery.validate.min.js', array('jquery'), '1.9.0', true);\n wp_enqueue_script('swpm-admin', SWPM_FORM_BUILDER_URL . \"/js/swpm-admin$this->load_dev_files.js\", array('jquery', 'jquery-form-validation'), '20140412', true);\n wp_enqueue_script('nested-sortable', SWPM_FORM_BUILDER_URL . \"/js/jquery.ui.nestedSortable$this->load_dev_files.js\", array('jquery', 'jquery-ui-sortable'), '1.3.5', true);\n\n wp_enqueue_style('swpm-form-builder-style', SWPM_FORM_BUILDER_URL . \"/css/swpm-form-builder-admin$this->load_dev_files.css\", array(), '20140412');\n\n wp_localize_script('swpm-admin', 'SwpmAdminPages', array('swpm_pages' => $this->_admin_pages));\n }", "function tz_admin_enqueue_scripts($hook) {\n\tif ($hook == 'post.php' || $hook == 'post-new.php') {\n\t\twp_register_script('tz-admin', get_template_directory_uri() . '/js/jquery.custom.admin.js', 'jquery');\n\t\twp_enqueue_script('tz-admin');\n\t}\n}", "public function enqueue_edit_scripts() {\n\t}", "function setup() {\n\t$n = function ( $function ) {\n\t\treturn __NAMESPACE__ . \"\\\\$function\";\n\t};\n\n\t// NOTE: Uncomment to activate metabox\n\tadd_action( 'cmb2_init', $n( 'hero_fields' ) );\n}", "public function registerScriptsFrontend() {\n $v = Wpjb_Project::VERSION;\n $p = plugins_url().'/wpjobboard/public/js/';\n \n wp_register_script('wpjb-js', $p.'frontend.js', array(\"jquery\"), $v );\n \n wp_register_script('wpjb-payment', $p.'frontend-payment.js', array(\"jquery\"), $v );\n wp_register_script('wpjb-serialize', $p.'serialize.js', array(), $v, true);\n wp_register_script('wpjb-alert', $p.'frontend-alert.js', array(\"jquery\", \"wp-util\", 'wpjb-serialize'), $v, true);\n wp_register_script('wpjb-manage', $p.'frontend-manage.js', array(\"jquery\"), $v, true);\n wp_register_script('wpjb-manage-apps', $p.'frontend-manage-apps.js', array(\"jquery\"), $v, true);\n \n wp_register_script(\"wpjb-paypal-reply\", $p.\"wpjb-paypal-reply.js\", array(\"jquery\"), $v);\n\n }", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "private function define_admin_hooks() {\n\t\t$plugin_admin = new TTR66_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t// Add the TTR66 dash widget and XML upload page/menu\n\t\t$this->loader->add_action( 'wp_dashboard_setup', $plugin_admin, 'add_dashboard_widget');\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'register_custom_menu_page' );\n\t}", "function add_admin() {\n\t\t\t$this->pagehook = add_options_page(\n\t\t\t\t\t__( \"Subpages as Tabs\" )\n\t\t\t\t\t, __( \"Subpages as Tabs\" )\n\t\t\t\t\t, 'manage_options'\n\t\t\t\t\t, 'subpage_tabs_plugin'\n\t\t\t\t\t, array( $this, 'plugin_options_page' )\n\t\t\t\t);\n\n\t\t\t//register callback to gets call prior your options_page rendering\n\t\t\tadd_action( 'load-' . $this->pagehook, array( &$this, 'add_the_meta_boxes' ) );\n\t\t}", "public function register_admin_scripts() {\n\t\n\t\twp_register_script( 'multisite-plugin-stats-admin-script', plugins_url( 'multisite-plugin-stats/js/admin.js' ) );\n\t\twp_enqueue_script( 'multisite-plugin-stats-admin-script' );\n\t\n\t}", "function cnew_load_scripts() {\r\n wp_register_script( 'cnew-js-admin', CNEW_PLUGIN_URL . 'includes/js/cne-workshops-admin.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker', 'cnew-js-jquery-validate' ), '', true );\r\n wp_register_script( 'cnew-js-jquery-mask', CNEW_PLUGIN_URL . 'includes/js/jquery.maskedinput.min.js', array( 'jquery' ), '', true );\r\n wp_register_script( 'cnew-js-jquery-validate', CNEW_PLUGIN_URL . 'includes/js/jquery.validate.min.js', array( 'jquery' ), '', true );\r\n wp_register_style( 'cnew-css-admin', CNEW_PLUGIN_URL . 'includes/css/cne-workshops-admin.css' );\r\n wp_register_style( 'cnew-css-jquery', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css' );\r\n\r\n wp_enqueue_script( 'cnew-js-admin' );\r\n wp_enqueue_script( 'cnew-js-jquery-mask' );\r\n wp_enqueue_style( 'cnew-js-jquery-validate' );\r\n wp_enqueue_style( 'cnew-css-admin' );\r\n wp_enqueue_style( 'cnew-css-jquery' );\r\n }", "function vslider_admin_scripts() {\r\n wp_enqueue_script ('media-upload');\r\n wp_enqueue_script ('thickbox');\r\n wp_register_script ('vslider-upload', WP_PLUGIN_URL.'/vslider/js/upload.js', array('jquery','media-upload', 'thickbox'));\r\n wp_enqueue_script ('vslider-upload');\r\n wp_register_script ( 'colorpicker-js', WP_PLUGIN_URL.'/vslider/picker/colorpicker.js', array('jquery'));\r\n wp_enqueue_script ('colorpicker-js' );\r\n wp_register_script ( 'custom-js', WP_PLUGIN_URL.'/vslider/js/custom.js', array('jquery'));\r\n wp_enqueue_script ('custom-js' );\r\n }", "private function dld_define_admin_hooks()\n {\n\n $this->dld_admin_settings();\n }", "function foool_partner_admin_partner_init(){\n add_filter( 'manage_edit-partner_columns', 'foool_partner_add_column' ) ;\n add_action( 'manage_partner_posts_custom_column', 'foool_partner_custom_columns_render', 10, 2);\n add_action( 'admin_head', 'foool_partner_admin_styles');\n \n // Custom Metabox : Infos\n add_meta_box( 'foool_partner_infos_meta_box', 'Informations complémentaires', 'foool_partner_infos_metabox_render', 'partner', 'normal', 'high');\n add_action( 'save_post', 'foool_partner_infos_save_postdata');\n}", "function admin_scripts()\n {\n $screen = get_current_screen();\n $screen_id = ( $screen ? $screen->id : '' );\n $localizations = Uni_Cpo_Frontend_Scripts::get_localizations();\n \n if ( in_array( $screen_id, array( 'product', 'edit-product' ) ) ) {\n wp_enqueue_style(\n 'uni-cpo-styles-product',\n $this->plugin_url() . '/assets/css/admin-product.css',\n false,\n UNI_CPO_VERSION,\n 'all'\n );\n } elseif ( in_array( str_replace( 'edit-', '', $screen_id ), wc_get_order_types( 'order-meta-boxes' ) ) ) {\n wp_register_script(\n 'moment',\n $this->plugin_url() . '/includes/vendors/moment/moment.min.js',\n array(),\n '2.19.1'\n );\n wp_register_script(\n 'flatpickr',\n $this->plugin_url() . '/includes/vendors/flatpickr/flatpickr.js',\n array(),\n '4.3.2'\n );\n wp_register_script(\n 'parsleyjs',\n $this->plugin_url() . '/includes/vendors/parsleyjs/parsley.min.js',\n array( 'jquery' ),\n '2.8.0'\n );\n wp_register_script(\n 'parsley-localization',\n $this->plugin_url() . '/includes/vendors/parsleyjs/i18n/en.js',\n array( 'parsleyjs' ),\n '2.8.0'\n );\n wp_register_script(\n 'uni-cpo-scripts-order',\n $this->plugin_url() . '/assets/js/admin-order.js',\n array(\n 'wc-admin-order-meta-boxes',\n 'moment',\n 'flatpickr',\n 'parsleyjs'\n ),\n UNI_CPO_VERSION\n );\n wp_enqueue_script( 'uni-cpo-scripts-order' );\n // media uploader\n wp_enqueue_media();\n wp_localize_script( 'parsleyjs', 'uni_parsley_loc', $localizations['parsleyjs'] );\n $uni_cpo_i18n = apply_filters( 'uni_cpo_i18n_admin_strings', array(\n 'flatpickr' => $localizations['flatpickr'],\n 'no_file' => __( 'No file uploaded', 'uni-cpo' ),\n ) );\n wp_localize_script( 'uni-cpo-scripts-order', 'unicpo_i18n', $uni_cpo_i18n );\n wp_enqueue_style(\n 'flatpickr',\n $this->plugin_url() . '/includes/vendors/flatpickr/flatpickr.css',\n false,\n '4.3.2',\n 'all'\n );\n wp_enqueue_style(\n 'uni-cpo-font-awesome',\n $this->plugin_url() . '/includes/vendors/font-awesome/css/fontawesome-all.min.css',\n false,\n '5.0.10',\n 'all'\n );\n wp_enqueue_style(\n 'uni-cpo-styles-order',\n $this->plugin_url() . '/assets/css/admin-order.css',\n false,\n UNI_CPO_VERSION,\n 'all'\n );\n } elseif ( in_array( $screen_id, array( 'woocommerce_page_uni-cpo-import-export', 'woocommerce_page_uni-cpo-settings' ) ) ) {\n wp_enqueue_style(\n 'uni-cpo-styles-settings',\n $this->plugin_url() . '/assets/css/admin-settings.css',\n false,\n UNI_CPO_VERSION,\n 'all'\n );\n wp_register_script(\n 'uni-cpo-scripts-settings',\n $this->plugin_url() . '/assets/js/admin-settings.js',\n array( 'jquery' ),\n UNI_CPO_VERSION\n );\n wp_enqueue_script( 'uni-cpo-scripts-settings' );\n } elseif ( in_array( $screen_id, array( 'woocommerce_page_uni-cpo-settings' ) ) ) {\n wp_enqueue_style( 'farbtastic' );\n wp_enqueue_script( 'farbtastic' );\n wp_enqueue_media();\n wp_register_script(\n 'uni-cpo-admin-utils',\n $this->plugin_url() . '/assets/js/admin-utils.js',\n array( 'farbtastic', 'jquery' ),\n UNI_CPO_VERSION\n );\n wp_enqueue_script( 'uni-cpo-admin-utils' );\n }\n \n }", "function skywalker_admin_scripts(){\n if(is_admin()){\n add_theme_support( 'editor-styles' );\n add_editor_style( 'https://use.typekit.net/rtd1rvn.css' );\n wp_enqueue_script( 'skywalker-admin-js', get_stylesheet_directory_uri() . '/assets/js/admin.js', array(), true);\n }\n}", "private function define_admin_hooks() {\n\n\t\t$plugin_admin = new Service_Tracker_Admin( $this->get_plugin_name(), $this->get_version() );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );\n\n\t\t$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'localize_scripts' );\n\n\t\t$this->loader->add_action( 'admin_menu', $plugin_admin, 'admin_page' );\n\n\t}", "function waraPay_admin_init()\n {\n wp_register_script('waraPay_admin_js', WARAPAY_URL . '/javascripts/admin.js', array('jquery'));\n wp_register_style('waraPay_settings_css', WARAPAY_URL . '/styles/settings.css?v=2');\n }", "public function setup()\n {\n add_action('admin_head', function () {\n echo \"\n <style>\n i.mce-i-raph { font: 400 20px/1 dashicons; background-color: #777; }\n i.mce-i-raph:before { color: #fff!important; }\n </style>\n \";\n });\n add_action('admin_enqueue_scripts', function () {\n wp_localize_script('editor', 'Raph', $this->formData->data());\n });\n add_filter('mce_buttons', function (array $buttons) {\n return array_merge($buttons, ['raphRender']);\n });\n add_filter('mce_external_plugins', function (array $plugins) {\n return array_merge($plugins, ['raphRender' => $this->scriptUrl()]);\n });\n }", "public function register_admin_scripts() {\n wp_enqueue_script( 'jquery-ui-autocomplete' );\n wp_enqueue_script( 'jquery-ui-dialog' );\n wp_enqueue_script( 'mousetrap', plugins_url( 'sudosearch/vendor/mousetrap.min.js' ) );\n wp_enqueue_script( 'sudosearch-spotlight', plugins_url( 'sudosearch/assets/javascripts/sudosearch.js' ), \n array('mousetrap', 'jquery-ui-dialog', 'jquery-ui-autocomplete') );\n }", "public function register_metabox(){\n add_filter( 'attachment_fields_to_edit', array($this, 'add_metabox'), 10, 2 );\n /* Saves the field value*/\n add_action( 'edit_attachment', array($this->meta_field, 'save_metabox'), 20, 2 );\n }", "function register_vc_add_on(){\r\n\r\n vc_map( array(\r\n \"name\" => $this->name,\r\n \"base\" => $this->id,\r\n \"icon\" => $this->icon,\r\n \"description\" => $this->description,\r\n \"weight\" => 1,\r\n\r\n \"wrapper_height\"=> 'full',\r\n\r\n \"category\" => __( 'BetterMag Addons', 'better-studio' ),\r\n \"params\" => array(\r\n\r\n array(\r\n \"type\" => 'textfield',\r\n \"admin_label\" => true,\r\n \"heading\" => __( 'Title', 'better-studio' ),\r\n \"param_name\" => 'title',\r\n \"value\" => $this->defaults['title'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"heading\" => __( 'Show Title?', 'better-studio'),\r\n \"param_name\" => 'show_title',\r\n \"value\" => $this->defaults['show_title'],\r\n ),\r\n array(\r\n 'heading' => __( 'Instructions', 'better-studio' ),\r\n 'param_name' => 'help',\r\n 'type' => 'bf_info',\r\n 'value' => __('<ol>\r\n <li>Copy the link to you facebook page</li>\r\n <li>Paste it in the \"Link to you Facebook page\" input box below</li>\r\n </ol>\r\n ', 'better-studio' ),\r\n 'state' => 'open',\r\n 'info-type' => 'help',\r\n 'section_class' => 'widefat',\r\n ),\r\n array(\r\n \"type\" => 'textfield',\r\n \"admin_label\" => true,\r\n \"heading\" => __( 'Link to you Facebook page', 'better-studio' ),\r\n \"param_name\" => 'url',\r\n \"value\" => $this->defaults['url'],\r\n ),\r\n array(\r\n \"type\" => 'bf_select',\r\n \"heading\" => __( 'Style', 'better-studio' ),\r\n \"param_name\" => 'style',\r\n 'section_class' => 'style-floated-left',\r\n \"admin_label\" => true,\r\n \"options\" => array(\r\n 'light' => __( 'Light Schema', 'better-studio' ),\r\n 'dark' => __( 'Style Schema', 'better-studio' ),\r\n ),\r\n \"value\" => $this->defaults['style'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"admin_label\" => false,\r\n \"heading\" => __( 'Show Posts?', 'better-studio' ),\r\n \"param_name\" => 'show_posts',\r\n \"value\" => $this->defaults['show_posts'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"admin_label\" => false,\r\n \"heading\" => __( 'Show faces?', 'better-studio' ),\r\n \"param_name\" => 'show_faces',\r\n \"value\" => $this->defaults['show_faces'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"admin_label\" => false,\r\n \"heading\" => __( 'Show Header?', 'better-studio' ),\r\n \"param_name\" => 'show_header',\r\n \"value\" => $this->defaults['show_header'],\r\n ),\r\n array(\r\n \"type\" => 'bf_switchery',\r\n \"admin_label\" => false,\r\n \"heading\" => __( 'Show Border?', 'better-studio' ),\r\n \"param_name\" => 'show_border',\r\n \"value\" => $this->defaults['show_border'],\r\n ),\r\n\r\n\r\n )\r\n ) );\r\n\r\n }", "public function __construct(){\n add_action( 'admin_enqueue_scripts', array( &$this,'admin_scripts' ) );\n \n }", "public static function action__admin_print_scripts() {\n\n\t\t\tif ( 'off' === WPGlobus::Config()->toggle ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filter for using canonical URL field. Return false to disable field handling.\n\t\t\t *\n\t\t\t * Returning string.\n\t\t\t * @since 1.1.41\n\t\t\t *\n\t\t\t * @param value True by default.\n\t\t\t */\t\n\t\t\t$canonical_url = apply_filters( 'wpglobus_plus_wpseo_canonical_url', self::$_wpseo_canonical_input_id );\n\t\t\t\n\t\t\tif ( WPGlobus_WP::is_pagenow( array( 'post.php', 'post-new.php' ) ) ) {\n\n\t\t\t\t$scr_version = '30';\n\t\t\t\tif ( version_compare( WPSEO_VERSION, '3.3.0', '>=' ) ) {\n\t\t\t\t\t$scr_version = '33';\n\t\t\t\t}\n\n\t\t\t\twp_register_script(\n\t\t\t\t\t'wpglobus-plus-yoastseo',\n\t\t\t\t\tWPGlobusPlus_Asset::url_js( 'wpglobus-plus-yoastseo' . $scr_version ),\n\t\t\t\t\tarray( 'jquery', 'wpglobus-admin' ),\n\t\t\t\t\tWPGLOBUS_PLUS_VERSION,\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t\twp_enqueue_script( 'wpglobus-plus-yoastseo' );\n\t\t\t\twp_localize_script(\n\t\t\t\t\t'wpglobus-plus-yoastseo',\n\t\t\t\t\t'WPGlobusPlusYoastSeo',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'wpglobus_plus_version' => WPGLOBUS_PLUS_VERSION,\n\t\t\t\t\t\t'wpseo_version' => WPSEO_VERSION,\n\t\t\t\t\t\t'canonicalUrl'\t\t\t=> $canonical_url\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}", "function manage_wp_posts_using_bulk_quick_edit_enqueue_admin_scripts() {\n\t//wp_enqueue_script( 'manage-wp-posts-using-bulk-quick-edit', trailingslashit( get_bloginfo( 'stylesheet_directory' ) ) . 'bulk_quick_edit.js', array( 'jquery', 'inline-edit-post' ), '', true );\n\t\n\t// if using code as plugin\n\twp_enqueue_script( 'manage-wp-posts-using-bulk-quick-edit', trailingslashit( plugin_dir_url( __FILE__ ) ) . 'bulk_quick_edit.js', array( 'jquery', 'inline-edit-post' ), '', true );\n\t\n}", "public function admin_init() {}", "public function register_script() {\n\t\ttribe_asset(\n\t\t\tTribe__Main::instance(),\n\t\t\t'tribe-common-logging-controls',\n\t\t\t'admin-log-controls.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'admin_enqueue_scripts',\n\t\t\tarray(\n\t\t\t\t'conditionals' => array( Tribe__Admin__Help_Page::instance(), 'is_current_page' ),\n\t\t\t\t'localize' => (object) array(\n\t\t\t\t\t'name' => 'tribe_logger_data',\n\t\t\t\t\t'data' => array(\n\t\t\t\t\t\t'check' => wp_create_nonce( 'logging-controls' ),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}", "function st_blog_customizer_control_scripts()\n{\n\n wp_enqueue_style('st-blog-customize-controls-style', get_template_directory_uri() . '/editor-style.css');\n\n wp_enqueue_script('st-blog-customize-controls-scripts', get_template_directory_uri() . '/assets/custom/admin-script.js');\n\n}", "function admin_init()\n {\n // vars\n $version = '1.0.0';\n\n // scripts\n wp_register_script( 'admin', _24_TEMPLATE_PATH . '/library/assets/admin/admin.js', array('jquery'), $version );\n\n // styles\n wp_register_style( 'admin', _24_TEMPLATE_PATH . '/library/assets/admin/admin.css', false, $version );\n }", "public function arvan_wp_enqueue_scripts(){\n \n wp_register_script('arvan-plugin-custom-script', plugin_dir_url(__FILE__) . '/js/custom.js', array('jquery'));\n wp_localize_script( 'arvan-plugin-custom-script', 'WPData', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ))); \n wp_enqueue_script( 'arvan-plugin-custom-script');\n \n\n }", "function pw_load_scripts($hook) {\n\n//load js only with specified hooks\nif( !is_admin() && $hook != 'post.php' OR !is_admin() && $hook != 'post-new.php' )\nreturn;\n// now check to see if the $post type is 'fzproject_post'\nglobal $post;\nif ( !isset($post) || 'fzproject_post' != $post->post_type )\nreturn;\n\nwp_register_script('fzproject_admin_script', plugins_url('admin.js', __FILE__)); \n// enqueue \nwp_enqueue_script('jquery'); \nwp_enqueue_script('fzproject_admin_script');\n\n}", "public function register_hooks() {\n\t\tadd_action( 'admin_init', [ $this, 'admin_init' ] );\n\t}", "function jigoshop_admin_coupons_scripts () {\n\twp_register_script('jigoshop-date', jigoshop::plugin_url() . '/assets/js/date.js');\n\twp_register_script('jigoshop-datepicker', jigoshop::plugin_url() . '/assets/js/datepicker.js', array('jquery', 'jigoshop-date'));\n\twp_enqueue_script('jigoshop-datepicker');\n}", "function of_admin_head() {\n\t\tdo_action( 'lcarsframework_custom_scripts' );\n\t}" ]
[ "0.6946345", "0.68924266", "0.68847835", "0.6870702", "0.68024594", "0.67540395", "0.6711913", "0.6707241", "0.67069477", "0.6679416", "0.66788816", "0.66768295", "0.6667433", "0.6649931", "0.6636296", "0.6632517", "0.6595033", "0.65911394", "0.6581198", "0.6546152", "0.6540575", "0.65372634", "0.6532905", "0.65301436", "0.65178955", "0.6511971", "0.65094227", "0.6505604", "0.6503183", "0.6488389", "0.64769906", "0.6472389", "0.64609355", "0.64594346", "0.64423704", "0.6421889", "0.64163876", "0.6405422", "0.64020413", "0.63880694", "0.63856184", "0.6381463", "0.6348317", "0.633295", "0.63321304", "0.6322839", "0.63192415", "0.6313953", "0.630743", "0.63010514", "0.62987185", "0.629854", "0.62983125", "0.62867886", "0.6280059", "0.62780267", "0.62780267", "0.62780267", "0.62780267", "0.62780267", "0.62780267", "0.62780267", "0.62570304", "0.62533015", "0.6251858", "0.6246492", "0.6245262", "0.62271756", "0.62267536", "0.6216041", "0.6215827", "0.62102485", "0.6204691", "0.6204691", "0.619941", "0.61983365", "0.6196489", "0.61957735", "0.61941695", "0.61932886", "0.6188792", "0.6184168", "0.61834484", "0.61782056", "0.6175102", "0.61669576", "0.6164691", "0.61607796", "0.6158461", "0.6154356", "0.6152547", "0.6138641", "0.61375767", "0.6137349", "0.61356103", "0.61346585", "0.6132523", "0.61259514", "0.6124009", "0.6120297", "0.6119277" ]
0.0
-1
Get image ID from URL
function pz_get_image_id($image_url) { global $wpdb; $attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url)); return $attachment[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wpbm_get_image_id( $image_url ){\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb -> posts} WHERE guid='$image_url'\";\n $id = $wpdb -> get_var( $query );\n return $id;\n }", "function rockthemes_get_image_id_from_url($image_url) {\n\tglobal $wpdb;\n\t$prefix = $wpdb->prefix;\n\t$attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM \" . $prefix . \"posts\" . \" WHERE guid='%s';\", $image_url )); \n\tif(!empty($attachment) && $attachment[0]){\n return $attachment[0]; \n\t}else{\n\t\t$new_image_url = '';\n\t\t\n\t\tif(strpos($image_url, 'https') > -1){\n\t\t\t$new_image_url = str_replace('https', 'http', $image_url);\n\t\t}elseif(strpos($image_url, 'http') > -1){\n\t\t\t$new_image_url = str_replace('http', 'https', $image_url);\n\t\t}\n\n\t\t$attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM \" . $prefix . \"posts\" . \" WHERE guid='%s';\", $new_image_url)); \n\n\t\tif(!empty($attachment) && $attachment[0]){\n \t\treturn $attachment[0]; \n\t\t}\t\n\n\t}\n\treturn '';\n}", "function getImageId();", "function themify_get_attachment_id_from_url( $url = '', $base_url = '' ) {\r\n\t\t// If this is the URL of an auto-generated thumbnail, get the URL of the original image\r\n\t\t$url = preg_replace( '/-\\d+x\\d+(?=\\.(jpg|jpeg|png|gif)$)/i', '', $url );\r\n\r\n\t\t$id = attachment_url_to_postid( $url );\r\n\t\treturn $id;\r\n\t}", "function fjarrett_get_attachment_id_by_url($url) {\n\t\t$parsed_url = explode( parse_url(WP_CONTENT_URL, PHP_URL_PATH), $url);\n\t\t$this_host = str_ireplace('www.', '', parse_url(home_url(), PHP_URL_HOST));\n\t\t$file_host = str_ireplace('www.', '', parse_url($url, PHP_URL_HOST));\n\t\tif (!isset($parsed_url[1]) || empty($parsed_url[1]) || ($this_host != $file_host)) {\n\t\t\treturn;\n\t\t}\n\t\tGlobal $wpdb;\n\t\t$prefix = is_multisite() ? $wpdb->base_prefix : $wpdb->prefix;\n\t\t$attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM {$prefix}posts WHERE guid RLIKE %s;\", $parsed_url[1]));\n\t\treturn $attachment[0];\n\t}", "public function getImagesId()\n {\n $url = str_replace(\"[:action]\", \"images/ids\", self::ImgUrAPI_MINE_URL);\n $url = str_replace(\"[:user_id]\", $this->user_id, $url);\n $result = self::excuteHTTPSRequest($url, $this->accessToken);\n\n return isset($result['data']) && !empty($result['data']) ? $result['data'] : null;\n }", "function url_to_attachment_id( string $image_url ) : string {\n\tglobal $wpdb;\n\t$original_image_url = $image_url;\n\t$image_url = preg_replace( '/^(.+?)(?:-e\\d+)?(?:-\\d+x\\d+)?\\.(jpg|jpeg|png|gif)(?:(?:\\?|#).+)?$/i', '$1.$2', $image_url );\n\t$cached_id = wp_cache_get( md5( $image_url ), 'url_to_id' );\n\tif ( ! $cached_id ) {\n\t\treturn $cached_id;\n\t}\n\t$cached_id = wp_cache_get( md5( $original_image_url ), 'url_to_id', false, $found );\n\tif ( $found ) {\n\t\treturn $cached_id;\n\t}\n\t$attachment_id = $wpdb->get_col( $wpdb->prepare( 'SELECT ID FROM ' . $wpdb->prefix . 'posts WHERE guid=%s;', $image_url ) );\n\tif ( ! empty( $attachment_id ) ) {\n\t\twp_cache_set( md5( $image_url ), $attachment_id[0], 'url_to_id' );\n\t\treturn $attachment_id[0];\n\t}\n\tif ( $image_url !== $original_image_url ) {\n\t\t$attachment_id = $wpdb->get_col( $wpdb->prepare( 'SELECT ID FROM ' . $wpdb->prefix . 'posts WHERE guid=%s;', $original_image_url ) );\n\t\tif ( ! empty( $attachment_id ) ) {\n\t\t\twp_cache_set( md5( $original_image_url ), $attachment_id[0], 'url_to_id' );\n\t\t\treturn $attachment_id[0];\n\t\t}\n\t}\n\twp_cache_set( md5( $original_image_url ), false, 'url_to_id' );\n\treturn '';\n}", "function ac_get_image_id($image_url) {\n \n global $wpdb;\n \n $attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url )); \n \n return $attachment[0]; \n}", "function fjarrett_get_attachment_id_by_url( $url ) {\n\t$parsed_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );\n\t$this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );\n\t$file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );\n\tif ( ! isset( $parsed_url[1] ) || empty( $parsed_url[1] ) || ( $this_host != $file_host ) ) {\n\t\treturn;\n\t}\n\n\tglobal $wpdb;\n\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM {$wpdb->prefix}posts WHERE guid RLIKE %s;\", $parsed_url[1] ) );\n\n\treturn $attachment[0];\n}", "function dahz_get_attachment_id_from_url( $url ) {\n\tglobal $wpdb;\n\n\t$prefix = $wpdb->prefix;\n\n\t$posts = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM \" . $prefix . \"posts\" . \" WHERE guid='%s';\", $url ) ); \n \n\treturn array_shift( $posts );\n}", "public static function getIdFromUrl($url) {\n\t\t\n\t\t$url = filter_var($url, FILTER_VALIDATE_URL);\n\t\t\n\t\t$pattern = '|^http://[^/]+(.*)/([0-9]+)(\\\\?.*)?$|' ;\n\t\t\t\n \tpreg_match($pattern, $url, $matches);\n \t\n \tif (count($matches) < 3) {\n \t\tthrow new RegexException('Invalid url. Id cannot be extracted.');\n \t}\n \t\n \treturn $matches[2];\n\t\t\n\t}", "public static function getIdFromUrl($url)\n {\n $base_url = WEB_SERVER_BASE_URL . '/badges/';\n $id = (int) str_replace($base_url, '', $url);\n\n return $id;\n }", "function tfuse_get_attachment_id_by_url( $url ) {\r\n $attachment_id = 0;\r\n $dir = wp_upload_dir();\r\n if ( false !== strpos( $url, $dir['baseurl'] . '/' ) ) { // Is URL in uploads directory?\r\n $file = basename( $url );\r\n $query_args = array(\r\n 'post_type' => 'attachment',\r\n 'post_status' => 'inherit',\r\n 'fields' => 'ids',\r\n 'posts_per_page' => 1,\r\n 'meta_query' => array(\r\n array(\r\n 'value' => $file,\r\n 'compare' => 'LIKE',\r\n 'key' => '_wp_attached_file',\r\n ),\r\n )\r\n );\r\n $query = new WP_Query( $query_args );\r\n if ( $query->have_posts() ) {\r\n return $query->posts[0];\r\n }\r\n }\r\n\r\n return $attachment_id;\r\n }", "static public function getIdFromUrl($url) {\n $cleanedUrl = substr($url, 0, -1); // Remove last / from url.\n $explodedUrl = explode('/', $cleanedUrl);\n return (int) end($explodedUrl); // Get id from url\n }", "static function get_attachment_id_from_src ($url) {\n\t\t$parse_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );\n\n\t\t// Get the host of the current site and the host of the $url, ignoring www.\n\t\t$this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );\n\t\t$file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );\n\n\t\t// Return nothing if there aren't any $url parts or if the current host and $url host do not match.\n\t\tif ( ! isset( $parse_url[1] ) || empty( $parse_url[1] ) || ( $this_host != $file_host ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Now we're going to quickly search the DB for any attachment GUID with a partial path match.\n\t\t// Example: /uploads/2013/05/test-image.jpg\n\t\tglobal $wpdb;\n\n\t\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM {$wpdb->prefix}posts WHERE guid RLIKE %s;\", $parse_url[1] ) );\n\n\t\t// Returns null if no attachment is found.\n\t\treturn $attachment[0];\n\t}", "function arlo_fn_attachment_id_from_url( $attachment_url = '' ) {\n \n\tglobal $wpdb;\n\t$attachment_id = false;\n \n\t// If there is no url, return.\n\tif ( '' == $attachment_url ){return '';}\n\t\t\n \n\t// Get the upload directory paths\n\t$upload_dir_paths = wp_upload_dir();\n \n\t// Make sure the upload path base directory exists in the attachment URL, to verify that we're working with a media library image\n\tif ( false !== strpos( $attachment_url, $upload_dir_paths['baseurl'] ) ) {\n \n\t\t// If this is the URL of an auto-generated thumbnail, get the URL of the original image\n\t\t$attachment_url = preg_replace( '/-\\d+x\\d+(?=\\.(jpg|jpeg|png|gif)$)/i', '', $attachment_url );\n \n\t\t// Remove the upload path base directory from the attachment URL\n\t\t$attachment_url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $attachment_url );\n \n\t\t// Finally, run a custom database query to get the attachment ID from the modified attachment URL\n\t\t$attachment_id = $wpdb->get_var( $wpdb->prepare( \"SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'\", $attachment_url ) );\n \n\t}\n \n\treturn esc_html($attachment_id);\n}", "function thegrapes_get_attachment_id_by_url( $url ) {\n\n // Split the $url into two parts with the wp-content directory as the separator\n $parsed_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );\n\n // Get the host of the current site and the host of the $url, ignoring www\n $this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );\n $file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );\n\n // Return nothing if there aren't any $url parts or if the current host and $url host do not match\n if ( ! isset( $parsed_url[1] ) || empty( $parsed_url[1] ) || ( $this_host != $file_host ) ) {\n return;\n }\n\n // Now we're going to quickly search the DB for any attachment GUID with a partial path match\n\n // Example: /uploads/2013/05/test-image.jpg\n global $wpdb;\n $attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM {$wpdb->prefix}posts WHERE guid RLIKE %s;\", $parsed_url[1] ) );\n\n // Returns null if no attachment is found\n return $attachment[0];\n}", "function ywraq_get_attachment_id_by_url( $url ) {\n\t\t// Split the $url into two parts with the wp-content directory as the separator\n\t\t$parsed_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );\n\n\t\t// Get the host of the current site and the host of the $url, ignoring www\n\t\t$this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );\n\t\t$file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );\n\n\t\t// Return nothing if there aren't any $url parts or if the current host and $url host do not match\n\t\tif ( ! isset( $parsed_url[1] ) || empty( $parsed_url[1] ) || ( $this_host != $file_host ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Now we're going to quickly search the DB for any attachment GUID with a partial path match\n\t\t// Example: /uploads/2013/05/test-image.jpg\n\t\tglobal $wpdb;\n\n\t\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM {$wpdb->prefix}posts WHERE guid RLIKE %s;\", $parsed_url[1] ) );\n\n\t\t// Returns null if no attachment is found\n\t\treturn $attachment[0];\n\t}", "function attachment_url_to_postid($url)\n {\n }", "function kt_get_image_id($image_url) {\n global $wpdb;\n $attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url )); \n return $attachment[0]; \n}", "public function getImageid()\n {\n return $this->imageid;\n }", "function shoestrap_get_attachment_id_from_src( $image_src ) {\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'\";\n $id = $wpdb->get_var( $query );\n return $id;\n}", "public function getImageId()\n {\n return $this->imageid;\n }", "public function getUrlId();", "function client_portal_get_attachment_id_from_url( $attachment_url = '' ) {\n\n\tglobal $wpdb;\n\n\t$attachment_id = false;\n\n\t// If there is no url, return.\n\tif ( '' === $attachment_url ) {\n\t\treturn false;\n\t}\n\n\t// Get the upload directory paths.\n\t$upload_dir_paths = wp_upload_dir();\n\n\t// Make sure the upload path base directory exists in the attachment URL, to verify that we're working with a media library image.\n\tif ( false !== strpos( $attachment_url, $upload_dir_paths['baseurl'] ) ) {\n\n\t\t// If this is the URL of an auto-generated thumbnail, get the URL of the original image.\n\t\t$attachment_url = preg_replace( '/-\\d+x\\d+(?=\\.(jpg|jpeg|png|gif)$)/i', '', $attachment_url );\n\n\t\t// Remove the upload path base directory from the attachment URL.\n\t\t$attachment_url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $attachment_url );\n\n\t\t// Do something with $result.\n\t\t$attachment_id = $wpdb->get_var( $wpdb->prepare( \"SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = %s AND wposts.post_type = 'attachment'\", $attachment_url ) ); // WPCS db call ok, cache ok, placeholder ok.\n\t}\n\n\treturn $attachment_id;\n}", "function cpo_image_url( $id, $size = 'full' ) {\n\t$url = '';\n\tif ( is_numeric( $id ) ) {\n\t\t$url = wp_get_attachment_image_src( $id, $size );\n\t\t$url = $url[0];\n\t} else {\n\t\t$url = $id;\n\t}\n\n\treturn $url;\n}", "public function getImageId()\n {\n return $this->_imageId;\n }", "public function pId()\n {\n static $id = null;\n\n if (!is_null($id)) {\n return $id;\n }\n\n $id = $this->property('id');\n\n if (strpos($id, 'http') === 0) {\n $path = explode('/', parse_url($id, PHP_URL_PATH));\n\n if ($path[1] == 'gallery') {\n $id = $path[2];\n }\n elseif ($path[1] == 'a') {\n $id = 'a/'.$path[2];\n }\n else {\n $id = $path[1];\n }\n }\n\n return $id;\n }", "protected function extractId($url)\n {\n $parts = explode('/', $url);\n return end($parts);\n }", "public function getId()\n {\n return $this->_imageId;\n }", "private static function get_id_from_url(string $url): string {\n\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$url'\";\n $id = $wpdb->get_var($query);\n\n return $id;\n }", "function itransform_get_attachment_id_from_url( $attachment_url = '' ) {\r\n\r\n global $wpdb;\r\n $attachment_id = false;\r\n\r\n // If there is no url, return.\r\n if ( '' == $attachment_url )\r\n return;\r\n\r\n // Get the upload directory paths\r\n $upload_dir_paths = wp_upload_dir();\r\n\r\n // Make sure the upload path base directory exists in the attachment URL, to verify that we're working with a media library image\r\n if ( false !== strpos( $attachment_url, $upload_dir_paths['baseurl'] ) ) {\r\n\r\n // If this is the URL of an auto-generated thumbnail, get the URL of the original image\r\n $attachment_url = preg_replace( '/-\\d+x\\d+(?=\\.(jpg|jpeg|png|gif)$)/i', '', $attachment_url );\r\n\r\n // Remove the upload path base directory from the attachment URL\r\n $attachment_url = str_replace( $upload_dir_paths['baseurl'] . '/', '', $attachment_url );\r\n\r\n // Finally, run a custom database query to get the attachment ID from the modified attachment URL\r\n $attachment_id = $wpdb->get_var( $wpdb->prepare( \"SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'\", $attachment_url ) );\r\n\r\n }\r\n\r\n return $attachment_id;\r\n}", "function mafiran_get_attachment_id_by_url( $url ) {\n $attachment_id = 0;\n $dir = wp_upload_dir();\n if ( false !== strpos( $url, $dir['baseurl'] . '/' ) ) { // Is URL in uploads directory?\n $file = basename( $url );\n $query_args = array(\n 'post_type' => 'attachment',\n 'post_status' => 'inherit',\n 'fields' => 'ids',\n 'meta_query' => array(\n array(\n 'value' => $file,\n 'compare' => 'LIKE',\n 'key' => '_wp_attachment_metadata',\n ),\n )\n );\n $query = new WP_Query( $query_args );\n if ( $query->have_posts() ) {\n foreach ( $query->posts as $post_id ) {\n $meta = wp_get_attachment_metadata( $post_id );\n $original_file = basename( $meta['file'] );\n $cropped_image_files = wp_list_pluck( $meta['sizes'], 'file' );\n if ( $original_file === $file || in_array( $file, $cropped_image_files ) ) {\n $attachment_id = $post_id;\n break;\n }\n }\n }\n }\n return $attachment_id;\n}", "public function photoURL($ID) {\n\t\t\t\t$image = File::get_by_id($ID);\n\t\t\t\t$url = $image->getAbsoluteURL();\n\t\t\t\treturn $url;\n\t\t}", "static function get_attachment_id_by_url($url) {\n\t\t// Split the $url into two parts with the wp-content directory as the separator\n\t\t$parsed_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );\n\n\t\t// Get the host of the current site and the host of the $url, ignoring www\n\t\t$this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );\n\t\t$file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );\n\t\t// Return nothing if there aren't any $url parts or if the current host and $url host do not match\n\t\tif ( ! isset( $parsed_url[1] ) || empty( $parsed_url[1] ) || ( $this_host != $file_host ) ) {\n\t\t\treturn null;\n\t\t}\n\t\t// Now we're going to quickly search the DB for any attachment GUID with a partial path match\n\t\t// Example: /uploads/2013/05/test-image.jpg\n\t\tglobal $wpdb;\n\t\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM {$wpdb->prefix}posts WHERE guid RLIKE %s;\", $parsed_url[1] ) );\n\t\t// Returns null if no attachment is found\n\t\tif ( ! empty( $attachment[0] ) ) {\n\t\t\treturn $attachment[0];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function ts_get_attachment_id_from_src ($image_src) {\r\n\r\n\tglobal $wpdb;\r\n\t$query = $wpdb -> prepare(\"SELECT ID FROM {$wpdb->posts} WHERE guid= %s \",$image_src);\r\n\t$id = $wpdb->get_var($query);\r\n\treturn $id;\r\n}", "function get_attachment_id_from_src ($image_src) {\n\n\tglobal $wpdb;\n\t$query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'\";\n\t$id = $wpdb->get_var($query);\n\treturn $id;\n\n}", "function url_to_postid($url)\n {\n }", "function truethemes_get_attachment_id_from_src($image_src){\n $image_src = esc_url($image_src);\n\n\t\t//irregardless of multisite or single install\n\t\t//$wpdb->posts will point to the correct posts table.\n\t\t//tested and proven on multisite setup.\n \n //mod by denzel\n //@since version 3.0, check WordPress version to determine which prepared statement to use.\n $check_wp_version = get_bloginfo('version');\n if($check_wp_version < 3.5){\n\t\tglobal $wpdb;\n\t\t$query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'\";\n\t\t$id = $wpdb->get_var( $wpdb->prepare( $query ) );\n\t\t\n\t}else{\n\t\tglobal $wpdb;\n\t\t$query = $wpdb->prepare(\"SELECT ID FROM {$wpdb->posts} WHERE guid=%s\",$image_src);\n\t\t$id = $wpdb->get_var($query);\n\t}\n\t\treturn $id;\n\n}", "function bandcamp_album_id($url) {\n\n $content = file_get_contents($url, false, null, -1);\n\n if (preg_match('/<!-- album id ([0-9]*) -->/UimsS', $content, $match)) {\n\n if (isset($match[1])) {\n return $match[1];\n } else {\n return false;\n }\n\n } else {\n\n return false;\n\n }\n\n }", "public function getId()\n\t{\n\t $pattern = '/http\\:\\/\\/(\\w{3}\\.)?break.com\\/(.*)/';\n\t preg_match( $pattern, $this->url, $match );\n\n return !empty( $match[2] ) ? $match[2] : null;\n\t}", "public function idByUrl($url) {\n $url_parts = parse_url($url);\n if (isset($url_parts['host']) and in_array($url_parts['host'], self::$_hosts) and isset($url_parts['query'])) {\n $query = $url_parts['query'];\n $params = explode('&', $query);\n foreach ($params as $pair) {\n list($key, $value) = explode('=', $pair);\n if ($key === 'v' and $value) {\n return $value;\n }\n }\n }\n\n return null;\n }", "private function getIdFromRedirectedUrl(): string\n {\n $url = $this->getResponse()\n ->getHeader('Location')\n ->getFieldValue();\n $pattern = '!/id/(.*?)/!';\n $result = preg_match($pattern, $url, $matches);\n\n return $result ? $matches[1] : '';\n }", "function get_guid_from_url($url) {\n\treturn 0;\n}", "function GetFidFromUrl($url)\n{\n\t$url = mysql_real_escape_string($url);\n\t$result = mysql_query(\"SELECT id FROM files WHERE url='$url'\") or die();\n\treturn mysql_result($result, 0);\n}", "function get_attachment_id_from_src ($image_src) {\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'\";\n $id = $wpdb->get_var($query);\n return $id;\n}", "function getIdFromLinkVnExpress($url) {\n // tra ve dc id cua url truyen vao\n // url thi la bat ky link nao theo dung dinh dang cua VNExpress\n $arrUrl = explode('-', $url); // chuyen chuoi ve mang\n $strId = end($arrUrl); // lay ra phan tu cuoi cung cua mang va khong lam thay doi mang ban dau\n $id = intval($strId);\n return $id;\n}", "public function get_image_id() {\r\n return $this->image_id;\r\n }", "function imageID( )\r\n {\r\n return $this->ImageID;\r\n }", "static function getPMIDfromURL($url)\n {\n $pieces = explode('/', $url); // make array of url bits\n $id = preg_grep(\"/[0-9]/\", $pieces); // get just the PMID portion of URL\n $id = array_values($id); // reset array keys\n if ($id[0]) {\n return $id[0]; // return the PMID\n } else {\n return \"There is an error with the url\";\n }\n }", "protected function getImageId(): string\n {\n // We can safely use `getcwd()` even in a subdirectory.\n $git = new Repository(getcwd());\n $tag = $this->options->getDockerTag();\n if (!$tag || $tag == 'auto') {\n $tag = $git->getMainBranch()->getName();\n $this->output->writeln(\"<info>Docker tag not specified. Using current branch name: {$tag}</info>\");\n\n // We should be using the tag 'latest' if the current branch is 'master' or 'main'.\n if ($tag == 'master' || $tag == 'main') {\n $tag = 'latest';\n $this->output->writeln(\n \"<info>Using Docker tag 'latest' for branch '{$tag}'.</info>\",\n OutputInterface::VERBOSITY_VERBOSE\n );\n }\n }\n\n $imageName = $this->options->getDockerImageName();\n if (!$imageName || $imageName == \"auto\") {\n // Throws an exception if the remote not found, so we don't have to.\n $remote = $git->getRemote($this->options->getGitRemote(), false);\n $imageName = $this->getImageNameFromRepoUrl($remote->getFetchURL());\n $this->output->writeln(\"<info>Docker image not specified. Using from git repository: {$imageName}</info>\");\n }\n\n // Determine the image name (path) from the git remote URL.\n return sprintf(\"%s:%s\", $imageName, $tag);\n }", "function jmayt_id_from_url($url) {\n if (preg_match('%(?:youtube(?:-nocookie)?\\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\\.be/)([^\"&?/ ]{11})%i', $url, $match)) {\n $id = $match[1];\n return $id;\n }\n return false;\n}", "public function sel_next_image_id()\n\t{\n\t\t$image_id = null;\n\t\ttry{\n\t\t\t$m_image = new Model_M_Image($this->db, $this->client_id);\n\t\t\t$image_id = $m_image->sel_next_id();\n\t\t} catch(Exception $e){\n\t\t\tKohana::$log->add(Log::ERROR, Kohana_Exception::text($e))->write();\n\t\t\t$image_id = null;\n\t\t}\n\t\treturn $image_id;\n\t}", "function L_getImage($number) {\n\t\t\n\t\tglobal $post;\n\t\t$img = '';\n\t\t$output = preg_match_all('/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', $post->post_content, $matches);\n\t\t$img = $matches [1] [$number];\n\n\t\treturn $img;\n\t\n\t}", "function culturefeed_entry_ui_collaboration_get_image_from_url($image) {\n\n // See if the image is stored on the local url.\n $base_path = $GLOBALS['base_url'] . '/' . variable_get('file_public_path', conf_path() . '/files') . '/';\n $parts = explode($base_path, $image);\n if (count($parts) == 2 && $parts[1]) {\n\n $files = entity_load('file', FALSE, array('uri' => 'public://' . $parts[1]));\n if (!empty($files)) {\n return reset($files);\n }\n\n }\n\n}", "function origincode_gallery_video_get_video_gallery_id()\n{\n if (isset($_GET['page']) && $_GET['page'] == 'video_galleries_origincode_video_gallery') {\n if (isset($_GET[\"id\"])) {\n $id = absint($_GET[\"id\"]);\n } else {\n $id = 0;\n }\n }\n return $id;\n}", "public function getURLID( $url )\n {\n if( !empty($this->urlIDs[ $url ]) ){ return $this->urlIDs[ $url ]; }\n else\n {\n $theURLID = $this->APICall( array( 'url' => $url ), \"Could not lookup the URL ID for url \" . $url );\n $this->urlIDs[ $url ] = $theURLID;\n return $theURLID;\n }\n }", "public function getId()\n\t{\n\t\t$videoId\t= '';\n\n\t\tpreg_match('/videos\\/(.*)/', $this->url , $matches);\n\t \tif (!empty($matches[1])){\n\t\t\t$videoId\t= $matches[1];\n\t\t}\n\n\t\treturn $videoId;\n\t}", "protected function GetImageFromPageTable()\n {\n $imageID = null;\n $activePage = $this->getActivePageService()->getActivePage();\n if (array_key_exists('images', $activePage->sqlData)) {\n $oPageImages = $activePage->GetImages('images');\n if ($oPageImages->Length() > 0) {\n /** @var $oImage TCMSImage */\n if ($this->bPickRandomImage) {\n $oImage = $oPageImages->Random();\n } else {\n $oImage = $oPageImages->Current();\n }\n $imageID = $oImage->id;\n }\n }\n\n return $imageID;\n }", "function get_id_from_link($link)\n\t{\n\t\t$link_bits = explode('/', $link);\n\t\treturn $link_bits[(count($link_bits)-1)];\n\t}", "function get_image($image_id)\n\t{\n\t\t// global variables from config/db_config.php\n\t\tglobal $idea_db;\n\t\tglobal $images_db_table;\n\t\tglobal $db_hostname;\n\t\tglobal $db_user;\n\t\tglobal $db_password;\n\n\t\t$query = \"SELECT * FROM $images_db_table WHERE id='$image_id';\";\n\n\t\tif ($result = receive_query($query, $db_hostname, $db_user,\n\t\t$db_password,$idea_db))\n\t\t{\n\t\t\t// extract record from query\n\t\t\t$row = $result->fetch_array();\n\t\t\treturn $row['filename'];\n\t\t} else {\n\t\t\treturn NULL;\n\t\t}\n\t}", "function retrieveOneImageId($folderId, $apiKey){\n $fileArray = retrieveOneFileArray($folderId, $apiKey);\n $filteredFileArray = filterByMimeType($fileArray, \"image/\");\n return getfileIds($filteredFileArray);\n}", "function get_image_url ($type = null, $id = null){\n\n if(file_exists('uploads/' . $type . '_image/' . $id . '.jpg'))\n $image_url = base_url(). 'uploads/' . $type . '_image/' . $id . '.jpg';\n else\n $image_url = base_url(). 'uploads/default_image.jpg';\n\n return $image_url;\n }", "function odin_get_image_url( $id, $width, $height, $crop = true, $upscale = false ) {\n\t$resizer = Odin_Thumbnail_Resizer::get_instance();\n\t$origin_url = wp_get_attachment_url( $id );\n\t$url = $resizer->process( $origin_url, $width, $height, $crop, $upscale );\n\n\tif ( $url ) {\n\t\treturn $url;\n\t} else {\n\t\treturn $origin_url;\n\t}\n}", "function iti_get_image_alt_from_url( $url = '' ) {\n\tglobal $wpdb;\n\n\t$url = esc_url( $url );\n\n\t/** @noinspection PhpUndefinedMethodInspection */\n\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $url ) );\n\n\t$post_id = isset( $attachment[0] ) ? $attachment[0] : 0;\n\t$alt = get_post_meta( absint( $post_id ), '_wp_attachment_image_alt', true );\n\n\treturn $alt;\n}", "public static function getVimeoId($url){\n return self::parseForLastParam($url);\n }", "public function getId() {\n\t\treturn (string) $this->photo['id'];\n\t}", "public function imgset_id($format = '')\n {\n return $this->getVar('imgset_id', $format);\n }", "function get_thumbnail_url($value)\n{\n\t$thumbnailUrl = '';\n\t\n\tif (is_object($value)) {\n\t\t$thumbnailUrl = $value->{'@id'};\t\t\n\t}\n\telse\n\t{\n\t\t$thumbnailUrl = $value;\t\n\t}\n\t\n\t// hack to handle CDN issues\n\t$thumbnailUrl = preg_replace('/https:\\/\\/cdn.rawgit.com\\//', 'https://raw.githubusercontent.com/', $thumbnailUrl);\n\t\n\treturn $thumbnailUrl;\n}", "private function getPicture($id)\n\t{\n\t\t$url = 'https://graph.facebook.com/' . $id . '/picture?type=normal';\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, true);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$a = curl_exec($ch);\n\t\t$url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);\n\t\tcurl_close($ch);\n\t\treturn $url;\n\t}", "public function get_attachment_id( $image_tag ) \n\t\t{\n\t\t\t$attachment_id = false;\n\t\t\t$match = array();\n\t\t\tif ( preg_match( '/wp-image-([0-9]+)/i', $image_tag, $match ) ) \n\t\t\t{\n\t\t\t\t$attachment_id = absint( $match[1] );\n\t\t\t}\n\t\t\t\n\t\t\treturn $attachment_id;\n\t\t}", "function getImg($postUrl){\n $url = explode(\"/\", $postUrl);\n $data = file_get_contents(\"htt\".\"p://\".$url[2].\"/mobile/post/\".$url[4]);\n preg_match_all('<a href=\"(.*?)\">',$data,$matches,PREG_PATTERN_ORDER);\n return $matches[1][0];\n}", "function getImageUrl($url)\r\n {\r\n if (substr_count($url, 'http://') or substr_count($url, 'https://')) {\r\n //\r\n } else {\r\n $page = $this->currentUrl;\r\n if ($this->baseHrefs[$page]) {\r\n $page = rtrim($this->baseHrefs[$page], '/');\r\n }\r\n else {\r\n $page = dirname($page);\r\n }\r\n if (!substr_count($url, '/')) return $page . '/' . $url;\r\n $page = 'http://' . parse_url($page, PHP_URL_HOST);\r\n $url = $page . '/' . ltrim($url, '/');\r\n }\r\n $url = html_entity_decode($url);\r\n $url = str_replace(' ', '%20', $url);\r\n return $url;\r\n }", "public function getMediaId();", "function Image_url($random_number)\n{\n $url = \"https://xkcd.com/{$random_number}/info.0.json\";\n $url = Sanitize_url($url);\n $json = file_get_contents($url);\n $image_url = json_decode($json, true);\n return $image_url['img'];\n}", "protected function getImageWithId($id){\n $conn = static::connect();\n $stmt = $conn->prepare(\"SELECT * FROM images where id=:id\");\n $stmt->bindValue('id', $id, PDO::PARAM_INT);\n $stmt->execute();\n return $stmt->fetch(PDO::FETCH_ASSOC);\n }", "private function getProfileImage($id)\n\t{\n\t\t$url = 'https://graph.facebook.com/' . $id . '/picture';\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, true);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$a = curl_exec($ch);\n\t\t$url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);\n\t\tcurl_close($ch);\n\t\treturn $url;\n\t}", "private function _getAlbumImage($id, $type)\n\t{\n\t\treturn _PS_BASE_URL_.__PS_BASE_URI__.'modules/'.$this->name.'/images/c/'.$id.'-'.$type.'.jpg';\n\t}", "private function parseIdFromTweetUrl($tweetUrl)\n {\n $path = parse_url($tweetUrl)['path']; \n return explode('/', $path)[3];\n }", "public function getAlbumsId()\n {\n $url = str_replace(\"[:action]\", \"albums/ids\", self::ImgUrAPI_MINE_URL);\n $url = str_replace(\"[:user_id]\", $this->user_id, $url);\n $result = self::excuteHTTPSRequest($url, $this->accessToken);\n\n return isset($result['data']) && !empty($result['data']) ? $result['data'] : null;\n }", "function getImgurAlbum($url) {\n\t\t$data = file_get_contents($url);\n\t\tpreg_match_all('/http\\:\\/\\/i\\.imgur\\.com\\/(.*)\\.jpg/',$data,$matches);\n\t\treturn $matches = array_unique($matches[0]);\n\t}", "public function getPictureId()\n {\n return $this->pictureId;\n }", "function shariff3uu_catch_image() {\n\t\t$result = preg_match_all( '/<img.+src=[\\'\"]([^\\'\"]+)[\\'\"].*>/i', get_post_field( 'post_content', get_the_ID() ), $matches );\n\t\tif ( array_key_exists( 0, $matches[1] ) ) {\n\t\t\treturn $matches[1][0];\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "function image($imgId,$type='thumbs') {\n if(is_file($this->core->_SYS['CONF']['FTP_QUOTATIONS'].\"/\".$type.\"/\".$imgId)) {\n $imgUrl = $this->core->_SYS['CONF']['URL_IMAGES_QUOTATIONS'].\"/\".$type.\"/\".$imgId;\n }\n\n return $imgUrl;\n }", "function cjpopups_get_image_url($image){\n\tif(strpos($image, 'img') > 0){\n\t\t$xpath = new DOMXPath(@DOMDocument::loadHTML($image));\n\t\t$src = $xpath->evaluate(\"string(//img/@src)\");\n\t\treturn $src;\n\t}else{\n\t\treturn $image;\n\t}\n}", "public function get_image_url_filename($image_url){\n\n\t\t// $time_ini_get_image_url_filename = microtime(1);\n\n\t\t$image_url_info = pathinfo($image_url);\n\t\t$filename = rawurldecode($image_url_info['basename']);\n\t\t$filename = str_replace([\"#\", \"%\"], [\"_U23_\", \"_U25_\"], $filename);\n\n\t\t// sl_debbug('# time_get_image_url_filename: '.(microtime(1) - $time_ini_get_image_url_filename).' seconds.', 'timer');\n\n\t\treturn $filename;\n\n\t}", "function cl_wp_get_attachment_image_src($id, $type) {\n $url = wp_get_attachment_image_src($id, $type);\n if ( defined('FBRWEB_OFFLOAD_HOST') && ($rep = constant('FBRWEB_OFFLOAD_HOST')) ) {\n return str_replace( '//' . $_SERVER['HTTP_HOST'], '//' . $rep, $url);\n }\n return $url;\n}", "public static function getIdByURL($URL)\n\t{\n\t\t// exists\n\t\treturn (int) FrontendModel::getDB()->getVar('SELECT id\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM tags\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE url = ?;',\n\t\t\t\t\t\t\t\t\t\t\t\t\t(string) $URL);\n\t}", "private function getEdxCourseId($url)\n {\n return substr($url, strrpos($url,'-')+1);\n }", "public function getID($url,$type = \"video\"){\n parse_str(preg_replace('/https:\\/\\/[www|m]\\.youtube\\.com\\/|watch\\?|https:\\/\\/[www|m]\\.youtube\\.com\\/|playlist\\?/','',$url));\n if($type == \"video\"){\n if(isset($v)){return $v;}\n else{return FALSE;} \n }elseif($type == \"playlist\"){\n\n if(isset($list)){return $list;}\n else{return FALSE;}\n }else{return FALSE; } \n }", "public function getPhoto($id){\n $sql=\"SELECT from_url FROM people WHERE id_people=?\";\n $rs=$this->con->prepare($sql);\n $rs->execute(array($id));\n return $rs->fetch(PDO::FETCH_OBJ);\n }", "function get_song_id($imgSrc, $previewTrackName, $previewArtistName) {\n global $link;\n $sql = sprintf('select id \n from songs\n where img like \"%%%s%%\" and name like \"%%%s%%\" and artist like \"%%%s%%\"\n limit 1\n ',$imgSrc,$previewTrackName,$previewArtistName);\n \n $result = mysqli_query($link,$sql);\n $row = mysqli_fetch_array($result);\n return $row[0];\n}", "protected function GetImageFromDivisionTable()\n {\n $imageID = null;\n $activePage = $this->getActivePageService()->getActivePage();\n $oDivision = $activePage->getDivision();\n\n if (null !== $oDivision && is_array($oDivision->sqlData) && array_key_exists('images', $oDivision->sqlData)) {\n $oDivisionImages = $oDivision->GetImages('images');\n\n if ($oDivisionImages->Length() > 0) {\n /** @var $oImage TCMSImage */\n if ($this->bPickRandomImage) {\n $oImage = $oDivisionImages->Random();\n } else {\n $oImage = $oDivisionImages->Current();\n }\n $imageID = $oImage->id;\n }\n }\n\n return $imageID;\n }", "function get_image_url( $id, $width=false, $height=false ) {\n\t\t\n\t\t/**/\n\t\t// Get attachment and resize but return attachment path (needs to return url)\n\t\t$attachment = wp_get_attachment_metadata( $id );\n\t\t$attachment_url = wp_get_attachment_url( $id );\n\t\tif (isset($attachment_url)) {\n\t\t\tif ($width && $height) {\n\t\t\t\t$uploads = wp_upload_dir();\n\t\t\t\t$imgpath = $uploads['basedir'].'/'.$attachment['file'];\n\t\t\t\terror_log($imgpath);\n\t\t\t\t$image = image_resize( $imgpath, $width, $height );\n\t\t\t\tif ( $image && !is_wp_error( $image ) ) {\n\t\t\t\t\terror_log( is_wp_error($image) );\n\t\t\t\t\t$image = path_join( dirname($attachment_url), basename($image) );\n\t\t\t\t} else {\n\t\t\t\t\t$image = $attachment_url;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$image = $attachment_url;\n\t\t\t}\n\t\t\tif (isset($image)) {\n\t\t\t\treturn $image;\n\t\t\t}\n\t\t}\n\t}", "function strip_url( $url ) {\n\t\t\t$id_match = '[0-9a-zA-Z\\-_]+';\n\t\t\tif ( preg_match( '|https?://(www\\.)?youtube\\.com/(watch)?\\?.*v=(' . $id_match . ')|', $url, $matches ) )\n\t\t\t\t$id = $matches[3];\n\t\t\telse if ( preg_match( '|https?://(www\\.)?youtube(-nocookie)?\\.com/embed/(' . $id_match . ')|', $url, $matches ) )\n\t\t\t\t$id = $matches[3];\n\t\t\telse if ( preg_match( '|https?://(www\\.)?youtube\\.com/v/(' . $id_match . ')|', $url, $matches ) )\n\t\t\t\t$id = $matches[2];\n\t\t\telse if ( preg_match( '|http://youtu\\.be/(' . $id_match . ')|', $url, $matches ) )\n\t\t\t\t$id = $matches[1];\n\t\t\telse if ( !preg_match( '|^http|', $url, $matches ) )\n\t\t\t\t$id = $url;\n\t\t\t\n\t\t\treturn $id;\n\t\t}", "public function getImageUrl();", "public function getFirstImageUrl()\n {\n $url = '';\n if ($image = $this->getFirstImage()) {\n $url = $image->getUrl();\n }\n return $url;\n }", "public function id($format = 'N')\n {\n return $this->getVar('imgset_id', $format);\n }", "function get_featured_img_url($id) {\n\t$thumb_id = get_post_thumbnail_id($id);\n\t$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'grid-thumbnail-medium', true);\n\t$thumb_url = $thumb_url_array[0];\n\treturn $thumb_url;\n}", "function entry_id_from_url_title($url_title)\n\t{\n ee()->db->where('url_title', $url_title)->limit(1);\n $entry = ee()->db->get('channel_titles')->row_array(); \n if($entry)\n {\n return $entry['entry_id'];\n }\n return false;\n\t}" ]
[ "0.7743889", "0.7580079", "0.7571197", "0.7330971", "0.72314346", "0.7163625", "0.70910954", "0.7087257", "0.705534", "0.70504117", "0.6933549", "0.6880133", "0.6823867", "0.68002665", "0.6769917", "0.6767856", "0.67537844", "0.66945934", "0.667625", "0.6646649", "0.6620791", "0.6618596", "0.66111135", "0.6572515", "0.65629774", "0.6557902", "0.6540598", "0.652938", "0.65145165", "0.65078324", "0.65009236", "0.65004086", "0.6483737", "0.6465861", "0.64643824", "0.64623445", "0.64439005", "0.63598114", "0.6350043", "0.6314132", "0.6308999", "0.6305185", "0.6287805", "0.6280467", "0.62773764", "0.6203499", "0.6195105", "0.6188166", "0.6172222", "0.6146412", "0.61261356", "0.6123107", "0.6110356", "0.6108669", "0.6087329", "0.6082427", "0.60794777", "0.6008189", "0.6006844", "0.6001979", "0.59611565", "0.59579456", "0.5950113", "0.5928748", "0.59116596", "0.5901281", "0.58914804", "0.58856905", "0.58803546", "0.5879786", "0.5869532", "0.5833144", "0.5823357", "0.5812904", "0.5811131", "0.57739335", "0.57732075", "0.5766685", "0.5749184", "0.5747204", "0.5735475", "0.57330155", "0.573226", "0.5723516", "0.57181007", "0.5709281", "0.5698368", "0.5675571", "0.56718695", "0.56685394", "0.5656122", "0.5654408", "0.5645126", "0.5644028", "0.5643041", "0.56414807", "0.5635689", "0.5634485", "0.5630807", "0.5624619" ]
0.6978872
10
ANTI XSS & SQL INJECTION//
function antiinjection($data){ $filter_sql = stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES))); return $filter_sql; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sqlInjections($data){\n\t$value1=mysqli_real_escape_string($GLOBALS['link'],$data);\n\t$value1=trim($value1);\n\treturn $value1;\n\t}", "function anti_injection($data){\n\t$filter = stripslashes(strip_tags(htmlspecialchars($data, ENT_QUOTES)));\n\treturn $filter;\n}", "public function anti_injection($sql){\r\n /*\r\n\t\t$seg = preg_replace(sql_regcase(\"/(from|select|insert|delete|where|drop table|show tables|\\*|--|\\\\\\\\)/\"),\"\",$sql);\r\n\t\t$seg = trim($seg);//limpa espaços vazio\r\n\t\t$seg = strip_tags($seg);//tira tags html e php\r\n\t\t$seg = addslashes($seg);//Adiciona barras invertidas a uma string\r\n\t\treturn $seg;\r\n */\r\n return $sql;\r\n\t}", "public static function evilStrings()\n {\n while (true) {\n yield \"* WHERE 1=1; --\";\n yield \"<script>alert('xss')</script>\";\n }\n }", "function sqlsanitize($sql)\r\n{\r\n\t$trysan = str_replace(\"\\\\\", \"\\\\\\\\\", $sql);\r\n\t$trysan = str_replace(\"\\\"\", \"\\\"\\\"\", $trysan);\r\n\t$trysan = str_replace(\"'\", \"''\", $trysan);\r\n\treturn $trysan;\r\n}", "function anti_injection($sql)\n{\n\t$sql = preg_replace(sql_regcase(\"/(from|select|insert|delete|where|drop table|show tables|#|\\*|--|\\\\\\\\)/\"),\"\",$sql);\n\t$sql = trim($sql);//limpa espaços vazio\n\t$sql = strip_tags($sql);//tira tags html e php\n\t$sql = addslashes($sql);//Adiciona barras invertidas a uma string\n\treturn $sql;\n}", "function escape($s) {\r\n //return mysql_real_escape_string(strip_tags($s)); // uncomment in when you will use connection with database\r\n return strip_tags($s);\r\n}", "function security($input)\n{\n $input = mysql_real_escape_string($input);\n $input = strip_tags($input);\n $input = stripslashes($input);\n return $input;\n}", "function sanitize( $input ){\n $mysqli = self::dbconnect();\n $input = $mysqli->real_escape_string( $input );\n $input = trim($input);\n $input = htmlentities($input);\n $mysqli->close();\n return $input;\n }", "function safety($text){\r\n $text = strip_tags($text); //Remove html tags\r\n $text = $this->ixd->real_escape_string($text); // Make safe for Database.\r\n return $text;\r\n }", "function secure_input($data) {\r\n $data = trim($data);\r\n $data = stripslashes($data);\r\n $data = htmlspecialchars($data);\r\n // tbd mysql_real_escape_string\r\n return $data;\r\n}", "public function XSSfilter()\n {\n /**\n * @var array Исключения для полей с визуальным редактором\n */\n $exceptionsAllowingHTML = array( 'contest_text', 'results_contest' );\n\n foreach ($_POST as $key => $value){\n if (is_array($value)) {\n foreach ($value as $sub_key => $sub_value) {\n $sub_value = stripos( $sub_value, 'سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ') !== false ? '' : $sub_value ;\n $_POST[$key][$sub_key] = Security::xss_clean(HTML::chars($sub_value));\n }\n continue;\n }\n $value = stripos($value, 'سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ') !== false ? '' : $value ;\n\n /** $exceptionsAllowingHTML — allow html tags (does not fire HTML Purifier) */\n if ( in_array($key, $exceptionsAllowingHTML) === false) {\n $_POST[$key] = Security::xss_clean(HTML::chars($value));\n }\n }\n foreach ($_GET as $key => $value) {\n $value = stripos( $value, 'سمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ') !== false ? '' : $value ;\n $_GET[$key] = Security::xss_clean(HTML::chars($value));\n }\n\n }", "function sanitize($data) \n{\n\treturn htmlentities(strip_tags(mysql_real_escape_string($data)));\n}", "function sanitize_input($input) {\n $input = mysql_real_escape_string($input);\n return $input;\n}", "function sanitize ($data) {\n\t\treturn htmlentities (mysqli_real_escape_string ($GLOBALS['con'], $data),ENT_NOQUOTES,\"utf-8\");\n\t}", "function sanitize($data) {\n return htmlentities(strip_tags(mysql_real_escape_string($data)));\n }", "function sanitizeDBData($input) {\n $halfSan = filter_var($input, FILTER_SANITIZE_EMAIL);\n\n //sets slashes infront of \" ' and \\\n $output = filter_var($halfSan, FILTER_SANITIZE_MAGIC_QUOTES);\n\n return $output;\n}", "function db_output($string) {\n return htmlspecialchars($string);\n }", "public function ex_sanitize($data){\n\n\t\treturn mysql_real_escape_string(htmlentities(trim($data)));\n\n\t}", "function secur($string){return htmlspecialchars($string, ENT_QUOTES|ENT_SUBSTITUTE);}", "public function inject()\n\t{\n\t\t$insert = '?id=1%27 and 1%3d1 union select ';\n\t\treturn $insert;\n\t}", "function filterQuery($query){\n $query=htmlspecialchars(stripslashes($query));\n $query=str_ireplace(\"script\", \"blocked\", $query);\n $query=mysql_escape_string($query);\n\n return $query;\n}", "function sanitize($data){\r\n $conn = db ();\r\n return mysqli_real_escape_string($conn, $data);\r\n}", "function db_escape($input)\n{\n\tglobal $db;\n\treturn $db->real_escape_string($input);\n}", "function escape($value){//XSS attacks protection\n return htmlspecialchars($value , ENT_QUOTES,'UTF-8');\n }", "function xssafe($data, $encoding = 'UTF-8')\n{\n //return htmlspecialchars($data,ENT_QUOTES | ENT_HTML401,$encoding);\n return htmlspecialchars($data);\n}", "function sanitizeString($var)\n{\nglobal $connection;\n$var = strip_tags($var);\n$var = htmlentities($var);\n$var = stripslashes($var);\nreturn $connection->real_escape_string($var);\n}", "function esc_sql($data)\n {\n }", "public function sanitize($data){\n\n\t\treturn mysql_real_escape_string(htmlentities($data));\n\n\t}", "function sanitize($input){\n\tglobal $link;\n\t$input = htmlentities(strip_tags(trim($input)));\n\t$input = mysqli_real_escape_string($link, $input);\n\treturn $input;\n}", "abstract protected function _escape($s);", "function db_output($string) {\n\treturn htmlspecialchars($string);\n}", "function sanitize($data){\n$data=trim($data);\n$data=htmlspecialchars($data);\n$data=mysql_real_escape_string($data);\nreturn $data;\n}", "function sqlText($s, $db){\n\t// @ ! : _ - = + ? . , ' # / [ ] ( )\n\t$result = preg_replace(\"/[^a-zA-Z0-9@!: \\[\\]\\(\\)_\\-\\=\\+\\?\\.\\,\\'\\#\\/]+/\", \"\", $s);\n\treturn trim($db->real_escape_string($result));\n}", "public function sanitizing_attributes_sql($atr){\n\t\t$atr1 = $mysqli->real_escape_string($atr); //escapes special chars\n\t\treturn $atr1;\n\t}", "function hash_mysql_sanitize($pdata){\n\t\nif( isset($pdata) ){\n\n\t//make sure that $pdata is cleaned. put this in a header.\n\tforeach( $pdata as $key => $value ){\n\t\t//clean up!\n\t\tmysql_real_escape_string($value);\n\t}\n}\n\nreturn $pdata;\n}", "private function preventSQLInjection($string) {\n foreach ($string as $key => $value) {\n //Escapes special characters in a string for use in an SQL statement\n $value = mysql_real_escape_string($value);\n }\n return $string;\n }", "function insertData($strInput)//Use In inserting or updating data into database\n{\n\t$strInput = addslashes(unconvertHTML($strInput));\n\treturn $strInput;\n}", "function sql_desanitize($sql)\r\n{\r\n\t$trysan = str_replace(\"\\\\\\\\\", \"\\\\\", $sql);\r\n\t$trysan = str_replace(\"\\\"\\\"\", \"\\\"\", $trysan);\r\n\t$trysan = str_replace(\"''\", \"'\", $trysan);\r\n\treturn $trysan;\r\n}", "public static function test_input($data) {\r\n $data = trim($data);\r\n //This PHP function returns a string with backslashes in front of each character that needs to be quoted in a database query\r\n $data = addslashes($data);\r\n //The htmlspecialchars() function converts some predefined characters to HTML entities.\r\n //Translates: <script>location.href('http://www.hacked.com')</script> \r\n //To: &lt;script&gt;location.href('http://www.hacked.com')&lt;/script&gt;\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n }", "function rehtmlspecialchars($arg){\n\t//$arg = str_replace(\"\", \"<\", $arg);\n\t//$arg = str_replace(\" \", \"_\", $arg);\n\t$arg = str_replace(\"/\", \"\", $arg);\n\t$arg = str_replace(\"&\", \"\", $arg);\n\t$arg = str_replace(\"'\", \"\", $arg);\n\t$arg = str_replace(\"#\", \"\", $arg);\n\t$arg = str_replace(\"(\", \"\", $arg);\n\t$arg = str_replace(\")\", \"-\", $arg);\n\t$arg = str_replace(\".\", \"\", $arg);\n\t\n\treturn $arg;\n\t}", "function ppPrepareForDB($var) {\n $var = COM_checkHTML($var);\n $var = addslashes($var);\n return $var;\n}", "function safe_import($data)\n {\n return trim(mysql_real_escape_string($data));\n }", "function clean_input( $dirty_data ){\n\t//use the DB connection already established\n\tglobal $db;\n\t//clean the data and 'return' it so we can continue working with it\n\treturn mysqli_real_escape_string($db, strip_tags( $dirty_data ));\n}", "function make_safe($text) {\n\t// make_safe MUST be called AFTER db_connect()\n\t// database must be connected to use escape string function\n\t\n\t$text = stripslashes($text);\n\t$text = htmlentities($text);\n\t$text = strip_tags($text);\n\t$text = $GLOBALS['db_connection'] -> real_escape_string($text);\n\treturn $text;\n}", "function test_input($con,$data){\r\n$data=trim($data);\r\n$data= stripslashes($data);\r\n$data= mysqli_real_escape_string($con, $data);\r\n$data= htmlspecialchars($data);\r\nreturn $data;\r\n}", "function escaped_str($string)\n{\n $safe_string = Database::getInstance()->getConnection()->real_escape_string($string);\n return $safe_string;\n}", "private function mysql_protect($string) \n {\n return @ mysql_escape_string(trim(strip_tags(addslashes($string))));\n }", "function safe_import($data)\n {\n return trim(mysql_real_escape_string($data));\n }", "public static function escape($som) {}", "function SafeConvert($data){\n\t$data=trim($data);\n\t//convert special characters to html entities\n\t//most hacking inputs in XSS are HTML in nature, so converting them to special characters so that they are not harmful\n\t$data=htmlspecialchars($data);\n\t//sanitize before using any MySQL database queries\n\t//this will escape quotes in the input.\n\t$data = mysql_real_escape_string($data);\n\treturn $data;\n}", "abstract public function sanitize();", "public static function InjectionCleaner($var)\n {\n $var = htmlspecialchars($var);\n $var = str_replace(\"<?php\", \"\", $var);\n $var = str_replace(\"?>\", \"\", $var);\n $var = str_replace(\"SELECT\", \"\", $var);\n $var = str_replace(\"INSERT\", \"\", $var);\n $var = str_replace(\"UPDATE\", \"\", $var);\n $var = str_replace(\"DROP\", \"\", $var);\n $var = str_replace(\"TRUNCATE\", \"\", $var);\n $var = str_replace(\"CREATE\", \"\", $var);\n $var = str_replace(\"<script\", \"\", $var);\n $var = str_replace(\"data:image/jpeg;base64,\", \"\", $var);\n $var = str_replace(\"data:image/png;base64,\", \"\", $var);\n\n return $var;\n }", "protected function sanitize() {}", "private function quote( )\n {\n if ( @ count( $this->data_buffer ) == 0 )\n return;\n foreach ( $this->data_buffer as $key => $val )\n {\n if ( in_array( $key, $this->string_fields ))\n $this->data_buffer[$key] = @\"'\".mysql_real_escape_string($val,underQL::$db_handle).\"'\";\n else\n $this->data_buffer[$key] = $val;\n }\n }", "function db_input($string) {\n\t$DB = DB::DB()->getLink();\n\treturn $DB->real_escape_string($string);\n}", "function sloodle_clean_for_db($str)\n {\n return htmlentities($str, ENT_QUOTES, 'UTF-8');\n }", "function init__database_security_filter()\n{\n global $DB_ESCAPE_STRING_LIST;\n $DB_ESCAPE_STRING_LIST = array();\n}", "function escape_string($string)\n{\n\tglobal $connection;\n\t$string=htmlentities($string);\n\treturn $string;\n}", "function sterilize($input){\r\n return htmlspecialchars($input);\r\n }", "function escs(String $value)\n{\n // bring the global db connect object into function\n global $conn;\n\n $val = trim($value); // remove empty space sorrounding string\n $data = stripslashes($val);\n $data = htmlspecialchars($data);\n $val = mysqli_real_escape_string($conn, $value);\n\n return $data;\n}", "function mysql_prep_string($string) {\n global $db;\n return mysqli_real_escape_string($db->connection, htmlentities(strip_tags($string)));\n}", "public function _real_escape($data)\n {\n }", "private function mysql_protect($txt) \n\t\t{\n\t\t\t$txt = $this->link_mt->real_escape_string($txt);\n\t\t\treturn $txt;\n\t\t}", "function sanitize($data)\n{\n$data = trim($data);\n \n// apply stripslashes if magic_quotes_gpc is enabled\nif(get_magic_quotes_gpc())\n{\n$data = stripslashes($data);\n}\n \n// a mySQL connection is required before using this function\n$data = mysql_real_escape_string($data);\n \nreturn $data;\n}", "function sanitize_input($data)\n {\n $data = trim($data); //remove whitespaces \n $data = stripslashes($data); //such as '\n $data = htmlspecialchars($data); //such as >,<&\n return $data;\n }", "function check_input($data){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n $data = htmlentities($data);\n $data = mysql_real_escape_string($data);\n return $data;\n}", "function check_input($data){\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n $data = htmlentities($data);\n $data = mysql_real_escape_string($data);\n return $data;\n}", "function fixSQLInjection($value){\n $newstring=$value;\n //echo \"value=\".$value.\"<br/>\";\n $latestPos=0;\n $counter=0;\n if (strpos($value,',')!==false) throw new Exception (\"PASS. Comma is unavaiable as a character. PGSQL doesn\\'t like it :( \");\n //echo \"position of ': \";var_dump(strpos($value,'\\'')); echo \"<br/>\";\n while(($positionOfXrenb=strpos($value,'\\'',$latestPos))!==false){\n //echo \"GG\";\n $newstring = substr($newstring,0,$positionOfXrenb+$counter);\n $newstring.='\\'';\n $newstring.=substr($value,$positionOfXrenb,strlen($value)-$positionOfXrenb);\n //var_dump ($newstring);\n //echo \"<br/>\";\n $latestPos=$positionOfXrenb;\n $value[$positionOfXrenb]='X';\n $counter++;\n \n }\n //var_dump ($newstring);\n return $newstring;\n}", "function sanitize($db_link, $var) {\n\t\tif(get_magic_quotes_gpc()) $var = stripslashes($var);\n\t\t$var = htmlentities($var);\n\t\t$var = strip_tags($var);\n\t\t$var = mysqli_real_escape_string($db_link, $var);\n\t\treturn $var;\n\t}", "function filter($string){\n\t\t\t\t\t\t$string = htmlspecialchars($string);\n\t\t\t\t\t\t$string = preg_replace(array('`[^a-z0-9]`i','`[-]+`'), '-', $string);\n\t\t\t\t\t\t$string = mysql_escape_string($string);\n\t\t\t\t\t\treturn $string;\n\t\t\t\t\t}", "function escape($unsafe_string) {\n return mysqli_real_escape_string($dbc , $unsafe_string);\n}", "function html_xss_clean($text) {\n return htmlspecialchars($text);\n}", "function secure_input($input) {\n\t\t\t$input = trim($input);\n\t\t\t$input = htmlspecialchars($input);\n\t\t\treturn $input;\n\t\t}", "function escape_data ($data) {\n global $dbc;\n if (ini_get('magic_quotes_gpc')) {\n $data = stripslashes($data);\n }\n return mysql_real_escape_string (trim ($data), $dbc);\n}", "function sanitize($data)\n {\n $data=trim($data);\n $data=mysql_real_escape_string($data);\n return $data;\n }", "function secure_input($data) {\n $data = trim($data);\n // remove backslashes (\\)\n $data = stripslashes($data);\n // save as HTML escaped code --> any scripts in input data will not run\n $data = htmlspecialchars($data);\n return $data;\n }", "function sanitizeInput(&$string){\n $string = $this->connection->real_escape_string($string);\n }", "function escape($data){\r\n\t\t\tglobal $link;\r\n\t\t\treturn mysqli_real_escape_string($link, $data);\r\n\t\t}", "function _replacePlaceholdersInSQL(&$data){\n // allow current user name in filter:\n $data['sql'] = str_replace('%user%', $_SERVER['REMOTE_USER'], $data['sql']);\n // allow current date in filter:\n $data['sql'] = str_replace('%now%', dformat(null, '%Y-%m-%d'),$data['sql']);\n }", "private static function escapeSql($s) // {{{\n {\n $matches = array(\"\\\\\", \"'\", \"\\\"\" /*,\"\\0\", \"\\b\", \"\\n\", \"\\r\", \"\\t\"*/);\n $replacements = array(\"\\\\\\\\\", \"\\\\'\", \"\\\\\\\"\", /*\"\\\\0\", \"\\\\b\", \"\\\\n\", \"\\\\r\",\n \"\\\\t\"*/);\n $st = str_replace($matches, $replacements, $s);\n return $st;\n }", "function sS($var) {\n\t\t$var = strip_tags($var);\n\t\t$var = htmlentities($var);\n\t\t$var = stripslashes($var);\n\t\tglobal $connection;\n\t\treturn $connection->real_escape_string($var); //?\n\t}", "function clean($value) {\r\n\r\n\t/*$str = @trim($str);\r\n\r\n\tif(get_magic_quotes_gpc()) {\r\n\r\n\t\t$str = stripslashes($str);\r\n\r\n\t}\r\n\r\n\treturn mysql_real_escape_string($str);*/\r\n\r\n\t\r\n\r\n\t\t//function to check for both sql injection and cross site scripting\r\n\r\n\t\t //Trim the value\r\n\r\n\t\t $value = trim($value);\r\n\r\n\t\t \r\n\r\n\t\t// Stripslashes\r\n\r\n\t\tif (get_magic_quotes_gpc()) {\r\n\r\n\t\t\t$value = stripslashes($value);\r\n\r\n\t\t}\r\n\r\n\t\t\r\n\r\n\t\t // Convert all &lt;, &gt; etc. to normal html and then strip these\r\n\r\n\t\t $value = strtr($value,array_flip(get_html_translation_table(HTML_ENTITIES)));\r\n\r\n\t\t\r\n\r\n\t\t // Strip HTML Tags\r\n\r\n\t\t $value = strip_tags($value);\r\n\r\n\t\t\r\n\r\n\t\t// Quote the value\r\n\r\n\t\t$value = mysql_real_escape_string($value);\r\n\r\n\t\t$value = htmlspecialchars ($value);\r\n\r\n\t\treturn $value;\r\n\r\n}", "function escape_sq($str)\n{\n $esc_str = str_replace(\"'\", \"''\", $str);\n return $esc_str;\n}", "function pdo_escape_string($str, $link=NULL) {\r\n return pdo_real_escape_string($str, $link);\r\n }", "function sqlCode($s, $db){\n\t$result = preg_replace(\"/[^a-zA-Z0-9\\-]+/\", \"\", $s);\n\treturn trim($db->real_escape_string($result));\n}", "function normalizeInputedString($input, $connection) {\n $input = strip_tags($input);\n $input = mysqli_real_escape_string($connection, $input);\n return $input;\n}", "function escape_data($dataFromForms) {\n if (function_exists('mysql_real_escape_string')) {\n $dataFromForms = mysqli_real_escape_string (trim($dataFromForms), $connection);\n $dataFromForms = strip_tags($dataFromForms);\n } else {\n $dataFromForms = mysqli_escape_string (trim($dataFromForms));\n $dataFromForms = strip_tags($dataFromForms);\n }\n return $dataFromForms;\n }", "function safeSQL($source, &$connection) {\n\t\t// clean all elements in this array\n\t\tif (is_array($source)) {\n\t\t\tforeach($source as $key => $value)\n\t\t\t\t// filter element for SQL injection\n\t\t\t\tif (is_string($value)) $source[$key] = $this->quoteSmart($this->decode($value), $connection);\n\t\t\treturn $source;\n\t\t// clean this string\n\t\t} else if (is_string($source)) {\n\t\t\t// filter source for SQL injection\n\t\t\tif (is_string($source)) return $this->quoteSmart($this->decode($source), $connection);\n\t\t// return parameter as given\n\t\t} else return $source;\t\n\t}", "function strClean($strCadena){\n $string = preg_replace(['/\\s+/','/^\\s|\\s$/'],[' ',''], $strCadena);\n $string = trim($string); //Elimina espacios en blanco al inicio y al final\n $string = stripslashes($string); // Elimina las \\ invertidas\n $string = str_ireplace(\"<script>\",\"\",$string);\n $string = str_ireplace(\"</script>\",\"\",$string);\n $string = str_ireplace(\"<script src>\",\"\",$string);\n $string = str_ireplace(\"<script type=>\",\"\",$string);\n $string = str_ireplace(\"SELECT * FROM\",\"\",$string);\n $string = str_ireplace(\"DELETE FROM\",\"\",$string);\n $string = str_ireplace(\"INSERT INTO\",\"\",$string);\n $string = str_ireplace(\"SELECT COUNT(*) FROM\",\"\",$string);\n $string = str_ireplace(\"DROP TABLE\",\"\",$string);\n $string = str_ireplace(\"OR '1'='1\",\"\",$string);\n $string = str_ireplace('OR \"1\"=\"1\"',\"\",$string);\n $string = str_ireplace('OR ´1´=´1´',\"\",$string);\n $string = str_ireplace(\"is NULL; --\",\"\",$string);\n $string = str_ireplace(\"is NULL; --\",\"\",$string);\n $string = str_ireplace(\"LIKE '\",\"\",$string);\n $string = str_ireplace('LIKE \"',\"\",$string);\n $string = str_ireplace(\"LIKE ´\",\"\",$string);\n $string = str_ireplace(\"OR 'a'='a\",\"\",$string);\n $string = str_ireplace('OR \"a\"=\"a',\"\",$string);\n $string = str_ireplace(\"OR ´a´=´a\",\"\",$string);\n $string = str_ireplace(\"OR ´a´=´a\",\"\",$string);\n $string = str_ireplace(\"--\",\"\",$string);\n $string = str_ireplace(\"^\",\"\",$string);\n $string = str_ireplace(\"[\",\"\",$string);\n $string = str_ireplace(\"]\",\"\",$string);\n $string = str_ireplace(\"==\",\"\",$string);\n return $string;\n }", "function test_input($data){\r\n $data = trim($data); //remove white spaces\r\n $data = stripcslashes($data); //remove backslashes\r\n $data = htmlspecialchars($data);\r\n return $data;\r\n }", "function postValidate($string)\r\n\t{\r\n\t $instrucoesSQL = array( \"INSERT\", \"insert\", \"UPDATE\", \"update\", \"DELETE\", \"delete\", \"TRUNCATE\", \"truncate\", \"WHERE\", \"where\" );\r\n\r\n\t $retirandoPossiveisInjections = str_replace($instrucoesSQL, \"\", $string);\r\n\r\n\t return addslashes($retirandoPossiveisInjections);\r\n\t}", "function filterSpecials($data){\n\n if(!$this->isUTF8($data))\n $data = utf8_encode($data);\n $data = htmlspecialchars($data, ENT_QUOTES);\n\n return $data;\n }", "function input_validation($input) {\r\n\r\n global $con;\r\n $input_t = trim($input);\r\n $input_v = mysql_real_escape_string($con, $input_t);\r\n return $input_v;\r\n}", "function formatAndQuery() {\n\tglobal $DB;\n\t$args = func_get_args();\n\t$query = array_shift($args); #remove the first element of the array as its own variable\n\t$query = str_replace(\"%sv\",\"'%s'\",$query);\n\tforeach ($args as $key => $val)\n\t {\n\t $args[$key] = $DB->real_escape_string($val);\n\t\t\t$args[$key] = htmlspecialchars($val);\n\t }\n\t$query = vsprintf($query, $args);\n\t$result = $DB->query($query);\n\tif (!$result)\n\t{\n\tthrow new Exception($DB->error.\" [$query]\");\n\t}\n\treturn $result;\n}", "function sanitise_input($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n }", "public function sanitize($str){\n\t\tglobal $con;\n\t\t$invalid_characters = array(\"$\", \"%\", \"#\", \"<\", \">\", \"|\");\n\t\t$str = str_replace($invalid_characters, \"\", $str);\n\t\t$str=mysqli_real_escape_string($con,$str);\n\t\treturn $str;\n\t}", "function db_security($conn, $string) {\n if(ctype_digit($string))\n $string = intval($string);\n else {\n /*mysql_real_escape_string — Protège une commande SQL de la présence de caractères spéciaux*/\n $string = mysqli_real_escape_string($conn, $string);\n $string = addcslashes($string, '%_');\n }\n return ($string);\n }", "function sanitize_string_xss(string $data): string\n{\n return filter_var($data, FILTER_SANITIZE_STRING);\n}", "function sql_real_escape_string($val,$dbh=NULL)\n {\n $s = sql_quote_string($val, $dbh);\n return (string) substr($s, 1, strlen($s) -2 );\n// return addslashes($val);\n }" ]
[ "0.6846932", "0.6671799", "0.66669977", "0.6589908", "0.658406", "0.65651757", "0.65582883", "0.65257055", "0.6510999", "0.65039515", "0.6479666", "0.6462158", "0.6458724", "0.64330816", "0.6429838", "0.64138585", "0.64120257", "0.63999945", "0.6394304", "0.63847834", "0.63721806", "0.6369639", "0.63440466", "0.6341101", "0.6328934", "0.6323839", "0.63193756", "0.6313061", "0.6294414", "0.62867063", "0.6280756", "0.6269203", "0.6217232", "0.6216259", "0.6207281", "0.61881", "0.6180568", "0.6165488", "0.6161735", "0.6158982", "0.6124148", "0.6121815", "0.6119028", "0.6109477", "0.6104698", "0.60924923", "0.6070197", "0.60679966", "0.60573316", "0.6043115", "0.6039622", "0.60333824", "0.60327303", "0.603109", "0.6022736", "0.60172105", "0.60153824", "0.60129786", "0.60004425", "0.59902126", "0.598679", "0.5985277", "0.5977797", "0.5965188", "0.5951668", "0.59500164", "0.5941245", "0.5941245", "0.5936295", "0.5932831", "0.59296995", "0.59255844", "0.59214556", "0.5920814", "0.59207207", "0.5920216", "0.5918085", "0.59175867", "0.5915714", "0.5913356", "0.5909924", "0.5906209", "0.59042585", "0.589674", "0.58882064", "0.5870795", "0.5866516", "0.5864648", "0.5860482", "0.5860427", "0.5857407", "0.5855029", "0.58540195", "0.5852381", "0.5848831", "0.584264", "0.58293587", "0.5826272", "0.5825992", "0.58062977" ]
0.7492571
0
Create a new job instance.
public function __construct(Reservation $_reservation) { $this->reservation = $_reservation; $this->setReservationManagers($this->reservation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createJob( $creationParameters ){ return $this->APICallSub( '/jobs', array( 'create' => $creationParameters ), \"Could not create new job with query \" . $creationParameters['query'] . \" and operation \" . $creationParameters['operation'] ); }", "abstract public function makeJob();", "abstract public function makeJob();", "private function createSearchJob() {\n $response = $this->client->request('POST','search/jobs', [\n 'json' => [\n 'query' => $this->getSumoQuery(),\n 'from' => $this->start->format(DateTime::ATOM),\n 'to' => $this->end->format(DateTime::ATOM),\n 'timeZone' => $this->profile->getTimezone()\n ]\n ]);\n $code = $response->getStatusCode();\n if ($code !== 202) {\n throw new \\Exception('Error getting data from Sumologic, error was HTTP ' . $code . ' - ' . $response->getBody() . '.');\n }\n $data = json_decode($response->getBody());\n $this->jobId = $data->id;\n if ($this->output->isVerbose()) {\n $this->output->writeln(\" > Debug: Search job ID {$this->jobId} created.\");\n }\n }", "public function createJobObject($payload)\n {\n $job = new Job([\n 'title' => $payload['title'],\n 'name' => $payload['title'],\n 'description' => $payload['description'],\n 'url' => $payload['url'],\n 'location' => $payload['locations'],\n ]);\n\n $job->setCompany($payload['company'])\n ->setDatePostedAsString($payload['date'])\n ->setBaseSalary($payload['salary']);\n\n return $job;\n }", "public function createJobExecution(JobInstance $job)\n {\n return new JobExecution();\n }", "public function setJobName(string $jobName): JobInstanceInterface;", "public function __construct(Job $job)\n {\n $this->job = $job;\n }", "public static function createJob($project, $jobOptions, $parentJob = null) {\n\n // Check if the job must be CC\n $isCC = ($jobOptions->getProjectJobFileType() && $jobOptions->getProjectJobFileType() == ProjectJobFile::TYPE_CC);\n\n if ($jobOptions->getJobType())\n Subtitle::defineSubtitleExtension($jobOptions->getJobType());\n\n // Get job type service id\n $jobOptionsTypeService = JobTypeService::model()->byJobTypeAndService(\n $jobOptions->getJobType(),\n $jobOptions->getService()\n )->find();\n\n // Set attributes\n $projectJob = new PRMProjectJob();\n $projectJob->source_lang_id = $jobOptions->getSourceLanguage();\n $projectJob->target_lang_id = $jobOptions->getTargetLanguage();\n $projectJob->project_id = $project->id;\n $projectJob->job_type_id = $jobOptions->getJobType();\n $projectJob->job_type_service_id = $jobOptionsTypeService->id;\n $projectJob->subtitle_provided = $jobOptions->isSubtitleProvided() ? 1 : 0;\n $projectJob->status = parent::STATUS_NEW;\n $projectJob->due_date = $jobOptions->getDueDate();\n $projectJob->is_billable = ($jobOptions->getJobType() != JobType::TYPE_ACCEPTANCE) ? 1 : 0;\n $projectJob->is_cc = (int) $isCC;\n $projectJob->forced_subtitle = $jobOptions->getIsForced() ? 1 : 0;\n $projectJob->job_meta_type_id = $jobOptions->getMetaType();\n\n if($projectJob->save(false)) {\n\n $deliverySpecComponent = new DeliverySpecComponent();\n $projectJobPreference = $deliverySpecComponent->copyTerritoriesToJobPreferences($projectJob, $project->delivery_spec_id);\n // Set max_box_lines = 3 for CC jobs\n if($projectJobPreference instanceof ProjectJobPreference && $isCC) {\n $projectJobPreference->max_box_lines = 3;\n $projectJobPreference->save(false);\n }\n\n ProjectBreakdownReport::create(ProjectBreakdownReportActions::TASK_ADDED)\n ->forProjectJob($projectJob)\n ->save();\n\n if ($project->user_id){\n PUserJob::model()->assignJob($project->user_id, $projectJob->id);\n }\n\n ProjectJobParent::link($parentJob ? $parentJob->id : 0, $projectJob->id);\n\n if ($jobOptions->getOutputSupportedFile() instanceof ProjectSupportedFile) {\n $deliverableFile = new ProjectJobDeliverableFiles();\n $deliverableFile->project_job_id = $projectJob->id;\n $deliverableFile->project_supported_file_id = $jobOptions->getOutputSupportedFile()->id;\n $deliverableFile->file_name = $jobOptions->getOutputFileName();\n\n if ($jobOptions->getOutputPositioningType()){\n $deliverableFile->positioning_profile = \"0;{$jobOptions->getOutputPositioningType()};{$jobOptions->getOutputAspect()};{$jobOptions->getOutputAspectRatio()}\";\n }\n\n $deliverableFile->save(false);\n }\n\n // Return job\n return $projectJob;\n }\n\n return false;\n }", "public function createJobObject($payload)\n {\n $job = new Job;\n\n $map = $this->getJobSetterMap();\n\n array_walk($map, function ($path, $setter) use ($payload, &$job) {\n try {\n $value = static::getValue(explode('.', $path), $payload);\n $job->$setter($value);\n } catch (\\OutOfRangeException $e) {\n // do nothing\n }\n });\n\n return $job;\n }", "public function create(JobRequest $jobRequest)\n {\n $job = new Job();\n\n $job->business_person = $jobRequest->business_person;\n $job->principal_phone = $jobRequest->principal_phone;\n $job->optional_phone = $jobRequest->optional_phone;\n $job->init_date = $jobRequest->init_date;\n $job->finish_date = $jobRequest->finish_date;\n $job->city = $jobRequest->city;\n\n $job->save();\n\n return compact('job');\n }", "public function createNewJob($jobBody, $queue)\n {\n $job = new Job($jobBody, $queue);\n\n if ($this->jobHasBeenAddedFromOutside($job)) {\n $this->addMissingJobTimeData($job);\n }\n\n return $job;\n }", "protected function createJobFromPayload($payload = [])\n {\n return new Job([\n 'title' => $payload['jobTitle'],\n 'name' => $payload['jobTitle'],\n 'description' => $payload['descriptionFragment'],\n 'url' => $payload['jobViewUrl'],\n 'sourceId' => $payload['jobListingId'],\n 'location' => $payload['location'],\n 'industry' => $payload['jobCategory']\n ]);\n }", "public function created(Job $job)\n {\n //\n }", "protected function generateJob()\n\t{\n\t\t$name = $this->inflector->getJob();\n\n\t\t$this->call('make:job', compact('name'));\n\t}", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "static public function factory($job, $conn, $handle, $initParams=array())\n {\n if (empty($initParams['path'])) {\n $paths = explode(',', NET_GEARMAN_JOB_PATH);\n $file = null;\n\n foreach ($paths as $path) {\n $tmpFile = $path . '/' . $job . '.php';\n\n if (file_exists(realpath($tmpFile))) {\n $file = $tmpFile;\n break;\n }\n }\n }\n else {\n $file = $initParams['path'];\n }\n\n if ( ! file_exists($file) ) {\n throw new Net_Gearman_Job_Exception('Invalid Job class file: ' . (empty($file) ? '<empty>' : $file));\n }\n\n include_once $file;\n\n if (empty($initParams['class_name'])) {\n $class = NET_GEARMAN_JOB_CLASS_PREFIX . $job;\n }\n else {\n $class = $initParams['class_name'];\n }\n\n if (!class_exists($class)) {\n throw new Net_Gearman_Job_Exception('Invalid Job class: ' . (empty($class) ? '<empty>' : $class) . ' in ' . (empty($file) ? '<empty>' : $file) );\n }\n\n $instance = new $class($conn, $handle, $initParams);\n if (!$instance instanceof Net_Gearman_Job_Common) {\n throw new Net_Gearman_Job_Exception('Job is of invalid type: ' . get_class($instance));\n }\n\n return $instance;\n }", "public function creating(Job $job)\n {\n $job->setTokenValue();\n $job->setExpiresAtValue();\n $job->is_activated = 1;\n }", "private function createJob (string $cronTab) : CronJobInterface\n {\n return new class ($cronTab) implements CronJobInterface\n {\n /** @var string */\n private $cronTab;\n\n\n /**\n */\n public function __construct (string $cronTab)\n {\n $this->cronTab = $cronTab;\n }\n\n\n /**\n */\n public function getCronTab () : string\n {\n return $this->cronTab;\n }\n\n\n /**\n */\n public function getName () : string\n {\n return \"My Job\";\n }\n\n\n /**\n */\n public function execute (BufferedSymfonyStyle $io) : CronStatus\n {\n return new CronStatus(true);\n }\n };\n }", "private function createJob(array $data = [])\n {\n $workflow = fake(WorkflowModel::class);\n $stage = fake(StageModel::class, [\n 'action_id' => 'info',\n 'workflow_id' => $workflow->id,\n 'required' => 1,\n ]);\n fake(StageModel::class, [\n 'action_id' => 'button',\n 'workflow_id' => $workflow->id,\n 'required' => 0,\n ]);\n\n $data = array_merge([\n 'workflow_id' => $workflow->id,\n 'stage_id' => $stage->id,\n ], $data);\n\n return fake(JobModel::class, $data);\n }", "public function getNewJob() {\n # we can grab a locked job if we own the lock\n $rs = $this->runQuery(\"\n SELECT id\n FROM \" . self::$jobsTable . \"\n WHERE queue = ?\n AND (run_at IS NULL OR NOW() >= run_at)\n AND (locked_at IS NULL OR locked_by = ?)\n AND failed_at IS NULL\n AND attempts < ?\n ORDER BY created_at DESC\n LIMIT 10\n \", array($this->queue, $this->name, $this->max_attempts));\n\n // randomly order the 10 to prevent lock contention among workers\n shuffle($rs);\n\n foreach ($rs as $r) {\n $job = new DJJob($this->name, $r[\"id\"], array(\n \"max_attempts\" => $this->max_attempts,\n \"fail_on_output\" => $this->fail_on_output\n ));\n if ($job->acquireLock()) return $job;\n }\n\n return false;\n }", "public function store(Request $request): JobResource\n {\n $jobTypes = Factory::listTypes();\n $validValues = $this->validate(\n $request,\n [\n 'sample_code' => ['filled', 'string', 'alpha_dash'],\n 'name' => ['required', 'string'],\n 'type' => ['required', 'string', Rule::in($jobTypes->pluck('id'))],\n 'parameters' => ['filled', 'array'],\n ]\n );\n $parametersValidation = $this->_prepareNestedValidation(\n Factory::validationSpec($validValues['type'], $request)\n );\n $validParameters = $this->validate($request, $parametersValidation);\n $type = $validValues['type'];\n $validParameters = $validParameters['parameters'] ?? [];\n $job = Job::create(\n [\n 'sample_code' => $validValues['sample_code'] ?? null,\n 'name' => $validValues['name'],\n 'job_type' => $type,\n 'status' => Job::READY,\n 'job_parameters' => [],\n 'job_output' => [],\n 'log' => '',\n 'user_id' => \\Auth::guard('api')->id(),\n ]\n );\n $job->setParameters(Arr::dot($validParameters));\n $job->save();\n $job->getJobDirectory();\n\n return new JobResource($job);\n }", "public function __construct(JobPoster $job)\n {\n $this->job = $job;\n }", "public function create()\n {\n // Display form to create a new job\n return view('jobs.create');\n }", "public function __construct(Job $job)\n {\n parent::__construct();\n\n $this->job = $job;\n }", "protected function getJobInstance(): JobInstance\n {\n if (!isset($this->jobInstance)) {\n $id = $this->argument('instanceId');\n /** @noinspection PhpIncompatibleReturnTypeInspection */\n $this->jobInstance = JobInstance::findOrFail(intval($id));\n }\n\n return $this->jobInstance;\n }", "public function getInstance()\n {\n if (!is_null($this->instance)) {\n return $this->instance;\n }\n\n if (!class_exists($this->class)) {\n throw new \\RuntimeException('Could not find job class \"'.$this->class.'\"');\n }\n\n if (!method_exists($this->class, $this->method) or !is_callable(array($this->class, $this->method))) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" does not contain a public \"'.$this->method.'\" method');\n }\n\n $class = new \\ReflectionClass($this->class);\n\n if ($class->isAbstract()) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" cannot be an abstract class');\n }\n\n $instance = $class->newInstance();\n\n return $this->instance = $instance;\n }", "static function createJobDescriptorFromInput()\n {\n $obj = b2input()->json();\n $job = new \\scheduler\\JobDescriptor();\n\n $job->group = trim($obj->group) ?: b2config()->scheduler['defaultGroupName'];\n $job->name = $obj->name;\n $job->type = $obj->type;\n $job->description = $obj->description;\n\n if ($obj->data) {\n $job->data = parse_ini_string($obj->data);\n }\n if (empty($job->data)) {\n $job->data = null;\n }\n\n// var_dump($job);\n\n return $job;\n }", "public function create() {}", "public function __construct()\n {\n $this->jobService = new JobService();\n }", "public function create()\n {\n $job=new Job;\n return view('jobs.create',[\n 'job'=>$job,]);\n //\n }", "public function store(CreateJobFormRequest $request)\n {\n $job = Job::create($request->input());\n\n return response()->json($job, 201);\n\n }", "public function create()\n {\n return view('admin.job.create');\n }", "public function createAction(Request $request)\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('job_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function create(){}", "public function create(Request $request) {\n $jobPost = new Job();\n $jobPost->user_id = Auth::user()->id;\n\n // Substract one credit from user's subscription\n $userPlans = Auth::user()->plans;\n\n foreach ($userPlans as $plan) {\n if ($plan->credits > 0) {\n $plan->credits = $plan->credits - 1;\n $plan->save();\n }\n }\n\n $jobPostData = $request::input('jobPost');\n foreach ($jobPostData as $key => $value) {\n $jobPost[$key] = $value;\n }\n\n $jobPost->save();\n\n return $jobPost;\n }", "public function __construct($job)\n {\n $payload = [];\n $this->job = $job;\n $payload['data'] = json_encode($this->job);\n\n $payload['classname'] = $this->job->getNameOfClass();\n $this->payload = $payload;\n\n }", "public function create()\n {\n return view('profile.job.create');\n }", "public function create()\n {\n return view('job.add_job');\n }", "public function store(CreateRequest $request, Job $job)\n {\n $newTask = $request->validated();\n $newTask['job_id'] = $job->id;\n $task = Task::create($newTask);\n\n flash(__('task.created'), 'success');\n\n return redirect()->route('jobs.show', $job);\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function create()\n {}", "public function newAction()\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function createTask()\n {\n return factory($this->model)->create();\n }", "public function createJob(array $settings, $metaData = [], $priority = 0)\n {\n return $this->client->createJob([\n 'Role' => config('media-converter.iam_arn'),\n 'Settings' => $settings,\n 'Queue' => config('media-converter.queue_arn'),\n 'UserMetadata' => $metaData,\n 'StatusUpdateInterval' => $this->getStatusUpdateInterval(),\n 'Priority' => $priority,\n ]);\n }", "public function addNewJobOpo()\n {\n }", "public function insert($projectId, Google_Job $postBody, $optParams = array()) {\n $params = array('projectId' => $projectId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n $data = $this->__call('insert', array($params));\n if ($this->useObjects()) {\n return new Google_Job($data);\n } else {\n return $data;\n }\n }", "public function run()\n {\n Job::create([\n \"name\" => \"Wirausaha\"\n ]);\n\n Job::create([\n \"name\" => \"Wiraswasta\"\n ]);\n\n Job::create([\n \"name\" => \"Freelance\"\n ]);\n\n Job::create([\n \"name\" => \"Pelajar\"\n ]);\n }", "public function create() {\n \n }", "public function create() {\n \n }", "public static function createJob($mysqli,$name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate){\n $insert = \"INSERT INTO job (job_name,job_desc,cust_email,trade_name,area,preferred_cost,date_needed,offer_end_date) VALUES (?,?,?,?,?,?,?,?)\";\n $stmt = $mysqli->prepare($insert);\n $stmt->bind_param('sssssiss', $name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate); \n $stmt->execute();\n $stmt->close();\n $job = new Job(['JobName'],['JobDesc'],['Email'],['Trade'],['Area'],['JobCost'],['JobDate'],['EstDate']);\n return $job;\n }", "public function store(Request $request)\n {\n $job = new Job();\n $job->title = $request->title;\n $job->description = $request->description;\n $job->company_name = $request->company_name;\n $this->repo->save($job);\n return new JobsResources($job);\n }", "public function create()\n {\n $fields = Field::all();\n $jobTypes = config('user.job_type');\n\n return view('job.create', [\n 'fields' => $fields,\n 'jobTypes' => $jobTypes,\n ]);\n }", "public static function create($queue, $class, array $data = null, $run_at = 0)\n {\n $id = static::createId($queue, $class, $data, $run_at);\n\n $job = new static($queue, $id, $class, $data);\n\n if ($run_at > 0) {\n if (!$job->delay($run_at)) {\n return false;\n }\n } elseif (!$job->queue()) {\n return false;\n }\n\n Stats::incr('total', 1);\n Stats::incr('total', 1, Queue::redisKey($queue, 'stats'));\n\n return $job;\n }", "public function create()\n {\n return $this->objectManager->create($this->className);\n }", "public function create() {\r\n }", "public function submit(Job $job): JobResource\n {\n if (!$job->canBeModified()) {\n abort(400, 'Unable to submit a job that is already submitted.');\n }\n $job->setStatus(Job::QUEUED);\n JobRequest::dispatch($job);\n\n return new JobResource($job);\n }", "public function __construct(int $status, Job $job)\n {\n $this->status = $status;\n $this->job = $job;\n\n $this->updateTask($this->status, $this->job);\n }", "public function create()\n {\n //TODO\n }", "public function create()\n {\n return new $this->class;\n }", "public function create() {\n\t \n }", "public function create() {\n }", "public function create() {\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create()\n {\n return view('admin.jobs.create');\n }", "public function fake(Generator &$faker): Job\n {\n return new Job([\n 'name' => $faker->catchPhrase,\n 'summary' => $faker->sentence,\n 'workflow_id' => random_int(1, Fabricator::getCount('workflows') ?: 4),\n 'stage_id' => random_int(1, Fabricator::getCount('stages') ?: 99),\n ]);\n }", "public function run()\n {\n Job::factory()->count(100)->create();\n \n }", "public function create()\n {\n return view('admin.jobs.create');\n\n }", "public function create() {\n\t\t\t//\n\t\t}", "public function create() {\n\n\t\t\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "protected function _createJob($type, $job)\n\t{\n\t\treturn strtoupper($type) . ' ' . json_encode($job);\n\t}", "public function createJobWithSalesPrices(array $inputData): Job;", "public function create(Job $job)\n {\n $states = $job->prepareStates();\n $countries = $job->prepareCountries();\n $hours = $job->prepareHours();\n $minutes = $job->prepareMinutes();\n $ampm = $job->prepareAmpm();\n $open = $job->prepareOpen();\n return view('companies.create', compact(['states','countries','hours','minutes','ampm','open']));\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }" ]
[ "0.6921209", "0.69057024", "0.69057024", "0.6869179", "0.68103194", "0.6528797", "0.65196216", "0.6493415", "0.6490451", "0.6469612", "0.64285964", "0.6407571", "0.63951784", "0.63916427", "0.63756514", "0.63051784", "0.6257829", "0.6243103", "0.62026787", "0.6179217", "0.6075898", "0.60701805", "0.60486525", "0.6046617", "0.60303205", "0.602945", "0.6022536", "0.6021767", "0.5922327", "0.5879946", "0.58752656", "0.5857992", "0.5809801", "0.5805977", "0.58001745", "0.5788092", "0.5785923", "0.5778177", "0.57755536", "0.57561237", "0.570345", "0.5682758", "0.5682758", "0.5682758", "0.56823313", "0.56796294", "0.56788784", "0.56591874", "0.56541383", "0.5648576", "0.5633934", "0.5631753", "0.5631753", "0.56285495", "0.56268084", "0.56220424", "0.5613231", "0.5604739", "0.56038624", "0.560278", "0.5600494", "0.56000566", "0.5595701", "0.55924124", "0.55923295", "0.55923295", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5576929", "0.5536407", "0.55348086", "0.5530554", "0.55224764", "0.552151", "0.5516777", "0.55162746", "0.55162746", "0.55162746", "0.55162746", "0.55162746", "0.55162746", "0.55162746", "0.55162746", "0.55162746", "0.55162746", "0.55162746", "0.55162746", "0.551581", "0.54999197", "0.54995006", "0.54878587", "0.54878587", "0.54878587" ]
0.0
-1
gets email and mobile from reservation object then send an email , SMS & PUSH Notification to the User
public function sendReservationWasCreatedToCustomerByEmail(Reservation $reservation) { // Customer Reservation Created Notification Mail::send( 'emails/cart/customer/pending', [ 'user' => $reservation->user, 'reservation' => $reservation ], function ($message) use ($reservation) { $message->from('[email protected]', trans('HTR Sales!')); $message->to($reservation->user->email, $reservation->user->name)->subject(trans('Reservation is Pending')); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendEmail_customer($details, $sitetitle) {\n\t\t\t/*echo json_encode($details);\n\t\t\texit();*/\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$sendto = $details->accountEmail;\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$HOTEL_NAME = $details->title;\n\t\t\t\t$room_name = $details->subItem->title;\n\t\t\t\t$booking_adults = $details->subItem->booking_adults;\n\t\t\t\t$room_price = $details->subItem->price;\n\t\t\t\t$couponRate = $details->couponRate;\n\t\t\t\t\n\t\t\t\t$checkin = $details->checkin;\n\t\t\t\t\n\t\t\t\t$checkout = $details->checkout;\n\t\t\t\t\n\t\t\t\t$date = date ( \"m/d/Y\" , strtotime ( \"-1 day\" , strtotime ( $details->checkin ) ) );\n\t\t\t\t$no_of_room = $details->subItem->quantity;\n\t\t\t\t$thumbnail = $details->thumbnail;\n\t\t\t\t$hotel_id = $details->itemid;\n\n\t\t\t\t$invoicelink = '<tr><td colspan=\"2\"><strong>Pay now link : </strong><a href=\"' . base_url() . 'invoice?id=' . $invoiceid . '&sessid=' . $refno . '\" >' . base_url() . 'invoice?id=' . $invoiceid . '&sessid=' . $refno . '</a></td>\n </tr>';\n\t\t\t\t$template = $this->shortcode_variables(\"bookingordercustomer\");\n\t\t\t\t$details = email_template_detail(\"bookingordercustomer\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingordercustomer\");\n\t\t\t\t$values = array($invoiceid, $HOTEL_NAME, $refno, $deposit, $totalamount, $sendto, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $remaining , $name, $room_name, $date, $checkin, $checkout, $no_of_room, $thumbnail,$booking_adults,$room_price,$couponRate,$additionaNotes);\n\n\t\t\t\t$details = $this->html_template_booking($hotel_id,$invoiceid);\n\t\t\t\t$message .= str_replace($template, $values, $details);\n\t\t\t\t/*echo $message;\n\t\t\t\texit();*/\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $phone, \"bookingordercustomer\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Details and Invoice');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t/*echo $message;\n\t\t\t\texit();*/\n\t\t}", "function paid_sendEmail_owner($details) {\n\t\t\t\t$currencycode = $details->currCode;\n\t\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$custemail = $details->accountEmail;\t\t\t\t\n\t\t\t\n\t\t\t\t$sendto = $this->ownerEmail($details->module, $details->itemid);\n\t\t\t\t$sitetitle = \"\";\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= \"<h4><b>Booking Paid Successfully</b></h4>\";\n\t\t\t\t$message .= \"Invoice No.: \" . $invoiceid . \".<br>\";\n\t\t\t\t//$message .= \"Payment Method: \" . $paymethod . \".<br><br>\";\n\t\t\t\t$message .= \"Deposit Amount: \" . $currencycode . \" \" . $currencysign . $deposit . \"<br>\";\n\t\t\t\t$message .= \"Total Amount: \" . $currencycode . \" \" . $currencysign . $totalamount . \"<br><br>\";\n\t\t\t\t$message .= \"<h4><b>Customer Information</b></h4>\";\n\t\t\t\t$message .= \"Customer ID: \" . $custid . \"<br>\";\n\t\t\t\t$message .= \"Name : \" . $name . \"<br>\";\n\t\t\t\t$message .= \"Email : \" . $custemail . \"<br>\";\n\t\t\t\t$message .= \"Country : \" . $country . \"<br>\";\n\t\t\t\t$message .= \"Phone : \" . $phone . \"<br>\";\n\t\t\t\t$message .= \"<br> To view Invoice <a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$message .= $this->mailFooter;\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Payment Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function customerRegisterSuccess($observer)\n{\n\n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $customer = $observer->getEvent()->getCustomer();\n $fname=$customer->getFirstname();\n $lname=$customer->getLastname();\n $email= $customer->getEmail();\n\n $telephone= $customer->getAddressesCollection()->getFirstitem()->getTelephone();\n\n if ($telephone) {\n $text =$settings['customer_notification_message'];\n $text = str_replace('{{firstname}}', $fname, $text);\n $text = str_replace('{{lastname}}', $lname, $text);\n $text = str_replace('{{emailid}}', $email, $text);\n }\n \n array_push($settings['order_noficication_recipients'], $telephone);\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n return;\n}", "function paid_sendEmail_supplier($details) {\n\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$custemail = $details->accountEmail;\t\t\t\t\n\t\t\t\t$sendto = $this->supplierEmail($details->module, $details->itemid);\n\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"<a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$template = $this->shortcode_variables(\"bookingpaidsupplier\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidsupplier\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidadmin\");\n\t\t\t\t$values = array($invoiceid, $refno, $deposit, $totalamount, $custemail, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $name);\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"bookingpaidadmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Payment Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "function paid_sendEmail_admin($details) {\n\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$custemail = $details->accountEmail;\t\t\t\t\n\t\t\t\t$additionaNotes = $details->additionaNotes;\t\t\t\t\n\t\t\t\t$sendto = $this->adminemail;\n\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"<a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$template = $this->shortcode_variables(\"bookingpaidadmin\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidadmin\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidadmin\");\n\t\t\t\t$values = array($invoiceid, $refno, $deposit, $totalamount, $custemail, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $name,$additionaNotes);\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"bookingpaidadmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Payment Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "function paid_sendEmail_customer($details) {\n\t\t\t\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\n\t\t\t\t$total_amount = $details->checkoutTotal;\n\t\t\t\t $abc = $details->Extra_data->normal_price - $total_amount;\n if($abc < 0){\n $save = '0';\n\n }else{\n $save = number_format($details->Extra_data->normal_price - $total_amount,0);\n\t\t\t\t\t}\n\n\t\t\t\t$id = $details->id;\n\t\t\t\t$itemid = $details->itemid;\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$stars = $details->stars;\n\t\t\t\t$code = $details->code;\n\t\t\t\t$booking_adults = $details->Extra_data->adults;\n\t\t\t\t$child = $details->Extra_data->child;\n\t\t\t\t\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$deposit = $details->subItem->price;\n\t\t\t\t$quantity = $details->subItem->quantity;\n\t\t\t\t$hotel_title = $details->subItem->title;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$sendto = $details->accountEmail;\n\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$HOTEL_NAME = $details->title;\n\t\t\t\t$location = $details->location;\n\t\t\t\t$room_name = $details->subItem->title;\n\t\t\t\t$booking_adults = $details->subItem->booking_adults;\n\t\t\t\t$room_price = $details->subItem->price;\n\t\t\t\t\n\t\t\t\t$checkin = $details->checkin;\n\t\t\t\t\n\t\t\t\t$checkout = $details->checkout;\n\t\t\t\t$couponRate = $details->couponRate;\n\t\t\t\t\n\t\t\t\t$date = date ( \"m/d/Y\" , strtotime ( \"-1 day\" , strtotime ( $details->checkin ) ) );\n\t\t\t\t$no_of_room = $details->subItem->quantity;\n\t\t\t\t$thumbnail = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$details->thumbnail);\n\t\t\t\t$hotel_id = $details->itemid;\n\n\t\t\t\t$guest_name = $details->Extra_data->guest_name;\n\t\t\t\t$guest_age = $details->Extra_data->guest_age;\n\t\t\t\t$chil = $details->Extra_data->child;\n\t\t\t\t$child_name = isset($details->Extra_data->child_name) ? $details->Extra_data->child_name : 0;\n\t\t\t\t$child_age = isset($details->Extra_data->child_age) ? $details->Extra_data->child_age : 0;\n\t\t\t\t\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"\";\n\t\t\t\t\n\t\t\t\t$sendto = $details->accountEmail;\n\t\t\t\t\n\t\t\t\t $ptheme = pt_default_theme();\n\t\t\t\t\t$this->_config = config_item('theme');\n\t\t\t\t\t$uu = $this->_config['url'];\n\t\t\t\t$email_temp_img = $uu.$ptheme.'/email_temp_img/gb_email_temp_img/';\n\t\t\t\t/*$template = $this->shortcode_variables(\"bookingpaidcustomer\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidcustomer\");*/\n\n\t\t\t\t $book_room = $no_of_room;\n \n $room_per_guest = $booking_adults / $book_room;\n \n for ($r_i=0; $r_i < $book_room ; $r_i++) {\n \t$cc = $r_i+1;\n \t$no_top_hotel .= '<li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px;\">\n <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;margin-left: -30px;\">ROOM '.$cc.'</p>\n </li>';\n\t for($g_d_a=0; $g_d_a < $room_per_guest; $g_d_a++){\n\n\t $jj = $g_d_a + $r_i;\n\t $dd = $guest_name[$jj];\n\t $age = $guest_age[$jj];\n\t \n\n\t \t$no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 100%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px; \">\n\t\t <h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$dd.'</h5>\n \t\t<h5 class=\"right\" style=\"float:right;font-size: 16px;color: #0c134f;margin-right: 5px;\">'.$age.' Years</h5>\n\t\t </li>';\n\t }\n }\n\n if($chil > 0){\n\t $no_top_hotel .= ' <li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px; \">\n \t\t\t\t <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;\">CHILD DETAILS</p>\n \t\t\t\t </li>';\n \t for($c_i=0;$c_i<$chil;$c_i++){\n \t \t $ii = $c_i;\n\t \t\t $child_name1 = $child_name[$ii];\n\t \t\t $child_age1= $child_age[$ii];\n \t \t\n \t \t $no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 96%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px;\">\n \t\t\t<h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$child_name1.'</h5>\n \t\t<h5 class=\"right\" style=\"font-size: 16px;color: #0c134f;float: right;margin-right: 5px;\"><img src=\"'.$email_temp_img.'paynow_icon8.png\"> '.$child_age1.' Years</h5>\n \t\t\t</li>';\n \t}\n }\n\n \t$this->db->select('hotel_latitude,hotel_longitude,hotel_desc,hotel_map_city,hotel_stars');\n\t\t \t$this->db->where('hotel_id', $itemid);\n\t\t \t$query = $this->db->get('pt_hotels');\t\n\t\t \t$hotel_data = $query->result();\n\n\t\t \t$star_temp_img = $uu.$ptheme.'/images/';\n\n\t\t\t\t\t/*echo $hotel_data[0]->hotel_stars;*/\n\n\t\t\t\t\t$aaa = '';\n\t\t\t\t\tfor ($st_i=0; $st_i < 5 ; $st_i++) { \n \tif($st_i < $hotel_data[0]->hotel_stars){\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-on.png\">';\n \t}else{\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-off.png\">';\n \t}\n }\n\n\t\t \t$arrayInfo['checkIn'] = date(\"m/d/Y\", strtotime(\"+1 days\"));\n\t\t \t$arrayInfo['checkOut'] = date(\"m/d/Y\", strtotime(\"+2 days\"));\n\t\t \t$arrayInfo['adults'] = '1';\n\t\t \t$arrayInfo['child'] = '';\n\t\t \t$arrayInfo['room'] = '1';\n\t\t \t/*error_reporting(E_ALL);*/\n\t\t \t\t//$this->ci = & get_instance();\n\t\t\t\t\t\t// $this->db = $this->ci->db;\n\t\t\t\t\t$this->load->model('hotels/hotels_model');\n\t\t \t\n\t\t \t$local_hotels = $this->hotels_model->search_hotels_by_lat_lang($hotel_data[0]->hotel_latitude, $hotel_data[0]->hotel_longitude,$arrayInfo);\n\n\t\t \t$top_hotel = '<div class=\"col-sm-12 hotels\">';\n\n\t\t \tfor ($i=0; $i < count($local_hotels['hotels']) ; $i++) { \n\t\t \t\tif($i < 3){\n\t\t \t\t $image = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$bb[$i]->thumbnail);\n\t\t \t\t$bb = $local_hotels['hotels'];\n\t\t \t\t $bb[$i]->title;\n\t\t \t\t$top_hotel .= '<a class=\"col-sm-4\" href=\"'.$bb[$i]->slug.'\" style=\"margin-left: 2%;padding:10px;text-decoration: none; width:27.3333%;float: left; box-sizing: border-box;position: relative;\">';\n\t\t \t\t\t\t\t\tif($image == \"\"){\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$uu.$ptheme.'/email_temp_img/gb_email_temp_img/email-d-lasvegas.png\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$image.'\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<p style=\"text-align:center;margin:0px;color: rgb(12, 19, 79);font-size: 14px;margin: 20px 0 10px;font-family: \\'Roboto\\',sans-serif;\">'.$this->custom_echo($bb[$i]->title, 25).'</p>\n\t\t\t\t\t\t\t\t\t\t\t<h4 style=\" text-align:center;margin:0px; color: rgb(28, 192, 251);font-size: 20px;font-weight: 600;font-family: \\'Roboto\\',sans-serif;\">'.$bb[$i]->currCode.$bb[$i]->price.'</h4>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t \t} \n\t\t }\n\n\t\t \t$map = '<div class=\"col-sm-12 map\" style=\"width: 100%;padding-left: 0;float: left; box-sizing: border-box;min-height: 1px; padding-right:0px; position: relative;\">\n\t\t\t\t\t\t\t\t <a href=\"http://maps.google.com/?daddr={hotel_name}\" target=\"_blank\"> \n <img style=\"width:100%\" border=\"0\" src=\"https://maps.googleapis.com/maps/api/staticmap?center='.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&zoom=14&size=620x260&markers=size:mid%7Ccolor:red%7C'.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&key=AIzaSyAH65sTGsDsP4mMpmbHC8zqRiM1Qh07iL8\" alt=\"Google map\"></a>\n\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t$res = $this->settings_model->get_contact_page_details();\n\t\t\t\t$contact_phone = $res[0]->contact_phone;\n\t\t\t\t$contact_email = $res[0]->contact_email;\n\t\t\t\t$contact_address = $res[0]->contact_address;\n\n\t\t\t\t\n\n\t\t\t\t$template = array(\"{invoice_id}\", \"{hotel_name}\", \"{stars}\", \"{location}\", \"{code}\",\"{invoice_code}\", \"{deposit_amount}\", \"{total_amount}\", \"{customer_email}\", \"{customer_id}\", \"{country}\", \"{phone}\", \"{currency_code}\", \"{currency_sign}\", \"{invoice_link}\", \"{site_title}\", \"{remaining_amount}\", \"{fullname}\",\"{room_name}\",\"{date}\",\"{checkin}\",\"{checkout}\",\"{no_of_room}\",\"{thumbnail}\",\"{booking_adults}\",\"{room_price}\",\"{couponRate}\",\"{additionaNotes}\",\"{email_temp_img}\",\"{quantity}\",\"{hotel_title}\",\"{booking_adults}\",\"{child}\",\"{no_top_hotel}\",\"{top_hotel}\",\"{map}\",\"{aaa}\",\"{save}\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidcustomer\");\n\t\t\t\t$values = array($invoiceid, $HOTEL_NAME, $stars, $location, $code, $refno, $deposit, $total_amount, $sendto, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $remaining , $name, $room_name, $date, $checkin, $checkout, $no_of_room, $thumbnail,$booking_adults,$room_price,$couponRate,$additionaNotes,$email_temp_img, $quantity,$hotel_title,$booking_adults,$child,$no_top_hotel,$top_hotel,$map,$aaa,$save);\n\n\t\t\t\t$HTML_DATA = file_get_contents( $uu.$ptheme.'/invoice.html');\n\t\t\t\t$message = str_replace($template, $values, $HTML_DATA);\n\n\t\t\t\t\n\t\t\t\t/*$message = $this->mailHeader;*/\n\t\t\t\t/*echo '<pre>'.json_encode($message).'</pre>';\n\t\t\t\texit();*/\n\t\t\t\t/*$details = $this->html_template_booking($hotel_id,$invoiceid);\n\t\t\t\t$message .= str_replace($template, $values, $details);*/\n\t\t\t\t//$message .= $this->mailFooter;\n\t\t\t\t/*echo $message;\n\t\t\t\texit;*/\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $phone, \"bookingpaidcustomer\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Thanks for Booking at the '.$HOTEL_NAME);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t\n\t\t}", "public static function sendEmailReminder()\n {\n /*'text'->Notification.notification_message\n subject-> notification_subject \n\n sender can be from .env or email of currently logged user ....\n to... list from vic, vol, emp\n */\n /*Mail::raw(Input::get('notification_message'), function($message) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to('[email protected]', 'Chanda')->subject(Input::get('notification_subject'));\n });\n */\n\n $activities= Input::get('activity_id');\n //if volunteer = 'Y'\n if (Input::get('to_all_volunteers')=='Y') {\n\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('volunteer_id'); \n $volunteers = Volunteer::where('id', $activitydetails)->get(); \n foreach ($volunteers as $volunteer) {\n Mail::raw(Input::get('notification_message'), function($message) use ($volunteer) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($volunteer->email, $volunteer->last_name.\", \".$volunteer->first_name)->subject(Input::get('notification_subject'));\n });\n } \n }\n\n //if victim = 'Y'\n if (Input::get('to_all_victims')=='Y') {\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('victim_id'); \n $victims = Victim::where('id', $activitydetails)->get(); \n foreach ($victims as $victim) {\n Mail::raw(Input::get('notification_message'), function($message) use ($victim) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($victim->email, $victim->last_name.\", \".$victim->first_name)->subject(Input::get('notification_subject'));\n });\n }\n }\n\n //if employee = 'Y'\n if (Input::get('to_all_employees')=='Y') {\n\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('employee_id'); \n $employees = Employee::where('id', $activitydetails)->get(); \n foreach ($employees as $employee) {\n Mail::raw(Input::get('notification_message'), function($message) use ($employee) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($employee->email, $employee->last_name.\", \".$employee->first_name)->subject(Input::get('notification_subject'));\n });\n } \n }\n }", "public function sendPaymentNotification(){\n\n $sms_recipients=\"0712345648\";//empty string\n $username = Constants::$username;\n $apiKey = Constants::$apiKey;\n $from = Constants::$from;\n // dd($apiKey);\n\n $AT = new AfricasTalking($username, $apiKey);\n // // Get one of the services\n $recipients=\"\";\n $sms = $AT->sms();\n //user has a valid mobile number\n $phone = substr($sms_recipients,1);\n $recipients='+254'.$phone;//$data['phone'];//'+254712345678'\n // dd($recipients);\n\n // // Set the numbers you want to send to in international format\n \n // // Set your message\n $message = \"Testing SMS.\";\n\n // // Set your shortCode or senderId\n \n // Get one of the services\n try {\n // Thats it, hit send and we'll take care of the rest\n $result = $sms->send([\n 'to' => $recipients,\n 'message' => $message,\n 'from' => $from\n ]);\n\n print_r($result);\n \n } catch (Exception $e) {\n //echo \"Error: \".$e->getMessage();\n $result=$e->getMessage();\n print_r($result);\n }\n\n \n }", "public function SendReminder($sender_id,$api_key,$mobile,$outlet_name,$customer_name,$date,$time){\n\t\tif($this->IsLoggedIn('cashier')){\n\t\t\n\t\t\t//API key & sender ID\n\t\t\t// $apikey = \"ll2C18W9s0qtY7jIac5UUQ\";\n\t\t\t// $apisender = \"BILLIT\";\n\t\t\t$msg = \"Dear \".$customer_name.\", your have an upcoming appointment at \".$outlet_name.\" on \".$date.\" at \".$time.\" hrs.\";\n\t\t\t\t$msg = rawurlencode($msg); //This for encode your message content \t\t\n\t\t\t\t\n\t\t\t\t// API \n\t\t\t$url = 'https://www.smsgatewayhub.com/api/mt/SendSMS?APIKey='.$api_key.'&senderid='.$sender_id.'&channel=2&DCS=0&flashsms=0&number='.$mobile.'&text='.$msg.'&route=1';\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t$ch = curl_init($url);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\tcurl_setopt($ch,CURLOPT_POST,1);\n\t\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,\"\");\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,2);\n\t\t\t\n\t\t\t$data = curl_exec($ch);\n\t\t\treturn json_encode($data);\n\t\t}\n\t\telse{\n\t\t\t$this->LogoutUrl(base_url().\"Cashier/\");\n\t\t}\t\t\n\t}", "function sendEmail_supplier($details, $sitetitle) {\n\t\t\t$currencycode = $details->currCode;\n\t\t\t $currencysign = $details->currSymbol;\n\n\t\t\t $custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$custemail = $details->accountEmail;\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\t\t\t\t$sendto = $this->supplierEmail($details->module, $details->itemid);\n\t\t\t\t$invoicelink = \"<a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$template = $this->shortcode_variables(\"bookingordersupplier\");\n\t\t\t\t$details = email_template_detail(\"bookingordersupplier\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingorderadmin\");\n\t\t\t\t$values = array($invoiceid, $refno, $deposit, $totalamount, $custemail, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $name,$additionaNotes);\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"bookingorderadmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject($details[0]->temp_subject);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\n\t\t\t\n\t\t}", "function sendEmail_admin($details, $sitetitle) {\n\t\t\t\t$currencycode = $details->currCode;\n\t\t\t $currencysign = $details->currSymbol;\n\n\t\t\t $custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$custemail = $details->accountEmail;\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\t\t\t\t$sendto = $this->adminemail;\n\t\t\t\t$invoicelink = \"<a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$template = $this->shortcode_variables(\"bookingorderadmin\");\n\t\t\t\t$details = email_template_detail(\"bookingorderadmin\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingorderadmin\");\n\t\t\t\t$values = array($invoiceid, $refno, $deposit, $totalamount, $custemail, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $name,$additionaNotes);\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"bookingorderadmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject($details[0]->temp_subject);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function api_entry_sendnotification() {\n parent::validateParams(array('sender', 'receiver', 'subject'));\n\n if(!$this->Mdl_Users->get($_POST['sender'])) parent::returnWithErr(\"Sender is not valid\");\n if(!$this->Mdl_Users->get($_POST['receiver'])) parent::returnWithErr(\"Receiver is not valid\");\n\n $sender = $this->Mdl_Users->get($_POST['sender']);\n $receiver = $this->Mdl_Users->get($_POST['receiver']);\n\n unset($sender->password);\n unset($receiver->password);\n\n if ($_POST['subject'] == \"ipray_sendinvitation\") {\n $msg = $sender->username . \" has invited you.\";\n }\n else if ($_POST['subject'] == \"ipray_acceptinvitation\") {\n $msg = $sender->username . \" has accepted your invitation.\";\n\n // sender ---> receiver \n $this->Mdl_Users->makeFriends($_POST[\"sender\"], $_POST[\"receiver\"]);\n }\n else if ($_POST['subject'] == \"ipray_rejectinvitation\") {\n $msg = $sender->username . \" has rejected your invitation.\";\n }\n else if ($_POST['subject'] == 'ipray_sendprayrequest') {\n parent::validateParams(array('request'));\n }\n else if ($_POST['subject'] == 'ipray_acceptprayrequest') {\n parent::validateParams(array('request'));\n }\n else if ($_POST['subject'] == 'ipray_rejectprayrequest') {\n parent::validateParams(array('request'));\n }\n else {\n parent::returnWithErr(\"Unknown subject is requested.\");\n }\n\n if (!isset($receiver->devicetoken) || $receiver->devicetoken == \"\")\n parent::returnWithErr(\"User is not available at this moment. Please try again later.\");\n\n $payload = array(\n 'sound' => \"default\",\n 'subject' => $_POST['subject'],\n 'alert' => $msg,\n 'sender' => $sender,\n 'receiver' => $receiver\n );\n\n if (($failedCnt = $this->qbhelper->sendPN($receiver->devicetoken, json_encode($payload))) == 0) {\n $this->load->model('Mdl_Notifications');\n $this->Mdl_Notifications->create(array(\n 'subject' => $_POST['subject'],\n 'message' => $msg,\n 'sender' => $sender->id,\n 'receiver' => $receiver->id\n ));\n\n parent::returnWithoutErr(\"Contact request has been sent successfully.\");\n }\n else {\n parent::returnWithErr($failedCnt . \" requests have not been sent.\");\n }\n \n }", "function sendEmail_owner($details, $sitetitle) {\n\n\t\t\t $currencycode = $details->currCode;\n\t\t\t $currencysign = $details->currSymbol;\n\n\t\t\t $custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$custemail = $details->accountEmail;\n\n\t\t\t\t$sendto = $this->ownerEmail($details->module, $details->itemid);\n\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= \"<h4><b>Order Information</b></h4>\";\n\t\t\t\t$message .= \"Date :\" . $date . \".<br>\";\n\t\t\t\t$message .= \"Invoice No.: \" . $invoiceid . \".<br>\";\n\t\t\t\t//\t$message .= \"Payment Method: \" . $paymethod . \".<br><br>\";\n\t\t\t\t$message .= \"Deposit Amount: \" . $currencycode . \" \" . $currencysign . $deposit . \"<br>\";\n\t\t\t\t$message .= \"Total Amount: \" . $currencycode . \" \" . $currencysign . $totalamount . \"<br><br>\";\n\t\t\t\t$message .= \"<h4><b>Customer Information</b></h4>\";\n\t\t\t\t$message .= \"Customer ID: \" . $custid . \"<br>\";\n\t\t\t\t$message .= \"Name : \" . $name . \"<br>\";\n\t\t\t\t$message .= \"Email : \" . $custemail . \"<br>\";\n\t\t\t\tif(!empty($country)){\n\t\t\t\t$message .= \"Country : \" . $country . \"<br>\";\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$message .= \"Phone : \" . $phone . \"<br>\";\n\t\t\t\t$message .= \"<br> To view Invoice visit at: <a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t\n\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('New Booking Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function agent_email_appln()\n {\n $this->load->model('admin/admin_model');\n $booking_id = $this->input->post(\"booking_id\",true);\n\n $booking_details = $this->admin_model->get_tour_booking_details($booking_id);\n foreach ($booking_details as $bd) { }\n $mail_body = $this->input->post(\"mail_body\",true);\n $subject = $this->input->post(\"subject\",true);\n\n $agent_email = $this->input->post(\"agent_email\",true); //agent email id\n $mail_body = $this->input->post(\"mail_body\",true);\n $from_name = \"Dubai Private Tour\";\n $from_email = \"[email protected]\";\n \n if(!empty($agent_email)){\n send_mail($agent_email, $from_name, \"New Booking Confirmation- Ref: \".$subject, $mail_body, $from_email); //send to agent\n } \n // ====== Send email notification =========\n sf('success_message','Email has been sent to agent successfully!');\n redirect('admin/tour-booking');\n }", "public function sendReservationEmail($values)\n {\n //TODO: rework\n }", "public function send_lease_notification(Request $request)\n\t\t{ \n\t\t\t$offer_status = $request->offer_status;\n\t\t\t$lease_form = array();\n\t\t\t\n\t\t\t$lease_form_fields = array(\n\t\t\t\t'company',\n\t\t\t\t'contactPerson',\n\t\t\t\t'email',\n\t\t\t\t'phone',\n\t\t\t\t'address',\n\t\t\t\t'city',\n\t\t\t\t'state',\n\t\t\t\t'zipCode',\n\t\t\t\t'billTo',\n\t\t\t\t'howLongInBusiness',\n\t\t\t\t'buyOut'\n\t\t\t);\n\t\t\tforeach ($lease_form_fields as $lease_form_field) {\n\t\t\t\t$lease_form[$lease_form_field] = (isset($request->lease_form[$lease_form_field])) ? $request->lease_form[$lease_form_field] : '';\n\t\t\t}\n\t\t\t\n\t\t\t$recipient = $request->recipient;\n\t\t\t$company = $request->company;\n\t\t\t\n\t\t\tswitch ($recipient) {\n\t\t\t\tcase \"laine\":\n\t\t\t\t\t$sales_rep_data = array(\n\t\t\t\t\t\t'mail' => '[email protected]',\n\t\t\t\t\t\t'sales_rep' => 'Laine Dobson',\n\t\t\t\t\t\t'company' => $company\n\t\t\t\t\t);\n\t\t\t\t\t$new_user_data = array_merge($lease_form, $sales_rep_data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"greg\":\n\t\t\t\t\t$sales_rep_data = array(\n\t\t\t\t\t\t'mail' => '[email protected]',\n\t\t\t\t\t\t'sales_rep' => 'Greg Bentz',\n\t\t\t\t\t\t'company' => $company\n\t\t\t\t\t);\n\t\t\t\t\t$new_user_data = array_merge($lease_form, $sales_rep_data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"jesse\":\n\t\t\t\tdefault:\n\t\t\t\t\t$sales_rep_data = array(\n\t\t\t\t\t\t'mail' => '[email protected]', \n\t\t\t\t\t\t'sales_rep' => 'Jesse Harwell',\n\t\t\t\t\t\t'company' => $company\n\t\t\t\t\t);\n\t\t\t\t\t$new_user_data = array_merge($lease_form, $sales_rep_data);\n\t\t\t\t\tbreak; \n\t\t\t}\n\t\t\t\n\t\t\tswitch ($offer_status) {\n\t\t\t\tcase \"rejected\":\n\t\t\t\t\tMail::send(\n\t\t\t\t\t\t'emails.notification_device_rejected',\n\t\t\t\t\t\t$new_user_data,\n\t\t\t\t\t\tfunction ($message) use ($new_user_data) {\n\t\t\t\t\t\t\t$message->from('[email protected]', 'Pahoda Image Products');\n\t\t\t\t\t\t\t$message->to($new_user_data['mail'], $new_user_data['sales_rep'])->subject('Perfectcopier Lease Form information: Device Quote Rejected');\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"accepted\":\n\t\t\t\tdefault:\t\t\n\t\t\t\t\t$sales_rep_data = array (\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'mail' => '[email protected]', \n\t\t\t\t\t\t\t'sales_rep' => 'Jesse Harwell',\n\t\t\t\t\t\t\t'company' => $company\n\t\t\t\t\t\t), \n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'mail' => '[email protected]', \n\t\t\t\t\t\t\t'sales_rep' => 'Greg Bentz',\n\t\t\t\t\t\t\t'company' => $company\n\t\t\t\t\t\t), \n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'mail' => '[email protected]', \n\t\t\t\t\t\t\t'sales_rep' => 'Laine Dobson',\n\t\t\t\t\t\t\t'company' => $company\n\t\t\t\t\t\t), \n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'mail' => '[email protected]',\n\t\t\t\t\t\t\t'sales_rep' => 'Alex',\n\t\t\t\t\t\t\t'company' => $company\n\t\t\t\t\t\t)\n\t\t\t\t\t);\t\t\t\t\t\n\t\t\t\t\tforeach ($sales_rep_data as $sales_rep_array) {\t\t\t\t\t\t\n\t\t\t\t\t\t$new_user_data = array_merge($lease_form, $sales_rep_array);\n\t\t\t\t\t\t\n\t\t\t\t\t\tMail::send(\n\t\t\t\t\t\t\t'emails.notification_device_accepted',\n\t\t\t\t\t\t\t$new_user_data,\n\t\t\t\t\t\t\tfunction ($message) use ($new_user_data) {\n\t\t\t\t\t\t\t\t$message->from('[email protected]', 'Pahoda Image Products');\n\t\t\t\t\t\t\t\t$message->to($new_user_data['mail'], $new_user_data['sales_rep'])->subject('Perfectcopier notification: Device Quote Accepted');\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\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t}\t\t\t\n\t\t\treturn response()->json(array('message' => $lease_form));\n\t\t}", "public function mailTestRegister() { \r\n \r\n try{\r\n \r\n //Array para alamcenar loa datos de entrada\r\n $datosPeticion = array();\r\n //objeto que maneja los requerimientos/peticiones\r\n $request = new simpleRest();\r\n //obtiene los datos de la peticion\r\n $json = $request->getHttpRequestBody();\r\n //objeto que maneja las codificaciones/descodificaciones\r\n $handler = new requestRestHandler();\r\n //descodifica el foramtoJSON y lo pasa a array\r\n $datosPeticion = (array)$handler->decodeJson($json);\r\n\r\n if (isset($datosPeticion['cedula'])) {\r\n\r\n $Cedula = $datosPeticion['cedula']; \r\n if (!empty($Cedula)) { \r\n //Captura todos los campos para persona\r\n $Cedula = $datosPeticion['cedula'];\r\n $Nombres = $datosPeticion['nombres'];\r\n $Apellidos = $datosPeticion['apellidos'];\r\n $FechaNac = $datosPeticion['fechaNac'];\r\n $Sexo = $datosPeticion['sexo'];\r\n $Codido_pais = $datosPeticion['Codigo_pais'];\r\n $Codido_tipo_identif = $datosPeticion['Codigo_tipo_identificacion'];\r\n $Codido_profesion = $datosPeticion['Codigo_profesion'];\r\n $Correo = $datosPeticion['correo'];\r\n $Skype = $datosPeticion['skype'];\r\n $Celular = $datosPeticion['celular'];\r\n $Clave = decrypt(API_ENCRIPT_KEY,$datosPeticion['clave']);\r\n $RepetirClave = decrypt(API_ENCRIPT_KEY,$datosPeticion['repetirclave']);\r\n $Tipo_perfil = $datosPeticion['tipo_perfil'];\r\n $tokens = new tokenSec();\r\n //Aqui empieza el proceso de resgitro/activacion de cuenta\r\n $ActivacionData = $tokens->generarCodigoActivacion();\r\n if (!isset($ActivacionData[\"error\"])){\r\n $Codigo_activacion = $ActivacionData[\"Codigo_activacion\"];\r\n $Fecha_caducidad_activacion = $ActivacionData[\"Fecha_caducidad_activacion\"];\r\n\r\n //Aqui se genera el proceso de activaciones para test\r\n /*Enviamos Email*/\r\n $agenteMail = new mailAgent();\r\n $NombreCompleto = $Nombres.' '.$Apellidos;\r\n\r\n $Id_activacion = \"9999999999\";\r\n $Codigo_Usuario = \"9999999999\";\r\n $Codigo_persona = \"9999999999\";\r\n\r\n\r\n $para = $Correo;\r\n $titulo = \"Excelencia Medica - Activar Cuenta\";\r\n $html =$agenteMail->crearMailTemplateRegister($NombreCompleto,$Id_activacion,$Codigo_Usuario,$Codigo_persona,$Codido_pais,$Codigo_activacion,$Fecha_caducidad_activacion,$Tipo_perfil,$para,$Clave);\r\n $StatusMail =$agenteMail->enviarMail($para,$titulo,$html);\r\n \r\n $responseMailTest[\"error\"] = \"false\";\r\n $responseMailTest[\"status\"] = \"OK\";\r\n $responseMailTest[\"message\"] = \"SUCCESS\";\r\n $responseMailTest['fecha'] = ObtenerFecha();\r\n $responseMailTest[\"respuesta\"] = \"{\\\"mail\\\":\\\"\".$StatusMail.\"\\\"}\";\r\n \r\n return $responseMailTest;\r\n \r\n }\r\n else{\r\n $responseMailTest[\"error\"] = \"true\";\r\n $responseMailTest[\"status\"] = \"error\";\r\n $responseMailTest[\"message\"] = $ActivacionData[\"error\"];\r\n $responseMailTest['fecha'] = \"\";\r\n $responseMailTest[\"respuesta\"] = \"{}\";\r\n return $responseMailTest;\r\n }\r\n }else{\r\n $responseMailTest[\"error\"] = \"true\";\r\n $responseMailTest[\"status\"] = \"error\";\r\n $responseMailTest[\"message\"] = \"Falta datos - cédula\";\r\n $responseMailTest['fecha'] = \"\";\r\n $responseMailTest[\"respuesta\"] = \"{}\";\r\n return $responseMailTest;\r\n }\r\n }else{\r\n $responseMailTest[\"error\"] = \"true\";\r\n $responseMailTest[\"status\"] = \"error\";\r\n $responseMailTest[\"message\"] = \"Falta datos - cédula\";\r\n $responseMailTest['fecha'] = \"\";\r\n $responseMailTest['token'] = \"\";\r\n $responseMailTest[\"respuesta\"] = \"{}\";\r\n return $responseMailTest;\r\n }\r\n }\r\n catch(Exception $e){\r\n $responseMailTest[\"error\"] = \"true\";\r\n $responseMailTest[\"status\"] = \"error\";\r\n $responseMailTest[\"message\"] = $e->getMessage();\r\n $responseMailTest['fecha'] = \"\";\r\n $responseMailTest['token'] = \"\";\r\n $responseMailTest[\"respuesta\"] = \"{}\";\r\n return $responseMailTest;\r\n }\r\n \r\n }", "public function customerProductReview($observer)\n{ \n \n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n $fname=$customer->getFirstname();\n $lname=$customer->getLastname();\n $email= $customer->getEmail();\n\n $telephone= $customer->getAddressesCollection()->getFirstitem()->getTelephone();\n if ($telephone){\n $text = Mage::getStoreConfig('smsnotifications/customer_notification/customer_review');\n $text = str_replace('{{firstname}}', $fname, $text);\n $text = str_replace('{{lastname}}', $lname, $text);\n $text = str_replace('{{emailid}}', $email, $text);\n // $text = str_replace('{{name}}', $customer_name, $text);\n }\n array_push($settings['order_noficication_recipients'], $telephone);\n\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n return($result);\n}", "public function agent_email_details($booking_id='')\n {\n\n $this->load->model('admin/admin_model');\n\n $this->gen_contents['page_heading'] = 'Tour Booking Details';\n $tour_type = $this->gen_contents['tour_type'] = $this->input->get('type');\n $this->gen_contents['agents'] = $this->admin_model->get_agents();\n\n $this->gen_contents['booking_details'] = $this->admin_model->get_tour_booking_details($booking_id);\n $booking_details = $this->gen_contents['booking_details'];\n //p($booking_details); exit;\n foreach ($booking_details as $bd) { }\n\n if($tour_type == 'ts'){\n $emirates_data = $this->admin_model->get_emairates_from_booking($booking_id); // for TS\n }\n\n $this->gen_contents['emirates'] = $emirates_data['emirates'];\n //$mail_body = $this->admin_model->get_email_template('booking-mail'); //old\n $tour_template = $bd['template'];//$this->admin_model->get_tour_template($bd['category_id']);\n $mail_body = $tour_template;//['template'];\n \n if($tour_type == 'ts'){\n $tour_details = \"You are selected <b>\" .$emirates_data['emirates']. '</b> transfer service.';\n $mail_body = str_replace('{{user_name}}', $bd['user_name'], $mail_body);\n $mail_body = str_replace('{{tour_details}}', $tour_details, $mail_body);\n //echo $mail_body; exit;\n }\n else{\n $tour_details = get_tour_details_table($bd); // get tour details \n $traveler_details = get_traveler_details($bd); // get traveler details\n $extra_details = get_extra_details($bd);\n //echo $traveler_details; exit;\n $mail_body = str_replace('{{user_name}}', $bd['user_name'], $mail_body); \n $mail_body = str_replace('{{tour_details}}', $tour_details, $mail_body);\n $mail_body = str_replace('{{traveler_details}}', $traveler_details, $mail_body);\n $mail_body = str_replace('{{extra_details}}', $extra_details, $mail_body);\n }\n \n\n $this->gen_contents['mail_content'] = $mail_body;\n \n\n //p($this->gen_contents['booking_details']); exit;\n //rendering page \n $this->template->set_template('admin');\n $this->template->write_view('content', 'admin/agent-email-details', $this->gen_contents);\n $this->template->render();\n }", "public function send_reminder()\n\t{\n\t\t$apikey = $this->input->post('apikey');\n\t\t$ip_add = $_SERVER['REMOTE_ADDR'];\n\n\t\tif($apikey=='smsatlosbanos'){\n\t \t\t$contact_number = '0'.substr($this->input->post('contact_number'), -10);\n\t \t\t$name = $this->input->post('name');\n\t \t\t$vac_date = $this->input->post('vac_date');\n\t \t\t$vac_site = $this->input->post('vac_site');\n\t \t\t$time_schedule = $this->input->post('time_schedule');\n\t \t\t$device_id = $this->input->post('device_id');\n\t \t\t$dose = $this->input->post('dose');\n\n\t \t\tif($vac_site==1){\n\t \t\t\t$site_text = 'Batong Malake Covered Court';\n\t \t\t}elseif($vac_site==2){\n\t \t\t\t$site_text = 'UPLB Copeland';\n\t \t\t}elseif($vac_site==3){\n\t \t\t\t$site_text = 'LB Evacuation Center';\n\t \t\t}\n\n\t\t\t$message = 'LB RESBAKUNA REMINDER';\n\t\t\t$message .= \"\\n\".$name;\n\t\t\t$message .= \"\\n\".date('F d, Y', strtotime($vac_date)).' At '. $time_schedule;\n\t \t\t$message .= \"\\n\".$site_text;\n\t \t\t$message .= \"\\nWear facemask and faceshield properly. Bring Ballpen.\";\n\t \t\t$message .= \"\\nSalamat po.\";\n\t\t\t$this->send_text($message,$contact_number,$device_id);\n\t\t}\n\t}", "public function notify()\n {\n /*$data = DB::select(DB::raw(\"SELECT license_type_id from `license_type_vehicle` where CURDATE()+INTERVAL 31 DAY =`license_end_on`\"));\n if(!empty($result)) {\n $data = array('license_type_id' => ,$result->license_type_id, 'vehicle_id' => $result->vehicle_id, '' );\n }\n DB::table('users')->insert([\n ['email' => '[email protected]', 'votes' => 0],\n ['email' => '[email protected]', 'votes' => 0]\n ]);*/\n $results = DB::table('license_type_vehicle')\n ->join('vehicles', 'vehicles.id', '=', 'license_type_vehicle.vehicle_id') \n ->select('license_type_vehicle.license_type_id', 'license_type_vehicle.vehicle_id','vehicles.client_id')\n ->where( 'license_type_vehicle.license_end_on', '=','CURDATE()+INTERVAL 30 DAY')\n ->get();\n print_r($results);\n /* Mail::send('emails.welcome', ['key' => 'value'], function($message)\n {\n $message->to('[email protected]', 'John Smith')->subject('Welcome!');\n });*/\n \n }", "public function toMobile($notifiable){\n\n if($notifiable->push_token){\n \\OneSignal::sendNotificationToUser(\n 'You have received a new message on Service Booking',\n $notifiable->push_token,\n $url = null,\n $data = null,\n $buttons = null,\n // $buttons = [\n // [\"id\"=>$this->booking_order_id, \"text\"=> \"View Message\", \"icon\"=>\"ic_menu_send\"]\n // ],\n $schedule = null,\n $headings = null,\n $subtitle = null\n );\n }\n }", "public function sendPhoneVerificationNotification();", "public function sendReminder()\n {\n $token = \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhZG1pbiIsImlhdCI6MTU4MDU1OTc5OCwiZXhwIjo0MTAyNDQ0ODAwLCJ1aWQiOjc3MTA4LCJyb2xlcyI6WyJST0xFX1VTRVIiXX0.0itAev15AZH70jnynEZbqL5K0Z_YQe-Kvp1m5MZ_Ij0\";\n $currentTime = date(\"Y-m-d H:i:s\", strtotime(\"now\")); //current time\n\n $accountsdue = DB::table('accounts')\n ->whereExists(function ($query) {\n $query->select(DB::raw(1))\n ->from('bills')\n ->whereRaw('bills.bills_account_number = accounts.account_number')\n ->whereRaw('bills.due_date = CURDATE()')\n ->whereRaw('bills.status = 0');\n })\n ->get();\n\n $accountsoverdue = DB::table('accounts')\n ->whereExists(function ($query) {\n $query->select(DB::raw(1))\n ->from('bills')\n ->whereRaw('bills.bills_account_number = accounts.account_number')\n ->whereRaw('bills.due_date < CURDATE()')\n ->whereRaw('bills.status = 0');\n })\n ->get();\n\n foreach($accountsdue as $key => $account){\n \n $smsBody= $currentTime . \" \" . $account->account_number . \"/\" . $account->account_name . \". Your account is due today.Please pay today to avoid disconnection and extra fee.\";\n // echo $smsBody;\n // echo $account->contact_number;\n // echo \"\\n\";\n //start send message\n $array_fields['phone_number'] = $account->contact_number;\n $array_fields['message'] = $smsBody;\n $array_fields['device_id'] = 115242;\n\n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://smsgateway.me/api/v4/message/send\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 50,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"[ \" . json_encode($array_fields) . \"]\",\n CURLOPT_HTTPHEADER => array(\n \"authorization: $token\",\n \"cache-control: no-cache\"\n ),\n ));\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n \n\n if ($err) {\n dd($err);\n } else {\n // dd($response);\n }\n //end send message\n \n //\n }\n\n foreach($accountsoverdue as $key => $account){\n \n $smsBody= $account->account_number . \"/\" . $account->account_name . \". Your account is overdue.Please pay today to avoid disconnection and extra fee.\";\n // echo $smsBody . \" \";\n // echo $account->contact_number;\n // echo \"\\n\";\n //start send message\n $array_fields['phone_number'] = $account->contact_number;\n $array_fields['message'] = $smsBody;\n $array_fields['device_id'] = 115242;\n\n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://smsgateway.me/api/v4/message/send\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 50,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"[ \" . json_encode($array_fields) . \"]\",\n CURLOPT_HTTPHEADER => array(\n \"authorization: $token\",\n \"cache-control: no-cache\"\n ),\n ));\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n \n\n if ($err) {\n dd($err);\n } else {\n // dd($response);\n }\n //end send message\n }\n }", "public function notifyRSVPRegistered( $data )\n {\n $subject = \"Event Manager - RSVP Registered\";\n\n $msg = '\n <img src=\"http://' . $_SERVER['HTTP_HOST'] . '/images/event.png\" width=\"200\" height=\"200\" alt=\"Event Manager Banner\"/>\n\n <br><br>\n Hello ' . $data['Eid'] . ',\n\n <br><br>\n We have received your RSVP on ' . date(\"m/d/Y\") . ' through the event management platform.\n\n <br><br>\n\n <hr>\n\n <br>\n\n <table>\n <tr>\n <td colspan=\"2\">\n Reservation Information\n </td>\n </tr>\n <tr>\n <td colspan=\"2\">\n ---------------------------------------------------------\n </td>\n </tr>\n <tr>\n <td width=\"50%\">\n Your EID:\n </td>\n <td width=\"50%\">' .\n $data['Eid'] . '\n </td>\n </tr>\n <tr>\n <td>\n Event Name:\n </td>\n <td>' .\n $data['Name'] . '\n </td>\n </tr>\n <tr>\n <td>\n Event Date:\n </td>\n <td>' .\n $data['Date'] . '\n </td>\n </tr>\n <tr>\n <td>\n Event Location:\n </td>\n <td>' .\n $data['Location'] . '\n </td>\n </tr>\n </table>\n\n <br><br>\n\n An iCal has been attached for your convenience, please use it to add a reminder to your calendar.\n\n <br><br>\n\n Thank you,\n <br>\n Event Manager<br><br>';\n\n return $this->sendEmail( array( \"subject\"=>$subject, \"msg\"=>$msg, \"email\"=>$data['Email'], \"name\"=>$data['Eid'], \"iCal\"=>$data['iCal'] ) );\n }", "public function cancel_send_email()\n\t{\n\t\t$this->is_allowed('amuco_details_customers_send_email');\n\t\t$arr_details = $this->input->get('arr_details');\n\t\t$request_id = $this->input->get('request_id'); \n\n\n\t\t$details = $this->model_amuco_details_customers_request->get_in($arr_details,'id');\n\n\t\t$customer_request = $this->model_amuco_customer_request->get($request_id,'id')[0];\n\n\t\t//armar email\n\t\t $integration_id=$this->Integration_table->get_from_destination('Amuco',1)[0]->id;\n\t\t\n\t\t$message_type=$this->message_types->get_message_types_id('EMAIL')['id'];\n\n\t\t$email_template = json_decode($this->message_template->get_by($integration_id, $message_type)->template);\n\n\t\t$email_message = $email_template->body;\n\n\n\t\t//variables\n\t\t$amuco_customer_request = cclang('amuco_customer_request');\n\t\t$amuco_customer_request_id = $customer_request->id;\n\n\t\t$email_message = str_replace('%%amuco_customer_request%%',$amuco_customer_request,$email_message);\n\t\t$email_message = str_replace('%%amuco_customer_request_id%%',$amuco_customer_request_id, $email_message);\n\n\n\t\t$customer = cclang('customer');\n\t\t$customers_name = $customer_request->amuco_customers_name;\n\n\t\t$email_message = str_replace('%%customer%%',$customer,$email_message);\n\t\t$email_message = str_replace('%%customers_name%%',$customers_name,$email_message);\n\n\n\t\t$destination_port = cclang('destination_port');\n\t\t$destination_port_name = $customer_request->amuco_destination_port_name;\n\n\t\t$contact = cclang('contact');\n\t\t$contacts_name = $customer_request->amuco_contacts_name;\n\n\t\t$email_message = str_replace('%%contact%%',$contact,$email_message);\n\t\t$email_message = str_replace('%%contact_name%%',$contacts_name,$email_message);\n\n\t\t$sales_agent = cclang('sales_agent');\n\t\t$aauth_users_username = $customer_request->aauth_users_username;\n\n\t\t$email_message = str_replace('%%sales_agent%%',$sales_agent,$email_message);\n\t\t$email_message = str_replace('%%aauth_users_username%%',$aauth_users_username,$email_message);\n\n\n\t\t$combined_container = cclang('combined_container');\n\t\t$combinate_container_value = ($customer_request->combinate_container ==1? cclang('YES') : cclang('NOT'));\n\n\t\t$email_message = str_replace('%%combined_container%%',$combined_container,$email_message);\n\t\t$email_message = str_replace('%%combinate_container_value%%',$combinate_container_value,$email_message);\n\n\n\t\t$incoterm = cclang('incoterm');\n\t\t$amuco_incoterm_name = $customer_request->amuco_incoterm_name;\n\n\t\t$email_message = str_replace('%%incoterm%%',$incoterm,$email_message);\n\t\t$email_message = str_replace('%%amuco_incoterm_name%%',$amuco_incoterm_name,$email_message);\n\n\n\t\t$remarks = cclang('remarks');\n\t\t$remarks_value = $customer_request->remarks;\n\n\t\t$email_message = str_replace('%%remarks%%',$remarks,$email_message);\n\t\t$email_message = str_replace('%%remarks_value%%',$remarks_value,$email_message);\n\n\t\t$note_email = cclang('email_note');\n\t\t$email_value = get_option('email');\n\n\t\t$email_message = str_replace('%%note_email%%',$note_email,$email_message);\n\t\t$email_message = str_replace('%%email_value%%',$email_value,$email_message);\n\n\n\t\t$table_data=\"\";\n\t\t$recipients ='';\n\n\n\t\t$tabla_head ='<table>\n <tr class=\"heading heading-p\" >\n <td width=\"30%\" style=\"text-align: left;\">\n '.cclang('product').'\n </td>\n <td width=\"15%\" style=\"text-align: left;\">\n '.cclang('quantity').'\n </td>\n <td width=\"15%\" style=\"text-align: left;\">\n '.cclang('supplier').'\n </td>\n <td width=\"15%\" style=\"text-align: left;\">\n '.cclang('office').'\n </td>\n <td width=\"15%\" style=\"text-align: left;\">\n '.cclang('contact').'\n </td>\n <td width=\"15%\" style=\"text-align: left;\">\n '.cclang('status').'\n </td>\n </tr>';\n\t\t\n\t\t$i = 0;\n\t\tforeach ($details as $key => $item) {\n\n\t\t\tif($item->amuco_suppliers_email !== ''){\n $email = $item->amuco_suppliers_email; \n }\n\t if($item->amuco_suppliers_email == ''){\n\t $email = $item->purchasing_email;\n\t }\n\n\t \t$recipients = $email;\n \t\t\n \t\t$class ='';\n\t \tif($i % 2 == 0){\n\t \t\t$class=\"background-color:#F1F1F1\";\n\t \t}else{\n\t \t\t$class ='';\n\t \t}\n\n $table_data.= '<tr style=\"'.$class.'\">\n <td>\n <span style=\"text-align: left\">\n <small>'.$item->amuco_products_name.'</small>\n </td>\n <td style=\"text-align: left\">'.$item->quantity.'</td>\n <td style=\"text-align: left\">'.$item->amuco_suppliers_name.'</td>\n <td style=\"text-align: left\">'.$item->purchasing_username.'</td>\n <td style=\"text-align: left\">'.$email.'</td>\n <td style=\"text-align: left\">'.$item->status.'</td>\n </tr>';\n $i++;\n\t\t}\n\n\t\t$tabla_def=$tabla_head.$table_data.'</table>';\n\n\t\t\n\t\t$email_message = str_replace('%%tabla%%',$tabla_def,$email_message);\n\n\n\t\t$email_data=[\n\t\t\t'sender' => '[email protected]',\n\t\t\t'recipients' => $recipients,\n\t\t\t'reply_to' => get_option('email')\n\t\t];\n\n\t\t$user_id = $this->session->userdata('id');\n\t\t$title_email = cclang('notification_title');\n\n\n\t\t//inserto en la tabla notification\n\t\t$type_notification = $this->model_mw_notification_types->get_single(['code' => 'EMAIL']);\n\n\t\t$type_id = $type_notification->id;\n\n\t\t$save_data = [\n\t\t\t\t'type_id' => $type_id,\n\t\t\t\t'user_id' => $user_id,\n\t\t\t\t'status' => 'new',\n\t\t\t\t'title'\t => $title_email,\n\t\t\t\t'body'\t => $email_message,\n\t\t\t\t'created_date' => date('Y-m-d H:i:s'),\n\t\t\t\t'sender' => $email_data['sender'],\n\t\t\t\t'recipients' => $email_data['recipients'],\n\t\t\t\t'reply_to' => $email_data['reply_to']\n\t\t\t];\n\n\n\t\t\t$save = $this->model_mw_notifications->store($save_data);\n\t\t\t$data_update = [\n\t\t\t\t\"entity\" => \"amuco_details_customers_request\",\n\t\t\t\t\"value\" => implode(\",\", $arr_details)\n\t\t\t];\n\n\t\t\t$this->model_mw_notifications->change($save, $data_update);\n\n\t\t\t//actualizo la tabla amuco_details_customers_request\n\t\t\t$data_update_details = [\n\t\t\t\t\"notification_send\" => \"pending\"\n\t\t\t];\n\n\t\t\tforeach ($details as $key => $item) {\n\t\t\t\t$this->model_amuco_details_customers_request->change($item->id,$data_update_details);\n\t\t\t}\n\n\t\t\t$this->data = [\n\t\t\t\t\"success\" => true,\n\t\t\t\t\"message\" => cclang('notification_fails')\n\t\t\t];\n\n\t\t\techo json_encode($this->data);\n\t}", "public static function sendEmail($data) {\r\n\r\n // get user data to fill in automatically\r\n $user = Auth::getUser();\r\n // Email Settings\r\n // Send email back to user and the home store \r\n $cc[] = $user->email;\r\n\r\n // Live Address\r\n $to = '[email protected]';\r\n // Test address\r\n //$to = '[email protected]';\r\n\r\n // getting the From store email\r\n $allStores = Helpers::getStores();\r\n foreach ($allStores as $store) {\r\n if ($store['storeNumber'] == $user->storeNumber){\r\n //uncomment for Live\r\n //$cc[] = ($store['storeEmail']);\r\n $storeName = $store['storeName'];\r\n }\r\n\r\n }\r\n // HTML Email Version\r\n $partCount = count($data['catNum']);\r\n $msgHeader = '<b>Store Requesting: &emsp;</b>' . $storeName . '<br />';\r\n $msgHeader .= '<b>Requestor: &emsp;</b>' . $user->name . '<br />';\r\n $msgHeader .= '<b><h3>If Stolen</h3></b>';\r\n $msgHeader .= '<b>Police Department: &emsp;</b>' . $data['policeDepartment'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to Police: &emsp;</b>' . $data['policeDate'] . '<br />';\r\n $msgHeader .= '<b>Police Report Number: &emsp;</b>' . $data['reportNum'] . '<br />';\r\n $msgHeader .= '<b>Reported to NER by: &emsp;</b>' . $data['nerReportBy'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to NER: &emsp;</b>' . $data['nerDate'] . '<br />';\r\n $msgHeader .= '<b>Reported to Manufacturer by: &emsp;</b>' . $data['mfgReportBy'] . '<br />';\r\n $msgHeader .= '<b>Date Reported to Manufacturer: &emsp;</b>' . $data['mfgDate'] . '<br />';\r\n\r\n $msgFooter = '<h3>Details of the Disposal</h3>' . $data['disposal_comments'];\r\n $msg = '<h3>Disposal Item Line Details</h3>';\r\n $msg .= '<table border=\"1\"><tr><b><td>Cat Num</td><td>Item Num</td><td>Serial Num</td><td>Manufacturer</td><td>Qty</td><td>Disposal Type</td></b></tr>';\r\n for ($i = 0;$i<$partCount; $i++){\r\n $msg .= \"<tr>\";\r\n $msg .= \"<td>\" . $data['catNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['itmNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['serialNum'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['mfg'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['quantity'][$i] . \"</td>\";\r\n $msg .= \"<td>\" . $data['disposalCode'][$i] . \"</td>\";\r\n $msg .= \"</tr>\";\r\n }\r\n $msg .=\"</table>\";\r\n\r\n // Text only part of the email\r\n\r\n $textHeader = \"Store Requesting: \" . $storeName . \"\\r\\n\";\r\n $textHeader .= \"Requestor: \" . $user->name . \"\\r\\n\\r\\n\";\r\n $textHeader .= \"If Stolen: \\r\\n\\r\\n\";\r\n $textHeader .= \"Police Department: \" . $data['policeDepartment'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to Police\" . $data['policeDate'] . \"\\r\\n\";\r\n $textHeader .= \"Police Report Number: \" . $data['reportNum'] . \"\\r\\n\";\r\n $textHeader .= \"Reported to NER by: \" . $data['nerReportBy'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to NER\" . $data['nerDate'] . \"\\r\\n\";\r\n $textHeader .= \"Reported to Manufacturer by: \" . $data['mfgReportBy'] . \"\\r\\n\";\r\n $textHeader .= \"Date Reported to Manufacturer: \" . $data['mfgDate'] . \"\\r\\n\";\r\n\r\n $textFooter = 'Details of the Disposal \\r\\n' . $data['disposal_comments'];\r\n $textBody = \"Cat # Item # Serial # Manufacturer Quantity Disposal Type\";\r\n\r\n for ($i = 0; $i<$partCount; $i++){\r\n $textBody .= $data['catNum'][$i] . ' ';\r\n $textBody .= $data['itmNum'][$i] . ' ';\r\n $textBody .= $data['serialNum'][$i] . ' ';\r\n $textBody .= $data['mfg'][$i] . ' ';\r\n $textBody .= $data['quantity'][$i] . ' ';\r\n $textBody .= $data['disposalCode'][$i] . ' ';\r\n }\r\n\r\n $subject = 'New Disposal Request';\r\n $text = $textHeader . $textBody . $textFooter;\r\n $html = $msgHeader . $msg . $msgFooter;\r\n\r\n Mail::send($to, $subject, $text, $html, $cc);\r\n \r\n // remove after saveDisposal() is written\r\n\r\n }", "function offer_mail($recharge_user_id) {\n\t\t$recharge_user_id = $recharge_user_id;\n\t\t$frnd_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $recharge_user_id);\n\t\t$user_name = $frnd_records['0']['user_name'];\n\t\t$user_email = $frnd_records['0']['user_email'];\n\t\t// $frnd_number = $frnd_records['0']['user_contact_no'];\n\t\t//\t$offer_records = $this -> conn -> get_table_row_byidvalue('add_cart_offer', 'cart_user_id', 12);\n\t\t$offer_records = $this -> conn -> get_table_field_doubles('add_cart_offer', 'cart_user_id', $recharge_user_id, 'cart_offer_status', 2);\n\n\t\tif (!empty($offer_records)) {\n\n\t\t\tforeach ($offer_records as $value) {\n\n\t\t\t\t$coupon_id = $value['cart_offer_id'];\n\t\t\t\t$frnd_records = $this -> conn -> join_two_table('free_coupon_list', 'free_coupon_category', 'fee_coupon_category_id', 'free_coupon_category_id', 'free_coupon_id', $coupon_id);\n\t\t\t\t//$transaction = $this->login_model->join_two_table('free_coupon_list','free_coupon_category', 'fee_coupon_category_id', 'free_coupon_category_id','free_coupon_id',$coupon_id);\n\n\t\t\t\t$free_coupon_id = $frnd_records['0']['free_coupon_id'];\n\t\t\t\t$coupon_name = $frnd_records['0']['coupon_name'];\n\t\t\t\t$coupon_discount = $frnd_records['0']['coupon_discount'];\n\t\t\t\t$coupon_code = $frnd_records['0']['coupon_code'];\n\t\t\t\t$coupon_expiry_date = $frnd_records['0']['coupon_expiry_date'];\n\t\t\t\t$coupon_refference_url = $frnd_records['0']['refference_website'];\n\t\t\t\t$coupon_image_url = coupon_logo . '/' . $frnd_records['0']['coupon_img'];\n\t\t\t\t// $to='[email protected]';\n\t\t\t\t$to = $user_email;\n\n\t\t\t\t$subject = \"Promotional offer code details\";\n\t\t\t\t$path = mail_logo;\n\t\t\t\t$message = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>Untitled Document</title></head>\n\n<body bgcolor=\"#f1f1f1\">\n<table cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"background:#fff; border:1px solid #cbcbcb; margin:0 auto; font-family:Arial, Helvetica, sans-serif; font-size:12px;\">\n\t<thead class=\"header\">\n \t<tr>\n \t<td style=\"background:#FFFFFF; height:62px; width:100%; padding:5px; border-bottom:1px solid #DDD;\" valign=\"middle\">\n \t<a href=\"#\" style=\"margin-left:10px;\"><img width=\"100\" src=\"' . $path . '\" alt=\"...\"/></a>\n \n </td>\n </tr>\n </thead>\n <tbody style=\" background:#FEFEFE; border-bottom:1px solid #ddd;\">\n \t<tr>\n \t<td style=\"padding:10px 15px;\">\n \t<h1 style=\"margin-bottom:0px; color:#337d75;\">RECHARGE </h1>\n \t<p >Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since</p>';\n\t\t\t\t$message .= '<p>Coupon name:<strong>' . $coupon_name;\n\t\t\t\t'</strong></p>';\n\t\t\t\t$message .= '<p>Coupon Discount:<strong>' . $coupon_discount;\n\t\t\t\t'</strong></p></td></tr>';\n\t\t\t\t$message .= '<p>Coupon Code:<strong>' . $coupon_code;\n\t\t\t\t'</strong></p>';\n\t\t\t\t$message .= '<p>Coupon Expiry Date:<strong>' . $coupon_expiry_date;\n\t\t\t\t'</strong></p></td></tr>';\n\t\t\t\t$message .= '<p>Refference Website:<strong>' . $coupon_refference_url;\n\t\t\t\t'</strong></p></td></tr>';\n\t\t\t\t$message .= '<tr><td style=\"background:#ddd; height:1px; width:100%;\"></td></tr></tbody>';\n\n\t\t\t\t$message .= '<tfoot style=\"background:#337d75; text-align:center; color:#fff;\"><tr><td><p> Copyright © 2016 Recharge All right reserved </p></td><tr></tfoot></table></body></html>';\n\n\t\t\t\t//\n\t\t\t\t// $message= '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\t\t\t\t// <html xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t\t// <head>\n\t\t\t\t// <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\t\t\t\t// <title>Untitled Document</title>\n\t\t\t\t// </head>\n\t\t\t\t//\n\t\t\t\t// <body>\n\t\t\t\t// <table width=\"550\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" style=\"width:550px; font-family:Arial, Helvetica, sans-serif; border:1px solid #ddd;\">\n\t\t\t\t// <tbody>\n\t\t\t\t// <tr>\n\t\t\t\t// <td><table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t// <tbody>\n\t\t\t\t// <tr bgcolor=\"#60c4ba\">\n\t\t\t\t// <td align=\"left\"><img src=\"'.$path.'\" width=\"150\" alt=\"...\"/></td>\n\t\t\t\t// </tr>\n\t\t\t\t// </tbody>\n\t\t\t\t// </table>\n\t\t\t\t// &nbsp;\n\t\t\t\t// <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"padding:10px;\">\n\t\t\t\t// <tbody>\n\t\t\t\t// <tr>\n\t\t\t\t// <td valign=\"bottom\" style=\"font-size:14px;text-align:left;font-family:arial;text-transform:capitalize\">Dear \"'.$user_name\t.'\",</td>\n\t\t\t\t// </tr>\n\t\t\t\t// </tbody>\n\t\t\t\t// </table>\n\t\t\t\t// <p style=\"margin:0;min-height:20px padding:10px;\">&nbsp;</p>\n\t\t\t\t// <p style=\"margin:0 0 0 0;color:#000000; padding:10px;text-align:left;font-size:14px;font-weight:normal;line-height:20px\">Your recharge has officially been made free! Your free coupons have been listed below. Please note, e-coupons can be redeemed instantly.</p>\n\t\t\t\t// <p style=\"font-size:14px;padding:10px;margin:0;color:#000000;text-align:justify;line-height:18px\">If theres anything else we can do to make you smile, please dont hesitate to get in touch with us.</p>\n\t\t\t\t// <p style=\"font-size:14px;padding:10px;margin:0;text-align:left;font-weight:bold\"><span style=\"text-transform:uppercase\">Insta coupon(s)</span> - <span style=\"font-weight:normal;padding:10px;color:#666;font-size:12px\">Delivered instantly via email to your registered email id.</span></p>\n\t\t\t\t// <table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" style=\"border:2px dashed #0d2651;padding:10px;background:#fefdf5\">\n\t\t\t\t// <tbody>\n\t\t\t\t// <tr>\n\t\t\t\t// <td colspan=\"5\"><div style=\"min-height:10px\">&nbsp;</div></td>\n\t\t\t\t// </tr>\n\t\t\t\t// <tr>\n\t\t\t\t// <td width=\"10\" rowspan=\"2\">&nbsp;</td>\n\t\t\t\t// <td width=\"95\" align=\"center\" style=\"font-size:11px;padding:0px\" rowspan=\"2\"><a style=\"text-decoration:none;border:0;font-size:11px;color:#000000\" rel=\"external\"><img width=\"95\" height=\"50\" title=\"Dominos.co.in 15% OFF\" style=\"min-height:50px;display:block;text-decoration:none;border:0;word-break:break-all\" src=\".$coupon_image_url.\" alt=\"Dominos.co.in 15% OFF\" class=\"CToWUd\"></a></td>\n\t\t\t\t// <td width=\"290\" valign=\"top\" style=\"text-align:left;padding:0px;padding-left:7px\"><span style=\"color:#999;font-size:14px;font-weight:bold;display:block\"><a data-saferedirecturl=\"https://www.google.com/url?hl=en&amp;q=http://Dominos.co.in&amp;source=gmail&amp;ust=1465984931028000&amp;usg=AFQjCNGti07GxKef8IQLYh-4J9SikJsGZQ\" target=\"_blank\" rel=\"external\" href=\"http://Dominos.co.in\">Dominos.co.in</a> 15% OFF</span></td>\n\t\t\t\t// <td width=\"135\" style=\"text-align:right;padding:0\"><strong style=\"color:#0d2651;font-size:28px;font-weight:bold;text-align:center\"><span style=\"font-size:17px\">Rs.</span> 50</strong></td>\n\t\t\t\t// <td width=\"10\" rowspan=\"2\">&nbsp;</td>\n\t\t\t\t// </tr>\n\t\t\t\t// <tr>\n\t\t\t\t// <td style=\"padding:0;margin:0\"><table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n\t\t\t\t// <tbody>\n\t\t\t\t// <tr>\n\t\t\t\t// <td width=\"90\" valign=\"middle\" style=\"text-align:left;padding:0px;padding-left:7px\"><span style=\"color:#999;font-size:12px;line-height:18px\">Coupon Code:</span></td>\n\t\t\t\t// <td width=\"200\"><div style=\"background:none repeat scroll 0 0 #eee;border:1px dashed #333333;font-size:16px;font-weight:bold;padding:1px 0px;display:block;text-align:center;width:185px;margin:0 5px\">Frchr01</div></td>\n\t\t\t\t// </tr>\n\t\t\t\t// </tbody>\n\t\t\t\t// </table></td>\n\t\t\t\t// <td style=\"text-align:right;padding:0;font-size:16px;color:#000000\"><p style=\"margin:0;padding:0;font-size:11px;color:#999\">Expire on: &nbsp; <span data-term=\"goog_1872809791\" class=\"aBn\" tabindex=\"0\"><span class=\"aQJ\">31 Aug 2016</span></span></p></td>\n\t\t\t\t// </tr>\n\t\t\t\t// <tr>\n\t\t\t\t// <td colspan=\"5\"><div style=\"min-height:18px\">&nbsp;</div></td>\n\t\t\t\t// </tr>\n\t\t\t\t// </tbody>\n\t\t\t\t// </table>\n\t\t\t\t// <table cellspacing=\"0\" cellpadding=\"0\" style=\"padding:10px;\">\n\t\t\t\t// <tbody>\n\t\t\t\t// <tr>\n\t\t\t\t// <td style=\"padding:15px 0px;background:#fff;border-bottom:3px solid #f9f9f9\" colspan=\"\"><p style=\"font-size:11px;color:#999;line-height:16px;margin:0;padding:0\"><strong>Terms &amp; Conditions:</strong> Offer Highlights: Enjoy flat 15% discount on minimum billing of Rs. 350 at <a data-saferedirecturl=\"https://www.google.com/url?hl=en&amp;q=http://www.dominos.co.in&amp;source=gmail&amp;ust=1465984931028000&amp;usg=AFQjCNHKk0HpqXE9TW5R1pA62PZ9rbGT2Q\" target=\"_blank\" rel=\"external\" href=\"http://www.dominos.co.in\">www.dominos.co.in</a> How to redeem this Offer: You will receive an coupon code via e-mail as soon as your transaction is successful. You need to apply the coupon code at the time of placing the order on <a data-saferedirecturl=\"https://www.google.com/url?hl=en&amp;q=http://www.dominos.co.in&amp;source=gmail&amp;ust=1465984931028000&amp;usg=AFQjCNHKk0HpqXE9TW5R1pA62PZ9rbGT2Q\" target=\"_blank\" rel=\"external\" href=\"http://www.dominos.co.in\">www.dominos.co.in</a> Terms of this Offer: Offer not valid on Simply Veg, Simply Non Veg Pizzas, Pizza Mania Combos and Beverages. Only one Coupon Code is valid per transaction and cannot be clubbed with any other offer or promotion. Offer valid only on orders placed ONLINE. Offer valid till <span data-term=\"goog_1872809792\" class=\"aBn\" tabindex=\"0\"><span class=\"aQJ\">31st August, 2016</span></span>.</p></td>\n\t\t\t\t// </tr>\n\t\t\t\t// </tbody>\n\t\t\t\t// </table>\n\t\t\t\t// <p style=\"font-size:12px;margin:0;color:#000000;padding:10px;text-align:left\">Lots of love,</p>\n\t\t\t\t// <p style=\"font-size:12px;margin:0;color:#000000;padding:10px;text-align:left\">The OyaCharge Family</p>\n\t\t\t\t// <p style=\"font-size:12px;margin:0;color:#000000;padding:10px;text-align:left;font-weight:normal\">This is a system-generated mail, please do not respond to this e-mail Id. Got a question or need clarifications? You can either visit <a data-saferedirecturl=\"https://www.google.com/url?hl=en&amp;q=http://support.freecharge.in/&amp;source=gmail&amp;ust=1465984931028000&amp;usg=AFQjCNEm1EolVTUsdJj69XGVn3lMVSSUeg\" target=\"_blank\" rel=\"external\" href=\"http://support.freecharge.in/\">support.Oyacharge.in</a> or write in to <a target=\"_blank\" href=\"mailto:[email protected]\">[email protected]</a> we will get in touch with you asap.</p></td>\n\t\t\t\t// </tr>\n\t\t\t\t// </tbody>\n\t\t\t\t// </table>\n\t\t\t\t// </body>\n\t\t\t\t// </html>';\n\t\t\t\t//\n\t\t\t\t$headers = \"Organization: OyaCharge\\r\\n\";\n\t\t\t\t$headers .= \"MIME-Version: 1.0\\r\\n\";\n\t\t\t\t$headers .= \"Content-type: text/plain; charset=iso-8859-1\\r\\n\";\n\t\t\t\t$headers .= \"X-Priority: 3\\r\\n\";\n\t\t\t\t$headers .= \"X-Mailer: PHP\" . phpversion() . \"\\r\\n\";\n\t\t\t\t$header = \"From:[email protected] \\r\\n\";\n\t\t\t\t$header .= \"Cc:[email protected] \\r\\n\";\n\t\t\t\t$header .= \"MIME-Version: 1.0\\r\\n\";\n\t\t\t\t$header .= \"Content-type: text/html\\r\\n\";\n\t\t\t\t$retval = mail($to, $subject, $message, $header);\n\t\t\t\t$data_frnd['cart_offer_status'] = 1;\n\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'cart_offer_id', $coupon_id, $data_frnd);\n\t\t\t}\n\n\t\t}\n\t}", "function refund_sms_notification_send($tourwise_id)\n{\n $sq_personal_info = mysql_fetch_assoc(mysql_query(\"select mobile_no from traveler_personal_info where tourwise_traveler_id='$tourwise_id'\"));\n $mobile_no = $sq_personal_info['mobile_no'];\n\n $message = \"We are providing the refunds considering your cancellation request of the genuine reason. Pls, contact us for the future journey.\";\n global $model;\n $model->send_message($mobile_no, $message);\n}", "public function new_customer_email($edata) {\n\t\t\t\t$template = $this->shortcode_variables(\"customerregisteradmin\");\n\t\t\t\t$details = email_template_detail(\"customerregisteradmin\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"supplierregisteradmin\");\n\t\t\t\t$values = array($edata['name'], $edata['email'], $edata['address'], $edata['phone']);\n\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"supplierregisteradmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($this->adminemail);\n\t\t\t\t$this->email->subject($details[0]->temp_subject);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function manualSmsotpsend(Request $request)\n {\n $this->validate($request, [\n 'orderid' => 'required',\n ]);\n\n $currentdtaetime=date(\"Y-m-d H:i:s\", strtotime(\"+30 minutes\"));\n $mainorderinfo = Ordercollection::where('id',$request->orderid)->where('okupdate','0')->where('totalamount','!=','0')->where('verifiedmobilecode','!=','')->get();\n if(count($mainorderinfo) > 0){\n $mainorderinfo=$mainorderinfo->first();\n $updateorders=Ordercollection::where('id',$request->orderid)->where('okupdate','0')->where('totalamount','!=','0')->where('verifiedmobilecode','!=','')->\n update(['otpferifiedat'=>$currentdtaetime]);\n \n\n\n \n\n $outletidd=$mainorderinfo->outletid;\n $marchantidinfo = Marchantlist::where('id',$outletidd)->get(['currentavailable'])->first();\n $newcurrentavailable=$marchantidinfo->currentavailable;\n $newsms=\"Dear+Merchant,for+your+UBL+order+reff.+invoice+\".$mainorderinfo->invoiceid.\"+your+loan+amount=\".$mainorderinfo->dueamount.\"FairBanc+credit+Available=\".$newcurrentavailable.\"Tk+and+Confirmation+OTP=\".$mainorderinfo->verifiedmobilecode;\n \n $newurls='http://alphasms.biz/index.php?app=ws&u=indexer&h=351794a3122fab8ff8bbc78b8092797b&op=pv&to='.$mainorderinfo->outletmobileno.'&msg='.$newsms;\n\n \n $curl = curl_init();\n // Set some options - we are passing in a useragent too here\n curl_setopt_array($curl, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => $newurls,\n CURLOPT_USERAGENT => 'SMS mobile Request'\n ));\n // Send the request & save response to $resp\n $resp = curl_exec($curl);\n // Close request to clear up some resources\n curl_close($curl);\n\n if($resp){\n $newsavedta= new Manualotpsmssent;\n $newsavedta->sentbyid=$request->user()->id;\n $newsavedta->sentfororderid=$request->orderid;\n $newsavedta->invoiceidfor=$mainorderinfo->invoiceid;\n $newsavedta->updated_by=$request->user()->id;\n $newsavedta->save();\n }\n \n return response()->json([\n 'message' => 'SMS sent complete'\n ], 200);\n\n\n }\n return response()->json([\n 'response' => 'error',\n 'message' => 'Problem in data'\n ], 400); \n \n }", "public function sendEmail()\n\t{\n\t\tif (empty($this->get('crmid'))) {\n\t\t\treturn;\n\t\t}\n\t\t$moduleName = 'Contacts';\n\t\t$recordModel = Vtiger_Record_Model::getInstanceById($this->get('crmid'), $moduleName);\n\t\tif ($recordModel->get('emailoptout')) {\n\t\t\t$emailsFields = $recordModel->getModule()->getFieldsByType('email');\n\t\t\t$addressEmail = '';\n\t\t\tforeach ($emailsFields as $fieldModel) {\n\t\t\t\tif (!$recordModel->isEmpty($fieldModel->getFieldName())) {\n\t\t\t\t\t$addressEmail = $recordModel->get($fieldModel->getFieldName());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!empty($addressEmail)) {\n\t\t\t\t\\App\\Mailer::sendFromTemplate([\n\t\t\t\t\t'template' => 'YetiPortalRegister',\n\t\t\t\t\t'moduleName' => $moduleName,\n\t\t\t\t\t'recordId' => $this->get('crmid'),\n\t\t\t\t\t'to' => $addressEmail,\n\t\t\t\t\t'password' => $this->get('password_t'),\n\t\t\t\t\t'login' => $this->get('user_name'),\n\t\t\t\t\t'acceptable_url' => Settings_WebserviceApps_Record_Model::getInstanceById($this->get('server_id'))->get('acceptable_url')\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}", "public function customerForgotpassword($observer)\n {\n \n $settings = Mage::helper('smsnotifications/data')->getSettings();\n\n $customer_email =$_POST[\"email\"];\n $customer = Mage::getModel(\"customer/customer\");\n $customer->setWebsiteId(Mage::app()->getWebsite()->getId());\n $customer->loadByEmail($customer_email);\n $fname=$customer->getFirstname();\n $lname=$customer->getLastname();\n $email= $customer->getEmail();\n$telephone= $customer->getAddressesCollection()->getFirstitem()->getTelephone();\n\nif ($telephone) {\n $text = Mage::getStoreConfig('smsnotifications/customer_notification/password_status');\n $text = str_replace('{{firstname}}', $fname, $text);\n $text = str_replace('{{lastname}}', $lname, $text);\n $text = str_replace('{{emailid}}', $email, $text);\n //$text = str_replace('{{name}}', $customer_name, $text);\n $link=Mage::helper('customer')->getForgotPasswordUrl();\n $text = str_replace('{{link}}', $link, $text);\n array_push($settings['order_noficication_recipients'], $telephone);\n\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n return;\n }\n\n }", "public function sendEmailNotification($params) {\n $mailer = $params['mailer'];\n \n $message = $mailer\n ->createMessage()\n ->setFrom([$params['mailFrom'] => 'Zoobdoo'])\n ->setTo($params['sendTo'])\n ->setContentType(\"text/html\");\n\n $subject = 'Zoobdoo - You have been invited to register as MAnager';\n $template = 'ErpCoreBundle:EmailNotification:' . $this->type . '.html.twig';\n\n $emailParams['landlordInvite'] = $params['landlordInvite'];\n $emailParams['landlordEmail'] = $params['landlordEmail'];\n $emailParams['message'] = array_key_exists('message', $params) ? $params['message'] : '';\n $emailParams['url'] = $params['url'];\n $emailParams['imageErp'] = $message->embed($this->getLogoPath($params));\n\n $message\n ->setSubject($subject)\n ->setBody($params['container']->get('templating')->render($template, $emailParams));\n $result = $mailer->send($message);\n\n return $result;\n }", "public function mailRentalPlaceNewReservation(Request $request)\n {\n $now = now();\n $inquiry = $request->query('inquiry') == 1;\n $reservation = new BikeReservation([ \n 'reserved_from' => $now,\n 'reserved_to' => $now->addDay(),\n ]); \n $reservation->id = 1;\n \n $reservation->user = new User([\n 'firstname' => \"Firstname\",\n 'lastname' => \"Lastname\",\n 'email' => \"[email protected]\",\n 'telephone' => '+43234423'\n ]);\n \n $bike = new Bike([\n 'name' => 'Sample Bike', \n ]); \n \n $bike->id = 1;\n $mail = new Mail\\RentalPlaceNewReservation($bike, $reservation, $inquiry);\n \n return $mail;\n }", "public static function sendEmail($data)\n {\n $invoiceData = Invoice::where('id', '=', $data['invoice_id'])->first();\n $profileInfo = User::where('id', '=', Auth::user()->id)->first();\n $data['last_id'] = $data['invoice_id'];\n $data['invoice_data'] = $invoiceData;\n\n if (trim($invoiceData->additional_email) != '') {\n $additionEmail = $invoiceData->email . ',' . $invoiceData->additional_email;\n } else {\n $additionEmail = $invoiceData->email;\n }\n\n $dataToEmail['item'] = InvoiceItem::where('invoice_id', '=', $data['invoice_id'])->get();\n\n Session::flash('email', $additionEmail);\n $additionEmail = explode(',', $additionEmail);\n\n if ($data['payment_method'] == 'paypal') {\n $data['paypalurl'] = $data['pay_pal_config']['paypal_invoice_link'] . $data['invoice_url'];\n } else {\n $data['paypalurl'] = url('') . '/pay/' . $data['invoice_url'];\n }\n \n \n $dataToEmail['profile_info'] = $profileInfo;\n $dataToEmail['invoice_data'] = $invoiceData;\n $dataToEmail['to'] = $invoiceData->email;\n $dataToEmail['subject'] = 'New Invoice from ' . $data['invoice_data']->company_name;\n $dataToEmail['body'] = view('emails.invoice', compact('data'));\n $dataToEmail['sender'] = env('NO_REPLY_EMAIL', '[email protected]');\n $dataToEmail['cc'] = $invoiceData->addition_email;\n\n $dataToEmailSecond['to'] = $profileInfo->email;\n $dataToEmailSecond['subject'] = 'Invoice Sent to ' . $data['invoice_data']->company_name;\n $dataToEmailSecond['body'] = view('emails.invoice_user', compact('data'));\n $dataToEmailSecond['sender'] = env('NO_REPLY_EMAIL', '[email protected]');\n if ($data['payment_method'] == 'paypal'){\n\n } else{\n _mail($dataToEmail);\n }\n\n _mail($dataToEmailSecond);\n }", "public function toMailCustom($notifiable)\r\n {\r\n $contact = \\App\\Models\\Contact::findOrFail($notifiable->id);\r\n $notification_attributes = json_decode($contact->list->notification_attributes, true);\r\n $attributes = json_decode($contact->list->attributes);\r\n\r\n\r\n $sending_server = \\App\\Models\\SendingServer::whereId($contact->list->sending_server_id)\r\n ->whereStatus('Active')\r\n ->with('bounce')\r\n ->first();\r\n\r\n if(!empty($sending_server->id)) {\r\n $connection = Helper::configureSendingNode($sending_server->type, $sending_server->sending_attributes);\r\n\r\n if($connection['success']) {\r\n\r\n // If Unsubscribe Email is set to 'Yes' for a list\r\n if($contact->list->double_optin == 'Yes' || $contact->list->welcome_email == 'Yes' || $contact->list->unsub_email == 'Yes') {\r\n // send email to contact \r\n $send_email = false; //' It may possilbe one option is true other false\r\n // Run old emails that have no value set\r\n if(($this->subscriber_email == 'confirm-email-app' || $this->subscriber_email == 'confirm-email-webform') && $contact->list->double_optin == 'Yes') {\r\n if(!empty($attributes->confirmation_email_id)) {\r\n $page = \\App\\Models\\Page::whereId($attributes->confirmation_email_id)->whereAppId($contact->app_id)->first();\r\n } else {\r\n $page = \\App\\Models\\Page::whereSlug($this->subscriber_email)->whereAppId($contact->app_id)->first();\r\n }\r\n $send_email = true;\r\n } elseif($this->subscriber_email == 'welcome-email' && $contact->list->welcome_email == 'Yes') {\r\n if(!empty($attributes->welcome_email_id)) {\r\n $page = \\App\\Models\\Page::whereId($attributes->welcome_email_id)->whereAppId($contact->app_id)->first();\r\n } else {\r\n $page = \\App\\Models\\Page::whereSlug($this->subscriber_email)->whereAppId($contact->app_id)->first();\r\n }\r\n $send_email = true;\r\n } elseif($this->subscriber_email == 'unsub-email' && $contact->list->unsub_email == 'Yes') {\r\n if(!empty($attributes->unsub_email_id)) {\r\n $page = \\App\\Models\\Page::whereId($attributes->unsub_email_id)->whereAppId($contact->app_id)->first();\r\n } else {\r\n $page = \\App\\Models\\Page::whereSlug($this->subscriber_email)->whereAppId($contact->app_id)->first();\r\n }\r\n $send_email = true;\r\n }\r\n\r\n if($send_email) {\r\n $content = Helper::replaceSpintags(Helper::decodeString($page->content_html)); // replace spintags\r\n $content = Helper::replaceCustomFields($content, $contact->customFields); // replace custom field\r\n $content = Helper::replaceSystemVariables($contact, $content, $data_values=[]); // replace system variables\r\n\r\n $subject = Helper::replaceSpintags(Helper::decodeString($page->email_subject)); // replace spintags\r\n $subject = Helper::replaceCustomFields($subject, $contact->customFields); // replace custom field\r\n $subject = Helper::replaceSystemVariables($contact, $subject, $data_values=[]); // replace system variables\r\n\r\n $message = Helper::configureEmailBasicSettings($sending_server);\r\n if(in_array($sending_server->type, Helper::sendingServersFramworkSuported())) {\r\n $message->setTo($contact->email);\r\n $message->setSubject($subject);\r\n $message->setBody($content, \"text/html\");\r\n try {\r\n $connection['transport']->send($message);\r\n $status = 'Sent';\r\n } catch(\\Exception $e) {\r\n //echo $e->getMessage();\r\n $status = 'Failed';\r\n }\r\n } elseif($sending_server->type == 'sendgrid_api') {\r\n $message->addTo($contact->email);\r\n $message->setSubject($subject);\r\n $message->addContent(\"text/html\", $content);\r\n $sendgrid = new \\SendGrid(\\Crypt::decrypt(json_decode($sending_server->sending_attributes)->api_key));\r\n try {\r\n $response = $sendgrid->send($message);\r\n // status start with 2 consider as sent\r\n if(substr($response->statusCode(), 1) == 2) {\r\n $status = 'Sent';\r\n } else {\r\n $status = 'Failed';\r\n }\r\n } catch(\\Exception $e) {\r\n //echo $e->getMessage();\r\n $status = 'Failed';\r\n }\r\n }\r\n\r\n if($status == 'Sent') {\r\n Helper::updateSendingServerCounters($sending_server->id);\r\n }\r\n }\r\n }\r\n\r\n // send notification email\r\n if($contact->list->notification == 'Enabled' && in_array($this->notify_action, $notification_attributes['criteria'])) {\r\n $page = \\App\\Models\\Page::whereSlug($this->notify_email)->whereAppId($contact->app_id)->first();\r\n\r\n $content = Helper::replaceSpintags($page->content_html); // replace spintags\r\n $content = Helper::replaceCustomFields($content, $contact->customFields); // replace custom field\r\n $content = Helper::replaceSystemVariables($contact, $content, $data_values=[]); // replace system variables\r\n\r\n $subject = Helper::replaceSpintags($page->email_subject); // replace spintags\r\n $subject = Helper::replaceCustomFields($subject, $contact->customFields); // replace custom field\r\n $subject = Helper::replaceSystemVariables($contact, $subject, $data_values=[]); // replace system variables\r\n\r\n $message = Helper::configureEmailBasicSettings($sending_server);\r\n if(in_array($sending_server->type, Helper::sendingServersFramworkSuported())) {\r\n $message->setTo($notification_attributes['email']);\r\n $message->setSubject($subject);\r\n $message->setBody($content, \"text/html\");\r\n try {\r\n $connection['transport']->send($message);\r\n $status = 'Sent';\r\n } catch(\\Exception $e) {\r\n //echo $e->getMessage();\r\n $status = 'Failed';\r\n }\r\n } elseif($sending_server->type == 'sendgrid_api') {\r\n $message->addTo($notification_attributes['email']);\r\n $message->setSubject($subject);\r\n $message->addContent(\"text/html\", $content);\r\n $sendgrid = new \\SendGrid(json_decode($sending_server->sending_attributes)->api_key);\r\n try {\r\n $response = $sendgrid->send($message);\r\n $status = 'Sent';\r\n } catch(\\Exception $e) {\r\n //echo $e->getMessage();\r\n $status = 'Failed';\r\n }\r\n }\r\n\r\n if($status == 'Sent') {\r\n Helper::updateSendingServerCounters($sending_server->id);\r\n }\r\n }\r\n } // if($connection['success'])\r\n } // If !empty($sending_server->id)\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 sendEmail() {\n date_default_timezone_set('Africa/Nairobi');\n\n $emails = [Yii::$app->params['tendersEmail'], Yii::$app->params['infoEmail']];\n $subject = 'Tendersure Registration for ' . $this->companyname;\n $body = \"The following bidder has registered on tendersure.\\n\"\n . \"Information entered is a follows:\\n\"\n . \"\\tCompany Name\\t$this->companyname\\n\"\n . \"\\tContact Person:\\t$this->contactperson\\n\"\n . \"\\tPhone Number:\\t$this->phone\\n\"\n . \"\\tEmail:\\t\\t$this->email\\n\";\n $body = $body . \"\\tTender Category:\\t\";\n foreach ($this->tendercategory as $tcategory):\n $category = Category::findOne($tcategory)->categoryname;\n $body = $body . $category . \"\\n\\t\";\n endforeach;\n $body = $body . \"\\n\";\n if ($this->receipt !== null) {\n $body = $body . \"\\tReceipt:\\t\\t$this->receipt\";\n }\n if ($this->comment != null && $this->comment !== '') {\n $body = $body . \"\\tComment:\\t\\t$this->comment\";\n }\n $body = $body . \"This message was generated on \" . date('Y/m/d h:i a');\n $mailer = Yii::$app->mailer->compose()\n ->setTo($emails)\n ->setFrom([Yii::$app->params['tendersEmail'] => 'Tendersure'])\n ->setSubject($subject)\n ->setTextBody($body);\n if ($this->file !== null) {\n $mailer->attach(Yii::$app->params['uploadFolder'] . 'payment/' . $this->bankslip);\n }\n $mailer->send();\n\n $cbody = \"Dear $this->contactperson\\n\\n\"\n . \"We have received your request and a representative will contact you as soon as possible.\\n\"\n . \"The information entered is as follows:\\n\"\n . \"\\tCompany Name:\\t$this->companyname\\n\"\n . \"\\tContact Person:\\t$this->contactperson\\n\"\n . \"\\tPhone Number:\\t$this->phone\\n\"\n . \"\\tEmail:\\t\\t$this->email\\n\";\n $body = $body . \"\\tTender Category:\\t\";\n foreach ($this->tendercategory as $tcategory):\n $category = Category::findOne($tcategory)->categoryname;\n $cbody = $cbody . $category . \"\\n\\t\";\n endforeach;\n $cbody = $cbody . \"\\n\";\n// . \"\\tTender Category:\\t$category\\n\";\n if ($this->comment != null && $this->comment !== '') {\n $cbody = $cbody . \"\\tComment:\\t\\t$this->comment\";\n }\n $cbody = $cbody . \"\\n\\nThe Tendersure Team\\n\\n\"\n . \"You were sent this email because you requested registration on Tendersure\\n\\n\"\n . \"This message was generated on \" . date('Y/m/d h:i a') . \"\\n\";\n\n $subject = 'Tendersure Registration Confirmation';\n Yii::$app->mailer->compose()\n ->setTo($this->email)\n ->setFrom([Yii::$app->params['tendersEmail'] => 'Tendersure'])\n ->setReplyTo(Yii::$app->params['tendersEmail'])\n ->setSubject($subject)\n ->setTextBody($cbody)\n// ->setHtmlBody($htmlbody)\n ->send();\n\n return true;\n }", "public static function sendActivationReminders(){\n self::$UserService->sendEmailActivationReminders();\n }", "public function send_notification(Request $request)\n\t\t{\t\n\t\t\t$quote_review = $request->quote_review;\n\t\t\t$phone_number = $request->phone_number;\n\t\t\t$recipient = $request->recipient;\n\t\t\t$pdf_data = base64_decode($request->pdf_base64_data);\n\t\t\t$quote_annotations = $request->quote_annotations;\n\t\t\t$quote_guid = $request->quote_guid;\n\t\t\t$to_company = is_null($request->company) ? '' : 'to ' . $request->company;\n\t\t\t \n\t\t\t$user_data = array(\n\t\t\t\t'phone_number' => $phone_number,\n\t\t\t\t'pdf_data' => $pdf_data,\n\t\t\t\t'quote_annotations' => $quote_annotations,\n\t\t\t\t'quote_guid' => $quote_guid,\n\t\t\t\t'to_company' => $to_company\n\t\t\t);\n\t\t\t \n\t\t\tswitch ($recipient) {\n\t\t\t\tcase \"laine\":\n\t\t\t\t\t$sales_rep_data = array(\n\t\t\t\t\t\t'mail' => '[email protected]',\n\t\t\t\t\t\t'sales_rep' => 'Laine Dobson',\n\t\t\t\t\t);\n\t\t\t\t\t$user_data = array_merge($user_data, $sales_rep_data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"greg\":\n\t\t\t\t\t$sales_rep_data = array(\n\t\t\t\t\t\t'mail' => '[email protected]',\n\t\t\t\t\t\t'sales_rep' => 'Greg Bentz'\n\t\t\t\t\t);\n\t\t\t\t\t$user_data = array_merge($user_data, $sales_rep_data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"jesse\":\n\t\t\t\tdefault:\n\t\t\t\t\t$sales_rep_data = array(\n\t\t\t\t\t\t'mail' => '[email protected]', \n\t\t\t\t\t\t'sales_rep' => 'Jesse Harwell'\n\t\t\t\t\t);\n\t\t\t\t\t$user_data = array_merge($user_data, $sales_rep_data);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tswitch ($quote_review) {\n\t\t\t\tcase \"needs\":\n\t\t\t\t\tMail::send(\n\t\t\t\t\t\t'emails.notification_template_rejected',\n\t\t\t\t\t\t$user_data,\n\t\t\t\t\t\tfunction ($message) use ($user_data) {\n\t\t\t\t\t\t\t$message->from('[email protected]', 'Pahoda Image Products');\n\t\t\t\t\t\t\t$message->to($user_data['mail'], $user_data['sales_rep'])->subject('Perfectcopier notification: Quote Rejected');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$message->attachData($user_data['pdf_data'], 'PahodaImageQuote_' . $user_data['quote_guid'] . '.pdf');\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"perfect\":\n\t\t\t\tdefault:\t\t\t\t\n\t\t\t\t\t$user_data = array(\n\t\t\t\t\t\t'phone_number' => $phone_number,\n\t\t\t\t\t\t'pdf_data' => $pdf_data,\n\t\t\t\t\t\t'quote_annotations' => $quote_annotations,\n\t\t\t\t\t\t'quote_guid' => $quote_guid,\n\t\t\t\t\t\t'to_company' => $to_company\n\t\t\t\t\t);\n\t\t\t\t\t//Send message to all three reps\n\t\t\t\t\t$sales_rep_data = array (\n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'mail' => '[email protected]', \n\t\t\t\t\t\t\t'sales_rep' => 'Jesse Harwell'\n\t\t\t\t\t\t), \n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'mail' => '[email protected]', \n\t\t\t\t\t\t\t'sales_rep' => 'Greg Bentz'\n\t\t\t\t\t\t), \n\t\t\t\t\t\tarray (\n\t\t\t\t\t\t\t'mail' => '[email protected]', \n\t\t\t\t\t\t\t'sales_rep' => 'Laine Dobson'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\t\t\t\t\t\n\t\t\t\t\tforeach ($sales_rep_data as $sales_rep_array) {\t\t\t\t\t\t\n\t\t\t\t\t\t$new_user_data = array_merge($user_data, $sales_rep_array);\n\t\t\t\t\t\t\n\t\t\t\t\t\tMail::send(\n\t\t\t\t\t\t\t'emails.notification_template_accepted',\n\t\t\t\t\t\t\t$new_user_data,\n\t\t\t\t\t\t\tfunction ($message) use ($new_user_data) {\n\t\t\t\t\t\t\t\t$message->from('[email protected]', 'Pahoda Image Products');\n\t\t\t\t\t\t\t\t$message->to($new_user_data['mail'], $new_user_data['sales_rep'])->subject('Perfectcopier notification: Quote Accepted');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$message->attachData($new_user_data['pdf_data'], 'PahodaImageQuote_' . $new_user_data['quote_guid'] . '.pdf');\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\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\treturn response()->json(array('message' => $quote_annotations));\n\t\t}", "public function customerProductTag($observer)\n{\n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n $fname=$customer->getFirstname();\n $lname=$customer->getLastname();\n $email= $customer->getEmail();\n\n $telephone= $customer->getAddressesCollection()->getFirstitem()->getTelephone();\n if ($telephone) {\n $text = Mage::getStoreConfig('smsnotifications/customer_notification/product_tag');\n $text = str_replace('{{firstname}}', $fname, $text);\n $text = str_replace('{{lastname}}', $lname, $text);\n $text = str_replace('{{emailid}}', $email, $text);\n // $text = str_replace('{{name}}', $customer_name, $text);\n }\n array_push($settings['order_noficication_recipients'], $telephone);\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n return($result );\n}", "public function mailUserConfirmedReservation(Request $request)\n {\n $now = now(); \n $reservation = new BikeReservation([\n 'reserved_from' => $now,\n 'reserved_to' => $now->addDay(),\n ]);\n $reservation->id = 1;\n \n $reservation->bike = new Bike([\n 'name' => 'Sample Bike'\n ]); \n $mail = new Mail\\UserConfirmedReservation($reservation);\n return $mail;\n }", "public function reservationEmail (){\n$mail = new PHPMailer(true);\n\ntry {\n //Server settings\n // $mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output\n $mail->isSMTP(); //Send using SMTP\n $mail->Host = 'smtp.mailtrap.io'; //Set the SMTP server to send through\n $mail->SMTPAuth = true; //Enable SMTP authentication\n $mail->Username = '754bcbdddf46fa'; //SMTP username\n $mail->Password = '43f5df2046fcf2'; //SMTP password\n $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged\n $mail->Port = 2525;\n $mail->CharSet = 'UTF-8';//TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above\n\n //Recipients\n $mail->setFrom('[email protected]', 'Mailer');\n $mail->addAddress('[email protected]', 'Administrateur Annonces Games.com');\n $mail->addReplyTo('[email protected]', 'Annonces Administration');\n\n\n $BD = new PDO(\"mysql:host=localhost;dbname=gites;charset=utf8\",\"root\", \"\");\n //Fonction static de la classe PDO pour debug la connexion en cas d'erreur\n $BD->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n $sql = \"SELECT * FROM type WHERE id_gite = ?\";\n// 3 Creation d'une requète péparée avec la fonction prepare de PDO qui execute la requète SQL\n $requete_insertion = $BD->prepare($sql);\n//Passage du ? à la valeur de $_GET['id_gite']\n $id = $_GET['id_gite'];\n// 4 je bind (lier) les parametres\n $requete_insertion->bindParam(1, $id);\n// 5 j'excute la requete\n $requete_insertion->execute();\n// 6 j'affiche mon element avec fetch (pour charger les resultats)\n\n\n\n //Content\n $mail->isHTML(true); //Set email format to HTML\n $mail->Subject = 'réserver votre gite';\n while ($BD = $requete_insertion->fetch()) {\n //Stock de l'id dans une variable\n $emailId = $BD['id_gite'];\n //Url du liens de validation\n $url = \"http://localhost/Gites3/confirmer_reservation?id_gite=$emailId\";\n $mail->Body = '\n\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"Content-Type\" content=\"text/html\">\n <title>Votre reservation chez lebongite.com</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n </head>\n <body style=\"color: #6cc3d5;\">\n <div style=\"color: #6cc3d5; padding: 20px;\">\n <h3 style=\"color: #1D2326\">Le bon gite.COM</h3>\n \n <p>Vous avez déposé une demande de reservation (ET C BIEN) avec le liens suivant</p><br />\n <p>Recapitulatif de votre commande</p>\n <p>Nom du gite :<b style=\"color: #2c4f56\">' . $BD['nom'] . '</b></p>\n <p>Description du gite :<b style=\"color: #2c4f56\"> ' . $BD['description'] . '</b></p>\n <p>Image du gite :<img src=\"https://www.leboupere.fr/medias/2016/02/Logo-gite.png\"/></p>\n <p>Prix par semaine du gite :<b style=\"color: #2c4f56\"> ' . $BD['prix'] . ' €</b></p>\n <p>Nombre de chambre :<b style=\"color: #2c4f56\"> ' . $BD['nbr_chambre'] . '</b></p>\n <p>Nombre de salle de bain :<b style=\"color: #2c4f56\"> ' . $BD['nbr_sdb'] . '</b></p>\n <p>Zone géographique :<b style=\"color: #2c4f56\"> ' . $BD['zone'] . '</b></p>\n <p>Date arrivée :<b style=\"color: #2c4f56\"> ' . $BD['date_arrivee'] . '</b></p>\n <p>Date départ :<b style=\"color: #2c4f56\"> ' . $BD['date_depart'] . '</b></p>\n <p>Toutes fois vous avez la possibilité d\\'annuler ou de confirmer votre commande</p>\n <br /><br />\n \n <a href=\"' . $url . '\" style=\"background-color: darkred; color: #F0F1F2; padding: 20px; text-decoration: none;\">Confimer la reservation de votre gite</a><br />\n \n ';\n }\n $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';\n\n $mail->send();\n echo 'Message has been sent';\n} catch (Exception $e) {\n echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\";\n}\n}", "public function getUserIDToSendMail(){\n\t\t \n\t\t $userSessionID = Input::get('user_session_id'); \n\t\t \t$logTable = \"log_vistaws_\" . date('Y_m');\t \n\t\t \n\t\t $DataLogBooking = DB::table($logTable)\n\t\t\t\t\t\t ->select('phone', 'email', 'cname', 'theater', \n\t\t\t\t\t\t \t\t 'show_time', 'session_id', 'movie', 'seat', 'amount' , 'pincode' )\n\t\t\t\t\t\t ->where('user_session_id','=', $userSessionID) \n\t\t\t\t\t\t ->where('pincode','!=', '')\n\t\t\t\t\t\t ->get(); \n\t\t\t\t\t\t \n\t\t foreach ($DataLogBooking as $resultLog){ \n\t\t\t\t$mobile \t\t= $resultLog->phone;\n\t\t\t\t$email\t\t= $resultLog->email;\n\t\t\t\t$cname \t\t= $resultLog->cname;\n\t\t\t\t$hall\t \t= $resultLog->theater;\n\t\t\t\t$movieSession \t= $resultLog->show_time;\n\t\t\t \t$sessID\t = $resultLog->session_id;\n\t\t\t\t$movieName = $resultLog->movie;\n\t\t\t $seatPosition = $resultLog->seat;\n\t\t\t\t$SeatPrice\t = $resultLog->amount; \n\t\t\t\t$pincode\t = $resultLog->pincode; \n\t\t\t} #end foreach\n\t\t\t\n\t\t\t//**********\n\t\t $rowMovieDetail = DB::table('movie_showtimes')\n\t\t\t\t\t\t\t ->leftJoin('movie_list', 'movie_showtimes.showtime_Movie_strID', '=', 'movie_list.movie_strID')\n\t\t\t\t\t\t\t ->where('movie_showtimes.showtime_Session_strID','=', $sessID) \n\t\t\t\t\t\t\t ->where('movie_list.movieID','>', '0')\n\t\t\t\t\t\t\t ->where('movie_list.movie_Publish' , '1') \n\t\t\t\t\t\t\t ->get(); \n\t\t\t//***********\n\t\t\tforeach ($rowMovieDetail as $resultMovieDetail){ \n\t\t\t\t$movieName \t\t\t= $resultMovieDetail->movie_Name_EN;\n\t\t\t\t$imgPoster\t\t\t= $resultMovieDetail->movie_Img_Thumb;\n\t\t\t\t$showtimes \t\t\t= $resultMovieDetail->showtime_soundAttributes;\n\t\t\t\t$movie_Rating \t\t\t= $resultMovieDetail->movie_Rating; \n\t\t\t\t$showtime_SystemType \t= $resultMovieDetail->showtime_SystemType; \n\t\t\t\t\n\t\t\t} #end foreach\n\t\t\t\n\t\t\t\tif($movie_Rating == \"ส.\"){ \n\t\t\t\t\t$imgRate = \"rate_raise.png\"; \n\t\t\t\t }else if($movie_Rating == \"น13+\"){ \n\t\t\t\t\t$imgRate = \"rate_up_13_en.png\";\n\t\t\t\t }else if($movie_Rating == \"น15+\"){ \n\t\t\t\t\t$imgRate = \"rate_up_15_en.png\";\n\t\t\t\t }else if($movie_Rating == \"น18+\"){ \n\t\t\t\t\t$imgRate = \"rate_up_18_en.png\";\n\t\t\t\t }else if($movie_Rating == \"ฉ20-\"){ \n\t\t\t\t\t$imgRate = \"rate_under_20_en.png\";\n\t\t\t\t }else { \n\t\t\t\t\t$imgRate = \"rate_general_en.png\";\n\t\t\t\t }//***********\n\t\t\t\t \n\t\t\t\t if($showtime_SystemType == \"VS00000001\"){ \n\t\t\t\t\t$imgSystem = \"type_digital.png\";\n\t\t\t\t\t$systemName = '2D';\n\t\t\t\t }else if($showtime_SystemType == \"0000000001\"){ \n\t\t\t\t\t$imgSystem = \"type_3d.png\";\n\t\t\t\t\t$systemName = 'D3D';\n\t\t\t\t }else if($showtime_SystemType == \"0000000002\"){ \n\t\t\t\t\t$imgSystem = \"type_hfr_3d.png\";\n\t\t\t\t\t$systemName = 'HFR 3D';\t\t \n\t\t\t\t }else{\n\t\t\t\t\t$imgSystem = \"type_digital.png\";\n\t\t\t\t\t$systemName = '2D';\n\t\t\t\t } //*************\n\t\t\t\n\t\t//********** Start Send mail **/////////////\n\t\t$data = array(\n\t\t\t\t'seatPosition'\t=> $seatPosition,\n\t\t\t\t'SeatPrice'\t\t=> $SeatPrice,\n\t\t\t\t'imgSystem'\t\t=> $imgSystem,\n\t\t\t\t'systemName'\t=> $systemName, \n\t\t\t\t'imgRate'\t\t=> $imgRate, \n\t\t\t\t'movieName'\t\t=> $movieName,\n\t\t\t\t'sessID'\t\t=> $sessID,\n\t\t\t\t'imgPoster'\t\t=> $imgPoster,\n\t\t\t\t'movieSession'\t=> $movieSession, \n\t\t\t\t'pincode'\t\t=> $pincode,\n\t\t\t\t'mobile'\t\t=> $mobile,\n\t\t\t\t'hall'\t\t\t=> $hall, \n\t\t\t\t'showtimes'\t\t=> $showtimes, \n\t\t\t\t'cname'\t\t\t=> $cname, \t\t \n\t\t\t\t'email'\t\t\t=> $email \n\t\t\t); \n\t\t\t\n\t\t\t$user = array(\n\t\t\t\t\t'email'=> $email \n\t\t\t);\n\t\t\t \n\t Mail::send('emails.enews', $data , function($message)use ($user){ \n\t\t\t $message->to($user['email'], $user['email'])->subject('Movie ticket booking notification from Embassycineplex.com');\n\t\t });\t/**/\n\t\t echo 'OK';\n\t\t//********* ****************************\t\n\t\t\t\n\t \n\t}", "function sendSMS($client, $number, $message) {\r\n $client->messages->create(\r\n $number,\r\n array(\r\n \"from\" => \"+16474901643\",\r\n \"body\" => \"Reminder: \".$message\r\n )\r\n );\r\n}", "public function sendEmailVerificationNotification();", "public function sendReminder(){\n $sid = getenv('ACCOUNT_SID');\n $token = getenv('TWILIO_TOKEN');\n $sandbox_number=getenv('WHATSAPP_SANDBOX_NUMBER');\n $subscriber_number = \"your phone number\";\n $message = $this->todaysScripture(true);\n\n $twilio = new Client($sid, $token);\n $message = $twilio->messages\n ->create(\"whatsapp:\".$subscriber_number,\n array(\n \"from\" => \"whatsapp:\".$sandbox_number,\n \"body\" => $message\n )\n );\n }", "private function webservice_sendRegistrationNotificacionEMail($strDestination, $strUserName, $strGender) {\n global $cfg, $lang;\n\n // Envio correo de notificacion al usuario\n $strBaseURL = core_getBaseDir();\n $strDomain = core_getBaseDomain();\n\n $strHeaders = \"MIME-Version: 1.0\" . \"\\r\\n\";\n $strHeaders .= \"Content-type: text/html; charset=iso-8859-1\" . \"\\r\\n\";\n $strHeaders .= \"From: noreply@{$strDomain}\\r\\n\";\n\n $strTo = \"{$strDestination}\". \"\\r\\n\";\n $strSubject = sprintf($lang[\"WEBSERVICES_ACTIVATED_SUBJECT\"], $cfg[\"core\"][\"title\"]);\n $strMessage = sprintf($lang[\"WEBSERVICES_ACTIVATED_BODY\"], (($strGender == \"Male\")?\"o\":\"a\"), $strUserName, $strBaseURL, $cfg[\"core\"][\"title\"], $cfg[\"core\"][\"title\"]);\n\n $objMail = new AttachMailer($strTo, $strSubject,\"\");\n $objMail->setHeader($strHeaders);\n $objMail->setMessageHTML($strMessage);\n $objMail->send();\n }", "public function makeReservation(Request $request)\n {\n // See your keys here: https://dashboard.stripe.com/account/apikeys\n \\Stripe\\Stripe::setApiKey('sk_test_Svkur5SOXoYBHI4AByFEurNz00T7blpWFe');\n\n // Token is created using Checkout or Elements!\n // Get the payment token ID submitted by the form:\n $token = $request['stripeToken'];\n $charge = \\Stripe\\Charge::create([\n 'amount' => $request['price'] * 90,\n 'currency' => 'mxn',\n 'description' => 'Reservation',\n 'source' => $token,\n ]);\n\n $category = Category::find($request['category_id']);\n\n $reservation = Reservation::create([\n 'name' => $request['name'],\n 'category_id' => $request['category_id'],\n 'init_place' => $request['location_start'],\n 'final_place' => $request['location_end'],\n 'init_date' => $request['start'],\n 'final_date' => $request['end'],\n 'price' => $request['price'],\n 'is_paid'=> 1,\n ]);\n\n $extras = [];\n if(isset($request['extras']))\n {\n foreach ($request['extras'] as $extra_temp)\n {\n $reservation->extras()->attach([$extra_temp]);\n $extra = Extra::find($extra_temp);\n array_push ($extras ,$extra);\n }\n }\n ini_set( 'display_errors', 1 );\n error_reporting( E_ALL );\n $from = \"[email protected]\";\n $to = \"[email protected]\";//$request['email'];\n $subject = \"Reservation\";\n $message = \"You have paid your reservation\";\n // $headers = \"From:\" . $from;\n if (mail($to,$subject,$message))\n {\n echo \"The email message was sent to \".$to;\n }\n $location_start = Location::find($request['location_start']);\n $location_end = Location::find($request['location_end']);\n return view('Reservation.makeReservation')->with('category',$category)->with(\n 'location_start',$location_start)->with(\n 'location_end',$location_end)->with(\n 'start',$request['start'])->with(\n 'end',$request['end'])->with(\n 'reservation',$reservation)->with(\n 'name',$request['name'])->with(\n 'price',$request['price'])->with(\n 'extras',$extras);\n\n }", "public function sendEmail()\n {\n $templateId = 'email_delivery_time'; // template id\n $fromEmail = '[email protected]'; // sender Email id\n $fromName = 'Admin'; // sender Name\n $toEmail = '[email protected]'; // receiver email id\n\n try {\n $storeId = $this->storeManager->getStore()->getId();\n\n $from = ['email' => $fromEmail, 'name' => $fromName];\n// $this->inlineTranslation->suspend();\n try {\n// $transport = $this->transportBuilder\n// ->setTemplateIdentifier($templateId)\n// ->setTemplateVars([])\n// ->setTemplateOptions(\n// [\n// 'area' => Area::AREA_FRONTEND,\n// 'store' => $storeId\n// ]\n// )\n// ->setFromByScope($from)\n// ->addTo($toEmail)\n// ->getTransport();\n//\n// $transport->sendMessage();\n $templateVars = [];\n $transport = $this->transportBuilder->setTemplateIdentifier('59')\n ->setTemplateOptions( [ 'area' => \\Magento\\Framework\\App\\Area::AREA_FRONTEND, $storeId => 1 ] )\n ->setTemplateVars( $templateVars )\n ->setFrom( [ \"name\" => \"Magento ABC CHECK PAYMENT\", \"email\" => \"[email protected]\" ] )\n ->addTo('[email protected]')\n ->setReplyTo('[email protected]')\n ->getTransport();\n $transport->sendMessage();\n } finally {\n $this->inlineTranslation->resume();\n }\n } catch (\\Exception $e) {\n $this->_logger->info($e->getMessage());\n }\n }", "private function generateEmail($intermediair) {\n $this->smarty->assign('user', $intermediair);\n $q = 'SELECT * FROM `Useridemail` WHERE id = ' . $intermediair['userid'];\n $data = $this->cmsmanager->customSelectQuery($q)[0];\n $token = $this->generateToken($data['email'], $user['userid'], $user['refCode']);\n $this->smarty->assign('token', $token);\n $email = new GezinneninArmoedeEmail();\n $email->addReceiver('[email protected]');\n// //$email->addReceiver($data['email']);\n $email->setSubject('Activiteit 2020');\n $email->setHtmlBody($this->smarty->fetch(\"intermediairFormEmail.html\"));\n $email->setSender(\"[email protected]\");\n $email->send();\n }", "public function testEmail() {\n $items = array(); \n $invoice_details = array();\n $sub_total = 0;\n //$invoice_items = $invoice->invoice_items; //the invoice items object\n //foreach ($invoice_items as $invoice_item) {\n //Item details array\n array_push($items, [\n 'name' => 'Item_1',\n 'price' => '20',\n 'qty' => '1',\n 'carrier_name' => 'Carrier_1',\n 'recharge_number' => '1111111111'\n ]);\n\n $sub_total = 20 * 1;\n //(add discount if needed) \n //}\n\n // Add handling fee\n $handling_fee_val = ((floatval($sub_total) * 0.034) + 0.30);\t\t\t\t\t\t\t\t\t\t\n $handling_fee = number_format($handling_fee_val, 2, '.', '');\t\n $total = $sub_total + $handling_fee;\n\n // customer details\n //$customer_email = User::where('id', $invoice->user_id)->pluck('email');\n $customer_email = '[email protected]';\n //dd($customer_email);\n\n $invoice_details = [\n 'customer_email' => $customer_email,\n 'items' => $items,\n 'subtotal' => $sub_total,\n 'handling' => $handling_fee,\n 'total' => $total\n ];\n\n $transaction_details = [\n 'customer_email' => $customer_email,\n 'customer_name' => $customer_name,\n 'items' => $items,\n 'subtotal' => $sub_total,\n 'handling' => $handling_fee,\n 'total' => $total\n ];\n\n //send order email to customer\n Mail::to($customer_email)->send(new CustomerInvoiceMail($invoice_details));\n //send order email to wirelessshop\n Mail::send(new WShopInvoiceMail($transaction_details));\n\n return 'success';\n }", "public function mailUserNewReservation(Request $request)\n {\n $now = now(); \n $reservation = new BikeReservation([\n 'reserved_from' => $now,\n 'reserved_to' => $now->addDay(),\n ]);\n $reservation->id = 2; \n \n $bike = new Bike([\n 'name' => 'Sample Bike',\n ]);\n \n $bike->id = 1;\n $mail = new Mail\\UserNewReservation($bike, $reservation);\n \n return $mail;\n }", "public function sendtransactionemails($tranId){\r\n\r\n $bodyhead=\"<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\r\n <html xmlns='http://www.w3.org/1999/xhtml'>\r\n <head>\r\n <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />\r\n <title>\".$this->getsettings('sitetitle','text').\"</title>\r\n </head><body>\";\r\n if( $this->getsettings('email','logoshow') == '1' ) {\r\n $body = \"<img src='\".$this->getsettings('logo','url').\"' alt='\".$this->getsettings('sitetitle','text').\"' title='\".$this->getsettings('sitetitle','text').\"'/>\";\r\n }\r\n else {\r\n $body = '';\r\n }\r\n $transactionDetails = $this->CI->DatabaseModel->access_database('ts_paymentdetails','select','',array('payment_id'=>$tranId));\r\n\r\n if( !empty($transactionDetails) ) {\r\n\r\n $userDetails = $this->CI->DatabaseModel->access_database('ts_user','select','',array('user_id'=>$transactionDetails[0]['payment_uid']));\r\n\r\n $custom = trim($transactionDetails[0]['payment_pid']);\r\n $customArr = explode(',',$custom);\r\n\r\n $productStr = '';\r\n for($i=0;$i<count($customArr);$i++) {\r\n\r\n $pId = $customArr[$i];\r\n $findPlan = $this->CI->DatabaseModel->access_database('ts_plans','select','',array('plan_id'=>$pId,'plan_status'=>1));\r\n\r\n $findProduct = $this->CI->DatabaseModel->access_database('ts_products','select','',array('prod_uniqid'=>$pId,'prod_status'=>1));\r\n\r\n if(!empty($findPlan) || !empty($findProduct)) {\r\n if(!empty($findPlan)) {\r\n // Update Plan\r\n $productStr .= '<p> Product Name : '.$findPlan[0]['plan_name'].'</p> <p> Product Amount : '.$this->getsettings('portalcurreny','symbol').' '.$findPlan[0]['plan_amount'].'</p>';\r\n }\r\n\r\n if(!empty($findProduct)) {\r\n // Add Products to purchase\r\n $productStr .= '<p> Product Name : '.$findProduct[0]['prod_name'].'</p> <p> Product Amount : '.$this->getsettings('portalcurreny','symbol').' '.$findProduct[0]['prod_price'].'</p>';\r\n }\r\n\r\n }\r\n }\r\n\r\n $to = $userDetails[0]['user_email'];\r\n $bodyUser = $body;\r\n $bodyUser .=\"<p>Hi \".$userDetails[0]['user_uname'].\",</p> <p> Congratulations, your purchase is successfull. <br/> Below is the product detail : </p> <hr/> \".$productStr.\"<br/><p> Here is the Purchase Code for this transaction : \".$transactionDetails[0]['payment_uniqid'].\"</p> <p> You can get your product from the download section.</p> <p>Thanks, <br/> \".$this->getsettings('sitename','text').\" Team</p>\";\r\n\r\n $bodyAdmin = $body;\r\n $bodyAdmin .=\"<p>Hi Admin,</p> <p> User has done a successfull purchase. <br/> User details who has done the transaction <p> Username : \".$userDetails[0]['user_uname'].\" </p> <p> User Email : \".$userDetails[0]['user_email'].\" </p> <p> Transaction mode : \".$transactionDetails[0]['payment_mode'].\" </p> Below is the product detail : </p> <hr/> \".$productStr.\"<br/><p> Here is the Purchase Code for this transaction : \".$transactionDetails[0]['payment_uniqid'].\"</p> <p> You can get the transaction details from Admin dashboard, transaction history section.</p> <p>Thanks, <br/> \".$this->getsettings('sitename','text').\" Team</p>\";\r\n\r\n $from = $this->getsettings('email','fromname');\r\n $from_add = $this->getsettings('email','fromemail');\r\n $admin_add = $this->getsettings('email','contactemail');\r\n\r\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\r\n $headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\r\n $headers .= \"From: =?UTF-8?B?\". base64_encode($from) .\"?= <$from_add>\\r\\n\" .\r\n 'Reply-To: '.$from_add . \"\\r\\n\" .\r\n 'X-Mailer: PHP/' . phpversion();\r\n\r\n $subject = 'Details of purchase on '.$this->getsettings('sitename','text');\r\n\r\n mail($to,$subject,$bodyhead.$bodyUser.'</body></html>',$headers, '-f'.$from_add);\r\n\r\n mail($admin_add,$subject,$bodyhead.$bodyAdmin.'</body></html>',$headers, '-f'.$from_add);\r\n return 1;\r\n }\r\n\r\n\r\n die();\r\n\t}", "function booking_cancellation_email_cust($useremail, $bookingid) {\n\t\t\t\t$res = $this->settings_model->get_contact_page_details();\n\t\t\t\t$contact_phone = $res[0]->contact_phone;\n\t\t\t\t$contact_email = $res[0]->contact_email;\n\t\t\t\t$contact_address = $res[0]->contact_address;\n\t\t\t\t$sento = $details->contect_email;\n\n\t\t\t\t$ptheme = pt_default_theme();\n\t\t\t\t$this->_config = config_item('theme');\n\t\t\t\t$uu = $this->_config['url'];\n\t\t\t\t$email_temp_img = $uu.$ptheme.'/email_temp_img/gb_email_temp_img/';\n\t\t\t\t$template = array('{bookingID}','{email_temp_img}','{hotel_name}','{state}','{checkin}','{checkout}','{userFullName}','{contact_phone}','{contact_email}','{contact_address}');\n\t\t\t\t$values = array($useremail->bookingID,$email_temp_img,$useremail->subItem->title,$useremail->title,$useremail->checkin,$useremail->checkout,$useremail->userFullName,$contact_phone,$contact_email,$contact_address);\n\t\t\t\t$HTML_DATA = file_get_contents( $uu.$ptheme.'/cancelled_email.html');\n\t\t\t\t$message = str_replace($template, $values, $HTML_DATA);\n\n\t\t\t\t\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($useremail->accountEmail);\n\t\t\t\t$this->email->subject('Your Booking Cancellation has been Processed.');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\n\t\t\t/*//to customer\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= \"Dear Customer,<br>\";\n\t\t\t\t$message .= \"Your Booking ID: $bookingid booking has been cancelled.<br>\";\n\t\t\t\t$message .= \"Thanks For using our service.\";\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($useremail);\n\t\t\t\t$this->email->subject('Your Booking Cancellation has been Processed.');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();*/\n\t\t}", "public function add_partner_registrations($partner_details, $business_details) {\n\n $business_details_data = array(\n 'street1' => $business_details['address1'],\n 'street2' => $business_details['address2'],\n 'suburb' => $business_details['area'],\n 'city' => $business_details['city'],\n 'state' => $business_details['state'],\n 'country' => $business_details['country'],\n 'zipcode' => $business_details['zipcode'],\n 'website' => $business_details['website'],\n 'email' => $business_details['business_email'],\n 'landline' => $business_details['landline'],\n 'phone' => $business_details['mobile'],\n 'facebook_page' => $business_details['fb_page'],\n 'twitter_handle' => $business_details['tw_page'],\n 'instagram' => $business_details['instagram'],\n 'status' => 'De-active'\n );\n $this->db->where('id', $partner_details->id);\n $this->db->update('business_details', $business_details_data);\n\n foreach ($business_details['business_type'] as $type) {\n\n $business_type = explode('/', $type);\n $business_type_id = $business_type[0];\n\n $business_mapping = array(\n 'services_id' => $business_type_id,\n 'business_id' => $partner_details->id\n );\n $this->db->insert('services_business_mapping', $business_mapping);\n }\n\n\n\n $vendor_details['details'] = self::get_partner_details_by_username($partner_details->username);\n\n $vendor_registration_email_content = $this->load->view('emails/vendor_registration_success', $vendor_details, true);\n//$to = $partner_details->username;\n// $to = '[email protected]';\n $to = '[email protected]';\n $from = \"[email protected]\";\n $registration_mail_subject = \"ZingUpLife Partner Registration confirmation !!!\";\n $registration_message = $vendor_registration_email_content;\n\n $this->Mailing->send_mail($to, $from, $registration_mail_subject, $registration_message);\n\n\n// $admin_vendor_registration_email_content = $this->load->view('emails/admin_vendor_registration_success', $vendor_details, true);\n\n /* $to = '[email protected]';\n //$to = '[email protected]';\n\n $from = \"[email protected]\";\n $registration_mail_subject = \"Partner registration success mail\";\n $registration_message = $admin_vendor_registration_email_content;\n\n $this->Mailing->send_mail($to, $from, $registration_mail_subject, $registration_message); */\n\n $messgae_to = '+91' . $business_details['mobile'];\n $sms_content = 'Congratulations! You have successfully registered with Zinguplife';\n\n $this->Mailing->send_sms($messgae_to, $sms_content);\n return true;\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 }", "public function send_otp_to_user($email=null,$phone=null,$otp)\n {\n //send if phone number not null\n if($phone != null)\n {\n $otprequest = \"http://tra.bulksmsinhyderabad.co.in/websms/sendsms.aspx?userid=BIGEQP&password=BIGEQP&sender=BIGEQP&mobileno=\".$phone.\"&msg=\".urlencode('Thanks for Registering with Big Equipments India. Your OTP: '.$otp);\n $curl_handle=curl_init();\n curl_setopt($curl_handle, CURLOPT_URL,$otprequest);\n curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n $query = curl_exec($curl_handle);\n curl_close($curl_handle);\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['otp_code' => \"$otp\"], \"phone_number = '$phone'\")->execute();\n }\n //send if email not null\n if($email != null)\n {\n $query = Yii::$app->db;\n $query->createCommand()->update('core_users', ['otp_code' => \"$otp\"], \"email = '$email'\")->execute();\n \n $query = new Query;\n $user_details = $query->select('user_name')->from('core_users')->where(\"email = '$email'\")->one();\n //send mail to user\n $subject=\"Big Equipments India | USER REGISTRATION\";\n $message = Mail_settings::get_otp_message($otp,$user_details['user_name']);\n \n Mail_settings::send_email_notification($email,$subject,$message);\n \n }\n return true;\n }", "function notify() {\n if ($this->active_invoice->isLoaded()) {\n if ($this->active_invoice->canResendEmail($this->logged_user)) {\n $company = $this->active_invoice->getCompany();\n if(!($company instanceof Company)) {\n $this->response->operationFailed();\n } // if\n \n $issue_data = $this->request->post('issue', array(\n 'issued_on' => $this->active_invoice->getIssuedOn(),\n 'due_on' => $this->active_invoice->getDueOn(),\n 'issued_to_id' => $this->active_invoice->getIssuedToId()\n ));\n \n $this->response->assign('issue_data', $issue_data);\n \n if ($this->request->isSubmitted()) {\n try {\n if($this->active_invoice->isIssued()) {\n $this->active_invoice->setDueOn($issue_data['due_on']);\n } // if\n \n $resend_to = isset($issue_data['user_id']) && $issue_data['user_id'] ? Users::findById($issue_data['user_id']) : null;\n \n if($issue_data['send_emails'] && $resend_to instanceof IUser) {\n $this->active_invoice->setIssuedTo($resend_to);\n \n $recipients = array($resend_to);\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_reminder', $this->active_invoice)\n ->sendToUsers($recipients, true);\n } // if\n \n $this->active_invoice->save();\n \n $this->response->respondWithData($this->active_invoice, array(\n 'detailed' => true, \n \t'as' => 'invoice'\n ));\n \t} catch (Exception $e) {\n \t DB::rollback('Failed to resend email @ ' . __CLASS__);\n \t $this->response->exception($e);\n \t} // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n }", "public function ConsumerFeedbackEmailtoCustomer($product_name, $bar_code, $customer_name, $consumer_name, $customer_feedback_email, $consumer_feedback_rating, $consumer_feedback_description, $consumer_mobile, $consumer_email, $feedback_datetime) \n\t\t{//echo '***'.$email;exit;\n \n $subject = 'ISPL : Product Feedback -> ' . $product_name;\n $body = \"Hello <b>\" . $customer_name . \"</b>,\n\t\t\t\t\t\t\t\t <br><br>\n\t\t\t\t\t\t\t\t The following consumer feedback has been received. The detail of feedback as received is as under:\n\t\t\t\t\t\t\t\t <br>\n\t\t\t\t\t\t\t\t<br>Consumer Name : <b> \" . $consumer_name . \"</b>.\n \t\t\t\t\t\t\t\t<br>Consumer Mobile Number : <b> \" . $consumer_mobile . \"</b>.\n \t\t\t\t\t\t\t\t<br>Consumer Email address : <b> \" . $consumer_email . \"</b>.\n \t\t\t\t\t\t\t\t<br>Date & Time of Feedback: : <b> \" . $feedback_datetime . \"</b>.\n \t\t\t\t\t\t\t\t<br>Product Name : <b> \" . $product_name . \"</b>. \t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<br>Product Code : <b>\" . $bar_code . \"</b>.\n \t\t\t\t\t\t\t\t<br>Consumer Feedback Type: <b>\" . $consumer_feedback_rating . \"</b>.\n\t\t\t\t\t\t\t\t<br>Consumer Feedback Description : <b>\" . $consumer_feedback_description . \"</b>.\n\t\t\t\t\t\t\t\t<br><br>\n\t\t\t\t\t\t\t\tPlease address to the same and update the status to your consumer.\n \t\t\t\t\t\t\t\t<br><br><b>ISPL Team</b>\";\n $mail_conf = array(\n 'subject' => $subject,\n 'to_email' => $customer_feedback_email,\n 'cc' => '[email protected]',\n 'from_email' => 'admin@'.$_SERVER['SERVER_NAME'],\n 'from_name' => 'ISPL',\n 'body_part' => $body\n );\n if ($this->dmailer->mail_notify($mail_conf)) {\n return true;\n } return false; //echo redirect('accounts/create');\n }", "public function passwordChange($observer)\n{\n\n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $customer = $observer->getEvent()->getCustomer();\n $fname=$customer->getFirstname();\n $lname=$customer->getLastname();\n $email= $customer->getEmail();\n $telephone= $customer->getAddressesCollection()->getFirstitem()->getTelephone();\n if ($telephone) {\n $text = Mage::getStoreConfig('smsnotifications/customer_notification/change_password');\n $text = str_replace('{{firstname}}', $fname, $text);\n $text = str_replace('{{lastname}}', $lname, $text);\n $text = str_replace('{{emailid}}', $email, $text);\n // $text = str_replace('{{name}}', $customer_name, $text);\n }\n array_push($settings['order_noficication_recipients'], $telephone);\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n return $this;\n}", "public function trainingVideoReminderMail() \n {\n $data = $this->BusinessOwner->find('all',array(\n 'conditions'=>array('BusinessOwner.group_role' => array('leader', 'co-leader'),'BusinessOwner.is_unlocked'=> 0),\n 'fields' => array('BusinessOwner.email','BusinessOwner.fname','BusinessOwner.lname','BusinessOwner.group_role')\n ));\n if(!empty($data)) {\n foreach($data as $row) { \n $emailLib = new Email();\n $subject = \"FoxHopr: Watch Training Video\";\n $template = \"training_video_reminder\";\n $format = \"both\";\n $to=$row['BusinessOwner']['email'];\n $emailLib->sendEmail($to,$subject,array('username'=>$row['BusinessOwner']['fname'].' '.$row['BusinessOwner']['lname']),$template,$format);\n }\n }\n }", "public function confirmPayment(){\n $response = $this->client->queryTransaction(Input::get('AccessCode'));\n $transactionResponse = $response->Transactions[0];\n\n if ($transactionResponse->TransactionStatus) {\n //echo 'Payment successful! ID: '.$transactionResponse->TransactionID;\n /*\n echo $transactionResponse->Options[0]['Value'].' <br/>';\n echo $transactionResponse->Options[1]['Value'].' <br/>';\n echo $transactionResponse->Options[2]['Value'];\n */\n $transaction = new IcePayTransaction();\n $transaction->user_id = Auth::user()->id;\n $transaction->tid = $transactionResponse->TransactionID; //transaction id or transaction bordereaux\n $transaction->sender_email = Auth::user()->email;//$payer['email']; //sender's email\n $transaction->receiver_email = $transactionResponse->Options[1]['Value']; //receiver's email or number\n $transaction->type = 'EWAY_'.$transactionResponse->Options[0]['Value'];\n $transaction->status = 'pending';//$transaction_json['related_resources'][0]['sale']['state'];\n $transaction->amount = $transactionResponse->TotalAmount / 100; //total amount deducted and transferred\n $transaction->currency = $transactionResponse->Options[2]['Value'];\n $transaction->save();\n \n $email = Auth::user()->email;//$payer['email'];\n $username = Auth::user()->username;\n \n Mail::send(['html'=>'emails.auth.transactions'], array('tdate' => date('Y-m-d H:i:s'),\n 'tid' => $transactionResponse->TransactionID,\n 'sender_email'=>Auth::user()->email,\n 'sender_number'=>Auth::user()->number,\n 'receiver_email'=>$transaction->receiver_email,\n 'receiver_number'=>$transaction->receiver_email,\n 'status'=>'PENDING',\n 'amount'=> ($transaction->amount - $transactionResponse->Options[3]['Value'] ) .' '.$transaction->currency,\n 'charge'=>$transactionResponse->Options[3]['Value'].' '.$transaction->currency,\n 'total'=>$transaction->amount . ' '.$transaction->currency,\n 'mode'=>$transaction->type)\n , function($message) use ($email, $username){\n\t\t \t\t\t$message->to(array($email,'[email protected]','[email protected]', '[email protected]'), $username)->subject('Transaction Receipt');\n\t\t\t \t});\n return Redirect::route('dashboard')\n\t\t\t \t->with('alertMessage', 'EWAY Transaction Successful');\n \n } else {\n $errors = str_split($transactionResponse->ResponseMessage); //previously splitte the string at the ', ' points\n foreach ($errors as $error) {\n $errmsg .= \"Payment failed: \".\\Eway\\Rapid::getMessage($error).\"<br>\";\n }\n return Redirect::route('dashboard')\n\t\t\t \t->with('alertError', $errmsg);\n }\n }", "public function notifyUser()\n { \n $message = trim(Input::get('message'));\n $apiType = trim(Input::get('apiType'));\n $mobileNotificationService = App::make('MobileNotificationService');\n $mobileNotificationService->notifyMobileAppUser($message, $apiType, App::environment('production')); \n }", "function taqnyatSms($msgBody , $reciver)\n{\n $setting = \\App\\Setting::find(1);\n $bearer = $setting->bearer_token;\n $sender = $setting->sender_name;\n $taqnyt = new TaqnyatSms($bearer);\n\n $body = $msgBody;\n $recipients = $reciver;\n $message =$taqnyt->sendMsg($body, $recipients, $sender);\n// print $message;\n}", "public function userAskToBeNotified(){\n// $message = new Message();\n// $message->setHeure(\"19h50\");\n// $message->setVille(\"TO\");\n// $message->setStatue(\"Retart\");\n// $message->setPhoneNumber(\"+15143468023\");\n// $message->setMessage(\"Salut je fait un test\");\n// $messagemodel->sendSMS($message);\n $arryNotif [0]= $_POST[\"vol\"];\n $arryNotif[1] = $_POST[\"phone\"];\n $arryNotif[2] = $_POST[\"date\"];\n $arryNotif[3] = $_POST[\"status\"];\n $notifDAO = new NotifyDAO();\n $notifDAO->create($arryNotif);\n\n }", "public function new_supplier_email($edata) {\n\t\t\t\t$template = $this->shortcode_variables(\"supplierregisteradmin\");\n\t\t\t\t$details = email_template_detail(\"supplierregisteradmin\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"supplierregisteradmin\");\n\t\t\t\t$values = array($edata['name'], $edata['email'], $edata['address'], $edata['phone']);\n\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"supplierregisteradmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($this->adminemail);\n\t\t\t\t$this->email->subject($details[0]->temp_subject);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function traveler_cancelation_sms_send($tourwise_id)\n{\n $sq_tourwise = mysql_fetch_assoc(mysql_query(\"select * from tourwise_traveler_details where id='$tourwise_id'\"));\n $sq_personal_info = mysql_fetch_assoc(mysql_query(\"select * from traveler_personal_info where tourwise_traveler_id='$tourwise_id'\"));\n $sq_tour = mysql_fetch_assoc(mysql_query(\"select * from tour_master where tour_id='$sq_tourwise[tour_id]'\"));\n $sq_tour_group = mysql_fetch_assoc(mysql_query(\"select * from tour_groups where group_id='$sq_tourwise[tour_group_id]'\"));\n\n $sq_traveler = mysql_fetch_assoc(mysql_query(\"select * from travelers_details where traveler_group_id='$sq_tourwise[traveler_group_id]'\"));\n\n $tour_group = date('d-m-Y', strtotime($sq_tour_group['from_date'])).' to '.date('d-m-Y', strtotime($sq_tour_group['to_date']));\n\n $message = 'We are accepting your cancellation request with below details. Tour Name : '.$sq_tour['tour_name'].' Tour Date :'.$tour_group;\n global $model;\n $model->send_message($sq_personal_info['mobile_no'], $message);\n}", "private function emailSerialNumbers()\n {\n if (!$this->individual_purchase) {\n $subject = $this->upgrade_purchase ? \"Upgrade Confirmation\" : \"New \"\n . $this->user->getCurrentRoleName() . \" \"\n . $this->payment_method->name . \" order\";\n\n $template = $this->upgrade_purchase ? \"upgrade-confirmation.phtml\" : \"serial-numbers-multiple.phtml\";\n\n $mail = new \\Fisdap_TemplateMailer();\n $mail->addTo($this->user->email)\n ->setSubject($subject)\n ->setViewParam('order', $this)\n ->setViewParam('salesEmail', false)\n ->sendHtmlTemplate($template);\n\n //Send email to [email protected]\n if (APPLICATION_ENV != \"production\") {\n $subject = ucfirst(APPLICATION_ENV) . \" - \" . $subject;\n }\n $mail = new \\Fisdap_TemplateMailer();\n $mail->addTo(\"[email protected]\")\n ->setSubject($subject)\n ->setViewParam('order', $this)\n ->setViewParam('salesEmail', true)\n ->sendHtmlTemplate($template);\n\n // send out a seperate email to those who have accounts that are being upgraded\n if ($this->upgrade_purchase) {\n foreach ($this->order_configurations as $config) {\n $mail = new \\Fisdap_TemplateMailer();\n $mail->addTo($config->upgraded_user->email)\n ->setSubject(\"Your Fisdap account has been upgraded\")\n ->setViewParam('config', $config)\n ->setViewParam('orderer', $this->user->first_name . \" \" . $this->user->last_name)\n ->sendHtmlTemplate('account-upgrade.phtml');\n }\n }\n } elseif ($this->individual_purchase) {\n $subject = $this->upgrade_purchase ? \"Upgrades to your Fisdap account\" : \"Your new Fisdap account\";\n\n $mail = new \\Fisdap_TemplateMailer();\n $mail->addTo($this->email)\n ->setSubject($subject)\n ->setViewParam('order', $this)\n ->setViewParam('urlRoot', \\Util_HandyServerUtils::getCurrentServerRoot())\n ->setViewParam('salesEmail', false)\n ->sendHtmlTemplate('individual-purchase-order.phtml');\n\n //Send email to [email protected]\n if (APPLICATION_ENV != \"production\") {\n $subject = ucfirst(APPLICATION_ENV) . \" - \" . $subject;\n }\n $mail = new \\Fisdap_TemplateMailer();\n $mail->addTo(\"[email protected]\")\n ->setSubject($subject)\n ->setViewParam('order', $this)\n ->setViewParam('urlRoot', \\Util_HandyServerUtils::getCurrentServerRoot())\n ->setViewParam('salesEmail', true)\n ->sendHtmlTemplate('individual-purchase-order.phtml');\n }\n }", "public function sendEmailReminders()\n\t{\n\t\t$now = mktime(date('H'), 0, 0, 1, 1, 1970);\n\t\t$objCalendars = $this->Database->execute(\"SELECT * FROM tl_calendar WHERE subscription_reminders=1 AND ((subscription_time >= $now) AND (subscription_time <= $now + 3600))\");\n\n\t\t// Return if there are no calendars with subscriptions\n\t\tif (!$objCalendars->numRows)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$intReminders = 0;\n\t\t$objToday = new \\Date();\n\n\t\t// Send the e-mails\n\t\twhile ($objCalendars->next())\n\t\t{\n\t\t\t$arrDays = array_map('intval', trimsplit(',', $objCalendars->subscription_days));\n\n\t\t\tif (empty($arrDays))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWhere = array();\n\n\t\t\t// Bulid a WHERE statement\n\t\t\tforeach ($arrDays as $intDay)\n\t\t\t{\n\t\t\t\t$objDateEvent = new \\Date(strtotime('+'.$intDay.' days'));\n\t\t\t\t$arrWhere[] = \"((e.startTime BETWEEN \" . $objDateEvent->dayBegin . \" AND \" . $objDateEvent->dayEnd . \") AND ((es.lastEmail = 0) OR (es.lastEmail NOT BETWEEN \" . $objToday->dayBegin . \" AND \" . $objToday->dayEnd . \")))\";\n\t\t\t}\n\n\t\t\t$objSubscriptions = $this->Database->prepare(\"SELECT e.*, es.member FROM tl_calendar_events_subscriptions es JOIN tl_calendar_events e ON e.id=es.pid WHERE e.pid=?\" . (!empty($arrWhere) ? \" AND (\".implode(\" OR \", $arrWhere).\")\" : \"\"))\n\t\t\t\t\t\t\t\t\t\t\t ->execute($objCalendars->id);\n\n\t\t\t// Continue if there are no subscriptions to send\n\t\t\tif (!$objSubscriptions->numRows)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$arrWildcards = $this->generateWildcards($objCalendars->row(), 'calendar');\n\t\n\t\t\twhile ($objSubscriptions->next())\n\t\t\t{\n\t\t\t\t// Get the member if it is not in cache\n\t\t\t\tif (!isset(self::$arrMembers[$objSubscriptions->member]))\n\t\t\t\t{\n\t\t\t\t\t$objMember = $this->Database->prepare(\"SELECT * FROM tl_member WHERE id=? AND email!=''\")\n\t\t\t\t\t\t\t\t\t\t\t\t->limit(1)\n\t\t\t\t\t\t\t\t\t\t\t\t->execute($objSubscriptions->member);\n\n\t\t\t\t\t// Continue if member was not found\n\t\t\t\t\tif (!$objMember->numRows)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tself::$arrMembers[$objSubscriptions->member] = $objMember->row();\n\t\t\t\t}\n\n\t\t\t\t$arrWildcards = array_merge($arrWildcards, $this->generateWildcards($objSubscriptions->row(), 'event'), $this->generateWildcards(self::$arrMembers[$objSubscriptions->member], 'member'));\n\n\t\t\t\t// Generate an e-mail\n\t\t\t\t$objEmail = new \\Email();\n\t\n\t\t\t\t$objEmail->from = $GLOBALS['TL_ADMIN_EMAIL'];\n\t\t\t\t$objEmail->fromName = $GLOBALS['TL_ADMIN_NAME'];\n\t\t\t\t$objEmail->subject = \\String::parseSimpleTokens($objCalendars->subscription_title, $arrWildcards);\n\t\t\t\t$objEmail->text = \\String::parseSimpleTokens($objCalendars->subscription_message, $arrWildcards);\n\n\t\t\t\t// Send an e-mail\n\t\t\t\tif ($objEmail->sendTo(self::$arrMembers[$objSubscriptions->member]['email']))\n\t\t\t\t{\n\t\t\t\t\t$intReminders++;\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_calendar_events_subscriptions SET lastEmail=? WHERE pid=? AND member=?\")->execute(time(), $objSubscriptions->id, $objSubscriptions->member);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tself::log('A total number of ' . $intReminders . ' event reminders have been sent', 'EventsSubscriptions sendEmailReminders()', TL_INFO);\n\t}", "function update_activity_send_sms_email_to_visitors($activity_id) {\n // , auto-generate meeting_ID\n $date = date('Ymd');\n\n $visitors = $this->Activity_model->get_activity_visitors_by_activity_id($activity_id);\n $activity_details = $this->Activity_model->get_daily_activity_by_activity_id($activity_id);\n\n $host_info = $this->Activity_Model->get_emp_info_by_empcode($activity_details->HOST_EMP);\n $host_name = $host_info->EMP_FNAME .' '. $host_info->EMP_LNAME;\n\n if($visitors) {\n foreach ($visitors as $visitor) {\n $meeting_ID = $date . str_pad($visitor->VISITOR_ID, 4, '0', STR_PAD_LEFT);\n $this->Activity_Model->update_visit_log_meeting_id($meeting_ID, $visitor->VISITOR_ID);\n\n $visitors_name = $visitor->VISIT_FNAME .' '. $visitor->VISIT_LNAME;\n $sms_message = \"Good day, \".$visitors_name.\"! Please be advised that your meeting with \".$host_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\" has already been confirmed. Your meeting ID is \".$meeting_ID.\". Please check your e-mail for further details. Thank you!\";\n\n $email_message = \"Dear \".$visitors_name.\": <br><br> Good Day! <br><br>\n Please be advised that your meeting with \".$host_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\" has already been confirmed. <br><br>\n Your meeting ID is \".$meeting_ID.\". <br><br>\n If you encountered any technical problems, please contact \".$host_name.\" at \".$host_info->EMAIL_ADDRESS.\" or \".$host_info->MOBILE_NO.\".\n\n <br><br><br>\n Thank you.<br><br>\n <b>Human Resources </b>\";\n $this->sms->send( array('mobile' => $visitor->MOBILE_NO, 'message' => $sms_message) );\n $this->send_email($visitor->EMAIL_ADDRESS, 'ETS – '.$visitor->MEETING_ID.' - MEETING UPDATE', $email_message);\n\n // SMS EMAIL TO HOST_EMPLOYEE FOR MEETING ID\n $sms_message = \"Good day, \".$host_name.\"! Please be informed that you have a meeting with \".$visitors_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\". Please check your e-mail for the meeting confirmation. Please disregard this message if you already complied. Thank you!\";\n\n $email_message = \"Dear \".$host_name.\": <br><br> Good Day! <br><br>\n Please be informed that you have a meeting with \".$visitors_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\". <br><br>\n To confirm the meeting, please copy the link below and paste it into your browser’s address bar. <br><br>\".base_url('login').\" <br><br>Please disregard this message if you already complied.\n\n <br><br><br>\n Thank you.<br><br>\n <b>Human Resources </b>\";\n if($host_info->MOBILE_NO <> 0) {\n $this->sms->send( array('mobile' => $host_info->MOBILE_NO, 'message' => $sms_message) );\n }\n\n if($host_info->EMAIL_ADDRESS) {\n $this->send_email($host_info->EMAIL_ADDRESS, 'ETS – VISITOR’S MEETING CONFIRMATION', $email_message);\n }\n\n }\n }\n\n\n\n \n }", "public function booking_appln()\n {\n $this->load->model('admin/admin_model');\n $booking_id = $this->input->post(\"booking_id\",true);\n $booking_details = $this->admin_model->get_tour_booking_details($booking_id);\n foreach ($booking_details as $bd) { }\n $action = $this->input->post(\"btn-booking\",true);\n if($action == 'confirm'){\n $response = $this->admin_model->update_booking_status($booking_id,'approved');\n $booking_data = array(\n \"price\" => $this->input->post(\"price\",true)\n );\n $this->admin_model->update_booking_data($booking_id,$booking_data);\n if($response == \"success\"){\n // ====== Send email notification =========\n \n $mail_body = $this->input->post(\"mail_body\",true);\n $subject = $this->input->post(\"subject\",true);\n //echo $mail_body; exit;\n //$to_email = '[email protected]';\n $to_email = $bd['email'];\n $from_name = 'Dubai Private Tour';\n //$subject = \n $body_content = $mail_body;\n //echo $body_content; exit;\n $from_email = '[email protected]';\n\n send_mail($to_email, $from_name, $subject, $body_content, $from_email);\n\n $agent_email = $this->input->post(\"agent_email\",true);\n if(!empty($agent_email)){\n send_mail($agent_email, $from_name, \"New Booking Confirmation- Ref: \".$subject, $body_content, $from_email); //send to agent\n } \n // ====== Send email notification =========\n sf('success_message','Booking has been confirmed successfully');\n redirect('admin/tour-booking/'.$booking_id);\n }\n else{\n redirect('admin/tour-booking/'.$booking_id);\n }\n }\n else if($action == 'cancel'){\n $response = $this->admin_model->update_booking_status($booking_id,'cancelled');\n sf('success_message','Booking has been cancelled successfully');\n redirect('admin/tour-booking/'.$booking_id);\n }\n }", "function register(){\n\n $cust=new Customer();\n \n //get each field from form\n $first_name=$_POST['first_name'];\n $last_name=$_POST['last_name'];\n $vehicle_number=$_POST['vehicle_number'];\n $address=$_POST['address'];\n $e_mail=$_POST['email'];\n $password=$_POST['password'];\n $mobile_tel_no=$_POST['mobile_tel_no'];\n $home_tel_no=$_POST['home_tel_no'];\n\n //hash the password\n //$hashed=md5($password);\n $hashed = sha1($password);\n\n //$hashed = password_hash($password,PASSWORD_BCRYPT);\n $vehicle_type=Vehicle_regex::validate($vehicle_number);\n //insert data\n $result=$cust->insert_record($first_name,$last_name,$vehicle_number,$address,$hashed,$e_mail,$mobile_tel_no,$home_tel_no,$vehicle_type);\n echo(\"resultstart\");\n echo($result);\n echo(\"resultend\");\n //ON SUCCESS, send an email to customer address\n $mail=new Mailer();\n\n $subject=\"Welcome to Cleancar Reservation System!\";\n $body=\"<strong>Dear Mr./Mrs. $last_name,</strong></br>Thank you for\n registering with Cleancar reservation System.\";\n\n //call function in class\n $mail->mailto($subject,$e_mail,$body);\n }", "public static function sendEmail($user,$RDV) : bool {\n\n $user = parent::findBy($user->getEmail(), 'email');\n\n $to = $user->getEmail();\n $from = \"<[email protected]>\";\n $subject = 'CHUO NEWSLETTER : Reclamation';\n $message = '\n <html>\n <head>\n <style>\n .banner-color {\n background-color: #eb681f;\n }\n .title-color {\n color: #0066cc;\n }\n .button-color {\n background-color: #0066cc;\n }\n @media screen and (min-width: 500px) {\n .banner-color {\n background-color: #0066cc;\n }\n .title-color {\n color: #eb681f;\n }\n .button-color {\n background-color: #eb681f;\n }\n }\n </style>\n </head>\n <body>\n <div style=\"background-color:#ececec;padding:0;margin:0 auto;font-weight:200;width:100%!important\">\n <table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"table-layout:fixed;font-weight:200;font-family:Helvetica,Arial,sans-serif\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"center\">\n <center style=\"width:100%\">\n <table bgcolor=\"#FFFFFF\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin:0 auto;max-width:512px;font-weight:200;width:inherit;font-family:Helvetica,Arial,sans-serif\" width=\"512\">\n <tbody>\n <tr>\n <td bgcolor=\"#F3F3F3\" width=\"100%\" style=\"background-color:#f3f3f3;padding:12px;border-bottom:1px solid #ececec\">\n <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-weight:200;width:100%!important;font-family:Helvetica,Arial,sans-serif;min-width:100%!important\" width=\"100%\">\n <tbody>\n <tr>\n <td valign=\"middle\" width=\"50%\" align=\"right\" style=\"padding:0 0 0 10px\"><span style=\"margin:0;color:#4c4c4c;white-space:normal;display:inline-block;text-decoration:none;font-size:12px;line-height:20px\">'.date(\"Y-m-d\").'</span></td>\n <td width=\"1\">&nbsp;</td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n <tr>\n <td align=\"left\">\n <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-weight:200;font-family:Helvetica,Arial,sans-serif\" width=\"100%\">\n <tbody>\n <tr>\n <td width=\"100%\">\n <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-weight:200;font-family:Helvetica,Arial,sans-serif\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"center\" bgcolor=\"#8BC34A\" style=\"padding:20px 48px;color:#ffffff\" class=\"banner-color\">\n <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-weight:200;font-family:Helvetica,Arial,sans-serif\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"center\" width=\"100%\">\n <img src=\"../img/logo-accueil.png\" alt=\"Centre Hospitalier Universitaire Mohammed VI OUJDA\">\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n <tr>\n <td align=\"center\" style=\"padding:20px 0 10px 0\">\n <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-weight:200;font-family:Helvetica,Arial,sans-serif\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"center\" width=\"100%\" style=\"padding: 0 15px;text-align: justify;color: rgb(76, 76, 76);font-size: 12px;line-height: 18px;\">\n <h3 style=\"font-weight: 600; padding: 0px; margin: 0px; font-size: 16px; line-height: 24px; text-align: center;\" class=\"title-color\">Bonjour '.$user->getNom().',</h3>\n <p style=\"margin: 20px 0 30px 0;font-size: 15px;text-align: center;\">L\\'Etat du votre Rendez-vous que vous avez reservé pour '.$RDV->getDateRdv().' a été changer!</p>\n <div style=\"font-weight: 200; text-align: center; margin: 25px;\"><a style=\"padding:0.6em 1em;border-radius:600px;color:#ffffff;font-size:14px;text-decoration:none;font-weight:bold\" class=\"button-color\">Consulter votre compte pour plus de détails</a></div>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n <tr>\n </tr>\n <tr>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n <tr>\n <td align=\"left\">\n <table bgcolor=\"#FFFFFF\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"padding:0 24px;color:#999999;font-weight:200;font-family:Helvetica,Arial,sans-serif\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"center\" width=\"100%\">\n <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-weight:200;font-family:Helvetica,Arial,sans-serif\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"center\" valign=\"middle\" width=\"100%\" style=\"border-top:1px solid #d9d9d9;padding:12px 0px 20px 0px;text-align:center;color:#4c4c4c;font-weight:200;font-size:12px;line-height:18px\">Regards,\n <br><b>The CHUO Team</b>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n <tr>\n <td align=\"center\" width=\"100%\">\n <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"font-weight:200;font-family:Helvetica,Arial,sans-serif\" width=\"100%\">\n <tbody>\n <tr>\n <td align=\"center\" style=\"padding:0 0 8px 0\" width=\"100%\"></td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </center>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </body>\n </html>';\n\n //from w3schools\n $headers = 'From: ' . $from . \"\\r\\n\".\n \"MIME-Version: 1.0\" . \"\\r\\n\" .\n \"Content-type: text/html; charset=UTF-8\" . \"\\r\\n\";\n\n if(mail($to, $subject, $message, $headers))\n //Email Sended\n return true;\n else\n return false;\n\n }", "public function send_registration_feedback()\n {\n // Get parameters.\n $admin_account = $this->GABIA_SMS_API->getAdminAccount();\n\n // From contact form.\n $email = $_POST['email'];\n $tel = $_POST['tel'];\n $course_title = $_POST['course_title'];\n $name = $_POST['name'];\n $amount = $_POST['amount'];\n\n wp_mail($email, '[어벤져스쿨] 성공적으로 강연 등록이 완료되었습니다.',\n '강의 제목: ' . $course_title . \"\\n\" .\n '수강자 이름: ' . $name . \"\\n\" .\n '결제 금액: ' . $amount . \"\\n\" .\n $admin_account . \"\\n\" .\n '입급 전 정원 초과시 자동 취소되오니 빠른 결제 부탁드립니다.' . \"\\n\" .\n '- 어벤져스쿨.');\n $message = '<' . $course_title . '> 강연 등록이 완료되었습니다. 입급 전 정원 초과시 자동 취소되오니 빠른 결제 부탁드립니다. - 어벤져스쿨';\n $this->sendSms($tel, $message, '무통장입금');\n }", "function wpsp_email_notify( $inquiry_info, $is_operator = false, $is_tour_design = flase ) {\n\t\n\tif ( $is_operator ) {\n\t\t$subject = ( $is_tour_design ) ? esc_html__( 'Tour design:', 'discovertravel' ) . ' ' . $inquiry_info['fullname'] : esc_html__( 'Tour inquiry:', 'discovertravel' ) . ' ' . $inquiry_info['firstname'] . ' ' . $inquiry_info['lastname'];\n\t} else {\n\t\t$subject = get_bloginfo('name') . ' ' . esc_html__( 'Notification', 'discovertravel' );\n\t}\n\t\n\t$guest_email = strip_tags( $inquiry_info['email'] );\n\t$operator_email = ot_get_option('operator-email');\n\t$noreply_email = ot_get_option('noreply-email');\n\t$emailTo = ( $is_operator ) ? $operator_email : $guest_email;\n\t\n\tif ( $is_operator ) {\n\t\t$headers = \"From: \" . $guest_email . \"\\r\\n\";\n\t\t$headers .= \"Reply-To: \" . $guest_email . \"\\r\\n\";\n\t} else {\n\t\t$headers = \"From: \" . $noreply_email . \"\\r\\n\";\n\t}\n\t$headers .= \"MIME-Version: 1.0\\r\\n\";\n\t$headers .= \"Content-Type: text/html; charset=ISO-8859-1\\r\\n\";\n\n\tif ( $is_tour_design ) {\n\t\t$custom_destination = '';\n\t\tforeach ( $inquiry_info['destinations'] as $destination ) :\n\t\t\t$custom_destination .=\t$destination . ', ';\n\t\tendforeach;\n\n\t\t$custom_style = '';\n\t\tforeach ( $inquiry_info['tourstyles'] as $style ) :\n\t\t\t$custom_style .=\t$style . ', ';\n\t\tendforeach;\n\t}\n\t\n\t$body = '<html><body style=\"background-color:#4caf50; padding-bottom:30px;\">';\n\t\n\t$body .= '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#333333\"><tbody>';\n \t$body .= '<tr>';\n $body .= '<td align=\"center\" valign=\"top\">';\n \n $body .= '<table width=\"640\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\"><tbody>';\n $body .= '<tr>';\n $body .= '<td width=\"170\" valign=\"middle\" style=\"padding-bottom:10px; padding-top:10px;\">';\n $body .= '<img src=\"'. ot_get_option('custom-logo') . '\">';\n $body .= '</td>';\n $body .= '<td width=\"470\" valign=\"middle\" style=\"padding-bottom:10px; padding-top:10px; text-align:right;\">';\n $body .= '<font style=\"font-size:18px;line-height:18px\" face=\"Arial, sans-serif\" color=\"#ffffff\">' . esc_html__( 'Hotline Support: ', 'discovertravel' ) . '<font color=\"#ffffff\" style=\"text-decoration:none;color:#ffffff\">' . ot_get_option('operator-hotline') . '</font></font>';\n $body .= '<br><font style=\"font-size:14px;line-height:14px\" face=\"Arial, sans-serif\" color=\"#cccccc\"><a href=\"mailto:' . ot_get_option('operator-email') . '\" style=\"text-decoration:none\"><font color=\"#cccccc\">' . ot_get_option('operator-email') . '</font></a></font>';\n $body .= '</td>';\n $body .= '</tr>';\n $body .= '</tbody></table>';\n \n $body .= '</td>';\n $body .= '</tr>';\n $body .= '</tbody></table>';\n\n\t$body .= '<div style=\"max-width:640px; margin: 30px auto 20px; background-color:#fff; padding:30px;\">';\n\t$body .= '<table cellpadding=\"5\" width=\"100%\"><tbody>';\n\t$body .= '<tr>';\n\t$body .= '<td colspan=\"2\">';\n\tif ( $is_operator ) {\n\t\t$body .= '<p>' . esc_html__( 'Dear Operators', 'discovertravel' ) . ',</p>';\n\t\tif ( $is_tour_design ) {\n\t\t\t$body .= '<p>' . esc_html__( 'Please review the tour customized from ', 'discovertravel' ) . ' <strong>' . $inquiry_info['fullname'] . esc_html__( ' listed bellow', 'discovertravel' ) . '</p>';\t\n\t\t} else {\n\t\t\t$body .= '<p>' . esc_html__( 'Please review tour inquiry from ', 'discovertravel' ) . ' <strong>' . $inquiry_info['title'] . ' ' . $inquiry_info['firstname'] . '</strong>' . esc_html__( ' listed bellow', 'discovertravel' ) . '</p>';\t\n\t\t}\n\t\t\t\n\t} else {\n\t\tif ( $is_tour_design ) {\n\t\t\t$body .= '<p>' . esc_html__( 'Dear', 'discovertravel' ) . ' ' . $inquiry_info['fullname'] . ',</p>';\n\t\t} else {\n\t\t\t$body .= '<p>' . esc_html__( 'Dear', 'discovertravel' ) . ' ' . $inquiry_info['title'] . ' ' . $inquiry_info['firstname'] . ',</p>';\t\n\t\t}\n\t\t$body .= '<p>' . esc_html__( 'Thank you very much for your kind interest in booking Tours in Cambodia with', 'discovertravel' ) . ' ' . get_bloginfo('name') . '. ' . esc_html__( 'One of our travel consultants will proceed your request and get back to you with BEST OFFERS quickly.', 'discovertravel' ) . '</p>';\n\t\t$body .= '<p>' . esc_html__( 'Please kindly check all the information of your inquiry again as below:', 'discovertravel' ) . '</p>';\n\t}\n\t$body .= '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td colspan=\"2\"><div style=\"border-bottom:1px solid #ccc; padding-bottom:5px;\"><strong>' . ( $is_tour_design ) ? esc_html__( 'Tour design summary:', 'discovertravel' ) : esc_html__( 'Tour inquiry summary:', 'discovertravel' ) . '</strong></div></td>';\n\t$body .= '</tr>';\n\tif ( !$is_tour_design ) {\n\t\t$body .= '<tr>';\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Tour name: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . $inquiry_info['tourname'] . ' ' . $inquiry_info['tourday'] . ' ' . esc_html__( 'Days', 'discovertravel' ) . '/' . ($inquiry_info['tourday'] - 1) . ' ' . esc_html__( 'Nights', 'discovertravel' ) . '</td>';\n\t\t$body .= '</tr>';\n\t} else {\n\t\t$body .= '<tr>';\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Destinations: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . $custom_destination . '' . $inquiry_info['otherdestination'] . '</td>';\n\t\t$body .= '</tr>';\n\t\t$body .= '<tr>';\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Tour styles: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . $custom_style . '</td>';\n\t\t$body .= '</tr>';\n\t}\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Will travel as: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\" style=\"text-transform: capitalize;\">' . $inquiry_info['tourtype'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Total guests: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">';\n\tif ( $inquiry_info['tourtype'] == 'solo' ) {\n\t\t$body .= esc_html__( 'Adults:', 'discovertravel' ) . ' 1';\n\t}\n\tif ( $inquiry_info['tourtype'] == 'couple' ) {\n\t\t$body .= esc_html__( 'Adults:', 'discovertravel' ) . ' 2';\n\t}\n\tif ( $inquiry_info['tourtype'] == 'family' || $inquiry_info['tourtype'] == 'group' ) {\n\t\t$body .= esc_html__( 'Adults:', 'discovertravel' ) . ' ' . $inquiry_info['adult'] . ', ';\n\t\t$body .= esc_html__( 'Children:', 'discovertravel' ) . ' ' . $inquiry_info['children'] . ', '; \n\t\t$body .= esc_html__( 'Babies:', 'discovertravel' ) . ' ' . $inquiry_info['kids'];\n\t} // end tour type as family or group\n\t$body .= '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Hotel class: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['tourclass'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\tif ( $inquiry_info['flexibledate'] ) {\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Flexible date: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . $inquiry_info['manualdate'] . '</td>';\n\t} else {\n\t\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Arrive date: ', 'discovertravel' ) . '</strong></td>';\n\t\t$body .= '<td width=\"70%\">' . date(\"d F Y\", strtotime( $inquiry_info['departuredate'] )) . '</td>';\n\t}// end flexible date is checked\n\t$body .= '</tr>';\n\tif ( !empty( $inquiry_info['otherrequest'] ) ) {\n\t$body .= '<tr>';\n\t$body .= '<td valign=\"top\" style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Special requests: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['otherrequest'] . '</td>';\n\t$body .= '</tr>';\n\t} // end other request\n\t$body .= '<tr>';\n\t$body .= '<td colspan=\"2\"><div style=\"padding-top: 10px; border-bottom:1px solid #ccc; padding-bottom:5px;\"><strong>' . esc_html__( 'Contact info:', 'discovertravel' ) . '</strong></div></td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Full Name: ', 'discovertravel' ) . '</strong></td>';\n\tif ( $is_tour_design ) {\n\t\t$body .= '<td width=\"70%\"><strong>' . $inquiry_info['fullname'] . '</strong></td>';\n\t} else {\n\t\t$body .= '<td width=\"70%\"><strong>' . $inquiry_info['title'] . ' ' . $inquiry_info['firstname'] . ' ' . $inquiry_info['lastname'] . '</strong></td>';\n\t}\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Email: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['email'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Phone: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['phone'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '<tr>';\n\t$body .= '<td style=\"padding-left:30px;width:30%;color:#666666;\"><strong>' . esc_html__( 'Nationality: ', 'discovertravel' ) . '</strong></td>';\n\t$body .= '<td width=\"70%\">' . $inquiry_info['country'] . '</td>';\n\t$body .= '</tr>';\n\t$body .= '</tbody></table>';\n\n\tif ( !$is_operator )\n\t\t$body .= '<br><p><strong>' . esc_html__( 'Tips: ', 'discovertravel' ) . '</strong>' . esc_html__( 'If you submit incorrect information, please contact our travel consultants to change your information by ', 'discovertravel' ) . '<a href=\"mailto:' . ot_get_option('operator-email') . '\">' . ot_get_option('operator-email') . '</a></p>';\n\t\n\t$body .= '<p style=\"padding-top: 10px;\">' . esc_html__( 'Thanks & Best regards,', 'discovertravel') . '</p>';\t\n\n\tif ( !$is_operator ) {\n\t\t$body .= '<p style=\"border-top:1px solid #ccc; padding-top:30px; font-size:12px; color:#666666;\"><strong style=\"font-size:13px; color:#4caf50;\">' . get_bloginfo('name') . '</strong>';\n\t\t$body .= '<br>' . ot_get_option('operator-address');\n\t\t$body .= '<br><strong>' . esc_html__( 'T. ', 'discovertravel' ) . '</strong>' . ot_get_option('operator-phone');\n\t\t$body .= '<br><strong>' . esc_html__( 'E. ', 'discovertravel' ) . '</strong><a href=\"mailto:' . ot_get_option('operator-email') . '\">' . ot_get_option('operator-email') . '</a>';\n\t\t$body .= '<br><strong>' . esc_html__( 'F. ', 'discovertravel' ) . '</strong>' . ot_get_option('operator-fax');\n\t\t$body .= '<br><strong>' . esc_html__( 'W: ', 'discovertravel' ) . '</strong>' . get_bloginfo('wpurl', 'display') . '</p>';\n\t}\n\t$body .= '</div>'; //wrapper\n\t$body .= '</body></html>';\n\t\n\tif ( mail( $emailTo, $subject, $body, $headers ) ){\n\t\tif ( !$is_operator ) {\n\t\t\t$out = '<h3>' . esc_html__( 'Thank you for sending us your inquiry!', 'discovertravel' ) . '</h3>';\n\t\t\t$out .= '<p>' . esc_html__( 'We will contact you within 01 working day. If you have any questions, please kindly contact us at: ', 'discovertravel' );\n\t\t\t$out .= '<br>Email: <a href=\"mailto:' . $operator_email . '\">' . $operator_email . '</a>';\n\t\t\t$out .= '<br><span class=\"hotline\">Hotline: ' . ot_get_option('operator-hotline') . '</span></p>';\n\t\t\t$out .= '<p class=\"note\">Note: To ensure that you can receive a reply from us, Please kindly add the \"' . str_replace( 'http://', '', get_home_url() ) . '\" domain to your e-mail \"safe list\".<br>If you do not receive a response in your \"inbox\" within 12 hours, check your \"bulk mail\" or \"junk mail\" folders.</p>';\n\t\t\techo $out;\n\t\t}\n\t} else {\n\t\tif ( !$is_operator )\n\t\t\techo '<h5>' . esc_html__( 'Sorry, your inquiry cannot be send right now.', 'discovertravel' ) . '</h5><p>' . error_message . '</p>';\n\t}\n}", "function schedulesms() {\n \t\t\n \t\tConfigure::write('debug', 0);\n \t\t\n \t\t$this->send(true, $_REQUEST['message'], $_REQUEST['mobile'], $_REQUEST['skey'], $_REQUEST['senderid'], \n \t\t\t\t\t\t\t$_REQUEST['group'], $_REQUEST['tag'], $_REQUEST['date'], $_REQUEST['response']);\n \t\t\n \t}", "protected function sendMail()\n {\n $user = User::find()\n ->where(['id' => $this->user->id])\n ->one();\n\n $notificationManager = new MailService($user);\n $notificationManager->register();\n }", "function sendEmails() {\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\n\t\t$emailUser = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailUser = str_replace(\"<br />\", \"\\n\", $emailUser);\n\t\t$emailAdmin = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailAdminBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailAdmin = str_replace(\"<br />\", \"\\n\", $emailAdmin);\n\t\t$emailFrom = $this->data['tx_gokontakt_emailFrom'];\n\t\t$emailFromName = $this->data['tx_gokontakt_emailFromName'];\n\t\t$emailToAdmin = $this->data['tx_gokontakt_emailToAdmin'];\n\n\t\t$this->sendEmail($this->pi_getLL('subject_email_user'), $emailUser, '', $emailFrom, $emailFromName, $this->piVars['email']);\n\t\t$this->sendEmail($this->pi_getLL('subject_email_admin'), $emailAdmin, '', $emailFrom, $emailFromName, $emailToAdmin);\n\t}", "public function send_email() {\n $response = array('sucess' => 'fail');\n $user_id = Session::get('user.id');\n $email = Session::get('user.email');\n $token = User::createAccountToken();\n\n User::where('id',$user_id)->update(array('account_token' => $token));\n\n $data = $this->getSendMailInfo();\n $data['token'] = $token;\n\n if(Request::ajax()) {\n $status = Mail::send('emails.register', $data, function($message) use($email) {\n $message->to($email, 'Thành viên mới')->subject('Đăng ký Store thành công');\n });\n $response = array('sucess' => $status);\n }\n\n return Response::json( $response );\n\n }", "public function sendOfferMail($variables)\r\n {\r\n\r\n $shopContext = Shopware()->Container()->get('shopware_storefront.context_service')->getShopContext();\r\n\r\n $context = array(\r\n 'sOrderDetails' => $variables[\"sOrderDetails\"],\r\n\r\n 'billingaddress' => $variables[\"billingaddress\"],\r\n 'shippingaddress' => $variables[\"shippingaddress\"],\r\n 'additional' => $variables[\"additional\"],\r\n\r\n 'sTaxRates' => $variables[\"sTaxRates\"],\r\n 'sShippingCosts' => $variables[\"sShippingCosts\"],\r\n 'sAmount' => $variables[\"sAmount\"],\r\n 'sAmountNet' => $variables[\"sAmountNet\"],\r\n\r\n 'sOrderNumber' => $variables[\"ordernumber\"],\r\n 'sOrderDay' => $variables[\"sOrderDay\"],\r\n 'sOrderTime' => $variables[\"sOrderTime\"],\r\n 'sComment' => $variables[\"customerComment\"],\r\n\r\n 'attributes' => $variables[\"attributes\"],\r\n 'sCurrency' => $this->admin->sSYSTEM->sCurrency[\"currency\"],\r\n\r\n 'sLanguage' => $shopContext->getShop()->getId(),\r\n\r\n 'sSubShop' => $shopContext->getShop()->getId(),\r\n\r\n 'sEsd' => $variables[\"sEsd\"],\r\n 'sNet' => $this->admin->sNet\r\n );\r\n\r\n // Support for individual payment means with custom-tables\r\n if ($variables[\"additional\"][\"payment\"][\"table\"]) {\r\n $paymentTable = $this->db->fetchRow(\"\r\n SELECT * FROM {$variables[\"additional\"][\"payment\"][\"table\"]}\r\n WHERE userID=?\",\r\n array($variables[\"additional\"][\"user\"][\"id\"])\r\n );\r\n $context[\"sPaymentTable\"] = $paymentTable ? : array();\r\n } else {\r\n $context[\"sPaymentTable\"] = array();\r\n }\r\n\r\n if ($variables[\"sDispatch\"]) {\r\n $context['sDispatch'] = $variables[\"sDispatch\"];\r\n }\r\n\r\n $mail = null;\r\n\r\n if (!($mail instanceof \\Zend_Mail)) {\r\n $mail = Shopware()->TemplateMail()->createMail('sOfferMail', $context);\r\n }\r\n\r\n $mail->addTo($mail->getFrom());\r\n if (!($mail instanceof \\Zend_Mail)) {\r\n return;\r\n }\r\n $mail->send();\r\n\r\n }", "function sendReminders($appointmentList)\n\t{\t\t\n\t\t// get appointment details and email address\n\t\tJLoader::register('SalonBookModelAppointments', JPATH_COMPONENT_SITE.DS.'models'.DS.'appointments.php');\n\t\t$appointmentModel = new SalonBookModelAppointments();\n\t\t\n\t\tforeach ($appointmentList as $appointment)\n\t\t{\n\t\t\t$mailingInfo = $appointmentModel->detailsForMail($appointment['id']);\n\t\t\n\t\t\t// clear any old recipients\n\t\t\t$this->email = NULL;\n\t\t\t\n\t\t\t$this->setSuccessMessage($mailingInfo);\n\t\t\n\t\t\t// $this->mailer->addBCC(\"[email protected]\");\n\t\t\t\n\t\t\t$this->sendMail();\n\t\t}\n\t}", "function resend_invoice($details) {\n\t\t\t\t$name = $details[0]->ai_first_name . \" \" . $details[0]->ai_last_name;\n\t\t\t\t$invoiceid = $details[0]->booking_id;\n\t\t\t\t$refno = $details[0]->booking_ref_no;\n\t\t\t\t$sendto = $details[0]->accounts_email;\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= \"Dear \" . $name . \",<br>\";\n\t\t\t\t$message .= \"You may review your invoice by visiting at: <a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$message .= $this->mailFooter;\n\n\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Invoice');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function mobileOriginated($message) {\n\n $username = $this->config['username'];\n $password = $this->config['password'];\n\n // Gatway\n $gatewayID = '115646'; // Gateway ID: https://communicatepro.mgage.com/consoleapp/viewTemplateProgram.jspx?id=115646\n // $gatewayID = '115658'; // Send tests to US based lists\n\n $mobileNumber = $message['mobile'];\n\n // @todo: needs to come from producer, currently hard coded in logic below.\n $countryCode = NULL;\n\n if (isset($message['mGagePathID'])) {\n $optInListID = $message['mGagePathID'];\n }\n if (isset($message['opt_in_keyword'])) {\n $optInKeyword = $message['opt_in_keyword'];\n }\n\n // https://en.wikipedia.org/wiki/Telephone_numbers_in_Brazil\n if ($message['user_country'] == 'BR') {\n $countryCode = '55';\n $optInListID = '38383';\n $optInKeyword = 'BZCGG';\n }\n // https://en.wikipedia.org/wiki/Telephone_numbers_in_Mexico\n elseif ($message['user_country'] == 'MX') {\n $countryCode = '52';\n $optInListID = '86865';\n $optInKeyword = 'MXCGG';\n }\n\n if (substr($mobileNumber, 0, 2) != $countryCode) {\n $mobileNumber = $countryCode . $mobileNumber;\n }\n\n // Add user to list\n // Consider also using /saveProperties endpoint.\n if (isset($countryCode)) {\n\n $moURL = self::BASE_URL . 'externalMO';\n $contentType = NULL;\n $postContent = [\n 'campid' => $gatewayID,\n 'destination' => $optInListID,\n 'originator' => $mobileNumber,\n 'message' => $optInKeyword,\n ];\n\n $results = $this->makeWebRequest($username, $password, $moURL, $contentType, $postContent);\n\n /**\n * On success, the system will return a 200 header, and the word \"SUCCESS\".\n * On failure, the system will return a 500 header, and an English language error message\n * telling you what you've done wrong.\n */\n if (isset($results[1]) && $results[1] != 200) {\n throw new Exception('Call to mobileOriginated returned error response: ' . $results[0] . ': ' . $results[1]);\n }\n elseif ($results == 0) {\n throw new Exception('Hmmm: No results returned from mGage mobileOriginated submission.');\n }\n\n }\n else {\n echo '- mobileOriginated: Unsupported country code: ' . $message['user_country'], PHP_EOL;\n $this->messageBroker->sendAck($message['payload']);\n $results = FALSE;\n }\n\n return $results;\n }", "public function acceptPendingRequest($id,$payment_id) {\n $reservations = Reservation::find($id);\n $reservations->status = \"Accepted\";\n $reservations->save();\n\n $customer_token = CustomersToken::where(['customer_id' => $reservations->customer_id])->first();\n\n if(!empty($customer_token)) {\n $pm = new PushMessage();\n $fcm = new FirebaseMessage();\n\n $pm->setTitle(\"Your reservation has been accepted!\");\n $pm->setMessage(\"Reservation schedule : Date:\".$reservations->reservation_date.\", Time: \".$reservations->reservation_time.\" \");\n $pm->setId($reservations->id);\n $pm->setImage(\"\");\n $pm->setIntent(\"Reservation\");\n\n $jsonMessage = $pm->getPushMessage();\n $response = $fcm->send($customer_token->token_id,$jsonMessage);\n\n }\n // Payment::find($id)->delete();\n $notification = new NotificationCustomer;\n $notification->customer_id = $reservations->customer_id;\n $notification->notificationable_id = $id;\n $notification->notificationable_type = \"App\\Reservation\";\n $notification->save();\n\n Payment::where('id',$payment_id)->update(['is_valid'=>'Valid']);\n\n return redirect('/admin/range-rental/pending/list')->with('flash_message_success','Reservation successfully updated!');\n\n }", "public function executeCreateCustomSms()\n {\n $notification = new Lib\\Entities\\Notification();\n $notification\n ->setType( Lib\\Entities\\Notification::TYPE_APPOINTMENT_START_TIME )\n ->setToCustomer( 1 )\n ->setToStaff( 1 )\n ->setSettings( json_encode( Lib\\DataHolders\\Notification\\Settings::getDefault() ) )\n ->setGateway( 'sms' )\n ->save();\n\n $notification = $notification->getFields();\n $id = $notification['id'];\n\n $form = new \\Bookly\\Backend\\Modules\\Notifications\\Forms\\Notifications( 'sms' );\n $statuses = Lib\\Entities\\CustomerAppointment::getStatuses();\n\n $html = $this->render( '_custom_notification', compact( 'form', 'notification', 'statuses' ), false );\n wp_send_json_success( compact( 'html', 'id' ) );\n }", "function process_message($sender,$message){\n $date_time = date(\"Y/m/d H:i:s\"); \n\n //insert details to message into recsms table\n $query = \"INSERT INTO recsms (date_time,msg,sender_num) VALUES ('$date_time','$message','$sender') \";\n $result_set= mysqli_query($connection,$query);\n if($result_set) {\n \n //echo \"Record has been saved successfully!\";\n \n } \n else {\n // echo \"Record Entry Failed !\";\n }\n\n //getting the id of the entered sms(or last entered row)\n $query= \"SELECT * FROM recsms ORDER BY id DESC LIMIT 1\";\n $result_set= mysqli_query($connection,$query);\n $row=mysqli_fetch_assoc($result_set);\n $rec_id=$row[\"id\"]; //this is the same id for corresponding send message allowing user to crosscheck based on id\n\n //function to seperate based on vendors and output the extracted parts accordingly\n function ext_sms($rec_sms) {\n\n $array=explode(\" \",$rec_sms); \n if($array[0]==\"+\") \n {\n require('functions/fget_huawei.php'); \n return ext_huawei($rec_sms);\n }\n\n else {\n require('functions/fget_ZTE.php');\n return ext_ZTE($rec_sms);\n }\n \n }\n \n $array= ext_sms($message);\n\n //entering region code,alarm name and date-time from received sms into variables\n $region_code=$array['region_code'];\n $alarm=$array['alarm_name'];\n $date_time=$array['date_time'];\n\n //checking weather filtering is enabled for the particular alarm\n $query=\"SELECT* FROM filtersms WHERE alarm_name='$alarm' LIMIT 1\";\n $result_set= mysqli_query($connection,$query);\n\n if (isset($result_set)) { //isset in case alarm name becomes unavailable\n $row = mysqli_fetch_assoc($result_set);\n $filter_alarm = $row['filter_op']; \n \n //code to store sending sms to a single string variable\n $send_message=\"Region : \".$region.\" ; \".\"Alarm : \".$alarm.\" ; \".\"Occurrence : \".$date_time;\n\n if ($filter_alarm == \"1\") { \n\n //taking corresponding region name from regions table\n $query=\"SELECT* FROM regions WHERE region_code='$region_code' LIMIT 1\";\n $result_set= mysqli_query($connection,$query);\n \n if (isset($result_set)) { //isset in case a region_code becomes unavailable\n $row = mysqli_fetch_assoc($result_set);\n $region = $row['region_name'];\n \n //CODE TO SEND SMS\n \n //calling smppclass to send sms\n include ('smppclass.php');\n \n //setting SMPP parameters for sending sms\n $smpphost = \"172.22.88.150\"; //******SPECIFY SMSC IP TO SEND SMS HERE*******\n $smppport = 5020; //******SPECIFY SMSC PORT NUMBER TO SEND SMS HERE*******\n $systemid = \"NOCAlert\"; //******SPECIFY ID TO BIND TRANSMITTER NUMBER HERE*******\n $password = \"noc123\"; //******SPECIFY PASSWORD TO BIND TRANSMITTER NUMBER HERE*******\n $system_type = \"INOC\";\n $from = \"INOC\";\n $smpp = new SMPPClass();\n \n \n $messagefinalstat = \"Ok\";\n $message_sts = \"\";\n \n \n \n //selecting mobile numbers for the respective region\n $query = \" SELECT * FROM regions WHERE region_code = '$region_code'\";\n $result_set= mysqli_query($connection,$query);\n \n $numbersarray = array();\n\n //entering region mobile numbers to an array\n while ($row = mysqli_fetch_assoc($result_set)) {\n \n array_push($numbersarray, $row['mobile_num']);\n \n }\n \n $numberten = \"\";\n for ($ii = 0; $ii < count($numbersarray); $ii++) {\n \n $numbersarray .= $numbersarray[$ii] . \",\";\n }\n\n $numbersarray = rtrim($numbersarray, \",\");\n \n $smpp->SetSender($from);\n $smpp->Start($smpphost, $smppport, $systemid, $password, $system_type);\n $smpp->TestLink();\n \n $smpp->SendMulti($numbersarray, $send_message);\n $smpp->End();\n\n // $msg_status = \"Sent\";\n //Following part addded according to smpp protocol to see success\n \n $message_sts = \"Send Failed\";\n if ($smpp->get_last_message_status() != 0) {\n $message_sts = \"Send Failed\";\n // echo 'Error';\n } else {\n $message_sts = \"Send Success\";\n }\n\n\n } //end isset region_code\n \n } //end if filter alarm\n\n else { $msg_status = \"Not Sent\"; } //not sent when not filtered\n\n //entering data to the sentsms table\n $query= \"INSERT INTO sentsms (id,date_time,region_name,alarm_name,ack) VALUES ($rec_id,'$date_time','$region','$alarm','$msg_status')\";\n $result_set= mysqli_query($connection,$query);\n\n } //end isset alarm_name\n\n }", "public function sendSMSApplicant(Request $request)\n {\n\n $appStage=app_config('AppStage');\n if($appStage=='Demo'){\n return redirect('reports/job-applicants')->with([\n 'message' => language_data('This Option is Disable In Demo Mode'),\n 'message_important'=>true\n ]);\n }\n\n $self='job-applicants';\n if (\\Auth::user()->user_name!=='admin'){\n $get_perm=permission::permitted($self);\n\n if ($get_perm=='access denied'){\n return redirect('permission-error')->with([\n 'message' => language_data('You do not have permission to view this page'),\n 'message_important'=>true\n ]);\n }\n }\n\n $v = \\Validator::make($request->all(), [\n 'phone' => 'required', 'message' => 'required'\n ]);\n\n if ($v->fails()) {\n return redirect('reports/job-applicants')->withErrors($v->errors());\n }\n\n $phone = Input::get('phone');\n $message = Input::get('message');\n $sender_id=app_config('AppName');\n\n $sms_gateway = SMSGateway::where('status', 'Active')->first();\n $gateway_name = $sms_gateway->name;\n\n if ($gateway_name == 'Twilio') {\n $sid = $sms_gateway->user_name;\n $token = $sms_gateway->password;\n\n try {\n\n $client = new Client($sid, $token);\n $response = $client->account->messages->create(\n \"$phone\",\n array(\n 'from' => '+15005550006',\n 'body' => $message\n )\n );\n\n if ($response->sid!='') {\n return redirect('reports/job-applicants')->with([\n 'message' => language_data('SMS sent successfully')\n ]);\n } else {\n return redirect('reports/job-applicants')->with([\n 'message' => language_data('Please check your Twilio Credentials'),\n 'message_important'=>true\n ]);\n }\n } catch (Exception $e) {\n return redirect('reports/job-applicants')->with([\n 'message' => language_data('Please check your Twilio Credentials'),\n 'message_important'=>true\n ]);\n }\n\n\n } elseif ($gateway_name == 'Route SMS') {\n\n $sms_url=$sms_gateway->api_link;\n $user=$sms_gateway->user_name;\n $password=$sms_gateway->password;\n\n $sms_sent_to_user = \"$sms_url\" . \"?type=0\" . \"&username=$user\" . \"&password=$password\" .\"&destination=$phone\" . \"&source=$sender_id\" . \"&message=$message\" . \"&dlr=1\";\n $get_sms_status=file_get_contents($sms_sent_to_user);\n $get_sms_status = str_replace(\"1701\", language_data('Success'), $get_sms_status);\n $get_sms_status = str_replace(\"1709\", language_data('User Validation Failed'), $get_sms_status);\n $get_sms_status = str_replace(\"1025\", language_data('Insufficient Credit'), $get_sms_status);\n $get_sms_status = str_replace(\"1710\", language_data('Internal Error'), $get_sms_status);\n $get_sms_status = str_replace(\"1706\", language_data('Invalid receiver'), $get_sms_status);\n $get_sms_status = str_replace(\"1705\", language_data('Invalid SMS'), $get_sms_status);\n $get_sms_status = str_replace(\"1707\", language_data('Invalid sender'), $get_sms_status);\n $get_sms_status = str_replace(\",\", \" \", $get_sms_status);\n $pos = strpos($get_sms_status, language_data('Success'));\n\n if ($pos === false) {\n return redirect('reports/job-applicants')->with([\n 'message' => language_data('SMS sent successfully')\n ]);\n } else {\n return redirect('reports/job-applicants')->with([\n 'message' => $get_sms_status,\n 'message_important'=>true\n ]);\n }\n\n\n\n } elseif ($gateway_name == 'Bulk SMS') {\n\n $sms_url=$sms_gateway->api_link;\n $user=$sms_gateway->user_name;\n $password=$sms_gateway->password;\n\n\n $url = \"$sms_url\" . \"/eapi/submission/send_sms/2/2.0?username=$user\" . \"&password=$password\" .\"&msisdn=$phone\" .\"&message=\".urlencode($message);\n\n\n $ret = file_get_contents($url);\n\n $send = explode(\"|\",$ret);\n\n if ($send[0]=='0') {\n $get_sms_status= language_data('In progress');\n }elseif($send[0]=='1'){\n $get_sms_status= language_data('Scheduled');\n }elseif($send[0]=='22'){\n $get_sms_status= language_data('Internal Error');\n }elseif($send[0]=='23'){\n $get_sms_status= language_data('Authentication failure');\n }elseif($send[0]=='24'){\n $get_sms_status= language_data('Data validation failed');\n }elseif($send[0]=='25'){\n $get_sms_status= language_data('Insufficient Credit');\n }elseif($send[0]=='26'){\n $get_sms_status= language_data('Upstream credits not available');\n }elseif($send[0]=='27'){\n $get_sms_status= language_data('You have exceeded your daily quota');\n }elseif($send[0]=='28'){\n $get_sms_status= language_data('Upstream quota exceeded');\n }elseif($send[0]=='40'){\n $get_sms_status= language_data('Temporarily unavailable');\n }elseif($send[0]=='201'){\n $get_sms_status= language_data('Maximum batch size exceeded');\n }elseif($send[0]=='200'){\n $get_sms_status= language_data('Success');\n }\n else{\n $get_sms_status= language_data('Failed');\n }\n\n if($get_sms_status=='Success'){\n return redirect('reports/job-applicants')->with([\n 'message' => language_data('SMS sent successfully')\n ]);\n }else{\n return redirect('reports/job-applicants')->with([\n 'message' => $get_sms_status,\n 'message_important'=>true\n ]);\n }\n\n } else {\n return redirect('reports/job-applicants')->with([\n 'message' => language_data('Gateway information not found'),\n 'message_important' => true\n ]);\n }\n\n }", "function sendPracticeReservationEmail($registrant, $slot)\n{\n $name = $_SESSION['ctst_name'];\n $subject = $name . \" practice slot.\";\n $mailContent = $registrant['givenName'] . ' ' . $registrant['familyName'] .\n \" has practice slot(s):\\n\\n\" . $slot . \"\\n\\nat the \" . $name . \".\\n\\n\";\n $mailContent .= automatedMessage($name);\n $headers = \"From: \" . ADMIN_EMAIL . \"\\r\\n\";\n do_email($registrant['email'], $subject, $mailContent, $headers);\n}", "public function scheduleDelivery(Request $request)\n {\n if (!empty($request->input('agent'))) {\n $count = 0;\n foreach ($request->input('agent') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $agents = User::where('isActive', 1)->where(function ($q) {\n $q->where('role', 'EM')->orWhere('role', 'AG');\n })->whereIn('_id', $objectArray)->get();\n } else {\n $agents = '';\n }\n\n if (!empty($request->input('assigned'))) {\n $count = 0;\n foreach ($request->input('assigned') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $assigned_to = User::where('isActive', 1)->where(function ($q) {\n $q->where('role', 'EM')->orWhere('role', 'AG')->orWhere('role', 'CR')->orWhere('role', 'AD')->orWhere('role', 'MS')->orWhere('role', 'CO')->orWhere('role', 'SV');\n })->whereIn('_id', $objectArray)->get();\n } else {\n $assigned_to = '';\n }\n\n if (!empty($request->input('customer'))) {\n $count = 0;\n foreach ($request->input('customer') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $customers = Customer::whereIn('_id', $objectArray)->get();\n $recepients = RecipientDetails::whereIn('_id', $objectArray)->get();\n $customers = $customers->merge($recepients);\n } else {\n $customers = '';\n }\n //\\\t\t$customer_code = [];\n //\t\tforeach ($customers as $customer) {\n //\t\t\t$customer_code[] = $customer->customerCode;\n //\t\t}\n if (!empty($request->input('case_manager'))) {\n $count = 0;\n foreach ($request->input('case_manager') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $case_managers = User::where('isActive', 1)->where(function ($q) {\n $q->where('role', 'EM')->orWhere('role', 'AD')->orWhere('role', 'RP')->orWhere('role', 'AG')->orWhere('role', 'CO')->orWhere('role', 'SV');\n })->whereIn('_id', $objectArray)->get();\n } else {\n $case_managers = '';\n }\n\n if (!empty($request->input('dispatch'))) {\n $count = 0;\n foreach ($request->input('dispatch') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n if (\n session('role') == 'Insurer' || session('role') == 'Employee' || session('role') == 'Agent' || session('role') == 'Coordinator' ||\n session('role') == 'Supervisor' || session('role') == 'Courier' || session('role') == 'Messenger' || session('role') == 'Accountant'\n ) {\n $dispatch_type_check = DispatchTypes::where('type', '!=', 'Direct Collections')->whereIn('_id', $objectArray)->get();\n } else {\n $dispatch_type_check = DispatchTypes::whereIn('_id', $objectArray)->get();\n }\n } else {\n $dispatch_type_check = '';\n }\n if (!empty($request->input('delivery'))) {\n $count = 0;\n foreach ($request->input('delivery') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $delivery_mode_check = DeliveryMode::whereIn('_id', $objectArray)->get();\n } else {\n $delivery_mode_check = '';\n }\n if (!empty($request->input('status'))) {\n $count = 0;\n foreach ($request->input('status') as $cust) {\n $objectArray[$count] = $cust;\n $count++;\n }\n $Allstatus = DispatchStatus::whereIn('status', $objectArray)->groupBy('status')->get();\n } else {\n $Allstatus = '';\n }\n\n $delivery_mode = DeliveryMode::all();\n $dispatch_types = DispatchTypes::all();\n $document_types = DocumentType::all();\n $filter_data = $request->input();\n $current_path = $request->path();\n return view('dispatch.schedule_for_delivery_list')\n ->with(compact(\n 'dispatch_type_check',\n 'assigned_to',\n 'customers',\n 'delivery_mode_check',\n 'agents',\n 'case_managers',\n 'delivery_mode',\n 'dispatch_types',\n 'customer_code',\n 'filter_data',\n 'document_types',\n 'current_path',\n 'Allstatus'\n ));\n }", "function sendNotif(){\n\t\t$sql1 \t\t= \"SELECT EMAIL, MATERIAL, VENDOR FROM VMI_NOTIF\";\n\t\t$dt \t\t= $this->db->query($sql)->result_array();\n\t\t// $dt\t\t\t= $this->db->query($sql1)->row();\t\t\n\t\t// $to \t\t= $result->EMAIL;\n\t\t// $material \t= $result->MATERIAL;\n\t\t// $vendor\t\t= $result->VENDOR;\n\t\tforeach ($dt as $key => $value) {\n\t\t\t$to \t\t= $value['EMAIL'];\n\t\t\t$material \t= $value['MATERIAL'];\n\t\t\t$vendor \t= $value['VENDOR'];\n\t\t\t$from \t \t= \"Tim VMI-Eproc Semen Indonesia\";\n\t\t\t$subject \t= \"Email Notifikasi untuk melakukan Replenishment\";\n\t\t\t// $cc \t \t= \"[email protected]\t\";\n\t\t\t$bcc \t \t= \"[email protected]\";\n\t\t\t$bcc2 \t = \"[email protected]\";\n\t\t\t$bcc3 \t = \"[email protected]\";\n\t\t\t$bcc4 \t = \"[email protected]\";\n\t\t\t$bcc5 \t = \"[email protected]\";\n\t\t\t$message \t= '<html><body><font style = \"font-family:\"Cambria\";size:\"12px\";\">';\n\t\t\t$message \t.= 'Yth. <b>'.$vendor.'</b><br/>';\n\t\t\t$message \t.= 'Mohon melakukan pengecekkan terhadap perubahan nilai prognose pada material '.$material.' : <br/><br/>';\n\t\t\t$message \t.= '<br/>Demikian Email Pemberitahun ini kami sampaikan<br/>';\n\t\t\t$message \t.= 'Terima Kasih<br/><br/>';\n\t\t\t$message \t.= 'NB : Email ini dikirimkan oleh system. Jangan me-reply email ini. Apabila ada pertanyaan silakan menghubungi Seksi Inventory<br/>';\n\t\t\t$message \t.= '</font></body></html>';\n\n\t\t\t$this->load->library('email');\n\t\t\t$this->config->load('email');\n\t\t\t$semenindonesia = $this->config->item('semenindonesia');\n\t\t\t$this->email->initialize($semenindonesia['conf']);\n\t\t\t$this->email->from($from);\n\t\t\t$this->email->to($to);\n\t\t\t// $this->email->cc('[email protected]');\n\t\t\tif(!empty($cc)){\n\t\t\t $this->email->cc($cc);\n\t\t\t}\n\t\t\tif(!empty($bcc)){\n\t\t\t $this->email->bcc($bcc);\n\t\t\t $this->email->bcc($bcc2);\n\t\t\t $this->email->bcc($bcc3);\n\t\t\t $this->email->bcc($bcc4);\n\t\t\t $this->email->bcc($bcc5);\n\t\t\t}\n\n\t\t\tif(!empty($attachment)){\n\t\t\t $this->email->attach($attachment);\n\t\t\t}\n\n\t\t\t$this->email->subject($subject);\n\t\t\t$this->email->message($message);\n\t\t\treturn $this->email->send();\n\t\t}\n\t\t$sql2 \t\t= \"DELETE table VMI_NOTIF\";\n\t\t$result2\t= $this->db->query($sql2)->row();\t\n\t}", "public function store(Request $request)\n {\n $list = Reservation::all();\n \n $this->validate($request,[\n 'petname' => 'required',\n 'petage' => 'required|numeric',\n 'petgender' => 'required',\n 'petbreed' => 'required',\n 'time' => 'required'\n ]);\n $user = (int)Auth::user()->id;\n \n $reserve = Reservation::create([\n 'user_id' => $user,\n 'petname' => $request['petname'],\n 'petage' => $request['petage'],\n 'petgender' => $request['petgender'],\n 'petbreed' => $request['petbreed'],\n 'time' => $request['time'],\n 'date_reserve' => $request['date'],\n 'status_id' => 1,\n 'service' => implode($request['service'],',')\n ]);\n\n/**//* $basic = new Nexmo\\Client\\Credentials\\Basic('9c9350e6', '8Eo5CgibNgBHEs7K');\n $client = new Nexmo\\Client($basic);\n$reserve = $client->message()->send([\n 'to' => '639472195796',\n 'from' => 'Pet Centre Animal Clinic',\n 'text' => 'New Reservation'\n]);*/\n$name = Auth::user()->name;\n Nexmo::message()->send([\n 'to' => '639458204862',\n 'from' => '639472195796',\n 'text' => $name.' add a reservation'\n ]); \n return $reserve;\n\n \n\n\n }", "public function customer_signup($edata) {\n\t\t\t\t$details = email_template_detail(\"customerregister\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"supplierregister\");\n\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= $details[0]->temp_body;\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//sendsms($smsdetails[0]->temp_body, $edata['phone'], \"supplierregister\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($edata['email']);\n\t\t\t\t$this->email->subject($details[0]->temp_subject);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "function daily_update_property_email(){\n\t\t$meta_post = $this->InteractModal->get_update_post_meta();\n\t\tif(!empty($meta_post)){\n\t\t\t$data = array();\n\t\t\tforeach($meta_post as $meta_details){\n\t\t\t\t$user_id = $this->InteractModal->get_post_meta($meta_details['post_id'],'initiator_id');\n\t\t\t\t$data[$user_id][]= $meta_details['meta_key'];\n\t\t\t}\n\t\t}\t\t\n\t\t$get_data=$this->InteractModal->get_today_data();\n\t\t$id=2;\n\t\tif(!empty($get_data)){\n\t\t\t$result = array();\n\t\t\tforeach ($get_data as $element) {\n\t\t\t\t$result[$element['user_id']][]= $element['task_type'];\n\t\t\t}\n\t\t\tif(!empty($data) && (!empty($result))){\n\t\t\t\t$results = array_merge($data,$result);\n\t\t\t}\n\t\t\t$user_id= '';\n\t\t\tif(!empty($results)){\n\t\t\t\tforeach($result as $user_id=>$value):\n\t\t\t\t\t$update_details='';\n\t\t\t\t\t$value = array_unique($value);\n\t\t\t\t\tforeach($value as $values):\t\t\t\t\t\t\n\t\t\t\t\t\t$update_details=$update_details.'Today '.ucwords($values).' Successfully.<br>';\n\t\t\t\t\tendforeach;\n\t\t\t\t\tif(!empty($user_id)){\n\t\t\t\t\t\t$where = array( 'id' =>$user_id);\n\t\t\t\t\t\t$user_data=$this->InteractModal->single_field_value('users',$where);\n\t\t\t\t\t\techo $email= $user_data[0]['user_email'];\n\t\t\t\t\t\techo \"<br>\";\n\t\t\t\t\t\t$company_id = $this->InteractModal->get_user_meta( $user_id, 'company_id');\n\t\t\t\t\t\t///get auto email content data \n\t\t\t\t\t\t$status_template = $this->InteractModal->get_user_meta( $company_id, 'status_template_id_'.$id );\n\t\t\t\t\t\tif(($status_template ==1)){\n\t\t\t\t\t\t\t$subject = $this->InteractModal->get_user_meta( $company_id, 'subject_template_id_'.$id );\n\t\t\t\t\t\t\t$content = $this->InteractModal->get_user_meta( $company_id, 'content_template_id_'.$id );\n\t\t\t\t\t\t\t$user_name = $this->InteractModal->get_user_meta( $user_id, 'concerned_person');\n\t\t\t\t\t\t\t$phone_number = $this->InteractModal->get_user_meta( $user_id, 'phone_number');\n\t\t\t\t\t\t\t$logo_content = '<img src=\"'.base_url().'/assets/img/profiles/logo_(2).png\" height=\"auto\" width=\"100\" alt=\"Logo\">'; \t\t\t\t\t\t\n\t\t\t\t\t\t\t$content=nl2br($content);\n\t\t\t\t\t\t\t$content = str_replace(\"_NAME_\",$user_name,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_PHONE_\",$phone_number,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_EMAIL_\",$email,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_LOGO_\",$logo_content,$content);\n\t\t\t\t\t\t\t$content = str_replace(\"_DATE_\",date('d-F-Y'),$content);\n\t\t\t\t\t\t\t$content = $content.'<br>'.$update_details;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$template_list = $this->InteractModal->get_email_template($id);\n\t\t\t\t\t\t\tforeach( $template_list as $template_lists ):\n\t\t\t\t\t\t\t\t$subject = $template_lists['subject']; \n\t\t\t\t\t\t\t\t$content = $update_details; \n\t\t\t\t\t\t\tendforeach;\t\t\t\t\n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t///get auto email content data \t\t\t\t\n\t\t\t\t\t\t$email_data = array('email' => $email,\n\t\t\t\t\t\t\t'content' => $content,\n\t\t\t\t\t\t\t'subject' => $subject\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$this->send_email($email_data);\n\t\t\t\t\t} \n\t\t\t\tendforeach;\n\t\t\t}\n\t\t}\n\t}", "function mailUser($transcript, $phoneNumber, $CallSid)\n{\n\t $inCallEmployeeId = getOne(\"select user_id from schedule where ph_id = (select ph_id from phone_numbers where phone_number like '%\".trim($phoneNumber).\"') and is_active=1\");\n\t$inCallEmployeeMail = getOne(\"select user_email from users where user_id = '\".$inCallEmployeeId.\"'\");\n\t$voiceURL = getOne(\"select recording_url from incomming_calls where call_sid = '\".$CallSid.\"'\");\n\t\n\t\n\tif(trim($inCallEmployeeMail) != \"\")\n\t{\n\t\t$message = \"\n\t\t\t<h3> New Call for you..!!</h3>\n\t\t\t<br />\n\t\t\tYou have a new message.<br />\n\t\t\tTranscription: \".$transcript.\"<br />\n\t\t\tVoice Url: \".$voiceURL.\"<br /><br />\n\t\t\tLog in to VBX scheduler for more details.<br />\n\t\t\tThanks.\t\t\n\t\t\";\n\t\tmailEmployee($inCallEmployeeMail, $message);\n\t}\n}", "private function _sendNotificationEmail($message, $origMessage = false, $_product = false)\r\n {\r\n /*\r\n\t\tarray(10) {\r\n\t\t [\"message\"] => string(31) \"raspuns test la al doilea mesaj\"\r\n\t\t [\"sender_firstname\"] => string(4) \"Bugs\"\r\n\t\t [\"sender_lastname\"] => string(5) \"Bunny\"\r\n\t\t [\"replay_to\"] => string(28) \"[email protected]\"\r\n\t\t [\"is_first\"] => int(0)\r\n\t\t [\"first_message_id\"] => string(2) \"26\"\r\n\t\t [\"subject\"] => string(55) \"RE: Detalii despre oferta Oferta foto-video BB's Agency\"\r\n\t\t [\"sender_id\"] => string(2) \"93\"\r\n\t\t [\"recever_id\"] => string(2) \"94\"\r\n\t\t [\"message_id\"] => string(2) \"38\"\r\n\t\t} \r\n\t\t\r\n $message = array(9) {\r\n [\"sender_id\"] => string(2) \"94\"\r\n [\"recever_id\"] => string(2) \"93\"\r\n [\"sender_firstname\"] => string(4) \"Nicu\"\r\n [\"sender_lastname\"] => string(5) \"Popan\"\r\n [\"subject\"] => string(51) \"Detalii despre oferta Oferta foto-video BB's Agency\"\r\n [\"message\"] => string(20) \"Prmiul mesaj de test\"\r\n [\"replay_to\"] => string(19) \"[email protected]\"\r\n [\"is_first\"] => int(1)\r\n [\"message_id\"] => string(2) \"15\"\r\n }\r\n */\r\n \r\n $sender = $message->getSenderId() ? Mage::getModel('customer/customer')->load($message->getSenderId()) : false;\r\n $receiver = $message->getReceverId() ? Mage::getModel('customer/customer')->load($message->getReceverId()) : false;\r\n \r\n $senderDetails = array();\r\n $receiverDetails = array();\r\n $emailVariables = array();\r\n \r\n if ($sender) {\r\n if ($sender->getGroupId() == 4) {\r\n // furnizor\r\n $senderDetails['sender_fullname'] = ucwords(strtolower($sender->getData('furnizor_contact_firstname') . ' ' . $sender->getData('furnizor_contact_lastname')));\r\n $senderDetails['sender_email'] = $sender->getData('furnizor_contact_email');\r\n $senderDetails['sender_phone'] = $sender->getData('furnizor_contact_phone') ? $sender->getData('furnizor_contact_phone') : '';\r\n $senderDetails['sender_company'] = $sender->getData('business_descriptions_title');\r\n $subject = 'RE: ' . $message->getSubject(); \r\n } else {\r\n // regular customer => get data from form\r\n $senderDetails['sender_fullname'] = ucwords(strtolower($message->getData('sender_firstname') . ' ' . $message->getData('sender_lastname')));\r\n $senderDetails['sender_email'] = $message->getData('replay_to');\r\n $senderDetails['sender_phone'] = false;\r\n $subject = $message->getSubject(); \r\n }\r\n } else {\r\n // regular customer => get data from form\r\n $senderDetails['sender_fullname'] = ucwords(strtolower($message->getData('sender_firstname') . ' ' . $message->getData('sender_lastname')));\r\n $senderDetails['sender_email'] = $message->getData('replay_to');\r\n $senderDetails['sender_phone'] = false;\r\n $subject = $message->getSubject(); \r\n }\r\n \r\n if ($receiver) {\r\n if ($receiver->getGroupId() == 4) {\r\n // furnizor\r\n $receiverDetails['receiver_fullname'] = ucwords(strtolower($receiver->getData('furnizor_contact_firstname') . ' ' . $receiver->getData('furnizor_contact_lastname')));\r\n $receiverDetails['receiver_email'] = $receiver->getData('furnizor_contact_email');\r\n $receiverDetails['receiver_phone'] = $receiver->getData('furnizor_contact_phone') ? $receiver->getData('furnizor_contact_phone') : false;\r\n \r\n $emailTemplate = Mage::getModel('core/email_template')->loadDefault('provider_notification_email');\r\n $emailSubject = $senderDetails['sender_fullname'] . ' ți-a trimis un mesaje prin nuntainimagini.ro';\r\n } else {\r\n // regular customer\r\n $receiverDetails['receiver_fullname'] = ucwords(strtolower($receiver->getData('firstname') . ' ' . $receiver->getData('lastname')));\r\n $receiverDetails['receiver_email'] = $receiver->getData('email');\r\n $receiverDetails['receiver_phone'] = false;\r\n $emailTemplate = Mage::getModel('core/email_template')->loadDefault('customer_notification_email');\r\n $emailSubject = $senderDetails['sender_fullname'] . ' de la ' . $senderDetails['sender_company'] . ' ți-a trimis un mesaje prin NuntaInImagini.ro';\r\n }\r\n } else {\r\n // unregistered regular customer => get data from orig message\r\n $receiverDetails['receiver_fullname'] = ucwords(strtolower($origMessage->getData('sender_firstname') . ' ' . $origMessage->getData('sender_lastname')));\r\n $receiverDetails['receiver_email'] = $origMessage->getData('replay_to');\r\n $receiverDetails['receiver_phone'] = false;\r\n $emailTemplate = Mage::getModel('core/email_template')->loadDefault('customer_notification_email');\r\n $emailSubject = $senderDetails['sender_fullname'] . ' de la ' . $senderDetails['sender_company'] . ' ți-a trimis un mesaje prin NuntaInImagini.ro';\r\n $emailVariables['phone_entry'] = ' sau la telefon ' . $senderDetails['sender_phone'] . '.';\r\n }\r\n \r\n //Zend_Debug::dump($emailTemplate); die();\r\n \r\n // set email template variables\r\n $emailVariables = array_merge($emailVariables, $senderDetails);\r\n $emailVariables = array_merge($emailVariables, $receiverDetails);\r\n $emailVariables['created_at'] = date('d.m.Y | H:i:s', Mage::getModel('core/date')->timestamp(time()));\r\n $emailVariables['store_url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);\r\n $emailVariables['message'] = $message->getMessage();\r\n \r\n $emailVariables['product'] = '';\r\n \r\n //Zend_Debug::dump($_product->getData()); die();\r\n \r\n if ($_product) {\r\n $productName = $_product->getName();\r\n $productUrl = $_product->getProductUrl();\r\n $productType = $_product->getResource()->getAttribute('ofg_tip_oferta')->getFrontend()->getValue($_product);\r\n $productFinalPrice = Mage::helper('core')->currency($_product->getFinalPrice(), true, false);\r\n $regions = '';\r\n $regionsArr = explode(',', $_product->getOfgZonaPersonalizata());\r\n foreach ($regionsArr as $region) {\r\n $regions .= Mage::getModel('directory/region')->load($region)->getName() .', ';\r\n }\r\n $productAvailability = trim($regions, ', ');\r\n $producctFotografi = $_product->getOfgNrFotografi();\r\n $productCameramani = $_product->getOfgNrCameramani();\r\n $productTransport = $_product->getResource()->getAttribute('ofg_cheltuieli_transport')->getFrontend()->getValue($_product);\r\n $productCazare = $_product->getResource()->getAttribute('ofg_cheltuieli_cazare')->getFrontend()->getValue($_product);\r\n $productTimpAlocat = $_product->getResource()->getAttribute('ofg_disponibilitate')->getFrontend()->getValue($_product);\r\n \r\n $emailVariables['product'] = '<p style=\"font-size:12px; line-height:16px; margin:0 0 16px 0;\">Mesajul a fost trimis de pe pagina <a href=\"' . $productUrl . '\">' . $productName . '</a>. ';\r\n $emailVariables['product'] .= 'Îți transmitem în continuare câteva detalii despre ofertă, așa cum erau la data ' . $emailVariables['created_at'] . ':</p>';\r\n $emailVariables['product'] .= '<ul style=\"font-size:12px; line-height:16px; margin:0 0 16px 0; padding:0;\">';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Tip oferta</strong>: ' . $productType . '</li>';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Preț / Tarif</strong>: ' . $productFinalPrice . '</li>';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Nr. Fotografi</strong>: ' . $producctFotografi . '</li>';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Nr. Cameramani</strong>: ' . $productCameramani . '</li>';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Valabila pentru</strong>: ' . $productAvailability . '</li>';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Cheltuieli transport</strong>: ' . $productTransport . '</li>';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Cheltuieli cazare</strong>: ' . $productCazare . '</li>';\r\n $emailVariables['product'] .= '<li style=\"list-style:none inside; padding:0 0 0 10px;\">&ndash; <strong>Timp alocat evenimentului</strong>: ' . $productTimpAlocat . '</li>';\r\n $emailVariables['product'] .= '</ul>'; \r\n }\r\n\t\t\r\n //load the custom template to the email \r\n $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_custom1/name', Mage::app()->getStore()->getId()));\r\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_custom1/email', Mage::app()->getStore()->getId()));\r\n $emailTemplate->setReplyTo($message->getReplayTo());\r\n $emailTemplate->setTemplateSubject($emailSubject);\r\n\t\t\r\n\t\ttry {\r\n // send email\r\n $emailTemplate->send($receiverDetails['receiver_email'], $receiverDetails['receiver_fullname'], $emailVariables);\r\n return true;\r\n \r\n } catch (Exception $e) {\r\n $errorMessage = $e->getMessage();\r\n //Zend_Debug::dump($errorMessage);\r\n return $errorMessage;\r\n }\r\n \r\n }", "public function invite(){\n $this->validate(request(),[\n 'task_id' => 'required',\n 'user_id'=> 'required'\n ]);\n $task=Task::find(request('task_id'));\n\n $user=User::find(request('user_id'));\n if (\\Gate::denies('taskOwner', $task)) {\n return response()->json(\"Task doesn't Belong To you\");\n }\n \\Mail::to($user)->send(new TaskInvitation($user,$task));\n return response()->json(\"Invitation Mail Sent Successfully\");\n }", "function sendPushNotification($hotel)\n{\n /*here will integrate with the sdk or call api to send broadcast message\n to all users with new hotel data added\n and then call this function after successfully added new hotel*/\n}", "function sendReleasingRequestToEmployer($userData)\n\t\t{\n\t\t\t$datetime = date('Y-m-d h:i:s a');\n\t\t\t//checking for milestone id and workroom id\n\t\t\t$milestone = $this->manageContent->getValue_where('milestone_info', '*', 'milestone_id', $userData['milestone']);\n\t\t\tif(!empty($milestone[0]))\n\t\t\t{\n\t\t\t\t//get workroom details\n\t\t\t\t$workroom = $this->manageContent->getValue_where('workroom_info', '*', 'workroom_id', $milestone[0]['workroom_id']);\n\t\t\t\tif(!empty($workroom[0]) && $workroom[0]['con_user_id'] == $_SESSION['user_id'] && $milestone[0]['funding_status'] == 1)\n\t\t\t\t{\n\t\t\t\t\t//get project details\n\t\t\t\t\t$project_details = $this->manageContent->getValue_where('project_info', '*', 'project_id', $workroom[0]['project_id']);\n\t\t\t\t\t//get sending user details\n\t\t\t\t\t$con_user_details = $this->manageContent->getValue_where('user_info', '*', 'user_id', $_SESSION['user_id']);\n\t\t\t\t\t//creating notification id\n\t\t\t\t\t$noti_id = uniqid('noti');\n\t\t\t\t\t$sending_user = $workroom[0]['emp_user_id'];\n\t\t\t\t\t$page_link = 'escrow.php?wid='.$workroom[0]['workroom_id'];\n\t\t\t\t\t$message = 'Money Release Request of <b>'.$milestone[0]['milestone_name'].'</b> from <b>'.$con_user_details[0]['name'].'</b> for <b>'.$project_details[0]['title'].'</b>';\n\t\t\t\t\t$column_name = array('notification_id','message','date','user_id','project_id','from_user','page_link','view_status');\n\t\t\t\t\t$column_value = array($noti_id,$message,$datetime,$workroom[0]['emp_user_id'],$workroom[0]['project_id'],$_SESSION['user_id'],$page_link,0);\n\t\t\t\t\t$insert = $this->manageContent->insertValue('notification_info', $column_name, $column_value);\n\t\t\t\t\tif($insert != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\techo 'Request Send Successfully';\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\techo 'Request Can Not Be Sent';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t}", "public function frontliner_reminder()\n\t{\n\t\t$this->load->model('General_model');\n\t\t$apikey = $this->input->post('apikey');\n\t\t$ip_add = $_SERVER['REMOTE_ADDR'];\n\t\tif($apikey=='smsatlosbanos'){\n\t \t\t$contact_number = '0'.substr($this->input->post('contact_number'), -10);\n\t \t\t$name = $this->input->post('name');\n\t \t\t$vac_date = $this->input->post('vac_date');\n\t \t\t$vac_site = $this->input->post('vac_site');\n\t \t\t$time_schedule = $this->input->post('time_schedule');\n\t \t\t$dose = $this->input->post('dose');\n\n\t \t\tif($vac_site==1){\n\t \t\t\t$site_text = 'Batong Malake Covered Court';\n\t \t\t}elseif($vac_site==2){\n\t \t\t\t$site_text = 'UPLB Copeland';\n\t \t\t}elseif($vac_site==3){\n\t \t\t\t$site_text = 'LB Evacuation Center';\n\t \t\t}\n\n\t\t\t$message = 'LB RESBAKUNA REMINDER';\n\t\t\t$message .= \"\\n\".$name;\n\t\t\t$message .= \"\\n\".date('F d, Y', strtotime($vac_date)).' At '. $time_schedule;\n\t \t\t$message .= \"\\n\".$site_text;\n\t \t\t$message .= \"\\nA1 required to bring any of the ff as proof:\";\n\t \t\t$message .= \"\\nPRC, COE as medical frontliner, Certificate of Training.\";\n\t \t\t$message .= \"\\n DO NOT REPLY.\";\n\t\t\t$this->send_text($message,$contact_number);\n\t\t}\n\t}" ]
[ "0.6672711", "0.65038604", "0.64791775", "0.64435995", "0.64293474", "0.64056885", "0.63879424", "0.6371168", "0.6277627", "0.62704235", "0.6268141", "0.6265047", "0.62172216", "0.6197046", "0.6143469", "0.6128018", "0.61193085", "0.61054355", "0.6065892", "0.60631716", "0.60497624", "0.60141635", "0.5987603", "0.5980825", "0.59610295", "0.59523517", "0.5949599", "0.59412634", "0.59265596", "0.5911414", "0.59077203", "0.5902308", "0.5889294", "0.5886652", "0.58855414", "0.5882995", "0.58801895", "0.5867644", "0.5854506", "0.58362645", "0.58316785", "0.5829513", "0.58132184", "0.5809074", "0.5807478", "0.5779714", "0.5772024", "0.5769816", "0.5765861", "0.57529294", "0.5751782", "0.5749888", "0.57487863", "0.5746287", "0.57315403", "0.57259136", "0.5714996", "0.5709801", "0.570831", "0.57014084", "0.5693112", "0.5690668", "0.5686427", "0.56843925", "0.5683914", "0.568295", "0.5680375", "0.567816", "0.5669423", "0.5667611", "0.56549937", "0.565227", "0.5643966", "0.5631072", "0.56304276", "0.56202024", "0.5617872", "0.5610299", "0.5602216", "0.5599895", "0.55988586", "0.5597287", "0.5594585", "0.55906576", "0.5590307", "0.55896235", "0.55894244", "0.55862117", "0.5585728", "0.55808586", "0.5579557", "0.55758214", "0.5574754", "0.55741274", "0.5568381", "0.5567473", "0.55536395", "0.5553021", "0.5551108", "0.555077", "0.5547638" ]
0.0
-1
get restaurant id from reservation objec loop all reservation managers for the found restaurant send email to reservation managers
public function sendReservationWasCreatedToReservationManagersByEmail(Reservation $reservation) { // Customer Basic Info $customer = $reservation->user->toArray(); // Loop and send to Reservation Managers foreach ($this->reservation_managers as $manager) { Mail::send( 'emails/cart/admin/pending', [ 'user' => $manager, 'reservation' => $reservation, 'customer' => $customer ], function ($message) use ($manager) { $message->from('[email protected]', trans('HTR Sales!')); $message->to($manager->email, $manager->name)->subject(trans('Reservation is Pending')); } ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirm_reservations($id) {\n global $DB;\n\n $reservation = $DB->get_record('roomscheduler_reservations', array('id' => $id));\n\n $reservations = $DB->get_records('roomscheduler_reservations', array('recurrence_id'=>$reservation->recurrence_id,'location'=>$reservation->location));\n \n foreach($reservations as $res){\n $res->confirm = 1;\n $DB->update_record('roomscheduler_reservations', $res);\n }\n}", "public function reservations()\n {\n return $this->hasMany('App\\Reservation', 'restaurant_id');\n }", "public function getReservationId()\n {\n return $this->reservation_id;\n }", "public function getBillsWithUserReservation () {\n if (strpos(Route::getFacadeRoot()->current()->uri(), 'admin') !== false) {\n $bills = self::select('*')->orderBy('bill_bill_date', 'DESC')->get();\n } else {\n\n $bills = self::where('bill_user_id', '=', Auth::id())->get();\n }\n $bills->each(function ($b) {\n global $subtotals;\n global $totals;\n $r = new Reservation();\n $b->reservation = $r->where('id', '=', $b->reservation_id)\n ->select('id', 'reservation_started_at', 'reservation_ended_at', 'reservation_nights', 'user_id')\n ->with(array(\n 'guests' => function ($q) {\n $q->select('guests.id', 'reservation_id', 'guest_number', 'guest_night', 'guest_ended_at', 'guest_started_at', 'role_id');\n },\n ))\n ->first();\n $b->user = \\User::find($b->reservation->user_id);\n $b->reservation->guests->each(function ($g) use($b) {\n $g->calcGuestSumTotals();\n $s = new DateTime($g->guest_started_at);\n $g->guest_started_at_show = $s->format('d. m Y');\n $e = new DateTime($g->guest_ended_at);\n $g->guest_ended_at_show = $e->format('d. m Y');\n $b->reservation->reservation_sum += $g->guestSum;\n });\n $bds = new \\DateTime($b->bill_bill_date);\n $s = new DateTime($b->reservation->reservation_started_at);\n $b->reservation->reservation_started_at_show = $s->format('d. m Y');\n $e = new DateTime($b->reservation->reservation_ended_at);\n $b->reservation->reservation_ended_at_show = $e->format('d. m Y');\n $b->bill_bill_date_show = $bds->format(trans('formats.short-date-ts'));\n if (isset($b->bill_paid)) {\n $bds = new \\DateTime($b->bill_paid);\n $b->bill_paid_show = $bds->format(trans('formats.short-date-ts'));\n }\n\n if (isset($b->bill_resent_date)) {\n $bds = new \\DateTime($b->bill_resent_date);\n $b->bill_resent_date_show = $bds->format(trans('formats.short-date-ts'));\n }\n\n $ubc = DB::select(DB::raw('select `country_name_' . trans('formats.langjs') . '` from countries where country_code = ' . $b->user->user_country_code));\n $b->user->country = $ubc[0]->{'country_name_' . trans('formats.langjs')};\n $subtotals += (float)$b->bill_sub_total;\n $totals += (float)$b->bill_total;\n $b->subtotals = $subtotals;\n $b->totals = $totals;\n });\n return $bills;\n }", "public function inforeservations($id_reservations){\n $reservation = \\App\\reservation::where('ID_RESERVATION','=',$id_reservations)->get()->first();\n if(!$reservation){return redirect('/');}\n $prestation = \\App\\pristation::where('id_prestation','=',$reservation->id_prestation)->get()->first();\n $coiffeur = \\App\\coiffeur::where('NOM_COIFFEUR','=',$prestation->NOM_COIFFEUR)->get()->first();\n $salon = \\App\\salon::where('NAME_SALON','=',$coiffeur->NAME_SALON)->get()->first();\n \n return view('Inforeservation',compact('prestation','coiffeur','salon','reservation'));\n \n }", "public function getRespondToReservation(Request $request)\n {\n\t\t$user = null;\n\t\tif(Auth::check())\n\t\t{\n\t\t\t$user = Auth::user();\n\t\t\t\n\t\t\tif($this->helpers->isAdmin($user))\n\t\t\t{\n\t\t\t\t$hasPermission = $this->helpers->hasPermission($user->id,['view_users','edit_users']);\n\t\t\t\t#dd($hasPermission);\n\t\t\t\t$req = $request->all();\n\t\t\t\t\n\t\t\t\tif($hasPermission)\n\t\t\t\t{\n\t\t\t\t$validator = Validator::make($req,[\n\t\t 'xf' => 'required|numeric',\n\t\t\t\t\t\t\t'axf' => 'required',\n\t\t\t\t\t\t\t'gxf' => 'required|numeric'\n\t\t ]);\n\t\t\t\t\t\t\n\t\t\t\tif($validator->fails())\n {\n session()->flash(\"validation-status-error\",\"ok\");\n\t\t\t return redirect()->intended('/');\n }\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$dt = [\n\t\t\t 'id' => $req['xf'],\n\t\t\t 'apartment_id' => $req['axf'],\n\t\t\t 'user_id' => $req['gxf']\n\t\t\t ];\n\t\t\t \n\t\t\t if($this->helpers->hasReservation($dt))\n\t\t\t {\n\t\t\t\t $dt['type'] = $req['type'];\n\t\t\t\t $dt['auth'] = $user->id;\n\t\t\t\t\n\t\t\t $this->helpers->respondToReservation($dt);\n\t\t\t session()->flash(\"respond-to-reservation-status\",\"ok\");\n return redirect()->intended('/');\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t \t session()->flash(\"duplicate-reservation-status-error\",\"ok\");\n\t\t\t return redirect()->intended('/');\n\t\t\t }\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsession()->flash(\"permissions-status-error\",\"ok\");\n\t\t\t\t\treturn redirect()->intended('/');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tAuth::logout();\n\t\t\t\t$u = url('/');\n\t\t\t\treturn redirect()->intended($u);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn redirect()->intended('/');\n\t\t}\n }", "static public function buildObject($reservations){\n\n foreach ($reservations as &$reservation) { // DO NOT FORGET \"&\"!! &を付けると、$usersを上書きできる。Arrayだった$usersをobjectに上書きしたいため。\n $reservation = new ReservationModel(\n $reservation[\"id\"], \n $reservation[\"user_id\"],\n $reservation[\"email\"],\n $reservation[\"username\"],\n $reservation[\"firstName\"],\n $reservation[\"lastName\"],\n $reservation[\"property_id\"],\n $reservation[\"propertyName\"],\n $reservation[\"checkIn\"],\n $reservation[\"checkOut\"],\n $reservation[\"numGuests\"],\n $reservation[\"note\"],\n $reservation[\"pricePerNight\"],\n $reservation[\"numOfNights\"],\n $reservation[\"totalPrice\"],\n $reservation[\"cardNumber\"],\n $reservation[\"cardholderName\"],\n $reservation[\"expirationDate\"],\n $reservation[\"cvc\"],\n $reservation[\"creationDate\"],\n $reservation[\"status_id\"]\n );\n\n }\n return $reservations; \n }", "function processReservation($fname,$lname,$sourcelist,$destlist,$flight,$sdate){\n $connection = initDB();\n $query2;\n \n //Update Guest Table\n $query2 = \"SELECT * FROM Guest WHERE FirstName='\".$fname.\"' AND LastName='\".$lname.\"'\";\n $result2 = mysql_query($query2);\n //or die (\"Query Failed \".mysql_error());\n\n $registeredGuest = false;\n $guestID;\n\n while($row2 = mysql_fetch_array($result2)){ \n $guestID = $row2['GID'];\n $registeredGuest = true; \n }\n //Guest ID not available. First time flyer.\n if(! $registeredGuest){ \n //Update Guest table.\n //Get last Guest ID\n $query2 = \"SELECT MAX(GID) FROM Guest\";\n $result2 = mysql_query($query2);\n //or die (\"Query Failed \".mysql_error());\n $row2 = mysql_fetch_array($result2);\n $MGID = $row2[0];\n \n $guestID = $MGID + 1;\n \n $query2 = \"INSERT INTO Guest Values('\".$guestID.\"','\".$fname.\"','\".$lname.\"')\";\n $result2 = mysql_query($query2);\n //or die (\"Query Failed \".mysql_error()); \n } \n \n //Get the flight ID\n $query = \"SELECT * FROM Flights WHERE FName='\".$flight.\"'\";\n $result = mysql_query($query);\n //or die (\"Query Failed \".mysql_error());\n $row2 = mysql_fetch_array($result); \n $FID = $row2['FID']; \n \n //Update schedule table \n $query2 = \"SELECT MAX(SID) FROM Schedule\";\n $result2 = mysql_query($query2);\n //or die (\"Query Failed \".mysql_error());\n $row2 = mysql_fetch_array($result2);\n $MSID = $row2[0];\n //echo \"MAX GID \".$MGID;\n $SID = $MSID + 1; \n //Before updating the schedule and itinerary table\n //check duplicate itinerary.\n\n $query2 = \"SELECT * FROM Schedule WHERE GID='\".$guestID.\"' AND FID='\".$FID.\"' AND Date='\".$sdate.\"'\";\n $result2 = mysql_query($query2);\n //or die (\"Query Failed \".mysql_error());\n\n $duplicateItinerary = false;\n $guestID;\n\n while($row2 = mysql_fetch_array($result2)){ \n $duplicateItinerary = true; \n }\n\n if($duplicateItinerary){\n //Duplicate itineraries not allowed.\n return -1;\n } \n\n\n $query2 = \"INSERT INTO Schedule Values('\".$SID.\"','\".$guestID.\"','\".$FID.\"','\".$sdate.\"')\";\n $result2 = mysql_query($query2);\n //or die (\"Query Failed \".mysql_error());\n \n //Finally update the Itinerary Table \n $query2 = \"SELECT MAX(IID) FROM Itinerary\";\n $result2 = mysql_query($query2);\n // or die (\"Query Failed \".mysql_error());\n $row2 = mysql_fetch_array($result2);\n $MIID = $row2[0]; \n $IID = $MIID + 1;\n\n $query2 = \"INSERT INTO Itinerary Values('\".$IID.\"','\".$guestID.\"','\".$FID.\"','\".$SID.\"')\";\n $result2 = mysql_query($query2);\n //or die (\"Query Failed \".mysql_error());\n\n closeDB($connection);\n return $IID;\n}", "function afficherreservation(){\n\t\t$sql=\"select hotel.nom hotel ,hotel.ville,reservation.* from (reservation inner join hotel on reservation.idhotel=hotel.id) order by idres \";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "public function index(Request $request)\n {\n if($request->has('accept_reserv')){\n Reservation::where('id',$request->reserv_id)\n ->update([\n 'status' => 1\n ]);\n $notification = Notification::create([\n 'to' => Reservation::find($request->reserv_id)->user_id,\n 'from' => Auth::user()->id,\n 'message' => 'تمت الموافقة على طلب الحجز الذي ارسلته من قبل صاحب العقار'\n ]);\n broadcast(new NewNotification($notification));\n return redirect()->back()->with('info','تم تحديث حالة الطلب');\n }\n // to delete reservation\n if($request->has('delete_reserv')){\n Reservation::where('id',$request->reserv_id)->update(['status' => 0]);\n $notification = Notification::create([\n 'to' => Reservation::find($request->reserv_id)->user_id,\n 'from' => Auth::user()->id,\n 'message' => 'تم رفض طلب الحجز الذي ارسلته من قبل صاحب العقار'\n ]);\n broadcast(new NewNotification($notification));\n return redirect()->back()->with('info',' تم حذف الطلب بنجاح ');\n }\n // to list all reservation\n $reservations = Reservation::where('reciver_id',Auth::user()->id)\n ->where('status', NULL)\n ->get();\n $accepted_reservations = Reservation::where('reciver_id',Auth::user()->id)\n ->where('status',1)\n ->get();\n $confirmable_reservations = Reservation::where('reciver_id',Auth::user()->id)\n ->where('status',2)\n ->get();\n return view('reservation.index')\n ->with('reservations',$reservations)\n ->with('accepted_reservations',$accepted_reservations)\n ->with('confirmable_reservations',$confirmable_reservations);\n }", "public function walk_in_reservation(Request $request, GuestDetail $guest_detail)\n {\n $guest_detail = new GuestDetail;\n $guest_detail->last_name = $request['last_name'];\n $guest_detail->first_name = $request['first_name'];\n $guest_detail->mi = $request['mi'];\n $guest_detail->email_address = $request['email_address'];\n $guest_detail->address = $request['address'];\n $guest_detail->contact_number = $request['contact_number'];\n $guest_detail->purpose = $request['purpose'];\n $guest_detail->gender = $request['gender'];\n $guest_detail->nationality = $request['nationality'];\n $guest_detail->check_in_date = date('Y-m-d', strtotime($request['check_in']));\n $guest_detail->check_out_date = date('Y-m-d', strtotime($request['check_out']));\n $guest_detail->save();\n\n $guest_id = DB::table('guest_details')->orderBy('id',\"DESC\")->take(1)->value('id');\n\n $date_start = date('Y-m-d', strtotime($request['check_in']));\n $date_end = date('Y-m-d', strtotime($request['check_out']));\n $interval = Carbon::parse($date_end)->diffInDays($date_start);\n\n $bookings = new Booking;\n $bookings->guest_id = $guest_id;\n $bookings->number_of_rooms = $request['number_of_rooms'];\n $bookings->grand_total = $interval;\n $bookings->payment_mode = 'Unpaid';\n $bookings->paid_status = 0;\n $bookings->viewed_status = 0;\n $bookings->save();\n\n for($i=0; $i < $request['number_of_rooms']; $i++)\n { \n $booking_id = DB::table('bookings')->orderBy('id',\"DESC\")->take(1)->value('id');\n\n $booking_details = new BookingDetail;\n \n $booking_details->booking_id = $booking_id;\n $booking_details->room_cat_id = $request['room_cat_id'];\n $booking_details->room_no = $request['room_no'];\n $booking_details->room_rate = $request['room_rate'];\n $booking_details->status = 'occupied';\n $booking_details->check_in = date('Y-m-d', strtotime($request['check_in']));\n $booking_details->check_out = date('Y-m-d', strtotime($request['check_out']));\n $booking_details->nights = $interval;\n $booking_details->total = ($request['room_rate']) * $interval;\n // $booking_details->total = ($request['room_rate'] * $request['number_of_rooms']) * $interval;\n $booking_details->save();\n\n $grand_total = BookingDetail::where('booking_id', $booking_id)->sum('total');\n $bookings = Booking::findOrFail($booking_id);\n $bookings->grand_total = $grand_total;\n $bookings->save();\n\n $accept_booking = new ConfirmedBooking;\n\n $accept_booking->booking_id = $booking_id;\n $accept_booking->room_cat_id = $request['room_cat_id'];\n $accept_booking->room_no = $request['room_no'];\n $accept_booking->room_rate = $request['room_rate'];\n $accept_booking->status = 'occupied';\n $accept_booking->check_in = date('Y-m-d', strtotime($request['check_in']));\n $accept_booking->check_out = date('Y-m-d', strtotime($request['check_out']));\n $accept_booking->nights = $interval;\n $accept_booking->total = ($request['room_rate']) * $interval;\n $accept_booking->save();\n\n }\n\n return ['bookings' => $bookings];\n }", "public function getUserIDToSendMail(){\n\t\t \n\t\t $userSessionID = Input::get('user_session_id'); \n\t\t \t$logTable = \"log_vistaws_\" . date('Y_m');\t \n\t\t \n\t\t $DataLogBooking = DB::table($logTable)\n\t\t\t\t\t\t ->select('phone', 'email', 'cname', 'theater', \n\t\t\t\t\t\t \t\t 'show_time', 'session_id', 'movie', 'seat', 'amount' , 'pincode' )\n\t\t\t\t\t\t ->where('user_session_id','=', $userSessionID) \n\t\t\t\t\t\t ->where('pincode','!=', '')\n\t\t\t\t\t\t ->get(); \n\t\t\t\t\t\t \n\t\t foreach ($DataLogBooking as $resultLog){ \n\t\t\t\t$mobile \t\t= $resultLog->phone;\n\t\t\t\t$email\t\t= $resultLog->email;\n\t\t\t\t$cname \t\t= $resultLog->cname;\n\t\t\t\t$hall\t \t= $resultLog->theater;\n\t\t\t\t$movieSession \t= $resultLog->show_time;\n\t\t\t \t$sessID\t = $resultLog->session_id;\n\t\t\t\t$movieName = $resultLog->movie;\n\t\t\t $seatPosition = $resultLog->seat;\n\t\t\t\t$SeatPrice\t = $resultLog->amount; \n\t\t\t\t$pincode\t = $resultLog->pincode; \n\t\t\t} #end foreach\n\t\t\t\n\t\t\t//**********\n\t\t $rowMovieDetail = DB::table('movie_showtimes')\n\t\t\t\t\t\t\t ->leftJoin('movie_list', 'movie_showtimes.showtime_Movie_strID', '=', 'movie_list.movie_strID')\n\t\t\t\t\t\t\t ->where('movie_showtimes.showtime_Session_strID','=', $sessID) \n\t\t\t\t\t\t\t ->where('movie_list.movieID','>', '0')\n\t\t\t\t\t\t\t ->where('movie_list.movie_Publish' , '1') \n\t\t\t\t\t\t\t ->get(); \n\t\t\t//***********\n\t\t\tforeach ($rowMovieDetail as $resultMovieDetail){ \n\t\t\t\t$movieName \t\t\t= $resultMovieDetail->movie_Name_EN;\n\t\t\t\t$imgPoster\t\t\t= $resultMovieDetail->movie_Img_Thumb;\n\t\t\t\t$showtimes \t\t\t= $resultMovieDetail->showtime_soundAttributes;\n\t\t\t\t$movie_Rating \t\t\t= $resultMovieDetail->movie_Rating; \n\t\t\t\t$showtime_SystemType \t= $resultMovieDetail->showtime_SystemType; \n\t\t\t\t\n\t\t\t} #end foreach\n\t\t\t\n\t\t\t\tif($movie_Rating == \"ส.\"){ \n\t\t\t\t\t$imgRate = \"rate_raise.png\"; \n\t\t\t\t }else if($movie_Rating == \"น13+\"){ \n\t\t\t\t\t$imgRate = \"rate_up_13_en.png\";\n\t\t\t\t }else if($movie_Rating == \"น15+\"){ \n\t\t\t\t\t$imgRate = \"rate_up_15_en.png\";\n\t\t\t\t }else if($movie_Rating == \"น18+\"){ \n\t\t\t\t\t$imgRate = \"rate_up_18_en.png\";\n\t\t\t\t }else if($movie_Rating == \"ฉ20-\"){ \n\t\t\t\t\t$imgRate = \"rate_under_20_en.png\";\n\t\t\t\t }else { \n\t\t\t\t\t$imgRate = \"rate_general_en.png\";\n\t\t\t\t }//***********\n\t\t\t\t \n\t\t\t\t if($showtime_SystemType == \"VS00000001\"){ \n\t\t\t\t\t$imgSystem = \"type_digital.png\";\n\t\t\t\t\t$systemName = '2D';\n\t\t\t\t }else if($showtime_SystemType == \"0000000001\"){ \n\t\t\t\t\t$imgSystem = \"type_3d.png\";\n\t\t\t\t\t$systemName = 'D3D';\n\t\t\t\t }else if($showtime_SystemType == \"0000000002\"){ \n\t\t\t\t\t$imgSystem = \"type_hfr_3d.png\";\n\t\t\t\t\t$systemName = 'HFR 3D';\t\t \n\t\t\t\t }else{\n\t\t\t\t\t$imgSystem = \"type_digital.png\";\n\t\t\t\t\t$systemName = '2D';\n\t\t\t\t } //*************\n\t\t\t\n\t\t//********** Start Send mail **/////////////\n\t\t$data = array(\n\t\t\t\t'seatPosition'\t=> $seatPosition,\n\t\t\t\t'SeatPrice'\t\t=> $SeatPrice,\n\t\t\t\t'imgSystem'\t\t=> $imgSystem,\n\t\t\t\t'systemName'\t=> $systemName, \n\t\t\t\t'imgRate'\t\t=> $imgRate, \n\t\t\t\t'movieName'\t\t=> $movieName,\n\t\t\t\t'sessID'\t\t=> $sessID,\n\t\t\t\t'imgPoster'\t\t=> $imgPoster,\n\t\t\t\t'movieSession'\t=> $movieSession, \n\t\t\t\t'pincode'\t\t=> $pincode,\n\t\t\t\t'mobile'\t\t=> $mobile,\n\t\t\t\t'hall'\t\t\t=> $hall, \n\t\t\t\t'showtimes'\t\t=> $showtimes, \n\t\t\t\t'cname'\t\t\t=> $cname, \t\t \n\t\t\t\t'email'\t\t\t=> $email \n\t\t\t); \n\t\t\t\n\t\t\t$user = array(\n\t\t\t\t\t'email'=> $email \n\t\t\t);\n\t\t\t \n\t Mail::send('emails.enews', $data , function($message)use ($user){ \n\t\t\t $message->to($user['email'], $user['email'])->subject('Movie ticket booking notification from Embassycineplex.com');\n\t\t });\t/**/\n\t\t echo 'OK';\n\t\t//********* ****************************\t\n\t\t\t\n\t \n\t}", "public function get_restaurant_list_fees () {\n\t\t\n\t\t$restaurantIDString = $this->get_param('post.restaurant_id_list');\n\t\t$deliveryRegionID = $this->get_param('post.delivery_region_id');\n\t\t\n\t\t$extraFee = M('restaurant')\n\t\t\t->where('`id` in (' . $restaurantIDString . ')')\n\t\t\t->field('sum(`extra_fee`) as extra_fee')\n\t\t\t->find();\n\t\t\n\t\tif (!$extraFee) {\n\t\t\t$extraFee = \"0\";\n\t\t} else {\n\t\t\t$extraFee = $extraFee['extra_fee'];\n\t\t}\n\t\t\n\t\t\n\t\t$deliveryFee = M('restaurant_deliver_fee')\n\t\t\t->where(\"`region_id` = $deliveryRegionID and `restaurant_id` in ( $restaurantIDString ) \")\n\t\t\t->select();\n\t\t\n\t\t$this->return_data(['extra_fee' => $extraFee, 'delivery_fee' => $deliveryFee]);\n\t}", "public function agent_email_details($booking_id='')\n {\n\n $this->load->model('admin/admin_model');\n\n $this->gen_contents['page_heading'] = 'Tour Booking Details';\n $tour_type = $this->gen_contents['tour_type'] = $this->input->get('type');\n $this->gen_contents['agents'] = $this->admin_model->get_agents();\n\n $this->gen_contents['booking_details'] = $this->admin_model->get_tour_booking_details($booking_id);\n $booking_details = $this->gen_contents['booking_details'];\n //p($booking_details); exit;\n foreach ($booking_details as $bd) { }\n\n if($tour_type == 'ts'){\n $emirates_data = $this->admin_model->get_emairates_from_booking($booking_id); // for TS\n }\n\n $this->gen_contents['emirates'] = $emirates_data['emirates'];\n //$mail_body = $this->admin_model->get_email_template('booking-mail'); //old\n $tour_template = $bd['template'];//$this->admin_model->get_tour_template($bd['category_id']);\n $mail_body = $tour_template;//['template'];\n \n if($tour_type == 'ts'){\n $tour_details = \"You are selected <b>\" .$emirates_data['emirates']. '</b> transfer service.';\n $mail_body = str_replace('{{user_name}}', $bd['user_name'], $mail_body);\n $mail_body = str_replace('{{tour_details}}', $tour_details, $mail_body);\n //echo $mail_body; exit;\n }\n else{\n $tour_details = get_tour_details_table($bd); // get tour details \n $traveler_details = get_traveler_details($bd); // get traveler details\n $extra_details = get_extra_details($bd);\n //echo $traveler_details; exit;\n $mail_body = str_replace('{{user_name}}', $bd['user_name'], $mail_body); \n $mail_body = str_replace('{{tour_details}}', $tour_details, $mail_body);\n $mail_body = str_replace('{{traveler_details}}', $traveler_details, $mail_body);\n $mail_body = str_replace('{{extra_details}}', $extra_details, $mail_body);\n }\n \n\n $this->gen_contents['mail_content'] = $mail_body;\n \n\n //p($this->gen_contents['booking_details']); exit;\n //rendering page \n $this->template->set_template('admin');\n $this->template->write_view('content', 'admin/agent-email-details', $this->gen_contents);\n $this->template->render();\n }", "public function getReservationID()\n {\n return $this->reservationID;\n }", "public function checkinPost(Request $request, Reservation $reservation)\n {\n\n foreach($request->room as $reservation_room_id => $roomPeople) {\n\n foreach($roomPeople as $person) {\n if ( isset($person['dni']) || isset($person['name']) || isset($person['surname']) ) {\n ReservationRoomPeople::create([\n 'reservation_room_id' => $reservation_room_id,\n 'dni' => $person['dni'],\n 'name' => $person['name'],\n 'surname' => $person['surname'],\n ]);\n }\n }\n }\n\n $reservation->status = ReservationStatus::Checkin();\n\n $reservation->save();\n\n return redirect()->route('attendant.reservations.index')->with('success', 'Checkin realizado exitosamente');\n\n }", "public function reservationEmail (){\n$mail = new PHPMailer(true);\n\ntry {\n //Server settings\n // $mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output\n $mail->isSMTP(); //Send using SMTP\n $mail->Host = 'smtp.mailtrap.io'; //Set the SMTP server to send through\n $mail->SMTPAuth = true; //Enable SMTP authentication\n $mail->Username = '754bcbdddf46fa'; //SMTP username\n $mail->Password = '43f5df2046fcf2'; //SMTP password\n $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged\n $mail->Port = 2525;\n $mail->CharSet = 'UTF-8';//TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above\n\n //Recipients\n $mail->setFrom('[email protected]', 'Mailer');\n $mail->addAddress('[email protected]', 'Administrateur Annonces Games.com');\n $mail->addReplyTo('[email protected]', 'Annonces Administration');\n\n\n $BD = new PDO(\"mysql:host=localhost;dbname=gites;charset=utf8\",\"root\", \"\");\n //Fonction static de la classe PDO pour debug la connexion en cas d'erreur\n $BD->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n $sql = \"SELECT * FROM type WHERE id_gite = ?\";\n// 3 Creation d'une requète péparée avec la fonction prepare de PDO qui execute la requète SQL\n $requete_insertion = $BD->prepare($sql);\n//Passage du ? à la valeur de $_GET['id_gite']\n $id = $_GET['id_gite'];\n// 4 je bind (lier) les parametres\n $requete_insertion->bindParam(1, $id);\n// 5 j'excute la requete\n $requete_insertion->execute();\n// 6 j'affiche mon element avec fetch (pour charger les resultats)\n\n\n\n //Content\n $mail->isHTML(true); //Set email format to HTML\n $mail->Subject = 'réserver votre gite';\n while ($BD = $requete_insertion->fetch()) {\n //Stock de l'id dans une variable\n $emailId = $BD['id_gite'];\n //Url du liens de validation\n $url = \"http://localhost/Gites3/confirmer_reservation?id_gite=$emailId\";\n $mail->Body = '\n\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"Content-Type\" content=\"text/html\">\n <title>Votre reservation chez lebongite.com</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n </head>\n <body style=\"color: #6cc3d5;\">\n <div style=\"color: #6cc3d5; padding: 20px;\">\n <h3 style=\"color: #1D2326\">Le bon gite.COM</h3>\n \n <p>Vous avez déposé une demande de reservation (ET C BIEN) avec le liens suivant</p><br />\n <p>Recapitulatif de votre commande</p>\n <p>Nom du gite :<b style=\"color: #2c4f56\">' . $BD['nom'] . '</b></p>\n <p>Description du gite :<b style=\"color: #2c4f56\"> ' . $BD['description'] . '</b></p>\n <p>Image du gite :<img src=\"https://www.leboupere.fr/medias/2016/02/Logo-gite.png\"/></p>\n <p>Prix par semaine du gite :<b style=\"color: #2c4f56\"> ' . $BD['prix'] . ' €</b></p>\n <p>Nombre de chambre :<b style=\"color: #2c4f56\"> ' . $BD['nbr_chambre'] . '</b></p>\n <p>Nombre de salle de bain :<b style=\"color: #2c4f56\"> ' . $BD['nbr_sdb'] . '</b></p>\n <p>Zone géographique :<b style=\"color: #2c4f56\"> ' . $BD['zone'] . '</b></p>\n <p>Date arrivée :<b style=\"color: #2c4f56\"> ' . $BD['date_arrivee'] . '</b></p>\n <p>Date départ :<b style=\"color: #2c4f56\"> ' . $BD['date_depart'] . '</b></p>\n <p>Toutes fois vous avez la possibilité d\\'annuler ou de confirmer votre commande</p>\n <br /><br />\n \n <a href=\"' . $url . '\" style=\"background-color: darkred; color: #F0F1F2; padding: 20px; text-decoration: none;\">Confimer la reservation de votre gite</a><br />\n \n ';\n }\n $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';\n\n $mail->send();\n echo 'Message has been sent';\n} catch (Exception $e) {\n echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\";\n}\n}", "public function indexAction()\n\t{\n\t\t$order_id = session_id();\n\t\t\n\t\t$this->view->headTitle('Reservation');\n\t\t$objReser = new Models_Reservation();\n\t\t\n\t\t$resId = $this->_getParam('rid', false);\n\t\tif (false === $resId) {\n\t\t $this->_redirect('');\n\t\t}\n\t\t\n /**\n * Get restaurant\n */\n $objRes = new Models_Restaurant();\n $res = $objRes->find($resId)->toArray();\n $res = current($res);\n if (false == $res || '0' == $res['reser_onoff']) {\n $this->_redirect('');\n }\n /**\n * Check active restaurant\n */\n $this->_checkReservationOfRestaurant($res);\n// echo '<pre>';print_r($res);die;\n /**\n * All time in a day\n */\n $defaultTimeZone = date_default_timezone_get();\n date_default_timezone_set('UTC');\n $allTimes = array();\n for ($i = 0; $i < 48; $i++) {\n $time = 1800 * $i;\n $allTimes[] = array(\n 'time' => $time,\n 'text' => date('g:i A', $time)\n );\n }\n date_default_timezone_set($defaultTimeZone);\n// echo date('g:i A', 0);die;\n// echo '<pre>';print_r($allTimes);die;\n \n /**\n * Get search condition\n */\n $search = $this->_getParam('search', array(\n 'date' => date('m/d/Y'),\n 'time' => (date('G') * 3600 + (ceil(date('i')/30)) * 1800),\n 'quantity' => 2\n ));\n $search['quantity'] = intval($search['quantity']);\n \n \n $pointerDate = explode('/', $search['date']);\n $pointerDate = mktime(0, 0, 0, $pointerDate[0], $pointerDate[1], $pointerDate[2]) + $search['time'];\n $search['unixTime'] = $pointerDate;\n \n $this->session->reserSearch = $search;\n// echo '<pre>';print_r($search);die;\n\n /**\n * Get next 7 day often\n */\n $searchDateArr = array();\n $count = 0;\n $pointerDate = $search['unixTime'];\n $dateArr = array('date_mon', 'date_tue', 'date_wed', 'date_thu', 'date_fri', 'date_sat', 'date_sun');\n\n while (true) {\n $field = 'date_' . strtolower(date('D', $pointerDate));\n if ('1' == $res[$field]) {\n $searchDateArr[] = array(\n 'time' => $pointerDate,\n 'field' => $field,\n 'date' => date('D, m/d/Y g:i A', $pointerDate)\n );\n $count++;\n }\n if( 8 <= $count) {\n break;\n }\n $pointerDate += 3600 * 24;\n }\n /**\n * Get available hour for each date\n */\n foreach ($searchDateArr as &$date) {\n $date['startTime'] = $date['time'] - 1800 * 3;\n $date['endTime'] = $date['time'] + 1800 * 3;\n $maxTotal = $res['reser_quantity'] - $search['quantity'];\n \n $date['exitResers'] = $objReser->searchExistRerservation($date['startTime'], $date['endTime'], $maxTotal);\n $date['available'] = array();\n \n for ($i = $date['startTime']; $i <= $date['endTime']; $i = $i + 1800) {\n $flag = true;\n foreach ($date['exitResers'] as $exist) {\n if ($i == $exist['time']) {\n $flag = false;\n break;\n }\n }\n \n $date['available'][$i] = $flag;\n }\n }\n unset($date);\n \n// echo '<pre>';print_r($searchDateArr);die;\n// $searchDateArr[1]['available']['1301472000'] = false;\n// $searchDateArr[1]['available']['1301477400'] = false;\n// $searchDateArr[1]['available']['1301482800'] = false;\n /**\n * Data for view\n */\n $this->view->res = $res;\n $this->view->arr_restaurant = $res;\n $this->view->resId = $resId;\n $this->view->allTimes = $allTimes;\n $this->view->search = $search;\n $this->view->searchDateArr = $searchDateArr;\n $this->view->currentTime = time();\n $this->view->address_restaurant = $res['street'].\" \".$res['city'].\" \".$res['state'];\n\t}", "static function sendRequests()\n {\n // Grab all managers\n $managers = User::where('role', User::getRole('manager'))->get();\n // Today's date\n $date = Carbon::now()->format('d_m_Y');\n // Create a new folder named by today's date\n Storage::disk('local')->makeDirectory('holidayRequests/' . $date);\n $all_requests = new Collection();\n\n foreach ($managers as $manager) {\n if ($manager->employees->isNotEmpty()) {\n $manager_requests = new Collection();\n foreach ($manager->employees as $employee) {\n if ($employee->holidayRequests->isNotEmpty() &&\n $employee->holidayRequests()->whereIsSend(0)->get(['firstname','lastname'])->isNotEmpty()) {\n $manager_requests = $manager_requests->concat(\n $employee->holidayRequests()->whereIsSend(0)->get()\n );\n }\n }\n\n if ($manager_requests->isNotEmpty()) {\n // Define a path where the .csv file will be saved\n $path = \"holidayRequests/{$date}/{$date}_{$manager->firstname}_{$manager->lastname}.csv\";\n// //Create and store the .csv file\n Excel::store(new HolidayRequestsExport($manager_requests), $path);\n// // Send the .csv to the manager\n Mail::to($manager->email)->send(new holidayRequests($manager, $path, $date));\n $all_requests = $all_requests->concat($manager_requests);\n }\n }\n }\n\n if ($all_requests->isNotEmpty()) {\n // Update all request that were send and set is_set = 1\n HolidayRequest::updateIsSend($all_requests);\n }\n // if no files were created,delete the folder\n if (count(Storage::files($date)) === 0) {\n Storage::deleteDirectory($date);\n }\n }", "private function mailer($id)\n {\n //server\n $server = Servers::where('server_id', $id)->firstOrFail();\n $server_name = $server->server_name;\n //apps\n $server_apps = ServerApp::where('server_id', $id)->get();\n //find the apps\n foreach ($server_apps as $serverapp)\n {\n $app_id = $serverapp->app_id;\n $appfunctionaladmincount = $this->countAppFunctionalAdmin($app_id);\n //check if persons exist\n if ($appfunctionaladmincount >=1){\n //find the persons\n $appfunctionaladmin = App_FunctionalAdmin::with('persons')->where('app_id', $app_id)->get();\n foreach ($appfunctionaladmin as $functionaladmin)\n {\n $person_mail = $functionaladmin->persons->person_email;\n //run the mails\n if (filter_var($person_mail, FILTER_VALIDATE_EMAIL)) {\n if (!is_null($person_mail)){\n Mail::to($person_mail)->send(new OSnotifyMail($app_name,$server_name,$person_mail));\n }\n }\n }\n } \n $apptechadmincount = $this->countAppTechAdmin($app_id);\n if($apptechadmincount >=1){\n $apptechadmin = App_TechAdmin::with('persons')->where('app_id', $app_id)->get();\n foreach ($apptechadmin as $techadmin)\n {\n $person_techmail = $techadmin->persons->person_email;\n //run the mails\n if (filter_var($person_techmail, FILTER_VALIDATE_EMAIL)) {\n if (!is_null($person_techmail)){\n Mail::to($person_techmail)->send(new OSnotifyMail($app_name,$server_name,$person_techmail));\n }\n } \n }\n }\n\n }\n }", "public function reservations() {\n return $this->hasMany('App\\Reservation')->getResults();\n }", "public function run(Faker $faker)\n {\n $restaurants = [\n [\n 'name' => 'Mirko',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Dal genovese',\n 'vat' => '12345678912',\n 'address' => 'Via del genovese',\n 'zip' => '21137',\n 'phone' => '3333333331',\n 'image' => 'https://www.umberto.it/wp-content/uploads/2018/11/RISTORANTE-UMBERTO-%C3%A8-UNA-TAPPA-del-MONOPOLY-NAPOLI-2.png'\n ],\n [\n 'name' => 'Giuseppe',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Dal pugliese',\n 'vat' => '55566699954',\n 'address' => 'Via del pugliese',\n 'zip' => '21137',\n 'phone' => '3333333332',\n 'image' => 'https://i.ibb.co/26JzDpz/124689152-116276153619835-6658681031194173572-n.png'\n\n ],\n [\n 'name' => 'Alfonso',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Da Alfonso',\n 'vat' => '55566199954',\n 'address' => 'Via di Alfonso',\n 'zip' => '21137',\n 'phone' => '3333333333',\n 'image' => 'https://lirp.cdn-website.com/0912aaa6/dms3rep/multi/opt/Logo-174w.png'\n\n ],\n [\n 'name' => 'Marco',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Il Barbatrucco',\n 'vat' => '55516699954',\n 'address' => 'Via del barbatrucco',\n 'zip' => '21137',\n 'phone' => '3333335100',\n 'image' => 'https://media-cdn.tripadvisor.com/media/photo-s/0d/34/6c/c6/getlstd-property-photo.jpg'\n ],\n [\n 'name' => 'Pasquale',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Bella Napoli',\n 'vat' => '5156669995',\n 'address' => 'Via Napoli',\n 'zip' => '21137',\n 'phone' => '3333335588',\n 'image' => 'https://www.bellanapolilignano.info/wp-content/uploads/2018/10/bella-napoli-1.png'\n ],\n [\n 'name' => 'Eugenio',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Ristogenius',\n 'vat' => '55561298854',\n 'address' => 'Via del genio',\n 'zip' => '21137',\n 'phone' => '3334133550',\n 'image' => 'https://ristoacademy.it/wp-content/uploads/2021/07/RISTOGENIUS-LOGO-bn.png'\n ],\n [\n 'name' => 'Frank',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Da Frank',\n 'vat' => '52261899995',\n 'address' => 'Via di Frank',\n 'zip' => '21137',\n 'phone' => '3334163550',\n 'image' => 'https://pizzeriafrank.it/wp-content/uploads/2020/05/logo-frank.png'\n ],\n [\n 'name' => 'Chung',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Xuan',\n 'vat' => '55571299954',\n 'address' => 'Via della seta',\n 'zip' => '21137',\n 'phone' => '3334133588',\n 'image' => 'https://lh3.googleusercontent.com/-9l9A01-22tIcnGyliIupCbF7qChLejD5B8k5Bg_VyxWryFJ2urQFmFssCJvieThO8TeFFtEnvmPMFPv=w1080-h608-p-no-v0'\n ],\n [\n 'name' => 'Filippo',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Pizzeria Namek',\n 'vat' => '55561200054',\n 'address' => 'Via Namek',\n 'zip' => '21137',\n 'phone' => '33341893550',\n 'image' => 'https://i.ibb.co/DWYrDWg/20506989-123062131659736-760641137862062055-o.jpg'\n ],\n [\n 'name' => 'Tanaka',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n 'restaurant_name' => 'Toshi',\n 'vat' => '55560099954',\n 'address' => 'Via Giappone',\n 'zip' => '21137',\n 'phone' => '3332003500',\n 'image' => 'https://menu.sluurpy.it/menu-nuovi/4924/4924/miniatura.jpg'\n ]\n ];\n\n $types = Type::pluck('id')->toArray();\n\n foreach ($restaurants as $restaurant) {\n $new_user = new User();\n $new_user->fill($restaurant);\n $new_user->save();\n $new_user->types()->attach(Arr::random($types, 2));\n }\n\n // for ($i = 0; $i < 13; $i++) {\n // $new_user = new User();\n // $new_user->name = $faker->name();\n // $new_user->email = $faker->email();\n // $new_user->password = bcrypt($faker->word());\n // $new_user->restaurant_name = $faker->words(2, true);\n // $new_user->vat = $faker->randomNumber(9, true);\n // $new_user->address = $faker->address();\n // $new_user->zip = $faker->randomNumber(5, true);\n // $new_user->phone = $faker->phoneNumber();\n // $new_user->save();\n // $new_user->types()->attach(Arr::random($types, 2));\n // }\n }", "public function mailUserConfirmedReservation(Request $request)\n {\n $now = now(); \n $reservation = new BikeReservation([\n 'reserved_from' => $now,\n 'reserved_to' => $now->addDay(),\n ]);\n $reservation->id = 1;\n \n $reservation->bike = new Bike([\n 'name' => 'Sample Bike'\n ]); \n $mail = new Mail\\UserConfirmedReservation($reservation);\n return $mail;\n }", "public function selectReservations() {\n $tab=[];\n $pdo=$this->connect_db('boutique');\n $reqlogin = $pdo->prepare(\"SELECT r.id, r.id_utilisateur, r.titrereservation, r.typeevenement, r.datedebut, r.heuredebut FROM reservation AS r INNER JOIN utilisateurs AS u ON r.id_utilisateur = u.id\");\n $reqlogin->execute($tab);\n $result=$reqlogin->fetchAll();\n return $result;\n }", "public function sendEmailNotificationToCustomer(Reservation $reservation)\n {\n $user = User::whereId($reservation->user_id)->first();\n\n Mail::send('emails/cart/customer/rejected', [\n 'user' => $user,\n 'reservation' => $reservation\n ],\n function ($message) use ($user) {\n $message->from('[email protected]', trans('HTR Sales!'));\n $message->to($user->email, $user->name)->subject('Reservation was Rejected!');\n }\n );\n }", "public function getIdrestaurant(): int \n {\n return $this->id_restaurant;\n }", "public function manager_data($manager_id){\n try {\n $query=$GLOBALS['$dbFramework']->query(\"SELECT a.user_id as manager_id,a.travel_cost,a.outgoingsms_cost,\n a.outgoingcall_cost,a.outgoingsms_currency,a.outgoingcall_currency,\n b.user_name as rep_name,b.team_id,d.teamname,\n g.Department_name,c.user_name as manager,r.role_name as designation,\n b.address1,b.address2,b.user_name as repname,b.phone_num->'$.mobile[0]' as phone1,b.dob,b.user_gender,b.emailId->'$.work[0]' as email\n FROM representative_details a,user_details b,hierarchy h,teams d,department g,user_details c,user_roles r\n Where a.user_id='$manager_id' \n and a.user_id=b.user_id\n -- and b.location=h.hkey2 \n and b.team_id=d.teamid \n and b.department=g.Department_id \n and b.reporting_to=c.user_id\n and b.designation=r.role_id\n group by a.user_id\");\n return $query->result();\n }\n catch (LConnectApplicationException $e) {\n $GLOBALS['$logger']->debug('!!!Exception Thrown to Model --- Passing to Controller!!!');\n throw $e;\n }\n \n\n }", "public function reservation(){\n\t\t\t$data['title'] = 'Reservasi Gigi ';\n\n\t\t\t$data['admins'] = $this->admin_model->get_reservations();\n\n\t\t\t$data['users'] = $this->admin_model->get_users();\n\n\t\t\t$this->form_validation->set_rules('nama', 'Nama', 'required');\n\t\t\t$this->form_validation->set_rules('umur', 'Umur', 'required');\n\t\t\t$this->form_validation->set_rules('jenis_kelamin', 'Jenis Kelamin', 'required');\n\t\t\t$this->form_validation->set_rules('ket_reservasi', 'Keterangan Reservasi', 'required');\n\t\t\t$this->form_validation->set_rules('waktu_reservasi', 'Waktu Reservasi', 'required');\n\n\t\t\tif ($this->form_validation->run() === FALSE) {\n\t\t\t\t$this->load->view('templates/header');\n\t\t\t\t$this->load->view('admins/reservation', $data);\n\t\t\t\t$this->load->view('templates/footer');\n\t\t\t}else{\n\t\t\t\t$id_pengguna = $this->session->userdata('id_pengguna');\n\t\t\t\t$konfirmasi = 'Menunggu Konfirmasi';\n\t\t\t\t$keterangan_reservasi = 'Belum Dilayani';\n\n\t\t\t\t$this->admin_model->reservasi($id_pengguna, $konfirmasi, $keterangan_reservasi);\n\n\t\t\t\t//Set message \n\t\t\t\t$this->session->set_flashdata('user_reservation', 'Reservasi Anda sudah Kami terima. Mohon tunggu konfirmasi selanjutnya.');\n\n\t\t\t\tredirect('');\n\t\t\t}\n\t\t}", "public function get_target_restaurant_list () {\n\t\t$restaurantList = $this->get_param('post.restaurant_list');\n\t\t$grouponRestaurantList = $this->get_param('post.groupon_restaurant_list');\n\n\t\t$this->get_restaurant_list($restaurantList, $grouponRestaurantList);\n\t}", "function annuler_reservation($data){\n\n\t\t$query = $this->db->query(\"SELECT * FROM reservations WHERE id = ?\", array($data['id']));\n\t\t$val = 0;\n\t\t$valToUpdate = array('status' => 'annuler','place'=>$val);\n\t\t$this->db->where('id', $data['id_reservation']);\n\t\t$resultat = $this->db->update('reservations', $valToUpdate);\n\t\t\t\t\n\t\tif ($resultat) {\n\t\t\t$valToUpdates = array('place_disponible'=>$data['place_disponible']);\n\t\t\t$this->db->where('id', $data['id_trajet']);\n\t\t\t$result = $this->db->update('trajet', $valToUpdates);\n\t\t\tif($result){\n\t\t\t\techo json_encode($message=array('etat' => 1,'message'=>'Reservation annulée avec success'));\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo json_encode($message=array('etat' => 0,'message'=>'Annulation échouée'));\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\techo json_encode($message=array('etat' => 0,'message'=>'Annulation échouée'));\n\t\t}\n\t\t\n\t\treturn !empty($message)?$message:null;\n\t}", "public function getReservations()\n {\n return $this->hasMany(Reservation::className(), ['service_id' => 'id']);\n }", "public static function soon()\n\t{\n\t\t$reservations = \\Model_Lessontime::find(\"all\", [\n\t\t\t\"where\" => [\n\t\t\t\t[\"deleted_at\", 0],\n\t\t\t\t[\"status\", 1],\n\t\t\t\t[\"freetime_at\", \"<=\", time() + 600],\n\t\t\t\t[\"freetime_at\", \">=\", time()],\n\t\t\t]\n\t\t]);\n\n\t\tforeach($reservations as $reservation){\n\n\t\t\t// for teacher\n\t\t\t$url = \"http://game-bootcamp.com/teachers/top\";\n\n\t\t\t$body = \\View::forge(\"email/teachers/reminder_soon\",[\"url\" => $url]);\n\t\t\t$sendmail = \\Email::forge(\"JIS\");\n\t\t\t$sendmail->from(\\Config::get(\"statics.info_email\"),\\Config::get(\"statics.info_name\"));\n\t\t\t$sendmail->to($reservation->teacher->email);\n\t\t\t$sendmail->subject(\"Your lesson will start.\");\n\t\t\t$sendmail->html_body(htmlspecialchars_decode($body));\n\n\t\t\t$sendmail->send();\n\n\t\t\t// for student\n\t\t\t$url = \"http://game-bootcamp.com/students/top\";\n\n\t\t\t$body = \\View::forge(\"email/students/reminder_soon\",[\"url\" => $url]);\n\t\t\t$sendmail = \\Email::forge(\"JIS\");\n\t\t\t$sendmail->from(\\Config::get(\"statics.info_email\"),\\Config::get(\"statics.info_name\"));\n\t\t\t$sendmail->to($reservation->student->email);\n\t\t\t$sendmail->subject(\"Your lesson will start.\");\n\t\t\t$sendmail->html_body(htmlspecialchars_decode($body));\n\n\t\t\t$sendmail->send();\n\t\t}\n\t}", "public function add_Reservation(Request $request){\n\n $validator = Validator::make($request->all(),[\n 'start_date' => 'required',\n 'end_date' => 'required'\n ]);\n\n // to make sure reservation cant be send when agar is rented\n $reservations_for_agar = Reservation::where('agar_id',$request->agar_id)->get();\n $start_date = new DateTime($request->start_date);\n foreach ($reservations_for_agar as $reservation) {\n\n $reservation_end_date = new DateTime($reservation->end_date);\n\n if(date_format($start_date,\"Y/m/d\") < date_format($reservation_end_date,\"Y/m/d\") and $reservation->status == 2){\n // 407 is custom code\n return response()->json([\n 'code' => 407,\n 'errors' => 'true',\n 'message' => 'العقار غير متاح للايجار في هذه الفترة'\n ]);\n }\n }\n\n if($request->start_date < $request->end_date){\n if ($validator->passes()) {\n if(Auth::user()->id != $request->reciver_id){\n Reservation::create([\n 'agar_id' => $request->agar_id,\n 'user_id' => Auth::user()->id,\n 'reciver_id' => $request->reciver_id,\n 'start_date' => Carbon\\Carbon::parse($request->start_date)->toDateTimeString(),\n 'end_date' => Carbon\\Carbon::parse($request->end_date)->toDateTimeString()\n ]);\n return response()->json([\n 'code' => 200,\n 'errors' => 'false',\n 'message' => 'تم ارسال طلب الايجار بنجاح'\n ]);\n }\n else{\n return response()->json([\n 'code' => 400,\n 'errors' => 'true',\n 'message' => 'لا يمكنك ارسال طلب ايجار على عقارك'\n ]);\n }\n }\n }\n // if validation faild\n return response()->json([\n 'code' => 400,\n 'error'=>$validator->errors()->all()\n ]);\n }", "public function store(Request $request)\n {\n #opcion 1\n\n $renta = new RentaCliente();\n $renta->user= $request->input('user_id');\n $renta->vehiculo= $request->input('vehiculo_id');\n \n $renta->total_de_dias=$request->input('total_de_dias');\n $renta->precio_total= $renta->total_de_dias * vehiculos::where('id',$renta->vehiculo)->pluck('precio')->first();\n $renta->fecha_inicio= $request->input('fecha_inicio');\n $renta->fecha_fin= $request->input('fecha_fin');\n vehiculos::where('id',$renta->vehiculo)->increment('veces_rentado');\n vehiculos::where('id',$renta->vehiculo)->update(['estado' => false]);\n $renta->codigo_de_renta = substr(str_shuffle(\"0123456789AaBbCcDdEeFfGgHhIiJjLkLlMmNnOoPpQqRrSsTtVvWwXxYyZz\"), 0, 6);\n $renta->save();\n\n // email data\n $email_data = array(\n 'name' => Auth::user()->name,\n 'email' => Auth::user()->email,\n 'rent'=> vehiculos::where('id',$renta->vehiculo)->pluck('Nombre')->first(),\n 'prec'=> RentaCliente::where('precio_total',$renta->precio_total)->pluck('precio_total')->first(),\n 'fechasalida'=> RentaCliente::where('fecha_inicio',$renta->fecha_inicio)->pluck('fecha_inicio')->first(),\n 'fechaentrega'=> RentaCliente::where('fecha_fin',$renta->fecha_fin)->pluck('fecha_fin')->first(),\n 'codigoderenta'=>RentaCliente::where('codigo_de_renta',$renta->codigo_de_renta)->pluck('codigo_de_renta')->first(),\n );\n \n // send email with the template\n Mail::send('renta_mail', $email_data, function ($message) use ($email_data) {\n $message->to($email_data['email'], $email_data['name'])\n ->subject('Gracias por tu renta!')\n ->from('[email protected]', 'Victor Ureña');\n });\n\n \n return redirect()->route('homec.index')->withSuccessMessage('Comunicate con nosotros para confirmar'); \n }", "function getLineManagersEmail ($lineManagerName)\n\n {\n //When someone applies to the HR Manager\n if($lineManagerName === 'Adekunle Obadina')\n {\n //$HrEmail = DB::table('dbo.BUSINESS_UNITS')->where('unit_id', 10)->first()->line_manager_email;\n //return $HrEmail;\n return '[email protected]';\n }\n\n $LM_Emp_Id = (int) DB::table('dbo.LEAVE_USERS')->where(\"name\", '=', \"$lineManagerName\")->first()->Emp_id;\n $LM = Employee::find($LM_Emp_Id);\n return $LM->Emp_Email;\n\n /*$line_manager_email = explode(\" \",$lineManagerName);\n $line_manager_email_for_this_request = $line_manager_email[0] .\".\" .$line_manager_email[1].\"@cardinalstone.com\";\n return $line_manager_email_for_this_request;\n */\n }", "public function reservations()\n {\n\n return $this->hasMany('App\\Models\\reservation');\n }", "public function agent_email_appln()\n {\n $this->load->model('admin/admin_model');\n $booking_id = $this->input->post(\"booking_id\",true);\n\n $booking_details = $this->admin_model->get_tour_booking_details($booking_id);\n foreach ($booking_details as $bd) { }\n $mail_body = $this->input->post(\"mail_body\",true);\n $subject = $this->input->post(\"subject\",true);\n\n $agent_email = $this->input->post(\"agent_email\",true); //agent email id\n $mail_body = $this->input->post(\"mail_body\",true);\n $from_name = \"Dubai Private Tour\";\n $from_email = \"[email protected]\";\n \n if(!empty($agent_email)){\n send_mail($agent_email, $from_name, \"New Booking Confirmation- Ref: \".$subject, $mail_body, $from_email); //send to agent\n } \n // ====== Send email notification =========\n sf('success_message','Email has been sent to agent successfully!');\n redirect('admin/tour-booking');\n }", "public function reservations() {\n $this->template->content = View::instance(\"v_reservations_reservations\");\n $this->template->title = \"Reservations\";\n\n # Build the query to get all the users\n // $q = \"SELECT * FROM reservations\";\n\n\t $q = \"SELECT *\n FROM reservations\n WHERE user_id = \".$this->user->user_id.\" order by reservation_id desc\";\n\n # Execute the query to get all the users.\n # Store the result array in the variable $users\n $reservations = DB::instance(DB_NAME)->select_rows($q);\n\n # Build the query to figure out what reservations does this user already have?\n # I.e. who are they following\n $q = \"SELECT *\n FROM reservations\n WHERE user_id = \".$this->user->user_id;\n\n\n\n # Pass data (reservations) to the view\n $this->template->content->reservations = $reservations;\n\n\n # Render the view\n echo $this->template;\n }", "function update_activity_send_sms_email_to_visitors($activity_id) {\n // , auto-generate meeting_ID\n $date = date('Ymd');\n\n $visitors = $this->Activity_model->get_activity_visitors_by_activity_id($activity_id);\n $activity_details = $this->Activity_model->get_daily_activity_by_activity_id($activity_id);\n\n $host_info = $this->Activity_Model->get_emp_info_by_empcode($activity_details->HOST_EMP);\n $host_name = $host_info->EMP_FNAME .' '. $host_info->EMP_LNAME;\n\n if($visitors) {\n foreach ($visitors as $visitor) {\n $meeting_ID = $date . str_pad($visitor->VISITOR_ID, 4, '0', STR_PAD_LEFT);\n $this->Activity_Model->update_visit_log_meeting_id($meeting_ID, $visitor->VISITOR_ID);\n\n $visitors_name = $visitor->VISIT_FNAME .' '. $visitor->VISIT_LNAME;\n $sms_message = \"Good day, \".$visitors_name.\"! Please be advised that your meeting with \".$host_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\" has already been confirmed. Your meeting ID is \".$meeting_ID.\". Please check your e-mail for further details. Thank you!\";\n\n $email_message = \"Dear \".$visitors_name.\": <br><br> Good Day! <br><br>\n Please be advised that your meeting with \".$host_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\" has already been confirmed. <br><br>\n Your meeting ID is \".$meeting_ID.\". <br><br>\n If you encountered any technical problems, please contact \".$host_name.\" at \".$host_info->EMAIL_ADDRESS.\" or \".$host_info->MOBILE_NO.\".\n\n <br><br><br>\n Thank you.<br><br>\n <b>Human Resources </b>\";\n $this->sms->send( array('mobile' => $visitor->MOBILE_NO, 'message' => $sms_message) );\n $this->send_email($visitor->EMAIL_ADDRESS, 'ETS – '.$visitor->MEETING_ID.' - MEETING UPDATE', $email_message);\n\n // SMS EMAIL TO HOST_EMPLOYEE FOR MEETING ID\n $sms_message = \"Good day, \".$host_name.\"! Please be informed that you have a meeting with \".$visitors_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\". Please check your e-mail for the meeting confirmation. Please disregard this message if you already complied. Thank you!\";\n\n $email_message = \"Dear \".$host_name.\": <br><br> Good Day! <br><br>\n Please be informed that you have a meeting with \".$visitors_name.\" on \".$activity_details->ACTIVITY_DATE.\" from \".$activity_details->TIME_FROM.\" to \".$activity_details->TIME_TO.\" at \".$activity_details->LOCATION.\". <br><br>\n To confirm the meeting, please copy the link below and paste it into your browser’s address bar. <br><br>\".base_url('login').\" <br><br>Please disregard this message if you already complied.\n\n <br><br><br>\n Thank you.<br><br>\n <b>Human Resources </b>\";\n if($host_info->MOBILE_NO <> 0) {\n $this->sms->send( array('mobile' => $host_info->MOBILE_NO, 'message' => $sms_message) );\n }\n\n if($host_info->EMAIL_ADDRESS) {\n $this->send_email($host_info->EMAIL_ADDRESS, 'ETS – VISITOR’S MEETING CONFIRMATION', $email_message);\n }\n\n }\n }\n\n\n\n \n }", "public function reminderCommentario(){\n\n $reminders = Cliente::join('clientes_observaciones', 'clientes.id','=','clientes_observaciones.cliente_id')\n ->join('personal','clientes.id','=','personal.id')\n ->select('clientes_observaciones.id','celular','apellidos', 'nombre','email', 'comentario','clientes.vendedor_id')\n ->where('prox_cita','=', Carbon::now()->format('Y-m-d'))\n ->where('clientes.vendedor_id','=', Auth::user()->id)\n ->get();\n\n return $reminders;\n }", "public function reservationCancel()\n\t{\n\t\t//echo \"<pre>\"; print_r(Input::all()); die;\n\t\t$reservationID = $this->request->input('reserv_id');\n\t\t$reservationType = $this->request->input('reserv_type');\n\t\t$user_id = $this->request->input('user_id');\n\t\t$added_by = $this->request->input('added_by');\n\t\t//echo \"reservationID == \".$reservationID.\" , reservationType == \".$reservationType; die;\n\t\t$arrResponse = ReservationModel::cancelReservation($reservationID, $reservationType);\n\t\t$userID = $user_id;\n\t\t$userData = Profile::getUserProfileWeb($userID);\n\t\t//print_r($userData);die;\n\n\t\t//for the new db structure support\n\t\t$newDb['attributes']['reservation_status_id'] = 3;\n\t\t$newDb['userdetails']['user_id'] = $userID;\n\t\t$newDb['userdetails']['status'] = 3;\n\t\t$newDb['attributes']['seating_status'] = 3;\n\t\t$newDb['attributes']['closed_on'] = Carbon::now()->toDateTimeString();\n\n\t\t//print_r($newDb);die;\n\t\t$reservDetails = new ReservDetailsModel();\n\t\t$newDbStatus = $reservDetails->updateAttributes($reservationID,$newDb);\n\t\t$tokens = $reservDetails->pushToRestaurant($reservationID);\n\t\t$this->restaurantapp->push($reservationID,$tokens,true);\n\t\t//print_r($newDbStatus);die;\n\t\t/*TODO: Add the status of success check and include added_by and transaction_id attributes */\n\t\t//die;\n\n\n\t\t$rewardsPoints = '';\n\t\t$type = '';\n\t\t$bookingsMade = '';\n\t\t$lastOrderId = '';\n\n\t\t$arrReservationDetails = DB::table('reservation_details')->where('id', $reservationID)\n\t\t\t->select('reservation_date','reservation_time','no_of_persons','product_vendor_location_id','vendor_location_id')\n\t\t\t->get();\n\n\t\t//echo \"<pre>\"; print_r($arrReservationDetails); //die;\n\n\t\tif($arrResponse['status']=='ok')\n\t\t{\n\n\t\t\tif($reservationType == \"experience\"){\n\n\t\t\t\t$zoho_data = array(\n\t\t\t\t\t'Loyalty_Points_Awarded'=>0,\n\t\t\t\t\t'Order_completed'=>(isset($added_by) && $added_by == 'user' ? 'User Cancelled' : 'Admin Cancelled'),\n\t\t\t\t);\n\t\t\t\t$res_data = $this->zoho_edit_booking('E'.sprintf(\"%06d\",$reservationID),$zoho_data);\n\n\t\t\t\t$setBookingKey = 'MERGE11';\n\t\t\t\t$setBookingsValue = $userData['data']['bookings_made'];\n\n\n\t\t\t\t$arrProductID = DB::table('product_vendor_locations')->where('id', $arrReservationDetails[0]->product_vendor_location_id)\n\t\t\t\t\t->select('product_id','vendor_location_id')\n\t\t\t\t\t->get();\n\n\t\t\t\t$productDetails = $this->experiencesRepository->getByExperienceId($arrProductID[0]->product_id);\n\n\t\t\t\t$outlet = $this->experiences_model->getOutlet($arrReservationDetails[0]->product_vendor_location_id);\n\n\t\t\t\t//$locationDetails = $this->experiences_model->getLocationDetails($arrReservationDetails[0]->product_vendor_location_id);\n\t\t\t\t//echo \"<br/>---- productdetails---<pre>\"; print_r($productDetails);\n\t\t\t\t//echo \"<br/>---- outlet---<pre>\"; print_r($outlet);\n\t\t\t\t$rewardsPoints = $productDetails['attributes']['reward_points_per_reservation'];\n\t\t\t\t$bookingsMade = $userData['data']['bookings_made'] - 1;\n\t\t\t\t$type = \"cancel\";\n\t\t\t\t$reservationType = \"experience\";\n\t\t\t\t$lastOrderId = $reservationID;\n\n\t\t\t\t$dataPost = array('reservation_type'=> $reservationType,\n\t\t\t\t\t'reservationID' => $reservationID,\n\t\t\t\t\t'partySize' => $arrReservationDetails[0]->no_of_persons,\n\t\t\t\t\t'reservationDate'=> $arrReservationDetails[0]->reservation_date,\n\t\t\t\t\t'reservationTime'=> $arrReservationDetails[0]->reservation_time,\n\t\t\t\t\t'guestName'=>$userData['data']['full_name'],\n\t\t\t\t\t'guestEmail'=>$userData['data']['email'],\n\t\t\t\t\t'guestPhoneNo'=>$userData['data']['phone_number'],\n\t\t\t\t\t'order_id'=> \"#E\".sprintf(\"%06d\",$reservationID),\n\t\t\t\t\t'venue' => $outlet->vendor_name,\n\t\t\t\t);\n\n\n\t\t\t} else if($reservationType == \"alacarte\"){\n\n\t\t\t\t$setBookingKey = 'MERGE26';\n\t\t\t\t$setBookingsValue = $userData['data']['a_la_carte_reservation'];\n\n\t\t\t\t$zoho_data = array(\n\t\t\t\t\t'Loyalty_Points_Awarded'=>0,\n\t\t\t\t\t'Order_completed'=>(isset($added_by) && $added_by == 'user' ? 'User Cancelled' : 'Admin Cancelled'),\n\t\t\t\t);\n\t\t\t\t$res_data = $this->zoho_edit_booking('A'.sprintf(\"%06d\",$reservationID),$zoho_data);\n\n\n\t\t\t\t$outlet = $this->alacarte_model->getOutlet($arrReservationDetails[0]->vendor_location_id);\n\n\t\t\t\t$locationDetails = $this->alacarte_model->getLocationDetails($arrReservationDetails[0]->vendor_location_id);\n\n\t\t\t\t$vendorDetails = $this->restaurantLocationsRepository->getByRestaurantLocationId($arrReservationDetails[0]->vendor_location_id);\n\t\t\t\t//echo \"<br/>---- vendorDetails---<pre>\"; print_r($vendorDetails);\n\t\t\t\t//echo \"<br/>---- outlet---<pre>\"; print_r($outlet);\n\n\t\t\t\t$rewardsPoints = $vendorDetails['attributes']['reward_points_per_reservation'];\n\t\t\t\t$bookingsMade = $userData['data']['a_la_carte_reservation'] - 1;\n\t\t\t\t$type = \"cancel\";\n\t\t\t\t$reservationType = \"alacarte\";\n\t\t\t\t$lastOrderId = $reservationID;\n\n\t\t\t\t$dataPost = array('reservation_type'=> $reservationType,\n\t\t\t\t\t'reservationID' => $reservationID,\n\t\t\t\t\t'partySize' => $arrReservationDetails[0]->no_of_persons,\n\t\t\t\t\t'reservationDate'=> $arrReservationDetails[0]->reservation_date,\n\t\t\t\t\t'reservationTime'=> $arrReservationDetails[0]->reservation_time,\n\t\t\t\t\t'guestName'=>$userData['data']['full_name'],\n\t\t\t\t\t'guestEmail'=>$userData['data']['email'],\n\t\t\t\t\t'guestPhoneNo'=>$userData['data']['phone_number'],\n\t\t\t\t\t'order_id'=> \"#A\".sprintf(\"%06d\",$reservationID),\n\t\t\t\t\t'venue' => $outlet->vendor_name,\n\t\t\t\t);\n\n\n\n\t\t\t}\n\n\t\t\tif(!empty($userData)){\n\t\t\t\t\t$merge_vars = array(\n\t\t\t\t\t\t$setBookingKey=>$setBookingsValue - 1,\n\t\t\t\t\t\t'GROUPINGS' => array(array('id' => 9713, 'groups' => [$userData['data']['location']]))\n\t\t\t\t\t);\n\n\t\t\t\t\t//$email = [\"email\"[\"email\":]];\n\t\t\t\t\t$this->mailchimp->lists->subscribe($this->listId, [\"email\"=>$userData['data']['email']],$merge_vars,\"html\",true,true );\n\t\t\t\t\t//$this->mc_api->listSubscribe($list_id, $_POST['email'], $merge_vars,\"html\",true,true );\n\n\t\t\t\t}\n\n\t\t\tProfile::updateReservationInUsers($rewardsPoints,$type,$bookingsMade,$reservationType,$userID,$lastOrderId);\n\n\t\t\tMail::send('site.pages.cancel_reservation',[\n\t\t\t\t'post_data'=>$dataPost,\n\t\t\t], function($message) use ($dataPost){\n\t\t\t\t$message->from('[email protected]', 'WowTables by GourmetItUp');\n\n\t\t\t\t$message->to($dataPost['guestEmail'])->subject('Your WowTables Reservation at '.$dataPost['venue'].' has been cancelled');\n\t\t\t\t//$message->cc('[email protected]', '[email protected]');\n\t\t\t});\n\n\n\t\t\tMail::send('site.pages.cancel_reservation',[\n\t\t\t\t'post_data'=>$dataPost,\n\t\t\t], function($message) use ($dataPost){\n\t\t\t\t$message->from('[email protected]', 'WowTables by GourmetItUp');\n\n\t\t\t\t$message->to('[email protected]')->subject('CR - '.$dataPost['order_id'].' | '.date('d-F-Y',strtotime($dataPost['reservationDate'])).' , '.date('g:i a',strtotime($dataPost['reservationTime'])).' | '.$dataPost['venue'].' | '.$dataPost['guestName']);\n\t\t\t\t$message->cc('[email protected]', '[email protected]','[email protected]','[email protected]');\n\t\t\t});\n\n\n\n\t\t\techo '1';\n\t\t}\n\t}", "private function cliente_xpress_buscar(Request $r){\n //No busca rut porque si es ingresado (es diferente a 999999999), ya lo evalua.\n\n //buscar empresa\n if(strlen($r->empresa)>0){\n $empresa=cliente_modelo::where('empresa',$r->empresa)->first();\n if(!is_null($empresa)){ //hay esa empresa\n return $empresa->id; //devuelve el id del cliente.\n }else{\n return 0;\n }\n\n }\n\n\n //buscar nombres y apellidos\n\n //buscar celular\n\n //buscar email\n\n }", "public function mailRentalPlaceNewReservation(Request $request)\n {\n $now = now();\n $inquiry = $request->query('inquiry') == 1;\n $reservation = new BikeReservation([ \n 'reserved_from' => $now,\n 'reserved_to' => $now->addDay(),\n ]); \n $reservation->id = 1;\n \n $reservation->user = new User([\n 'firstname' => \"Firstname\",\n 'lastname' => \"Lastname\",\n 'email' => \"[email protected]\",\n 'telephone' => '+43234423'\n ]);\n \n $bike = new Bike([\n 'name' => 'Sample Bike', \n ]); \n \n $bike->id = 1;\n $mail = new Mail\\RentalPlaceNewReservation($bike, $reservation, $inquiry);\n \n return $mail;\n }", "public function sendReservationWasCreatedToCustomerByEmail(Reservation $reservation)\n {\n // Customer Reservation Created Notification\n Mail::send(\n 'emails/cart/customer/pending',\n [\n 'user' => $reservation->user,\n 'reservation' => $reservation\n ],\n function ($message) use ($reservation) {\n $message->from('[email protected]', trans('HTR Sales!'));\n $message->to($reservation->user->email, $reservation->user->name)->subject(trans('Reservation is Pending'));\n }\n );\n }", "public function run()\n {\n $reservations = [\n [\n 'user_id' => '1',\n 'room_id' => '1',\n 'num_of_guests' => '4',\n 'arrival' => '2020/5/18',\n 'departure' => '2020/5/28'\n ],\n [\n 'user_id' => '1',\n 'room_id' => '2',\n 'num_of_guests' => '1',\n 'arrival' => '2020/5/10',\n 'departure' => '2020/5/12'\n ],\n [\n 'user_id' => '1',\n 'room_id' => '3',\n 'num_of_guests' => '3',\n 'arrival' => '2020/5/6',\n 'departure' => '2020/5/7'\n ],\n [\n 'user_id' => '1',\n 'room_id' => '4',\n 'num_of_guests' => '2',\n 'arrival' => '2020/5/12',\n 'departure' => '2020/5/15'\n ],\n [\n 'user_id' => '1',\n 'room_id' => '2',\n 'num_of_guests' => '2',\n 'arrival' => '2020/5/20',\n 'departure' => '2020/5/24'\n ]\n ];\n\n foreach($reservations as $reservation) {\n Reservation::create(array(\n 'user_id' => $reservation['user_id'],\n 'room_id' => $reservation['room_id'],\n 'num_of_guests' => $reservation['num_of_guests'],\n 'arrival' => $reservation['arrival'],\n 'departure' => $reservation['departure']\n ));\n }\n }", "function sendReminders($appointmentList)\n\t{\t\t\n\t\t// get appointment details and email address\n\t\tJLoader::register('SalonBookModelAppointments', JPATH_COMPONENT_SITE.DS.'models'.DS.'appointments.php');\n\t\t$appointmentModel = new SalonBookModelAppointments();\n\t\t\n\t\tforeach ($appointmentList as $appointment)\n\t\t{\n\t\t\t$mailingInfo = $appointmentModel->detailsForMail($appointment['id']);\n\t\t\n\t\t\t// clear any old recipients\n\t\t\t$this->email = NULL;\n\t\t\t\n\t\t\t$this->setSuccessMessage($mailingInfo);\n\t\t\n\t\t\t// $this->mailer->addBCC(\"[email protected]\");\n\t\t\t\n\t\t\t$this->sendMail();\n\t\t}\n\t}", "public static function sendEmailReminder()\n {\n /*'text'->Notification.notification_message\n subject-> notification_subject \n\n sender can be from .env or email of currently logged user ....\n to... list from vic, vol, emp\n */\n /*Mail::raw(Input::get('notification_message'), function($message) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to('[email protected]', 'Chanda')->subject(Input::get('notification_subject'));\n });\n */\n\n $activities= Input::get('activity_id');\n //if volunteer = 'Y'\n if (Input::get('to_all_volunteers')=='Y') {\n\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('volunteer_id'); \n $volunteers = Volunteer::where('id', $activitydetails)->get(); \n foreach ($volunteers as $volunteer) {\n Mail::raw(Input::get('notification_message'), function($message) use ($volunteer) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($volunteer->email, $volunteer->last_name.\", \".$volunteer->first_name)->subject(Input::get('notification_subject'));\n });\n } \n }\n\n //if victim = 'Y'\n if (Input::get('to_all_victims')=='Y') {\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('victim_id'); \n $victims = Victim::where('id', $activitydetails)->get(); \n foreach ($victims as $victim) {\n Mail::raw(Input::get('notification_message'), function($message) use ($victim) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($victim->email, $victim->last_name.\", \".$victim->first_name)->subject(Input::get('notification_subject'));\n });\n }\n }\n\n //if employee = 'Y'\n if (Input::get('to_all_employees')=='Y') {\n\n\n $activitydetails = Activitydetail::where('activity_id', $activities)->value('employee_id'); \n $employees = Employee::where('id', $activitydetails)->get(); \n foreach ($employees as $employee) {\n Mail::raw(Input::get('notification_message'), function($message) use ($employee) {\n $message->from('[email protected]', 'NECare System email');\n\n $message->to($employee->email, $employee->last_name.\", \".$employee->first_name)->subject(Input::get('notification_subject'));\n });\n } \n }\n }", "public function reservationRecord()\n\t{\n\t\t$user_array = Session::all();\n\t\t//$userID =Session::get('id');\n\t\t//this code is start in header and footer page.\n $cities = Location::where(['Type' => 'City', 'visible' =>1])->lists('name','id');\n $arrResponse['cities'] = $cities;\n\n $city_id = Input::get('city'); \n $city_name = Location::where(['Type' => 'City', 'id' => $city_id])->pluck('name');\n if(empty($city_name))\n {\n $city_name = 'mumbai';\n }\n\n $arrResponse['allow_guest'] ='Yes'; \n $arrResponse['current_city'] = strtolower($city_name);\n $arrResponse['current_city_id'] = $city_id;\n //this code is start in header and footer page.\n $userID = Session::get('id');\n\t\tif($userID) {\n\t\t\t$arrReservation = ReservationModel::getReservationRecord($userID);\n\t\t}\n\t\telse {\n\t\t\t$arrReservation['status'] = Config::get('constants.API_ERROR');\n\t\t\t$arrReservation['msg'] = 'Not a valid request'; \n\t\t}\n\t\t/*print_r($arrReservation);\n\t\tforeach ($arrReservation['data']['pastReservation'] as $data) {\n\t\t\techo $data['guest_email'];\n\t\t}\n\t\texit;*/\n\t\t//return response()->json($arrResponse,200); \n\t\t//$aLaCarteID = DB::table('vendor_locations')->where('slug',$alaslug)->first()->id; //@kailash\n /*$aLaCarteID \t\t = '97';\n $arrALaCarte \t\t = $this->alacarte_model->getALaCarteDetails($aLaCarteID);\n\t\t$data['reserveData'] = $this->alacarte_model->getAlacarteLimit($aLaCarteID);\n $data['block_dates'] = $this->alacarte_model->getAlacarteBlockDates($aLaCarteID);\n $data['schedule'] = $this->alacarte_model->getAlacarteLocationSchedule($aLaCarteID);*/ \n \t/*print_r($arrReservation);\n \texit;*/\n return view('frontend.pages.myreservation',$arrResponse)\n \t\t\t->with('arrReservation',$arrReservation);\n \t\t\t/*->with('data',$data);*/\n\t}", "public function getBorrowReminder() {\n $dataReminder = DB::table('settings')->where('name', 'dayredm')->select('content')->get()[0];\n $fromDate = new Carbon('now');\n $toDate = Carbon::now()->addDays($dataReminder->content);\n\n $data = Borrow::where('status', '<', '20')->whereBetween( 'ngaydaohan', array($fromDate->toDateTimeString(), $toDate->toDateTimeString()) )->orderBy('ngaydaohan', 'asc')->get();\n if (count($data)) {\n foreach ($data as $record) {\n $userObj = User::where('id', $record->uid)->first();\n emailSend($record, $userObj['email'], 'Email Reminder ' .$userObj['username'], 'REMINDER_1');\n\n // update - neu da send email reminder => cap nhat trang thai cua khoan vay la da reminder lan 1 => status = 20\n Borrow::where('id', $record->id)->update(array('status'=> '20'));\n }\n } else {\n echo 'No data';\n }\n }", "public function show_supervisor_order_detail_for_restaurant_post()\n {\n $response = new StdClass();\n $result = array();\n $admin_id=$this->input->post('admin_id');\n $order_status=$this->input->post('order_status');\n \n $order_detail_for_supervisor = $this->Supervisor->order_detail_for_restaurant_supervisor($admin_id,$order_status);\n\n if(!empty($order_detail_for_supervisor))\n {\n foreach ($order_detail_for_supervisor as $row)\n {\n $data['order_id'] = $row['order_id'];\n $data['admin_id'] = $row['admin_id'];\n $data['cus_id'] = $row['cus_id'];\n $data['table_no'] = $row['table_no'];\n $data['menu_item_name'] = $row['menu_item_name'];\n $data['quantity'] = $row['quantity'];\n $data['half_and_full_status'] = $row['half_and_full_status'];\n $data['menu_price'] = $row['menu_price'];\n $data['total_item'] = $row['total_item'];\n $data['total_price'] = $row['total_price'];\n $data['gst_amount'] = $row['gst_amount'];\n $data['gst_amount_price'] = $row['gst_amount_price'];\n $data['net_pay_amount'] = $row['net_pay_amount'];\n $data['order_status'] = $row['order_status'];\n $data['payment_status'] = $row['payment_status'];\n $data['waiter_mobile_no'] = $row['waiter_mobile_no'];\n $data['customer_mobile_no'] = $row['customer_mobile_no'];\n $data['create_date'] = $row['create_date'];\n $data['message'] = 'Success';\n $data['status'] ='1';\n\n array_push($result,$data);\n\n } \n \n $response->data = $result;\n }\n\n \n else\n {\n $data['message'] = 'failed';\n $data['status'] ='0';\n array_push($result , $data);\n }\n $response->data = $result;\n echo json_output($response);\n }", "public function receptionistList(Request $request)\n {\n $leadId = session()->get('leadId');\n if (!empty($request->input('agent'))) {\n $count = 0;\n foreach ($request->input('agent') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $agents = User::where('isActive', 1)->where(function ($q) {\n $q->where('role', 'EM')->orWhere('role', 'AG');\n })->whereIn('_id', $objectArray)->get();\n } else {\n $agents = '';\n }\n\n if (!empty($request->input('assigned'))) {\n $count = 0;\n foreach ($request->input('assigned') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $assigned_to = User::where('isActive', 1)->where(function ($q) {\n $q->where('role', 'EM')->orWhere('role', 'AG')->orWhere('role', 'CR')->orWhere('role', 'MS')->orWhere('role', 'AD')->orWhere('role', 'CO')->orWhere('role', 'SV');\n })->whereIn('_id', $objectArray)->get();\n } else {\n $assigned_to = '';\n }\n\n if (!empty($request->input('customer'))) {\n $count = 0;\n foreach ($request->input('customer') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $customers = Customer::whereIn('_id', $objectArray)->get();\n $recepients = RecipientDetails::whereIn('_id', $objectArray)->get();\n $customers = $customers->merge($recepients);\n } else {\n $customers = '';\n }\n //\\\t\t$customer_code = [];\n //\t\tforeach ($customers as $customer) {\n //\t\t\t$customer_code[] = $customer->customerCode;\n //\t\t}\n // $recipientsDetails = RecipientDetails::where('status', 0)->get();\n if (!empty($request->input('case_manager'))) {\n $count = 0;\n foreach ($request->input('case_manager') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $case_managers = User::where('isActive', 1)->where(function ($q) {\n $q->where('role', 'EM')->orWhere('role', 'AD')->orWhere('role', 'RP')->orWhere('role', 'AG')->orWhere('role', 'CO')->orWhere('role', 'SV');\n })->whereIn('_id', $objectArray)->get();\n } else {\n $case_managers = '';\n }\n\n if (!empty($request->input('dispatch'))) {\n $count = 0;\n foreach ($request->input('dispatch') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n if (\n session('role') == 'Insurer' || session('role') == 'Employee' || session('role') == 'Supervisor' || session('role') == 'Agent' ||\n session('role') == 'Coordinator' || session('role') == 'Courier' || session('role') == 'Messenger' || session('role') == 'Accountant'\n ) {\n $dispatch_type_check = DispatchTypes::where('type', '!=', 'Direct Collections')->whereIn('_id', $objectArray)->get();\n } else {\n $dispatch_type_check = DispatchTypes::whereIn('_id', $objectArray)->get();\n }\n } else {\n $dispatch_type_check = '';\n }\n if (!empty($request->input('delivery'))) {\n $count = 0;\n foreach ($request->input('delivery') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $delivery_mode_check = DeliveryMode::whereIn('_id', $objectArray)->get();\n } else {\n $delivery_mode_check = '';\n }\n $delivery_mode = DeliveryMode::all();\n if (\n session('role') == 'Insurer' || session('role') == 'Employee' || session('role') == 'Agent' || session('role') == 'Coordinator' ||\n session('role') == 'Supervisor' || session('role') == 'Courier' || session('role') == 'Messenger' || session('role') == 'Accountant'\n ) {\n $dispatch_types = DispatchTypes::where('type', '!=', 'Direct Collections')->get();\n } else {\n $dispatch_types = DispatchTypes::all();\n }\n $document_types = DocumentType::all();\n $filter_data = $request->input();\n $current_path = $request->path();\n if (!empty($request->input('status'))) {\n $count = 0;\n foreach ($request->input('status') as $cust) {\n $objectArray[$count] = $cust;\n $count++;\n }\n $Allstatus = DispatchStatus::whereIn('status', $objectArray)->groupBy('status')->get();\n } else {\n $Allstatus = '';\n }\n if (session()->has('leadId')) {\n return view('dispatch.newreceptionist')\n ->with(compact(\n 'customers',\n 'agents',\n 'case_managers',\n 'delivery_mode',\n 'dispatch_types',\n 'assigned_to',\n 'delivery_mode_check',\n 'dispatch_type_check',\n 'filter_data',\n 'document_types',\n 'leadId',\n 'current_path',\n 'Allstatus'\n ));\n } else {\n return view('dispatch.receptionist_list')\n ->with(compact(\n 'customers',\n 'agents',\n 'case_managers',\n 'delivery_mode',\n 'dispatch_types',\n 'assigned_to',\n 'delivery_mode_check',\n 'dispatch_type_check',\n 'filter_data',\n 'document_types',\n 'leadId',\n 'current_path',\n 'Allstatus'\n ));\n }\n }", "public function run()\n {\n\t\t$reservations = [[\n\t\t\t'valid_from' => Carbon::parse('2019-01-01'),\n\t\t\t'valid_until' => Carbon::parse('2019-03-08'),\n\t\t\t'user_id' => 2,\n\t\t\t'room_id' => 1,\n\t\t],\n\t\t[\n\t\t\t'valid_from' => Carbon::parse('2019-01-04'),\n\t\t\t'valid_until' => Carbon::parse('2019-12-12'),\n\t\t\t'user_id' => 3,\n\t\t\t'room_id' => 2,\n\t\t],\n [\n 'valid_from' => Carbon::parse('2020-01-04'),\n 'valid_until' => Carbon::parse('2021-12-12'),\n 'user_id' => 4,\n 'room_id' => 2,\n ]\n ];\n\t\tforeach ($reservations as $r){\n\t\t Reservation::create($r);\n }\n }", "public function booking_notifications() {\n $data = $this->class->get_all_active_classes();// model for data. \n log_message(\"debug\", \"Found active classes: \".count($data)); \n foreach ($data as $class) { \n log_message(\"debug\", \"Processing class ID: \" . $class->class_id);\n $current_date = date('Y-m-d');\n $freq1_date = NULL;\n $freq2_date = NULL;\n $freq3_date = NULL;\n $managers = NULL;\n if($class->min_reqd_noti_freq1 != 0) {\n $freq1_date = date ( 'Y-m-d', strtotime ( \"-$class->min_reqd_noti_freq1 day\" . $class->class_start_date) );\n } \n if($class->min_reqd_noti_freq2 != 0) {\n $freq2_date = date ( 'Y-m-d', strtotime ( \"-$class->min_reqd_noti_freq2 day\" . $class->class_start_date) );\n }\n if($class->min_reqd_noti_freq3 != 0) {\n $freq3_date = date ( 'Y-m-d', strtotime ( \"-$class->min_reqd_noti_freq3 day\" . $class->class_start_date) );\n }\n if(strtotime($freq1_date) == strtotime($current_date)) {\n $managers = $this->class->get_manager_details($class->crse_manager);\n } else if(strtotime($freq2_date) == strtotime($current_date)) {\n $managers = $this->class->get_manager_details($class->crse_manager);\n } else if(strtotime($freq3_date) == strtotime($current_date)) {\n $managers = $this->class->get_manager_details($class->crse_manager);\n }\n if (!empty($managers)) { \n foreach ($managers as $user) {\n $total_enrol_count = 0;\n $subject = NULL;\n $noti_msg_txt = NULL;\n log_message('debug', ' Sending notification to ' . $user->registered_email_id);\n if (!empty($user->registered_email_id)) {\n $total_enrol_count = $this->class->class_enrol_count($class->course_id, $class->class_id); \n $subject = \"Class booking notifications for '\".$class->class_name.\"'\";\n $noti_msg_txt = \"Dear \".$user->first_name.\" \".$user->last_name.\", <br/><br/>\"\n . \"Total seats booked in the class '\".$class->class_name.\"' as on '\".date('d-m-Y').\"' is: <b>'\".$total_enrol_count.\"'</b>\"; \n $send_result = $this->sendBookingEmail($user->registered_email_id, $noti_msg_txt, $subject);\n if (!$send_result) {\n log_message('error', ' ERROR sending notification to ' . $user->registered_email_id);\n $last_error = $this->email->print_debugger();\n log_message('error', $last_error); \n }\n } else {\n $error = ' User [ID:' . $user->user_id . '] email is empty.';\n log_message('error', $error); \n }\n }\n }\n } \n echo \"OK\";\n }", "public function invite(){\n $this->validate(request(),[\n 'task_id' => 'required',\n 'user_id'=> 'required'\n ]);\n $task=Task::find(request('task_id'));\n\n $user=User::find(request('user_id'));\n if (\\Gate::denies('taskOwner', $task)) {\n return response()->json(\"Task doesn't Belong To you\");\n }\n \\Mail::to($user)->send(new TaskInvitation($user,$task));\n return response()->json(\"Invitation Mail Sent Successfully\");\n }", "static function getRestaurantReservationRevenue($id)\n {\n //lay ra cac san pham trong mot bar reservation\n $product_items =RestaurantTotalReportDB::get_reservation_product($id);\n //System::debug($product_items);\n $total_discount = 0;\n\t\t$total_price = 0;\n $product_for_report = array();\n $product_for_report['product']['original_price'] = 0;\n $product_for_report['product']['real_price'] = 0;\n $product_for_report['is_processed']['real_price'] = 0;\n $product_for_report['is_processed']['original_price'] = 0;\n $product_for_report['service']['real_price'] = 0;\n $product_for_report['service']['original_price'] = 0;\n foreach($product_items as $key=>$value)\n\t\t{\n\t\t\tif($value['is_processed'] == 1 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['is_processed']['original_price'] += $value['original_price'];\n $product_for_report['is_processed']['real_price'] += $ttl-$discnt;\n\t\t\t}\n if($value['is_processed'] == 0 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['product']['original_price'] += $value['original_price'];\n $product_for_report['product']['real_price'] += $ttl-$discnt;\t\n\t\t\t}\n if($value['type'] == 'SERVICE')\n {\n $ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['service']['original_price'] += $value['original_price'];\n $product_for_report['service']['real_price'] += $ttl-$discnt;\t\n }\n\t\t}\n return $product_for_report;\n }", "public function run()\n {\n $reservation1 = new Reservation();\n $reservation1->total_price = 150;\n $reservation1->start_date = '2019-11-14';\n $reservation1->end_date = '2019-11-16';\n $reservation1->user_id = 1;\n $reservation1->room_id = 2;\n $reservation1->save();\n\n $reservation2 = new Reservation();\n $reservation2->total_price = 2071.5;\n $reservation2->start_date = '2019-12-14';\n $reservation2->end_date = '2020-01-20';\n $reservation2->user_id = 1;\n $reservation2->room_id = 1;\n $reservation2->save();\n\n $reservation3 = new Reservation();\n $reservation3->total_price = 13020;\n $reservation3->start_date = '2019-12-19';\n $reservation3->end_date = '2020-01-28';\n $reservation3->user_id = 1;\n $reservation3->room_id = 5;\n $reservation3->save();\n }", "public static function findReservationById($data)\n {\n if($data['method'] == 2){\n $data = self::send('reservas/get_reserva/'.$data['reserva_id'], [],$data['method']);\n $response['res'] = $data['res'];\n $response['msg'] = $data['msg'];\n $response['data'] = [\n 'list' => $data['reserva'],\n ];\n }else{\n $data= self::send('reservas/buscar_reserva_por_id', [\n 'reserva_id' => $data['reserva_id'],\n ],$data['method']);\n $response['res'] = 1;\n $response['msg'] = 'reserva encontrada';\n $response['data'] = [\n 'list' => $data,\n ];\n }\n\n\n return $response;\n\n }", "public function getJoinedReservationById($reservationId)\n {\n // Database query\n $this->db->query('SELECT reservations.id, reservations.status, guests.check_in_date, guests.check_out_date, guests.room_number, guests.id AS guest_id, guests.full_name, guests.address, guests.phone_number, guests.email, guests.notes, invoices.number AS invoice_number, users.first_name AS employee_first_name, users.last_name AS employee_last_name FROM reservations INNER JOIN guests ON reservations.guest = guests.id INNER JOIN invoices ON invoices.guest_id = guests.id INNER JOIN users ON guests.checked_in_by = users.id WHERE reservations.id = :reservation_id');\n // Bind values\n $this->db->bind(':reservation_id', $reservationId);\n // Return records \n $row = $this->db->single();\n\n return $row;\n\n }", "public function store(Request $request)\n {\n $list = Reservation::all();\n \n $this->validate($request,[\n 'petname' => 'required',\n 'petage' => 'required|numeric',\n 'petgender' => 'required',\n 'petbreed' => 'required',\n 'time' => 'required'\n ]);\n $user = (int)Auth::user()->id;\n \n $reserve = Reservation::create([\n 'user_id' => $user,\n 'petname' => $request['petname'],\n 'petage' => $request['petage'],\n 'petgender' => $request['petgender'],\n 'petbreed' => $request['petbreed'],\n 'time' => $request['time'],\n 'date_reserve' => $request['date'],\n 'status_id' => 1,\n 'service' => implode($request['service'],',')\n ]);\n\n/**//* $basic = new Nexmo\\Client\\Credentials\\Basic('9c9350e6', '8Eo5CgibNgBHEs7K');\n $client = new Nexmo\\Client($basic);\n$reserve = $client->message()->send([\n 'to' => '639472195796',\n 'from' => 'Pet Centre Animal Clinic',\n 'text' => 'New Reservation'\n]);*/\n$name = Auth::user()->name;\n Nexmo::message()->send([\n 'to' => '639458204862',\n 'from' => '639472195796',\n 'text' => $name.' add a reservation'\n ]); \n return $reserve;\n\n \n\n\n }", "public function reservations()\n {\n return $this->hasMany(Reservation::class);\n }", "public function sent(){\n\n $reservations = Reservation::where('user_id',Auth::user()->id)\n ->where('status', NULL)->get();\n $accepted_reservations = Reservation::where('user_id',Auth::user()->id)\n ->where('status',1)->get();\n $confirmable_reservations = Reservation::where('user_id',Auth::user()->id)\n ->where('status',2)->get();\n $rejected_reservations = Reservation::where('user_id',Auth::user()->id)\n ->where('status',0)->get();\n $paymentAddress = PaymentAddress::get();\n $settings = Settings::first();\n\n return view('reservation.sent')\n ->with('reservations',$reservations)\n ->with('accepted_reservations',$accepted_reservations)\n ->with('confirmable_reservations',$confirmable_reservations)\n ->with('rejected_reservations',$rejected_reservations)\n ->with('paymentAddress',$paymentAddress)\n ->with('settings',$settings);\n }", "public function index($recepcion)\n {\n // -------------------------\n $id_user=session('user')->id;\n // -----------------------------------------\n $delivery = DB::SELECT(\"SELECT * FROM deliveriers\n WHERE id_user = $id_user and state_delete = 0 \");\n\n // ---------------------------------\n $nproceso = count(DB::SELECT(\"SELECT pending FROM receptions\n WHERE state = 1 and id_user = $id_user\"));\n $nrealizado = count(DB::SELECT(\"SELECT pending FROM receptions\n WHERE state = 2 and id_user = $id_user\"));\n $nanulado = count(DB::SELECT(\"SELECT pending FROM receptions\n WHERE state = 3 and id_user = $id_user\"));\n\n if (! \\Session::get('valor2')) {\n $task2 = (object)array(\n 'proceso'=>$nproceso,\n 'realizado'=>$nrealizado,\n 'anulado'=>$nanulado\n );\n \\Session::push('valor2',$task2);\n }else {\n $task3 = \\Session::get('valor2');\n // dd($task3);\n $task3[0]->proceso = $nproceso;\n $task3[0]->realizado = $nrealizado;\n $task3[0]->anulado = $nanulado;\n \\Session::put('valor2',$task3);\n }\n\n if ($recepcion == 'proceso') {\n // ----------------------------------------------\n\n $recepciones = DB::SELECT(\"SELECT pending FROM receptions\n WHERE state = 1 and id_user = $id_user\");\n // return $recepciones;\n\n $i=1;\n if ($recepciones == null) {\n $reception=[];\n }\n foreach ($recepciones as $recepcion) {\n $reception[$i] = DB::SELECT(\"SELECT r.id as id, rd.orders_id, c.name as nombre,rd.total,c.email,r.pending, c.phone,c.last_name,d.name, rd.quantity, r.coupon, r.date_reception, r.customer_id,r.deliverier_id,at.name as at_name, va.name as va_name, r.state_delivery\n FROM receptions r\n INNER JOIN reception_details rd on rd.order_detail = r.pending\n INNER JOIN costumers c on c.id=r.customer_id\n INNER JOIN products d on d.id = rd.dish_id\n LEFT JOIN attributes at on at.id = rd.id_attribute\n LEFT JOIN variations va on va.id = rd.id_variation\n WHERE r.pending = $recepcion->pending and r.id_user = $id_user and rd.id_user_detail=$id_user\");\n $i = $i + 1 ;\n } \n // dd($reception);\n return view('backend.reception.indexProcess')->with(compact('reception', 'id_user'))->with(compact('delivery'));\n // --------------------------------------------------------\n } else {\n if ($recepcion == 'realizado') {\n // ----------------------------------------------\n $recepciones = DB::SELECT(\"SELECT pending FROM receptions\n WHERE state = 2 and id_user = $id_user ORDER BY date_reception DESC\");\n $i=1;\n if ($recepciones == null) {\n $reception=[];\n }\n foreach ($recepciones as $recepcion) {\n $reception[$i] = DB::SELECT(\"SELECT c.name as nombre, r.pending,rd.total, c.email, c.phone,c.last_name,d.name, rd.quantity, r.coupon, r.date_reception, r.customer_id,r.deliverier_id,at.name as at_name, va.name as va_name, r.state_delivery\n FROM receptions r\n INNER JOIN reception_details rd on rd.order_detail = r.pending\n INNER JOIN costumers c on c.id=r.customer_id\n INNER JOIN products d on d.id = rd.dish_id\n LEFT JOIN attributes at on at.id = rd.id_attribute\n LEFT JOIN variations va on va.id = rd.id_variation\n WHERE r.pending = $recepcion->pending and r.id_user = $id_user and rd.id_user_detail=$id_user\");\n $i = $i + 1 ;\n }\n // dd($reception);\n return view('backend.reception.indexAccomplished')->with(compact('reception', 'id_user'))->with(compact('delivery'));\n // --------------------------------------------------------\n } else {\n if ($recepcion == 'anulado') {\n // ----------------------------------------------\n $recepciones = DB::SELECT(\"SELECT pending FROM receptions\n WHERE state = 3 and id_user = $id_user ORDER BY date_reception DESC\");\n $i=1;\n if ($recepciones == null) {\n $reception=[];\n }\n foreach ($recepciones as $recepcion) {\n $reception[$i] = DB::SELECT(\"SELECT c.name as nombre,r.pending,rd.total, c.email, c.phone,c.last_name,d.name, rd.quantity, r.coupon, r.date_reception, r.customer_id,r.deliverier_id,at.name as at_name, va.name as va_name, r.state_delivery\n FROM receptions r\n INNER JOIN reception_details rd on rd.order_detail = r.pending\n INNER JOIN costumers c on c.id=r.customer_id\n INNER JOIN products d on d.id = rd.dish_id\n LEFT JOIN attributes at on at.id = rd.id_attribute\n LEFT JOIN variations va on va.id = rd.id_variation\n WHERE r.pending = $recepcion->pending and r.id_user = $id_user and rd.id_user_detail=$id_user\");\n $i = $i + 1 ;\n }\n return view('backend.reception.indexCanceled')->with(compact('reception', 'id_user'))->with(compact('delivery'));\n // --------------------------------------------------------\n }\n }\n\n }\n }", "public function traerEmpleados($id)\n {\n if ($id == Auth()->user()->cz1_id_empleado || Gate::allows('isAdmin') ||\n Gate::allows('isRRHH') || Gate::allows('isSST')) {\n\n $estado = 1;\n $contratoV = Contrato::find($id)->where('c0550_ind_estado', 2)->first();\n\n $contratoA = Contrato::where('c0550_rowid_tercero', $id)->where('c0550_ind_estado', 1)->first();\n if (empty($contratoA)) {\n $estado = 2;\n };\n\n $id_depto = Empleados::select(\"c0540_id_depto_exp_identif\")\n ->where(\"c0540_rowid_tercero\", $id)->first();\n\n // return Paises::with('departamentos')->get();\n $user = Terceros_mm::select(\n \"dbo.t015_mm_contactos.f015_contacto\",\n \"dbo.t015_mm_contactos.f015_direccion1\",\n \"dbo.t015_mm_contactos.f015_id_barrio\",\n \"dbo.t015_mm_contactos.f015_telefono\",\n \"dbo.t015_mm_contactos.f015_email\",\n \"dbo.t015_mm_contactos.f015_celular\",\n \"dbo.t015_mm_contactos.f015_id_pais\",\n \"dbo.t015_mm_contactos.f015_id_depto\",\n \"dbo.t015_mm_contactos.f015_id_ciudad\",\n \"dbo.t015_mm_contactos.f015_id_barrio\",\n \"f200_apellido2\",\n \"f200_apellido1\",\n \"f200_nombres\",\n 'dbo.w0540_empleados.c0540_rowid_tercero',\n \"c0540_fecha_exp_identif\",\n \"c0540_ind_sexo\",\n \"c0763_descripcion\",\n \"c0550_fecha_ingreso\",\n \"c0550_fecha_contrato_hasta\",\n \"c0550_rowid_centros_trabajo\",\n \"c0515_id\",\n \"c0516_id\",\n \"c0517_id\",\n \"f284_descripcion\",\n \n \"c0504_descripcion\",\n \"f011_descripcion\",\n \"f012_descripcion\",\n \"f013_descripcion\",\n 'f200_id',\n 'c0550_rowid',\n 'c0550_salario',\n \"c0540_id_ciudad_nacimiento\",\n \"c0540_id_ciudad_exp_identif\",\n \"c0540_id_depto_exp_identif\",\n \"c0540_id_pais_exp_identif\",\n \"f285_descripcion\",\n \"c0540_fecha_nacimiento\",\n \"c0550_ind_termino_contrato\"\n\n )->join(\n 'dbo.t200_mm_terceros',\n 'dbo.t015_mm_contactos.f015_rowid',\n '=',\n 'dbo.t200_mm_terceros.f200_rowid_contacto'\n\n )->join(\n 'dbo.w0540_empleados',\n 'dbo.t200_mm_terceros.f200_rowid',\n '=',\n 'dbo.w0540_empleados.c0540_rowid_tercero'\n\n )->join(\n 'dbo.w0550_contratos',\n 'dbo.w0540_empleados.c0540_rowid_tercero',\n '=',\n 'dbo.w0550_contratos.c0550_rowid_tercero'\n\n )->join(\n 'dbo.w0763_gh01_cargos',\n 'dbo.w0763_gh01_cargos.c0763_rowid',\n '=',\n 'dbo.w0550_contratos.c0550_rowid_cargo'\n )->join(\n 'dbo.w0515_entidades_eps',\n 'dbo.w0550_contratos.c0550_rowid_entidad_eps',\n '=',\n 'dbo.w0515_entidades_eps.c0515_rowid'\n\n )->join(\n 'dbo.t285_co_centro_op',\n 'dbo.w0550_contratos.c0550_id_co',\n '=',\n 'dbo.t285_co_centro_op.f285_id'\n\n )->join(\n 'dbo.w0516_entidades_afp',\n 'dbo.w0550_contratos.c0550_rowid_entidad_pension',\n '=',\n 'dbo.w0516_entidades_afp.c0516_rowid'\n\n )->join(\n 'dbo.w0517_entidades_arp',\n 'dbo.w0550_contratos.c0550_rowid_entidad_arp',\n '=',\n 'dbo.w0517_entidades_arp.c0517_rowid'\n\n )->join(\n 'dbo.t284_co_ccosto',\n 'dbo.w0550_contratos.c0550_rowid_ccosto',\n '=',\n 'dbo.t284_co_ccosto.f284_rowid'\n\n )->join(\n 'dbo.w0504_tipos_nomina',\n 'dbo.w0550_contratos.c0550_rowid_tipo_nomina',\n '=',\n 'dbo.w0504_tipos_nomina.c0504_rowid'\n )\n ->join(\n 'dbo.t013_mm_ciudades',\n 'dbo.w0540_empleados.c0540_id_ciudad_exp_identif',\n '=',\n 'dbo.t013_mm_ciudades.f013_id'\n )\n ->join(\n 'dbo.t012_mm_deptos',\n 'dbo.w0540_empleados.c0540_id_depto_exp_identif',\n '=',\n 'dbo.t012_mm_deptos.f012_id'\n )\n ->join(\n 'dbo.t011_mm_paises',\n 'dbo.w0540_empleados.c0540_id_pais_exp_identif',\n '=',\n 'dbo.t011_mm_paises.f011_id'\n )\n\n ->where('c0550_ind_estado', $estado)\n ->where('f200_rowid', $id)\n ->where('f013_id_depto', $id_depto->c0540_id_depto_exp_identif)\n ->get();\n\n $results = $user->last();\n\n return $results;\n\n }else{\n return redirect('/accces-denied'); \n } \n }", "public function makeReservation(Request $request)\n {\n // See your keys here: https://dashboard.stripe.com/account/apikeys\n \\Stripe\\Stripe::setApiKey('sk_test_Svkur5SOXoYBHI4AByFEurNz00T7blpWFe');\n\n // Token is created using Checkout or Elements!\n // Get the payment token ID submitted by the form:\n $token = $request['stripeToken'];\n $charge = \\Stripe\\Charge::create([\n 'amount' => $request['price'] * 90,\n 'currency' => 'mxn',\n 'description' => 'Reservation',\n 'source' => $token,\n ]);\n\n $category = Category::find($request['category_id']);\n\n $reservation = Reservation::create([\n 'name' => $request['name'],\n 'category_id' => $request['category_id'],\n 'init_place' => $request['location_start'],\n 'final_place' => $request['location_end'],\n 'init_date' => $request['start'],\n 'final_date' => $request['end'],\n 'price' => $request['price'],\n 'is_paid'=> 1,\n ]);\n\n $extras = [];\n if(isset($request['extras']))\n {\n foreach ($request['extras'] as $extra_temp)\n {\n $reservation->extras()->attach([$extra_temp]);\n $extra = Extra::find($extra_temp);\n array_push ($extras ,$extra);\n }\n }\n ini_set( 'display_errors', 1 );\n error_reporting( E_ALL );\n $from = \"[email protected]\";\n $to = \"[email protected]\";//$request['email'];\n $subject = \"Reservation\";\n $message = \"You have paid your reservation\";\n // $headers = \"From:\" . $from;\n if (mail($to,$subject,$message))\n {\n echo \"The email message was sent to \".$to;\n }\n $location_start = Location::find($request['location_start']);\n $location_end = Location::find($request['location_end']);\n return view('Reservation.makeReservation')->with('category',$category)->with(\n 'location_start',$location_start)->with(\n 'location_end',$location_end)->with(\n 'start',$request['start'])->with(\n 'end',$request['end'])->with(\n 'reservation',$reservation)->with(\n 'name',$request['name'])->with(\n 'price',$request['price'])->with(\n 'extras',$extras);\n\n }", "public function mailUserNewReservation(Request $request)\n {\n $now = now(); \n $reservation = new BikeReservation([\n 'reserved_from' => $now,\n 'reserved_to' => $now->addDay(),\n ]);\n $reservation->id = 2; \n \n $bike = new Bike([\n 'name' => 'Sample Bike',\n ]);\n \n $bike->id = 1;\n $mail = new Mail\\UserNewReservation($bike, $reservation);\n \n return $mail;\n }", "public function show($id){\n $getR = Reservation::query()->orderby('id', 'DESC')->where('restaurant_id', $id)->get();\n return view('admin/manage-reservation', compact('getR'));\n }", "public function getReservation($id_locataire) {\n\n \t$reservation = Reservation::where('id_locataire', $id_locataire)->get();\n\n return $reservation;\n }", "public static function remindAssignedUser() {\n $unrespondedToTickets = Self::getUnrespondedToTickets(15);\n\n if($unrespondedToTickets->count() > 0) {\n foreach($unrespondedToTickets as $ticket) {\n $vendor = $ticket->assignedTo;\n\n $message = \"<p>Hello {$vendor->name}.<br/> You are yet to respond to the ticket ID <a href='{{ route('tickets.vendor.show', ['ticket_id'=> $ticket->ticket_id]) }}''>#{{$ticket->ticket_id}}</p>. <p>If further delayed, your unit head would be notified of your delayed response to this ticket. <br/><br/>Thank you</p>\";\n $title = \"Ticket #{$ticket->ticket_id} is yet to receive a response\";\n send_email($vendor->name, $vendor->email, $message, route('tickets.vendor.show', ['ticket_id'=> $ticket->ticket_id]), $title);\n\n }\n }\n }", "public function get_reservation_per_teacher($res_teach_code=NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t $res_room_code=NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t $tm_row=NULL,\n\t\t\t\t\t\t\t\t\t\t\t\t $res_todate)\n\t\t{\n \t\t\t$where = \" and DATE_FORMAT(res_time_start,'%Y-%m-%d') = '\". date(\"Y-m-d\").\"'\";\n\t\t if(!empty($res_todate))\n\t\t\t $where = \" and DATE_FORMAT(res_time_start,'%Y-%m-%d') = '\".date('Y-m-d',strtotime($res_todate)).\"'\";\n\t\t \n\t\t\t\n\t \n \t\t\t$reservs = $this->db->query(\"select Distinct res_teach_code, res_admin_note from \n\t\t\t\t\t\t\t\t\t\t reservations \n \t\t\t where res_teach_code = \".$res_teach_code.\"\n\t\t\t\t\t\t\t and res_room_code = \".$res_room_code.\"\n\t\t\t\t\t\t\t and DATE_FORMAT(res_time_start, '%H:%i') <= '\".$tm_row.\"'\n\t\t\t\t\t\t\t and DATE_FORMAT(res_time_end, '%H:%i') >= '\".$tm_row.\"' \".\n\t\t\t\t\t\t $where .\n \t\t\t\t\t\t\t \" order by res_code desc \")->result();\n \t\t\t //\t \n\t \n\t\t\treturn $reservs;\n\t\t}", "public function getBorrowReminderLost() {\n $dataReminder = DB::table('settings')->where('name', 'daylost')->select('content')->get()[0];\n $fromDate = new Carbon('now');\n\n\n $data = Borrow::where('status', '=', '20')->where( 'ngaydaohan', '<=', $fromDate->toDateTimeString())->orderBy('ngaydaohan', 'asc')->get();\n if (count($data)) {\n foreach ($data as $record) {\n $toDate = Carbon::parse($record['ngaydaohan'])->addDays($dataReminder->content);\n $dataAdd['dateLost'] = $toDate->toDateTimeString();\n $userObj = User::where('id', $record->uid)->first();\n\n emailSend($record, $userObj['email'], 'Email Reminder ' .$userObj['username'] .' - '.$toDate->toDateTimeString(), 'REMINDER_LOST', $dataAdd);\n\n // update - neu da send email reminder => cap nhat trang thai cua khoan vay la da reminder lan 1 => status = 20\n Borrow::where('id', $record->id)->update(array('status'=> '30'));\n }\n } else {\n echo 'No data';\n }\n }", "public function run(Faker $faker)\n {\n $users = User::all();\n $users_arr = $users->toArray();\n $users = Count($users_arr);\n\n\n for ($i = 0; $i < $users; $i++){\n // for($j = 0; $j < $userCount; $j++ ){\n // $newRestaurant->user_id = $userCount[$j];\n // }\n\n $newRestaurant = new Restaurant ();\n $newRestaurant->nome = $faker->word();\n $nomeBeginner = $newRestaurant->nome;\n\n $nomePresente = Restaurant::where('nome',$nomeBeginner)->first();\n $cont = 1;\n while($nomePresente){\n $nomeBeginner = $nomeBeginner.'-'.$cont;\n $nomeBeginner = Restaurant::where('nome',$nomeBeginner)->first();\n $cont++;\n }\n $newRestaurant->nome = $nomeBeginner;\n\n $newRestaurant->indirizzo = $faker->streetAddress();\n $newRestaurant->immagine = \"'ristorante_storage\\fast-food-2029397_960_720.png'\";\n\n \n // $newRestaurant->immagine = Storage::put('ristorante_storage', $newRestaurant->immagine);\n\n $newRestaurant->slug = Str::slug($newRestaurant->nome);\n $newRestaurant->user_id = $i + 1;\n $existRestaurant = Restaurant::where('user_id',$newRestaurant->user_id)->first();\n if (!$existRestaurant) {\n $newRestaurant->save();\n\n }\n\n\n }\n }", "public function agenda_reminder($id,$team_id= null){\n\t\t$from = date('H:i:s',strtotime ( '-70 min' , strtotime (date('H:i:s')) ));\n\t \t$to = date('H:i:s');\n\n\t $agendas = AgendaMast::whereBetween('required_at',array($from,$to))\n\t ->where('days_active','like','%'.date('N').'%')\n\t ->get(); \n\n\t foreach($agendas as $agenda){\n\t \t$users = User::whereIn('id', json_decode($agenda->permissions)->can_respond)->get();\n\t\t $team = null;\n\t\t Notification::send($users, new SendAgendaMessage($agenda,$team));\n\t }\n\t }", "public function all() {\n $parser = new XmlParser();\n $restaurants = $parser->getRestaurantList(50);\n foreach ($restaurants as $restaurant) {\n $restaurant_eloquent = Restaurant::firstOrNew(['url' => $restaurant[\"value\"]]);\n if (!$restaurant_eloquent->exists) {\n $restaurant_eloquent->description = \"\";\n $restaurant_eloquent->name = $this->getTempName($restaurant_eloquent);\n $restaurant_eloquent->save();\n }\n $this->dispatch(new ScrapeRestaurantInfo($restaurant_eloquent));\n }\n\n return Restaurant::all()->keyBy('id');\n }", "public function email($approverid,$days)\n {\n Configure::write('debug',0);\n $approvermail = $this->Common->staff_name($approverid);\n $usernname = $this->Session->read('USERNAME');\n $emailcontent=\"A leave request applied by '\".ucfirst($usernname).\"' for '\".$days.\"'\";\n $to = \"[email protected]\"; \n $email = new CakeEmail('myConfig');\n $email->template('invoice', false);\n $email->emailFormat('html');\n $email->to($to);\n $email->from('[email protected]');\n $email->subject('Leave Apply');\n $email->viewVars(\n array\n (\n 'product'=>$orderproduct\n ));\n $email->send();\n \n\n $to = array('[email protected]','[email protected]');\n foreach($to as $emailto)\n { \n $email = new CakeEmail('smtp');\n $email->template('invoice_admin', false);\n $email->emailFormat('html');\n $email->to($emailto);\n $email->from('[email protected]');\n $email->subject('Payment Detail');\n $email->viewVars(\n array\n (\n 'product'=>$orderproduct\n ));\n $email->send();\n\n } \n }", "public function path()\n {\n return \"/reservation/{$this->id}\";\n }", "public function get_confirmable_reserv_with_user_id($user_id){\n $reservations = Reservation::where('status',2)\n ->where('user_id',$user_id)\n ->get();\n return reservationResource::collection($reservations);\n }", "public function enter_restaurant($area_id, $restaurant_id) {\n\t\t\t$this->db->select('*');\n\t\t\t$this->db->from('building_restaurants');\n\t\t\t$this->db->join('area_owners', 'area_owners.ao_area_id=building_restaurants.br_area_id');\n\t\t\t$this->db->join('accounts', 'accounts.user_id=area_owners.ao_owner_id');\n\t\t\t$this->db->where('building_restaurants.br_area_id', $area_id);\n\t\t\t$q_ba = $this->db->get();\n\t\t\t\t\n\t\t\tif($q_ba->num_rows() > 0) { // If there is, do smth\n\t\t\t\t$row_ao = $q_ba->row_array();\n\t\t\t\t\t\n\t\t\t\t/* GETS THE DISHES */\n\t\t\t\t$q_dishes = $this->db->get_where('build_restaurant_dishes', array('brd_area_id'=>$area_id));\n\t\t\t\t$dishes = array();\n\t\t\t\tforeach($q_dishes->result_array() AS $row) {\n\t\t\t\t\t$dishes[] = $row;\n\t\t\t\t}\n\t\t\t\t$row_ao['dishes'] = $dishes;\n\t\t\t\t/* END OF GETTING DISHES */\n\t\t\t\treturn $row_ao;\n\t\t\t} else {\n\t\t\t\texit();\n\t\t\t}\n\t\t}", "public function invoiceAddress() {\r\n $result = $this->clients->flatInvoice();\r\n foreach ($result as $key => $value) {\r\n $getAdress = $this->clients->companyAddress($value->CustomerCompanyID);\r\n $data = array('Params' => $getAdress[0]->Params);\r\n $response = $this->clients->invoiceAdressupdate($value->InvoiceID, $data);\r\n echo $response . \"<br/>\";\r\n }\r\n }", "function getHotelsPerTripOrganizer(Request $request)\n {\n $oUser=Auth::user();\n if ($oUser->role=='admin'){\n\n $aActiveTrips = Trip::where('is_active', true)->get();\n\n $aHotels = Hotel::get();\n\n if ($request->post('selectedActiveTrip') == null) {\n $iTripId = Trip::where('is_active', true)->first();\n } else {\n $iTripId = Trip::where('trip_id', $request->post('selectedActiveTrip'))->select('trip_id')->first();\n }\n $aHotelsid = HotelsPerTrip::whereIn('trip_id', $iTripId)->select('hotel_id')->get();\n\n $aHotelsPerTrip = HotelsPerTrip::whereIn('hotels.hotel_id', $aHotelsid)\n ->where('trip_id', $iTripId->trip_id)\n ->join('hotels', 'hotels_per_trips.hotel_id', '=', 'hotels.hotel_id')\n ->orderBy('hotel_start_date', 'asc')\n ->get();\n\n return view('organiser.HotelsAndRooms.hotels',\n [\n 'aHotelsPerTrip' => $aHotelsPerTrip,\n 'aHotels' => $aHotels,\n 'aActiveTrips' => $aActiveTrips,\n 'iTripId' => $iTripId\n ]);\n }\n else {\n foreach ($oUser->traveller->travellersPerTrip as $travellersPerTrip) {\n $is_organizer = $travellersPerTrip->is_organizer;\n if ($is_organizer) {\n $travellerId = $oUser->traveller->traveller_id;\n $aIsOrganizerOfTrip = TravellersPerTrip::where('traveller_id', $travellerId)->where('is_organizer', true)->select('trip_id')->get();\n\n if ($request->post('selectedActiveTrip') == null) {\n $iTripId = Trip::where('is_active', true)->whereIn('trip_id', $aIsOrganizerOfTrip)->first();\n } else {\n $iTripId = Trip::where('trip_id', $request->post('selectedActiveTrip'))->select('trip_id')->first();\n }\n $aHotelsid = HotelsPerTrip::whereIn('trip_id', $iTripId)->select('hotel_id')->get();\n\n $aHotelsPerTrip = HotelsPerTrip::whereIn('hotels.hotel_id', $aHotelsid)\n ->where('trip_id', $iTripId->trip_id)\n ->join('hotels', 'hotels_per_trips.hotel_id', '=', 'hotels.hotel_id')\n ->orderBy('hotel_start_date', 'asc')\n ->get();\n\n\n $aActiveTrips = Trip::where('is_active', true)->whereIn('trip_id', $aIsOrganizerOfTrip)->get();\n\n $aHotels = Hotel::get();\n\n return view('organiser.HotelsAndRooms.hotels',\n [\n 'aHotelsPerTrip' => $aHotelsPerTrip,\n 'aHotels' => $aHotels,\n 'aActiveTrips' => $aActiveTrips,\n 'iTripId' => $iTripId\n ]);\n }\n }\n return $this->getHotelsPerTripUser();\n }\n }", "public function valide(Reservation $reservation)\n {\n\n $reservation->update([\n 'status' => 'accepted',\n ]);\n\n\n $mail = new ReservationInfoMail($reservation, route('dashboard'));\n\n Mail::to($reservation->user->email)->send($mail);\n\n return back();\n }", "function chooseRoom(Request $request){\n $oUser = Auth::user();\n if($oUser->role=='admin'){\n return redirect()->back()->with('errormessage', 'U kunt geen kamer kiezen als administrator');;\n }\n else{\n $userTravellerId=$oUser->traveller->traveller_id;\n $chosenTravellers=RoomsPerHotelPerTrip::join('travellers_per_rooms','rooms_per_hotel_per_trips.rooms_hotel_trip_id','=','travellers_per_rooms.rooms_hotel_trip_id')\n ->where('hotels_per_trip_id',$request->post('hotels_per_trip_id'))\n ->select(\"traveller_id\")\n ->get();\n foreach ($chosenTravellers as $traveller) {\n if ($traveller->traveller_id == $userTravellerId) {\n return redirect()->back()->with('errormessage', 'U heeft al een kamer gekozen in dit hotel');\n }\n }\n $oTravellerPerRoom=new TravellersPerRoom();\n $oTravellerPerRoom->rooms_hotel_trip_id=$request->post('rooms_hotel_trip_id');\n $oTravellerPerRoom->traveller_id=$userTravellerId;\n $oTravellerPerRoom->save();\n return redirect()->back();\n }\n }", "public function acceptPendingRequest($id,$payment_id) {\n $reservations = Reservation::find($id);\n $reservations->status = \"Accepted\";\n $reservations->save();\n\n $customer_token = CustomersToken::where(['customer_id' => $reservations->customer_id])->first();\n\n if(!empty($customer_token)) {\n $pm = new PushMessage();\n $fcm = new FirebaseMessage();\n\n $pm->setTitle(\"Your reservation has been accepted!\");\n $pm->setMessage(\"Reservation schedule : Date:\".$reservations->reservation_date.\", Time: \".$reservations->reservation_time.\" \");\n $pm->setId($reservations->id);\n $pm->setImage(\"\");\n $pm->setIntent(\"Reservation\");\n\n $jsonMessage = $pm->getPushMessage();\n $response = $fcm->send($customer_token->token_id,$jsonMessage);\n\n }\n // Payment::find($id)->delete();\n $notification = new NotificationCustomer;\n $notification->customer_id = $reservations->customer_id;\n $notification->notificationable_id = $id;\n $notification->notificationable_type = \"App\\Reservation\";\n $notification->save();\n\n Payment::where('id',$payment_id)->update(['is_valid'=>'Valid']);\n\n return redirect('/admin/range-rental/pending/list')->with('flash_message_success','Reservation successfully updated!');\n\n }", "public function senderIdManagement()\n {\n\n $all_sender_id = SenderIdManage::where('status', 'unblock')->orWhere('status', 'Pending')->get();\n $all_ids = [];\n\n foreach ($all_sender_id as $sid) {\n $client_array = json_decode($sid->cl_id);\n\n if (isset($client_array) && is_array($client_array) && in_array('0', $client_array)) {\n array_push($all_ids, $sid->id);\n } elseif (isset($client_array) && is_array($client_array) && in_array(Auth::guard('client')->user()->id, $client_array)) {\n array_push($all_ids, $sid->id);\n }\n }\n $sender_ids = array_unique($all_ids);\n\n $sender_id = SenderIdManage::whereIn('id', $sender_ids)->get();\n\n return view('client.sender-id-management', compact('sender_id'));\n }", "public function restaurant_save_assignments($restaurant_id = '', $publisher_id = '') {\n\t global $foodbakery_plugin_options;\n\t $response = array('status' => false, 'msg' => esc_html__('An error occurred. Try again later.', 'foodbakery'));\n\t $get_restaurant_id = foodbakery_get_input('restaurant_id', 0);\n\t $is_updating = false;\n\t if ($get_restaurant_id != '' && $get_restaurant_id != 0 && $this->is_publisher_restaurant($get_restaurant_id)) {\n\t\t$is_updating = true;\n\t }\n\t $foodbakery_free_restaurants_switch = isset($foodbakery_plugin_options['foodbakery_free_restaurants_switch']) ? $foodbakery_plugin_options['foodbakery_free_restaurants_switch'] : '';\n\t $foodbakery_restaurant_default_expiry = isset($foodbakery_plugin_options['foodbakery_restaurant_default_expiry']) ? $foodbakery_plugin_options['foodbakery_restaurant_default_expiry'] : '';\n\t if ($foodbakery_free_restaurants_switch == 'on') {\n\t\t// Free Posting without any Membership\n\t\tif (!$is_updating) {\n\t\t if ($foodbakery_restaurant_default_expiry == '') {\n\n\t\t\t$foodbakery_trans_restaurant_expiry = current_time('Y-m-d H:i:s');\n\t\t } else {\n\n\t\t\t$foodbakery_trans_restaurant_expiry = $this->date_conv($foodbakery_restaurant_default_expiry, 'days');\n\t\t }\n\n\t\t // Assign expire date\n\t\t update_post_meta($restaurant_id, 'foodbakery_restaurant_expired', strtotime($foodbakery_trans_restaurant_expiry));\n\n\t\t // Add restaurant type in free posting\n\t\t update_post_meta($restaurant_id, 'foodbakery_restaurant_type', 'restaurant-settings');\n\n\t\t // Assign without package true\n\t\t update_post_meta($restaurant_id, 'foodbakery_restaurant_without_package', '1');\n\n\t\t // Assign Status of restaurant\n\t\t $this->restaurant_update_status($restaurant_id);\n\t\t //do_action( 'foodbakery_restaurant_add_assign_status', $restaurant_id );\n\t\t}\n\t\t$response['status'] = true;\n\t\t$response['msg'] = esc_html__('Restaurant added successfully and packages processed', 'foodbakery');\n\t } else {\n\t\t$new_pkg_check = foodbakery_get_input('foodbakery_restaurant_new_package_used', '');\n\t\tif ($new_pkg_check == 'on') {\n\n\t\t $package_id = foodbakery_get_input('foodbakery_restaurant_package', 0);\n\t\t if ($this->is_package($package_id)) {\n\t\t\tif ($is_updating) {\n\t\t\t // package subscribe\n\t\t\t // add transaction\n\t\t\t $transaction_detail = $this->foodbakery_restaurant_add_transaction('update-restaurant', $restaurant_id, $package_id, $publisher_id);\n\t\t\t echo force_balance_tags($transaction_detail);\n\t\t\t} else {\n\t\t\t // package subscribe\n\t\t\t // add transaction\n\t\t\t $transaction_detail = $this->foodbakery_restaurant_add_transaction('add-restaurant', $restaurant_id, $package_id, $publisher_id);\n\t\t\t echo force_balance_tags($transaction_detail);\n\t\t\t}\n\t\t }\n\n\t\t // end of using new package\n\t\t} else {\n\n\t\t $active_package_key = foodbakery_get_input('foodbakery_restaurant_active_package', 0);\n\t\t $active_package_key = explode('pt_', $active_package_key);\n\t\t $active_pckg_id = isset($active_package_key[0]) ? $active_package_key[0] : '';\n\t\t $active_pckg_trans_id = isset($active_package_key[1]) ? $active_package_key[1] : '';\n\t\t if ($this->is_package($active_pckg_id)) {\n\t\t\t$t_package_feature_list = get_post_meta($active_pckg_trans_id, 'foodbakery_transaction_restaurant_feature_list', true);\n\t\t\t$t_package_top_cat_list = get_post_meta($active_pckg_trans_id, 'foodbakery_transaction_restaurant_top_cat_list', true);\n\n\t\t\tif ($is_updating) {\n\t\t\t $foodbakery_package_id = get_post_meta($restaurant_id, 'foodbakery_restaurant_package', true);\n\t\t\t $foodbakery_trans_id = $this->restaurant_trans_id($restaurant_id);\n\t\t\t // update-restaurant\n\t\t\t $is_pkg_subs = $this->foodbakery_is_pkg_subscribed($active_pckg_id, $active_pckg_trans_id);\n\t\t\t if ($foodbakery_package_id != $active_pckg_id || $active_pckg_trans_id != $foodbakery_trans_id) {\n\t\t\t\t// if package subscribe\n\t\t\t\tif ($is_pkg_subs) {\n\n\t\t\t\t // update featured, top category\n\t\t\t\t // this change will be temporary\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", '');\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", '');\n\n\t\t\t\t // Get Transaction Restaurants array\n\t\t\t\t // Merge new Restaurant in Array\n\t\t\t\t $get_trans_restaurants = get_post_meta($active_pckg_trans_id, \"foodbakery_restaurant_ids\", true);\n\t\t\t\t $updated_trans_restaurants = $this->merge_in_array($get_trans_restaurants, $restaurant_id);\n\t\t\t\t update_post_meta($active_pckg_trans_id, \"foodbakery_restaurant_ids\", $updated_trans_restaurants);\n\n\t\t\t\t $active_pckg_trans_title = $active_pckg_trans_id != '' ? str_replace('#', '', get_the_title($active_pckg_trans_id)) : '';\n\n\t\t\t\t // updating package id in restaurant\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_restaurant_package\", $active_pckg_id);\n\n\t\t\t\t // updating transaction title id in restaurant\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_trans_id\", $active_pckg_trans_title);\n\n\t\t\t\t // update restaurant subscription renew\n\t\t\t\t $get_subscripton_data = get_post_meta($restaurant_id, \"package_subscripton_data\", true);\n\t\t\t\t if (empty($get_subscripton_data)) {\n\t\t\t\t\t$package_subscripton_data = array(\n\t\t\t\t\t array(\n\t\t\t\t\t\t'type' => 'update_package',\n\t\t\t\t\t\t'transaction_id' => $active_pckg_trans_id,\n\t\t\t\t\t\t'title_id' => $active_pckg_trans_title,\n\t\t\t\t\t\t'package_id' => $active_pckg_id,\n\t\t\t\t\t\t'subscribe_date' => strtotime(current_time('Y-m-d H:i:s')),\n\t\t\t\t\t )\n\t\t\t\t\t);\n\t\t\t\t } else {\n\t\t\t\t\t$package_subscripton_data = array(\n\t\t\t\t\t 'type' => 'update_package',\n\t\t\t\t\t 'transaction_id' => $active_pckg_trans_id,\n\t\t\t\t\t 'title_id' => $active_pckg_trans_title,\n\t\t\t\t\t 'package_id' => $active_pckg_id,\n\t\t\t\t\t 'renew_date' => strtotime(current_time('Y-m-d H:i:s')),\n\t\t\t\t\t);\n\t\t\t\t }\n\t\t\t\t $merged_subscripton_data = $this->merge_in_array($get_subscripton_data, $package_subscripton_data, false);\n\t\t\t\t update_post_meta($restaurant_id, \"package_subscripton_data\", $merged_subscripton_data);\n\n\t\t\t\t // updating restaurant meta\n\t\t\t\t // as per transaction meta\n\t\t\t\t $this->restaurant_assign_meta($restaurant_id, $active_pckg_trans_id);\n\n\t\t\t\t // Assign Status of restaurant\n\t\t\t\t $this->restaurant_update_status($restaurant_id);\n\t\t\t\t}\n\t\t\t }\n\t\t\t if ($is_pkg_subs) {\n\t\t\t\t// update restaurant featured\n\t\t\t\tif ($t_package_feature_list == 'on') {\n\t\t\t\t // featured from form\n\t\t\t\t $get_restaurant_featured = foodbakery_get_input('foodbakery_restaurant_featured', '');\n\t\t\t\t // featured from meta\n\t\t\t\t $db_restaurant_featured = get_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", true);\n\n\t\t\t\t if ($get_restaurant_featured == 'on' && $db_restaurant_featured != 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", 'on');\n\t\t\t\t } else if ($get_restaurant_featured != 'on' && $db_restaurant_featured == 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", '');\n\t\t\t\t }\n\t\t\t\t} else {\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", '');\n\t\t\t\t}\n\n\t\t\t\t// update restaurant top category\n\t\t\t\tif ($t_package_top_cat_list == 'on') {\n\t\t\t\t // Top Cat from form\n\t\t\t\t $get_restaurant_top_cat = foodbakery_get_input('foodbakery_restaurant_top_cat', '');\n\t\t\t\t // Top Cat from meta\n\t\t\t\t $db_restaurant_top_cat = get_post_meta($restaurant_id, 'foodbakery_restaurant_is_top_cat', true);\n\n\t\t\t\t if ($get_restaurant_top_cat == 'on' && $db_restaurant_top_cat != 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", 'on');\n\t\t\t\t } else if ($get_restaurant_top_cat != 'on' && $db_restaurant_top_cat == 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", '');\n\t\t\t\t }\n\t\t\t\t} else {\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", '');\n\t\t\t\t}\n\t\t\t }\n\t\t\t} else {\n\t\t\t // if package subscribe\n\t\t\t if ($this->foodbakery_is_pkg_subscribed($active_pckg_id, $active_pckg_trans_id)) {\n\n\t\t\t\t// Get Transaction Restaurants array\n\t\t\t\t// Merge new Restaurant in Array\n\t\t\t\t$get_trans_restaurants = get_post_meta($active_pckg_trans_id, \"foodbakery_restaurant_ids\", true);\n\t\t\t\t$updated_trans_restaurants = $this->merge_in_array($get_trans_restaurants, $restaurant_id);\n\t\t\t\tupdate_post_meta($active_pckg_trans_id, \"foodbakery_restaurant_ids\", $updated_trans_restaurants);\n\n\t\t\t\t$active_pckg_trans_title = $active_pckg_trans_id != '' ? str_replace('#', '', get_the_title($active_pckg_trans_id)) : '';\n\t\t\t\t// updating package id in restaurant\n\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_package\", $active_pckg_id);\n\n\t\t\t\t// updating transaction title id in restaurant\n\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_trans_id\", $active_pckg_trans_title);\n\n\t\t\t\t// update restaurant subscription renew\n\t\t\t\t$get_subscripton_data = get_post_meta($restaurant_id, \"package_subscripton_data\", true);\n\n\t\t\t\tif (empty($get_subscripton_data)) {\n\t\t\t\t $package_subscripton_data = array(\n\t\t\t\t\tarray(\n\t\t\t\t\t 'type' => 'update_package',\n\t\t\t\t\t 'transaction_id' => $active_pckg_trans_id,\n\t\t\t\t\t 'title_id' => $active_pckg_trans_title,\n\t\t\t\t\t 'package_id' => $active_pckg_id,\n\t\t\t\t\t 'subscribe_date' => strtotime(current_time('Y-m-d H:i:s')),\n\t\t\t\t\t)\n\t\t\t\t );\n\t\t\t\t} else {\n\t\t\t\t $package_subscripton_data = array(\n\t\t\t\t\t'type' => 'update_package',\n\t\t\t\t\t'transaction_id' => $active_pckg_trans_id,\n\t\t\t\t\t'title_id' => $active_pckg_trans_title,\n\t\t\t\t\t'package_id' => $active_pckg_id,\n\t\t\t\t\t'renew_date' => strtotime(current_time('Y-m-d H:i:s')),\n\t\t\t\t );\n\t\t\t\t}\n\t\t\t\t$merged_subscripton_data = $this->merge_in_array($get_subscripton_data, $package_subscripton_data, false);\n\t\t\t\tupdate_post_meta($restaurant_id, \"package_subscripton_data\", $merged_subscripton_data);\n\n\t\t\t\t// update restaurant featured\n\t\t\t\tif ($t_package_feature_list == 'on') {\n\t\t\t\t // featured from form\n\t\t\t\t $get_restaurant_featured = foodbakery_get_input('foodbakery_restaurant_featured', '');\n\t\t\t\t // featured from meta\n\t\t\t\t $db_restaurant_featured = get_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", true);\n\n\t\t\t\t if ($get_restaurant_featured == 'on' && $db_restaurant_featured != 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", 'on');\n\t\t\t\t } else if ($get_restaurant_featured != 'on' && $db_restaurant_featured == 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", '');\n\t\t\t\t }\n\t\t\t\t} else {\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_restaurant_is_featured\", '');\n\t\t\t\t}\n\n\t\t\t\t// update restaurant top category\n\t\t\t\tif ($t_package_top_cat_list == 'on') {\n\t\t\t\t // Top Cat from form\n\t\t\t\t $get_restaurant_top_cat = foodbakery_get_input('foodbakery_restaurant_top_cat', '');\n\t\t\t\t // Top Cat from meta\n\t\t\t\t $db_restaurant_top_cat = get_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", true);\n\n\t\t\t\t if ($get_restaurant_top_cat == 'on' && $db_restaurant_top_cat != 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", 'on');\n\t\t\t\t } else if ($get_restaurant_top_cat != 'on' && $db_restaurant_top_cat == 'on') {\n\t\t\t\t\tupdate_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", '');\n\t\t\t\t }\n\t\t\t\t} else {\n\t\t\t\t update_post_meta($restaurant_id, \"foodbakery_restaurant_is_top_cat\", '');\n\t\t\t\t}\n\n\t\t\t\t// updating restaurant meta\n\t\t\t\t// as per transaction meta\n\t\t\t\t$this->restaurant_assign_meta($restaurant_id, $active_pckg_trans_id);\n\n\t\t\t\t// Assign Status of restaurant\n\t\t\t\t$this->restaurant_update_status($restaurant_id);\n\t\t\t }\n\t\t\t}\n\t\t }\n\t\t // end of using existing package\n\t\t}\n\t\t$response['status'] = true;\n\t\t$response['msg'] = esc_html__('Restaurant added successfully and packages processed', 'foodbakery');\n\t\t// end assigning packages\n\t\t// and payment processs\n\t }\n\t return $response;\n\t}", "public function relatedReservation($id)\n\t{\n\t\t$dat = $this->database->table(self::TABLE_NAME)->get($id);\n\n\t\t$pole = array();\n\t\tforeach ($dat->related('rezervace_leku_lek.ID_leku') as $med)\n\t\t\t$pole[] = $med->ID_rezervace;\n\t\treturn $this->database->table('rezervace_leku')->where('ID_rezervace', $pole);\n\t}", "public function pastReservation()\n {\n if (isset($_SESSION['id']) && isset($_SESSION['user'])) {\n $id = $_SESSION['id'];\n $pastReservations = new ReservationManager();\n $pastReservations->selectAllReservation($id);\n }\n }", "public function trainingVideoReminderMail() \n {\n $data = $this->BusinessOwner->find('all',array(\n 'conditions'=>array('BusinessOwner.group_role' => array('leader', 'co-leader'),'BusinessOwner.is_unlocked'=> 0),\n 'fields' => array('BusinessOwner.email','BusinessOwner.fname','BusinessOwner.lname','BusinessOwner.group_role')\n ));\n if(!empty($data)) {\n foreach($data as $row) { \n $emailLib = new Email();\n $subject = \"FoxHopr: Watch Training Video\";\n $template = \"training_video_reminder\";\n $format = \"both\";\n $to=$row['BusinessOwner']['email'];\n $emailLib->sendEmail($to,$subject,array('username'=>$row['BusinessOwner']['fname'].' '.$row['BusinessOwner']['lname']),$template,$format);\n }\n }\n }", "public function afficherRestaurant(){\r\n\t\t$sql=\"SElECT * From restaurant\";\r\n\t\t$db = config::getConnexion();\r\n\t\ttry{\r\n\t\t$liste=$db->query($sql);\r\n\t\treturn $liste;\r\n\t\t}\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n }\t\r\n\t}", "function get_reservation_byId($id) {\n global $DB;\n\n return $DB->get_record('roomscheduler_reservations', array('id' => $id));\n}", "public function scheduleDelivery(Request $request)\n {\n if (!empty($request->input('agent'))) {\n $count = 0;\n foreach ($request->input('agent') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $agents = User::where('isActive', 1)->where(function ($q) {\n $q->where('role', 'EM')->orWhere('role', 'AG');\n })->whereIn('_id', $objectArray)->get();\n } else {\n $agents = '';\n }\n\n if (!empty($request->input('assigned'))) {\n $count = 0;\n foreach ($request->input('assigned') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $assigned_to = User::where('isActive', 1)->where(function ($q) {\n $q->where('role', 'EM')->orWhere('role', 'AG')->orWhere('role', 'CR')->orWhere('role', 'AD')->orWhere('role', 'MS')->orWhere('role', 'CO')->orWhere('role', 'SV');\n })->whereIn('_id', $objectArray)->get();\n } else {\n $assigned_to = '';\n }\n\n if (!empty($request->input('customer'))) {\n $count = 0;\n foreach ($request->input('customer') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $customers = Customer::whereIn('_id', $objectArray)->get();\n $recepients = RecipientDetails::whereIn('_id', $objectArray)->get();\n $customers = $customers->merge($recepients);\n } else {\n $customers = '';\n }\n //\\\t\t$customer_code = [];\n //\t\tforeach ($customers as $customer) {\n //\t\t\t$customer_code[] = $customer->customerCode;\n //\t\t}\n if (!empty($request->input('case_manager'))) {\n $count = 0;\n foreach ($request->input('case_manager') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $case_managers = User::where('isActive', 1)->where(function ($q) {\n $q->where('role', 'EM')->orWhere('role', 'AD')->orWhere('role', 'RP')->orWhere('role', 'AG')->orWhere('role', 'CO')->orWhere('role', 'SV');\n })->whereIn('_id', $objectArray)->get();\n } else {\n $case_managers = '';\n }\n\n if (!empty($request->input('dispatch'))) {\n $count = 0;\n foreach ($request->input('dispatch') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n if (\n session('role') == 'Insurer' || session('role') == 'Employee' || session('role') == 'Agent' || session('role') == 'Coordinator' ||\n session('role') == 'Supervisor' || session('role') == 'Courier' || session('role') == 'Messenger' || session('role') == 'Accountant'\n ) {\n $dispatch_type_check = DispatchTypes::where('type', '!=', 'Direct Collections')->whereIn('_id', $objectArray)->get();\n } else {\n $dispatch_type_check = DispatchTypes::whereIn('_id', $objectArray)->get();\n }\n } else {\n $dispatch_type_check = '';\n }\n if (!empty($request->input('delivery'))) {\n $count = 0;\n foreach ($request->input('delivery') as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $delivery_mode_check = DeliveryMode::whereIn('_id', $objectArray)->get();\n } else {\n $delivery_mode_check = '';\n }\n if (!empty($request->input('status'))) {\n $count = 0;\n foreach ($request->input('status') as $cust) {\n $objectArray[$count] = $cust;\n $count++;\n }\n $Allstatus = DispatchStatus::whereIn('status', $objectArray)->groupBy('status')->get();\n } else {\n $Allstatus = '';\n }\n\n $delivery_mode = DeliveryMode::all();\n $dispatch_types = DispatchTypes::all();\n $document_types = DocumentType::all();\n $filter_data = $request->input();\n $current_path = $request->path();\n return view('dispatch.schedule_for_delivery_list')\n ->with(compact(\n 'dispatch_type_check',\n 'assigned_to',\n 'customers',\n 'delivery_mode_check',\n 'agents',\n 'case_managers',\n 'delivery_mode',\n 'dispatch_types',\n 'customer_code',\n 'filter_data',\n 'document_types',\n 'current_path',\n 'Allstatus'\n ));\n }", "public function emailadressen() {\r\n\t\t$objDBMaillijstEmailAdres = new clsDBMaillijstEmailAdres();\r\n\t\tforeach($objDBMaillijstEmailAdres->selectAll($this->getm_iBedrijfID(), $this->getm_iMaillijstID()) as $rs){\r\n\t\t\tarray_push($this->m_colEmailAdressen,new clsEmailAdres($rs['BedrijfID'],$rs['EmailAdresID'])); // voeg object MaillijstEmailAdres toe aan emailadressen collection\r\n\t\t};\r\n\t \treturn $this->m_colEmailAdressen;\r\n\t}", "public function getReservations(): string\n {\n $html = '\n <table>\n <thead>\n <tr>\n <th>ID</th>\n <th>Nom</th>\n <th>Annonce</th>\n <th>Date de réservations</th>\n </tr>\n </thead>\n <tbody>';\n\n // Get all Reservations :\n $reservationsService = new ReservationsService();\n $reservations = $reservationsService->getReservations();\n\n // Get html :\n foreach ($reservations as $reservation) {\n $usersHtml = '';\n if (!empty($reservation->getUser())) {\n $usersHtml .= 'Réservé par ';\n foreach ($reservation->getUser() as $user) {\n $usersHtml .= $user->getFirstname() . ' ' . $user->getLastname() . ' ';\n }\n }\n $annoncesHtml = '';\n if (!empty($reservation->getAnnonce())) {\n foreach ($reservation->getAnnonce() as $annonce) {\n $annoncesHtml .= $annonce->getLieuDepart() . ' ==> ' . $annonce->getLieuArrivee() . ' '. $annonce->getDateDepart()->format('H:i d-m-Y'). ' ';\n }\n }\n $html .=\n '<tr>\n <td> #'.$reservation->getId() . ' </td>' .\n '<td> '.$usersHtml . ' </td>' .\n '<td> '.$annoncesHtml . ' </td>' .\n '<td> '.$reservation->getDateReservation()->format('H:i d-m-Y') . '</td>\n </tr>';\n }\n $html .='</tbody>\n </table>';\n\n return $html;\n }", "public function testCIReturnPaymentShopIdInEachReciever()\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('ci_return_fee_payer');\n $shop_id = $this->getContainer()->getParameter('ci_return_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 }", "public function getRestaurant()\n {\n $restaurant = Restaurant::getOneBy(array('_id' => $this->restaurant));\n return $restaurant;\n }", "public function run()\n {\n \n\n \\DB::table('reservations')->delete();\n \n \\DB::table('reservations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'userID' => 1,\n 'carID' => 1,\n 'pickupLocation' => 1,\n 'returnLocation' => 2,\n 'pickupDate' => '2016-12-18 13:57:10',\n 'returnDate' => '2016-12-19 15:00:00',\n 'extras' => '\"[3]\"',\n 'price' => 200,\n 'isPending' => 1,\n 'isPaid' => 1,\n 'isCompleted' => 1,\n 'created_at' => '2016-12-18 12:56:57',\n 'updated_at' => '2016-12-18 12:57:10',\n ),\n 1 => \n array (\n 'id' => 2,\n 'userID' => 1,\n 'carID' => 1,\n 'pickupLocation' => 1,\n 'returnLocation' => 1,\n 'pickupDate' => '2016-12-19 14:00:00',\n 'returnDate' => '2016-12-30 15:00:00',\n 'extras' => '\"[2,3]\"',\n 'price' => 2050,\n 'isPending' => NULL,\n 'isPaid' => NULL,\n 'isCompleted' => NULL,\n 'created_at' => '2016-12-18 12:57:34',\n 'updated_at' => '2016-12-18 12:57:34',\n ),\n ));\n \n \n }", "public function index()\n {\n $my_id= Auth::user()->getId();\n //return $my_id;\n $myreservations = \\DB::table('reservation')\n ->join('seat', 'seat.id', '=', 'reservation.seat_id')\n ->join('projection', 'projection.id', '=', 'reservation.projection_id')\n ->join('film', 'film.id', '=', 'projection.film_id')\n ->join('hall', 'hall.id', '=', 'projection.hall_id')\n ->join('kino', 'kino.id', '=', 'hall.kino_id')\n ->where('reservation.users_id', '=', $my_id )\n ->select('projection.start AS start', 'film.name AS film', 'kino.name AS kino', 'hall.number AS hall' , 'seat.number AS seat' ,\n 'reservation.price AS price', 'reservation.id AS reservation' , 'projection.id AS projection' , 'reservation.users_id AS user_id')\n ->orderBy('projection.start', 'asc','projection.id')\n ->get();\n //return $myreservations;\n return view('reserve', compact('myreservations'));\n \n \n\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n $day_tracker = -30;\n\n $destinations = [];\n $destination_counter = 1;\n\n $transports = [];\n\n for ($i = 1; $i <= 20; $i++) {\n\n $faker->seed($i);\n $has_dates = $faker->boolean($chanceOfGettingTrue = 70);\n\n $creator = $faker->randomDigitNotNull();\n $n = $faker->numberBetween($min=2, $max=5);\n $cities = [];\n\n for ($j = 0; $j < $n; $j++) {\n array_push($cities, $faker->city);\n\n if ($j == 0) {\n continue;\n } else if ($j == 1) {\n $trip = Trip::create([\n 'origin' => $cities[0],\n 'created_by' => $creator,\n ]);\n\n $trip->users()->sync(array_merge($faker->randomElements($array = range(1, 10), $count = $faker->numberBetween($min=0, $max=4)), [$creator]));\n }\n\n if ($has_dates) {\n $start_date = date('Y-m-d', strtotime(\"+$day_tracker day\"));\n $num_days = $faker->numberBetween($min=1, $max=4);\n $day_tracker += $num_days;\n $end_date = date('Y-m-d', strtotime(\"+$day_tracker day\"));\n }\n\n array_push($destinations,[\n 'trip_id' => $i,\n 'location' => $cities[$j],\n 'start_date' => $has_dates ? $start_date : null,\n 'end_date' => $has_dates ? $end_date: null,\n ]);\n\n // transport to destination\n array_push($transports, [\n 'destination_id' => $destination_counter,\n 'mode' => $faker->randomElement($array = ['FLIGHT', 'FERRY', 'BUS', 'TRAIN', 'OTHER']),\n 'origin' => $cities[$j - 1],\n 'destination' => $cities[$j],\n 'booking_id' => $faker->bothify('???###'), \n 'departure_date' => $has_dates ? $start_date : null,\n 'arrival_date' => $has_dates ? $start_date: null,\n ]);\n\n // transport back to origin\n if ($j === $n - 1) {\n array_push($transports, [\n 'destination_id' => $destination_counter,\n 'mode' => $faker->randomElement($array = ['FLIGHT', 'FERRY', 'BUS', 'TRAIN', 'OTHER']),\n 'origin' => $cities[$j],\n 'destination' => $cities[0],\n 'booking_id' => $faker->bothify('???###'),\n 'departure_date' => $has_dates ? $end_date : null,\n 'arrival_date' => $has_dates ? $end_date: null,\n ]);\n }\n\n $destination_counter++;\n }\n\n $day_tracker += 10;\n }\n\n Destination::insert($destinations);\n Transport::insert($transports);\n\n $transport_count = Transport::all()->count();\n $costs = [];\n\n for ($i = 1; $i <= $transport_count; $i++) {\n array_push($costs, [\n 'costable_id' => $i,\n 'costable_type' => 'App\\Models\\Transport',\n 'cost' => $faker->randomFloat($nbMaxDecimals = 2, $min = 20, $max = 2000),\n ]\n );\n }\n\n Cost::insert($costs);\n }", "function edit_reservations($recurence_id, $subject, $category, $description){\n global $DB;\n\n$reservations = $DB->get_records('roomscheduler_reservations', array('recurrence_id' => $recurence_id), $sort='', $fields='*', $limitfrom=0, $limitnum=0);\n\nforeach($reservations as $reservation){\n\n $reservation_object = new stdClass();\n $reservation_object->subject = $subject;\n $reservation_object->categories = $category;\n $reservation_object->description = $description;\n $reservation_object->id = $reservation->id;\n\n$DB->update_record('roomscheduler_reservations', $reservation_object);\nprint $reservation->id . \" \".$subject.\" \".$description.\" \".$category;\n}\n}", "function get_invoices_nos_by_manisfestoid()\r\n\t\t{\r\n\t\t\t$user=$this->auth(KFILE_ROLE);\r\n\t\t\t\r\n\t\t\t$manifesto_log_id=$this->input->post('manifesto_id');\r\n\t\t\t\r\n\t\t\t//get the territory name by invoices nuber\r\n\t\t\t$territories_details=$this->erpm->get_terriory_name_by_invoice($manifesto_log_id);\r\n\t\t\t//get the driver list\r\n\t\t\t$driver_details=$this->erpm->get_drivres_list();\r\n\t\t\t//get the manifesto sent invoices\r\n\t\t\t$invoices_nos_det=$this->erpm->get_manifesto_send_invoices_det($manifesto_log_id);\r\n\t\t\t//get the field cordinators list\r\n\t\t\t$field_cordinators_list=$this->erpm->get_field_cordinators_list();\r\n\t\t\t\t\t\t\r\n\t\t\t$role_types=$this->db->query(\"select * from m_employee_roles where role_id=6 or role_id=7 order by role_name\")->result_array();\r\n\t\t\t$franchise_invoice_link=$territories_details['franchise_invoice_link'];\r\n\t\t\t\r\n\t\t\techo '<div class=\"manifesto_update_form\">\r\n\t\t\t\t<div style=\"background:#FFFAD6;border-bottom:1px dashed #F4EB9A;font-size:12px;\">\r\n\t\t\t\t\t<div style=\"width:460px;float:left;font-size:10px;\">\r\n\t\t\t\t\t\tTerritory : \r\n\t\t\t\t\t\t<select id=\"terr_list\" onChange=\"select_invoice_by_territory(this)\">\r\n\t\t\t\t\t\t<option value=\"all\">Choose</option>';\r\n\t\t\t\t$tr_list = array();\r\n\t\t\t\tif($territories_details['territories_det'])\r\n\t\t\t\t{\r\n\t\t\t\t\t$check_terr=array();\r\n\t\t\t\t\tforeach($territories_details['territories_det'] as $territories_det)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(!isset($check_terr[$territories_det['territory_name']]))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$check_terr[$territories_det['territory_name']]=1;\r\n\t\t\t\t\t\t\techo '<option value=\"'.$territories_det['territory_id'].'\">'.$territories_det['territory_name'].'</option>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$tr_list[$territories_det['territory_id']] = $territories_det['territory_name'];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\techo\t'\t</select>\r\n\t\t\t\t\t\tScan Invoice : <input type=\"text\" id=\"srch_barcode\" size=\"10\" onkeyup=\"scan_invoice(event)\">\r\n\t\t\t\t\t\t\t\t\t <a href=\"javascript:void(0)\" class=\"a_button\" onClick=\"scan_invoice(this)\" value=\"scan\">Scan</a>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div style=\"width:300px;float:right;padding:5px;\">\r\n\t\t\t\t\t\t<div style=\"float:left;font-size:10px;padding:3px;\">\r\n\t\t\t\t\t\t\tSelect all:<input type=\"checkbox\" class=\"sel_all\" onClick=\"select_option(this)\">\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div style=\"float:left;font-size:10px;padding:3px;\">\r\n\t\t\t\t\t\t\t<div style=\"background:#FFA500;float:left;padding:3px;\">\r\n\t\t\t\t\t\t\t\t<b>Sent</b>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div style=\"float:left;font-size:10px;padding:3px;\">\r\n\t\t\t\t\t\t\t<div style=\"background:#ffffa0;float:left;padding:3px;\">\r\n\t\t\t\t\t\t\t\t<b>Pending</b>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div style=\"clear:both;\"></div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div style=\"overflow:hidden;min-height:200px;max-height:300px;overflow:auto\">';\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t\t\tif($invoices_nos_det)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$territory_invoice_link=$territories_details['territory_invoice_link'];\r\n\t\t\t\t\t\t\t$trans_id_invoice_link=$territories_details['trans_id_invoice_link'];\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\t$sorted_invoices_by_sent=array();\r\n\t\t\t\t\t\t\t$sorted_invoices_by_sent['a']=array();\r\n\t\t\t\t\t\t\t$sorted_invoices_by_sent['b']=array();\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$send_invoices_Det=array();\r\n\t\t\t\t\t\t\tif($invoices_nos_det[0]['sent_invoices'])\r\n\t\t\t\t\t\t\t\t$send_invoices_Det=explode(',',$invoices_nos_det[0]['sent_invoices']);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$invoices_list = explode(',',$invoices_nos_det[0]['invoice_nos']);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tforeach($invoices_list as $invoice)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(in_array($invoice, $send_invoices_Det))\r\n\t\t\t\t\t\t\t\t\t$sorted_invoices_by_sent['a'][]=$invoice;\r\n\t\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\t\t$sorted_invoices_by_sent['b'][]=$invoice;\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\t\r\n\t\t\t\t\t\t\tforeach($tr_list as $tid=>$trname)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\techo '<h3 class=\"show_invoice show_invoice_'.$tid.'\" style=\"display:none;\">'.$trname.'</h3>'; \r\n\t\t\t\t\t\t\t\techo '<table>';\r\n\t\t\t\t\t\t\t\techo \t'<tr>';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tforeach($sorted_invoices_by_sent as $invoices_nos)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tforeach($invoices_nos as $in=> $invoice_no)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$territory_id=$territory_invoice_link[$invoice_no];\r\n\t\t\t\t\t\t\t\t\t\t$trans_id=$trans_id_invoice_link[$invoice_no];\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tif($territory_id != $tid)\r\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$inv_class_name='show_invoice_'.$territory_id;\r\n\t\t\t\t\t\t\t\t\t\t$rem_class='rm_'.$invoice_no;\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$disable_checkbox='';\r\n\t\t\t\t\t\t\t\t\t\t$select_class='sel';\r\n\t\t\t\t\t\t\t\t\t\t$backgroundcolor='';\r\n\t\t\t\t\t\t\t\t\t\tif(in_array($invoice_no, $send_invoices_Det))\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$disable_checkbox='checked=\"checked\" disabled=\"disabled\"';\r\n\t\t\t\t\t\t\t\t\t\t\t$select_class='';\r\n\t\t\t\t\t\t\t\t\t\t\t$backgroundcolor='background:#FFA500;';\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\t$backgroundcolor='background:#ffffa0;';\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\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\techo '<td style=\"overflow:hidden;float:left;margin:2px;'.$backgroundcolor.'padding:4px;width:160px;height:45px;\" class=\"show_invoice '.$inv_class_name.' '.$rem_class.' \" valing=\"top\">';\r\n\t\t\t\t\t\t\t\t\t\t\techo '<b><a href=\"'.site_url(\"/admin/trans/$trans_id\").'\" target=\"_blank\">'.$invoice_no.'</a></b>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '<span><input type=\"checkbox\" name=\"invoice_nos[]\" fr_name=\"'.addslashes($franchise_invoice_link[$invoice_no]).'\" value=\"'.$invoice_no.'\"'.$disable_checkbox.' class=\"'.$invoice_no.' '.$select_class.'\"></span><br>';\r\n\t\t\t\t\t\t\t\t\t\t\techo '<span style=\"font-size:8px;\">('.$franchise_invoice_link[$invoice_no].')</span><br>';\r\n\t\t\t\t\t\t\t\t\t\t\tif(!$disable_checkbox)\r\n\t\t\t\t\t\t\t\t\t\t\t\techo '<span style=\"font-size:12px;color:red !important;\"><a style=\"font-size:12px;color:red !important;\" href=\"javascript:void(0)\" invoice_no=\"'.$invoice_no.'\" class=\"remove_invoice\">Remove</a></spna>';\r\n\t\t\t\t\t\t\t\t\t\techo '</td>';\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tif(($in+1)%4==0)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\techo '</tr><tr>';\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\techo \t'</tr>';\r\n\t\t\t\t\t\t\t\techo '<table>';\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}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t//echo '</div>';\r\n\t\t\t\r\n\t\t\t$tran_opts=array('Choose'=>'choose','drivers_list_blk'=>'Driver','field_cordinators_list_blk'=>'Field Co-oridnator','other_trans'=>'Others');\r\n\t\t\t$pick_up_by=array(\"choose\",\"Executives\",\"Field Co-ordinators\");\r\n\t\t\t\r\n\t\t\t//drives list\r\n\t\t\techo '<table cellpadding=\"5\" cellspacing=\"0\" width=\"100%\">\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>Send Through:</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<select name=\"transport_opts\" id=\"Transport_opts\" onChange=\"select_transport(this)\">';\r\n\t\t\t\t\t\t\t\t\techo '<option vlaue=\"Choose\">Choose</option>';\r\n\t\t\t\t\t\t\t\tforeach($role_types as $i=>$opt)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\techo '<option value=\"'.$opt['role_id'].'\">'.$opt['role_name'].'</option>';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\techo '<option value=\"0\">Other transport</option>';\t\t\t\t\t\t\t\t\r\n\t\t\techo\t\t\t'</select\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td id=\"drivers_list_blk\" style=\"display:none;\" class=\"trans_opt_blk\">\r\n\t\t\t\t\t\t\t<select name=\"drivers_list\" id=\"drivers_list\" >\r\n\t\t\t\t\t\t\t\t<option value=\"choose\">Choose Driver</option>';\r\n\t\t\t\t\t\t\t\tif($driver_details)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tforeach($driver_details as $driver_Det)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\techo '<option value=\"'.$driver_Det['employee_id'].':'.$driver_Det['name'].'\">'.ucwords($driver_Det['name']).'</option>';\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\techo '</select>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td id=\"field_cordinators_list_blk\" style=\"display:none;\" class=\"trans_opt_blk\">\r\n\t\t\t\t\t\t\t<select name=\"field_cordinators_list\" id=\"field_cordinators_list\" >\r\n\t\t\t\t\t\t\t\t<option value=\"choose\">Choose</option>';\r\n\t\t\t\t\t\t\t\tif($field_cordinators_list)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tforeach($field_cordinators_list as $field_cordinator_det)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\techo '<option value=\"'.$field_cordinator_det['employee_id'].':'.$field_cordinator_det['name'].'\">'.ucwords($field_cordinator_det['name']).'</option>';\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\techo '</select>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td style=\"display:none;\" class=\"trans_opt_blk\" id=\"other_trans\" width=\"480\">\r\n\t\t\t\t\t\t\t<span style=\"font-size:10px\">Any Other Transport :<input type=\"text\" name=\"other_driver\" id=\"other_driver\"></span>\r\n\t\t\t\t\t\t\t<span style=\"font-size:10px\">Ph :<input type=\"text\" name=\"other_driver_ph\"></span>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr class=\"hidden\" id=\"pick-up-by-blk\">\r\n\t\t\t\t\t\t<td>Pick up by:</td>\r\n\t\t\t\t\t\t<td id=\"pick-up-by\"></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>Vehicle number:</td>\r\n\t\t\t\t\t\t<td><input type=\"text\" name=\"vehicle_num\" size=\"10\"></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>Start meter rate:</td>\r\n\t\t\t\t\t\t<td><input type=\"text\" name=\"start_meter\" size=\"10\"></td>\r\n\t\t\t\t\t\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>Remark:</td>\r\n\t\t\t\t\t\t<td colspan=\"5\"><textarea name=\"remark\" cols=\"35\" rows=\"3\"></textarea></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t</div>\r\n\t\t</div>';\r\n\t\t\t\r\n\t\t}", "function getRoomsOrganisator($hotel_id, $hotel_name)\n {\n $oUser=Auth::user();\n if($oUser->role=='admin'){\n $userTravellerId='admin';\n }\n else{\n $userTravellerId=$oUser->traveller->traveller_id;\n }\n\n $aRooms = RoomsPerHotelPerTrip::where('hotels_per_trip_id', $hotel_id)->get();\n $aCurrentOccupation = array();\n $aTravellerPerRoom = array();\n\n foreach ($aRooms as $oRoom)\n {\n $aCurrentOccupation[$oRoom->rooms_hotel_trip_id] = TravellersPerRoom::where('rooms_hotel_trip_id', $oRoom->rooms_hotel_trip_id)->count();\n $aTravellerPerRoom[$oRoom->rooms_hotel_trip_id]=TravellersPerRoom::where('rooms_hotel_trip_id', $oRoom->rooms_hotel_trip_id)\n ->join('travellers','travellers_per_rooms.traveller_id','=','travellers.traveller_id')\n ->get();\n }\n return view('organiser.HotelsAndRooms.rooms',\n [\n 'userTravellerId'=>$userTravellerId,\n 'hotel_id'=>$hotel_id,\n 'hotel_name'=>$hotel_name,\n 'aRooms' => $aRooms,\n 'aCurrentOccupation' => $aCurrentOccupation,\n 'aTravellerPerRoom' =>$aTravellerPerRoom\n ]);\n }" ]
[ "0.588065", "0.57398707", "0.55826837", "0.55086607", "0.5463044", "0.5441211", "0.5418472", "0.5410198", "0.5404332", "0.5390521", "0.53864413", "0.53753436", "0.53495204", "0.53312933", "0.5284397", "0.5262806", "0.5259282", "0.52040493", "0.51934665", "0.51905113", "0.5158819", "0.51534706", "0.5124768", "0.51244575", "0.5108171", "0.51058215", "0.51043016", "0.51008695", "0.5099653", "0.5096629", "0.5094589", "0.5092443", "0.5080203", "0.5072944", "0.50666654", "0.5051463", "0.50396305", "0.5036631", "0.50305736", "0.5019059", "0.50149924", "0.50131494", "0.50129974", "0.50044286", "0.49991068", "0.49978313", "0.4996033", "0.49803475", "0.4973013", "0.49716184", "0.49631834", "0.49435398", "0.49403915", "0.49393097", "0.49349248", "0.4929128", "0.49286628", "0.49286202", "0.4926098", "0.49258322", "0.49228516", "0.49117", "0.49102637", "0.4901539", "0.48935366", "0.48856148", "0.48784274", "0.48780414", "0.4877418", "0.48754174", "0.4860571", "0.48478794", "0.48474196", "0.4847108", "0.48417088", "0.4831826", "0.48292452", "0.48213196", "0.48177198", "0.4816792", "0.4816787", "0.48148304", "0.4813377", "0.4810093", "0.48059306", "0.47982764", "0.4795964", "0.47958428", "0.47942367", "0.47927698", "0.47922787", "0.4785171", "0.47851115", "0.47839755", "0.47836384", "0.47783774", "0.47754422", "0.47740853", "0.477076", "0.47666457" ]
0.6470802
0
add current timestamp as coupon expiry date
public function addCouponExpiryDate(Reservation $reservation) { // no coupon was applied if (empty($reservation->coupon_id)) return; // get model $coupon = Coupon::whereId($reservation->coupon_id)->first(); if (!$coupon) throw new CartException(trans('No coupon was applied to this reservation')); $coupon->expired_at = time(); $result = $coupon->update(); if (!$result) throw new CartException(trans('Coupon could not be invalidated')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function expiryDate();", "public function getExpirationDate();", "function _sf_set_spot_expiry_date($post) {\n\t\t\n\t\t///// FIRSTLY LET'S ADD A METABOX FOR OUR EXPIRY DATE\n\t\t$exp_date = time() + (ddp('submission_days') * (60*60*24));\n\t\t\n\t\t$midnight_time = $exp_date;\n\t\t\n\t\tupdate_post_meta($post->ID, 'expiry_date', $midnight_time);\n\t\t\n\t\t///// SETS UP OUR CRON JOB\n\t\twp_schedule_single_event($midnight_time, 'expire_spot_submission', array($post->ID, $post->post_title, $post->post_author, ''.$midnight_time.''));\n\t\t\n\t}", "public function getExpirationDate(): int;", "public static function expiration()\n {\n return strtotime( \"+\" . self::EXPIRATION );\n }", "function _sf_set_spot_expiry_date_new($post) {\n\t\t\n\t\t//// LETS GET THE EXPIRY DATE AND MAKE SURE IT'S IN THE FUTURE\n\t\tif(is_object($post)) { if($post->post_type == 'spot') {\t\t\t\n\t\t\t\n\t\t\t$exp_date = get_post_meta($post->ID, 'expiry_date', true);\n\t\t\t$now = time();\n\t\t\t\n\t\t\t//// IF ITS IN THE FUTURE\n\t\t\tif($exp_date > $now) {\n\t\t\t\t\n\t\t\t\t//// SCHEDULE EVENT\n\t\t\t\twp_schedule_single_event($exp_date, 'expire_spot_submission', array($post->ID, $post->post_title, $post->post_author, $exp_date));\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} }\n\t\t\n\t}", "public function getExpirationDate()\n {\n return $this->user_expiration;\n }", "public function incrementExpiresAt();", "public function validate_coupon_expiry_time( $is_expired = false, $coupon = object ) {\n\n\t\t\t// Proceed only if WooCommerce has flag this coupon as expired.\n\t\t\tif ( true === $is_expired ) {\n\t\t\t\tif ( $this->is_wc_gte_30() ) {\n\t\t\t\t\t$coupon_id = ( is_object( $coupon ) && is_callable( array( $coupon, 'get_id' ) ) ) ? $coupon->get_id() : 0;\n\t\t\t\t} else {\n\t\t\t\t\t$coupon_id = ( ! empty( $coupon->id ) ) ? $coupon->id : 0;\n\t\t\t\t}\n\n\t\t\t\tif ( 0 !== $coupon_id ) {\n\t\t\t\t\t$expiry_date_timestamp = 0;\n\t\t\t\t\tif ( $this->is_wc_gte_30() ) {\n\t\t\t\t\t\tif ( is_object( $coupon ) && is_callable( array( $coupon, 'get_date_expires' ) ) ) {\n\t\t\t\t\t\t\t$expiry_date_object = $coupon->get_date_expires();\n\t\t\t\t\t\t\tif ( is_a( $expiry_date_object, 'WC_DateTime' ) && is_callable( array( $expiry_date_object, 'getTimestamp' ) ) ) {\n\t\t\t\t\t\t\t\t$expiry_date_timestamp = $expiry_date_object->getTimestamp();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$expiry_date_timestamp = ( ! empty( $coupon->expiry_date ) ) ? $coupon->expiry_date : 0;\n\t\t\t\t\t\tif ( ! is_int( $expiry_date_timestamp ) ) {\n\t\t\t\t\t\t\t$expiry_date_timestamp = strtotime( $expiry_date_timestamp );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( 0 !== $expiry_date_timestamp ) {\n\t\t\t\t\t\t$expiry_time = (int) get_post_meta( $coupon_id, 'wc_sc_expiry_time', true );\n\t\t\t\t\t\tif ( ! empty( $expiry_time ) ) {\n\t\t\t\t\t\t\t$expiry_date_timestamp = $expiry_date_timestamp + $expiry_time; // Adding expiry time to expiry date.\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$current_timestamp = current_time( 'timestamp', true );\n\t\t\t\t\t\tif ( $current_timestamp <= $expiry_date_timestamp ) {\n\t\t\t\t\t\t\t$is_expired = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $is_expired;\n\t\t}", "public function getExpiration()\n {\n // expire now\n return new \\DateTime();\n }", "public function getExpirationDate()\n {\n return $this->expirationDate;\n }", "public function getExpirationDate()\n {\n return $this->expirationDate;\n }", "function getExpiryDate() {\n return $this->expirydate;\n }", "public function getExpiration()\n {\n }", "function acadp_listing_expiry_date( $post_id, $start_date = NULL ) {\n\n\t// Get number of days to add\n\t$general_settings = get_option( 'acadp_general_settings' );\n\t$days = apply_filters( 'acadp_listing_duration', $general_settings['listing_duration'], $post_id );\n\n\tif( $days <= 0 ) {\n\t\tupdate_post_meta( $post_id, 'never_expires', 1 );\n\t\t$days = 999;\n\t} else {\n\t\tdelete_post_meta( $post_id, 'never_expires' );\n\t}\n\n\tif( $start_date == NULL ) {\n\t\t// Current time\n\t\t$start_date = current_time( 'mysql' );\n\t}\n\n\t// Calculate new date\n\t$date = new DateTime( $start_date );\n\t$date->add( new DateInterval( \"P{$days}D\" ) );\n\n\t// return\n\treturn $date->format( 'Y-m-d H:i:s' );\n\n}", "function _sf_set_spot_expiry_date_featured($post) {\n\t\t\n\t\t///// FIRSTLY LET'S ADD A METABOX FOR OUR EXPIRY DATE\n\t\t$exp_date = time() + (ddp('price_featured_days') * (60*60*24));\n\t\t\n\t\t$midnight_time = strtotime(date('d-m-Y', $exp_date));\n\t\t\n\t\tupdate_post_meta($post->ID, 'featured_payment_expire', $midnight_time);\n\t\t\n\t\t///// SETS UP OUR CRON JOB\n\t\twp_schedule_single_event($midnight_time, 'expire_spot_featured', array($post->ID, $post->post_title, $post->post_author, ''.$midnight_time.''));\n\t\t\n\t}", "public function getExpiration();", "public function getExpiration()\n {\n return $this->getCreated()->add(new DateInterval('P2W'));\n }", "function getDateExpiration() {\n return $this->dateExpiration;\n }", "public function getMembershipDefaultExpiration()\n {\n return (new \\DateTime('now'))->modify('+1 year');\n }", "public function getExpiresAt()\n\t{\n\n\t\tif (Auth::check() && Auth::user()->level == User::LEVEL_ADMIN) {\n\t\t\treturn strtotime(\"+1 week\");\n\t\t};\n\n\t\treturn strtotime(\"+1 year\");\n\n\t}", "public function getExpiryDate()\n {\n return $this->expiry_date;\n }", "public function getExpirationDate(): \\DateTime\n {\n return $this->expiration_date;\n }", "function tep_expire_specials() {\n tep_db_query(\"update \" . TABLE_SPECIALS . \" set status = 0, date_status_change = now() where status = '1' and now() >= expires_date and expires_date > 0\");\n}", "function xl_set_expiration($id, $timestamp) {\n\n\t$date = date('m/d/Y', $timestamp);\n\n $formatted_date = DateTime::createFromFormat('m/d/Y', $date);\n\n $month = intval($formatted_date->format('m'));\n $day = intval($formatted_date->format('d'));\n $year = intval($formatted_date->format('y'));\n\n //Manually set post to expire at the end of the day.\n $hour = 23;\n $minute = 59;\n\n $ts = get_gmt_from_date(\"$year-$month-$day $hour:$minute:0\",'U');\n\n $opts = array(\n 'expireType' => 'delete',\n 'id' => $id\n );\n\n _scheduleExpiratorEvent($id, $ts, $opts);\n}", "public function expiresAt();", "public function expiresAt();", "function _sf_set_spot_expiry_date_featured_new($post) {\n\t\t\n\t\t//// LETS GET THE EXPIRY DATE AND MAKE SURE IT'S IN THE FUTURE\n\t\tif(is_object($post)) { if($post->post_type == 'spot') {\t\t\t\n\t\t\t\n\t\t\t$exp_date = get_post_meta($post->ID, 'featured_payment_expire', true);\n\t\t\t$now = time();\n\t\t\t\n\t\t\t//// IF ITS IN THE FUTURE\n\t\t\tif($exp_date > $now) {\n\t\t\t\t\n\t\t\t\t//// SCHEDULE EVENT\n\t\t\t\twp_schedule_single_event($exp_date, 'expire_spot_featured', array($post->ID, $post->post_title, $post->post_author, $exp_date));\n\t\t\t\t\n\t\t\t\t//// MAKES SURE SPOT IS FAETURED \n\t\t\t\tupdate_post_meta($post->ID, 'featured', 'on');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} }\n\t\t\n\t}", "public function getFormattedExpirationDate();", "public function getExpiryDate(){\n\t\t$expiryDate = $this->config->getAppValue('owncollab_ganttchart', 'shareExpiryDate', 0);\n\t\treturn $expiryDate;\n\t}", "public function GetExpiryDate() {\n\t\treturn $this->_expirationDate;\n\t}", "public function getDateExpiration()\n {\n return $this->DateExpiration;\n }", "public function expire()\n {\n return $this->update([\n $this->model->getExpirationAttribute() => Carbon::now()\n ]);\n }", "function set_date_to_now()\n {\n $this->timestamp=time();\n }", "public function setExpirationDate(?Date $value): void {\n $this->getBackingStore()->set('expirationDate', $value);\n }", "public function getExpirationDate($currentDate)\n {\n $numberOfDays = Mage::helper('mp_debug')->getPersistLifetime();\n\n return date(self::DATE_FORMAT, strtotime(\"-{$numberOfDays} days {$currentDate}\"));\n }", "public function getRelativeExpiration(): \\DateInterval;", "public function getExpirationDate(Gri_Reward_Model_Reward_History $item)\n {\n $expiresAt = $item->getExpiresAt();\n if ($expiresAt) {\n return Mage::helper('core')->formatDate($expiresAt, 'short', true);\n }\n return '';\n }", "public function setExpirationDate(int $expiration_date);", "public function getExpiryDate() {\n\t\treturn $this->expiryDate;\n\t}", "public static function creditCardExpirationDate()\n {\n return new EqualityNode('credit_card_expiration_date');\n }", "public function getSupportExpirationTime()\n {\n return $this->support_expiration_time;\n }", "function get_expiry() {\n\t\treturn $this->get_expiry_from_vtec();\n\t}", "function set_expiration($post_id) {\n remove_action('save_post', 'expirationdate_update_post_meta');\n //Pull the date we need\n if(get_post_meta( $post_id , 'expiration', true )){\n $date = get_post_meta( $post_id , 'expiration', true );\n expirationdate_update_post_meta_acf($post_id, $date);\n } else{\n return;\n }\n}", "private function validate_expiry_date() {\n\t\tif ( $this->expiry_date && current_time( 'timestamp' ) > $this->expiry_date ) {\n\t\t\tthrow new Exception( $error_code = self::E_WC_COUPON_EXPIRED );\n\t\t}\n\t}", "public function getExpiryTime()\n {\n return $this->expiry_time;\n }", "public function getExpirationDate(\\Magento\\Reward\\Model\\Reward\\History $item)\n {\n $expiresAt = $item->getExpiresAt();\n if ($expiresAt) {\n return $this->formatDate($expiresAt, \\IntlDateFormatter::SHORT, true);\n }\n return '';\n }", "public function getExpiration()\n {\n return $this->expiration;\n }", "public function getExpiration()\n {\n return $this->expiration;\n }", "public function getExpirationTime()\n {\n return $this->expiration_time;\n }", "public function getExpirationTime()\n {\n return $this->expiration_time;\n }", "public function getActiveQuoteCutoffDate()\n {\n return date('Y-m-d H:i:s', strtotime('-'.$this->getActiveQuoteCutoff().' days'));\n }", "function schedule_expiry() {\n\t\tif ( ! wp_next_scheduled( 'github_embed_cron' ) ) {\n\t\t\t$frequency = apply_filters( 'github_embed_cache_frequency', 'daily' );\n\t\t\twp_schedule_event( time(), $frequency, 'github_embed_cron' );\n\t\t}\n\t}", "public function emailTokenExpirationTime() {\n\t\treturn date('Y-m-d H:i:s', time() + $this->emailTokenExpirationTime);\n\t}", "public function column_exp( $item ) {\n\t\tif ( isset( $item['expiration'] ) ) {\n\t\t\t$item['exp'] = $item['expiration'];\n\t\t}\n\n\t\tif ( ! isset( $item['exp'] ) ) {\n\t\t\treturn __( 'Never', 'indieauth' );\n\t\t}\n\t\t$time = (int) $item['exp'];\n\t\t$time_diff = time() - $time;\n\t\tif ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {\n\t\t\t// translators: Human time difference ago\n\t\t\treturn sprintf( __( '%s ago', 'indieauth' ), human_time_diff( $time ) );\n\t\t}\n\t\treturn wp_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $time );\n\t}", "public function getExpirationTime()\n {\n return $this->_expiration_time;\n }", "public function setExpiry( $expiry );", "public function insert() {\n $this->data['creation_datetime']=date('Y-m-d H:i:s');\n $this->data['last_login_datetime']=date('Y-m-d H:i:s');\n if (array_key_exists('expiresIn', $this->rawData) && $this->rawData['expiresIn'] != '') {\n $this->data['expires_datetime']=date('Y-m-d H:i:s', time()+$this->rawData['expiresIn']); \n }\n parent::insert();\n }", "function _tsuiseki_tracking_get_expiration_time() {\n return (time() + TSUISEKI_TRACKER_COOKIE_TIMEOUT);\n}", "public static function get_expire_time_otp()\n {\n return apply_filters('wordpress_acl_otp_time_expire', (MINUTE_IN_SECONDS * 5));\n }", "private function setDefaultExpiry()\n {\n if (config('laravelinvites.expiry.type') === 'none') {\n return null;\n }\n \n if (config('laravelinvites.expiry.type') === 'hours') {\n return now()->addHours(config('laravelinvites.expiry.value'));\n } elseif (config('laravelinvites.expiry.type') === \"days\") {\n return now()->addDays(config('laravelinvites.expiry.days'));\n }\n }", "protected function getExpiration()\n {\n return $this->expiration;\n }", "public function expirationAfter(): ?int;", "private function getExpiration()\n {\n return (self::EXPIRATION_IN_MINUTES * 60);\n }", "function expire_token() {\n return time() + (60 * 60 * 24);\n}", "public function getExpiration() {\n return $this->expiration;\n }", "public function getExpirationDate(): DateTimeImmutable\n {\n return (new DateTimeImmutable(sprintf('@%s', $this->expirationTime)))\n ->setTimezone(new DateTimeZone(date_default_timezone_get()));\n }", "public function getExpiration(): string\n {\n return $this->expiration;\n }", "public function getExpiry()\n {\n return $this->expiry;\n }", "public function getExpiry()\n {\n return $this->expiry;\n }", "private function getTokenExpiryDateTime()\n {\n $tokenTtl = $this->container->getParameter('lexik_jwt_authentication.token_ttl');\n $now = new \\DateTime();\n $now->add(new \\DateInterval('PT' . $tokenTtl . 'S'));\n\n return $now->format('U');\n }", "public function getExpirationDate()\n {\n if (empty($this->expires_at)) {\n return null;\n }\n\n return !empty($this->expires_at)\n ? $this->expires_at->toDateString()\n : null;\n }", "public function expirationTimestamp()\n {\n if ($this->expiration instanceof \\DateTime) {\n return $this->expiration->getTimestamp();\n }\n }", "private static function updateExpire($record)\n {\n// $params = Yii::$app->getParams();\n// $interval = $params['restful_token_expired_seconds'];\n $interval = 30 * 24 * 60 * 60;\n $record->expire_date = date('Y-m-d H:i:s', time() + $interval);\n $record->save(false, array('expire_date'));\n }", "public function getExpireTime()\n {\n if(null === $this->expireTime) {\n $config_time = Mage::getStoreConfig('catalog/dailydeal/expire_time');\n\n try {\n $this->expireTime = new Zend_Date($config_time, 'hh,mm,ss');\n } catch (Exception $e) {\n $this->expireTime = new Zend_Date('23:59:59', 'hh:mm:ss');\n }\n }\n\n return $this->expireTime;\n }", "function smarty_modifier_expires($date) \n{ \n\tif ($date == \"\")\n\t\treturn \"\";\n\n\t$now = new DateTime();\n\t$dt = new DateTime($date);\n\t$interval = $dt->diff($now);\n\n\tif ($interval->invert == 1)\n\t\treturn \"expires in \".$interval->days.\" days\";\n\telse\n\t\treturn \"expired \".$interval->days.\" days ago\";\n}", "public function getExpirationTime() {\n return $this->shareData[\"expire\"];\n }", "static function autoExpiryUpdated($value) {\n if($value > 0) {\n DB::execute('UPDATE ' . TABLE_PREFIX . 'users SET password_expires_on = ? WHERE password_expires_on IS NULL', DateTimeValue::makeFromString(\"+$value months\"));\n } else {\n DB::execute('UPDATE ' . TABLE_PREFIX . 'users SET password_expires_on = NULL');\n } // if\n\n AngieApplication::cache()->removeByModel('users');\n }", "function premium_activated_message(){\n $model_config = WYSIJA::get('config', 'model');\n if ($model_config->getValue('premium_key')) {\n $date_expiry = $model_config->getValue('premium_expire_at' );\n if( $date_expiry > time() ){\n ?>\n <tr>\n <td class=\"premium_activated\" colspan=\"2\">\n <i class=\"dashicons dashicons-awards\"></i><?php echo __('Your Premium is activated.', WYSIJA); ?>\n <span class=\"expiring_at\"><?php\n\n\n $date_expiry = date( get_option('date_format'), $date_expiry );\n\n echo '('.sprintf(__('Valid until %s',WYSIJA),$date_expiry).')';\n ?></span>\n </td>\n </tr>\n <?php\n }\n }\n }", "public function setExpiryDateAttribute($input)\n {\n if($input != '') {\n $this->attributes['expiry_date'] = Carbon::createFromFormat(config('quickadmin.date_format'), $input)->format('Y-m-d');\n }else{\n $this->attributes['expiry_date'] = '';\n }\n }", "public function getProductExpiry() {\n //return the value product expiry\n return $this->ProductExpiry;\n }", "private function currentTime()\n\t{\n\t\treturn Carbon::now()->format('Ymdhis');\n\t}", "function SetAExpire($TL, $sToken, $uid){\n if((checkUsrPermissions($sToken) == \"ar\") | (checkUsrPermissions($sToken) == \"an\")){\n if(chkUsrExist((int)$uid)){\n $ex = GetExp($TL);\n if($ex == \"Err :: Select One Of This : [1h,12h,1d,1w,2w,1m,3m,1y,3y,5y,lifetime]\"){\n return \"Err :: Check TimeLimit\";\n }else{\n $_SESSION['db']->prepare(\"UPDATE users SET `expire-date`=:ex WHERE id=:id\")->execute(['id' => $uid,'ex' => $ex]);\n $_SESSION['db']->prepare(\"UPDATE users SET `Subscription-create-date`=:cd WHERE id=:id\")->execute(['id' => $uid,'cd' => gmdate('Y-m-d h:i:s')]);\n return \"done\"; \n }\n }else{\n return \"UserID Not Exist !!\";\n } \n }else{\n return \"Err :: May u are not admin !\";\n }\n}", "public function getExpirationTime(): int\n {\n return $this->expirationTime;\n }", "public function now();", "public function getPaymentAuthExpiration();", "public function getExpiryAttribute() : Carbon\n {\n if ($this->cageExpires !== null) {\n return $this->cageExpires;\n }\n\n return $this->cageExpires = $this->created_at->addMinutes($this->getAttributeFromArray('length'));\n }", "public static function currdate()\n {\n $now = Carbon::now() -> toDateTimeString();\n $erase = substr($now, -3);\n $now = str_replace($erase, '', $now);\n $now = str_replace(' ', 'T', $now);\n return $now;\n }", "function sf_correct_sflast()\n{\n\tglobal $wpdb;\n\n\t$sql = \"UPDATE \".SFUSERMETA.\" SET meta_value=now() WHERE meta_key = '\".$wpdb->prefix.\"sflast' AND meta_value < DATE_SUB(CURDATE(), INTERVAL 1 YEAR);\";\n\t$wpdb->query($sql);\n\treturn;\n}", "public function getExpireTime()\n {\n return $this->expire_time;\n }", "public function cacheFor()\n {\n return now()->addMinutes(2);\n }", "public function call_job_expiration_date()\n {\n $Email->from(array('[email protected]' => 'Harvest'));\n $Email->to('[email protected]');\n $Email->subject('Teste');\n $Email->send('Teste');\n $this->render('/pages/index');\n\n }", "public function clearExpiry();", "public function get_cookie_life() {\n\n\t\t\t$life = get_option( 'wc_sc_coupon_cookie_life', 180 );\n\n\t\t\treturn apply_filters( 'wc_sc_coupon_cookie_life', time() + ( 60 * 60 * 24 * $life ) );\n\n\t\t}", "public function getExpirationDateFormattedAttribute()\n {\n if (empty($this->nextBillingDate)) {\n return null;\n } else {\n return Carbon::createFromFormat('Y-m-d H:i:s', $this->endsAt ?? $this->nextBillingDate)->format('M d Y');\n }\n }", "function authCAS_getMyCurrentDate()\n{\n\treturn G::CurDate('Y-m-d');\n}", "public function currentDate()\n {\n return today()->format('Ymd');\n }", "public function setTokenValidDate()\n {\n $this->tokenValidDate = new DateTime('+ 2 hours');\n }", "protected function _fcpoAddShadowBasketCheckDate() {\n $oDb = $this->_oFcpoHelper->fcpoGetDb();\n $oSession = $this->getSession();\n $sSessionId = $oSession->getId();\n\n $sQuery = \"\n UPDATE \n fcposhadowbasket\n SET\n \tFCPOCHECKED=NOW()\n WHERE\n FCPOSESSIONID=\".$oDb->quote($sSessionId).\"\n LIMIT 1\n \";\n $oDb->Execute($sQuery);\n }", "public static function getNextDueDate() {\n }" ]
[ "0.7061822", "0.6766733", "0.66498756", "0.64803", "0.64722866", "0.6424264", "0.63855845", "0.63058364", "0.62998414", "0.62795293", "0.62671894", "0.62671894", "0.62664205", "0.6254499", "0.62444234", "0.6215756", "0.6158648", "0.614684", "0.61257666", "0.611723", "0.608147", "0.6009315", "0.5987653", "0.5968019", "0.59547955", "0.5926245", "0.5926245", "0.59216326", "0.5904363", "0.59031916", "0.5894194", "0.5888199", "0.58732647", "0.58574045", "0.5815395", "0.58125067", "0.5804853", "0.5802103", "0.5794423", "0.577863", "0.5771208", "0.57636213", "0.5753095", "0.57495236", "0.5744302", "0.57438594", "0.57232666", "0.57214385", "0.57214385", "0.57156694", "0.57156694", "0.56994396", "0.5697681", "0.56876063", "0.5680758", "0.5672438", "0.56460726", "0.564002", "0.56400037", "0.56356716", "0.563536", "0.56142664", "0.5611447", "0.56097895", "0.5596371", "0.5588092", "0.5569063", "0.55667514", "0.5554445", "0.5554445", "0.55473554", "0.5537962", "0.55344456", "0.5525628", "0.5522407", "0.552129", "0.5518929", "0.55169845", "0.5513858", "0.55138564", "0.55067027", "0.5478112", "0.54571337", "0.5447876", "0.5446599", "0.5440613", "0.5423487", "0.54196185", "0.541568", "0.54136205", "0.54000694", "0.5395369", "0.5392357", "0.5383654", "0.5380469", "0.53749573", "0.5360631", "0.5359135", "0.5353637", "0.5339737" ]
0.5662222
56
Displays a form to create a new Teacher entity.
public function newAction() { $entity = new Teacher(); $form = $this->createForm(new TeacherType(), $entity); return array( 'entity' => $entity, 'form' => $form->createView(), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new Teacher();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'users' => User::find()->orderBy('username')->all(),\n 'departments' => Department::find()->orderBy('longName')->all(),\n ]);\n }", "public function actionCreate()\n {\n $model = new Teacher();\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 TeacherCreate()\n {\n return view('admin.teachers.create');\n }", "public function create()\n {\n return view(\"teacher.create\");\n }", "public function create()\n {\n return view('Department.Teacher.create');\n }", "public function create()\n {\n return view('admin.teacher.create');\n }", "public function create()\n {\n return view('admin.teacher.create');\n }", "public function create()\n {\n return view('admin.teacher.create');\n }", "public function create()\n {\n $this->authorize('admin.teacher.create');\n\n return view('admin.teacher.create');\n }", "public function create()\n {\n return view('backEnd.school.teacher.create');\n }", "public function actionCreate()\n {\n $model = new InfForTeacher();\n\n $this->saveModel($model);\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('teacher.createteacher');\n }", "public function actionCreate()\n\t{\n\t\t$role = Yii::app()->user->role;\n\t\tif(!in_array($role, array('staff', 'admin'))) {\n\t\t\t$this->redirect(array('site/index'));\n\t\t}\n\n\t\t$model=new Teacher;\n\t\t$user=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['Teacher']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Teacher'];\n\t\t\t$user->attributes=$_POST['User'];\n\t\t\t$teacher = teacher::model()->find('teacherCode=:code', array(':code'=>$model->teacherCode));\n\n\t\t\tif($teacher!==null) \n\t\t\t{\n\t\t\t\t$model->addError('teacherCode', 'You have this teacherID already');\n\t\t\t\t$this->render('create', array('model'=>$model,'user'=>$user));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$user->username = $model->teacherCode;\n\t\t\t\t$user->role = 'teacher';\n\t\t\t\t$user->save();\n\t\t\t\t$model->userId = $user->id;\n\t\t\t\tif($model->save())\n\t\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model, 'user'=>$user\n\t\t));\n\t}", "public function create()\n {\n return view('teacher.create');\n }", "public function create()\n {\n return view('admin.manager_teacher.add');\n }", "public function create()\n {\n return view('admin.teacherdetail.create');\n }", "public function actionCreate()\n\t{\n\t\t$this->subPageTitle = 'Thêm mới giáo viên';\n\t\t$model = new User;\n\t\t$teacher = new Teacher; \n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\t\t$classSubjects = Subject::model()->generateSubjects();\n\t\t$abilitySubjects = $teacher->abilitySubjects();//Subjects ability of teacher\n\t\tif(isset($_POST['User']))\n\t\t{\n\t\t\t$teacher_values = $_POST['User'];//Teacher values\n\t\t\t$teacher_profile_values = $_POST['Teacher'];//Teacher profile values\n\t\t\tif(isset($_POST['abilitySubjects'])){\n\t\t\t\t$abilitySubjects = $_POST['abilitySubjects'];//Subject ability\n\t\t\t}\n\t\t\t$teacher_values['role'] = User::ROLE_TEACHER;\n\t\t\tif(trim($teacher_values['birthday'])==''){\n\t\t\t\tunset($teacher_values['birthday']);\n\t\t\t}\n\t\t\t$model->attributes = $teacher_values;\n\t\t\t$model->passwordSave = $teacher_values['password'];\n\t\t\t$common = new Common();\n\t\t\t$dir = \"media/uploads/profiles\";\n\t\t\t$profilePicture = $common->uploadProfilePicture(\"profilePicture\",$dir);\n\t\t\tif($profilePicture !== false){\n\t\t\t\t$model->profile_picture=$profilePicture;\n\t\t\t}\n $transaction = Yii::app()->db->beginTransaction();\n try{\n if($model->save()){\n $teacher->attributes = $teacher_profile_values;\n $teacher->user_id = $model->id;\n if($teacher->save()){\n $teacher->saveAbilitySubjects($abilitySubjects);\n $transaction->commit();\n $this->redirect(array('index'));\n } else {\n throw new Exception('teacher_not_saved');\n }\n } else {\n throw new Exception('user_not_saved');\n }\n } catch(Exception $e){\n $transaction->rollback();\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t\t'teacher'=>$teacher,\n\t\t\t'classSubjects' => $classSubjects,\n\t\t\t'abilitySubjects' => $abilitySubjects,\n\t\t));\n\t}", "public function create()\n {\n \n $teacher_array = Teacher::all();\n return view('admin.add_student',compact('teacher_array'));\n }", "public function create()\n {\n $department = Department::all();\n return view('backend.teacher.teacher-create',compact('department'));\n }", "public function addteacher()\n {\n return view('admin.addteacher');\n }", "public function create($teacherId) {\n $viewData = $this->getFormViewData(\"ADD\", $teacherId, 0);\n return view('pages.teachers.classes.form', $viewData);\n }", "public function create(TeacherFormBuilder $form)\n {\n return $form->render();\n }", "public function create()\n {\n $teacher = null;\n $centers = $this->centerRepository->getAllForSelectBox();\n return view('backend.teachers.create')->with('centers',$centers);\n }", "public function create()\n {\n if(!Auth::user()){\n return redirect('home');\n }\n $teachers = Teacher::orderBy('name')->get();\n return view('classrooms.create', compact('teachers'));\n }", "public function create()\n {\n //加载视图\n return view('admin.teacher.create',['title'=>'名师列表']);\n }", "public function create()\n {\n $page_title = 'Ajouter un formateur';\n $countries = CountriesFacade::lookup('fr_FR');\n\n return view(Auth::user()->role->slug.'.teacher.addFormateurs', compact('countries', 'page_title'));\n }", "public function create()\n {\n return view('admin.teachers.create');\n }", "public function create()\n {\n $teachers = Teacher::orderBy('id','DESC')->get();\n return view(Route::currentRouteName(),compact('teachers'));\n }", "public function create()\n {\n $teacher_types = \\App\\Teacher_type::pluck('name','id');\n $matter = \\App\\Matter::pluck('name','id');\n\n return view('professors.create',compact('professor','teacher_types','matter'));\n }", "public function create()\n\t{\n\t\treturn view('teachers.create');\n\t}", "public function create()\n {\n return view('instructor.instructor-form');\n }", "public function createAction(Request $request) {\n $entity = new Teacher();\n $form = $this->createForm(new TeacherType(), $entity);\n $form->bind($request); \n \n $entity->setRegistrationDate(new \\DateTime('now'));\n \n $em = $this->getDoctrine()->getManager();\n $currentBranchId = $this->getSelectedOrganizationBranch()->getId();\n $organizationBranch = $em->getRepository('VirguleMainBundle:OrganizationBranch')->find($currentBranchId);\n $entity->addOrganizationBranch($organizationBranch);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n \n $this->addFlash( 'Compte utilisateur \"' . $entity->getUsername() . '\" créé avec succès !');\n \n return $this->redirect($this->generateUrl('teacher_index'));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n $teachers = Person::query()->whereNotIn(\n 'id',\n User::query()->where('role_id','=',\n Role::query()->where('name', '=', 'TEACHER')\n ->value('id')\n )\n ->select('person_id')\n ->get())\n ->get();\n\n $schools = School::query()->orderBy('name')\n ->orderBy('city')->get();\n $roles = Role::query()->orderBy('name','asc')->get();\n\n return view('teachers.create',[\n 'schools'=>$schools,\n 'directionName'=>'teachers',\n 'roles'=>$roles,\n 'persons'=>$teachers,\n ]);\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n {\n $topics = Topic::all();\n $students = Student::where('teacher', session()->get('ic'))->get();\n return view('Teacher.SPForm.spformcreate', compact('students', 'topics'));\n }", "public function create()\n {\n $departments = Department::all();\n $teachers = Teacher::all();\n $schools = School::all();\n return view('admin.teacher.assign', ['departments' => $departments, 'teachers' => $teachers, 'schools' => $schools]);\n }", "public function teacher_registration(){\n\n\t\t$data['title_page'] = 'Teacher | Registration';\n\t\t$this->load->view('teach/reg_teach', $data);\n\n\t\t/* here is the validation to the form submitted in creating the new teacher_account_tbl;*/\n\n\t}", "public function create()\n {\n $users = User::all();\n $teachers = [];\n foreach($users as $user){\n if($user->hasRole('Teacher')){\n $teachers[] = $user;\n }\n }\n\n $teachers = array_pluck($teachers, 'email', 'id');\n\n $classrooms = Classroom::all();\n $classrooms = array_pluck($classrooms, 'name', 'id');\n\n\n return view('subject.create')->withTeachers($teachers)->withClassrooms($classrooms);\n }", "public function actionCreate()\n {\n $model = new TbTeach();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->teach_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function newAction()\n {\n $entity = new AttendanceEmployed();\n $form = $this->createForm(new AttendanceEmployedType(), $entity);\n\n return $this->render('AcmeKindergartenBundle:AttendanceEmployed:attendance.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function add() {\n\t\n\t\t# Make sure user is logged in if they want to use anything in this controller\n\t\tif(!$this->user) {\n\t\t\tRouter::redirect(\"/index/unauthorized\");\n\t\t}\n\t\t\n\t\t# Setup view\n\t\t$this->template->content = View::instance('v_teachers_add');\n\n\t\t$this->template->title = \"Add Teacher\";\n\n\t\t$client_files_head = array(\"/css/teachers_add.css\");\n\t\t$this->template->client_files_head = Utils::load_client_files($client_files_head);\n\n\t\t#$client_files_body = array(\"/js/ElementValidation.js\", \"/js/shout_out_utils.js\");\n\t\t#$this->template->client_files_body = Utils::load_client_files($client_files_body);\n\n\t\t# Render template\n\t\techo $this->template;\n\t\t\n\t}", "public function create()\n {\n return view('backend.student.form');\n }", "public function create()\n {\n //\n return view('Faculty.create');\n }", "public function create()\n {\n return view('teacher.exams.create');\n }", "public function create()\n {\n return view('contentmanagement::Faculty.create');\n }", "public function actionCreate()\n {\n $model = new HospitalForm();\n if ($model->load(Yii::$app->request->post())) {\n $model->groupid=Groups::GROUP_HOSPITAL;\n $model->admin_user_id=Yii::$app->user->id;\n if($res = $model->signup()){\n return $this->redirect(['details', 'id' => $res->id]);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n 'roles' => ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'name')\n ]);\n }", "public function actionCreate()\n {\n $model = new Lessons();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $model->setStudentsInLessons($model->id);\n return $this->redirect(['/teacher/lessons']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n } \n }", "public function create()\n {\n $academics=Academic::all();\n $subjects=Subject::all();\n $classrooms=Classroom::all();\n $teachers=Teacher::all();\n return view('Backend.timetable.new',compact('academics','subjects','classrooms','teachers'));\n \n }", "public function create()\n {\n return view(\"instructors.create\");\n }", "public function create($name)\n {\n return view('Admin.lesson_teacher.create',compact('name'));\n }", "public function newAction()\n {\n $entity = new AttendanceChildren();\n $form = $this->createForm(new AttendanceChildrenType(), $entity);\n\n return $this->render('AcmeKindergartenBundle:AttendanceChildren:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function create()\n {\n return view('instructors::instructor.create');\n }", "public function newAction()\n {\n $entity = new Utente();\n $form = $this->createCreateForm($entity);\n\n return $this->render('estarRdaBundle:Utente:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $this->generateParams();\n return view('backend.pages.user._form', compact('gender', 'type', 'city'));\n }", "public function create($id)\n {\n //\n $user_id = auth()->user()->id;\n $profile = Profile::where('user_id', $user_id)->first();\n $teacher = Teacher::where('id', $id)->first();\n // dd($teacher);\n return view('teacher.post.create',['teacher'=>$teacher,'profile'=>$profile]);\n }", "public function create()\n {\n $teacher=User::where('role','teacher')->pluck('id','name');\n $class= Classes::pluck('class_id','class_name');\n\n return view('backend.timetable.create',['class'=>$class,'teacher'=>$teacher]);\n }", "public function create()\n {\n //\n return view('lessonform');\n\n }", "public function create()\n {\n return view(\"teacher.pages.exam-types.create\");\n }", "public function create()\n {\n if (!Gate::allows('lesson_create')) {\n return abort(401);\n }\n $courses = Course::has('category')->ofTeacher()->get()->pluck('title', 'id')->prepend('Please select', '');\n\n return view('backend.assignments.create', compact('courses'));\n }", "public function create()\n {\n return view( 'students.create' );\n }", "public function newAction()\n {\n $user = new User();\n $form = $this->createForm(UserType::class, $user, array(\n 'adminRequired' => true,\n ));\n\n return $this->render('AdminBundle:admin:new.html.twig', array(\n 'user' => $user,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Titeur();\n\t\t\t\t$user = $this->get('security.context')->getToken()->getUser();\n $form = $this->createForm(new TiteurType(), $entity, array('user' => $user));\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function create()\n {\n \n return view ('trainer.create');\n }", "public function create()\n {\n return view('admin/createtrainer');\n }", "public function actionCreate()\n\t{\n\t\t$model = new Classes;\n\t\tif(isset($_POST['Classes'])) {\n\t\t\t$model->attributes = $_POST['Classes'];\n\t\t\t$model->formTags = isset($_POST['Classes']['formTags']) ? explode(',', $_POST['Classes']['formTags']) : null;\n\t\t\t$model->teachers = isset($_POST['Classes']['teachers']) ? $_POST['Classes']['teachers']: null;\n\t\t\t$model->classDays = isset($_POST['Classes']['classDays']) ? explode(',', $_POST['Classes']['classDays']) : null;\n\t\t\t$model->price = isset($_POST['Classes']['price']) ? $_POST['Classes']['price'] : 0;\n\t\t\t$model->teacher_id = 0;\n\n\t\t\tif($model->save()) {\n\t\t\t\tYii::app()->user->setFlash('success', '<span class=\"icon-check\"></span>&nbsp;&nbsp;اطلاعات با موفقیت ذخیره شد.');\n\t\t\t\t$this->redirect(array('admin'));\n\t\t\t} else\n\t\t\t\tYii::app()->user->setFlash('failed', 'در ثبت اطلاعات خطایی رخ داده است! لطفا مجددا تلاش کنید.');\n\t\t}\n\n\t\t$this->render('create', array(\n\t\t\t\t'model' => $model,\n\t\t));\n\t}", "public function formadd_teacher() {\n $user_teacher = $this->session->userdata('user');\n $this->load->view('template/header', $user_teacher);\n $this->load->view('include/navigation');\n $this->load->view('template/sidebar_teacher');\n $this->load->view('teacher/formadd_teacher');\n $this->load->view('template/footer');\n }", "public function create()\n {\n $faculties = $this->facultyRepository->all();\n return view('subjects.create', compact('faculties'));\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view('teacher_pannel.registration');\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n\t{\n\t\treturn view('backend.TrainerManagement.add');\n\t}", "public function create()\n {\n $classes=Stdclass::orderBy('order')->get();\n return view('back.teacher.assignment.create', compact('classes'));\n }", "public function create()\n {\n return view('admin.student.create');\n }", "public function create()\n {\n return view('admin.subjects.create');\n }", "public function create()\n {\n return view('trainer.create');\n }", "public function create()\n\t{\n\t\treturn view('students.create');\n\t}", "public function create()\n {\n return view('back.teacher.posts.create');\n }", "public function newAction()\n {\n $entity = new Education();\n $form = $this->createCreateForm($entity);\n\n return $this->render('SyndicateComponentBundle:Education:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('setup.students_subject.subject-create');\n }", "public function newAction()\n {\n $entity = new User();\n $form = $this->createCreateForm($entity)\n ->add('create', 'submit', array('label' => 'c'));\n\n return $this->render(\n 'VipaAdminBundle:AdminUser:new.html.twig',\n array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n )\n );\n }", "public function actionCreate()\n {\n $model = new HorarioEstudiante();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('admin.backends.employee.form.create');\n }", "public function createStudents()\n {\n $authUser = Auth::user();\n $objSchool = new School();\n $schoolsList = $objSchool->getList();\n $objTeachers = new Teachers();\n $schoolinfo = $objTeachers->getTeacherSchools();\n return view(\"teacher.add-student\", compact('authUser', 'schoolsList', 'schoolinfo'));\n }", "public function create()\n {\n return view('students.create');\n\n }", "public function create()\n {\n \treturn view('admin.subject.add');\n }", "public function create()\n\t{\n\t\treturn View::make('subjects.create');\n\t}", "public function create()\n {\n\n $formInputs = $this->form();\n $formInputs['method'] = 'create';\n\n $educations = Education::all();\n\n return view('lessons.create', compact('formInputs'))->with('educations', $educations);\n }", "public function create()\n {\n return view('participants.form', [\n 'participant' => new Participant()\n ]);\n }", "public function create()\n {\n $data = $this->userRepository->getShow();\n\n $programs = EducationProgram::where('user_id', $data->id)->get();\n\n $item = (new EducationProgram());\n\n $this->authorize('create', $item);\n\n return view('teacher.programs.edit', compact('item', 'programs'));\n }", "public function create()\n {\n return view('subjects.create');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function create()\n {\n \n return view(\n 'components/forms/form-personne',\n [\n 'redirect' => 'ajouterPersonne',\n 'employe' => null\n ]\n );\n }", "public function actionIndex()\n {\n $searchModel = new TeacherSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function create()\n {\n return view('students/create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n {\n return view('admin.ctStudentMajors.create');\n }", "public function create()\n {\n return view('formCreateElevage');\n }", "public function create()\n {\n return view('student.create');\n }", "public function create()\n {\n return view('student.create');\n }" ]
[ "0.84595525", "0.8357474", "0.81107384", "0.78124017", "0.78076524", "0.77961326", "0.77961326", "0.77961326", "0.77304596", "0.7716387", "0.77016187", "0.7672534", "0.7630601", "0.762947", "0.75905746", "0.7334293", "0.7266229", "0.72532994", "0.71728456", "0.71524817", "0.71346074", "0.70674074", "0.70398134", "0.70390815", "0.6950022", "0.6930109", "0.6861273", "0.6833619", "0.6761055", "0.67387575", "0.6666676", "0.66647404", "0.66429263", "0.6590726", "0.6590704", "0.6573276", "0.6541951", "0.65338445", "0.6530475", "0.6528495", "0.64991546", "0.6481022", "0.64761126", "0.6451455", "0.6437063", "0.64299846", "0.640209", "0.6377897", "0.6373759", "0.63654566", "0.63592553", "0.6355534", "0.63544804", "0.6335794", "0.63256276", "0.6324305", "0.63210833", "0.6296615", "0.6290308", "0.6288814", "0.62736964", "0.6261334", "0.62587047", "0.6257275", "0.62559175", "0.62519014", "0.6246394", "0.62428635", "0.62425846", "0.62405455", "0.6237408", "0.6235752", "0.6225537", "0.6225106", "0.62150013", "0.62138414", "0.6213581", "0.62102133", "0.62061375", "0.6204103", "0.6198156", "0.6195533", "0.61911744", "0.6189062", "0.61820996", "0.61817074", "0.618053", "0.61795765", "0.61724377", "0.6170692", "0.61689824", "0.6168668", "0.61686236", "0.61669207", "0.6166144", "0.6164163", "0.61589956", "0.61537784", "0.61515623", "0.61515623" ]
0.7995153
3
Creates a new Teacher entity.
public function createAction(Request $request) { $entity = new Teacher(); $form = $this->createForm(new TeacherType(), $entity); $form->bind($request); $entity->setRegistrationDate(new \DateTime('now')); $em = $this->getDoctrine()->getManager(); $currentBranchId = $this->getSelectedOrganizationBranch()->getId(); $organizationBranch = $em->getRepository('VirguleMainBundle:OrganizationBranch')->find($currentBranchId); $entity->addOrganizationBranch($organizationBranch); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $em->persist($entity); $em->flush(); $this->addFlash( 'Compte utilisateur "' . $entity->getUsername() . '" créé avec succès !'); return $this->redirect($this->generateUrl('teacher_index')); } return array( 'entity' => $entity, 'form' => $form->createView(), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new Teacher();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'users' => User::find()->orderBy('username')->all(),\n 'departments' => Department::find()->orderBy('longName')->all(),\n ]);\n }", "public function actionCreate()\n {\n $model = new Teacher();\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$role = Yii::app()->user->role;\n\t\tif(!in_array($role, array('staff', 'admin'))) {\n\t\t\t$this->redirect(array('site/index'));\n\t\t}\n\n\t\t$model=new Teacher;\n\t\t$user=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['Teacher']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Teacher'];\n\t\t\t$user->attributes=$_POST['User'];\n\t\t\t$teacher = teacher::model()->find('teacherCode=:code', array(':code'=>$model->teacherCode));\n\n\t\t\tif($teacher!==null) \n\t\t\t{\n\t\t\t\t$model->addError('teacherCode', 'You have this teacherID already');\n\t\t\t\t$this->render('create', array('model'=>$model,'user'=>$user));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$user->username = $model->teacherCode;\n\t\t\t\t$user->role = 'teacher';\n\t\t\t\t$user->save();\n\t\t\t\t$model->userId = $user->id;\n\t\t\t\tif($model->save())\n\t\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model, 'user'=>$user\n\t\t));\n\t}", "public function TeacherCreate()\n {\n return view('admin.teachers.create');\n }", "public function create()\n {\n return view('Department.Teacher.create');\n }", "public function actionCreate()\n\t{\n\t\t$this->subPageTitle = 'Thêm mới giáo viên';\n\t\t$model = new User;\n\t\t$teacher = new Teacher; \n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\t\t$classSubjects = Subject::model()->generateSubjects();\n\t\t$abilitySubjects = $teacher->abilitySubjects();//Subjects ability of teacher\n\t\tif(isset($_POST['User']))\n\t\t{\n\t\t\t$teacher_values = $_POST['User'];//Teacher values\n\t\t\t$teacher_profile_values = $_POST['Teacher'];//Teacher profile values\n\t\t\tif(isset($_POST['abilitySubjects'])){\n\t\t\t\t$abilitySubjects = $_POST['abilitySubjects'];//Subject ability\n\t\t\t}\n\t\t\t$teacher_values['role'] = User::ROLE_TEACHER;\n\t\t\tif(trim($teacher_values['birthday'])==''){\n\t\t\t\tunset($teacher_values['birthday']);\n\t\t\t}\n\t\t\t$model->attributes = $teacher_values;\n\t\t\t$model->passwordSave = $teacher_values['password'];\n\t\t\t$common = new Common();\n\t\t\t$dir = \"media/uploads/profiles\";\n\t\t\t$profilePicture = $common->uploadProfilePicture(\"profilePicture\",$dir);\n\t\t\tif($profilePicture !== false){\n\t\t\t\t$model->profile_picture=$profilePicture;\n\t\t\t}\n $transaction = Yii::app()->db->beginTransaction();\n try{\n if($model->save()){\n $teacher->attributes = $teacher_profile_values;\n $teacher->user_id = $model->id;\n if($teacher->save()){\n $teacher->saveAbilitySubjects($abilitySubjects);\n $transaction->commit();\n $this->redirect(array('index'));\n } else {\n throw new Exception('teacher_not_saved');\n }\n } else {\n throw new Exception('user_not_saved');\n }\n } catch(Exception $e){\n $transaction->rollback();\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t\t'teacher'=>$teacher,\n\t\t\t'classSubjects' => $classSubjects,\n\t\t\t'abilitySubjects' => $abilitySubjects,\n\t\t));\n\t}", "public function create()\n {\n $this->authorize('admin.teacher.create');\n\n return view('admin.teacher.create');\n }", "public function newAction() {\n $entity = new Teacher();\n $form = $this->createForm(new TeacherType(), $entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function store(TeacherRequest $request)\n\t{\n\t\tUser::create([\n\t\t\t'name' => $request->name,\n\t\t\t'last_name' => $request->last_name,\n\t\t\t'middle_name' => $request->middle_name,\n\t\t\t'itesm_id' => $request->itesm_id,\n\t\t\t'email' => $request->itesm_id.'@itesm.mx',\n\t\t\t'password' => bcrypt($request->itesm_id),\n\t\t\t'work_area' => $request->work_area,\n\t\t\t'type' => false\n\t\t]);\n\n\t\treturn redirect('teachers');\n\t}", "public function create()\n {\n return view(\"teacher.create\");\n }", "public function create()\n {\n return view('backEnd.school.teacher.create');\n }", "public function createCourse(CreateCourseSpecification $spec, Teacher $teacher);", "public function create()\n {\n return view('admin.teacher.create');\n }", "public function create()\n {\n return view('admin.teacher.create');\n }", "public function create()\n {\n return view('admin.teacher.create');\n }", "public function store(CreateTeacherRequest $request)\n {\n $teacher = new Teacher;\n $teacher->name = $request->name;\n $teacher->email = $request->email;\n $teacher->email_token = str_random('10');\n $teacher->password = bcrypt('1');\n $teacher->level = $request->level;\n $teacher->address = $request->address;\n $teacher->birthday = $request->birthday;\n $teacher->academy = $request->academy;\n $teacher->save();\n $email = new AuthenticateLoginTeacher($teacher);\n Mail::to($teacher)->send($email);\n return redirect()->route('manager_teacher.index');\n }", "public function create()\n {\n return view('teacher.createteacher');\n }", "public function store(TeacherRequest $request)\n {\n\n if (! Gate::allows('store-teacher')) {\n abort(403);\n }\n\n $teacher = new Teacher;\n\n $teacher->name = $request->name;\n $teacher->email = $request->email;\n $teacher->pwd = $request->pwd;\n $teacher->subject = $request->subject;\n $teacher->role = $request->role;\n $teacher->tsc_no = $request->tsc_no;\n $teacher->save();\n\n return response([\n 'data' => new TeacherResource($teacher)\n ], Response::HTTP_CREATED);\n }", "public function create()\n {\n return view('teacher.create');\n }", "public function create()\n {\n if(!Auth::user()){\n return redirect('home');\n }\n $teachers = Teacher::orderBy('name')->get();\n return view('classrooms.create', compact('teachers'));\n }", "public function store(TeacherStoreRequest $request)\n {\n $user = User::create(\n array_merge(\n $request->validated(),\n ['role' => 'TEACHER']\n )\n );\n\n $teacher = Teacher::create(array_merge(\n $request->validated(),\n ['user_id' => $user->id]\n ));\n\n return new TeacherResource($teacher);\n }", "public function create_teacher()\n\t{\n\t\t$data['school_id'] = html_escape($this->input->post('school_id'));\n\t\t$data['name'] = html_escape($this->input->post('name'));\n\t\t$data['email'] = html_escape($this->input->post('email'));\n\t\t$data['password'] = sha1($this->input->post('password'));\n\t\t$data['phone'] = html_escape($this->input->post('phone'));\n\t\t$data['gender'] = html_escape($this->input->post('gender'));\n\t\t$data['blood_group'] = html_escape($this->input->post('blood_group'));\n\t\t$data['address'] = html_escape($this->input->post('address'));\n\t\t$data['role'] = 'teacher';\n\t\t$data['watch_history'] = '[]';\n\n\t\t// check email duplication\n\t\t$duplication_status = $this->check_duplication('on_create', $data['email']);\n\t\tif($duplication_status){\n\t\t\t$this->db->insert('users', $data);\n\n\n\t\t\t$teacher_id = $this->db->insert_id();\n\t\t\t$teacher_table_data['user_id'] = $teacher_id;\n\t\t\t$teacher_table_data['about'] = html_escape($this->input->post('about'));\n\t\t\t$social_links = array(\n\t\t\t\t'facebook' => $this->input->post('facebook_link'),\n\t\t\t\t'twitter' => $this->input->post('twitter_link'),\n\t\t\t\t'linkedin' => $this->input->post('linkedin_link')\n\t\t\t);\n\t\t\t$teacher_table_data['social_links'] = json_encode($social_links);\n\t\t\t$teacher_table_data['department_id'] = html_escape($this->input->post('department'));\n\t\t\t$teacher_table_data['designation'] = html_escape($this->input->post('designation'));\n\t\t\t$teacher_table_data['school_id'] = html_escape($this->input->post('school_id'));\n\t\t\t$teacher_table_data['show_on_website'] = $this->input->post('show_on_website');\n\t\t\t$this->db->insert('teachers', $teacher_table_data);\n\n\t\t\tif ($_FILES['image_file']['name'] != \"\") {\n\t\t\t\t\tmove_uploaded_file($_FILES['image_file']['tmp_name'], 'uploads/users/'.$teacher_id.'.jpg');\n\t\t\t}\n\n\t\t\t$response = array(\n\t\t\t\t'status' => true,\n\t\t\t\t'notification' => get_phrase('teacher_added_successfully')\n\t\t\t);\n\t\t}else{\n\t\t\t$response = array(\n\t\t\t\t'status' => false,\n\t\t\t\t'notification' => get_phrase('sorry_this_email_has_been_taken')\n\t\t\t);\n\t\t}\n\n\t\treturn json_encode($response);\n\t}", "public function store(Request $request)\n {\n $this->validate($request, ['name' => 'required', 'last_name' => 'required', 'second_lastname' => 'required', 'email' => 'required', ]);\n\n Teacher::create($request->all());\n\n Session::flash('message', 'Maestro agregado.');\n Session::flash('status', 'success');\n\n return redirect('school/teacher');\n }", "public function create()\n {\n \n $teacher_array = Teacher::all();\n return view('admin.add_student',compact('teacher_array'));\n }", "public function store(Request $request)\n {\n $teacher = new Teacher();\n\n $this->validate($request, [\n 'phone' => 'required|unique:teachers',\n 'email' => 'required|unique:teachers',\n 'faculty_id' => 'required',\n 'department_id' => 'required',\n 'first_name' => 'required',\n ]);\n\n $teacher->phone = $request->phone;\n $teacher->email = $request->email;\n $teacher->faculty_id = $request->faculty_id;\n $teacher->department_id = $request->department_id;\n $teacher->first_name = $request->first_name;\n $teacher->last_name = $request->last_name;\n $teacher->image = ImageUploadHelper::upload('image', $request->file('image'), time(), 'public/image/teachers');\n $teacher->username = StringHelper::createSlug($request->first_name, 'Teacher', 'username');\n $teacher->save();\n\n session()->flash('success', 'Teacher added successfully');\n return redirect()->route('admin.teacher.index');\n }", "public function create()\n {\n return view('admin.manager_teacher.add');\n }", "public function run()\n {\n Teacher::create([\n 'name' => 'Kiều Trung Tiến',\n 'date' => '1987-11-03',\n 'address' => '294 - 296 Trường Sa, Phường 2, Quận Phú Nhuận',\n 'degree' => 'Tiến sĩ'\n ]);\n }", "public function actionCreate()\n {\n $model = new InfForTeacher();\n\n $this->saveModel($model);\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $department = Department::all();\n return view('backend.teacher.teacher-create',compact('department'));\n }", "public function store(CreateTeacherRequest $request)\n {\n $input = $request->all();\n if (!empty($request->image)) {\n $imageName = time().'.teachers.'.Helper::transText($request->image->getClientOriginalName(),'-');\n $request->image->move(public_path('uploads'), $imageName);\n $request->image = $imageName;\n $input['image'] = '/public/uploads/'.$imageName;\n }\n $input['user_id'] = Auth::user()->id;\n $teacher = $this->teacherRepository->create($input);\n\n Flash::success(__('messages.created'));\n\n return redirect(route('admin.teachers.index'));\n }", "public function store(TeacherRequest $request)\n {\n try{\n $request->validated();\n $teacher = Teacher::create(\n $request->all('user_name','full_name','email','phone_number','description')+[\n 'password' => Hash::make($request->get('password')),\n 'avatar' => Helpers::saveImage(null,$request->file('avatar'),'avatar/teachers'),\n 'slug' => SlugService::createSlug(Teacher::class,'slug',$request->get('full_name')),\n ]\n );\n return new Resource($teacher);\n }catch(Exception $exception){\n return response()->json([\n 'error' => $exception->getMessage()\n ],JsonResponse::HTTP_BAD_REQUEST);\n }\n }", "public function create()\n {\n $users = User::all();\n $teachers = [];\n foreach($users as $user){\n if($user->hasRole('Teacher')){\n $teachers[] = $user;\n }\n }\n\n $teachers = array_pluck($teachers, 'email', 'id');\n\n $classrooms = Classroom::all();\n $classrooms = array_pluck($classrooms, 'name', 'id');\n\n\n return view('subject.create')->withTeachers($teachers)->withClassrooms($classrooms);\n }", "public function create()\n {\n return view('admin.teacherdetail.create');\n }", "public function teacher()\n {\n return $this->hasOne(Teacher::class);\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'phone'=>'required|unique:teachers,phone'\n ]);\n\n $teacher = Teacher::create([\n 'name'=>$request->name,\n 'slug'=> Str::slug('$request->name', '-'),\n 'subject'=> $request->subject,\n 'phone'=>$request->phone,\n 'password'=>$request->password,\n ]);\n Session::flash('success', 'Teacher added successfully');\n return redirect()->back();\n }", "public function create($id)\n {\n //\n $user_id = auth()->user()->id;\n $profile = Profile::where('user_id', $user_id)->first();\n $teacher = Teacher::where('id', $id)->first();\n // dd($teacher);\n return view('teacher.post.create',['teacher'=>$teacher,'profile'=>$profile]);\n }", "public function store(Request $request)\n {\n $t = new teacher();\n $u = new user();\n $u->name = $request->name;\n $u->email = $request->email;\n $u->password = Hash::make($request->password);\n $t->sexo = $request->sexo;\n $t->data_nascimento = $request->data_nascimento;\n $t->cpf = $request->cpf;\n $t->telefone = $request->telefone;\n $u->save();\n $t->user_id = $u->id;\n $t->save();\n \n return redirect()->route('teachers.index');\n }", "public function __construct(Teacher $teacher)\n {\n $this->teacher = $teacher;\n }", "function add_teacher($delete = null){\r\n try {\r\n if($delete){\r\n $this->db->delete('academic_subject_teachers', array('teacher_id','=', $delete));\r\n Session::flash('home', 'Information successfully Deleted!');\r\n }else{\r\n $this->db->insert('academic_subject_teachers', array(\r\n 'subject_id' => trim(Input::get('entry_class')),\r\n 'teacher' => Input::get('teacher'),\r\n 'session_term' => Input::get('show_academic'),\r\n 'effective_date' => trim(Input::get('datepicker')),\r\n 'description' => trim(Input::get('description')),\r\n 'input_by' => trim(Session::get('user_id')),\r\n 'date' => $this->today,\r\n ));\r\n Session::flash('home', 'Information successfully saved!');\r\n }\r\n cleanUP();\r\n\r\n return true;\r\n } catch (Exception $e) {\r\n return false;\r\n }\r\n\r\n }", "public function store(TeacherRequest $request)\n {\n $user = User::create([\n 'name' => $request->teacher_name,\n 'email' => $request->teacher_email,\n 'password' => bcrypt($request->teacher_password),\n 'role_id' => 2\n ]);\n\n //profile\n $profile = Profile::create([\n 'user_id' => $user->id,\n 'sex' => $request->teacher_sex,\n 'birth_place' => $request->teacher_birth_place,\n 'birth_date' => Carbon::createFromFormat('d/m/Y', $request->teacher_birth_date)->toDateString(),\n ]);\n\n //upload image\n $filename = $this->uploadImage($request->file('teacher_image'), $user->email, 'teacher');\n $profile->image = $filename;\n $profile->save();\n\n //address\n $address = Address::create([\n 'user_id' => $user->id,\n 'province_id' => $request->province_id,\n 'city_id' => $request->city_id,\n 'address' => $request->teacher_address,\n 'postal_code' => $request->teacher_postal_code,\n ]);\n\n //geolocation\n $geolocation = Geolocation::create([\n 'user_id' => $user->id,\n 'latitude' => $request->latitude,\n 'longitude' => $request->longitude\n ]);\n\n //contact\n $contact = Contact::create([\n 'user_id' => $user->id,\n 'phone_number' => $request->teacher_phone_number,\n 'wa_number' => $request->teacher_wa_number,\n 'facebook_url' => $request->teacher_facebook_url,\n 'instagram_url' => $request->teacher_instagram_url\n ]);\n\n return redirect('admin/teacher')->with('success', 'Berhasil tambah Guru');\n }", "public function store(Request $request) {\n\n $this->validateRequest($request);\n\n // create a new teacher record in the DB table and return a confirmation\n $teacher = Teacher::create($request->all());\n \treturn $this->createSuccessResponse( \"The teacher with id {$teacher->id} was created\", 201 );\n }", "public function create(TeacherFormBuilder $form)\n {\n return $form->render();\n }", "public function create()\n {\n $teachers = Person::query()->whereNotIn(\n 'id',\n User::query()->where('role_id','=',\n Role::query()->where('name', '=', 'TEACHER')\n ->value('id')\n )\n ->select('person_id')\n ->get())\n ->get();\n\n $schools = School::query()->orderBy('name')\n ->orderBy('city')->get();\n $roles = Role::query()->orderBy('name','asc')->get();\n\n return view('teachers.create',[\n 'schools'=>$schools,\n 'directionName'=>'teachers',\n 'roles'=>$roles,\n 'persons'=>$teachers,\n ]);\n }", "public function create()\n {\n $teacher = null;\n $centers = $this->centerRepository->getAllForSelectBox();\n return view('backend.teachers.create')->with('centers',$centers);\n }", "public function create()\n {\n $teachers = Teacher::orderBy('id','DESC')->get();\n return view(Route::currentRouteName(),compact('teachers'));\n }", "public function actionCreate()\n {\n $model = new TbTeach();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->teach_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create($teacherId) {\n $viewData = $this->getFormViewData(\"ADD\", $teacherId, 0);\n return view('pages.teachers.classes.form', $viewData);\n }", "public function add($name, $age, $class)\n\t{\n\t\t//\t\t$teacher->name = $name;\n\t\t//\t\t$teacher->age = $age;\n\t\t//\t\t$teacher->class = $class;\n\t\t//\t\t$teacher->ctime = time();\n\t\t//\t\t$teacher->utime = time();\n\t\t//\t\treturn $teacher->save();\n//\t\treturn Teacher::create(\n//\t\t\t[\n//\t\t\t\t'name' => $name,\n//\t\t\t\t'age' => $age,\n//\t\t\t\t'class' => $class,\n//\t\t\t\t'ctime' => time(),\n//\t\t\t\t'utime' => time(),\n//\t\t\t]\n//\t\t);\n\t\t//以属性查找实例,若没有添加\n//\t\treturn Teacher::firstOrCreate(\n//\t\t\t[\n//\t\t\t\t'name' => $name,\n//\t\t\t\t'age' => $age,\n//\t\t\t\t'class' => $class,\n//\t\t\t\t'ctime' => time(),\n//\t\t\t\t'utime' => time(),\n//\t\t\t]\n//\t\t);\n\t\t//以属性查找实例,若没有生成实例\n\t\t$teacher = Teacher::firstOrNew(\n\t\t\t[\n\t\t\t\t'name' => $name,\n\t\t\t\t'age' => $age,\n\t\t\t\t'class' => $class,\n//\t\t\t\t'ctime' => time(),\n//\t\t\t\t'utime' => time(),\n\t\t\t]\n\t\t);\n\t\treturn $teacher->save();\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'email' => 'required|unique:teachers,email',\n 'password' => 'required',\n 'phone' => 'required',\n ]);\n Teacher::create($request->all());\n $this->setSuccessMessage();\n return back();\n }", "public function store(Request $request)\n {\n $teacher = $request->all();\n $user = \\App\\Models\\User::create([\n 'username' => $request->get('number'),\n 'password' => bcrypt($request->get('number')),\n 'name' => $request->get('name'),\n 'uuid' => \\Faker\\Provider\\Uuid::uuid()\n ]);\n// $roles = array(\"7\");\n// $user->identity_card()->save($card);\n// $user->syncRoles($roles);\n if ($user->teacher()->create($teacher)){\n return redirect()->to(route('admin.teacher'))->with(['status'=>'添加老师成功']);\n }\n return redirect()->to(route('admin.teacher'))->withErrors('系统错误');\n\n }", "public function __construct(Teacher $teacher)\n {\n $this->teacher = $teacher;\n $this->school_name = env('APP_NAME');\n }", "function add(Teacher $objeto) {\n $campos = self::_getCampos($objeto);\n unset($campos['idTeacher']);\n \n $r = $this->db->insertParameters(self::TABLA, $campos, false);\n\n return $r;\n }", "public function store(UserRequest $request)\n {\n Teacher::create($request->validated());\n\n return redirect()->route('teachers.index')\n ->with('message', 'Success, teacher inserted!');\n// return new JsonResponse($request);\n }", "public function createEntity();", "public function create($data)\n {\n return new JsonModel(\n $this\n ->getLisRegisterService()\n ->registerLisUser($data, 'teacher')\n );\n }", "public function StoreTeachers($request)\n {\n try {\n// $Teachers = new Teacher();\n// $Teachers->Email = $request->Email;\n// $Teachers->Password = Hash::make($request->Password);\n// $Teachers->Name = ['en' => $request->Name_en, 'ar' => $request->Name_ar];\n $Teachers = new Teacher();\n $Teachers->user_id=Auth::user()->id;\n $Teachers->Specialization_id = $request->Specialization_id;\n $Teachers->Gender_id = $request->Gender_id;\n $Teachers->Joining_Date = $request->Joining_Date;\n $Teachers->Address = $request->Address;\n $Teachers->save();\n toastr()->success(trans('messages.success'));\n return redirect()->route('Teachers.create');\n }\n catch (\\Exception $e) {\n return redirect()->back()->with(['error' => $e->getMessage()]);\n }\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'email' => 'required',\n 'password' => 'required',\n 'contact' => 'required',\n 'gender' => 'required',\n 'qualification' => 'required',\n ]);\n\n if ($request->has('image')) {\n\n $pic = $request->file('image');\n $updated_name = rand() . \".\" . $pic->getClientOriginalExtension();\n $pic->move(public_path('teacher_image'), $updated_name);\n } else {\n $updated_name = 'no-image.jpg';\n }\n User::create([\n 'name' => $request->name,\n 'email' => $request->email,\n 'password' => bcrypt($request->password),\n 'contact' => $request->contact,\n 'address' => $request->address,\n 'gender' => $request->gender,\n 'date_of_birth' => $request->date_of_birth,\n 'image' => $updated_name,\n 'role' => 'Teacher',\n ]);\n\n $user_id = User::where('email', $request->email)->first();\n\n Teacher::create([\n 'user_id' => $user_id->id,\n 'name' => $request->name,\n 'email' => $request->email,\n 'password' => $request->password,\n 'contact' => $request->contact,\n 'address' => $request->address,\n 'gender' => $request->gender,\n 'date_of_birth' => $request->date_of_birth,\n 'image' => $updated_name,\n 'qualification' => $request->qualification,\n 'date_of_joining' => $request->date_of_joining\n ]);\n\n return redirect()->route('teacher.create')->with('success', 'Record Insert Successfully');\n }", "public function add_teacher(){\n\t\t$this->verify();\n\t\t$this->load->library('form_validation');\n\t\t$this->form_validation->set_rules('name', 'Name', 'trim|required');\n\t\t$this->form_validation->set_rules('email', 'Email Address', 'trim|required|valid_email');\n\t\t$this->form_validation->set_rules('phone', 'Phone', 'trim|required|numeric');\n\t\t$this->form_validation->set_rules('subject[]', 'Subject', 'trim|required');\n\t\t$this->form_validation->set_rules('username', \"Username\", 'trim|required|is_unique[teachers.USERNAME]', array('is_unique' => 'Username has been taken'));\n\t\t$this->form_validation->set_rules('password', 'Password', 'trim|required');\n\t\t$this->form_validation->set_rules('cpassword', 'Confirm Password', 'trim|required|matches[password]');\n\t\tif($this->form_validation->run()){\n\t\t\t$subject=implode(', ', $this->input->post('subject'));\n\n\t\t\t$teacher_info=array(\n\t\t\t\t'NAME'=>ucwords(strtolower($this->input->post('name'))),\n\t\t\t\t'EMAIL'=>trim($this->input->post('email')),\n\t\t\t\t'PHONE'=>trim($this->input->post('phone')),\n\t\t\t\t'SUBJECT'=>$subject,\n\t\t\t\t'USERNAME'=>strtolower($this->input->post('username')),\n\t\t\t\t'PASSWORD'=>md5(strtolower($this->input->post('password')))\n\t\t\t);\n\n\t\n\t\t\tif($this->admin_model->add_teacher($teacher_info)){\n\t\t\t\t$this->session->set_flashdata('message', 'Teacher Record has been created');\n\t\t\t\tredirect('/teachers');\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->session->set_flashdata('message', 'There is a problem creating teacher record');\n\t\t\t\tredirect('/teachers');\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$error=\"\";\n\t\t\tif(form_error('name')){\n\t\t\t\t$error.=form_error('name').\"<br>\";\n\t\t\t}\n\n\t\t\tif(form_error('email')){\n\t\t\t\t$error.=form_error('email').\"<br>\";\n\t\t\t}\n\n\t\t\tif(form_error('phone')){\n\t\t\t\t$error.=form_error('phone').\"<br>\";\n\t\t\t}\n\n\t\t\tif(form_error('subject[]')){\n\t\t\t\t$error.=form_error('subject[]').\"<br>\";\n\t\t\t}\n\n\t\t\tif(form_error('username')){\n\t\t\t\t$error.=form_error('username').\"<br>\";\n\t\t\t}\n\n\t\t\tif(form_error('password')){\n\t\t\t\t$error.=form_error('password').\"<br>\";\n\t\t\t}\n\n\t\t\tif(form_error('cpassword')){\n\t\t\t\t$error.=form_error('cpassword').\"<br>\";\n\t\t\t}\n\n\t\t\t$this->session->set_flashdata('message', $error);\n\t\t\tredirect('/teachers');\n\t\t}\n\n\t}", "public function store(TeacherRec $request, Teacher $teacher)\n {\n $request->validated();\n\n $teacher = new Teacher;\n $teacher->name = $request->name;\n $teacher->gender = $request->gender;\n $teacher->address = $request->address;\n $teacher->dob = $request->dob;\n $teacher->phone = $request->phone;\n $teacher->email = $request->email;\n $teacher->save();\n \n if($request->schedule){\n\n $schedule = Schedule::whereSlug($request->schedule)->first();\n\n $teacher->schedules()->attach($schedule);\n }\n return redirect()->route('teachers.index')->with('success', 'Teacher Has Been Created Successfully');\n }", "public function create()\n {\n// $var = 'suscipit';\n// $join = TeacherClass::select('class_code');\n// $join->where('class_code','=',$var);\n// if($join){\n// $join->select('teacher_class_id','class_id','teacher_id');\n//\n// }\n// else{\n// echo 'Yes we have no rows';\n// }\n// $result = $join->get();\n//\n// foreach($result as $results){\n//\n// $student = TeacherClassStudent::create(array(\n// 'teacher_class_id' => $results['teacher_class_id'], // if you use in there.\n// 'student_id' =>Auth::id(),\n// 'teacher_id' => $results['teacher_id'],\n// ));\n//\n// }\n// dd($student);\n }", "public function create()\n\t{\n\t\treturn view('teachers.create');\n\t}", "public function create()\n {\n //加载视图\n return view('admin.teacher.create',['title'=>'名师列表']);\n }", "public function create()\n {\n $departments = Department::all();\n $teachers = Teacher::all();\n $schools = School::all();\n return view('admin.teacher.assign', ['departments' => $departments, 'teachers' => $teachers, 'schools' => $schools]);\n }", "public function create()\n {\n $teacher=User::where('role','teacher')->pluck('id','name');\n $class= Classes::pluck('class_id','class_name');\n\n return view('backend.timetable.create',['class'=>$class,'teacher'=>$teacher]);\n }", "public function actionCreate()\n {\n $model = new Lessons();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $model->setStudentsInLessons($model->id);\n return $this->redirect(['/teacher/lessons']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n } \n }", "public function store(StoreTeacher $request)\n {\n // Sanitize input\n $sanitized = $request->validated();\n $checkUserName = Teacher::where(['username'=>$request->get('username')])->get()->toArray();\n if(sizeof($checkUserName) > 0)\n return ['code' => 422, 'Status Code' => '422' , 'message' => 'Duplicate username', \"errors\" => [\"username\"=>[\"The username in used.\"]] ];\n else{\n $sanitized['password'] = Hash::make($sanitized['password']);\n $teacher = Teacher::create($sanitized);\n if ($request->ajax()) {\n return ['redirect' => url('admin/teachers'), 'message' => trans('brackets/admin-ui::admin.operation.succeeded')];\n }\n\n return redirect('admin/teachers');\n }\n }", "public function create(User $user)\n {\n return $user->hasAnyRole(['Teacher']);\n }", "public function actionCreate()\n\t{\n\t\t$model = new Classes;\n\t\tif(isset($_POST['Classes'])) {\n\t\t\t$model->attributes = $_POST['Classes'];\n\t\t\t$model->formTags = isset($_POST['Classes']['formTags']) ? explode(',', $_POST['Classes']['formTags']) : null;\n\t\t\t$model->teachers = isset($_POST['Classes']['teachers']) ? $_POST['Classes']['teachers']: null;\n\t\t\t$model->classDays = isset($_POST['Classes']['classDays']) ? explode(',', $_POST['Classes']['classDays']) : null;\n\t\t\t$model->price = isset($_POST['Classes']['price']) ? $_POST['Classes']['price'] : 0;\n\t\t\t$model->teacher_id = 0;\n\n\t\t\tif($model->save()) {\n\t\t\t\tYii::app()->user->setFlash('success', '<span class=\"icon-check\"></span>&nbsp;&nbsp;اطلاعات با موفقیت ذخیره شد.');\n\t\t\t\t$this->redirect(array('admin'));\n\t\t\t} else\n\t\t\t\tYii::app()->user->setFlash('failed', 'در ثبت اطلاعات خطایی رخ داده است! لطفا مجددا تلاش کنید.');\n\t\t}\n\n\t\t$this->render('create', array(\n\t\t\t\t'model' => $model,\n\t\t));\n\t}", "public function create()\n {\n return view('admin.teachers.create');\n }", "public function createDefaultEntrant(): void\n {\n $entrant = new Entrant();\n $entrant->first_name = $this->first_name;\n $entrant->family_name = $this->last_name;\n $entrant->can_retain_data = $this->can_retain_data;\n if ($entrant->save()) {\n $this->entrants()->save($entrant);\n }\n }", "public function create()\n {\n $teacher_types = \\App\\Teacher_type::pluck('name','id');\n $matter = \\App\\Matter::pluck('name','id');\n\n return view('professors.create',compact('professor','teacher_types','matter'));\n }", "public function createAction()\n {\n $entity = new Titeur();\n $request = $this->getRequest();\n\t\t\t\t$user = $this->get('security.context')->getToken()->getUser();\n $form = $this->createForm(new TiteurType(), $entity, array('user' => $user));\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n\t\t\t\t\t\t$this->get('session')->set('titeur_id', $entity->getId());\n\t\t\t\t\t\t$this->get('session')->setFlash('notice', 'Titeur a été ajouté avec succès');\n\n return $this->redirect($this->generateUrl('enfant_new'));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function store(Request $request)\n {\n $request->validate([\n 'username' => 'required|max:255',\n 'nama' => 'required|max:255',\n 'nip' => 'required|size:13',\n 'email' => 'required|regex:/^.+@.+$/i',\n 'password' => 'required|min:8'\n ]);\n Teacher::create($request->all());\n return redirect('/Dashboard')->with('status', 'Akun Berhasil dibuat!');\n }", "public function create($name)\n {\n return view('Admin.lesson_teacher.create',compact('name'));\n }", "public function getTeacher()\n {\n return $this->hasOne(Teacher::className(), ['teacher_id' => 'teacher_id']);\n }", "public function actionCreate($templateId = false)\n {\n $model = new Training();\n if ($templateId) {\n $template = \\app\\models\\db\\TrainingTemplate::findOne($templateId);\n if (!$template) {\n MgHelpers::throw404();\n }\n $model->training_template_id = $templateId;\n $model->inheritFromTemplate();\n }\n\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll(['lectorsStr'])) {\n if (OeiizkHelpers::isRole(\\app\\models\\mgcms\\db\\User::ROLE_LECTOR)) {\n $trainingLector = new \\app\\models\\db\\TrainingLector;\n $trainingLector->user_id = $this->getUserModel()->id;\n $trainingLector->training_id = $model->id;\n try {\n $trainingLector->save();\n } catch (yii\\db\\IntegrityException $e) {\n\n }\n }\n\n $this->saveParticipantCheckboxes($model);\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(Request $request)\n {\n //\n $teacher=new teacher;\n $teacher->full_name=$request->input(\"name\");\n $teacher->speciality=$request->input(\"speciality\");\n $teacher->number_years_experience=$request->input(\"year_exp\");\n $teacher->save();\n return redirect(\"teachers\");\n \n }", "public function teacher() {\n return $this->belongsTo('App\\Teacher');\n }", "public function teacher ()\n {\n return $this->belongsTo(Teacher::class);\n }", "public function createAction()\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $employee = new Employee();\n $employee->id = $this->request->getPost(\"id\");\n $employee->name = $this->request->getPost(\"name\");\n $employee->surename = $this->request->getPost(\"surename\");\n $employee->patronymic = $this->request->getPost(\"patronymic\");\n $employee->position = $this->request->getPost(\"position\");\n $employee->departmentId = $this->request->getPost(\"department_id\");\n \n\n if (!$employee->save()) {\n foreach ($employee->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'new'\n ]);\n\n return;\n }\n\n $this->flash->success(\"employee was created successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"employee\",\n 'action' => 'index'\n ]);\n }", "public function teacher()\n {\n return $this->belongsTo(Teacher::class);\n }", "public function registerTeacher($name, $subject, $username, $password, $con_password, $picture, $address, $role, $admin){\n\t\t\tif ($password != $con_password) {\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\t$sql = \"INSERT INTO teacher (id, name, username, passwordz, picture, address, subject_id, role, admin_id, created_at, updated_at) VALUES (NULL, '$name', '$username', '$password', '$picture', '$address', '$subject', '$role', '$admin', NULL, NULL)\";\n\t\t\t\t$this->connection()->exec($sql);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t}", "public function store(Request $request)\n {\n //$teacher=Teacher::create($request->all());\n $teacher=new Teacher();\n $teacher->teacher_name=Input::get('teacher_name');\n $teacher->email=Input::get('email');\n $hash=Input::get('password');\n $teacher->password=bcrypt($hash);\n $teacher->contact=Input::get('contact');\n\n if(Input::hasFile('image')){\n $file = Input::file('image');\n $file = $file->move(public_path().'/uploads/images/',$file->getClientOriginalName());\n $teacher->image = $file->getFileName();\n }\n\n $teacher->save();\n\n User::create([\n 'name' => $teacher->teacher_name,\n 'email' => $request['email'],\n 'userable_type' => 'Teacher',\n 'userable_id' => $teacher->id,\n 'password' => bcrypt($request['password']),\n ]);\n\n\n\n return redirect('/teacher/dashboard');\n }", "public function create()\n {\n $academics=Academic::all();\n $subjects=Subject::all();\n $classrooms=Classroom::all();\n $teachers=Teacher::all();\n return view('Backend.timetable.new',compact('academics','subjects','classrooms','teachers'));\n \n }", "protected function _createUser()\n {\n $data = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $user = $this->Users->newEntity($data);\n\n $user->set('active', true);\n $user->set('role_id', 1);\n\n $this->Users->save($user);\n }", "public function addteacher()\n {\n return view('admin.addteacher');\n }", "public function teacher_registration(){\n\n\t\t$data['title_page'] = 'Teacher | Registration';\n\t\t$this->load->view('teach/reg_teach', $data);\n\n\t\t/* here is the validation to the form submitted in creating the new teacher_account_tbl;*/\n\n\t}", "public function teacher(){\n\t\treturn $this->belongsTo('App\\Teacher');\n\t}", "public function create()\r\n {\r\n $this->isExistsSchoolSubject()\r\n ->isNameAlpha()\r\n ->setResult()\r\n ->addSchoolSubject()\r\n ->sendResult();\r\n }", "public function actionCreate()\n\t{\n\t\t$model=new Employer;\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['Employer']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Employer'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->employer_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(Request $request)\n {\n $paper = new Paper;\n $paper->paper_name = 'God of War';\n $paper->paper_type = 'ai';\n\n $paper->save();\n\n $user = User::findOrFail(1);\n $paper->teacher()->attach($user);\n\n return 'Success';\n }", "public function create($entity);", "public function store(Request $request)\n {\n \n $teacher_id=$request->input('Teacher');\n $class_id=$request->input('Class'); \n \n $teacher = User::find($teacher_id);\n $class = Classes::find($class_id);\n //dd($class);\n \n $teacher->Classes()->attach($class);\n return Redirect::to('teacherclasses')\n ->with('success','Great! Race info created successfully.');\n \n }", "public function create() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"INSERT INTO users (id, mail, name, password, role, state) VALUES (?, ?, ?, ?, ?, ?)\");\n\t\t$stmt->execute(array($this->id, $this->mail, $this->name, $this->password, $this->role, $this->state));\n\t}", "public function apiAuthV1TeachingClassTeacherInvitationPost()\n {\n $this->apiAuthV1TeachingClassTeacherInvitationPostWithHttpInfo();\n }", "public function teacher() {\n return $this->belongsTo('App\\Models\\User', 'user_id');\n }", "public function addTeacher($name, $email, $cell, $uname){\n\t\t$data = $this -> create(\"INSERT INTO teachers (name, email, cell, uname) VALUES ('$name', '$email', '$cell', '$uname') \");\n\n\t\tif ($data) {\n\t\t\treturn '<p class=\"alert alert-success\">Teacher Registration Successful !! <button class=\"close\" data-dismiss=\"alert\">&times;</button> </p>';\n\t\t}\n\t}", "public function create() {\n /*$id = json_decode($_POST['id']);\n $name = json_decode($_POST['name']);\n $usr = User();\n $usr->id = $id;\n $usr->name = $name;\n $usr->save();*/\n }", "public function actionCreate()\n {\n $model = new RoleForm();\n\n if ($model->load(Yii::$app->request->post()) ) {\n $role = new \\yii\\rbac\\Role();\n $role->description = $model->description;\n $role->type = $model->type;\n $role->ruleName = empty($model->rule_name) ? null : $model->rule_name;\n $role->data = $model->data;\n\n $this->authManager->add($role);\n if(is_array($model->child) && count($model->child)){\n foreach($model->child as $name){\n $this->authManager->addChild($role,$this->authManager->getPermission($name));\n }\n }\n return $this->redirect(['update', 'id' => $model->name]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'permissions' => $this->authManager->getPermissions()\n ]);\n }\n }", "public function actionCreate()\n {\n $session = \\yii::$app->session;\n $user_type = $session->get('type',-1);\n\n $model = new Student();\n $user = new User();\n\n if ($model->load(Yii::$app->request->post())) {\n $stu = User::findOne($model->user_id);\n if($stu !== null){\n $model->addError('user_id', 'ID exists');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n $user->id = $model->user_id;\n $user->username = strval($model->user_id);\n $user->password = '#'.$model->stu_ssn;\n $user->user_type = 2;\n if($model->stu_cost === ''){\n $model->stu_cost = 0;\n }\n if($user->save()) {\n if ($model->save()) {\n return $this->redirect(['view', 'id' => $model->user_id]);\n }\n else{\n $user->delete();\n }\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }" ]
[ "0.7414932", "0.739297", "0.7250668", "0.66026896", "0.6550837", "0.65495795", "0.6535018", "0.64804125", "0.64538103", "0.6396742", "0.63817155", "0.6374572", "0.63292444", "0.63292444", "0.63292444", "0.6290915", "0.62465405", "0.6187319", "0.6180495", "0.6175673", "0.60975677", "0.60813266", "0.60671675", "0.6045641", "0.60385877", "0.60369116", "0.5988887", "0.59758776", "0.59742606", "0.5965204", "0.5893109", "0.58757323", "0.5786722", "0.57533324", "0.5749459", "0.57377183", "0.5730898", "0.57274085", "0.56988835", "0.5696505", "0.5688618", "0.5678544", "0.5677952", "0.56681466", "0.5655246", "0.564079", "0.5638738", "0.56253076", "0.5624819", "0.5588594", "0.55687046", "0.554446", "0.554353", "0.55408627", "0.55368805", "0.55320245", "0.55247396", "0.548425", "0.5466834", "0.5448918", "0.5445205", "0.54425275", "0.5435354", "0.5425388", "0.5414705", "0.5408027", "0.5406514", "0.539108", "0.53906894", "0.5382415", "0.5371521", "0.5360567", "0.53264445", "0.52990454", "0.52821916", "0.5274756", "0.52712595", "0.52698976", "0.52630985", "0.5259905", "0.5238816", "0.5231144", "0.5228758", "0.52267677", "0.52112937", "0.5181148", "0.5167542", "0.5160164", "0.51587737", "0.5156254", "0.5155788", "0.5140878", "0.5123942", "0.5102228", "0.5087078", "0.5086489", "0.5086419", "0.5075312", "0.50745696", "0.50698435" ]
0.6744889
3
Using single captcha key:
public function registerAction() { $captcha = new Zend_Captcha_Image(array( 'captcha' => 'Image', 'wordLen' => 4, 'timeout' => 300, 'font' => 'NewtonC.ttf', 'width' => 100, 'height' => 40, 'dotNoiseLevel' => 0, 'lineNoiseLevel' => 0 )); $captcha->setName('captcha'); $values = array(); if($this->getRequest()->isPost()) { $values = $this->getRequest()->getPost(); if(!$captcha->isValid($_POST['captcha'], $_POST)) { $this->view->captcha_error = true; } else { //dump($this->getRequest()->getPost()); //проверить имя пользователя $user_model = new Model_Users(); $error = false; $error = Model_Users::register($values); if(!$error) { $this->view->user_error = Vida_Helpers_Text::_T("Пользователь с таким именем или email уже зарегистрирован в системе"); } else { $this->_helper->redirector('success', 'index'); } } } $this->view->values = json_encode($values); $this->view->captcha_id = $captcha->generate(); $this->view->captcha = $captcha->render($this->view); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function capcha_draw($min_length,$max_length)\n{\n\n require_once('kcaptcha/kcaptcha.php');\n\n $kcaptcha = new KCAPTCHA($min_length,$max_length);\n //$_SESSION['capcha_code'] = $kcaptcha->getKeyString();\n session_set('capcha_code',$kcaptcha->getKeyString());\n return true;\n}", "private function generate_captcha(){\n\t\t$s = $this->session;\n\t\tif($s->contains('captcha') && $s->get('captcha_time') > time() - 1800){\n\t\t\t$s->set('captcha', $s->get('captcha') + 1);\n\t\t\tif($s->get('captcha') > 10) {\n\t\t\t\t$this->data['show_captcha'] = true;\n\t\t\t\t$s->set('require_captcha', true);\n\t\t\t}\n\t\t} else {\n\t\t\t$s->set('captcha', 1);\n\t\t\t$s->set('captcha_time', time());\n\t\t\t$s->wipe('require_captcha');\n\t\t}\n\t}", "private function setCaptchaCode()\n\t{\n\t\t$Pass= Controler_Main::getInstance()->getRandomPass(5);\n\t\t$_SESSION['Captcha']=$Pass;\n\t}", "public function createCaptcha();", "function phpfmg_captcha_name(){\r\n if( !isset($_SESSION['captcha_name']) ){\r\n $_SESSION['captcha_name'] = phpfmg_rand(8); //PHPFMG_ID.'fmgCaptchCode';\r\n };\r\n return $_SESSION['captcha_name'];\r\n}", "private function _create_captcha()\n\t{\n\t\t$cap = create_captcha(config_captcha());\n\t\t$image = $cap['image'];\n\t\t$this->session->set_userdata('captchaword', $cap['word']);\n\t\treturn $image;\n\t}", "function setValidatedCaptcha(){\n\n\t$CI = &get_instance();\n\t$code = mt_rand();\n\t$CI->session->set_userdata('validated_captcha_code', $code);\n\treturn $code;\n}", "function spamcaptcher_get_captcha($accountID = null, $settings = \"{}\"){\r\n\t$sc_obj = new SpamCaptcher($accountID, null);\r\n\t$sc_obj->setSettings($settings);\r\n\treturn $sc_obj->getCaptcha();\r\n}", "function askapache_captcha($type=1,$numletters=4,$fontsize=22){\n $capya_string=capya_string($numletters); // the letters and numbers displayed on captcha\n $capya_bgfile=CAPYAINC.'n.png'; // the background image for the captcha\n $capya_filename='askapache-'.rand(1111,999999).'.jpg'; // the filename of finished captcha\n $capya_file=CAPYADIR.$capya_filename; // the full path to finished captcha\n $capya_uri=CAPYAURI.$capya_filename; // the public web address to finished captcha\n $rgb[0]=array(204,0,0);\n $rgb[1]=array(34,136,0);\n $rgb[2]=array(51,102,204);\n $rgb[3]=array(141,214,210);\n $rgb[4]=array(214,141,205);\n $rgb[5]=array(100,138,204);\n\n // create image from background image\n $image=imagecreatefrompng($capya_bgfile);\n\n // store the md5 of the captcha string\n $_SESSION['askapache_captcha'] = md5($capya_string);\n\n // add chars to captcha image\n $g=$fontsize;\n for($i=0; $i<$numletters; $i++){\n $L[]=substr($capya_string,$i,1); // each char from string into individual variable\n $A[]=rand(-20, 20); // random angle for each char\n $F[]=CAPYAINC.rand(1, 10).\".ttf\"; // random font for each char\n $C[]=rand(0, 5); // random color for each char\n $T[]=imagecolorallocate($image,$rgb[$C[$i]][0],$rgb[$C[$i]][1],$rgb[$C[$i]][2]); // allocate colors for chars\n imagettftext($image, $fontsize, $A[$i], $g, $fontsize+15, $T[$i], $F[$i], $L[$i]); // write chars to image\n $g+=$fontsize+10;\n }\n\n // save jpeg image to public web folder\n imagejpeg($image, $capya_file);\n\n if($type===1){\n // output the image url\n echo '<p><label for=\"capya\" class=\"S\"><input id=\"capya\" name=\"capya\" type=\"text\" value=\"\" size=\"5\" class=\"buttonNGrey\" autocomplete=\"off\" style=\"width:150px\" maxlength=\"5\" /></label><br><br></p>';\n echo '<img src=\"'.$capya_uri.'\"</>';\n } else echo '';\n\n // destroy image\n imagedestroy($image);\n\n // delete all captcha images at 12 and 3 oclock if more than 100 are found\n $dt=date('g');\n if(($dt==12)||($dt=='12'))capya_cleanup();\n else if(($dt==3)||($dt=='3'))capya_cleanup();\n}", "function ShowCaptcha($param = '') {\n if (USER::$logged_in) {\n return '';\n }\n $captcha = empty($param) ? CONFIG::getValue('main', 'captcha') : $param;\n $code = mt_rand(0, 666);\n if ($captcha === 'Random') {\n $types = ['Original', 'Color'];\n $captcha = $types[mt_rand(0, 1)]; # Change system CAPTCHA\n $result = ShowCaptcha($captcha);\n $captcha = 'Random'; # Restore system CAPTCHA\n return $result;\n }\n return '\n <img src=\"'.TOOLS.'captcha.php?code='.$code.'\" width=\"90\" height=\"30\" alt=\"CAPTCHA\" /><br />\n <input type=\"hidden\" name=\"antispam\" value=\"'.$code.'\" />\n <input type=\"text\" name=\"captcheckout\" id=\"captcheckout\" value=\"\" size=\"10\" class=\"required\" />\n ';\n}", "public function captcha()\n {\n //生成验证码图片的Builder对象,配置相应属性\n $builder = new CaptchaBuilder;\n //可以设置图片宽高及字体\n $builder->build($width = 80, $height = 40, $font = null);\n //获取验证码的内容\n $phrase = $builder->getPhrase();\n\n //把内容存入session\n Session::flash('code', $phrase);\n //生成图片\n header(\"Cache-Control: no-cache, must-revalidate\");\n header('Content-Type: image/jpeg');\n $builder->output();\n }", "private function getCaptchaString() {\n\t\t// I don't use 0,o, O, 1, I, i because they could be confusing for the user,\n\t\t// but you can customize your allowed characteres here\n\t\t$allowedChars = 'QWERTYUPASDFGHJKLZXCVBNM23456789'; \n\t\t$allowedChars = $allowedChars . strtolower($allowedChars);\n\t\t\n\t\t$captcha = '';\n\t\tfor ($i = 0; $i < $this->setting['length']; $i++) {\n\t\t\t$captcha .= $allowedChars[rand(0, strlen($allowedChars) - 1)];\n\t\t}\n\t\t\n\t\t//**SESSION**\n\t\t$_SESSION['captcha'] = $captcha;\n\t}", "function get_b2evo_captcha()\n\t\t{\n\t\t\t$this->make_captcha();\n\t\t\tif($public=='') $public = $this->public_key;\n\t\t\treturn str_replace($_SERVER['DOCUMENT_ROOT'],'',$this->tempfolder).$this->filename_prefix.$public.'.jpg';\n\t\t}", "function captcha(){\n $ci = get_instance();\n // Write your logic as per requirement\n //Caractère permis\n $permitted_chars = 'ABCDEFGHJKLMNOPQRSTUVWXYZ1234567890';\n\n $image = imagecreatetruecolor(200, 50);\n imageantialias($image, true);\n\n //Variable de couleur\n $colors = [];\n //Liste couleur aléatoire\n $red = rand(125, 170);\n $green = rand(125, 175);\n $blue = rand(125, 180);\n\n for($i = 0; $i < 5; $i++){\n //Contaste trame de fond\n $colors[] = imagecolorallocate($image, $red - 25*$i, $green - 25*$i, $blue - 25*$i);\n }\n\n //Couleur du fond BG\n imagefill($image, 100, 0, $colors[0]);\n\n for($i = 0; $i < 10; $i++){\n //largeur des traits aléatoire\n imagesetthickness($image, rand(2, 10));\n //Couleur des traits\n $line_color = $colors[rand(1, 4)];\n imagerectangle($image, rand(-10, 190), rand(-10, 10), rand(-10, 190), rand(40, 60), $line_color);\n }\n\n //Couleur du texte\n $white = imagecolorallocate($image, 255, 255, 255);\n\n //Police d'écriture\n $fonts = [APPPATH . 'helpers/Captcha/fonts/VEnigma/VEnigma45.ttf',\n APPPATH . 'helpers/Captcha/fonts/Ubuntu/Ubuntu-Regular.ttf',\n APPPATH . 'helpers/Captcha/fonts/Didact_Gothic/DidactGothic-Regular.ttf'\n ];\n\n //Longueur de la chaine caractère\n $string_length = \"4\";\n $captcha_string = generate_string($permitted_chars, $string_length);\n\n $_SESSION['captcha_text'] = $captcha_string;\n\n for($i = 0; $i < $string_length; $i++) {\n $letter_space = 170/$string_length;\n $initial = 15;\n imagettftext($image, 24, rand(-15, 15), $initial + $i*$letter_space, rand(25, 45), $white, $fonts[array_rand($fonts)], $captcha_string[$i]);\n }\n\n //header('Content-type: image/png');\n ob_start();\n imagepng($image);\n imagedestroy($image);\n $imagedata = ob_get_clean();\n\n return base64_encode($imagedata);\n }", "public function refereshCapcha(){\n return captcha_img('flat');\n }", "function _create_captcha()\n\t{\n\t\t$this->load->helper('captcha');\n\n\t\t$cap = create_captcha(array(\n\t\t\t'img_path'\t\t=> './'.$this->config->item('captcha_path', 'tank_auth'),\n\t\t\t'img_url'\t\t=> base_url().$this->config->item('captcha_path', 'tank_auth'),\n\t\t\t'font_path'\t\t=> './'.$this->config->item('captcha_fonts_path', 'tank_auth'),\n\t\t\t'font_size'\t\t=> $this->config->item('captcha_font_size', 'tank_auth'),\n\t\t\t'img_width'\t\t=> $this->config->item('captcha_width', 'tank_auth'),\n\t\t\t'img_height'\t=> $this->config->item('captcha_height', 'tank_auth'),\n\t\t\t'show_grid'\t\t=> $this->config->item('captcha_grid', 'tank_auth'),\n\t\t\t'expiration'\t=> $this->config->item('captcha_expire', 'tank_auth'),\n\t\t));\n\n\t\t// Save captcha params in session\n\t\t$this->session->set_flashdata(array(\n\t\t\t\t'captcha_word' => $cap['word'],\n\t\t\t\t'captcha_time' => $cap['time'],\n\t\t));\n\n\t\treturn $cap['image'];\n\t}", "public function src()\n {\n return url('captcha').'?'.Str::random(8);\n }", "public function showCaptcha() {\n CaptchaModel::generateAndShowCaptcha();\n }", "private function _generateCaptcha() {\n echo '<div class=\"g-recaptcha\" data-sitekey=\"' . self::$siteKey . '\"></div>';\n }", "private function generateCaptchaData()\n {\n $num1 = rand(1, 10) * rand(1, 3);\n $num2 = rand(1, 10) * rand(1, 3);\n $this->answer = $num1 + $num2;\n $this->question = trans('Webflorist-FormFactory::formfactory.captcha_questions.math', ['calc' => $num1 . ' + ' . $num2]);\n\n session()->put(\n $this->sessionKey,\n [\n 'question' => $this->question,\n 'answer' => $this->answer\n ]\n );\n }", "public function getCaptcha() {\n\t\t$this->getCaptchaString();\n\t\t$this->generateImage();\n\t}", "function _create_captcha()\n\t{\n\t\t$this->load->helper('captcha');\n\n\t\t$cap = create_captcha(array(\n\t\t\t'img_path'\t\t=> './'.config_item('captcha_path'),\n\t\t\t'img_url'\t\t=> base_url().config_item('captcha_path'),\n\t\t\t'font_path'\t\t=> './'.config_item('captcha_fonts_path'),\n\t\t\t'font_size'\t\t=> config_item('captcha_font_size'),\n\t\t\t'img_width'\t\t=> config_item('captcha_width'),\n\t\t\t'img_height'\t=> config_item('captcha_height'),\n\t\t\t'show_grid'\t\t=> config_item('captcha_grid'),\n\t\t\t'expiration'\t=> config_item('captcha_expire'),\n\t\t));\n\n\t\t// Save captcha params in database\n\t\t$data = array(\n \t\t\t\t'captcha_time' => time(),\n \t\t\t\t'ip_address' => $this->input->ip_address(),\n \t\t\t\t'word' => $cap['word']\n \t\t\t\t);\n\t\t$query = $this->db->insert_string('fx_captcha', $data);\n\t\t$this->db->query($query);\n\n\t\treturn $cap['image'];\n\t}", "public function enableCaptcha(): void;", "function _create_captcha()\n\t{\n\t\t$this->load->helper('captcha');\n\n\t\t$cap = create_captcha(array(\n\t\t\t'img_path'\t\t=> './'.$this->config->item('captcha_path', 'tank_auth'),\n\t\t\t'img_url'\t\t=> base_url().$this->config->item('captcha_path', 'tank_auth'),\n\t\t\t'font_path'\t\t=> './'.$this->config->item('captcha_fonts_path', 'tank_auth'),\n\t\t\t'font_size'\t\t=> $this->config->item('captcha_font_size', 'tank_auth'),\n\t\t\t'img_width'\t\t=> $this->config->item('captcha_width', 'tank_auth'),\n\t\t\t'img_height'\t=> $this->config->item('captcha_height', 'tank_auth'),\n\t\t\t'show_grid'\t\t=> $this->config->item('captcha_grid', 'tank_auth'),\n\t\t\t'expiration'\t=> $this->config->item('captcha_expire', 'tank_auth'),\n\t\t));\n\t\t\n\t\t// Save captcha params in session\n\t\t$this->session->set_flashdata('captcha_word', $cap['word']);\n\t\t$this->session->set_flashdata('captcha_time', $cap['time']);\n\t\t$cookie = array(\n\t\t\t\t'name' => 'captchaword',\n\t\t\t\t'value' => $cap['word'],\n\t\t\t\t'expire' => '180',\n\t\t\t\t'secure' => FALSE\n\t\t);\n\t\t$cookie1 = array(\n\t\t\t\t'name' => 'captchatime',\n\t\t\t\t'value' => $cap['time'],\n\t\t\t\t'expire' => '180',\n\t\t\t\t'secure' => FALSE\n\t\t);\n\t\t$this->input->set_cookie($cookie1);\n\t\t$this->input->set_cookie($cookie);\n\t\t\n// \t\t$this->session->set_flashdata(array(\n// \t\t\t\t'captcha_word' => $cap['word'],\n// \t\t\t\t'captcha_time' => $cap['time'],\n// \t\t));\n\t\t\t\t\n\t\treturn $cap['image'];\n\t}", "function _make_captcha(){\n\t $vals = array(\n\t 'img_path' => './captcha/', // PATH for captcha ( *Must mkdir (htdocs)/captcha )\n\t 'img_url' => base_url() . 'captcha/', // URL for captcha img\n\t 'img_width' => 165, // width\n\t 'img_height' => 46, // height\n\t 'font_path' => './fonts/inder-regular-webfont.ttf',\n\t 'expiration' => 3600 ,\n\t );\n\t // Create captcha\n\t $cap = create_captcha( $vals );\n\t // Write to DB\n\t if ( $cap ) {\n\t $data = array(\n\t 'captcha_id' => '',\n\t 'captcha_time' => $cap['time'],\n\t 'ip_address' => $this -> input -> ip_address(),\n\t 'word' => $cap['word'] ,\n\t );\n\t $query = $this -> db -> insert_string( 'captcha', $data );\n\t $this -> db -> query( $query );\n\t }else {\n\t return \"Umm captcha not work\" ;\n\t }\n\t return $cap['image'] ;\n\t }", "function _create_captcha()\n {\n $this->load->helper('captcha');\n\n $cap = create_captcha(array(\n 'img_path'\t\t=> './'.$this->config->item('captcha_path', 'tank_auth'),\n 'img_url'\t\t=> base_url().$this->config->item('captcha_path', 'tank_auth'),\n 'font_path'\t\t=> './'.$this->config->item('captcha_fonts_path', 'tank_auth'),\n 'font_size'\t\t=> $this->config->item('captcha_font_size', 'tank_auth'),\n 'img_width'\t\t=> $this->config->item('captcha_width', 'tank_auth'),\n 'img_height'\t=> $this->config->item('captcha_height', 'tank_auth'),\n 'show_grid'\t\t=> $this->config->item('captcha_grid', 'tank_auth'),\n 'expiration'\t=> $this->config->item('captcha_expire', 'tank_auth'),\n ));\n\n // Save captcha params in session\n $this->session->set_flashdata(array(\n 'captcha_word' => $cap['word'],\n 'captcha_time' => $cap['time'],\n ));\n\n return $cap['image'];\n }", "public function getCaptcha()\n {\n $random = str_random(5);\n\n return $random;\n }", "function check_captcha(){\n\t\t$captcha = FSInput::get('txtCaptcha');\n if ( $captcha == $_SESSION[\"security_code\"]){\n return true;\n } \n return false;\n\t}", "public function captcha(){\n\t $image = @imagecreatetruecolor(120, 30) or die(\"Cannot Initialize new GD image stream\");\n\n\t // set background to white and allocate drawing colours\n\t //$background = imagecolorallocate($image, 251, 252, 234);\n\t $background = imagecolorallocate($image, 252, 252, 252);\n\t imagefill($image, 0, 0, $background);\n\t //$linecolor = imagecolorallocate($image, 0xCC, 0xCC, 0xCC);\n\t $linecolor = imagecolorallocate($image, 255, 255, 255);\n\t $textcolor_arr = imagecolorallocate($image, 0x33, 0x33, 0x33);\n\n\t // draw random lines on canvas\n\t for($i=0; $i < 3; $i++) {\n\t\timagesetthickness($image, rand(1,3));\n\t\timageline($image, 0, rand(0,30), 120, rand(0,30), $linecolor);\n\t }\n\n\t //session_start();\n\t\t//if(!isset($_SESSION)): session_start(); endif;\n\n\t $captcha_text = '';\n\t for($x = 20; $x <= 100; $x += 20) {\n\t\t$captcha_text .= ($num = rand(0, 9));\n\t\t$new_x = $x - 3; \n\t\timagechar($image, 5, $new_x, 8, $num, $textcolor_arr);\n\t\t//imagechar($image, rand(3, 5), $new_x, rand(2, 14), $num, $textcolor_arr);\n\t }\n\n\t // record digits in session variable\n\t //$_SESSION['sess_captcha'] = $captcha_text;\n\t $this->session->set_userdata('captcha_word', $captcha_text);\t\t\n\t // display image and clean up\n\t header('Content-type: image/png');\n\t imagepng($image);\n\t imagedestroy($image);\n\t\n\t}", "function wert9_captcha($fields){\n unset($fields['url']); // del input with url \n unset($fields['cookies']); // del checkbox for cookies\n \n //add captcha\n $a = rand(1,10);\n $b = rand(1,10);\n // начинаем сессию\n $_SESSION['summ'] = $a + $b;\n\n $img1 = plugins_url('/tp/img/'.$a.'.png', __FILE__);\n $img2 = plugins_url('/tp/img/'.$b.'.png', __FILE__);\n ob_start();\n include dirname(__FILE__).\"/tp/captcha.php\"; // file with template HTML captcha\n $fields['captcha'] = ob_get_contents();\n ob_end_clean();\n\n return $fields;\n}", "function showCaptcha()\n {\n $captcha_model = $this->loadModel('Captcha');\n $captcha_model->generateCaptcha();\n }", "function captcha_create_session()\n\t{\n\t\t//-----------------------------------------\n\t\t// Clear old\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->captcha_clear_sessions( $this->ipsclass->ip_address );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Create new ID\n\t\t//-----------------------------------------\n\t\t\n\t\t$captcha_unique_id = md5( uniqid( time() ) );\n\t\t$captcha_string = \"\";\n\t\t\n\t\t//-----------------------------------------\n\t\t// Create new string\n\t\t//-----------------------------------------\n\t\t\n\t\tmt_srand( (double) microtime() * 1000000 );\n\t\t$final_rand = md5( uniqid( mt_rand(), TRUE ) );\n\t\tmt_srand(); \n\n\t\tfor( $i = 0; $i < 6; $i++ )\n\t\t{\n\t\t\t$captcha_string .= $final_rand{ mt_rand(0, 31) };\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Add to the DB\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->DB->do_insert( 'captcha', array( 'captcha_unique_id' => $captcha_unique_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'captcha_string' => $captcha_string,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'captcha_ipaddress' => $this->ipsclass->ip_address,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'captcha_date' => time() ) );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t//-----------------------------------------\n\t\t// Return ID\n\t\t//-----------------------------------------\n\t\t\n\t\treturn $captcha_unique_id;\n\t}\n\t\n\t/*-------------------------------------------------------------------------*/\n\t// Captcha validate\n\t/*-------------------------------------------------------------------------*/\n\t\n\t/**\n\t* Show the captcha bot image \n\t*\n\t* @param\tstring\tcaptcha_unique_id\tThe captcha DB row\n\t* @param\tstring\tcaptcha_input\t\tThe user entered data\n\t* @return\tvoid\n\t* @since\t1.0\n\t*/\n\tfunction captcha_validate( $captcha_unique_id, $captcha_input )\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$captcha_input = trim( strtolower($captcha_input) );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get the info from the DB\n\t\t//-----------------------------------------\n\t\t\n\t\t$captcha = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'captcha',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"captcha_unique_id='\".$captcha_unique_id.\"'\" ) );\n\t\n\t\tif ( ! $captcha['captcha_unique_id'] )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Check...\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $captcha['captcha_string'] != $captcha_input )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t}\n\t\n\t/*-------------------------------------------------------------------------*/\n\t// Captcha show image\n\t/*-------------------------------------------------------------------------*/\n\t\n\t/**\n\t* Show the captcha bot image \n\t*\n\t* @param\tstring\tcaptcha_unique_id\n\t* @return\tvoid\n\t* @since\t1.0\n\t*/\n\tfunction captcha_show_image( $captcha_unique_id )\n\t{\n\t\t//-----------------------------------------\n\t\t// CHECK\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( ! $captcha_unique_id )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get the info from the DB\n\t\t//-----------------------------------------\n\t\t\n\t\t$captcha = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'captcha',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"captcha_unique_id='\".$captcha_unique_id.\"'\" ) );\n\t\n\t\tif ( ! $captcha['captcha_unique_id'] )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Show it...\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->captcha_show_gd_img( $captcha['captcha_string'] );\n\t}\n\t\n\t/*-------------------------------------------------------------------------*/\n\t// Show GD created security image...\n\t/*-------------------------------------------------------------------------*/\n\t\n\t/**\n\t* Show anti-spam bot GD image numbers\n\t*\n\t* @param\tstring\tNumber string\n\t* @return\tvoid\n\t* @since\t1.0\n\t*/\n\tfunction captcha_show_gd_img( $content=\"\" )\n\t{\n\t\t//-----------------------------------------\n\t\t// Is GD Available?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( ! extension_loaded('gd') )\n\t\t{\n\t\t\tif ( $this->show_error_gd_img )\n\t\t\t{\n\t\t\t\t@header( \"Content-Type: image/gif\" );\n\t\t\t\tprint base64_decode( \"R0lGODlhyAA8AJEAAN/f3z8/P8zMzP///yH5BAAAAAAALAAAAADIADwAAAL/nI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8YhMlgACwEHQXESfzgOzykQAqgMmFMr9Rq+GbHlqAFsFWnFVrfwIAvQAu15P0A14Nn8/ADhXd4dnl2YYCAioGHBgyDbnNzBIV0gYxzEYWdg1iLAnScmFuQdAt2UKZTcl+mip+HoYG+tKOfv3N5l5garnmPt6CwyaFzrranu7i0crObvoaKvMyMhrIQhFuyzcyGwXcOpoLYg7DGsZXk5r6DSN51RNfF0RPU5sy7gpnH5bjLhrk7Y9/RQNisfq2CRJauTR6xUuFyBx/yrWypMMmTlq/9IwQnKWcKG5cvMeShBIMOFIaV9w2eti6SBABAyjvBRFMaZCMaxsqtxl8iShjpj+VfqGCJg4XzOfJCK5DVWliFNXlSIENKjWrVy7ev0KNqzYsWTFwhlFU8waLk+efGF7hi0aSgu3iGmV1cxdoGTinimbiGOeP8SWhps6z3AkeMMWW20mMykqQyuJDbYWdufKBJWc2uWmAJZdO0yOKfTCCqHGiO4E/oKGriTYaBw5g/MDqynNlW9Uhmx66tM2i05dNcM8O6Rg2MHLYKraLTpDcLebTke4APkcduAoku0DWpe24MI96ewZPdiy6Rlx/0Y+XJevlNu/z6vtlHFxZbpv9f9edYkfxgVmjnqSxXYOYPfFVMgXIHGC0ltWDNXYJ6Lsw82AFVpWEk4pEabgbsfBM5FphyDWRh1OLCUgbC06NtNU6UV1T1Jl3YhjjjruyGOPPv4IZJBC6tDXGUDB4UUaK06RhRl/0aWWF3CR4YWESraR1ZCh6dMOiMNIFE2GI/bRJYiIEeULiloyUNSFLzWC3VXcqEJXTBe1qApDpbXUEYxr2tYeQCyyGMuIcxbokHfPvPjHf25mqeWHoLEX0iH0UScmUzSWNxmj20yH6Z+/yNTeM0N1cumkg9E4GHnluLcfeKLm95yLoO5ZKJrhgeaQm4xlFGshcK3pYZ9LradQrmY5nmhVdMm+qqpKYkIqpDyltWkpjJJaaKmd6kXjHUXvDPborOaei2666q7LbrvuvgtvvPLOS2+9YBUAADs=\" );\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$content = ' '. preg_replace( \"/(\\w)/\", \"\\\\1 \", $content ) .' ';\n\t\t$allow_fonts = isset( $this->ipsclass->vars['captcha_allow_fonts'] ) ? $this->ipsclass->vars['captcha_allow_fonts'] : 1;\n\t\t$use_fonts = 0;\n\t\t$tmp_x = 135;\n\t\t$tmp_y = 20;\n\t\t$image_x = 200;\n\t\t$image_y = 60;\n\t\t$circles = 3;\n\t\t$continue_loop = TRUE;\n\t\t$_started = FALSE;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get backgrounds and fonts...\n\t\t//-----------------------------------------\n\t\t\n\t\t$backgrounds = $this->_captcha_show_gd_img_get_backgrounds();\n\t\t$fonts = $this->_captcha_show_gd_img_get_fonts();\n\t\n\t\t//-----------------------------------------\n\t\t// Seed rand functions for PHP versions that don't\n\t\t//-----------------------------------------\n\t\t\n\t\tmt_srand( (double) microtime() * 1000000 );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Got a background?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $this->ipsclass->vars['gd_version'] > 1 )\n\t\t{\n\t\t\twhile ( $continue_loop )\n\t\t\t{\n\t\t\t\tif ( is_array( $backgrounds ) AND count( $backgrounds ) )\n\t\t\t\t{\n\t\t\t\t\t$i = mt_rand(0, count( $backgrounds ) - 1 );\n\t\t\t\t\n\t\t\t\t\t$background = $backgrounds[ $i ];\n\t\t\t\t\t$_file_extension = preg_replace( \"#^.*\\.(\\w{2,4})$#is\", \"\\\\1\", strtolower( $background ) );\n\t\t\t\t\n\t\t\t\t\tswitch( $_file_extension )\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'jpg':\n\t\t\t\t\t\tcase 'jpe':\n\t\t\t\t\t\tcase 'jpeg':\n\t\t\t\t\t\t\tif ( ! function_exists('imagecreatefromjpeg') OR ! $im = @imagecreatefromjpeg($background) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tunset( $backgrounds[ $i ] );\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$continue_loop = FALSE;\n\t\t\t\t\t\t\t\t$_started = TRUE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'gif':\n\t\t\t\t\t\t\tif ( ! function_exists('imagecreatefromgif') OR ! $im = @imagecreatefromgif($background) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tunset( $backgrounds[ $i ] );\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$continue_loop = FALSE;\n\t\t\t\t\t\t\t\t$_started = TRUE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'png':\n\t\t\t\t\t\t\tif ( ! function_exists('imagecreatefrompng') OR ! $im = @imagecreatefrompng($background) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tunset( $backgrounds[ $i ] );\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$continue_loop = FALSE;\n\t\t\t\t\t\t\t\t$_started = TRUE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\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$continue_loop = FALSE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Still not got one? DO OLD FASHIONED\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $_started !== TRUE )\n\t\t{\n\t\t\tif ( $this->ipsclass->vars['gd_version'] == 1 )\n\t\t\t{\n\t\t\t\t$im = imagecreate($image_x, $image_y);\n\t\t\t\t$tmp = imagecreate($tmp_x, $tmp_y);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$im = imagecreatetruecolor($image_x, $image_y);\n\t\t\t\t$tmp = imagecreatetruecolor($tmp_x, $tmp_y);\n\t\t\t}\n\t\t\t\n\t\t\t$white = ImageColorAllocate($tmp, 255, 255, 255);\n\t\t\t$black = ImageColorAllocate($tmp, 0, 0, 0);\n\t\t\t$grey = ImageColorAllocate($tmp, 200, 200, 200 );\n\n\t\t\timagefill($tmp, 0, 0, $white);\n\n\t\t\tfor ( $i = 1; $i <= $circles; $i++ )\n\t\t\t{\n\t\t\t\t$values = array(\n\t\t\t\t\t\t\t\t0 => rand(0, $tmp_x - 10),\n\t\t\t\t\t\t\t\t1 => rand(0, $tmp_y - 3),\n\t\t\t\t\t\t\t\t2 => rand(0, $tmp_x - 10),\n\t\t\t\t\t\t\t\t3 => rand(0, $tmp_y - 3),\n\t\t\t\t\t\t\t\t4 => rand(0, $tmp_x - 10),\n\t\t\t\t\t\t\t\t5 => rand(0, $tmp_y - 3),\n\t\t\t\t\t\t\t\t6 => rand(0, $tmp_x - 10),\n\t\t\t\t\t\t\t\t7 => rand(0, $tmp_y - 3),\n\t\t\t\t\t\t\t\t8 => rand(0, $tmp_x - 10),\n\t\t\t\t\t\t\t\t9 => rand(0, $tmp_y - 3),\n\t\t\t\t\t\t\t\t10 => rand(0, $tmp_x - 10),\n\t\t\t\t\t\t\t\t11 => rand(0, $tmp_y - 3),\n\t\t\t\t\t\t );\n\n\t\t\t\t$randomcolor = imagecolorallocate( $tmp, rand(100,255), rand(100,255),rand(100,255) );\n\t\t\t\timagefilledpolygon($tmp, $values, 6, $randomcolor );\n\t\t\t}\n\n\t\t\t$num = strlen($content);\n\t\t\t$x_param = 0;\n\t\t\t$y_param = 0;\n\n\t\t\tfor( $i = 0; $i < $num; $i++ )\n\t\t\t{\n\t\t\t\t$x_param += rand(-1,12);\n\t\t\t\t$y_param = rand(-3,8);\n\t\t\t\t\n\t\t\t\tif( $x_param + 18 > $image_x )\n\t\t\t\t{\n\t\t\t\t\t$x_param -= ceil( $x_param + 18 - $image_x );\n\t\t\t\t}\n\n\t\t\t\t$randomcolor = imagecolorallocate( $tmp, rand(0,150), rand(0,150),rand(0,150) );\n\n\t\t\t\timagestring($tmp, 5, $x_param+1, $y_param+1, $content{$i}, $grey);\n\t\t\t\timagestring($tmp, 5, $x_param, $y_param, $content{$i}, $randomcolor);\n\t\t\t}\n\n\t\t\t//-----------------------------------------\n\t\t\t// Distort by resizing\n\t\t\t//-----------------------------------------\n\n\t\t\timagecopyresized($im, $tmp, 0, 0, 0, 0, $image_x, $image_y, $tmp_x, $tmp_y);\n\n\t\t\timagedestroy($tmp);\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Background dots and lines\n\t\t\t//-----------------------------------------\n\n\t\t\t$random_pixels = $image_x * $image_y / 10;\n\n\t\t\tfor ($i = 0; $i < $random_pixels; $i++)\n\t\t\t{\n\t\t\t\t$randomcolor = imagecolorallocate( $im, rand(0,150), rand(0,150),rand(0,150) );\n\t\t\t\tImageSetPixel($im, rand(0, $image_x), rand(0, $image_y), $randomcolor);\n\t\t\t}\n\n\t\t\t$no_x_lines = ($image_x - 1) / 5;\n\n\t\t\tfor ( $i = 0; $i <= $no_x_lines; $i++ )\n\t\t\t{\n\t\t\t\tImageLine( $im, $i * $no_x_lines, 0, $i * $no_x_lines, $image_y, $grey );\n\t\t\t\tImageLine( $im, $i * $no_x_lines, 0, ($i * $no_x_lines)+$no_x_lines, $image_y, $grey );\n\t\t\t}\n\n\t\t\t$no_y_lines = ($image_y - 1) / 5;\n\n\t\t\tfor ( $i = 0; $i <= $no_y_lines; $i++ )\n\t\t\t{\n\t\t\t\tImageLine( $im, 0, $i * $no_y_lines, $image_x, $i * $no_y_lines, $grey );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Can we use fonts?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( $allow_fonts AND function_exists('imagettftext') AND is_array( $fonts ) AND count( $fonts ) )\n\t\t\t{\n\t\t\t\tif ( function_exists('imageantialias') )\n\t\t\t\t{\n\t\t\t\t\timageantialias( $im, TRUE );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$num = strlen($content);\n\t\t\t\t$x_param = -18;\n\t\t\t\t$y_param = 0;\n\t\t\t\t$_font = $fonts[ mt_rand( 0, count( $fonts ) - 1 ) ];\n\t\t\t\t\n\t\t\t\tfor( $i = 0; $i < $num; $i++ )\n\t\t\t\t{\n\t\t\t\t\t$y_param = rand( 35, 48 );\n\t\t\t\t\t\n\t\t\t\t\t# Main color\n\t\t\t\t\t$col_r = rand(50,200);\n\t\t\t\t\t$col_g = rand(0,150);\n\t\t\t\t\t$col_b = rand(50,200);\n\t\t\t\t\t# High light\n\t\t\t\t\t$col_r_l = ( $col_r + 50 > 255 ) ? 255 : $col_r + 50;\n\t\t\t\t\t$col_g_l = ( $col_g + 50 > 255 ) ? 255 : $col_g + 50;\n\t\t\t\t\t$col_b_l = ( $col_b + 50 > 255 ) ? 255 : $col_b + 50;\n\t\t\t\t\t# Low light\n\t\t\t\t\t$col_r_d = ( $col_r - 50 < 0 ) ? 0 : $col_r - 50;\n\t\t\t\t\t$col_g_d = ( $col_g - 50 < 0 ) ? 0 : $col_g - 50;\n\t\t\t\t\t$col_b_d = ( $col_b - 50 < 0 ) ? 0 : $col_b - 50;\n\t\t\t\t\t\n\t\t\t\t\t$color_main = imagecolorallocate( $im, $col_r, $col_g, $col_b );\n\t\t\t\t\t$color_light = imagecolorallocate( $im, $col_r_l, $col_g_l, $col_b_l );\n\t\t\t\t\t$color_dark = imagecolorallocate( $im, $col_r_d, $col_g_d, $col_b_d );\n\t\t\t\t\t$_slant = mt_rand( -20, 40 );\n\t\t\t\t\t\n\t\t\t\t\tif ( $i == 1 OR $i == 3 OR $i == 5 )\n\t\t\t\t\t{\n\t\t\t\t\t\tfor( $ii = 0 ; $ii < 2 ; $ii++ )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$a = $x_param + 50;\n\t\t\t\t\t\t\t$b = mt_rand(0,100);\n\t\t\t\t\t\t\t$c = $a + 20;\n\t\t\t\t\t\t\t$d = $b + 20;\n\t\t\t\t\t\t\t$e = ( $i == 3 ) ? mt_rand( 280, 320 ) : mt_rand( -280, -320 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\timagearc( $im, $a , $b , $c, $d, 0, $e, $color_light );\n\t\t\t\t\t\t\timagearc( $im, $a+1, $b+1, $c, $d, 0, $e, $color_main );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ( ! $_result = @imagettftext( $im, 24, $_slant, $x_param - 1, $y_param - 1, $color_light, $_font, $content{$i} ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$use_fonts = FALSE;\n\t\t\t\t\t\tbreak;\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@imagettftext( $im, 24, $_slant, $x_param + 1, $y_param + 1, $color_dark, $_font, $content{$i} );\n\t\t\t\t\t\t@imagettftext( $im, 24, $_slant, $x_param, $y_param, $color_main, $_font, $content{$i} );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$x_param += rand( 15, 18 );\n\t\t\t\t\t\n\t\t\t\t\tif( $x_param + 18 > $image_x )\n\t\t\t\t\t{\n\t\t\t\t\t\t$x_param -= ceil( $x_param + 18 - $image_x );\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$use_fonts = TRUE;\n\t\t\t}\n\t\t\t\n\t\t\tif ( ! $use_fonts )\n\t\t\t{\n\t\t\t\t//-----------------------------------------\n\t\t\t\t// Continue with nice background image\n\t\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t\t$tmp = imagecreatetruecolor($tmp_x , $tmp_y );\n\t\t\t\t$tmp2 = imagecreatetruecolor($image_x, $image_y);\n\t\t\n\t\t\t\t$white = imagecolorallocate( $tmp, 255, 255, 255 );\n\t\t\t\t$black = imagecolorallocate( $tmp, 0, 0, 0 );\n\t\t\t\t$grey = imagecolorallocate( $tmp, 100, 100, 100 );\n\t\t\t\t$transparent = imagecolorallocate( $tmp2, 255, 255, 255 );\n\t\t\t\t$_white = imagecolorallocate( $tmp2, 255, 255, 255 );\n\t\t\t\n\t\t\t\timagefill($tmp , 0, 0, $white );\n\t\t\t\timagefill($tmp2, 0, 0, $_white);\n\t\t\t\n\t\t\t\t$num = strlen($content);\n\t\t\t\t$x_param = 0;\n\t\t\t\t$y_param = 0;\n\n\t\t\t\tfor( $i = 0; $i < $num; $i++ )\n\t\t\t\t{\n\t\t\t\t\tif ( $i > 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$x_param += rand( 6, 12 );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( $x_param + 18 > $image_x )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$x_param -= ceil( $x_param + 18 - $image_x );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t$y_param = rand( 0, 5 );\n\t\t\t\t\n\t\t\t\t\t$randomcolor = imagecolorallocate( $tmp, rand(50,200), rand(50,200),rand(50,200) );\n\n\t\t\t\t\timagestring( $tmp, 5, $x_param + 1, $y_param + 1, $content{$i}, $grey );\n\t\t\t\t\timagestring( $tmp, 5, $x_param , $y_param , $content{$i}, $randomcolor );\n\t\t\t\t}\n\t\t\t\n\t\t\t\timagecopyresized($tmp2, $tmp, 0, 0, 0, 0, $image_x, $image_y, $tmp_x, $tmp_y );\n\t\t\t\n\t\t\t\t$tmp2 = $this->captcha_show_gd_img_wave( $tmp2, 8, true );\n\t\t\t\n\t\t\t\timagecolortransparent( $tmp2, $transparent );\n\t\t\t\timagecopymerge( $im, $tmp2, 0, 0, 0, 0, $image_x, $image_y, 100 );\n\t\t\n\t\t\t\timagedestroy($tmp);\n\t\t\t\timagedestroy($tmp2);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Blur?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( function_exists( 'imagefilter' ) )\n\t\t{\n\t\t\t@imagefilter( $im, IMG_FILTER_GAUSSIAN_BLUR );\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Render a border\n\t\t//-----------------------------------------\n\t\t\n\t\t$black = imagecolorallocate( $im, 0, 0, 0 );\n\t\t\n\t\timageline( $im, 0, 0, $image_x, 0, $black );\n\t\timageline( $im, 0, 0, 0, $image_y, $black );\n\t\timageline( $im, $image_x - 1, 0, $image_x - 1, $image_y, $black );\n\t\timageline( $im, 0, $image_y - 1, $image_x, $image_y - 1, $black );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Show it!\n\t\t//-----------------------------------------\n\t\t\n\t\t@header( \"Content-Type: image/jpeg\" );\n\t\t\n\t\timagejpeg( $im );\n\t\timagedestroy( $im );\n\t\t\n\t\texit();\n\t}\n\t\n\t/*-------------------------------------------------------------------------*/\n\t// Create wave effect for GD images...\n\t/*-------------------------------------------------------------------------*/\n\t\n\t/**\n\t* Create wave effect for GD images\n\t*\n\t* @param\tobject\tImage resource\n\t* @return\tobject Returned image resource\n\t* @since\t1.0\n\t*/\n\tfunction captcha_show_gd_img_wave( $im, $wave=10 )\n\t{\n\t\t$_width = imagesx( $im );\n\t\t$_height = imagesy( $im );\n\n\t\t$tmp = imagecreatetruecolor( $_width, $_height );\n\n\t\t$_direction = ( time() % 2 ) ? TRUE : FALSE;\n\n\t\tfor ( $x = 0; $x < $_width; $x++ )\n\t\t{\n\t\t\tfor ( $y = 0 ; $y < $_height ; $y++ )\n\t\t\t{\n\t\t\t\t$xo = $wave * sin( 2 * 3.1415 * $y / 128 );\n\t\t\t\t$yo = $wave * cos( 2 * 3.1415 * $x / 128 );\n\n\t\t\t\t$_x = $x - $xo;\n\t\t\t\t$_y = $y - $yo;\n\t\t\t\t\n\t\t\t\tif ( ($_x > 0 AND $_x < $_width) AND ($_y > 0 AND $_y < $_height) )\n\t\t\t\t{\n\t\t\t\t\t$index = imagecolorat($im, $_x, $_y);\n \t\t$colors = imagecolorsforindex($im, $index);\n \t\t$color = imagecolorresolve( $tmp, $colors['red'], $colors['green'], $colors['blue'] );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$color = imagecolorresolve( $tmp, 255, 255, 255 );\n\t\t\t\t}\n\n\t\t\t\timagesetpixel( $tmp, $x, $y, $color );\n\t\t\t}\n\t\t}\n\n\t\treturn $tmp;\n\t}\n\t\n\t/*-------------------------------------------------------------------------*/\n\t// Removes extinct captcha sessions\n\t/*-------------------------------------------------------------------------*/\n\t/**\n\t* Removes extinct captcha sessions\n\t* Clears out \"dead\" entries\n\t*\n\t* @param\tstring\tOptional IP address to clear out on\n\t* @return\tstring\tvoid\n\t*/\n\t\n\tfunction captcha_clear_sessions( $ip_address='' )\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$time = time() - 60 * 3600;\n\t\t$extra = ( $ip_address ) ? ' OR captcha_ipaddress=\"'.$ip_address.'\"' : '';\n\t\t\n\t\t//-----------------------------------------\n\t\t// Remove...\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->DB->build_and_exec_query( array( 'delete' => 'captcha',\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t 'where' => 'captcha_date < ' . $time . $extra ) );\n\t\t\n\t}\n\t\n\t/*-------------------------------------------------------------------------*/\n\t// Load up the backgrounds\n\t/*-------------------------------------------------------------------------*/\n\t/**\n\t* Loads up the backgrounds.\n\t*\n\t* @return\tarray\tbackgrounds\n\t*/\n\t\n\tfunction _captcha_show_gd_img_get_backgrounds()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$images = array();\n\t\t$_path = $this->path_background;\n\t\t\n\t\tif ( $_dir = @opendir( $_path ) )\n\t\t{\n\t\t\twhile( false !== ( $_file = @readdir( $_dir ) ) )\n\t\t\t{\n\t\t\t\tif ( preg_match( \"#\\.(gif|jpeg|jpg|png)$#i\", $_file ) )\n\t\t\t\t{\n\t\t\t\t\t$images[] = $_path . '/' . $_file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $images;\n\t}\n\t\n\t/*-------------------------------------------------------------------------*/\n\t// Load up the fonts\n\t/*-------------------------------------------------------------------------*/\n\t/**\n\t* Loads up the fonts.\n\t*\n\t* @return\tarray\tfonts\n\t*/\n\t\n\tfunction _captcha_show_gd_img_get_fonts()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$fonts = array();\n\t\t$_path = $this->path_fonts;\n\t\t\n\t\tif ( $_dir = @opendir( $_path ) )\n\t\t{\n\t\t\twhile( false !== ( $_file = @readdir( $_dir ) ) )\n\t\t\t{\n\t\t\t\tif ( preg_match( \"#\\.(ttf)$#i\", $_file ) )\n\t\t\t\t{\n\t\t\t\t\t$fonts[] = $_path . '/' . $_file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $fonts;\n\t}\n\t\n}", "public function generateCaptcha()\n {\n $code = Helpers::generateCode($this->config['characters']);\n $width = $this->config['width'];\n $height = $this->config['height'];\n\n // Font size will be 75% of the image height\n $fontSize = $height * 0.45;\n $image = imagecreate($width, $height);\n\n // Set the colours\n $backgroundColor = imagecolorallocate($image, 255, 255, 255);\n $textColor = imagecolorallocate($image, 46, 118, 126);\n $noiseColor = imagecolorallocate($image, 118, 173, 201);\n\n // Generate random dots in background\n for ($i = 0; $i < ($width * $height) / 10; $i ++) {\n imagefilledellipse(\n $image,\n mt_rand(0, $width),\n mt_rand(0, $height),\n 1,\n 1,\n $noiseColor\n );\n }\n\n // Generate random lines in background\n for ($i = 0; $i < ($width * $height) / 310; $i ++) {\n imageline(\n $image,\n mt_rand(0, $width),\n mt_rand(0, $height),\n mt_rand(0, $width),\n mt_rand(0, $height),\n $noiseColor\n );\n }\n\n // Create textbox and add text\n $textbox = imagettfbbox($fontSize, 0, $this->config['font'], $code);\n $x = ($width - $textbox[4]) / 2;\n $y = ($height - $textbox[5]) / 2;\n imagettftext(\n $image,\n $fontSize,\n 0,\n $x,\n $y,\n $textColor,\n $this->config['font'],\n $code\n );\n\n // Output captcha image to browser\n header('Content-Type: image/jpeg');\n imagejpeg($image);\n imagedestroy($image);\n $_SESSION['security_code'] = $code;\n }", "public static function showCaptcha(){\n\t\t// Chaine de caractères pour créer le code\n\t\t$chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789\";\n\t\t$code = null;\n\t\tfor($i = 0; $i < 4; $i++) {\n\t\t\t$code .= $chars[mt_rand(0, 35)];\n\t\t}\n\t\t// On stocke le code dans la session\n\t\t$_SESSION['captcha'] = $code;\n\t\tsession_write_close();\n\t\treturn '<img src=\"./includes/captcha/showcaptcha.php\" height=\"40\" width=\"145\" alt=\"Impossible d\\'afficher le code !\" />';\n\t}", "function showCaptcha()\n {\n $login_model = $this->loadModel('Login');\n $login_model->generateCaptcha();\n }", "function _create_captcha() {\r\n $this->load->helper('captcha');\r\n $cap_config = array(\r\n 'img_path' => './' . $this->config->item('captcha_path'),\r\n 'img_url' => base_url() . $this->config->item('captcha_path'),\r\n 'font_path' => './assets/fonts/tes.otf',\r\n 'font_size' => '50',\r\n 'img_width' => $this->config->item('captcha_width'),\r\n 'img_height' => $this->config->item('captcha_height'),\r\n 'show_grid' => $this->config->item('captcha_grid'),\r\n 'expiration' => $this->config->item('captcha_expire'),\r\n 'ip_address' => $this->input->ip_address(),\r\n // White background and border, black text and red grid\r\n 'colors' => array(\r\n 'background' => array(0, 0, 0),\r\n 'border' => array(255, 255, 255),\r\n 'text' => array(0, 0, 0),\r\n 'grid' => array(255, 200, 200)\r\n )\r\n );\r\n $cap = create_captcha($cap_config);\r\n // Save captcha params in session\r\n $this->session->set_flashdata(array(\r\n 'captcha_word' => $cap['word'],\r\n 'captcha_image' => $cap['image']\r\n ));\r\n return $cap['image'];\r\n }", "public function captcha() {\n $captcha = imagecreatetruecolor(120,35);\n $color = rand(128,170);\n $background_color = imagecolorallocate($captcha, 130, 130, 200);\n imagefill($captcha, 0, 0, $background_color);\n \n #draw some lines\n for($i=0;$i<8;$i++){\n $color = rand(0,32);\n imageline($captcha, rand(0,130),rand(0,35), rand(0,130), rand(0,35),imagecolorallocate($captcha, $color, $color, $color));\n }\n \n #generate a random string of 5 characters\n $string = substr(md5(rand()*time()),0,5);\n\n #make string uppercase and replace \"O\" and \"0\" to avoid mistakes\n $string = strtoupper($string);\n $string = str_replace(\"O\",\"B\", $string);\n $string = str_replace(\"0\",\"C\", $string);\n\n #save string in session \"captcha\" key\n session_start();\n $_SESSION[\"captcha\"]=$string;\n //$this->session->set_userdata('captcha', $string);\n\n #place each character in a random position\n putenv('GDFONTPATH=' . realpath('.'));\n $font = 'arial.ttf';\n for($i=0;$i<5;$i++){\n $color = rand(0,32);\n if(file_exists($font)){\n $x=4+$i*23+rand(0,6);\n $y=rand(18,28);\n imagettftext ($captcha, 15, rand(-25,25), $x, $y, imagecolorallocate($captcha, $color, $color, $color), $font, $string[$i]);\n }else{\n $x=5+$i*24+rand(0,6);\n $y=rand(1,18);\n imagestring($captcha, 5, $x, $y, $string[$i], imagecolorallocate($captcha, $color, $color, $color));\n }\n }\n \n #applies distorsion to image\n $matrix = array(array(1, 1, 1), array(1.0, 7, 1.0), array(1, 1, 1));\n imageconvolution($captcha, $matrix, 16, 32);\n\n #avoids catching\n /*\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Cache-Control: private\",false); \n */\n #return the image\n //header(\"Content-type: image/png\");\n //imagejpeg($captcha); \n //imagepng($captcha,base_url().\"assets/captcha_image.png\");\n imagepng($captcha,\"assets/captcha_image.png\");\n }", "function _create_captcha() {\r\n $this->load->helper('captcha');\r\n $cap_config = array(\r\n 'img_path' => './' . $this->config->item('captcha_path'),\r\n 'img_url' => base_url() . $this->config->item('captcha_path'),\r\n 'font_path' => './assets/fonts/tes.otf',\r\n 'font_size' => '25',\r\n 'img_width' => $this->config->item('captcha_width'),\r\n 'img_height' => $this->config->item('captcha_height'),\r\n 'show_grid' => $this->config->item('captcha_grid'),\r\n 'expiration' => $this->config->item('captcha_expire'),\r\n 'ip_address' => $this->input->ip_address(),\r\n 'word_length' => $this->config->item('captcha_word_length'),\r\n // White background and border, black text and red grid\r\n 'colors' => array(\r\n 'background' => array(255, 255, 255),\r\n 'border' => array(255, 255, 255),\r\n 'text' => array(0, 0, 0),\r\n 'grid' => array(79, 135, 36)\r\n )\r\n );\r\n $cap = create_captcha($cap_config);\r\n // Save captcha params in session\r\n $this->session->set_flashdata(array(\r\n 'captcha_word' => $cap['word'],\r\n 'captcha_image' => $cap['image']\r\n ));\r\n return $cap['image'];\r\n }", "function create_image(){\r\n\t\r\n\t$abc = array(\"0\", \"1\", \"2\",\"3\", \"4\", \"5\",\"6\", \"7\", \"8\",\"9\", \"a\", \"b\",\"c\", \"d\", \"e\",\"f\", \"g\", \"h\",\"i\", \"j\", \"k\",\"l\", \"m\", \"n\",\"o\",\"p\", \"q\", \"r\",\"s\", \"t\", \"u\",\"v\", \"w\", \"x\",\"y\", \"z\");\r\n\t$word = '';\r\n\t$n = 0;\r\n\twhile ($n < 8){\r\n\t\t\r\n\t\t$word .= $abc[mt_rand(0,35)];\r\n\t\t$n++;\r\n\t\t\r\n\t}\r\n\t\r\n\t$captcha = array(\r\n\t\t\t\t'word'\t\t=> strtoupper($word),\r\n\t\t\t\t'img_path'\t=> './captcha/',\r\n\t\t\t\t'img_url'\t=>\tbase_url().'./captcha/',\r\n\t\t\t\t'font_path'\t=>\t'./fonts/impact.ttf',\r\n\t\t\t\t'img_width'\t=>\t'300',\r\n\t\t\t\t'img_height'=>\t30,\r\n\t\t\t\t'expiration'=>\t'60',\r\n\t\t\t\t'time'\t\t=> time()\r\n\t\t\t);\r\n\t\t\t$value = array(\r\n\t\t\t\t'time'\t\t=> $captcha['time'],\r\n\t\t\t\t'ip_address'=> $this->input->ip_address(),\r\n\t\t\t\t'word'\t\t=> $captcha['word']\r\n\t\t\t\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t//insert values in captcha table\r\n\t\t\t$this->db->insert('captcha', $value);\r\n\t\t\t\r\n\t\t\t$img = create_captcha($captcha);\r\n\t\t\treturn $data['image'] = $img['image'];\r\n\t}", "function create_captcha($action = null){\n\t\t\n\t\tif($action == \"code\"){\n\n\t\t\tif(isset($_SESSION['captcha'])){\n\n\t\t\t\treturn $_SESSION['captcha']['code'];\n\n\t\t\t}else{\n\n\t\t\t\t$_SESSION['captcha'] = (new magiccaptcha)->create_captcha();\n\t\t\n\t\t\t\t$_SESSION[\"captcha_code\"] = $_SESSION['captcha']['code'];\n\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t$_SESSION['captcha'] = (new magiccaptcha)->create_captcha();\n\t\t\t\n\t\t\t$_SESSION[\"captcha_code\"] = $_SESSION['captcha']['code'];\n\n\t\t\t$result = array(\n\t\t\t\t\"code\" \t=> $_SESSION['captcha']['code'],\n\t\t\t\t\"captcha_image\" => \"<img src='\". $_SESSION['captcha']['image_src'].\"' alt='CAPTCHA code'>\",\n\t\t\t\t\"captcha_image_url\" => $_SESSION['captcha']['image_src'],\n\t\t\t);\n\n\t\t\treturn json_decode(json_encode($result));\n\t\t}\n\t}", "public function createCaptcha() {\r\n\t\t$this->_image = $this->_text2img($this->_numbers, $this->_length);\r\n\t}", "function checkCaptcha(){\n return true; //for future \n }", "function onCaptchaVerify( $usersecurecode='', $idsuf = '', $captchasessionid = '' ) {\r\n\t\r\n\t\t$usersecurecode = strtolower( $usersecurecode );\r\n\t\t$hiddencaptchas = '';\r\n\t\t$captchagroup = '';\r\n\t\t$acaptcachar = '';\r\n\t\t$ncaptcachar = '';\r\n\t\t$captchasessionid = '';\r\n\t\t$captchasessionidfromcurrentsession = '';\r\n\t\t\r\n\t\t// Sessions >>>>>\r\n\t\t\r\n\t\t// close and save previous session\r\n\t\tif (session_id()) {\r\n\t\t\r\n\t\t\t// for backward compatibility\r\n\t\t\t// will be deprecated in 5.0.0 or wil be used for hi security\r\n\t\t\t@$captchasessionidfromcurrentsession .= $_SESSION['captchasessionid'];\r\n\t\t\t$lastsession = $_SESSION;\r\n\t\t\t$lastsessionid = session_id();\r\n\t\t}\r\n\t\tsession_write_close();\r\n\t\t\r\n\t\t// $captchasessionidfromcurrentsession will be deprecated in 5.0.0 or other used\r\n\t\tif ($captchasessionid == '') $captchasessionid = $captchasessionidfromcurrentsession;\r\n\r\n\t\t// captcha session\r\n\t\tif ( $captchasessionid ) {\r\n\t\t\tini_set( 'session.save_handler', 'files' );\r\n\t\t\t@session_id( $captchasessionid );\r\n\t\t\tsession_start();\r\n\t\t\t@$hiddencaptchas = $_SESSION [ 'hiddencaptchas' . $idsuf ] ;\r\n\t\t\t@$captchagroup = $_SESSION [ 'captchagroup' . $idsuf ] ;\r\n\t\t\t@$acaptcachar = $_SESSION [ 'acaptcha' . $idsuf ] ;\r\n\t\t\t@$ncaptcachar = $_SESSION [ 'ncaptcha' . $idsuf ] ;\r\n\t\t\tsession_write_close();\r\n\t\t}\r\n\t\t\r\n\t\t// restore previous session\r\n\t\t$conf = &JFactory::getConfig();\r\n\t\t$handler = $conf->getValue('config.session_handler', 'none');\r\n\t\tif ($handler == 'none') {\r\n\t\t\tini_set( 'session.save_handler', 'files' );\r\n\t\t} else {\r\n\t\t\tini_set( 'session.save_handler', 'user' );\r\n\t\t\t$sessionstorage = new JSessionStorageDatabase();\r\n\t\t}\r\n\t\tsession_id($lastsessionid);\r\n\t\tsession_start();\r\n\t\t\r\n\t\t// <<<<< Sessions\r\n\t\t\r\n\t\t// do not verify if hidden group and do not verify if captchas session distroy\r\n\t\tif (($captchagroup) && (substr_count( (',' . $hiddencaptchas . ','), (',' . $captchagroup . ',') ))) return true;\r\n\t\t\r\n\t\t$atruesecurecode = '';\r\n\t\t$ntruesecurecode = '';\r\n\t\t\r\n\t\t$atruesecurecode .= $acaptcachar;\r\n\t\t$ntruesecurecode .= $ncaptcachar;\r\n\t\t\r\n\t\tif ((($atruesecurecode == $usersecurecode) || ($ntruesecurecode == $usersecurecode)) && ( $usersecurecode != '' )) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\t\r\n\t}", "public function getCaptcha(){\r\n\t\treturn \"<script type=\\\"text/javascript\\\">var spamCaptcher ={settings : \" . $this->initSettings . \"};spamCaptcher.settings.accountID = \\\"\" . $this->accountID . \"\\\";</script><script type=\\\"text/javascript\\\" src=\\\"https://api.spamcaptcher.com/initCaptcha.js\\\"></script><noscript>SpamCaptcher NoScript Session:&nbsp;<input type=\\\"text\\\" name=\\\"spamCaptcherSessionID\\\" /><br /><iframe height=\\\"275px\\\" width=\\\"500px\\\" src=\\\"https://api.spamcaptcher.com/noscript/getCaptcha.jsp?k=\" . $this->accountID .\"&atma=\" . ($this->allowTrustMeAccount ? \"1\" : \"0\") . \"&ftma=\" . ($this->forceTrustMeAccount ? \"1\" : \"0\") . \"&ogtmas=\" . ($this->overwriteGlobalTMASettings ? \"1\" : \"0\") . \"\\\"><strong>Please upgrade your browser to one that supports iframes or enable JavaScript.</strong></iframe></noscript>\";\r\n\t}", "public function generateCaptcha($rand) {\n ob_clean();\n $data = $this->common_model->commonFunction();\n $arr1 = array(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n $arr2 = array();\n foreach ($arr1 as $val)\n $arr2[] = strtoupper($val);\n $arr3 = array(\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\");\n $str = \"\";\n $arr_all_characters = array_merge($arr1, $arr2, $arr3);\n for ($i = 0; $i < 5; $i++) {\n $str.=$arr_all_characters[array_rand($arr_all_characters)] . \"\";\n }\n $this->session->set_userdata('security_answer', $str);\n putenv('GDFONTPATH=' . realpath('.'));\n //$font = '/var/www/ci-pipl-code-library/user-module/media/front/captcha/ariblk.ttf';\n $font = $data['absolute_path'] . 'media/front/captcha/ariblk.ttf';\n $IMGVER_IMAGE = imagecreatefromjpeg(base_url() . \"media/front/captcha/bg1.jpg\");\n $IMGVER_COLOR_WHITE = imagecolorallocate($IMGVER_IMAGE, 0, 0, 0);\n $text = $str;\n $IMGVER_COLOR_BLACK = imagecolorallocate($IMGVER_IMAGE, 255, 255, 255);\n imagefill($IMGVER_IMAGE, 0, 0, $IMGVER_COLOR_BLACK);\n imagettftext($IMGVER_IMAGE, 24, 0, 20, 28, $IMGVER_COLOR_WHITE, $font, $text);\n //header(\"Content-type: image/jpeg\");\n imagejpeg($IMGVER_IMAGE);\n }", "public function getCaptcha()\n {\n return $this->captcha;\n }", "function captcha($largura,$altura,$tamanho_fonte,$v1) {\n $imagem = imagecreate($largura,$altura); // define a largura e a altura da imagem\n $fonte = \"./fonts/calibri.ttf\"; //voce deve ter essa ou outra fonte de sua preferencia em sua pasta\n $preto = imagecolorallocate($imagem,0,0,0); // define a cor preta\n $branco = imagecolorallocate($imagem,255,255,255); // define a cor branca\n \n // define a palavra conforme a quantidade de letras definidas no parametro $quantidade_letras\n $_SESSION[\"palavra\"] = $v1; // atribui para a sessao a palavra gerada\n \n imagettftext($imagem,$tamanho_fonte,12, 29 ,27, $branco,$fonte,$v1); // atribui as letras a imagem\n \n imagejpeg($imagem); // gera a imagem\n imagedestroy($imagem); // limpa a imagem da memoria\n }", "private function _generateCaptcha()\n {\n $vals = array(\n 'img_path' => './captcha_images/',\n 'img_url' => base_url('captcha_images/'), \n 'img_height' => 30,\n 'expiration' => 7200,\n 'word_length' => 8,\n 'font_size' => 16,\n 'colors' => array(\n /*\n 'background' => array(255,255,255),\n 'border' => array(153,102,102),\n 'text' => array(204,153,153),\n 'grid' => array(255,182,182)\n */\n 'background' => array(0,0,0),\n 'border' => array(0,0,0),\n 'text' => array(255,255,255),\n 'grid' => array(0,0,0) \n )\n );\n /* Generate the captcha */\n return create_captcha($vals);\n }", "public function checkCaptcha() {\n if ($this->input->post('input_captcha_value') == $this->session->userdata('security_answer')) {\n echo 'true';\n } else {\n echo 'false';\n }\n }", "function EnterCaptcha($captchaImg, $inputs, $captchaSize = '5', $sname = 'Enter Captcha', $iname = 'captcha') {\n\techo \"\\n<form name='captcha' method='POST'>\\n\";\n\tforeach ($inputs as $name => $input) echo \"\\t<input type='hidden' name='$name' id='$name' value='$input' />\\n\";\n\techo \"\\t<h4>\" . lang(301) . \" <img alt='CAPTCHA Image' src='$captchaImg' /> \" . lang(302) . \": <input type='text' id='captcha' name='$iname' size='$captchaSize' />&nbsp;&nbsp;\\n\\t\\t<input type='submit' onclick='return check();' value='$sname' />\\n\\t</h4>\\n\\t<script type='text/javascript'>/* <![CDATA[ */\\n\\t\\tfunction check() {\\n\\t\\t\\tvar captcha=document.getElementById('captcha').value;\\n\\t\\t\\tif (captcha == '') {\\n\\t\\t\\t\\twindow.alert('You didn\\'t enter the image verification code');\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t} else return true;\\n\\t\\t}\\n\\t/* ]]> */</script>\\n</form>\\n</body>\\n</html>\";\n}", "function getCaptcha($aConfig=array(), $bHtml=false) {\n\n\t$CI = & get_instance();\n\n\t$CI->load->config('captcha');\n\n\t//if there was some config option set by the user, then save it. will be needed when we refresh captcha\n\t// make sure to delete this from session when deleting captcha\n\tif( $aConfig ) {\n\t\tss( 'custom_captcha_settings', serialize($aConfig));\n\t}\n\n\t$vals = array_merge(array(\n\t\t\t\t\t 'word' \t\t\t\t\t=> '',\n\t\t\t\t\t 'img_path' \t\t\t\t=> $CI->config->item('base_path') . 'captcha/',\n\t\t\t\t\t 'img_url' \t\t\t\t=> $CI->config->item('captcha_url'),\n\t\t\t\t\t 'font_path' \t\t\t=> $CI->config->item('captcha_font_path'),\n\t\t\t\t\t 'img_width' \t\t\t=> $CI->config->item('captcha_img_width'),\n\t\t\t\t\t 'img_height' \t\t\t=> $CI->config->item('captcha_img_height'),\n\t\t\t\t\t 'expiration' \t\t\t=> $CI->config->item('captcha_expiration'),\n\t\t\t\t\t 'word_length' \t\t\t=> $CI->config->item('captcha_word_length'),\n\t\t\t\t\t 'class' \t\t\t\t=> $CI->config->item('captcha_img_class'),\n\t\t\t\t\t 'custom_font_size' \t\t=> 26,\n\t\t\t\t\t\t'img_id' \t\t=> 'captcha_image_id',\n\t\t\t\t\t\t'captcha_container_id' \t=> 'captcha_container'\n\t\t\t\t\t ), $aConfig);\n\n\t\t\t\t\t //p($vals);exit;\n\t$aCaptcha = create_captcha($vals);\n\n\n\t//store the word to the session\n\t$CI->session->set_userdata($aCaptcha);\n\n\n\t//load necessary JS/ CSS files\n\t$CI->mcontents['load_js'][] = 'captcha.js';\n\t$CI->mcontents['load_css'][] = 'captcha.css';\n\t$CI->mcontents['load_js']['data']['captcha_container_id'] = $vals['captcha_container_id'];\n\n\tif($bHtml){\n\t\t//fetch the whole captcha block of the form\n\t\treturn $CI->load->view('captcha', $aCaptcha, true);\n\t} else {\n\t\treturn $aCaptcha;\n\t}\n\n}", "function matchCaptcha($inputValue)\t{\n\t\treturn $inputValue['captcha']==$this->getCaptcha(); //return true or false after comparing submitted value with set value of captcha\n\t}", "function is_valid_captcha($obj, $captcha)\n{\n\t$result = FALSE;\n\t# First, delete old captchas\n\t$expiration = time()-7200; # Two hour limit\n\t$obj->db->query($obj->Query_reader->get_query_by_code('delete_old_captchas', array('oldesttime'=>$expiration))); \n\t\t\n\t$captcha_data = $obj->Query_reader->get_row_as_array('check_for_captcha', array('theword'=>$captcha, 'thisip'=>$obj->input->ip_address(), 'oldestdate'=>$expiration));\n\t\n\tif($captcha_data['count'] > 0)\n\t{\n\t\t$result = TRUE;\n\t}\t\t\n\treturn $result;\n}", "function check_captcha()\t\n\t {\n\t \t $expiration = time()-3600;\t\n\t \t $sql = \"DELETE FROM captcha WHERE captcha_time < ?\";\t\n\t \t $binds = array($expiration);\t\n\t \t $query = $this->db->query($sql, $binds);\t\n\t \t //checking\tinput\t\n\t \t $sql = \"SELECT COUNT(*) AS count FROM captcha WHERE word = ? AND ip_address = ? AND captcha_time > ?\";\t\n\t\t $binds = array($_POST['captcha'], $this->input->ip_address(), $expiration);\t\n\t \t $query = $this->db->query($sql, $binds);\t\n\t \t $row = $query->row();\t\n\t \t if\t($row->count>0)\t{\t\n\t \t \t return\ttrue;\t\n\t \t }\t\n\t \t return\tfalse;\t\n\t }", "public function getCaptcha()\n\t{\t\n\t\tHeader (\"Content-type: image/png\");\n\t\t// Laden der Rohdatei, die sich im Verzeichnis befinden muss\n\t\t\n\t\t$Pic = ImageCreate(250, 250);\n\t\t$Background=imagecreatefrompng(\"./img/Captcha.png\");\n\t\tImageCopy($Pic,$Background,0,0,$_SESSION['Random'][$_SESSION['PicCounter']],$_SESSION['Random'][$_SESSION['PicCounter']],250,250);\n\t\t//$Font=imageloadfont(\"./images/font/sector_017.ttf\");\n\t\t$farbe_w = ImageColorAllocate ($Pic, 255, 255, 255);\n\t\t$farbe_b = ImageColorAllocate ($Pic, 0, 0, 0);\n\n\t\tImageString($Pic,5, mt_rand(120,160), mt_rand(50,90), $_SESSION['Captcha'][0], $farbe_b);\n\t\tImageString($Pic, 5, mt_rand(165,175), mt_rand(125,150), $_SESSION['Captcha'][1], $farbe_b);\n\t\tImageString($Pic, 5, mt_rand(120,150), mt_rand(190,220), $_SESSION['Captcha'][2], $farbe_b);\n\t\tImageString($Pic, 5, mt_rand(60,100), mt_rand(170,210), $_SESSION['Captcha'][3], $farbe_b);\n\t\tImageString($Pic, 5, mt_rand(60,100), mt_rand(100,140), $_SESSION['Captcha'][4], $farbe_b);\t\n\n\t\theader (\"Content-type: image/png\");\n\t\tImagePNG ($Pic);\n\t\tImageDestroy ($Pic);\n\t\treturn false;\t\t\n\t}", "public function makeCaptcha()\n {\n return $this->_makeImage();\n }", "protected function generate_captcha($length=4)\r\n\t{\r\n\t\treturn substr(str_shuffle(\"2346789ABDHLMNPRTWXYZ\"), 0, $length);\r\n\t}", "private function generateCaptcha() {\n //Apagando arquivos existentes\n $result = scandir('captcha');\n foreach ($result as $filename) {\n if ($filename != '.' and $filename != '..') {\n unlink('captcha/' . $filename);\n }\n }\n\n $captcha = new Zend_Captcha_Image();\n $captcha->setExpiration('300')\n ->setWordLen('6')\n ->setHeight('60')\n ->setWidth('210')\n ->setFont('fonts/entsans.ttf')\n ->setImgDir('captcha/');\n\n $captcha->generate();\n $captcha_session = new Zend_Session_Namespace('Zend_Form_Captcha_' . $captcha->getId());\n $captcha_iterator = $captcha_session->getIterator();\n $captcha_word = $captcha_iterator['word'];\n\n $session = new Zend_Session_Namespace('captcha');\n $session->captcha_confirm = $captcha_word;\n\n //response\n return $captcha->getId();\n }", "function _showCaptcha($code){\n\n\t\tif ( session_id() == \"\" ) {\n\t\t\tsession_start();\n\t\t}\n\n\t\t$captchaHTML='';\n\t\t$security_code='';\n\t\t$esc='';\n\n\t\tif( $this->enable_captcha) //if captcha is enabled\n\t\t{\n\t\t\tif (extension_loaded('gd') AND extension_loaded('mcrypt'))\n\t\t\t{\n\t\t\t\t$gdinfo = gd_info();\n\t\t\t\tif($gdinfo['FreeType Support']){\n\t\t\t\t\tif(!$this->linear) $captchaHTML .= '<div class=\"subscriptionCaptcha\">';\n\n $captchaHTML .= '<div class=\"captchImg\">';\n\t\t\t\t\t$path= JNEWS_JPATH_LIVE_NO_HTTPS.'/index.php?option='.JNEWS_OPTION.'&act=captcha&tmpl=component&width='.$this->captcha_width.'&height='.$this->captcha_height.'&bgcolor='.$this->captcha_bgcolor.'&ftcolor='.$this->captcha_ftcolor.'&characters=5&esc='. $esc.'&encpwd='.crypt($GLOBALS[JNEWS.'captcha_code'],$GLOBALS[JNEWS.'captcha_code'] );\n\t\t\t\t\t$captchaHTML .= '<img alt=\"catchme\" style=\"border: 0px;\" src=\"'. $path .'\" id=\"captcha_image'.$this->num.'\" />';\n\n\t\t\t\t\t //$path_get_text = JNEWS_JPATH_LIVE_NO_HTTPS.'/index.php?option='.JNEWS_OPTION.'&act=captcha&tmpl=component&getsession=1';\n\t\t\t\t\t$captchaHTML .= '&nbsp;<img alt=\"refresh\" style=\"border: 0px;\" src=\"'. JURI::base().'components/'.JNEWS_OPTION.'/images/refresh.png\" id=\"refreshButton\" title=\"Refresh Captcha\" onclick=\"document.getElementById(\\'captcha_image'.$this->num.'\\').src=\\''.$path.'&changetext=1&\\'+Math.random(); document.getElementById(\\'security_code_captcha\\').focus();\"/>';\n\n\t\t\t\t\t$captchaHTML .= '</div>';\n\t\t\t\t\t$captchaHTML .='<div class=\"entered_captcha\"><input class=\"inputbox\" title =\"'._JNEWS_CAPTCHA_TIPS.'\" name=\"security_code\" size=\"7\" type=\"text\" class=\"entered_captcha\" id=\"security_code_captcha\"/></div>';\n\t\t\t\t\tif(!$this->linear) $captchaHTML .= '</div>';\n\t\t\t\t}else{\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{ //otherwise we live an empty space for the captcha to avoid blank page\n\t\t\t\tif ( ! extension_loaded('gd')) return '';\n\t\t\t\t\n\t\t\t \t$gdinfo = gd_info();\n\t\t\t\tif($gdinfo['FreeType Support']){\n\t\t\t\t\tif(!$this->linear) $captchaHTML .= '<div class=\"subscriptionCaptcha\">';\n $captchaHTML .= '<div class=\"captchImg\">';\n\t\t\t\t\t$path= JNEWS_JPATH_LIVE_NO_HTTPS.'/index.php?option='.JNEWS_OPTION.'&act=captcha&tmpl=component&width='.$this->captcha_width.'&height='.$this->captcha_height.'&bgcolor='.$this->captcha_bgcolor.'&ftcolor='.$this->captcha_ftcolor.'&characters=5';\n\t\t\t\t\t$captchaHTML .= '<img alt=\"catchme\" style=\"border: 0px;\" src=\"'. $path .'\" id=\"captcha_image'.$this->num.'\" />';\n // $captchaHTML .= '<div alt=\"catchme\" >'.$path.'</div>';\n\t\t\t\t\t$captchaHTML .= '&nbsp;<img alt=\"refresh\" style=\"border: 0px;\" src=\"'. JURI::base().'components/'.JNEWS_OPTION.'/images/refresh.png\" id=\"refreshButton\" title=\"Refresh Captcha\" onclick=\"document.getElementById(\\'captcha_image'.$this->num.'\\').src=\\''.$path.'&\\'+Math.random(); jQuery(\\'input[name=security_captcha]\\').val(\\'123\\'); document.getElementById(\\'security_code_captcha\\').focus();\"/>';\n\t\t\t\t\t$captchaHTML .= '</div>';\n\t\t\t\t\t$captchaHTML .='<div class=\"entered_captcha\"><input class=\"inputbox\" title =\"'._JNEWS_CAPTCHA_TIPS.'\" name=\"security_code\" size=\"7\" type=\"text\" class=\"entered_captcha\" id=\"security_code_captcha\"/></div>';\n\t\t\t\t\tif(!$this->linear) $captchaHTML .= '</div>';\n\t\t\t\t}else{\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $captchaHTML;\n\n \t}", "function plugin_cclabel_captcha() {\r\n global $_CONF, $LANG_CP00;\r\n\r\n if (SEC_inGroup('Root') ) {\r\n return array($LANG_CP00['plugin'],\r\n $_CONF['site_admin_url'] . '/plugins/captcha/index.php',\r\n $_CONF['site_url'] . '/captcha/captcha.png');\r\n } else {\r\n return '';\r\n }\r\n}", "private function gerarCaptcha()\n\t\t{\n\t\t\treturn $this->Delegator(\"ConcreteCadastro\",\"Captcha\");\n\t\t}", "public function save_captcha() {\n\t\t// Validate nonce\n\t\tforminator_validate_ajax( \"forminator_save_popup_captcha\" );\n\n\t\tupdate_option( \"forminator_captcha_key\", sanitize_text_field( $_POST['v2_captcha_key'] ) );\n\t\tupdate_option( \"forminator_captcha_secret\", sanitize_text_field( $_POST['v2_captcha_secret'] ) );\n\n\t\tupdate_option( \"forminator_v2_invisible_captcha_key\", sanitize_text_field( $_POST['v2_invisible_captcha_key'] ) );\n\t\tupdate_option( \"forminator_v2_invisible_captcha_secret\", sanitize_text_field( $_POST['v2_invisible_captcha_secret'] ) );\n\n\t\tupdate_option( \"forminator_v3_captcha_key\", sanitize_text_field( $_POST['v3_captcha_key'] ) );\n\t\tupdate_option( \"forminator_v3_captcha_secret\", sanitize_text_field( $_POST['v3_captcha_secret'] ) );\n\n\t\tupdate_option( \"forminator_captcha_language\", sanitize_text_field( $_POST['captcha_language'] ) );\n\n\t\twp_send_json_success();\n\t}", "function captchaBadge($apikey=CAPTCHA_APIKEY) {\nreturn '\n <div id=\"recaptcha-badge\"></div>\n <script>\n var clientId; // set by placeCaptcha\n\n // called by placeCaptcha after grecaptcha is provided by Google\n function getReCaptcha() {\n grecaptcha.ready(function() {\n grecaptcha.execute(clientId).then(function(token) {\n var captcha = document.getElementsByName(\"captcha\");\n Array.from(captcha).forEach(el => el.value = token);\n document.querySelector(\"#recaptcha-badge iframe\").tabIndex = -1;\n });\n });\n }\n\n // called by RECAPTCHA API, see below\n function placeCaptcha() {\n clientId = grecaptcha.render(\"recaptcha-badge\", {\n \"sitekey\": \"'.$apikey.'\",\n \"badge\": \"inline\",\n \"size\": \"invisible\"\n });\n getReCaptcha();\n setInterval(getReCaptcha, 120000); // update token every 2 minutes\n }\n </script>\n <script src=\"https://www.google.com/recaptcha/api.js?render=explicit&onload=placeCaptcha\"></script>\n';\n}", "function getInput_captcha() {\r\n\t\t$content.='<tr><td>';\r\n\t\t$content.='<img src=\"'.module::getClassPath('web_captcha').'?generate=true&length='.$this->length.'\">';\r\n\t\t$content.='</td><td style=\"width:'.$this->fieldWidth.'px\">';\r\n\t\t$content.=$this->getInput_text();\r\n\t\treturn $content;\r\n\t}", "function check_captcha($str){\n\t\tif(isset($_SESSION['captcha']) && !empty($_SESSION['captcha']) && $str != $_SESSION['captcha']){\n\t\t\t$this->form_validation->set_message('check_captcha','Text does not match with captcha!');\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "function printCaptcha($formId = NULL, $type = NULL, $fieldName = NULL, $accessibilityFieldName = NULL) {\n\trequire_once('assets/visualcaptcha.class.php');\n\t\n\t$visualCaptcha = new \\visualCaptcha\\captcha($formId,$type,$fieldName,$accessibilityFieldName);\n\t$visualCaptcha->show();\n}", "public function validate()\n\t{\n\t\t$arrCaptcha = $this->Session->get('captcha_' . $this->strId);\n\n\t\tif (!is_array($arrCaptcha) || !strlen($arrCaptcha['key']) || !strlen($arrCaptcha['sum']) || \\Input::post($arrCaptcha['key']) != $arrCaptcha['sum'] || $arrCaptcha['time'] > (time() - 3))\n\t\t{\n\t\t\t$this->class = 'error';\n\t\t\t$this->addError($GLOBALS['TL_LANG']['ERR']['captcha']);\n\t\t}\n\n\t\t$this->Session->set('captcha_' . $this->strId, '');\n\t}", "public function index()\n {\n $db=new Storage();\n $image_path = public_path('la-assets/img/captcha/captcha.png');\n if(isset($_POST['send'])&&$_POST['send']==\"send\"){\n $image=new Image($image_path);\n $code=$_POST['code'];\n $code_arr=str_split($code);\n\n for($i=0;$i<$image::CHAR_NUM;$i++){\n $hash_img_data=implode(\"\",$image->splitImage($i));\n $db->add($code_arr[$i],$hash_img_data);\n }\n\n $db->save();\n }else{\n $image = new Image(\"http://deposit.koudailc.com/user/captcha\"); //http://www.169ol.com/Stream/Code/getCode\n imagepng($image->_in_img, $image_path);\n }\n\n return View('la.captchas.index');\n }", "function isValidCaptcha(){\n\n\t$CI = &get_instance();\n\t$bReturn = false;\n\n\t$CI->load->config('captcha');\n\n\n\t$sFnName = c('captcha_case_sensitive') ? 'strcmp' : 'strcasecmp';\n\n\n\tif( 0 === $sFnName($CI->input->post('captcha'), s('word')) ) {\n\n\t\t$bReturn = true;\n\n\t}\n\n\tdestroyCaptcha();\n\n\treturn $bReturn;\n\n}", "private function setSessionKey()\n {\n $this->sessionKey = 'formfactory.captcha.' . $this->formRequestClass;\n }", "static public function getCAPTCHA($new = false)\n {\n global $session;\n\n if ($new || !$session->get('whups', 'captcha')) {\n $captcha = '';\n for ($i = 0; $i < 5; ++$i) {\n $captcha .= chr(rand(65, 90));\n }\n $session->set('whups', 'captcha', $captcha);\n }\n\n return $session->get('whups', 'captcha');\n }", "public function randomKey();", "public function insert_captcha($data)\n {\n $this->db->query(\n $this->db->insert_string('captcha', $data)\n );\n }", "public function display()\n {\n\n if (!$this->isActive())\n {\n throw new EngineNotInitialisedException('Simple CAPTCHA engine not initialised');\n }\n\n if (!extension_loaded('gd'))\n {\n throw new DependencyNotInitialisedException('GD extension missing');\n }\n\n if (!function_exists('imagettftext'))\n {\n throw new DependencyNotInitialisedException('FreeType extension missing');\n }\n\n /*\n * Decide upon a key and answer\n */\n $key = $this->_dependencies->utils->random(32);\n $key = hash('md5', $key);\n\n $answer = $this->_dependencies->utils->random(32);\n $answer = preg_replace('/[^A-Za-z]/', '', $answer);\n $answer = substr($answer, 0, 8);\n $answer = strtoupper($answer);\n\n $this->_dependencies->session->write('_bourbon_captcha_' . $key, $answer);\n\n /*\n * Create the image\n */\n $image = imagecreate(205, 60);\n imagecolorallocate($image, 255, 255, 255);\n\n $answer_array = str_split($answer);\n $count = 0;\n\n foreach ($answer_array as $character)\n {\n\n $offset = (rand(5, 10) + ($count * 23));\n\n $red = (rand(100, 150));\n $green = (rand(100, 150));\n $blue = (rand(100, 150));\n $colour = imagecolorallocate($image, $red, $green, $blue);\n\n imagettftext($image,\n rand(25, 35),\n rand(-10, 10),\n $offset,\n rand(30, 50),\n $colour,\n $this->_getFontPath(),\n $character);\n\n $count++;\n\n }\n\n ob_start();\n imagejpeg($image, null, 25);\n\n $jpeg_image = ob_get_clean();\n $jpeg_image = base64_encode($jpeg_image);\n $jpeg_image = 'data:image/jpeg;base64,' . $jpeg_image;\n\n /*\n * Return usable HTML\n */\n $html_image = '<img src=\"' . $jpeg_image . '\" alt=\"\" />';\n $html_key = '<input type=\"hidden\" name=\"_bourbon_captcha_key\" value=\"' . $key . '\" />';\n $html_value = '<input type=\"text\" name=\"_bourbon_captcha_value\" placeholder=\"Enter CAPTCHA text\" />';\n\n return '<div class=\"_bourbon_simple_captcha\">' . $html_image . $html_key . $html_value . '</div>';\n\n }", "function _check_captcha()\n\t{\n\t\t\t\t// First, delete old captchas\n\t\t\t\t$expiration = time() - config_item('captcha_expire');\n\t\t\t\t$this->db->query(\"DELETE FROM fx_captcha WHERE captcha_time < \".$expiration);\n\n\t\t\t\t// Then see if a captcha exists:\n\t\t\t\t$sql = \"SELECT COUNT(*) AS count FROM fx_captcha WHERE word = ? AND ip_address = ? AND captcha_time > ?\";\n\t\t\t\t$binds = array($_POST['captcha'], $this->input->ip_address(), $expiration);\n\t\t\t\t$query = $this->db->query($sql, $binds);\n\t\t\t\t$row = $query->row();\n\n\t\t\t\tif ($row->count == 0)\n\t\t\t\t{\n\t\t\t\t\t$this->form_validation->set_message('_check_captcha', $this->lang->line('auth_incorrect_captcha'));\n\t\t\t\t return FALSE;\n\t\t\t\t}else{\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t}", "public function refreshCaptcha()\n {\n return captcha_img();\n }", "public function index()\n {\n /* Set form validation rules */\n $this->form_validation->set_rules('name', \"Name\", 'required');\n $this->form_validation->set_rules('captcha', \"Captcha\", 'required'); \n $userCaptcha = $this->input->post('captcha'); \n /* Get the user's entered captcha value from the form */\n /* Check if form (and captcha) passed validation*/\n $image = $this->session->userdata('filename');\n if (file_exists('./captcha_images/'.$image)) {\n unlink('./captcha_images/'.$image); \n } \n if ($this->form_validation->run() == true && strcmp(strtolower($userCaptcha), strtolower($this->session->userdata('captchaWord'))) == 0) {\n /** Validation was successful; show the Success view **/\n /* Clear the session variable */\n /* delete captcha file but we need to write this function and also call it in fail case */\n // $this->deleteOldCaptcha('./captcha_images/'.$this->session->userdata('captchaName').'.jpg');\n // $this->session->unset_userdata('captchaName');\n \n $this->session->unset_userdata('captchaWord');\n /* Get the user's name from the form */\n $name = $this->input->post('name');\n /* Pass in the user input to the success view for display */\n $data = array('name' => $name);\n // do as your requirement\n echo \"Captcha Passed\";\n echo \"</br>\";\n print_r($data);\n exit;\n } else {\n /** Validation was not successful - Generate a captcha **/\n /* Setup vals to pass into the create_captcha function */\n $captcha = $this->_generateCaptcha();\n \n /* Store the captcha value (or 'word') in a session to retrieve later */\n $this->session->set_userdata('captchaWord', $captcha['word']);\n $this->session->set_userdata('filename', $captcha['filename']);\n \n \n /* Load the captcha view containing the form (located under the 'views' folder) */\n $this->load->view('captcha_view', $captcha);\n }\n }", "function generatechallenge(){\n\tsrand();\n\t//create the challenge variable\n\t$challenge=\"\";\n\t//fill the challenge variable\n\tfor($i=0; $i<80; $i++)\n\t{\n\t\t$challenge.=dechex(rand(0,15));\n\t}\n\t$_SESSION['challenge']=$challenge;\n\treturn $challenge;\n}", "function post_captcha($user_response) {\n $fields_string = '';\n $fields = array(\n 'secret' => '6LcbFuEUAAAAAILVdCO0EDzHN7qB7xWtKlX66K5P',\n 'response' => $user_response\n );\n foreach($fields as $key=>$value)\n $fields_string .= $key . '=' . $value . '&';\n $fields_string = rtrim($fields_string, '&');\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/recaptcha/api/siteverify');\n curl_setopt($ch, CURLOPT_POST, count($fields));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, True);\n\n $result = curl_exec($ch);\n curl_close($ch);\n\n return json_decode($result, true);\n}", "function isValidatedCaptcha(){\n\n\t$CI = &get_instance();\n\t$bReturn = false;\n\tif( $CI->session->userdata('validated_captcha_code') == $CI->input->post('validated_captcha_code') ){\n\t\t$bReturn = true;\n\t}\n\n\t$CI->session->unset_userdata('validated_captcha_code');\n\treturn $bReturn;\n}", "public function createCaptcha(array $data = array()) {\n if (!isset($data['type']) || !in_array($data['type'], array('image', 'audio'))) {\n return FALSE;\n }\n $path = 'captcha';\n $result = $this->query('POST', $path, $data, array('captcha', 'id'));\n\n return isset($result['captcha']) ? $result['captcha'] : $result;\n }", "function get_challenge(){\n\t$challenge = md5(uniqid(rand(), true));\n\t$_SESSION['challenge'] = $challenge;\n\treturn $challenge;\n}", "function insert_recaptcha_html() {\n\n\t$html = get_field('re_captcha', 'apikey') ? '<div class=\"g-recaptcha\" data-sitekey=\"'.get_field('re_captcha', 'apikey').'\"></div>' : '';\n\n\treturn $html;\n}", "public function daftar()\n\t{\n\t\t$this->load->helper('form');\n $this->load->helper('captcha');\n $vals = array(\n //'word'\t=> 'Random word',\n 'img_path'\t=> './captcha/',\n 'img_url'\t=> BASE_URL.'/captcha/',\n 'font_path'\t=> THEME_FOLDER.'/fonts/socicon-webfont.ttf',\n 'img_width'\t=> '150',\n 'img_height' => 40,\n 'expiration' => 7200\n );\n \n $this->data['cap'] = create_captcha($vals);\n \n\t\t$this->data['page']['pageTitle']=\"Menjadi member IABHI\";\n\t\t$this->data['header'] = $this->load->view('templates/header', $this->data, true);\n\t\t$this->data['footer'] = $this->load->view('templates/footer', '', true);\n\t\t$this->load->view('templates/signup', $this->data);\n\t}", "function kiemtra_MaXacNhan($MaXacNhan)\n {\n $captcha=$this->session->userdata('captcha');\n \n if($MaXacNhan==$captcha){ // Dung $MaXacNhan\n $this->session->unset_userdata(array('captcha' => ''));\n return TRUE;\n }\n else{\n $this->form_validation->set_message(\"kiemtra_MaXacNhan\",$this->lang->line('error_kiemtra_MaXacNhan'));\n return FALSE;\n }\n }", "function insert_recaptcha_html() {\n\n $html = get_field('re_captcha', 'apikey') ? '<div class=\"g-recaptcha\" data-sitekey=\"'.get_field('re_captcha', 'apikey').'\"></div>' : '';\n\n return $html;\n}", "function _check_captcha($code)\n {\n $time = $this->session->flashdata('captcha_time');\n $word = $this->session->flashdata('captcha_word');\n\n list($usec, $sec) = explode(\" \", microtime());\n $now = ((float)$usec + (float)$sec);\n\n if ($now - $time > $this->config->item('captcha_expire', 'tank_auth')) {\n $this->form_validation->set_message('_check_captcha', $this->lang->line('auth_captcha_expired'));\n return FALSE;\n\n } elseif (($this->config->item('captcha_case_sensitive', 'tank_auth') AND\n $code != $word) OR\n strtolower($code) != strtolower($word)) {\n $this->form_validation->set_message('_check_captcha', $this->lang->line('auth_incorrect_captcha'));\n return FALSE;\n }\n return TRUE;\n }", "public function check(){\n if(isset($_POST)){\n $SecretKey = $this->input->post('k');\n function cap($SecretKey){\n $Response = file_get_contents(\"https://www.google.com/recaptcha/api/siteverify?secret=\".SECRET_KEY.\"&response={$SecretKey}\");\n $Return = json_decode($Response);\n return $Return;\n }\n $Return = cap($SecretKey);\n if($Return->success == 1 && $Return->score >= 0.5){\n $this->accept_data(); \n $this->line_noti();\n }else{\n // echo 'U R BOT';\n redirect(base_url());\n }\n } \n }", "function _check_captcha($code) {\r\n $word = $this->session->flashdata('captcha_word');\r\n if (($this->config->item('captcha_case_sensitive') AND $code != $word) OR\r\n strtolower($code) != strtolower($word)) {\r\n return FALSE;\r\n }\r\n return TRUE;\r\n }", "function _check_captcha($code)\n\t{\n\t\t$time = $this->session->flashdata('captcha_time');\n\t\t$word = $this->session->flashdata('captcha_word');\n\t\t$word = $_COOKIE['captchaword'];\n\t\t$time = $_COOKIE['captchatime'];\n\t\tlist($usec, $sec) = explode(\" \", microtime());\n\t\t$now = ((float)$usec + (float)$sec);\n\n\t\tif ($now - $time > $this->config->item('captcha_expire', 'tank_auth')) {\n\t\t\t$this->form_validation->set_message('_check_captcha', $this->lang->line('auth_captcha_expired'));\n\t\t\treturn FALSE;\n\n\t\t} elseif (($this->config->item('captcha_case_sensitive', 'tank_auth') AND\n\t\t\t\t$code != $word) OR\n\t\t\t\tstrtolower($code) != strtolower($word)) {\n\t\t\t$this->form_validation->set_message('_check_captcha', $this->lang->line('auth_incorrect_captcha'));\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "function EnterCaptcha($captchaImg, $inputs, $default_login, $captchaSize = '5') {\n\techo \"\\n<center><form name='dl' method='POST'>\\n\";\n\tforeach ($inputs as $name => $input) echo \"\\t<input type='hidden' name='$name' id='$name' value='$input' />\\n\";\n\tif (!$default_login) echo \"\\t<table border='0' style='width:270px;' cellspacing='0' align='center'>\\n\\t\\t<tr><td style='white-space:nowrap;'>&nbsp;Login</td><td>&nbsp;<input type='text' id='up_login' name='up_login' value='\".htmlentities($_REQUEST['up_login']).\"' style='width:160px;' /></td></tr>\\n\\t\\t<tr><td style='white-space:nowrap;'>&nbsp;Password</td><td>&nbsp;<input type='password' id='up_password' name='up_pass' value='' style='width:160px;' /></td></tr>\\n\\t</table><br /><br />\";\n\techo \"\\t<h4>\" . lang(301) . \" <img alt='CAPTCHA Image' src='$captchaImg' /> \" . lang(302) . \": <input type='text' name='captcha' size='$captchaSize' />&nbsp;&nbsp;\\n\\t\\t<input type='submit' onclick='return check();' value='Enter Captcha' />\\n\\t</h4>\\n\";\n\techo \"<script type='text/javascript'>\\n\\tfunction check() {\\n\\t\\tvar captcha=document.dl.captcha.value;\\n\\t\\tif (captcha == '') {\\n\\t\\t\\twindow.alert('You didn\\'t enter the image verification code');\\n\\t\\t\\treturn false;\\n\\t\\t} \".($default_login ? '' : \"else if ($('#up_login').val() == '' || $('#up_password').val() == '') {\\n\\t\\t\\twindow.alert('Please fill login fields.');\\n\\t\\t\\treturn false;\\n\\t\\t} \") . \"else return true;\\n\\t}\\n</script>\";\n\techo \"</form></center>\\n</body\\n</html>\";\n}", "function _check_captcha($code)\n\t{\n\t\t$time = $this->session->flashdata('captcha_time');\n\t\t$word = $this->session->flashdata('captcha_word');\n\n\t\tlist($usec, $sec) = explode(\" \", microtime());\n\t\t$now = ((float)$usec + (float)$sec);\n\n\t\tif ($now - $time > $this->config->item('captcha_expire', 'tank_auth')) {\n\t\t\t$this->form_validation->set_message('_check_captcha', $this->lang->line('auth_captcha_expired'));\n\t\t\treturn FALSE;\n\n\t\t} elseif (($this->config->item('captcha_case_sensitive', 'tank_auth') AND\n\t\t\t\t$code != $word) OR\n\t\t\t\tstrtolower($code) != strtolower($word)) {\n\t\t\t$this->form_validation->set_message('_check_captcha', $this->lang->line('auth_incorrect_captcha'));\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "function reCAPTCHA($publicKey, $inputs, $sname = 'Upload File') {\n\tglobal $cookie, $domain, $referer, $pauth;\n\tif (empty($publicKey) || preg_match('/[^\\w\\.\\-]/', $publicKey)) html_error('Invalid reCAPTCHA public key.');\n\tif (!is_array($inputs)) html_error('Error parsing captcha post data.');\n\t// Check for a global recaptcha key\n\t$page = geturl('www.google.com', 0, '/recaptcha/api/challenge?k=' . $publicKey, 'http://fakedomain.tld/fakepath', 0, 0, 0, $_GET['proxy'], $pauth);is_page($page);\n\tif (substr($page, 9, 3) != '200') html_error('Invalid or deleted reCAPTCHA public key.');\n\n\tif (strpos($page, 'Invalid referer') === false) {\n\t\t// Embed captcha\n\t\techo \"<script language='JavaScript'>var RecaptchaOptions = {theme:'red', lang:'en'};</script>\\n\\n<center><form name='recaptcha' method='POST'><br />\\n\";\n\t\tforeach ($inputs as $name => $input) echo \"<input type='hidden' name='$name' id='C_$name' value='$input' />\\n\";\n\t\techo \"<script type='text/javascript' src='http://www.google.com/recaptcha/api/challenge?k=$publicKey'></script><noscript><iframe src='http://www.google.com/recaptcha/api/noscript?k=$publicKey' height='300' width='500' frameborder='0'></iframe><br /><textarea name='recaptcha_challenge_field' rows='3' cols='40'></textarea><input type='hidden' name='recaptcha_response_field' value='manual_challenge' /></noscript><br /><input type='submit' name='submit' onclick='javascript:return checkc();' value='$sname' />\\n<script type='text/javascript'>/*<![CDATA[*/\\nfunction checkc(){\\nvar capt=document.getElementById('recaptcha_response_field');\\nif (capt.value == '') { window.alert('You didn\\'t enter the image verification code.'); return false; }\\nelse { return true; }\\n}\\n/*]]>*/</script>\\n</form></center>\\n</body>\\n</html>\";\n\t} else {\n\t\t// Download captcha\n\t\t$page = geturl('www.google.com', 0, '/recaptcha/api/challenge?k=' . $publicKey, $referer, 0, 0, 0, $_GET['proxy'], $pauth);is_page($page);\n\t\tif (!preg_match('@[\\{,\\s]challenge\\s*:\\s*[\\'\\\"]([\\w\\-]+)[\\'\\\"]@', $page, $challenge)) html_error('Error getting reCAPTCHA challenge.');\n\t\t$inputs['recaptcha_challenge_field'] = $challenge = $challenge[1];\n\n\t\t$imgReq = geturl('www.google.com', 0, '/recaptcha/api/image?c=' . $challenge, $referer, 0, 0, 0, $_GET['proxy'], $pauth);is_page($imgReq);\n\t\tlist($headers, $imgBody) = explode(\"\\r\\n\\r\\n\", $imgReq, 2);\n\t\tunset($imgReq);\n\t\tif (substr($headers, 9, 3) != '200') html_error('Error downloading captcha img.');\n\t\t$mimetype = (preg_match('@image/[\\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/jpeg');\n\n\t\tEnterCaptcha(\"data:$mimetype;base64,\".base64_encode($imgBody), $inputs, 20, $sname, 'recaptcha_response_field');\n\t}\n\texit;\n}", "function captcha_validate( $captcha_unique_id, $captcha_input )\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$captcha_input = trim( strtolower($captcha_input) );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get the info from the DB\n\t\t//-----------------------------------------\n\t\t\n\t\t$captcha = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'captcha',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"captcha_unique_id='\".$captcha_unique_id.\"'\" ) );\n\t\n\t\tif ( ! $captcha['captcha_unique_id'] )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Check...\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $captcha['captcha_string'] != $captcha_input )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t}", "public function generate_code()\n {\n $code = \"\";\n $count = 0;\n while ($count < $this->num_characters) {\n $code .= substr($this->captcha_characters, mt_rand(0, strlen($this->captcha_characters)-1), 1);\n $count++;\n }\n return $code;\n }", "public function _checkCaptcha($input) {\n $code = $this->session->userdata('captcha_code');\n if (strcasecmp($code, $input) == 0) {\n return true;\n }\n $this->form_validation->set_message(__FUNCTION__, 'Captcha incorrect.');\n return false;\n }", "function getCaptchaView($aConfig=array()){\n\n\t$aData = getCaptcha($aConfig);\n\n\t$CI = &get_instance();\n\n\treturn $CI->load->view('captcha', $aData, true);\n}", "function create_image($cap)\n\n{\n\n unlink(\"./assets/image1.png\");\n\n global $image;\n\n $image = imagecreatetruecolor(200, 50) or die(\"Cannot Initialize new GD image stream\");\n\n $background_color = imagecolorallocate($image, 255, 255, 255);\n\n $text_color = imagecolorallocate($image, 0, 255, 255);\n\n $line_color = imagecolorallocate($image, 64, 64, 64);\n\n $pixel_color = imagecolorallocate($image, 0, 0, 255);\n\n imagefilledrectangle($image, 0, 0, 200, 50, $background_color);\n\n for ($i = 0; $i < 3; $i++) {\n\n imageline($image, 0, rand() % 50, 200, rand() % 50, $line_color);\n\n }\n\n for ($i = 0; $i < 1000; $i++) {\n\n imagesetpixel($image, rand() % 200, rand() % 50, $pixel_color);\n\n }\n\n $text_color = imagecolorallocate($image, 0, 0, 0);\n\n ImageString($image, 22, 30, 22, $cap, $text_color);\n\n imagepng($image, \"./assets/image1.png\");\n $_SESSION[\"captcha\"] = $cap;\n}", "public function index(){\n //to create the captcha folder automatically\n $path = './captcha';\n if(!is_dir($path)) {\n mkdir($path);\n } \n $this->load->model('Admin_model');\n $captcha = $this->Admin_model->_generateCaptcha();\n $this->session->set_userdata('captchaWord', $captcha['word']);\n $this->session->set_userdata('salt',hash('sha256',microtime()));\n $this->load->view('login', $captcha);\n }", "function captchaTest($captchaToken, $secret=CAPTCHA_SECRET) {\n $server = \"https://www.google.com/recaptcha/api/siteverify\";\n $post = [\n \"secret\" => $secret,\n \"response\" => $captchaToken\n ];\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $server);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t$answer = curl_exec($ch);\n\tcurl_close($ch);\n $result = json_decode($answer);\n // optional: $result->score returns heuristics 0-1\n // 0 = 100% bot, 1 = 100% human\n // $result->success is boolean\n return $result->success;\n}", "public function captchaDraw()\n {\n $HTML = ' <div id=\"cnt-captcha\" class=\"cnt-captcha\">\n <br>\n <div id= \"captcha-controll\" class= \"captcha-controll\">\n <img id=\"captcha\" align=\"middle\" src=\"./php/frontend/utilidades/captcha/comp/captcha.php\" alt=\"CAPTCHA Image\" width=\"150px\" height=\"60px\"/>\n </div> \n <div id=\"captcha-refresh\" class= \"captcha-controll\">\n <img id=\"rfrCaptcha\" align=\"middle\" src=\"./img/grids/refresh.png\" width=\"35px\" height=\"35px\" title=\"Actualizar imagen\"/>\n </div>\n <br>\n <br>\n <div id=\"captcha-text\" style=\"display:block\" align=\"center\">\n <input type=\"text\" id=\"captcha_code\" name=\"captcha_code\" size=\"10\" maxlength=\"6\" />\n </div>\n </div> \n ';\n \n return $HTML;\n }" ]
[ "0.7477949", "0.71817774", "0.7099943", "0.7045666", "0.69957924", "0.6994784", "0.6832279", "0.68170184", "0.67944556", "0.6794216", "0.67879105", "0.6769141", "0.6750773", "0.67362106", "0.6728325", "0.670551", "0.66925246", "0.6684418", "0.6672473", "0.6610346", "0.66068333", "0.6605594", "0.6589616", "0.6566891", "0.65643173", "0.65515584", "0.65471256", "0.65322614", "0.6507804", "0.6485152", "0.6481454", "0.64484406", "0.6412019", "0.6376758", "0.6322132", "0.63189596", "0.63188857", "0.6311382", "0.62992406", "0.6270116", "0.62663376", "0.625788", "0.62437487", "0.62432957", "0.62349135", "0.6234262", "0.6226097", "0.6223854", "0.6198716", "0.6185387", "0.61594987", "0.61556333", "0.61455894", "0.6144439", "0.6123988", "0.6120976", "0.61082983", "0.6100273", "0.60931945", "0.6086118", "0.60797983", "0.6068731", "0.6062571", "0.60585535", "0.60297984", "0.6010218", "0.59951526", "0.599434", "0.59871215", "0.59777594", "0.5967326", "0.5957089", "0.59511405", "0.594221", "0.59119076", "0.59110177", "0.59078944", "0.5906796", "0.5903398", "0.58624697", "0.5843231", "0.5841789", "0.5838093", "0.5826218", "0.5825953", "0.5818165", "0.5795133", "0.5784295", "0.57822764", "0.5772582", "0.5757625", "0.57274437", "0.5722701", "0.57208204", "0.5719038", "0.57162315", "0.5715193", "0.5692933", "0.5689163", "0.56823134", "0.5681522" ]
0.0
-1
The "index" action is the default action for all controllers. This will be the landing page of your application. Assuming the default route and default router, this action is dispatched via the following urls: / /index/ /index/index
public function indexAction() { // Рандом видео из лучших $model_files = new Model_Files(); $_arr = $model_files->fetchRandomTopFile(); $this->view->model_file_obj = $_arr; // Топ (видео) $_arr = $model_files->fetchTopSelect(ST_REQUEST_TOP_TYPE_ALL); $this->view->top_video_array = $_arr; unset($model_files); // dump($this->_helper->viewRenderer->getResponse()->getBody()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionIndex(){ \n $this->view(\"index.php\");\n }", "public function actionIndex()\n {\n $this->view->render('index');\n }", "public function indexAction()\n {\n $this->render('/views/index.html');\n }", "public function indexAction(){}", "public function indexAction() {\r\n\r\n// NSP::$app->registry->view->welcome = 'Welcome to NSP MVC';\r\n//\r\n// /*** load the index template ***/\r\n NSP::$app->view->viewVar = 'Rest controller';\r\n NSP::$app->registry->get('view')->show('index');\r\n }", "public function actionIndex() {\n $view_str = $this->renderView('index.php');\n return $view_str;\n \n //uncomment and edit the line below to incorporate the view above into your app's template\n //return $this->renderLayout( 'main-template.php', ['content'=>$view_str] );\n }", "public function actionIndex()\n {\n $this->render('index');\n }", "public function actionIndex()\n {\n return $this->render('/index');\n }", "public function indexAction()\n {\n $this->_forward('view');\n }", "public function indexAction()\n\t{\n\t\t$this->_forward('view');\n\t}", "public function actionIndex() {}", "public function actionIndex() {}", "public function indexAction()\n\t{\n\t\t//echo 'Hello from the index action in the Home controller!';\n\t\t\n\t\t/*View::render('Home' . DS . 'index.php', [\n\t\t\t\"name\" => \"Laura\",\n\t\t\t\"colours\" => [\"red\", \"green\", \"blue\"]\n\t\t]);*/\n\t\t\n\t\t// View::renderTemplate('Home' . DS . 'index.html', [\n\t\t// \t\"name\" => \"Laura\",\n\t\t// \t\"colours\" => [\"red\", \"green\", \"blue\"]\n // ]);\n \n\t\t$this->showRouteParams();\n\t\t// echo \"Hello, World!\";\n }", "public function indexAction() \n\t{\n\t\t$this->_forward('view');\n\t}", "public function actionIndex(): void\n {\n $this->actionInit();\n $this->actionDeploy();\n $this->actionSwitch();\n }", "public function indexAction() {\n\t\t// TODO Auto-generated AdminController::indexAction() default action\n\t}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function actionIndex()\n\t{\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t\n\t\t$this->render('index');\n\t}", "public function actionIndex(){\r\r\n\t\t$this->render('index', array());\r\r\n\t}", "protected function indexAction() {}", "public function indexAction()\n {\n return $this->doIndex();\n }", "public function indexAction()\n {\n return $this->doIndex();\n }", "public function indexAction()\n {\n return $this->doIndex();\n }", "public function indexAction()\n {\n return $this->doIndex();\n }", "public function action_index()\r\n\t{\r\n\t\t$this->title = 'Welcome';\r\n\t\t$this->template->content = View::factory('index');\r\n\t}", "public function actionIndex()\n {}", "public function indexAction()\n {\n $this->addAction();\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function action_index()\n\t{\n\t\treturn Redirect::to('/');\n\t}", "public function indexAction() {\n\t\t$this->_initAction()\n\t\t\t->renderLayout();\n\t}", "public function indexAction() : string\n {\n // Deal with the action and return a response.\n return \"index\";\n }", "public function actionIndex()\n\t{\n\n\t\treturn $this->render(\"index\");\n\n\n\t}", "public function actionIndex()\n {\n return $this->render('index.twig');\n }", "public function singleIndexAction() {}", "public function actionIndex()\r\n {\r\n\t\treturn $this->render('index');\r\n }", "protected function indexAction()\n {\n }", "public function indexAction()\n {\n return $this->render('default/index.html.twig');\n }", "public function indexAction()\n {\n return $this->render('default/index.html.twig');\n }", "public function indexAction()\n {\n return $this->render('default/index.html.twig');\n }", "public function actionIndex() {\n $this->assignLangue();\n $this->render('index');\n }", "public function actionIndex() {\n\t\treturn $this->render('index');\n\t}", "public function actionIndex()\r\n {\r\n \treturn $this->render('index');\r\n }", "public function index() {\n $this->view->render('index/index', null, null);\n }", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n\t{\n\t $this->pageTitle = 'Get Started';\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t$this->layout = 'main' ;\n\t\t$this->render('index') ;\n\t}", "public function actionIndex()\n\t{\n\t\t$this->layout ='main';\n\t\t$this->render('index');\n\t}", "public function Index()\n\t{\n\t\t$this->views->SetTitle('Index Controller');\n\t\t$this->views->AddView('index/index.tpl.php', array(),'primary');\n\t}", "public function indexAction() {\n $this->formAction();\n }", "public function indexAction() {\n $this->formAction();\n }", "public function actionIndex() {\n // renders the view file 'protected/views/site/index.php'\n // using the default layout 'protected/views/layouts/main.php'\n $this->render('index');\n }", "function index() {\n $this->renderView(\"index\");\n }", "public function index() {\n\t\t$this->display('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function indexAction()\n {\n $this->_initAction()\n ->renderLayout();\n }", "public function indexAction() {\n\t\t$this->_notImplemented();\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n {\n Yii::log('action: Index', 'error');\n // renders the view file 'protected/views/site/index.php'\n // using the default layout 'protected/views/layouts/main.php'\n $this->render('index');\n }", "public function indexAction() {\n\n\n $this->assign('loginUrl', $this->actions['loginUrl']);\n $this->assign('logoutUrl', $this->actions['logoutUrl']);\n $this->assign('indexUrl', $this->actions['indexUrl']);\n }", "public function actionIndex()\r\n\t{\r\n\t\t// renders the view file 'protected/views/site/index.php'\r\n\t\t// using the default layout 'protected/views/layouts/main.php'\r\n\t\t$this->render('index');\r\n\t}", "public function indexAction() {\r\n }", "public function indexAction()\n {\n// $this->view = 'index';\n }", "public function indexAction() {\n\t}", "public function indexAction() {\n\t}", "public function actionIndex()\n {\n\t return $this->render('index');\n }", "public function indexAction() {\n \n }", "public function actionIndex()\n {\n\t\techo \"=== Action index ===\";\n \n }", "public function actionIndex()\n {\n //$this->redirect(array('site/login'));\n $this->render('home', array());\n }", "public function indexAction()\r\n {\r\n $this->_initAction()\r\n ->renderLayout();\r\n }", "abstract public function actionIndex();", "public function actionIndex() {\n// $this->\n // renders the view file 'protected/views/site/index.php'\n // using the default layout 'protected/views/layouts/main.php'\n $this->render('index');\n }" ]
[ "0.7738967", "0.77320236", "0.77279156", "0.7725778", "0.7720843", "0.7699063", "0.76702195", "0.7664014", "0.7659877", "0.76440614", "0.7632856", "0.7632856", "0.7619304", "0.761614", "0.7597687", "0.7597215", "0.7582945", "0.75803876", "0.75802016", "0.75802016", "0.75802016", "0.75802016", "0.75802016", "0.75802016", "0.75802016", "0.75802016", "0.75802016", "0.7576804", "0.7576804", "0.7576804", "0.7576804", "0.75682974", "0.75675476", "0.75113827", "0.7509486", "0.7509486", "0.7509486", "0.7509486", "0.7500519", "0.7483649", "0.74761117", "0.74572915", "0.7442526", "0.7437782", "0.7435527", "0.74296355", "0.7428454", "0.7427982", "0.7423697", "0.7410804", "0.7407394", "0.7407394", "0.7407394", "0.7391085", "0.7387876", "0.7385239", "0.73719513", "0.73680156", "0.7363698", "0.7344193", "0.7338563", "0.733409", "0.73295814", "0.73295814", "0.73260736", "0.7323436", "0.73130935", "0.7312756", "0.7312756", "0.7312756", "0.7312756", "0.7312756", "0.7312756", "0.7312756", "0.7312756", "0.7312756", "0.7312756", "0.7312756", "0.7312756", "0.7312756", "0.7312756", "0.7312756", "0.7312756", "0.7312756", "0.73118174", "0.73076826", "0.73061574", "0.730177", "0.7296983", "0.72915715", "0.728639", "0.7285823", "0.72829074", "0.72829074", "0.72818935", "0.72743285", "0.7270697", "0.7266401", "0.72605634", "0.72604674", "0.72597027" ]
0.0
-1
Handle the transaction "created" event.
public function created(Transaction $transaction) { $user = User::findOrFail($transaction->user_id); $status = $transaction->status; if($user){ if($status == 'approved'){ $user->notify(new TransactionNotification(explode(' ', $user->name)[0], false, false, true, $transaction)); }else { $user->notify(new TransactionNotification(explode(' ', $user->name)[0], true, false, false, $transaction)); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function created(Transaction $transaction)\n {\n //\n }", "public function created(Transaction $transaction)\n {\n ProcessTransfer::dispatch($transaction, $this->authorizationService);\n }", "public function createTransaction()\n {\n }", "public function handleOrderCreated(OrderCreatedEvent $event) {\n $order = $event->order;\n $user = $order->user;\n if( null != $user ) {\n $user->notify(new OrderStatusNotification($order, 'created'));\n }\n }", "public function created(Like $like){\n\n Log::emergency('like created');\n// Miscellaneous::create_transaction($like->user_id, 4);\n event(new CreatePointTransaction($like->user_id, 4));\n\n }", "public function created(Exchange $exchange)\n {\n //\n }", "public function created(Order $order)\n\t{\n\t\t//\n\t}", "public function created(Order $order)\n\t{\n\t\t//\n\t}", "public function created(Auditable $model)\n {\n Auditor::execute($model->setAuditEvent('created'));\n }", "public function created(Contract $contract)\n {\n //\n }", "public function create()\n {\n $this->authorize('create', Transaction::class);\n }", "public function created(Transaction $transaction)\n {\n clearCacheByArray($this->getCacheKeys($transaction));\n clearCacheByTags($this->getCacheTags($transaction));\n }", "protected function created()\n {\n $this->response = $this->response->withStatus(201);\n $this->jsonBody($this->payload->getOutput());\n }", "public function onCreateTransaction(\\CEvent $event)\n {\n $params = $event->params;\n if (empty($params['transaction']) || !($params['transaction'] instanceof Commerce_TransactionModel)) {\n throw new Exception('onCreateTransaction event requires \"transaction\" param with Commerce_TransactionModel instance');\n }\n $this->raiseEvent('onCreateTransaction', $event);\n }", "public static function created($callback)\n {\n self::listenEvent('created', $callback);\n }", "abstract protected function _start_transaction();", "public function onCreated()\n {\n parent::onCreated();\n\n }", "public function onCreated()\n {\n parent::onCreated();\n\n }", "protected function createTransaction(): void\n {\n if ($this->transactions == 0) {\n try {\n $this->call('beginTransaction');\n } catch (Throwable $e) {\n $this->handleBeginTransactionException($e);\n }\n } elseif ($this->transactions >= 1) {\n $this->createSavepoint();\n }\n }", "public function testHandleCreate(): void\n {\n $query = 'SELECT * FROM [nt:unstructured]';\n $locale = 'fr';\n $primarySelector = 'p';\n\n $this->queryCreateEvent->getInnerQuery()->willReturn($query);\n $this->queryCreateEvent->getLocale()->willReturn($locale);\n $this->queryCreateEvent->getOptions()->willReturn([]);\n $this->queryCreateEvent->getPrimarySelector()->willReturn($primarySelector);\n $this->queryManager->createQuery($query, 'JCR-SQL2')->willReturn($this->phpcrQuery->reveal());\n $this->queryCreateEvent->setQuery(new Query(\n $this->phpcrQuery->reveal(),\n $this->dispatcher->reveal(),\n $locale,\n [],\n $primarySelector\n ))->shouldBeCalled();\n\n $this->subscriber->handleCreate($this->queryCreateEvent->reveal());\n }", "public static function beginTransaction()\n {\n }", "public function beforeCreate()\n {\n\t\t// Asignar la fecha y hora de creacion del registro\n $this->createdon = time();\n $this->updatedon = time();\n\t\tif ($this->subscribedon == 0) {\n\t\t\t$this->subscribedon = $this->createdon;\n\t\t}\n }", "protected function _processTransactionSubscriptionCreated($parameters) {\n\t\t\t$subscriptionData = array(\n\t\t\t\tarray(\n\t\t\t\t\t'created' => $parameters['transaction_date'],\n\t\t\t\t\t'id' => $parameters['subscription_id'],\n\t\t\t\t\t'invoice_id' => $parameters['invoice_id'],\n\t\t\t\t\t'interval_type' => $parameters['interval_type'],\n\t\t\t\t\t'interval_value' => $parameters['interval_value'],\n\t\t\t\t\t'payment_method_id' => $parameters['payment_method_id'],\n\t\t\t\t\t'plan_id' => $parameters['plan_id'],\n\t\t\t\t\t'price' => $parameters['payment_amount'],\n\t\t\t\t\t'status' => 'active',\n\t\t\t\t\t'user_id' => $parameters['user_id']\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\t!empty($parameters['user']) &&\n\t\t\t\t$this->save('subscriptions', $subscriptionData)\n\t\t\t) {\n\t\t\t\t$paymentMethod = $this->fetch('payment_methods', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'id' => $subscriptionData[0]['payment_method_id']\n\t\t\t\t\t),\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'name'\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (!empty($paymentMethod['count'])) {\n\t\t\t\t\t$subscriptionData[0]['payment_method_name'] = $paymentMethod['data'][0];\n\t\t\t\t\t$mailParameters = array(\n\t\t\t\t\t\t'from' => $this->settings['from_email'],\n\t\t\t\t\t\t'subject' => 'New subscription #' . $subscriptionData[0]['id'] . ' created',\n\t\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\t'name' => 'subscription_created',\n\t\t\t\t\t\t\t'parameters' => array(\n\t\t\t\t\t\t\t\t'subscription' => $subscriptionData[0],\n\t\t\t\t\t\t\t\t'transaction' => $parameters,\n\t\t\t\t\t\t\t\t'user' => $parameters['user']\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'to' => $parameters['user']['email']\n\t\t\t\t\t);\n\t\t\t\t\t$this->_sendMail($mailParameters);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}", "public function created(Transaction $transaction)\n {\n // First check is this transaction created by a join account member\n $account = Account::with([\n 'users',\n 'money_format'\n ])->joinAccount()->find($transaction->account_id);\n if ($account) {\n // get transaction creator\n $transactionCreator = User::find($transaction->user_id);\n // get transaction type\n $transactionType = TransactionType::find($transaction->transaction_type_id)->name;\n // get account money calculation format\n $moneyFormat = $account->money_format->name;\n // get transaction created date\n $transactionDate = date('d-m-Y h:i A', strtotime($transaction->created_at));\n // get all members of join account except who created\n $users = $account->users->where('id', '!=', $transaction->user_id);\n // get members emails and phones\n $emails = $users->pluck('email');\n $phones = $users->pluck('phone');\n\n // send message to all selected members\n $message = \"$transactionCreator->name is $transactionType $transaction->amount $moneyFormat only at $transactionDate\";\n }\n // If so, send mail and sms to other member of this account\n }", "public function transactionStart()\n\t{\n\t\treturn;\n\t}", "abstract public function startTransaction();", "public function startTransaction(): void;", "public function created(Order $order)\n {\n //\n }", "public function created(Post $post)\n {\n $post->recordActivity('created');\n }", "function after_create() {}", "public function onPrePersist()\n {\n $this->setCreated(new \\DateTime(\"now\"));\n }", "public function created(Order $Order)\n {\n //code...\n }", "public function trackTransaction() {\n\t\t\n\t\tif ( ! empty( $this->commerce_event ) ) {\n\t\t\t$this->trackEvent( $this->commerce_event );\n\t\t\t$this->commerce_event = '';\n\t\t}\n\t}", "function created()\n {\n /**\n * [signal]\n *\n * IDF_Project::created\n *\n * [sender]\n *\n * IDF_Project\n *\n * [description]\n *\n * This signal allows an application to perform special\n * operations at the creation of a project.\n *\n * [parameters]\n *\n * array('project' => $project)\n *\n */\n $params = array('project' => $this);\n Pluf_Signal::send('IDF_Project::created',\n 'IDF_Project', $params);\n }", "public function created(Item $item)\n {\n //\n }", "public function onPrePersist()\n {\n $this->created = new \\DateTime('now');\n }", "public function create()\n {\n return view(\"inventory.transaction.create\");\n }", "public abstract function beginTransaction();", "public function onPrePersist()\n {\n $this->created = new \\DateTime(\"now\");\n }", "protected function emitNotificationCreated(Notification $notification) {}", "public function beginTransaction() {\n\t\t//noop\n\t}", "public function beginTransaction();", "public function beginTransaction();", "public function beginTransaction();", "public function creating(Transaction $transaction)\n {\n $transaction->uuid=$transaction->uuid??(string) \\Illuminate\\Support\\Str::uuid();\n }", "public function created(History $history)\n {\n //\n }", "public function beginTransaction():void;", "public function handleTransactionBeginning(TransactionBeginning $event)\n {\n Log::debug('begin');\n }", "public function created(RideShareTransaction $rideShareTransaction)\n {\n event(new UpdateEvent('shareRideTransaction'));\n }", "public function handle(InvoiceCreated $event)\r\n {\r\n $this->invoiceCalculate->calculate($event->invoice);\r\n\r\n // Increment the next id.\r\n Group::incrementNextId($event->invoice);\r\n\r\n // Create the custom invoice record.\r\n $event->invoice->custom()->save(new InvoiceCustom());\r\n }", "public static function transaction_event_handler(Event $Event): void\n {\n /** @var Transaction $Transaction */\n $Transaction = $Event->get_subject();\n $event_name = $Event->get_event_name();\n if (strpos($event_name, '_after_') !== false) {\n $message = str_repeat(' ', $Transaction->get_nesting() * 4) . get_class($Transaction) . ':' . $Transaction->get_resource()->get_resource_id() . ' ' . str_replace('_after_', '', $event_name);\n if (self::CONFIG_RUNTIME['group_messages']) {\n try {\n $Context = Coroutine::getContext();\n if (!isset($Context->{self::class})) {\n $Context->{self::class} = new \\stdClass();\n }\n if (!isset($Context->{self::class}->transaction_debug_messages)) {\n $Context->{self::class}->transaction_debug_messages = [];\n }\n $Context->{self::class}->transaction_debug_messages[] = $message;\n } catch (ContextDestroyedException $Exception) {\n Kernel::log($message, LogLevel::DEBUG);\n }\n } else {\n Kernel::log($message, LogLevel::DEBUG);\n }\n }\n }", "public function postPersist(LifecycleEventArgs $args)\n {\n $this->doctrineLog($args,\n array(\n 'action' => 'created',\n 'level' => 'doctrine',\n ));\n }", "protected function beginTrans(){\r\n $this->transaction=$this->dba->beginTransaction();\r\n $this->isTransactionBegun=true;\r\n }", "protected function _precreate() {\n }", "public function invoiceCreated($invoice)\n\t{\n\n\t}", "public function prePersist()\n {\n $this->created = new \\DateTime();\n }", "private function record_transaction( $details ) {\n\n\t\tglobal $wpdb;\n\n\t\t$sql_cols = \"user_id, timestamp, \";\n\t\t$sql_vals = \"'\" . $details['custom'] . \"','\" . current_time( 'mysql' ) . \"',\";\n\t\t$txn_cols = $this->record_transaction_columns();\n\t\tforeach ( $txn_cols as $column ) {\n\t\t\tif ( isset( $details[ $column ] ) ) {\n\t\t\t\t$sql_cols.= $column . \",\";\n\t\t\t\t$sql_vals.= \"'\" . $details[ $column ] . \"',\";\n\t\t\t}\n\t\t}\n\t\t$sql = \"INSERT INTO \" . $wpdb->prefix . $this->transaction_table . \" ( \" . rtrim( $sql_cols, ',' ) . \" ) VALUES ( \" . rtrim( $sql_vals, ',' ) . \" )\";\n\t\t\n\t\t$result = $wpdb->query( $sql );\n\t\t\n\t\treturn;\n\t}", "function before_create() {}", "public function create()\n {\n return \"inside create method\";\n }", "protected function onCreated()\n {\n return true;\n }", "public function created(Region $region)\n {\n $this->cache->cacheFlush([\n ['allRegions'],\n ['allRegionChildren'],\n ['RegionAncestors']\n ]);\n }", "public function prePersist()\n {\n $this->created = new \\DateTime(\"now\");\n }", "public function create()\n {\n // Not needed cause this is coming from the item listing\n }", "public function created(Seller $seller)\n {\n $transaction = new Transaction();\n $transaction->amount = 0;\n $transaction->seller_id = $seller->id;\n $transaction->save();\n }", "public function addCreated()\n {\n try {\n $date = new DateTime();\n $this->created_at = $date->format('Y-m-d H:i:s');\n $this->created_by = 0;\n } catch (Exception $e) {\n print_r($e);\n }\n }", "protected function MetaAfterCreate() {\n\t\t}", "public function afterCreate(\\stdClass $data, Entity $entity) { }", "public function beginTransaction()\n {\n $this->transactions++;\n\n if ($this->transactions == 1) {\n $this->transaction = $this->neo->beginTransaction();\n }\n\n $this->fireConnectionEvent('beganTransaction');\n }", "public function created(Conversation $conversation)\n {\n //\n }", "public function created(ContactRecipient $contact_recipient)\n {\n //\n }", "public function creating()\n {\n # code...\n }", "public function created(Order $order): void\n\t{\n\t\t$order->chat()->create();\n\t}", "public function transaction();", "public function transaction();", "private function _eventAfterCreate($data){\r\n $this->on(self::EVENT_AFTER_CREATE,[$this,'_eventAddTag'],$data);\r\n $this->trigger(self::EVENT_AFTER_CREATE);\r\n }", "public function create()\n {\n //\n return view('transaction.create');\n }", "public function onPreCreate(ResourceEventInterface $event): void\n {\n $member = $this->getMemberFromEvent($event);\n\n $this->getGateway($member->getAudience()->getGateway(), GatewayInterface::INSERT_MEMBER);\n }", "public function transactionBegin() {\n $this->host->beginTransaction();\n }", "public function beginTransaction(): void\n {\n $this->createTransaction();\n\n ++$this->transactions;\n }", "public function getCreated() {}", "public function getCreated() {}", "public function created(Translation $translation);", "public function create()\n {\n // handled by client\n }", "public function created($task)\n {\n $task->notifyMembers('Created');\n }", "public function created(Cart $cart)\n {\n //\n }", "public function created(EntryInterface $entry)\n {\n $this->commands->dispatch(new CreateStream($entry));\n\n parent::created($entry);\n }", "public function onPrePersist(): void\n {\n $this->created = new DateTime(new DateTimeZone(\"UTC\"), \"now\");\n }", "public function onPrePersist()\r\n {\r\n $this->created_at = new \\DateTime(\"now\");\r\n }", "public function getEventType()\n {\n return EventType::TRANSFER_CREATED;\n }", "public function postCreate() {\n\t\t// Check permission\n //\n if (!Sentry::getUser()->hasAccess($this->permission_prefix . '.create')) {\n return App::abort('403');\n }\n\t}", "public function created(Thread $thread)\n {\n $thread->user->recordActivity('created a new thread:', $thread);\n }", "public function created(Project $project)\n {\n \n $project->recordActivity('created');\n\n }", "public function onPrePersist(): void\n {\n $this->created = new DateTime(\"now\", new DateTimeZone(\"UTC\"));\n }", "public function create() {\n //\n }", "public function created(Masyarakat $masyarakat)\n {\n $author = $masyarakat->name;\n $users = User::all();\n foreach ($users as $user) {\n $user->notify(new NewItem($masyarakat,$author));\n }\n }", "public function createVeto(ActiveUserPreCreatedEvent $event): void\n {\n }", "public function created(Post $post)\n {\n //\n }", "public function create()\n {\n //\n// $this->store();\n\n }", "public function created(Task $task)\n {\n broadcast(new Created($task))->toOthers();\n }", "public function handle(StreamWasCreated $event)\n {\n $this->dispatch(new CreateStreamsEntryTable($event->getStream()));\n }" ]
[ "0.7344605", "0.70833266", "0.65012735", "0.6283569", "0.5966646", "0.5904832", "0.5798684", "0.5798684", "0.5778851", "0.5725717", "0.56815696", "0.56668526", "0.5644545", "0.56093234", "0.560743", "0.56014085", "0.55826896", "0.55826896", "0.5576279", "0.55754554", "0.5550224", "0.5540875", "0.55343765", "0.5524877", "0.5520386", "0.5513156", "0.5510791", "0.5499385", "0.5463673", "0.5457688", "0.5450236", "0.54480326", "0.5447988", "0.54313725", "0.54170406", "0.5414604", "0.54112244", "0.54073817", "0.53931594", "0.5391504", "0.5377717", "0.53644913", "0.53644913", "0.53644913", "0.53369147", "0.5328695", "0.53163636", "0.5306508", "0.5304512", "0.5296016", "0.52824056", "0.52811825", "0.5260087", "0.52572626", "0.52550745", "0.52474165", "0.52392274", "0.523786", "0.5237791", "0.52363926", "0.5234946", "0.523105", "0.52120256", "0.5211409", "0.52076626", "0.5203722", "0.5196854", "0.5194426", "0.51914144", "0.5170296", "0.5169384", "0.51648086", "0.5162071", "0.5162071", "0.5138014", "0.5129099", "0.5127007", "0.5126093", "0.5118998", "0.51103204", "0.51103204", "0.5105945", "0.5105722", "0.51026595", "0.5082315", "0.50645864", "0.50555176", "0.5050554", "0.50331753", "0.502661", "0.5025645", "0.5016521", "0.50141054", "0.50097996", "0.50080127", "0.5003696", "0.50028306", "0.49953464", "0.49921995", "0.49903703" ]
0.6278616
4
Handle the transaction "updated" event.
public function updated(Transaction $transaction) { if($transaction->isDirty('status')){ $user = User::findOrFail($transaction->user_id); $status = $transaction->status; if($status == 'approved'){ $user->notify(new TransactionNotification(explode(' ', $user->name)[0], false, false, true, $transaction)); }elseif($status == 'declined'){ $user->notify(new TransactionNotification(explode(' ', $user->name)[0], false, true, false, $transaction)); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updated(Transaction $transaction)\n {\n //\n }", "public function updated(Transaction $transaction)\n {\n //\n }", "public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }", "protected function performUpdate() {}", "public function commitUpdate();", "public function handleOrderUpdated(OrderChangedEvent $event) {\n $order = $event->order;\n $user = $order->user;\n if( null != $user ) {\n $user->notify(new OrderStatusNotification($order, 'updated'));\n }\n }", "public function updated(Exchange $exchange)\n {\n //\n }", "public function handleUpdated(Updated $event): void\n {\n $entity = $event->entity();\n\n $this->scheduleCreatingNewDocuments($entity);\n $this->scheduleRemovingOldDocuments($entity);\n\n $this->elasticsearchManager->commit();\n }", "public function onUpdate();", "public function onUpdate();", "public function onUpdate();", "public function processUpdate()\n {\n // Clear SWAPPED state bit\n $this->_state &= ~self::SWAPPED;\n\n $this->_memManager->processUpdate($this, $this->_id);\n }", "protected function onUpdated()\n {\n return true;\n }", "public function isUpdated() {}", "public function postUpdateCallback()\n {\n $this->performPostUpdateCallback();\n }", "public function postUpdateCallback()\n {\n $this->performPostUpdateCallback();\n }", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "public function doUpdate() {\n\t\ttry {\n\t\t\tcall_user_func_array( $this->doUpdateFunction, $this->arguments );\n\t\t} catch ( Exception $ex ) {\n\t\t\t$this->exceptionHandler->handleException( $ex, 'data-update-failed',\n\t\t\t\t'A data update callback triggered an exception' );\n\t\t}\n\t}", "protected function update() {}", "public static function updated($callback)\n {\n self::listenEvent('updated', $callback);\n }", "protected function _update()\n\t{\n\t}", "public function _get_update_callback()\n {\n }", "protected function _postUpdate()\n\t{\n\t}", "protected function performPostUpdateCallback()\n {\n // echo 'updated a record ...';\n return true;\n }", "public function updated(Order $Order)\n {\n //code...\n }", "public function updating()\n {\n # code...\n }", "public function updated(Wallet $wallet)\n {\n //\n }", "protected function afterUpdating()\n {\n }", "public function update(Request $request) {\n Log::info(\"TransactionController->update :- Inside \");\n return $this->store_transaction($request, \"update\");\n }", "public function after_update() {}", "public function account_updated(){\n $this->log();\n http_response_code(200);\n ob_end_flush();\n }", "public function updateTransaction($tid, $args, $shippingConfirmed){}", "final public function notifyOrderUpdated(): void\n {\n $this->dirtyIndex = true;\n }", "public function update() {\n $this->connection->update(\n \"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), array(\"idchangemoney\" => $this->observer->idchangemoney), $this->user->iduser\n );\n }", "public function update()\n {\n //\n }", "public function update()\n {\n //\n }", "abstract protected function doUpdate($oldVersion);", "public function updated(Currency $currency)\n {\n //\n }", "public function getUpdated();", "public function getUpdated();", "public function updated(Order $order)\n {\n //\n }", "public function updated(Order $order)\n {\n //\n }", "protected function postProcessUpdateReceipt()\n {\n }", "public function handleTransactionCommitted(TransactionCommitted $event)\n {\n Log::debug('commit');\n }", "public function update()\r\n {\r\n //\r\n }", "public function update()\n {\n # code...\n }", "public function update() {\r\n }", "public function onUpdated(Step $step): void\n {\n }", "public function handle(UserUpdated $event)\n {\n $this->amqpService->publish($event);\n }", "public function update()\n {\n }", "function after_update() {}", "public function testUpdate()\n {\n $data = array(\n 'foo' => 'baz'\n );\n\n $transaction = $this->client->transaction()->Update(654, $data);\n\n $this->assertEquals($data, get_object_vars($transaction->put), 'Passed variables are not correct');\n $this->assertEquals('PUT', $transaction->request_method, 'The PHP Verb Is Incorrect');\n $this->assertEquals('/transactions/654', $transaction->path, 'The path is incorrect');\n\n }", "public function updated(Conversation $conversation)\n {\n //\n }", "public function responseAdditionalUpdates($transaction)\n {\n }", "public function ApplyChanges()\n {\n parent::ApplyChanges();\n\n // Update data\n $this->Update();\n }", "public function checkoutCartUpdateItemComplete(Varien_Event_Observer $observer)\n {\n $this->_lastUpdatedItem = $observer->getItem();\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function testUpdate(): void { }", "public function updated(Contract $contract)\n {\n //\n }", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "protected function afterUpdate()\n {\n }", "protected function afterUpdate()\n {\n }", "public function _postUpdate()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "public function refreshUpdated()\n {\n $this->setUpdated(new \\DateTime());\n }", "public function update()\r\n {\r\n \r\n }", "protected function update() {\n $this->db->updateRows($this->table_name, $this->update, $this->filter);\n storeDbMsg($this->db,ucwords($this->form_ID) . \" successfully updated!\");\n }", "public function processUpdate()\n {\n // Validate Request\n $validationRules = $this->getValidationRules();\n // Hook Filter updateModifyValidationRules\n $validationRules = $this->doFilter(\"updateModifyValidationRules\", $validationRules);\n $validationMessages = array();\n // Hook Filter updateModifyValidationMessages\n $validationMessages = $this->doFilter(\"updateModifyValidationMessages\", $validationMessages);\n $validator = Validator::make($this->Request->all(), $validationRules, $validationMessages);\n if ($validator->fails()) {\n $Response = back()->withErrors($validator)->withInput();\n $this->redirect($Response);\n }\n // Record is valid\n $Model = $this->isValidRecord();\n if ($Model instanceof \\Illuminate\\Http\\RedirectResponse) {\n $this->redirect($Model);\n }\n // Set value for BIT columns\n $this->setValueBitColumns();\n // Set initial configuration\n $Model->build($this->Model->getTable());\n $requestParameters = $this->Request->all();\n $requestParameters = $this->setValueBlobColumns($requestParameters);\n // Hook Filter updateModifyRequest\n $this->Model = clone $Model;\n $parameters = $this->doFilter(\"updateModifyRequest\", $requestParameters);\n // Update record\n if ($this->getIsTransaction()) {\n DB::transaction(function ($db) use ($Model, $parameters) {\n $Model->update($parameters);\n // Hook Action updateAfterUpdate\n $this->doHooks(\"updateAfterUpdate\", array($Model));\n });\n } else {\n $Model->update($parameters);\n // Hook Action updateAfterUpdate\n $this->doHooks(\"updateAfterUpdate\", array($Model));\n }\n // Set response redirect to list page and set session flash\n $Response = redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_success', trans('dkscaffolding.notification.update.success'));\n // Hook Filter updateModifyResponse\n $Response = $this->doFilter(\"updateModifyResponse\", $Response);\n $this->redirect($Response);\n }", "public function update()\n {\n\n }", "public function update()\n {\n\n }", "public function updated(Translation $translation);", "public function update(Request $request, Transaction $transaction)\n {\n\n }", "public function update(Request $request, Transaction $transaction)\n {\n //\n }", "public function update(Request $request, Transaction $transaction)\n {\n //\n }", "public function update(Request $request, Transaction $transaction)\n {\n //\n }", "public function update(Request $request, Transaction $transaction)\n {\n //\n }", "public function update () {\n\n }", "public function testUpdateChangesInputInDatabase()\n {\n $transaction = factory(Transaction::class)->states('with_account')->create();\n $transactionArray = $transaction->toArray();\n $transactionArray['amount'] = 155.49;\n\n $updatedTransaction = $this->repository->update($transactionArray, $transaction->id);\n\n $this->assertEquals($transaction->id, $updatedTransaction->id);\n $this->assertDatabaseHas('transactions', array_add($transactionArray, 'id', $updatedTransaction->id));\n }", "protected function afterUpdate() {\n\t}", "public function updated_message() {\n\t\t$tab = Template::current_tab();\n\n\t\t// Show updated notice.\n\t\tadd_action( 'beehive_admin_top_notices', function () use ( $tab ) {\n\t\t\tswitch ( $tab ) {\n\t\t\t\tcase 'tracking':\n\t\t\t\t\t$this->notice( __( 'Tracking ID updated successfully.', 'ga_trans' ), 'success', true );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$this->notice( __( 'Changes were saved successfully.', 'ga_trans' ), 'success', true );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} );\n\t}", "public function testHandleUpdateSuccess()\n {\n // Populate data\n $dealerAccountID = $this->_populate();\n \n // Set params\n $params = $this->customDealerAccountData;\n \n // Add ID\n $ID = $this->_pickRandomItem($dealerAccountID);\n $params['ID'] = $ID;\n \n // Request\n $this->withSession($this->adminSession)\n ->call('POST', '/dealer-account/edit', $params, [], [], ['HTTP_REFERER' => '/dealer-account/edit']);\n \n // Validate response\n $this->assertRedirectedTo('/dealer-account/edit');\n $this->assertSessionHas('dealer-account-updated', '');\n \n // Validate data\n $dealerAccount = $this->dealer_account->getOne($ID);\n $this->assertEquals($dealerAccount->name, $this->customDealerAccountData['name']);\n $this->assertEquals($dealerAccount->branch_ID, $this->customDealerAccountData['branch_ID']);\n }", "public function update()\n\t{\n\n\t}", "protected function onUpdate(): Update\r\n {\r\n }", "public function update()\n {\n $this->_checkItem();\n $service = $this->getService();\n $entry = $service->getGbaseItemEntry( $this->getItem()->getGbaseItemId() );\n $this->setEntry($entry);\n $this->_prepareEnrtyForSave();\n $entry = $service->updateGbaseItem($this->getEntry());\n\n }", "public function update() {\r\n\r\n\t}", "public function db_update() {}", "public function update() {\n \n }", "public function setUpdated($updated);", "public function update()\n {\n \n }" ]
[ "0.72023755", "0.72023755", "0.6400626", "0.60383517", "0.6006888", "0.59550333", "0.59287226", "0.5914402", "0.58895326", "0.58895326", "0.58895326", "0.58615935", "0.5858516", "0.58291715", "0.5816223", "0.5816223", "0.581255", "0.581255", "0.58040243", "0.5795616", "0.5787946", "0.5786627", "0.5774433", "0.57705325", "0.5763544", "0.5753093", "0.57465243", "0.5741454", "0.57309705", "0.5730673", "0.5725876", "0.5715155", "0.56701297", "0.56313163", "0.5628521", "0.5614822", "0.5614822", "0.56126213", "0.56073165", "0.56062937", "0.56062937", "0.5604902", "0.5604902", "0.5601583", "0.5596338", "0.55938065", "0.556091", "0.5554154", "0.55498064", "0.55434173", "0.55271953", "0.5526883", "0.5516063", "0.5507187", "0.54936075", "0.54918003", "0.54771936", "0.54739785", "0.54739785", "0.54739785", "0.54739785", "0.54739785", "0.54739785", "0.54739785", "0.54739785", "0.54739785", "0.54739785", "0.54739785", "0.54739785", "0.5473912", "0.54598945", "0.5455447", "0.5431861", "0.5431861", "0.5417203", "0.541461", "0.5412026", "0.54071945", "0.54061663", "0.5406066", "0.5406066", "0.54042894", "0.53935176", "0.53932446", "0.53932446", "0.53932446", "0.53932446", "0.53865165", "0.5383629", "0.53819287", "0.537032", "0.5369145", "0.5359835", "0.5356156", "0.5354511", "0.5354286", "0.5350181", "0.5345833", "0.5338957", "0.53383654" ]
0.62554234
3
Handle the transaction "deleted" event.
public function deleted(Transaction $transaction) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function deleted($callback)\n {\n self::listenEvent('deleted', $callback);\n }", "public function handleDeleted(Deleted $event): void\n {\n $entity = $event->entity();\n\n $this->scheduleRemovingOldDocuments($entity);\n\n $this->elasticsearchManager->commit();\n }", "protected function handleDoDelete() {\n\t\t\tif ($this->verifyRequest('DELETE') && $this->verifyParams()) {\n\t\t\t\tif ($this->blnAuthenticated) {\n\t\t\t\t\tif ($intEventId = str_replace('.' . $this->strFormat, '', $this->objUrl->getSegment(3))) {\n\t\t\t\t\t\t$objUserEvent = $this->initModel();\n\t\t\t\t\t\tif ($objUserEvent->loadById($intEventId) && $objUserEvent->count()) {\n\t\t\t\t\t\t\tif ($objUserEvent->current()->get('userid') == AppRegistry::get('UserLogin')->getUserId()) {\n\t\t\t\t\t\t\t\tif ($objUserEvent->destroy()) {\n\t\t\t\t\t\t\t\t\tCoreAlert::alert('The event was deleted successfully.');\n\t\t\t\t\t\t\t\t\t$this->blnSuccess = true;\n\t\t\t\t\t\t\t\t\t$this->intStatusCode = 200;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error deleting the event'));\n\t\t\t\t\t\t\t\t\t$this->error(400);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('Invalid event permissions'));\n\t\t\t\t\t\t\t\t$this->error(401);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error loading the event data'));\n\t\t\t\t\t\t\t$this->error(400);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrigger_error(AppLanguage::translate('Missing event ID'));\n\t\t\t\t\t\t$this->error(401);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttrigger_error(AppLanguage::translate('Missing or invalid authentication'));\n\t\t\t\t\t$this->error(401);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->error(400);\n\t\t\t}\n\t\t}", "public function onDelete(): void\n {\n if ($this->globals->getUpdated() !== (int) $_GET['id']) {\n $this->_entity->delete($_GET['id']);\n $this->globals->setUpdated($_GET['id']);\n $this->globals->unsetAlert();\n }\n }", "protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, $this::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }", "protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, self::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }", "public static function deleted($event) {\n\n\t\t$account = $event->getSubject();\n\n\t}", "public function deleted() {\n // TODO Implement this\n }", "abstract public static function deleted($callback);", "protected function onDeleted()\n {\n return true;\n }", "public function delete($event): void;", "public function deleted(Order $order)\n\t{\n\t\t//\n\t}", "public function deleted(Order $order)\n\t{\n\t\t//\n\t}", "public function onBeforeDelete();", "public function processDelete(): void \n {\n if ($this->delete()) { // The tag is deleted in the database storage.\n auth()->user()->logActivity($this, 'Tags', 'Has deleted an issue tag with the name ' . $this->name);\n flash(\"The ticket tag with the name <strong>{$this->name}</strong> has been deleted in the application.\")->info()->important();\n }\n }", "public function onAfterDelete();", "public function afterDeleteCommit(): void\n {\n }", "public function deleted(Exchange $exchange)\n {\n //\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "public function handleDelete()\n {\n Craft::$app->getDb()->createCommand()\n ->delete(Table::REVISIONS, ['id' => $this->owner->revisionId])\n ->execute();\n }", "public function deleted(PurchaseReceipt $purchaseReceipt)\n {\n //\n }", "public function deleted(Order $order)\n {\n //\n }", "public function deleted(Order $order)\n {\n //\n }", "protected function _postDelete()\n\t{\n\t\t//register events\n\t\t\\Base\\Event::trigger('user.delete',$this->id);\n\t\t//end events\n\t}", "public function deleted(Contract $contract)\n {\n //\n }", "public function onAfterDelete() {\r\n\t\tparent::onAfterDelete();\r\n\t\t$this->zlog('Delete');\r\n\t}", "function onDelete()\n\t{\n\t\treturn $this->getLookupTable()->deleteKey($this->getValue());\n\t}", "public function deleted(EntryInterface $entry)\n {\n //$this->dispatch(new DeleteStream($entry));\n\n parent::deleted($entry);\n }", "public function deleted(Auditable $model)\n {\n Auditor::execute($model->setAuditEvent('deleted'));\n }", "protected function afterDelete()\r\n {\r\n }", "private function user_deleted($event) {\n global $DB;\n $userid = $event->relateduserid;\n $token = $DB->get_record('repository_gdrive_tokens', array('userid' => $userid), 'refreshtokenid');\n $this->client->revokeToken($token->refreshtokenid);\n $DB->delete_records('repository_gdrive_tokens', array ('userid' => $userid));\n }", "protected function afterDelete()\n {\n }", "public function deleted(Order $Order)\n {\n //code...\n }", "public function _postDelete()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "public function forceDeleted(Transaction $transaction)\n {\n //\n }", "public function forceDeleted(Transaction $transaction)\n {\n //\n }", "public function forceDeleted(Transaction $transaction)\n {\n //\n }", "public function forceDeleted(Transaction $transaction)\n {\n //\n }", "public function delete()\n\n {\n Customers::find($this->deleteId)->delete();\n session()->flash('message', 'Post Deleted Successfully.');\n\n }", "public function deleted(RideShareTransaction $rideShareTransaction)\n {\n //\n }", "public function deleted(Post $post)\n {\n $post->recordActivity('deleted');\n }", "public static function deleted($callback, $priority = 0)\n {\n static::registerModelEvent('deleted', $callback, $priority);\n }", "public function deleted(Currency $currency)\n {\n //\n }", "public function deleted(TradeCancel $tradeCancel)\n {\n //\n }", "public function handle(StreamWasDeleted $event)\n {\n $this->dispatch(new DropStreamsEntryTable($event->getStream()));\n }", "public static function deleting($callback)\n {\n self::listenEvent('deleting', $callback);\n }", "public function deleted(Wallet $wallet)\n {\n //\n }", "public function delete(RegistrationPostDeletedEvent $event): void\n {\n }", "protected function _postDelete()\n\t{\n\t}", "public function handleDelete()\n {\n $this->dispatch(new DeleteAccountCommand($this->auth->user()));\n\n return Redirect::route('home')->with('delete_account', 'Your account has been successfully deleted!');\n }", "public function processDelete()\n {\n // Record is valid\n $Model = $this->isValidRecord();\n if ($Model instanceof \\Illuminate\\Http\\RedirectResponse) {\n $this->redirect($Model);\n }\n // Set initial configuration\n $Model->build($this->Model->getTable());\n // Delete record\n if ($this->getIsTransaction()) {\n $result = DB::transaction(function ($db) use ($Model) {\n $result = $Model->delete();\n // Hook Action deleteAfterDelete\n $this->doHooks(\"deleteAfterDelete\", array($Model));\n });\n } else {\n $result = $Model->delete();\n // Hook Action deleteAfterDelete\n $this->doHooks(\"deleteAfterDelete\", array($Model));\n }\n // Set response redirect to list page and set session flash\n $Response = redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_success', trans('dkscaffolding.notification.delete.success'));\n // Hook Filter deleteModifyResponse\n $Response = $this->doFilter(\"deleteModifyResponse\", $Response);\n $this->redirect($Response);\n }", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "public static function user_deleted(core\\event\\user_deleted $event)\n {\n global $CFG;\n $request_data = array(\n 'action' => 'user_deletion',\n 'user_id' => $event->relateduserid\n );\n\n $api_handler = api_handler_instance();\n if (isset($CFG->eb_connection_settings)) {\n $sites = unserialize($CFG->eb_connection_settings);\n $synch_conditions = unserialize($CFG->eb_synch_settings);\n\n foreach ($sites as $key => $value) {\n if ($synch_conditions[$value[\"wp_name\"]][\"user_deletion\"] && $value['wp_token']) {\n // Adding Token for verification in WP from Moodle.\n $request_data['secret_key'] = $value['wp_token'];\n\n $api_handler->connect_to_wp_with_args($value[\"wp_url\"], $request_data);\n }\n }\n }\n }", "protected function _preDelete() {}", "public function deleted(Article $article)\n {\n //\n }", "public function delete()\n {\n DB::transaction(function () {\n $this->devedores()->delete();\n parent::delete();\n });\n }", "public function execute()\n {\n echo \"delete process\"; die;\n if ($this->_getVoucher()->getId()) {\n try {\n $this->_getVoucher()->delete();\n $this->messageManager->addSuccess(__('You deleted the Voucher.'));\n } catch (\\Exception $e) {\n $this->messageManager->addException($e, __('We can\\'t delete Voucher right now.'));\n $this->_redirect('*/*/edit/', ['voucher_id' => $this->_getVoucher()->getId()]);\n return;\n }\n }\n $this->_redirect('*/*/');\n }", "public function deleted(EntryInterface $entry)\n {\n $this->commands->dispatch(new DeleteStream($entry));\n\n parent::deleted($entry);\n }", "public function onAfterDelete() {\n\t\tif (!$this->owner->ID || self::get_disabled() || self::version_exist($this->owner))\n\t\t\treturn;\n\t\t$this->onAfterDeleteCleaning();\n\t}", "public function afterDelete(&$id, Entity $entity) { }", "public function deleted(Translation $translation);", "public function delete()\n\t{\n\t\t$this->plugin->setResponse('in delete');\n\t}", "public function deleted(EntryInterface $entry)\n {\n if (!$entry->isForceDeleting()) {\n event(new UserWasDeleted($entry));\n }\n\n parent::deleted($entry);\n }", "public function after_delete() {}", "protected function processDeletedObjects() {}", "public function onWikiDelete(WikiWasDeleted $event)\n {\n try {\n $this->wiki->withTrashed()->find($event->wiki['id'])->deleteFromIndex();\n } catch (\\Exception $e) {\n app('log')->warning($e->getMessage());\n }\n }", "private function course_content_deleted($event) {\n global $DB;\n $courseid = $event->courseid;\n $DB->delete_records('repository_gdrive_references', array('courseid' => $courseid));\n }", "public function ___deleted(Saveable $item) { \n\t\t$this->log(\"Deleted\", $item);\n\t}", "public static function onAfterDelete(Main\\Event $event)\n\t{\n\t\t$reservationId = (int)$event->getParameter('id')['ID'];\n\t\tif ($reservationId > 0)\n\t\t{\n\t\t\tself::deleteProductReservationMap($reservationId);\n\t\t}\n\t}", "public function onBeforeDelete() {\r\n\t\tparent::onBeforeDelete();\r\n\t}", "public function deleted($id)\n {\n }", "public function deleted(Chapter $chapter)\n {\n //\n }", "public function preDelete($event)\n {\n $chainItem = new ChainItem();\n $chainItem->updateVarnish($this->id);\n $chainItem->free(true);\n }", "public function onAfterDelete() {\n\t\tparent::onAfterDelete();\n\n\t\tif($this->isPublished()) {\n\t\t\t$this->doUnpublish();\n\t\t}\n\t}", "public function processVoucherDeleteRequest(Order $order, array $data);", "public function delete()\n\n {\n Sales::find($this->deleteId)->delete();\n session()->flash('message', 'Sale Deleted Successfully.');\n\n }", "public function isDeleted() {}", "public function isDeleted() {}", "public function onConfirmDelete(GridRowEventData $event)\n {\n $presenter = $event->getControl()->getPresenter();\n $id = $event->getId();\n try {\n $this->adminFacade->remove($id);\n $presenter->flashMessage(\n self::MESSAGE_SUCCESS_DELETE,\n AdminPresenter::STATUS_SUCCESS,\n null,\n AdminPresenter::ICON_SUCCESS,\n 75\n );\n $presenter->redirect(AdminPresenter::ACTION_DEFAULT);\n return;\n } catch (AdminException $exc) {\n $presenter->flashMessage(\n $exc->getMessage(),\n AdminPresenter::STATUS_DANGER,\n null,\n AdminPresenter::ICON_DANGER,\n 100\n );\n $presenter->redirect(AdminPresenter::ACTION_DEFAULT);\n }\n }", "public function deleted(EntryInterface $entry)\n {\n parent::deleted($entry);\n\n $this->dispatch(new DumpPages());\n }", "public function delete()\n {\n parent::delete();\n\n $this->sqs->deleteMessage([\n 'QueueUrl' => $this->queue, 'ReceiptHandle' => $this->job->getReceiptHandle(),\n ]);\n }", "public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }", "public function onAssetDelete(DeleteAssetEvent $event)\n {\n // doctrine cascading. You can't delete a series object graph with flushes inbetween.\n // wait for an update in the bprs asset bundle for a specific deleteMaybeUsedAsset Event.\n\n // $this->updateMedias($event->getAsset());\n // $this->updateEpisodes($event->getAsset());\n // $this->updateSeries($event->getAsset());\n }", "public function deleted(Contact $contact)\n {\n //\n }", "public function deleted(Contact $contact)\n {\n //\n }", "public function _delete()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public function deleted(Item $item)\n {\n //\n }", "public function deleted(Item $item)\n {\n //\n }", "protected function onDeleting()\n {\n return true;\n }", "public function deleted(Dispatch $dispatch)\n {\n //\n }", "function AfterDelete($where, &$deleted_values, &$message, &$pageObject)\n{\n\n\t\t\n\n$do=$deleted_values[\"LvID\"];\n\n$sqldel = \"DELETE FROM indleave WHERE LvID='$do'\";\nCustomQuery($sqldel);\n\n\n;\t\t\n}", "protected function _deleteEvent($eventId)\n {\n }", "public function delete(): void\n {\n $this->record(new AgendaWasDeleted($this->identity));\n }", "public function hook_after_delete($id) {\n\t //Your code here\n\n\t }", "public function hook_after_delete($id) {\n\t //Your code here\n\n\t }", "public function hook_after_delete($id) {\n\t //Your code here\n\n\t }" ]
[ "0.68374926", "0.6830709", "0.67456925", "0.66479945", "0.6608365", "0.66012704", "0.6600145", "0.6594114", "0.65310425", "0.65166855", "0.649442", "0.6421648", "0.6421648", "0.6396727", "0.63881946", "0.63682", "0.63404894", "0.6328055", "0.6312539", "0.63117605", "0.6292937", "0.6284229", "0.62769014", "0.62769014", "0.6275538", "0.6259861", "0.62581944", "0.61973435", "0.61927146", "0.6191317", "0.6167888", "0.61573553", "0.61254686", "0.61106104", "0.6082597", "0.60767466", "0.60767466", "0.60767466", "0.60767466", "0.60702556", "0.60643715", "0.60616696", "0.60556686", "0.6050863", "0.6018443", "0.60088557", "0.5998665", "0.5967265", "0.595975", "0.59300166", "0.59059185", "0.59049845", "0.58929676", "0.58861005", "0.58625966", "0.58598614", "0.58581644", "0.5847815", "0.58409303", "0.5834504", "0.58284235", "0.5825251", "0.5817771", "0.5815014", "0.58071786", "0.5777587", "0.577668", "0.5771975", "0.5771704", "0.5764317", "0.57607526", "0.5760489", "0.57511866", "0.57484955", "0.57466125", "0.57463855", "0.57452786", "0.57446104", "0.5743766", "0.5740377", "0.5727075", "0.57253623", "0.57237774", "0.5723598", "0.5720357", "0.5720357", "0.57203317", "0.57154083", "0.57154083", "0.5707645", "0.57049555", "0.56962156", "0.56946045", "0.56889516", "0.5687305", "0.5687305", "0.5687305" ]
0.7240107
2
Handle the transaction "restored" event.
public function restored(Transaction $transaction) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handleTransactionRollback(TransactionRolledBack $event)\n {\n Log::debug('rollback');\n }", "public function onrestoreCallback($intID, $strTable, $arrData, $intVersion);", "public function restored(PurchaseReceipt $purchaseReceipt)\n {\n //\n }", "public function restored(RideShareTransaction $rideShareTransaction)\n {\n //\n }", "public function restored(Auditable $model)\n {\n Auditor::execute($model->setAuditEvent('restored'));\n\n // Once the model is restored, we need to put everything back\n // as before, in case a legitimate update event is fired\n static::$restoring = false;\n }", "public function restored(Post $post)\n {\n $post->recordActivity('restored');\n }", "public function restored(Order $order)\n\t{\n\t\t//\n\t}", "public function restored(Order $order)\n\t{\n\t\t//\n\t}", "abstract protected function doRollback();", "public function restored(TradeCancel $tradeCancel)\n {\n //\n }", "public function restored(Order $order)\n {\n //\n }", "public function restored(Order $order)\n {\n //\n }", "public function restored(Order $order)\n {\n //\n }", "public function restored(Exchange $exchange)\n {\n //\n }", "protected function onRestored()\n {\n return true;\n }", "public function restored(Order $Order)\n {\n //code...\n }", "public function restored(Installment $installment)\n {\n //\n }", "public function rollbackTransaction() {\n\t\t//noop\n\t}", "public function restored(SaleService $saleService)\n {\n //\n }", "public function restored(Stock $stock)\n {\n //\n }", "public function restored(Region $region)\n {\n //\n }", "public function restore(User $user, Event $event)\n {\n //\n }", "public function restore(User $user, Event $event)\n {\n //\n }", "public function restored(Subscription $subscription)\n {\n //\n }", "public function rollback() {\n parent::rollback();\n $this->activeTransaction = false;\n }", "public function updraft_ajaxrestore() {\n\t\t$this->prepare_restore();\n\t\tdie();\n\t}", "public function restoring(Auditable $model)\n {\n // When restoring a model, an updated event is also fired.\n // By keeping track of the main event that took place,\n // we avoid creating a second audit with wrong values\n static::$restoring = true;\n }", "protected function _rollback() {\n $this->dataSource->rollback($this);\n }", "public abstract function rollback();", "public function restored(Investor $investor)\n {\n //\n }", "public function rollbackTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('ROLLBACK TRANSACTION');\r\n\t}", "public function restoring(Order $Order)\n {\n //code...\n }", "public function restore($id){\n $book_to_restore = \\App\\Book::withTrashed()->findOrFail($id);\n\n // jika ada, lakukan restore\n if($book_to_restore){\n $book_to_restore->restore();\n return redirect()->route(\"books.index\")->with(\"status\", \"Book successfully restored\");\n } else {\n return redirect()->route(\"books.index\")->with(\"status\", \"Book is not in trash\");\n }\n }", "public function restored(Contract $contract)\n {\n //\n }", "public function restored(Remission $remission)\n {\n //\n }", "public function rollback()\n\t{\n\t}", "public function rollback()\n\t{\n\t}", "function rollback(): void;", "public function rollbackTransaction();", "public function restored(Job $job)\n {\n //\n }", "public function rollbackTransaction(): void;", "public function rollback();", "public function rollback();", "public function rollback();", "public function rollback();", "public function restored(Bank $bank)\n {\n //\n }", "public function restored(Article $article)\n {\n //\n }", "public function transactionRollback()\n\t{\n\t\treturn;\n\t}", "public function restore(int $id)\n {\n //\n }", "protected function performRestore(Model $entity): void\n {\n $entity->restore();\n }", "function RollbackTrans() {}", "public function rollback()\n{\n\t$this->query('ROLLBACK');\n}", "public function restored(Document $document)\n {\n //\n }", "public function refundTransaction() {\n //not implemented\n }", "public function restored($task)\n {\n $task->notifyMembers('Restored');\n }", "public function restored(Ticket $ticket)\n {\n //\n }", "public function testRestoreState()\n {\n $load = new Load(new Memento());\n $load->pickup();\n $load->enroute();\n $load->deliver();\n\n // Check the last state of the load\n $this->assertSame(State::STATE_DELIVER, $load->getCurrentState());\n\n // Undo the previous state of the load\n $load->undo();\n $this->assertSame(State::STATE_ENTOUTE, $load->getCurrentState());\n\n // Restore the first state of the load\n $load->restore(0);\n $this->assertSame(State::STATE_PICKUP, $load->getCurrentState());\n }", "private function rollBack()\n\t{\n\t\tif (self::TRANSACTION) {\n\t\t\t$this->database->rollBack();\n\t\t}\n\t}", "function rollback();", "function rollback() {\n\t\t\tself::$db->rollback();\n\t\t}", "public function rollback()\n {\n // my code\n $by = 'id';\n $order = 'desc';\n $eventMessages = CEventMessage::GetList($by, $order, ['TYPE' => self::EVENT_TYPE]);\n $eventMessage = new CEventMessage;\n while ($template = $eventMessages->Fetch()) {\n $eventMessage->Delete((int)$template['ID']);\n }\n CEventType::Delete(self::EVENT_TYPE);\n }", "protected static function rollbackTransaction()\n\t{\n\t\tAbstractUnit::rollbackTransaction();\n\t}", "public function rollback()\n {\n }", "public function rollback()\n {\n }", "public function restored(Role $role)\n {\n }", "public function restored(InstallationTasking $InstallationTasking)\n {\n //\n }", "public function after_restore($restore) {\n global $DB;\n\n $data = $this->get_decoded_data();\n if ($newitem = \\restore_dbops::get_backup_ids_record($restore->get_restoreid(), 'course_module', $data->dateitem)) {\n $data->dateitem = $newitem->newitemid;\n try {\n $DB->set_field('customcert_elements', 'data', $this->save_unique_data($data), array('id' => $this->get_id()));\n } catch (\\dml_exception $e) {\n unset($e);\n }\n }\n }", "public function restored(Historia $historia)\n {\n //\n }", "public function restored(Item $item)\n {\n //\n }", "public function restored(Item $item)\n {\n //\n }", "public function restored(Conversation $conversation)\n {\n //\n }", "public function restored(Expense $expense)\n {\n //\n }", "public function restore()\n {\n //\n }", "public function restoreAction() {\n\t\t$request = reqBup::get('post');\n\t\t$response = new responseBup();\n\t\t$filename = $request['filename'];\n\t\t$model = $this->getModel();\n\t\t\n\t\t$result = $model->restore($filename);\n\n\t\tif (false === $result) {\n $errors = array_merge($model->getDatabase()->getErrors(), $model->getFilesystem()->getErrors());\n if (empty($errors)) {\n $errors = langBup::_('Unable to restore from ' . $filename);\n }\n\t\t\t$response->addError($errors);\n\t\t}\n\t\telse {\n\t\t\t$response->addData($result);\n\t\t\t$response->addMessage(langBup::_('Done!'));\n\t\t}\n\n $response->addData(array('result' => $result));\n return $response->ajaxExec();\n\t}", "public function rollback(){\n $this->db->exec('ROLLBACK TO xyz;');\n }", "public function restoring($model)\n\t{\n\t}", "public function rollback() {\n if (!$this->changed())\n return;\n\n $this->tags = array('new' => array(), 'del' => array());\n $this->inited = false;\n }", "public function restore(string $id)\n {\n // TODO: ...\n }", "public function restore($id);", "public function restore($id);", "public function restore($id);", "public function restore($id);", "public function restore($id)\n {\n PurchaseRequest::withTrashed()->where('id', $id)->restore();\n }", "public function restoring(Wallet $wallet)\n {\n //\n }", "public function restored(Credit $credit)\n {\n //\n }", "public function restored(TraHangNhaCungCap $traHangNhaCungCap)\n {\n //\n }", "public function restored(TechnicalVendorSchedule $technical_vendor_schedule)\n {\n //\n }", "public function restored(Vehicle $vehicle)\n {\n //\n }", "public function restored(History $history)\n {\n //\n }", "public function restore()\n {\n }", "public function restored($artistAlias)\n {\n parent::restored($artistAlias);\n\n Log::Info(\"Restored artist alias\", ['artist alias' => $artistAlias->id, 'artist' => $artistAlias->artist->id]);\n }", "function post_restoreItem() {\n\n if ((isset($this->input['_no_history']) && $this->input['_no_history'])\n || (!static::$logs_for_item_1\n && !static::$logs_for_item_2)) {\n return;\n }\n\n if ($this->useDeletedToLockIfDynamic()\n && $this->isDynamic()) {\n $item1 = $this->getConnexityItem(static::$itemtype_1, static::$items_id_1);\n $item2 = $this->getConnexityItem(static::$itemtype_2, static::$items_id_2);\n\n if (($item1 !== false)\n && ($item2 !== false)) {\n if ($item1->dohistory\n && static::$logs_for_item_1) {\n $changes[0] = '0';\n $changes[1] = '';\n $changes[2] = addslashes($this->getHistoryNameForItem1($item2, 'unlock'));\n\n Log::history($item1->getID(), $item1->getType(), $changes, $item2->getType(),\n static::$log_history_1_unlock);\n }\n\n if ($item2->dohistory\n && static::$logs_for_item_2) {\n $changes[0] = '0';\n $changes[1] = '';\n $changes[2] = addslashes($this->getHistoryNameForItem2($item1, 'unlock'));\n Log::history($item2->getID(), $item2->getType(), $changes, $item1->getType(),\n static::$log_history_2_unlock);\n }\n }\n\n }\n }", "public function restored(ReservationPayment $ReservationPayment)\n {\n //\n }", "public function after_restore(){\n \tglobal $DB;\n \t\n \t\n \t$pagemenuid = $this->get_activityid();\n\n \tif ($modulelinks = $DB->get_records('pagemenu_links', array('pagemenuid' => $pagemenuid))){\n \t\tforeach($modulelinks as $ml){\n \t\t\t\n \t\t\t$ml->previd = $this->get_mappingid('pagemenu_links', $ml->previd);\n \t\t\t$ml->nextid = $this->get_mappingid('pagemenu_links', $ml->nextid);\n\n\t\t\t\tif ($ml->type == 'module'){\n\t \t\t\tif ($link = $DB->get_record('pagemenu_link_data', array('linkid' => $ml->id))){\n\t \t\t\t\t$link->value = $this->get_mappingid('course_module', $link->value);\n\t \t\t\t\t$DB->update_record('pagemenu_link_data', $link);\n\t \t\t\t} else {\n\t\t\t\t\t\t$this->get_logger()->process(\"Failed to restore dependency for pagemenu link '$ml->name'. \", backup::LOG_ERROR); \t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$DB->update_record('pagemenu_links', $ml);\n \t\t}\n \t} \t \t\n }", "function rollback(){\n\t\ttry {\n\t\t\t$this->dbconn->rollBack();\n\t\t}catch(Exception $e){\n\t\t\t$this->logger->error($e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function rollbackTransaction()\n {\n mysqli_query($this->databaseLink,\"ROLLBACK;\");\n }", "public function restored(Seller $seller)\n {\n\n }" ]
[ "0.69343555", "0.655309", "0.63510865", "0.6244796", "0.6222654", "0.60597706", "0.6020239", "0.6020239", "0.6010224", "0.5985646", "0.5949184", "0.5949184", "0.5949184", "0.59482265", "0.59340113", "0.58958066", "0.5866178", "0.58114815", "0.57835126", "0.5768945", "0.57600456", "0.5755273", "0.5755273", "0.5729633", "0.57229084", "0.57215625", "0.5709203", "0.57037455", "0.5703366", "0.56952494", "0.5693301", "0.5679682", "0.5676778", "0.5652442", "0.56416357", "0.56364185", "0.56364185", "0.56168646", "0.56094116", "0.5608442", "0.56022817", "0.56001544", "0.56001544", "0.56001544", "0.56001544", "0.558888", "0.5575339", "0.556693", "0.5541425", "0.55321604", "0.55280554", "0.55208015", "0.5520101", "0.550897", "0.54959553", "0.54938495", "0.5485613", "0.54788417", "0.5478379", "0.54755795", "0.5474354", "0.54717696", "0.54665637", "0.54665637", "0.5458904", "0.5453278", "0.5452811", "0.54488367", "0.54374206", "0.54374206", "0.5435629", "0.54353935", "0.54349065", "0.543007", "0.5428449", "0.5424696", "0.541862", "0.5415107", "0.5414666", "0.5414666", "0.5414666", "0.5414666", "0.541243", "0.54066545", "0.54033256", "0.53897", "0.5387551", "0.53850746", "0.5382812", "0.5379678", "0.5378077", "0.53739583", "0.53727096", "0.5372062", "0.53672886", "0.53646904", "0.5363604" ]
0.69779557
2
Handle the transaction "force deleted" event.
public function forceDeleted(Transaction $transaction) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onBeforeDelete();", "protected function _preDelete() {}", "public function afterDeleteCommit(): void\n {\n }", "public function onAfterDelete();", "protected function onDeleted()\n {\n return true;\n }", "public function deleted(Transaction $transaction)\n {\n //\n }", "public function deleted(Transaction $transaction)\n {\n //\n }", "public function deleted(Transaction $transaction)\n {\n //\n }", "public function deleted(Transaction $transaction)\n {\n //\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, self::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }", "public function preDelete() { }", "protected function _afterDeleteCommit()\n {\n parent::_afterDeleteCommit();\n\n /** @var \\Mage_Index_Model_Indexer $indexer */\n $indexer = Mage::getSingleton('index/indexer');\n\n $indexer->processEntityAction($this, $this::ENTITY, Mage_Index_Model_Event::TYPE_DELETE);\n }", "public function onAfterDelete() {\n\t\tif (!$this->owner->ID || self::get_disabled() || self::version_exist($this->owner))\n\t\t\treturn;\n\t\t$this->onAfterDeleteCleaning();\n\t}", "protected function afterDelete()\r\n {\r\n }", "public function forceDeleted(Contract $contract)\n {\n //\n }", "protected function afterDelete()\n {\n }", "public function forceDelete()\n {\n //\n }", "public function onBeforeDelete() {\r\n\t\tparent::onBeforeDelete();\r\n\t}", "public function forceDelete();", "function before_delete() {}", "protected function _predelete() {\n }", "protected function beforeDelete()\n {\n }", "public function onBeforeDelete()\n {\n parent::onBeforeDelete();\n \n $proxied = $this->getProxiedObject();\n \n // Core SS types are decorated so we know we can call this\n $isCoreType = in_array($proxied->getField('ClassName'), $this->acService->ssCoreTypes());\n if($isCoreType && $proxied->canDeleteOnBlockDelete()) {\n $proxied->delete();\n }\n }", "public function forceDeleted(Exchange $exchange)\n {\n //\n }", "public function forceDeleted(RideShareTransaction $rideShareTransaction)\n {\n //\n }", "public static function forceDeleted($callback)\n {\n static::registerModelEvent('forceDeleted', $callback);\n }", "abstract public static function deleted($callback);", "public function forceDeleted(Order $order)\n\t{\n\t\t//\n\t}", "public function forceDeleted(Order $order)\n\t{\n\t\t//\n\t}", "public function handleDelete()\n {\n Craft::$app->getDb()->createCommand()\n ->delete(Table::REVISIONS, ['id' => $this->owner->revisionId])\n ->execute();\n }", "public function onAfterDelete() {\r\n\t\tparent::onAfterDelete();\r\n\t\t$this->zlog('Delete');\r\n\t}", "public function deleted() {\n // TODO Implement this\n }", "protected function onDeleting()\n {\n return true;\n }", "public function forceDeleted(Order $order)\n {\n //\n }", "public function forceDeleted(Order $order)\n {\n //\n }", "public function forceDeleted(Order $order)\n {\n //\n }", "public function onDelete(): void\n {\n if ($this->globals->getUpdated() !== (int) $_GET['id']) {\n $this->_entity->delete($_GET['id']);\n $this->globals->setUpdated($_GET['id']);\n $this->globals->unsetAlert();\n }\n }", "public function forceDeleted(TradeCancel $tradeCancel)\n {\n //\n }", "public function after_delete() {}", "public function forceDeleted(Document $document)\n {\n //\n }", "function ondelete(){\n\t\treturn true;\n\t}", "protected function _postDelete()\n\t{\n\t}", "public function forceDeleted(Conversation $conversation)\n {\n //\n }", "public function forceDeleted(Article $article)\n {\n //\n }", "public function hook_before_delete($id) {\n\n }", "protected function _postDelete()\n\t{\n\t\t//register events\n\t\t\\Base\\Event::trigger('user.delete',$this->id);\n\t\t//end events\n\t}", "public function softdelete(){\n \ttry{\n\t\t\t\t$this->deleted_at=date('Y/m/d H:i:s');\n \t\t$connect=Database::connect();\n \t\t$query='UPDATE vehicles SET deleted_at = :deleted_at WHERE id = :id';\n \t\t$statement=$connect->prepare($query);\n \t\t$statement->bindParam(':deleted_at',$this->deleted_at);\n \t\t$statement->bindParam(':id', $data->id);\n \t\treturn $statement->execute();\n \t} catch(\\Exception $e) {\n\t\t\t\techo $e;\n\t\t\t}\n }", "public function forceDeleted(Post $post)\n {\n }", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "protected function handleDoDelete() {\n\t\t\tif ($this->verifyRequest('DELETE') && $this->verifyParams()) {\n\t\t\t\tif ($this->blnAuthenticated) {\n\t\t\t\t\tif ($intEventId = str_replace('.' . $this->strFormat, '', $this->objUrl->getSegment(3))) {\n\t\t\t\t\t\t$objUserEvent = $this->initModel();\n\t\t\t\t\t\tif ($objUserEvent->loadById($intEventId) && $objUserEvent->count()) {\n\t\t\t\t\t\t\tif ($objUserEvent->current()->get('userid') == AppRegistry::get('UserLogin')->getUserId()) {\n\t\t\t\t\t\t\t\tif ($objUserEvent->destroy()) {\n\t\t\t\t\t\t\t\t\tCoreAlert::alert('The event was deleted successfully.');\n\t\t\t\t\t\t\t\t\t$this->blnSuccess = true;\n\t\t\t\t\t\t\t\t\t$this->intStatusCode = 200;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error deleting the event'));\n\t\t\t\t\t\t\t\t\t$this->error(400);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('Invalid event permissions'));\n\t\t\t\t\t\t\t\t$this->error(401);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrigger_error(AppLanguage::translate('There was an error loading the event data'));\n\t\t\t\t\t\t\t$this->error(400);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrigger_error(AppLanguage::translate('Missing event ID'));\n\t\t\t\t\t\t$this->error(401);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttrigger_error(AppLanguage::translate('Missing or invalid authentication'));\n\t\t\t\t\t$this->error(401);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->error(400);\n\t\t\t}\n\t\t}", "function after_delete() {}", "protected function preDeleteHook($object) { }", "protected function preDelete() {\n\t\treturn true;\n\t}", "function onDelete()\n\t{\n\t\treturn $this->getLookupTable()->deleteKey($this->getValue());\n\t}", "public function deleted(Order $order)\n\t{\n\t\t//\n\t}", "public function deleted(Order $order)\n\t{\n\t\t//\n\t}", "public function beforeDelete(): void\n {\n switch ($this->deletionType) {\n case self::DELETION_TYPE_1:\n $this->deletionType1();\n break;\n case self::DELETION_TYPE_0:\n default:\n $this->deletionType0();\n break;\n }\n }", "public function forceDeleted(SaleService $saleService)\n {\n //\n }", "public function hook_before_delete($id) {\n\t //Your code here\n\n\t }", "public function hook_before_delete($id) {\n\t //Your code here\n\n\t }", "public function hook_before_delete($id) {\n\t //Your code here\n\n\t }", "public function forceDeleted(Post $post)\n {\n //\n }", "public function forceDeleted(Post $post)\n {\n //\n }", "public function delete()\n {\n DB::transaction(function () {\n $this->devedores()->delete();\n parent::delete();\n });\n }", "public function onDelete(){\n return false;\n }", "public static function deleted($callback)\n {\n self::listenEvent('deleted', $callback);\n }", "public function delete($id)\n {\n echo 'in soft delete';\n }", "public function deleted(Order $order)\n {\n //\n }", "public function deleted(Order $order)\n {\n //\n }", "public function _postDelete()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "public function delete($event): void;", "public function forceDeleted(Vehicle $vehicle)\n {\n //\n }", "public function forceDeleted(Wallet $wallet)\n {\n // midi aba gateste\n }", "protected function MetaAfterDelete() {\n\t\t}", "public function deleted(Contract $contract)\n {\n //\n }", "public function processDelete(): void \n {\n if ($this->delete()) { // The tag is deleted in the database storage.\n auth()->user()->logActivity($this, 'Tags', 'Has deleted an issue tag with the name ' . $this->name);\n flash(\"The ticket tag with the name <strong>{$this->name}</strong> has been deleted in the application.\")->info()->important();\n }\n }", "private function tinydb_check_deleted()\n {\n if ($this->tinydb_is_deleted) {\n throw new \\TinyDb\\NoRecordException('Object was deleted.');\n }\n }", "public function isDeleted() {}", "public function isDeleted() {}", "public function forceDeleted(Currency $currency)\n {\n //\n }", "public function taskDelete(): void\n {\n $directory = $this->getDirectory();\n if (!$directory) {\n throw new RuntimeException('Not Found', 404);\n }\n\n $object = null;\n try {\n $object = $this->getObject();\n if ($object && $object->exists()) {\n $authorized = $object instanceof FlexAuthorizeInterface\n ? $object->isAuthorized('delete', 'admin', $this->user)\n : $directory->isAuthorized('delete', 'admin', $this->user);\n\n if (!$authorized) {\n throw new RuntimeException($this->admin::translate('PLUGIN_ADMIN.INSUFFICIENT_PERMISSIONS_FOR_TASK') . ' delete.', 403);\n }\n\n $object->delete();\n\n $this->admin->setMessage($this->admin::translate('PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_DELETE_SUCCESS'));\n if ($this->currentRoute->withoutGravParams()->getRoute() === $this->referrerRoute->getRoute()) {\n $redirect = dirname($this->currentRoute->withoutGravParams()->toString(true));\n } else {\n $redirect = $this->referrerRoute->toString(true);\n }\n\n $this->setRedirect($redirect);\n\n $this->grav->fireEvent('onFlexAfterDelete', new Event(['type' => 'flex', 'object' => $object]));\n }\n } catch (RuntimeException $e) {\n $this->admin->setMessage($this->admin::translate(['PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_DELETE_FAILURE', $e->getMessage()]), 'error');\n\n $this->setRedirect($this->referrerRoute->toString(true), 302);\n }\n }", "public function onBeforeDelete() {\n // Delete all items attached to this order\n foreach($this->Items() as $item) {\n $item->delete();\n }\n\n parent::onBeforeDelete();\n }", "function OnBeforeDeleteItem(){\n }", "function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }", "protected function processDeletedObjects() {}", "public function preDelete($event)\n {\n $chainItem = new ChainItem();\n $chainItem->updateVarnish($this->id);\n $chainItem->free(true);\n }", "public function forceDeleted(CovidPatient $covidPatient)\n {\n //\n }", "public function forceDeleted(Stock $stock)\n {\n //\n }", "public function forceDeleted(Dispatch $dispatch)\n {\n //\n }", "public function handleDeleted(Deleted $event): void\n {\n $entity = $event->entity();\n\n $this->scheduleRemovingOldDocuments($entity);\n\n $this->elasticsearchManager->commit();\n }", "public function forceDeleted(ConfirmationToken $confirmationToken)\n {\n //\n }", "protected function delete() {\n\t}", "public function delete()\n {\n self::deleteById( $this->db, $this->id, $this->prefix );\n\n if( $this->inTransaction )\n {\n //$this->db->commit();\n $this->inTransaction = false;\n }\n }", "public function forceDeleted(Chapter $chapter)\n {\n //\n }", "public function forceDeleted(Food $food)\n {\n //\n }" ]
[ "0.730766", "0.69939226", "0.6964241", "0.69106454", "0.68971235", "0.6817606", "0.6817606", "0.6817606", "0.6817606", "0.6817213", "0.681684", "0.67922384", "0.67890316", "0.6788038", "0.67691356", "0.6765413", "0.67286193", "0.6713343", "0.67113847", "0.6705567", "0.66607267", "0.66436905", "0.6599859", "0.6589911", "0.65879667", "0.65854746", "0.6542799", "0.6527486", "0.65207535", "0.6519655", "0.6519655", "0.651915", "0.65154755", "0.6507694", "0.6495569", "0.6492574", "0.6492574", "0.6492574", "0.64736664", "0.641962", "0.6392556", "0.63683724", "0.6314634", "0.6313278", "0.6312244", "0.6311526", "0.63051164", "0.6288656", "0.6288541", "0.6278281", "0.6265681", "0.6265166", "0.6264882", "0.62627244", "0.6261418", "0.62510985", "0.6250002", "0.6250002", "0.6247335", "0.6240154", "0.6231001", "0.6231001", "0.6231001", "0.62299997", "0.62299997", "0.6228965", "0.6199278", "0.6195005", "0.6182907", "0.617698", "0.617698", "0.61644197", "0.6163331", "0.61601484", "0.6158481", "0.6156034", "0.6155165", "0.6151753", "0.61454535", "0.61443067", "0.6143063", "0.61421376", "0.61370724", "0.6134701", "0.6132202", "0.61308277", "0.6125574", "0.6124956", "0.61219484", "0.61205494", "0.6106112", "0.6104133", "0.6101773", "0.60968745", "0.60950077", "0.609361", "0.6093055" ]
0.7249178
3
Returns the class name.
public function getClass() { return $this->method->getClass(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }", "public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}", "private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}", "public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}", "public function getClassName()\n {\n return $this->class_name;\n }", "public function getClassName() : string\n {\n\n return $this->className;\n }", "public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }", "public function getClassName() : string\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->class;\n }", "public function getClassName()\n {\n return $this->_sClass;\n }", "public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}", "public function getClassName(): string\n {\n return $this->className;\n }", "public function getClassName(): string\n {\n return $this->className;\n }", "protected function getClassName(): string\n {\n return $this->className;\n }", "public static function getClassName() {\n return self::$className;\n }", "public function getClassName()\n {\n return __CLASS__;;\n }", "public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}", "public function getName()\n {\n return __CLASS__;\n }", "public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}", "public function getName(): string\n {\n return __CLASS__;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName()\n {\n return $this->className;\n }", "public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}", "public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}", "public function getClassname(){\n\t\treturn $this->classname;\n\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() {\n return $this->className;\n }", "public function getClassName() { return __CLASS__; }", "public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}", "public function getClassName() {\n\t\treturn $this->className;\n\t}", "public function getClassName() {\n return $this->className;\n }", "public function getClassName();", "public function getClassName();", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getClassName() {}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}", "public function getClassName() {\n\t\treturn $this->_className;\n\t}", "public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }", "public static function getClassName() {\n\t\treturn get_called_class();\n\t}", "public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }", "public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}", "public static function getClassName()\n {\n return get_called_class();\n }", "public function getClassName() ;", "public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }", "public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}", "public static function getClassName() {\n return get_called_class();\n }", "public function getClassName()\n\t{\n\t\tif (null === $this->_className) {\n\t\t\t$this->setClassName(get_class($this));\n\t\t}\n\t\t\n\t\treturn $this->_className;\n\t}", "public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }", "public static function staticGetClassName()\n {\n return __CLASS__;\n }", "public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }", "function getClassName()\n {\n // TODO: Implement getClassName() method.\n }", "public function getClass(): string\n {\n return $this->class;\n }", "public static function className() : string {\n return get_called_class();\n }", "public function toClassName(): string\n {\n return ClassName::full($this->name);\n }", "public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }", "public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }", "private function getClassName() {\n return (new \\ReflectionClass(static::class))->getShortName();\n }", "public function getClassName() : string;", "public static function name()\n {\n return isset(static::$name) ? static::$name : self::getClassShortName();\n }", "public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }", "public function getName()\n {\n return static::CLASS;\n }", "public function getClassName(): string;", "public static function name()\n {\n return lcfirst(self::getClassShortName());\n }", "public static function getClassName($class)\n {\n return static::splitClassName($class)[1];\n }", "public function getClass()\n {\n return $this->_className;\n }", "public function className(): string\n {\n return $this->taskClass->name();\n }", "public static function className()\n\t{\n\t\treturn static::class;\n\t}", "private function className () {\n $namespacedClass = explode(\"\\\\\", get_class($this));\n\n return end($namespacedClass);\n }", "public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }", "public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}", "public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }", "public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }", "protected function getClassName()\n {\n return ucwords(camel_case($this->getNameInput())) . 'TableSeeder';\n }", "public function name($class) {\n return $this->classRegistry->getMap($class)->getCurrentName();\n }", "public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }", "public function getName() {\n return get_class($this);\n }", "public function getName() {\n return get_class($this);\n }", "public function className()\n {\n return static::CONSTANCE_CLASS;\n }", "protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}", "public function getClassName(): ?string {\n\t\treturn Hash::get($this->_config, 'className');\n\t}", "public function getClass()\n {\n if (is_null($this->_class)) {\n $this->_class = $this->_getClassName();\n }\n return $this->_class;\n }", "protected function fullyQualifiedClassName(): string\n {\n return $this->fullNamespace() . '\\\\' . $this->name();\n }", "public function getNamespacedName()\n {\n return get_class();\n }", "function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }", "public function getName(){\n\t\treturn get_class($this);\n\t}", "public function getFullClassName()\n {\n $name = $this->getName();\n $namespace = $this->getNamespace();\n if (!$namespace && $this->getDatabase()) {\n $namespace = $this->getDatabase()->getNamespace();\n }\n\n if ($namespace) {\n return trim($namespace, '\\\\') . '\\\\' . $name;\n } else {\n return $name;\n }\n }", "function getName()\n {\n return get_class($this);\n }", "public function getFullQualifiedClassname() : string\n {\n return $this->fqcn;\n \n }", "final public function getClass(): string\n\t{\n\t\treturn static::class;\n\t}", "function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}", "public function getClassName()\n {\n return $this->feedbackClass;\n }" ]
[ "0.8927032", "0.87912285", "0.87743944", "0.8688774", "0.8676623", "0.8658736", "0.8653049", "0.86477107", "0.86254823", "0.86254823", "0.8612077", "0.8595285", "0.8581332", "0.8581332", "0.856527", "0.85443616", "0.8514995", "0.85068756", "0.8505168", "0.8496778", "0.8484175", "0.84205604", "0.84205604", "0.84205604", "0.84205604", "0.84205604", "0.84205604", "0.84205604", "0.84205604", "0.84047395", "0.8388208", "0.83821076", "0.83818626", "0.83818626", "0.8367988", "0.8361322", "0.83605474", "0.83562577", "0.8354605", "0.8354605", "0.8345631", "0.8345631", "0.8345631", "0.8345631", "0.8313862", "0.8313862", "0.83087146", "0.8298084", "0.82787573", "0.82557654", "0.8238394", "0.82251406", "0.8210203", "0.8209296", "0.82082677", "0.81993383", "0.819599", "0.81831414", "0.81616825", "0.81341887", "0.812161", "0.8094905", "0.8094466", "0.80798125", "0.80771244", "0.8022034", "0.80099475", "0.79950434", "0.7972051", "0.79549706", "0.79494935", "0.7944288", "0.79331064", "0.7915974", "0.7913988", "0.7881636", "0.78432316", "0.7819534", "0.78172326", "0.77896273", "0.7670841", "0.7668489", "0.764791", "0.76457435", "0.7600152", "0.7588697", "0.7588697", "0.75852644", "0.75842106", "0.75768685", "0.7572284", "0.7549047", "0.7547452", "0.75327545", "0.74899006", "0.7483989", "0.7454865", "0.74437773", "0.7442997", "0.74387985", "0.7432919" ]
0.0
-1
Returns the method name.
public function getMethod() { return $this->method->getMethod(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMethodName() {\r\n\t\treturn($this->method_name);\r\n\t}", "public function getMethodName()\n {\n return $this->method;\n }", "public function getMethodName() : string\n {\n\n return $this->methodName;\n }", "public function getMethodName() {\n return $this->methodName;\n }", "public function getMethodName()\n {\n return $this->methodName;\n }", "public function getMethodName()\n {\n return $this->methodName;\n }", "public function getMethodName();", "public function getMethodName();", "public function getMethodName();", "public function getMethodName()\n {\n return PhandArr::last(explode('@', $this->getMethodInvokerName()));\n }", "public function method() {\n\t\treturn strtoupper($this->getMethod());\n\t}", "public function method(): string\n {\n return $this->getMethod();\n }", "public function method(): string\n {\n return $this->method;\n }", "abstract protected function getMethodName();", "protected function getMethodName($key){\n\t\t$method = $this->getMethod($key);\n\t\t\n\t\treturn $method->getName();\n\t}", "public function method(): string{\n return $this->_method;\n }", "public function getMethod(): string\n {\n return $this->method;\n }", "public function getMethod(): string\n {\n return $this->method;\n }", "public function getMethod() : string\n {\n return static::$method;\n }", "public function getHttpMethodName() : string \n {\n return $this->method;\n }", "public function getMethod() : string\n {\n\n return $this->method;\n }", "public function method()\n {\n return $this->method;\n }", "public function method()\n {\n return $this->method;\n }", "public function method()\n {\n return $this->method;\n }", "public function getMethod() : string\n {\n return $this->method;\n }", "public function getApiMethodName() : string {\n\t\treturn $this->apiMethod;\n\t}", "public function method()\n {\n return $this->_method;\n }", "public function method()\n {\n return $this->_method;\n }", "public function Name()\n {\n return parent::CallMethod(__FUNCTION__, array(), func_get_args());\n }", "public function method() {\n return $this->method;\n }", "public function method() {\n return $this->method;\n }", "public function get_method() {\n return $this->_method;\n }", "public function get_method() {\n\t\treturn $this->method;\n\t}", "public function getMethod()\t{\n\t\tif ($this->class != \"NoRoute\")\t{\n\t\t\treturn $this->method;\n\t\t}\n\t\treturn \"invoke\";\n\t}", "protected function getMethod(): string\n {\n if (strlen($this->method) == 0) {\n $this->method = 'get';\n }\n return $this->method;\n }", "public function method(){\n return $this->__method;\n }", "public function GetMethod () {\n\t\treturn $this->method;\n\t}", "public function getMethod(): string;", "public function getMethod(): string;", "public function getMethod(): string;", "public function getMethod(): string;", "public function getMethod(): string;", "public function getMethod(): string;", "public function getMethod()\n {\n if($this->_method == NULL || !isset($this->_method))\n {\n $this->_method = substr(get_class($this),3);\n }\n \n return $this->_method;\n }", "public static function getMethod()\n {\n return self::$__method;\n }", "public function getMethod(): string {}", "public function getMethod()\n {\n return $this->_method;\n }", "public function method(): string\n {\n return \\strtoupper($this->request()->getMethod());\n }", "public function getPaymentName()\n {\n return self::METHOD_NAME;\n }", "public function getMethodInvokerName()\n {\n return $this->action['controller'] ?? 'Closure';\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod()\n {\n return $this->method;\n }", "public function getMethod ()\n {\n\n return $this->method;\n\n }", "public function getMethod() : string;", "public function getMethod()\n {\n return $this->method;\n }", "protected function getMethod($methodName)\n {\n // that takes precendence.\n if ($this->isAnAlias($methodName))\n {\n return $this->aliases[$methodName];\n }\n\n\n return 'assert' . ucwords($methodName);\n\n }", "public function getMethod()\n {\n return $this->values[\"method\"];\n }", "public function getMethod()\r\n {\r\n return $this->method;\r\n }", "public function getMethod() \n {\n return $this->method;\n }", "public function getMethod ()\n {\n return $this->method;\n }", "public function getMethod() :string;", "public function getMethod(): string {\n\n return strtoupper($_SERVER['REQUEST_METHOD']);\n }", "protected function resolveActionMethodName(): string\n {\n switch ($this->request->getMethod()) {\n case 'HEAD':\n case 'GET':\n $actionName = ($this->request->hasArgument($this->resourceArgumentName)) ? 'show' : 'list';\n return $actionName . 'Action';\n\n // Not supported in Example\n case 'POST':\n case 'PUT':\n case 'DELETE':\n default:\n $this->throwStatus(400, null, 'Bad Request.');\n }\n $this->throwStatus(400, null, 'Bad Request.');\n return '';\n }", "public function getMethod() {\n return $this->method;\n }", "public function getMethod() {\n return $this->method;\n }", "public function getMethod() {\n return $this->method;\n }", "private function getFieldNameFromMethodName($methodName)\n {\n $str = substr($methodName, 3); // removing 'get'\n $str = $this->lcfirst($str);\n $str = preg_replace('/([A-Z])/', '_$1', $str);\n return strtolower($str);\n }", "public function getName()\n {\n return $this->__call(__FUNCTION__, func_get_args());\n }", "public function getMethod()\n\t{\n\t\treturn $this->method;\n\t}", "public function getMethod()\n\t{\n\t\treturn $this->method;\n\t}", "public function getMethod() { return $this->_method; }", "public function getName(): string\n {\n if (!$this->useAlternateName) {\n return 'get' . $this->getPropertyName();\n } else {\n $methodName = 'get' . $this->getPropertyName() . 'By';\n\n $camelizedColumns = array_map([TDBMDaoGenerator::class, 'toCamelCase'], $this->foreignKey->getUnquotedLocalColumns());\n\n $methodName .= implode('And', $camelizedColumns);\n\n return $methodName;\n }\n }", "public function get_method();", "public function getMethod() {\r\n\t\treturn $this->method;\r\n\t}", "protected function getMethod() {\n return $this->method;\n }", "public function getMethod() {\n\t\treturn $this->method;\n\t}", "public function getMethod() {\n\t\treturn $this->method;\n\t}", "public function getMethod() {\n\t\treturn $this->method;\n\t}", "function getMethod()\n {\n return $this->method;\n }", "public static function method(): string\n\t{\n\t\treturn strtoupper(Server::get('REQUEST_METHOD'));\n\t}", "public function getMethod(){\n return $this->method;\n }", "public function method(): string\n {\n return $this->request->getMethod();\n }", "public function method(): string\n {\n return $this->request->getMethod();\n }", "public function method(): string\n {\n return $this->request->getMethod();\n }" ]
[ "0.89591944", "0.8824065", "0.86665046", "0.8581625", "0.85813403", "0.85813403", "0.84923667", "0.84923667", "0.84923667", "0.8179835", "0.81223845", "0.8018441", "0.7991519", "0.7866686", "0.77814484", "0.7773537", "0.7705283", "0.7705283", "0.7665759", "0.7652903", "0.7578292", "0.7577244", "0.7577244", "0.7577244", "0.7573639", "0.7567772", "0.7558386", "0.7558386", "0.75146073", "0.74978983", "0.74600434", "0.7396034", "0.7383731", "0.7361349", "0.73478884", "0.7333538", "0.7327497", "0.7300734", "0.7300734", "0.7300734", "0.7300734", "0.7300734", "0.7300734", "0.72758794", "0.7246077", "0.7244119", "0.71185726", "0.7110424", "0.7100516", "0.709797", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.70878327", "0.7083709", "0.7078975", "0.7069082", "0.7065123", "0.70641106", "0.7061569", "0.70504254", "0.7039655", "0.7023688", "0.70068973", "0.7004306", "0.7001239", "0.7001239", "0.7001239", "0.69770235", "0.6973524", "0.69729483", "0.69729483", "0.6958469", "0.69551224", "0.69457465", "0.6940814", "0.69340277", "0.69307905", "0.69307905", "0.69307905", "0.6890509", "0.68878865", "0.68681663", "0.68594104", "0.68594104", "0.68594104" ]
0.7190075
46
Returns the method parameters.
public function getParameters() { return $this->parameters; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getParameters() {}", "public function getParams()\n {\n return $this->_invokeParams;\n }", "public function getParameters()\n {\n return $this->reflection->getParameters();\n }", "public function getParameters()\n {\n // TODO: Implement getParameters() method.\n }", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters();", "public function getParameters(/* ... */)\n {\n return $this->_params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParameters()\n {\n return $this->params;\n }", "public function getParams() {}", "public function getParameters(){\n\t\t$options = $this->_function_reflection->getParameters();\n\t}", "public function getParameters() {\n \n return $this->params;\n \n }", "public function getParams()\n {\n // TODO: Implement getParams() method.\n }", "public function getMethodArguments()\n {\n return $this->methodArguments;\n }", "public function get_parameters() {\r\n\t\treturn $this->parameters;\r\n\t}", "public function getParameters()\n {\n return array();\n }", "public function getParameters()\n\t{\n\t\treturn $this->parameters;\n\t}", "public function getParameters()\r\n {\r\n return $this->parameters;\r\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters;\n }", "public function getParams(){\n\t\tthrow new Exception(\"Method \".__CLASS__.\"::\".__METHOD__.\" not implemented yet!\");\n\t}", "public function getParameters()\n\t{\n\n\t}", "public function getParameters()\n\t{\n\n\t}", "public function parameters()\n {\n return $this->parameters;\n }", "public function parameters()\n {\n return $this->parameters;\n }", "public static function getParams()\n {\n return self::$params;\n }", "public function GetParameters()\n {\n return $this->parameters;\n }", "public function getParameters()\n {\n return $this->parameters->all();\n }", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParams();", "public function getParameters() {\n return $this->parameters;\n }", "public function getParameters() {\n\t\treturn $this->parameters;\n\t}", "function get_parameters()\r\n {\r\n return $this->parameters;\r\n }", "public function getParams()\r\n\t{\r\n\t\treturn $this->params;\r\n\t}", "public function parameters()\n {\n return array_merge($this->get, $this->post);\n }", "function getParameters()\r\n {\r\n }", "function getParameters() {\n\t\treturn $this->inputParameters;\n\t}", "public function getParams() {\n \n return $this->_params;\n }", "function getParameters() {\n return $this->parameters;\n }", "public function getParams()\n\t{\n\t\treturn $this->params;\n\t}", "public function getParameters(): array;", "public function getParams()\n {\n return $this->_params;\n }", "public function getParams()\n {\n return $this->_params;\n }", "public function getParams()\n {\n return $this->_params;\n }", "public function getParams()\n {\n return $this->_params;\n }", "public function get_params()\n {\n }", "public function get_params()\n {\n }", "public function getParams() {\n\t\treturn $this -> v_params;\n\t}", "public function getParams()\n\t{\n\t\treturn $this->_params;\n\t}", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParameters() : array\n {\n return $this->parameters;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParams()\n {\n return $this->params;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function getParameters(): array\n {\n return $this->parameters;\n }", "public function params()\n {\n return $this->_params;\n }" ]
[ "0.816109", "0.81013834", "0.8099746", "0.8086376", "0.807358", "0.807358", "0.807358", "0.807358", "0.807358", "0.807358", "0.807358", "0.807358", "0.8072108", "0.8048743", "0.8048743", "0.8048743", "0.8048743", "0.80063456", "0.79413164", "0.7932623", "0.79095596", "0.7905062", "0.79007494", "0.78797704", "0.7874947", "0.78720105", "0.78551793", "0.78551793", "0.78551793", "0.78551793", "0.78551793", "0.78551793", "0.78551793", "0.78551793", "0.78551793", "0.78551793", "0.78551793", "0.7843854", "0.7843315", "0.7843315", "0.7807959", "0.7807959", "0.7794045", "0.77688074", "0.7762756", "0.77473104", "0.77473104", "0.77473104", "0.77473104", "0.77473104", "0.77473104", "0.77473104", "0.77473104", "0.77473104", "0.77473104", "0.7732459", "0.7721131", "0.7711795", "0.7696341", "0.76933986", "0.7678621", "0.76616734", "0.765168", "0.76486003", "0.7646434", "0.76445866", "0.7633584", "0.7633584", "0.7633584", "0.7633584", "0.76269686", "0.76269686", "0.7626874", "0.7623882", "0.7621705", "0.7621705", "0.7621705", "0.7621705", "0.7621705", "0.7621705", "0.7621705", "0.7621705", "0.7621705", "0.7621705", "0.7621705", "0.7621705", "0.7621705", "0.7621705", "0.7621705", "0.7621705", "0.7621705", "0.7619009", "0.7615066", "0.7615066", "0.76108795", "0.76108795", "0.76108795", "0.76108795", "0.7609813" ]
0.78455955
38
Returns the parameter at the given index.
public function getParameter($index) { if ($index >= count($this->parameters)) { throw new OutOfRangeException(sprintf('The parameter %s does not exist', $index)); } return $this->parameters[$index]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getParam($index)\n {\n return $this->params[$index];\n }", "public function param($index)\n\t{\n\t\treturn $this->_fetch_from_array($this->params, $index);\n\t}", "private function _get_param( $index ) {\n\t\treturn ( isset( $this->_params[ $index ] ) ) ? $this->_params[ $index ] : null ;\n\t}", "public function getArgument($index);", "public function getParam(int $index)\n {\n return isset($this->params[$index]) ? $this->params[$index] : false;\n }", "public function getArgParam($index) {\n\t\tif ($index != 0)\n\t\t\tthrow new exception(\"data_address stores only one parameter\");\n\t\treturn $this->args[$index];\n\t}", "public function getArgument($index)\n\t{\n\t\treturn $this->router->getArgument($index);\n\t}", "public static function getArgumentByIndex($index)\n {\n return func_get_arg($index);\n }", "public function getParam($index, $defaultValue = null)\n {\n if (isset($this->params[$index]))\n {\n return $this->params[$index];\n }\n \n return $defaultValue;\n }", "public function getValue($index) {}", "public function get(int $index);", "public function get(int $index);", "public function __get($index) {\n return $this->vars[$index];\n }", "public function getParameterForCaller(int $i): ?Parameter;", "public function getArg($idx) {\r\n\t\treturn isset($this->args[$idx]) ? $this->args[$idx] : null;\r\n\t}", "function get($index) {\n\t\treturn isset($this->variable[$index]) ? $this->variable[$index] : null;\n\t}", "public function param($index = null)\n\t{\n\t\t$params = array_filter(explode('/', $this->path));\n\t\tif (strlen($params[0]) === 0)\n\t\t\tarray_shift($params);\n\t\tif ($index === null)\n\t\t\treturn array_map('rawurldecode', $params);\n\n\t\tif ($index < 0) \n\t\t{\n\t\t\t$slice = array_slice($params, $index, 1);\n\t\t\tif (!isset($slice[0])) return null;\n\t\t\treturn rawurldecode($slice[0]);\n\t\t}\n\n\t\tif (!isset($params[$index])) return null;\n\t\treturn rawurldecode($params[$index]);\n\t}", "public function get(int $index): mixed;", "public function getParameter($index, $type = 'string', $defaultValue = null)\n {\n // does the index exists and isn't this parameter empty\n if ($this->hasParameter($index)) {\n return \\SpoonFilter::getValue(\n $this->parameters[$index],\n null,\n null,\n $type\n );\n }\n\n // fallback\n return $defaultValue;\n }", "public function get ($index) { return $this[$index]; }", "function get_parameter($name)\r\n {\r\n if (array_key_exists($name, $this->parameters))\r\n return $this->parameters[$name];\r\n }", "public abstract function get($index);", "public function offsetGet($index);", "public function __invoke($index) {\n\t\treturn $this->offsetGet($index);\n\t}", "public function offsetGet($index)\r\n\t{\r\n\t\treturn $this->elements[$this->keyAssocation[$index]];\r\n\t}", "public function getParameter()\n\t{\n\t\treturn $this->parameter;\n\t}", "public function getParam($key);", "public function getAttributeValue($index = null);", "public function get($index)\n\t{\n\t\treturn parent::get($index - 1);\n\t}", "public function getParam($name);", "public function offsetGet($index)\n {\n }", "public function getValue($name, $index) {\n return $this->view->result[$index]->$name;\n }", "public static function get($index)\n {\n return self::getInstance()->dotNotation->get($index);\n }", "public function getParam (string $key)\n {\n return $this->params[$key];\n }", "public function getRealParameterForCaller(int $i): ?Parameter;", "public function getParameter($param)\n {\n return $this->params[$param];\n }", "function get($index = '', $xss_clean = FALSE)\n\t{\n\t\treturn $this->_fetch_from_array($this->get_var, $index, $xss_clean);\n\t}", "public function getParam($name) {\n return $this->params[$name];\n }", "public function getParameter($name);", "public function getParameter($name);", "public function getParameter($name);", "public function getParam($name) {\n if (isset($this->parameter[$name])) {\n return $this->parameter[$name];\n }\n }", "public function getParam($param);", "protected function get_parameter( $name ) {\n\t\treturn $this->has_parameter( $name ) ? $this->parameters[ $name ] : null;\n\t}", "public function get($index)\n\t{\n\t\treturn $this->_fetch_from_array($this->get, $index);\n\t}", "public function at($index)\n {\n return $this->substr($index, 1);\n }", "final public function __get($index)\n {\n return $this->_registry->$index;\n }", "public function GetDescriptorAt($index)\n\t\t{\n\t\t\t$current = 0;\n\t\t\tforeach($this->descriptors as $desc)\n\t\t\t{\n\t\t\t\tif($current == $index)\n\t\t\t\t\treturn $desc;\n\n\t\t\t\t$current++;\n\t\t\t}\n\n\t\t\treturn NULL;\n\t\t}", "function getAt ( $index = 0 , $default = null )\n\t{\n\t\treturn $this->_count > $index ? $this->_tokens[$index] : $default ;\n\t}", "public function get($index)\n {\n return Iterables::get($this, $index);\n }", "public function atIndex(int $index)\n {\n $i = 0;\n foreach ($this->items as $key => $value) {\n if ($i++ == $index) {\n return $value;\n }\n }\n\n return null;\n }", "public function offsetGet( $index )\n {\n return $this->_getDelegate()->offsetGet($index);\n }", "public function getParameter();", "public function getParameter();", "public function get($index) {\n return $this->items[$index];\n }", "public function eq ($index) { \r\n\t\t\r\n\t\tif ($index >= 0) return $this->get($index); \r\n\t\t\r\n\t\treturn $this->get($this->length+$index-1);\r\n\t}", "public function get ($index)\n {\n if (isset($this->data[$index])) {\n return $this->data[$index];\n } else {\n throw new IndexOutOfBoundsException();\n }\n }", "public function get($index)\n {\n \n }", "private function getParameter($key)\n {\n return $this->parameters->get($key);\n }", "public function getByPK($index)\n\t{\n\t\treturn $this->containsIndex($index) ? $this[$index] : null;\n\t}", "public function getParam($key)\n {\n return $this->_params[$key];\n }", "public function offsetGet($index)\n\t{\n\t\tif (parent::offsetExists($index))\n\t\t{\n\t\t\treturn parent::offsetGet($index);\n\t\t}\n\t\tif (isset(self::$global[$index]))\n\t\t{\n\t\t\treturn self::$global[$index];\n\t\t}\n\n\t\treturn null;\n\t}", "public function get_value($index = NULL,$item = NULL){\n if(is_null($index)){\n return $this->ini_file_array;\n } else if(is_null($item)){\n if(array_key_exists($index,$this->ini_file_array)){\n return $this->ini_file_array[\"$index\"];\n } else {\n return NULL;\n }\n } else {\n if(isset($this->ini_file_array[\"$index\"][\"$item\"])){\n return $this->ini_file_array[\"$index\"][\"$item\"];\n } else {\n return NULL;\n }\n }\n }", "final public static function getParam($key) {\n $param = self::getParams();\n return $param[$key];\n }", "public function item($index) {\n\t\treturn $this->valueForKey($this->keyForItem($index));\n\t}", "public function getPO1IndexOf($index){\n\n\t\tif (gettype ($index)!=\"integer\"||$index>15) {\n\t\t\tthrow new Exception(\"PO1IndexOf wrong index; index: \".$index);\n\t\t}\n\t\treturn $this->getValueOfIndex($index);\n\t\t\n\t}", "public function getParam(string $name)\n {\n if (! isset($this->getParameters()[$name])) {\n throw (new \\Exception('Parameter ' . $name . ' was not found in route', - 1));\n }\n\n return $this->getParameters()[$name];\n }", "public function getParam($name)\n {\n return Tools::getValue($name);\n }", "public function getValue($index){\n\n if(is_object($this->data)){\n return $this->data->$index;\n }\n return isset($this->data[$index]) ? $this->data[$index] : null;\n }", "public function get( $index )\n {\n return $this->_getDelegate()->offsetGet($index);\n }", "public function item($item = '', $index = ''){\n\t\t$value = false;\n\t\tif($index == ''){\n\t\t\tif(isset($this->config[$item])){\n\t\t\t\t$value = $this->config[$item];\n\t\t\t}\n\t\t}else{\n\t\t\tif(array_key_exists($index, $this->config) && in_array($item, $this->config)){\n\t\t\t\t$value = $this->config[$index][$item];\n\t\t\t}\n\t\t}\n\t\treturn $value;\n\t}", "public function get(string $name): Parameter\n {\n foreach ($this as $parameter) {\n if ($parameter->getName() === $name) {\n return $parameter;\n }\n }\n\n throw new FileGenException(sprintf(\n 'Can not find parameter \"%s\"',\n $name\n ));\n }", "public function getItem($index)\n\t\t{\n\t\t\tParameter::check(array(\n\t\t\t\t\t\"integer\" \t=> $index\n\t\t\t\t), __METHOD__);\n\t\t\t\n\t\t\tif ($index < 0 || $index > count($this->items)) throw new IndexOutOfBoundsException();\n\t\t\treturn $this->items[$index];\n\t\t}", "public function getParameter($key);", "public function getParam($key)\n {\n if (isset($this->params[$key])) {\n return $this->params[$key];\n }\n }", "public function getInput($index)\n {\n if ($index < 0 || $index >= count($this->inputs)) {\n throw new \\OutOfRangeException();\n }\n\n return $this->inputs[$index];\n }", "public function get($index) {\r\n if($this->isInvalidIndex($index)) throw new IndexOutOfRangeException(\"index is outside the bounds of this instance while get -or- setting a character. \");\r\n return $this->result[$index];\r\n }", "public static function getParam() {\n\n\t}", "public function getElement(int $index): string {\n return $this->elements[$index];\n }", "public function GetColumn($index = NULL)\r\n {\r\n return($this->preparedStatement->fetchColumn($index));\r\n }", "public function getParameter($name){\n\t\tif(!isset($this->inputParameters[$name])){\n\t\t\tthrow new ValidationException(\"Could not find parameter: {$name}\");\n\t\t}\n\t\treturn $this->inputParameters[$name];\n\t}", "public function getParam($name){\n\t\treturn array_key_exists($name, $this->params) ? $this->params[$name] : NULL;\n\t}", "public function value($parameter);", "public function at($index);", "public function offsetGet($name)\n {\n if (is_int($name)) {\n return parent::offsetGet($name);\n }\n $name = strtoupper($name);\n\n if (!isset($this->parameters[$name])) {\n return;\n }\n\n return $this->parameters[$name];\n }", "public static function get_search_parameter($key){\n global $TFUSE;\n return $TFUSE->ext->seek->get_search_parameter($key);\n }", "public function item($index) {\n return isset($this->list[$index]) ? $this->list[$index] : null;\n }", "public static function get( $index )\n {\n $instance = self::getInstance( );\n if( !$instance->offsetExists( $index ) )\n\t\t{\n throw new Zend_Exception(\"No entry is registered for key '$index'\");\n }\n return $instance[ $index ];\n }", "public function get($i);", "public function get($i);", "public function getParameter($name)\n {\n return $this->parameters[$name] ?? null;\n }", "public function getOptionAt($index)\n\t{\n\t\tif ($index >= 0 && $index < $this->getOptionsLength())\n\t\t{\n\t\t\treturn $this->options[$index];\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "function get ($idx = \"\") {\n\t\tif ($idx)\n\t\t\treturn $this->get_event($idx);\n\t\telse {\n\t\t\tif ($this->cursor < $this->count())\t\n\t\t\t\treturn $this->get_event($this->cursor++);\n\t\t}\n\t}", "public function get_parameter($parameter) {\n\t if (isset($this->decodedWebhook['queryResult']['parameters'][$parameter])) {\n\t\t return $this->decodedWebhook['queryResult']['parameters'][$parameter];\n\t }\n\t\treturn false;\n }", "public function getParam($key) {\n if (isset($this->params[$key])) {\n return $this->params[$key];\n }\n return NULL;\n }", "public function getParameter($parameter)\n {\n $params = $this->getParameters();\n\n return $params[$parameter] ?? null;\n }", "function getParam($inKey = null) {\n\t\treturn $this->_getItem($inKey);\n\t}", "function getIDAt ( $index = 0 )\n\t{\n\t\t$item = $this->getAt($index) ;\n\t\t\n\t\treturn !is_null ( $item ) ? str_get_last_int ($str) : null ;\n\t}", "public function get( int$index )\n\t{\n\t\treturn $this->stackArray[$index]??null;\n\t}", "public function get($parameterName) {\n return $this->getParameter($parameterName);\n }" ]
[ "0.855581", "0.8493773", "0.8092843", "0.786161", "0.76036376", "0.75439376", "0.74344385", "0.7390685", "0.69616085", "0.6939857", "0.69266367", "0.69266367", "0.6800946", "0.67945874", "0.6790953", "0.6730115", "0.66975176", "0.66817427", "0.66628945", "0.65581775", "0.6450758", "0.644603", "0.6425249", "0.6424133", "0.63715076", "0.6321369", "0.62981945", "0.6297293", "0.62535274", "0.6210729", "0.6198112", "0.6191962", "0.61686575", "0.61594284", "0.6147213", "0.6104367", "0.61016506", "0.6090796", "0.6081012", "0.6081012", "0.6081012", "0.60642254", "0.6062752", "0.6044707", "0.60382634", "0.60259414", "0.60256076", "0.60215545", "0.6003716", "0.5964026", "0.5957833", "0.59431463", "0.5941827", "0.5941827", "0.5932414", "0.59255844", "0.5922893", "0.59199715", "0.5909868", "0.5904162", "0.59002817", "0.5897014", "0.58886737", "0.5887835", "0.5878726", "0.587871", "0.5870224", "0.58692443", "0.58630574", "0.5861596", "0.58549774", "0.58503234", "0.5845179", "0.58428925", "0.5841004", "0.58394057", "0.5817026", "0.58146274", "0.58097726", "0.57980156", "0.5786023", "0.5776181", "0.576849", "0.57600385", "0.5759526", "0.5756939", "0.5734435", "0.57145274", "0.5711028", "0.5711028", "0.57106394", "0.57015586", "0.56980157", "0.5676015", "0.5673345", "0.5673033", "0.5669436", "0.5666938", "0.56620836", "0.564912" ]
0.79295003
3
Returns a string representation of the method call invocation. The result looks like a method call in PHP source code. Example: $invocation = new LimeMockMethodInvocation('doSomething', array(1, 'foobar')); print $invocation; // => "doSomething(1, 'foobar')"
public function __toString() { $parameters = $this->parameters; if (is_array($parameters)) { foreach ($parameters as $key => $value) { if (is_string($value)) { $value = str_replace(array("\0", "\n", "\t", "\r"), array('\0', '\n', '\t', '\r'), $value); $value = strlen($value) > 30 ? substr($value, 0, 30).'...' : $value; $parameters[$key] = '"'.$value.'"'; } else if (is_object($value)) { $parameters[$key] = get_class($value); } else if (is_array($value)) { $parameters[$key] = 'array'; } else { $parameters[$key] = var_export($value, true); } } } return sprintf('%s(%s)', $this->method->getMethod(), implode(', ', (array)$parameters)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toString() {\n return sprintf(\n \"%s(Calling %s(%d arg(s)) %s)@{\\n\".\n \" [args ] %s\\n\".\n \" [return ] %s\\n\".\n \" [exception ] %s\\n\".\n \" [isInPropertyBehavior] %s\\n\".\n \" [actualCalls ] %d\\n\".\n \"}\",\n $this->getClassName(),\n $this->methodName,\n sizeof($this->args),\n $this->repeat === -1 ? '**' : '* '.$this->repeat,\n xp::stringOf($this->args, ' '),\n xp::stringOf($this->return, ' '),\n xp::stringOf($this->exception, ' '),\n xp::stringOf($this->isInPropertyBehavior),\n $this->actualCalls\n );\n }", "public function __toString()\n {\n try {\n $str = 'at ' . $this->getCalled();\n\n $args = $this->getArguments();\n if (!empty($args)) {\n $str .= ' (';\n foreach ($args as $i => $arg) {\n $str .= $arg->__toString();\n if ($i < count($args) - 1) {\n $str .= ' , ';\n }\n }\n $str .= ' )';\n } else {\n $str .= ' ()';\n }\n\n $file = $this->getFile();\n $line = $this->getLine();\n if (!empty($file)) {\n $str .= PHP_EOL . ' called in file ' . $file;\n if (!empty($line)) {\n $str .= ' at line ' . $line;\n }\n }\n\n return $str;\n } catch (\\Exception $e) {\n return $e->__toString();\n }\n }", "public function toString() {\n return \n sprintf('%s<%s::%s(%s)>',\n $this->getClassName(),\n $this->instance->getClassName(),\n $this->method,\n implode(', ', array_map(array('xp', 'stringOf'), $this->args))\n );\n }", "public function __toString(): string\n {\n if ($this->isPrivate()) {\n $visibility = 'private';\n } elseif ($this->isProtected()) {\n $visibility = 'protected';\n } else {\n $visibility = 'public';\n }\n\n $eol = \"\\n\";\n $str = '';\n\n // Method\n $str .= sprintf(\n 'Method [ <%s> %s method %s ] {%s',\n $this->getExtensionName(),\n $visibility,\n $this->getShortName(),\n $eol\n );\n\n $str .= sprintf(\n ' @@ %s %d - %d%s',\n $this->getFileName(),\n $this->getStartLine(),\n $this->getEndLine(),\n $eol\n );\n\n // Parameters\n $parameters = $this->getParameters();\n $str .= sprintf(\n '%s - Parameters [%d] {%s',\n $eol,\n count($parameters),\n $eol\n );\n foreach ($parameters as $parameter) {\n $str .= ' ' . $parameter->__toString();\n }\n $str .= ' }' . $eol;\n\n $str .= '}' . $eol;\n\n return $str;\n }", "protected function pExpr_MethodCall(MethodCall $node): string\n {\n return $this->pDereferenceLhs($node->var)\n . '->'\n . $this->pObjectProperty($node->name)\n . '('\n . $this->printArgs($node)\n . ')';\n }", "public function __toString()\n {\n return $this->__call(__FUNCTION__, func_get_args());\n }", "protected static function callstring($args) {\n $obj = array_shift($args);\n $method = array_shift($args);\n return sprintf(\"%s%s%s(%s)\",\n is_object($obj) ? get_class($obj) : $obj,\n is_object($obj) ? \"->\" : \"::\",\n $method,\n implode(\", \", array_map('static::valdebug', $args)));\n }", "public function toString()\n {\n $func = 'build'.ucfirst(strtolower($this->operation));\n return $this->$func();\n }", "public function __toString()\n\t{\n\t\treturn sprintf(\n\t\t\t\"%sFunction [ <user> function %s%s ] {\\n @@ %s %d - %d\\n}\\n\",\n\t\t\t$this->getDocComment() ? $this->getDocComment() . \"\\n\" : '',\n\t\t\t$this->returnsReference() ? '&' : '',\n\t\t\t$this->getName(),\n\t\t\t$this->getFileName(),\n\t\t\t$this->getStartLine(),\n\t\t\t$this->getEndLine()\n\t\t);\n\t}", "public function toStringReturnsStringRepresentationWithClassNameOfReflectedMethodAndParameter()\n {\n $this->assertEquals(\"stubbles\\\\lang\\\\reflect\\\\ReflectionParameter[stubbles\\\\lang\\\\reflect\\\\test_function(): Argument param] {\\n}\\n\",\n (string) $this->refParamFunction\n );\n $this->assertEquals(\"stubbles\\\\lang\\\\reflect\\\\ReflectionParameter[stubbles\\\\lang\\\\reflect\\\\ParamTestHelper::paramTest(): Argument param] {\\n}\\n\",\n (string) $this->refParamMethod1\n );\n $this->assertEquals(\"stubbles\\\\lang\\\\reflect\\\\ReflectionParameter[stubbles\\\\lang\\\\reflect\\\\ParamTestHelper2::paramTest(): Argument param] {\\n}\\n\",\n (string) $this->refParamMethod2\n );\n $this->assertEquals(\"stubbles\\\\lang\\\\reflect\\\\ReflectionParameter[stubbles\\\\lang\\\\reflect\\\\ParamTestHelper2::paramTest2(): Argument param2] {\\n}\\n\",\n (string) $this->refParamMethod3\n );\n $this->assertEquals(\"stubbles\\\\lang\\\\reflect\\\\ReflectionParameter[stubbles\\\\lang\\\\reflect\\\\ParamTestHelper2::paramTest3(): Argument param2] {\\n}\\n\",\n (string) $this->refParamMethod4\n );\n }", "public function __toString() {\n return (string)$this->run();\n }", "public function toString() {\n $buff = \"{\".$this->class_name().\"}-->\\n\";\n foreach ($this->params as $name=>$value) {\n $buff .= \"[{$name}=\";\n if (is_array($value)) {\n $buff .= \"\\n\\t[Array:\\n\";\n foreach ($value as $k=>$v) {\n $buff .= \"\\t\\t[{$k}=\";\n if (is_array($v)) {\n $buff .= \"[Array]\\n\";\n continue;\n }\n if (strlen($v)>75) {\n $buff .= substr(str_replace(\"\",\"\\n\",$v),0,75) .\" .....]\\n\";\n } else {\n $buff .= \"$v]\\n\";\n }\n }\n $buff .= \"]]\\n\";\n } else {\n $buff .= \"{$value}]\";\n }\n }\n return $buff;\n }", "public function __toString()\n {\n return $this->run( );\n }", "public function __toString()\r\n {\r\n return $this->dispatch();\r\n }", "public function __toString()\n\t{\n\t\tif (substr($this->name, -2) == '()')\n\t\t{\n\t\t\treturn PHP_EOL . substr($this->name, 0, -2) . '(' . implode($this->glue, $this->elements) . ')';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn PHP_EOL . $this->name . ' ' . implode($this->glue, $this->elements);\n\t\t}\n\t}", "public function __toString(): string\n {\n return (string) $this->call('__toString');\n }", "public function __toString() : string {\n return __CLASS__ . ': [' . $this->code . ']: ' . $this->message . ' Trace: ' . $this->getReadableTrace();\n }", "public function toString(): string\n {\n $methods = [\n self::LOCAL_NOT_FOUND,\n self::REMOTE_NOT_FOUND,\n self::BOTH_ARE_EQUAL,\n self::LOCAL_GOT_UPDATED,\n self::REMOTE_GOT_UPDATED,\n self::BOTH_GOT_UPDATED,\n ];\n\n foreach ($methods as $method) {\n if ($this->{$method}()) {\n return $method;\n }\n }\n\n throw new LogicException('This should not happen');\n }", "public function __toString()\n {\n return implode(' ', $this->args);\n }", "public function __toString() {\n\t\treturn implode(\"\\n\", $this->trace);\n\t}", "protected function generateCallTrace()\n {\n $e = new \\Exception();\n $trace = explode(\"\\n\", $this->getExceptionTraceAsString($e));\n // reverse array to make steps line up chronologically\n $trace = array_reverse($trace);\n array_shift($trace); // remove {main}\n array_pop($trace); // remove call to this method\n array_pop($trace); // remove call to log_debug_result method\n $length = count($trace);\n $result = [];\n for ($i = 0; $i < $length; $i++) {\n // replace '#someNum' with '$i)', set the right ordering\n $result[] = ($i + 1) . ')' . substr($trace[$i], strpos($trace[$i], ' '));\n }\n\n return \"\\t\" . implode(\"\\n\\t\", $result) . \"\\n\\n\";\n }", "public function __toString() \n {\n $headers = $this->getHeaders();\n if (count($headers) > 0) {\n array_walk(\n $headers, function (&$value, $key) {\n $value = ($value !== null && $value !== false) ? sprintf(\"%s: %s\", $key, $value) : null;\n }\n );\n }\n\n return sprintf(\n \"%s %s\\n%s\\n\",\n $this->getMethod(),\n $this->getEndpoint(),\n implode(\"\\n\", array_filter($headers))\n );\n }", "public function __toString() {\n\n $parameters = $this->getData();\n if (count($parameters) > 0) {\n $parameters_as_string = json_encode($parameters);\n }\n return \"Request to url \" . $this->getUrl() . \" with method \" . $this->getMethod()\n . (count($parameters) > 0?(\" with parameters \" . $parameters_as_string):\"\");\n }", "public function __toString()\n\t{\n\t\treturn \"This is the function that is called when you try to use print or echo or a variable that holds an instance of this class.\";\n\t}", "protected function getJoinpointInvocationBody(ReflectionMethod $method): string\n {\n $isStatic = $method->isStatic();\n $class = '\\\\' . self::class;\n $scope = $isStatic ? 'static::class' : '$this';\n $prefix = $isStatic ? AspectContainer::STATIC_METHOD_PREFIX : AspectContainer::METHOD_PREFIX;\n\n $argumentList = new FunctionCallArgumentListGenerator($method);\n $argumentCode = $argumentList->generate();\n $argumentCode = $scope . ($argumentCode !== '' ? \", $argumentCode\" : '');\n\n $return = 'return ';\n if ($method->hasReturnType()) {\n $returnType = $method->getReturnType();\n if ($returnType instanceof ReflectionNamedType && $returnType->getName() === 'void') {\n // void return types should not return anything\n $return = '';\n }\n }\n\n $advicesArrayValue = new ValueGenerator(\n $this->adviceNames[$prefix][$method->name],\n ValueGenerator::TYPE_ARRAY_SHORT\n );\n $advicesArrayValue->setArrayDepth(1);\n $advicesCode = $advicesArrayValue->generate();\n\n return <<<BODY\nstatic \\$__joinPoint;\nif (\\$__joinPoint === null) {\n \\$__joinPoint = {$class}::getJoinPoint(__CLASS__, '{$prefix}', '{$method->name}', {$advicesCode});\n}\n{$return}\\$__joinPoint->__invoke($argumentCode);\nBODY;\n }", "protected function callMethod($methodName, $object = '', $args = []) {\n\t\tif ($object === NULL){\n\t\t\t$object = $this->getSelf;\n\t\t}\n\t\tif ($object) {\n\t\t\t$object .= '->';\n\t\t}\n\t\t$a = implode(\", \", $args);\n\t\treturn \"{$object}$methodName($a)\";\n\t}", "public function __toString()\n {\n $str = \"\";\n if(is_array($this->params)){\n foreach($this->params as $key => $value){\n $str .= \"$key=$value\\n\";\n }\n }\n\n return $str;\n }", "public function __toString(): string\n {\n return $this->output() . PHP_EOL;\n }", "public function getMethod()\t{\n\t\tif ($this->class != \"NoRoute\")\t{\n\t\t\treturn $this->method;\n\t\t}\n\t\treturn \"invoke\";\n\t}", "public function __toString()\n\t{\n\t\treturn $this->getCommandLine();\n\t}", "public function __toString()\n\t{\n \t$r = \"Object \\\"\".get_class($this).\"\\\"\\n\";\n \t$r .= \"Log of events:\\n\";\n\t\tforeach($this->arrLogMessages as $m)\n\t\t{\n\t\t\t$r .= $m.\"\\n\";\n\t\t}\n\t\treturn $r;\n\t}", "function toString() {\n return $this->getClassName().'('.$this->code.') {\"'.$this->message.'\"}';\n }", "public function __call(string $method, array $params): void\n {\n $this->output->writeln(\"<{$method}>{$params[0]}</{$method}>\");\n }", "public function __toString()\n {\n return __CLASS__.\": [{$this->code}]: {$this->message}\".\\PHP_EOL;\n }", "public function __toString()\n {\n return __CLASS__.\": [{$this->code}]: {$this->message}\\n\";\n }", "public function __toString()\n {\n return get_called_class()\n . \"[\"\n . \"start={$this->getStart()},\"\n . \"end={$this->getEnd()}\"\n . \"]\";\n }", "public function someOperation(): string\n {\n // Call the factory method to create a Product object.\n $product = $this->factoryMethod();\n // Now, use the product.\n $result = \"Creator: The same creator's code has just worked with \" .\n $product->operation();\n\n return $result;\n }", "public function __toString() {\n\t\t\treturn $this->builder->command()->__toString();\n\t\t}", "public function Name()\n {\n return parent::CallMethod(__FUNCTION__, array(), func_get_args());\n }", "public function __toString() {\n return $this->assemble();\n }", "public function getMethod(): string {}", "public function __toString() {\n if ( $this->reflectionSource instanceof ReflectionFunction ) {\n return $this->reflectionSource->__toString();\n } else {\n return parent::__toString();\n }\n }", "public static function calldebug($obj, $method) {\n $args = array_slice(func_get_args(), 2);\n return sprintf(\"%s returns %s\",\n static::callstring(func_get_args()),\n // valdebug() will set $lastResult for us as well\n static::valdebug(call_user_func_array(array($obj, $method),\n $args)));\n }", "public function getMethod(): string;", "public function getMethod(): string;", "public function getMethod(): string;", "public function getMethod(): string;", "public function getMethod(): string;", "public function getMethod(): string;", "public function toString()\n {\n $this->assertEquals(\"net::stubbles::reflection::stubReflectionProperty[stubTestProperty1::property] {\\n}\\n\", (string) $this->stubRefProperty);\n }", "public function getCalled()\n {\n if (empty($this->called)) {\n $class_name = $this->getClassName();\n $function_name = $this->getFunctionName();\n $type = $this->getType();\n if (!empty($class_name)) {\n $this->called = $class_name . $type . $function_name;\n } else {\n $this->called = isset($function_name) ? $function_name : '-';\n }\n }\n return $this->called;\n }", "public function __toString()\n\t{\n\t\tswitch ($this->last_called) {\n\t\t\tcase \"Get_Documents_By_Name\":\n\t\t\tcase \"Get_Documents\":\n\t\t\tcase \"Get_Document_List\":\n\t\t\t\treturn $this->formatDocumentList();\n\t\t\t\t\n\t\t\tcase \"Get_Document_Log\":\n\t\t\tcase \"Log_Document\":\n\t\t\tcase \"Send_Document\":\n\t\t\tcase \"Get_Document_Id\":\n\t\t\tcase \"Get_Application_Data\":\n\t\t\tcase \"Get_Application_History\":\n\t\t\tdefault:\n\t\t\t\treturn $this->obj->__toString();\n\t\t}\n\t}", "private static function methodParametersForCall(ReflectionMethod $method): string\n {\n $parameters = [];\n\n foreach ($method->getParameters() as $i => $parameter) {\n $name = '$' . $parameter->getName();\n\n /* Note: PHP extensions may use empty names for reference arguments\n * or \"...\" for methods taking a variable number of arguments.\n */\n if ($name === '$' || $name === '$...') {\n $name = '$arg' . $i;\n }\n\n if ($parameter->isVariadic()) {\n continue;\n }\n\n if ($parameter->isPassedByReference()) {\n $parameters[] = '&' . $name;\n } else {\n $parameters[] = $name;\n }\n }\n\n return implode(', ', $parameters);\n }", "public function __toString()\n {\n return $this->assemble();\n }", "public function method(): string\n {\n return $this->getMethod();\n }", "public function toString()\n {\n return \"CommandLine\";\n }", "public function __toString()\n {\n $commandString = $this->command;\n\n if (count($this->options)) {\n $options = [];\n foreach ($this->options as $opt => $val) {\n if ($val) {\n $options[] = \"--{$opt}={$val}\";\n } else {\n $options[] = \"--{$opt}\";\n }\n }\n $commandString .= ' ' . join(' ', $options);\n }\n\n if (count($this->flags)) {\n $commandString .= ' -' . join('', $this->flags);\n }\n\n $commandString .= ' ' . $this->argument;\n\n return trim($commandString);\n }", "public function __toString()\n\t{\n\t\treturn __CLASS__ . \": {$this->message} ({$this->code})\\n\";\n\t}", "public function getMethod()\n {\n $output = $this->product->getMethod();\n return $output;\n }", "public function __toString() {\n return __CLASS__ . \": [{$this->code}]: {$this->message}\\n\";\n }", "public function __toString() {\n return __CLASS__ . \": [{$this->code}]: {$this->message}\\n\";\n }", "public function __toString() {\n return __CLASS__ . \": [{$this->code}]: {$this->message}\\n\";\n }", "public function __toString() {\n return __CLASS__ . \": [{$this->code}]: {$this->message}\\n\";\n }", "public function __toString() {\n\t\treturn __CLASS__ . \": [{$this->code}]: {$this->message}\\n\";\n\t}", "public function __toString() {\n\t\treturn __CLASS__ . \": [{$this->code}]: {$this->message}\\n\";\n\t}", "public function __toString() {\n\t\treturn __CLASS__ . \": [{$this->code}]: {$this->message}\\n\";\n\t}", "public function __toString()\n\t{\n\t\tif (is_array($this->params[self::PARAM_VALUE]))\n\t\t{\n\t\t\t$param_value = ' ('.join(\",\", $this->params[self::PARAM_VALUE]).')';\n\t\t}\n\t\telseif ($this->params[self::PARAM_VALUE])\n\t\t{\n\t\t\t$param_value = ' ('.$this->params[self::PARAM_VALUE].')';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$param_value = '';\n\t\t}\n\n\t\t$string = \"Rule: \" . $this->event_name . \" [\" . $this->name . $param_value . \"]\\n\";\n\t\treturn $string;\n\t}", "function to_str(){\n $expressions = $this->expressions;\n //\n //loop through the expressions returns a string for each \n $strs = array_map(function($exp){\n return $exp->to_str();}\n //\n //Array that contains the expressions\n ,$expressions);\n //\n $sep = is_null($this->sep) ? \",\": \" as `$this->sep`\";\n $args = implode($sep, $strs);\n $alias = is_null($this->alias) ? \"\": \" as `$this->alias`\";\n //\n return \"$this->name($args)$alias\";\n }", "public function __toString() {\n $request = $this->method . ' ' . $this->path . ' ' . $this->protocol . \"\\r\\n\";\n\n foreach ($this->headers as $header) {\n $request .= (string) $header . \"\\r\\n\";\n }\n\n if ($this->getBody()) {\n $request .= \"\\r\\n\" . $this->getBody() . \"\\r\\n\";\n }\n\n return $request;\n }", "static public function run() {\n try {\n $calledClass = get_called_class();\n $params = $calledClass::algorithm(func_get_args()) ?: array();\n return $calledClass::executeString($params);\n } catch (\\Exception $e) {\n return '';\n }\n }", "public static function debugPrintStartActionCode($eventCall, array $method)\n {\n $ret = '';\n if (Channels::$channelsMode === 'debug'\n && self::$_currentSystem !== 'Report'\n ) {\n $ret .= \"\\nif (Channels::\\$installing === FALSE) {\\n\";\n $ret .= \"\\$debugFunctionParams = array('params' => array());\\n\";\n $ret .= \"\\$debugFunctionParams['channel'] = '\".$eventCall.\"';\\n\";\n $ret .= '$debugFunctionParams[\\'system\\'] = \\''.$method['system'].\"';\\n\";\n $ret .= '$debugFunctionParams[\\'type\\'] = \\''.$method['type'].\"';\\n\";\n foreach ($method['params'] as $paramName) {\n $ret .= '$debugFunctionParams[\\'params\\'][\\'';\n $ret .= $paramName['name'].'\\'] = $'.$paramName['name'].\";\\n\";\n }\n\n $ret .= \"Channels::includeSystem('Report');\\n\";\n $ret .= \"Report::debugStartAction(\\$debugFunctionParams);\\n\";\n $ret .= \"}\\n\";\n }\n\n return $ret;\n\n }", "public function __toString()\n {\n return __CLASS__ . \": [{$this->code}]: {$this->message}\\n\";\n }", "public function __toString()\n {\n return __CLASS__ . \": [{$this->code}]: {$this->message}\\n\";\n }", "public function __toString() {\r\n return __CLASS__ . \": [{$this->code}]: {$this->message}\\n\";\r\n }", "public function __call($method, $arguments)\n {\n if (!$this->hasMethod($method)) {\n return '';\n }\n\n return parent::__call($method, $arguments);\n }", "public function __toString() {\n return __CLASS__ . \": [{$this->code}]: {$this->message}\\n\";\n }", "public function testMethodInvocationWithParameters() {\n\t\terror_reporting(($backup = error_reporting()) & ~E_USER_DEPRECATED);\n\n\t\t$class = 'lithium\\tests\\mocks\\analysis\\MockInspector';\n\n\t\t$this->assertEqual($class::invokeMethod('foo'), []);\n\t\t$this->assertEqual($class::invokeMethod('foo', ['bar']), ['bar']);\n\n\t\t$params = ['one', 'two'];\n\t\t$this->assertEqual($class::invokeMethod('foo', $params), $params);\n\n\t\t$params = ['short', 'parameter', 'list'];\n\t\t$this->assertEqual($class::invokeMethod('foo', $params), $params);\n\n\t\t$params = ['a', 'longer', 'parameter', 'list'];\n\t\t$this->assertEqual($class::invokeMethod('foo', $params), $params);\n\n\t\t$params = ['a', 'much', 'longer', 'parameter', 'list'];\n\t\t$this->assertEqual($class::invokeMethod('foo', $params), $params);\n\n\t\t$params = ['an', 'extremely', 'long', 'list', 'of', 'parameters'];\n\t\t$this->assertEqual($class::invokeMethod('foo', $params), $params);\n\n\t\t$params = ['an', 'extremely', 'long', 'list', 'of', 'parameters'];\n\t\t$this->assertEqual($class::invokeMethod('foo', $params), $params);\n\n\t\t$params = [\n\t\t\t'if', 'you', 'have', 'a', 'parameter', 'list', 'this',\n\t\t\t'long', 'then', 'UR', 'DOIN', 'IT', 'RONG'\n\t\t];\n\t\t$this->assertEqual($class::invokeMethod('foo', $params), $params);\n\n\t\terror_reporting($backup);\n\t}", "public function getMethodName()\n {\n return PhandArr::last(explode('@', $this->getMethodInvokerName()));\n }", "public function line()\n {\n return $this->method() . ' ' . $this->requestTarget() . ' ' . $this->protocol();\n }", "function callMethod() {\n $params = array();\n return $this->callServer(\"callMethod\", $params);\n }", "public static function getOutputByMethod ( $class, $name, $paramsRaw = '', array $options = array () )\n\t{\n\t\ttry\n\t\t{ \n\t\t\t$method = new ReflectionMethod ( $class, $name );\n\t\t}\t\t\n\t\tcatch ( ReflectionException $e )\n\t\t{\n\t\t\treturn new TakteeErrorInternal ( 61 );\n\t\t}\n\t\t\n\t\tif ( !$method->isPublic() )\n\t\t\treturn new TakteeErrorInternal ( 60, array ('$method', $name) );\n\t\t\n\t\t$paramaters = array ();\n\t\t\n\t\t$paramaters = new TakteeParameters ( $paramsRaw );\n\t\t$paramaters = $paramaters->toValue();\n\t\t\n\t\tunset ( $paramsParser );\n\t\t\n\t\tif ( count ( $paramaters ) < $method->getNumberOfRequiredParameters () )\n\t\t\treturn new TakteeErrorInternal ( 51 );\n\t\t\n\t\t$object = new $method->class( $options );\n\t\t\n\t\treturn call_user_method_array ( $name, $object, $paramaters );\n\t}", "public function __callIntern($methodName);", "public function call($method, array $arguments = []);", "public function __toString() {\n return __CLASS__ . \": [{$this->code}]: {$this->message}\\n\";\n }", "public function operation(): string\n {\n $result = \"Facade initializes subsystems:\\n\";\n $result .= $this->subsystem1->operation1();\n $result .= $this->subsystem2->operation1();\n $result .= \"Facade orders subsystems to perform the action:\\n\";\n $result .= $this->subsystem1->operationN();\n $result .= $this->subsystem2->operationZ();\n\n return $result;\n }", "public function getMethod() : string;", "public function __toString(): string\n {\n return $this->getResponse()->__toString();\n }", "public function testWhenCalledWithStringParameterWillOutputString()\n {\n $this->mock->expects($this->any())\n ->method('toString')\n ->will(\n $this->returnValue('outputString')\n );\n\n $output = $this->mock->toOutput('string');\n\n $this->assertInternalType(\n 'string',\n $output\n );\n }", "public function getTraceAsString();", "public function toString() {\n return $this->getClassName().'(handler= '.$this->_handler->toString().')';\n }", "public function __toString(): string\n {\n $step = sprintf(\"%s,\", substr(parent::__toString(), 0, -1));\n $step .= \"\\\"stepCount\\\":{$this->getStepCount()}\";\n $step .= \"}\";\n return $step;\n }", "protected function buildDescription($called, $args) {\n $text = (($this->invert) ? 'not ' : '').$this->tester->toWords($called);\n $when = ucfirst($this->tester->toWords(get_class($this->tester)));\n $it = $this->tester->toWords($this->tester->method);\n $args = (empty($args)) ? \"\" : $this->displayValue($args[0]);\n\n return \" : $when, $it : Expected {$this->displayValue($this->subject)} {$text} {$args}\\n\";\n }", "public function getMethod() :string;", "public function __toString()\n {\n $lines = array();\n foreach ($this->transactions as $entry) {\n $response = isset($entry['response']) ? $entry['response'] : '';\n $lines[] = '> ' . trim($entry['request']) . \"\\n\\n< \" . trim($response) . \"\\n\";\n }\n\n return implode(\"\\n\", $lines);\n }", "public function __toString(): string\n {\n return $this->code;\n }", "public function __toString(): string\n {\n return $this->code;\n }", "public function __toString(): string\n {\n return $this->code;\n }", "public function __toString(): string\n {\n return $this->code;\n }", "public function __toString() {\n\t\treturn $this->debug();\n\t}", "public function __toString(): string\n {\n return __CLASS__.'::__toString'.\"\\n\".print_r($this->stateRaw, true);\n }" ]
[ "0.7286679", "0.7013166", "0.6771366", "0.6592955", "0.6395609", "0.63878465", "0.62635154", "0.6175563", "0.58785987", "0.5871245", "0.58293635", "0.5777014", "0.5764829", "0.57433784", "0.5710327", "0.5699935", "0.5645043", "0.5593387", "0.5573108", "0.5530133", "0.55232674", "0.5521602", "0.5509727", "0.55076444", "0.55069", "0.5483101", "0.54483855", "0.54065543", "0.5396567", "0.53960246", "0.53809536", "0.53788966", "0.53673655", "0.53401065", "0.53383774", "0.53366816", "0.5334019", "0.53298837", "0.5321667", "0.53197116", "0.5315024", "0.53149366", "0.5308295", "0.52960426", "0.52960426", "0.52960426", "0.52960426", "0.52960426", "0.52960426", "0.52901715", "0.5277799", "0.52735823", "0.52692276", "0.5261676", "0.5257784", "0.5251227", "0.52308244", "0.5220336", "0.52191293", "0.5218776", "0.5218776", "0.5218776", "0.5218776", "0.52182025", "0.52182025", "0.52182025", "0.5216053", "0.521062", "0.51971364", "0.5190767", "0.5185149", "0.5183369", "0.5183369", "0.51830155", "0.51824045", "0.5177078", "0.51705045", "0.5162184", "0.51619256", "0.516024", "0.5153349", "0.5150045", "0.51484704", "0.5148401", "0.5136886", "0.5130368", "0.5124686", "0.5105293", "0.5098867", "0.50970787", "0.50960344", "0.5092586", "0.5091676", "0.5088486", "0.5077669", "0.5077669", "0.5077669", "0.5077669", "0.50716394", "0.50689936" ]
0.68624884
2
Just update the last recorded time
function updateSameCurrentScore($rawScore, $currentScore) { $query = "UPDATE `RB3CurrentScores` SET last_recorded = '$rawScore->recorded' WHERE id = $currentScore->id"; mysql_query($query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function setSyncLastTime()\n {\n DB::update(\"UPDATE `sync_last_time` SET timestamp = ? WHERE id=?\", [time(), 1]);\n }", "public function updateQueryTime()\n\t{\n\t\t$this->setLastQueryTime(time());\n\t\t$this->save();\n\t}", "public function updateLastUsed()\n {\n if (\n $this->last_used_at === null ||\n $this->last_used_at < (new \\DateTime())->sub(new \\DateInterval('P1D'))\n ) {\n $this->last_used_at = new \\DateTime();\n $this->save();\n }\n }", "public function refreshTimestamp();", "private function _timestamp()\n \t{\n \t\t$this->updated_at = time();\n \t\tif (!$this->exists) $this->created_at = $this->updated_at;\n \t}", "function setPasswordUpdatedTime(){\n\t\t$this->setPasswordUpdated(time());\n\t}", "public function updateLastPing()\n {\n $this->last_ping = Carbon::now();\n $this->save();\n }", "public function UpdateLastActivity()\n\t{\n\t\tif (isset($_SESSION['timestamp']) && $_SESSION['timestamp'] - time() > 60 * 10)\n\t\t{\n\t\t\t// If it's been enough time (say, 10 minutes), generate new session ID\n\t\t\t// to help prevent session hijacking\n\t\t\tsession_regenerate_id();\n\t\t\t$_SESSION['timestamp'] = time();\n\t\t}\n\n\t\t$this->LastActivity = now();\n\t\t$this->Save();\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}", "public function updateNewTimeClient() {\n\t\treturn $this->Db->query(\"UPDATE `yp_sessions` \n\t\t\tSET `last_time` = {$this->Request->time} \n\t\t\tWHERE `hash` = '{$this->_thisClientHash()}'\");\n\t}", "function set_date_to_now()\n {\n $this->timestamp=time();\n }", "public function markLastUpdate()\n {\n if (!$this->updatedAtOveridden) {\n $this->updatedAt = new \\DateTime();\n }\n }", "public function touch() {\n\t\t$this->timestamp();\n\t\t$this->save();\n\t}", "function updateTime($abrv){\n\t$time = time();\n\t$sql = \"UPDATE updated set $abrv='$time' where ID='0'\";\n db_query($sql, \"update the time record\");\n}", "public function populateTimestamp()\n {\n $this->exists = true;\n $this->timestamp = 1;\n }", "private function set_last_updated_at() {\n\n\t\tif ( ! static::get_table() instanceof TimestampedTable ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$dirty = $this->is_dirty();\n\n\t\t$this->set_attribute( static::get_table()->get_updated_at_column(), $this->fresh_timestamp() );\n\n\t\t// If the model is dirty, we don't want to commit our save since the user should already be calling save.\n\t\tif ( ! $dirty ) {\n\t\t\t$this->save();\n\t\t}\n\t}", "private function updateUpdatedAtField() {\n foreach (static::getFields() as $field_name => $field) {\n if ($field instanceof UpdatedAtField) {\n $this->$field_name = time();\n }\n }\n }", "public function setTimeStamp()\n\t{\n\t\t$this->_current_timestamp = time();\n\t}", "public function timestamp() {\n\t\t$this->updated_at = new \\DateTime;\n\n\t\tif ( ! $this->exists) $this->created_at = $this->updated_at;\n\t}", "public function refreshUpdated()\n {\n $this->setUpdated(new \\DateTime());\n }", "public function _update()\n {\n $this->updatedAt = new \\DateTime();\n }", "public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }", "protected function setUpdated(){\n if($this->_id > 0){\n $pfDB = DB\\Database::instance()->getDB('PF');\n\n $pfDB->exec(\n [\"UPDATE \" . $this->table . \" SET updated=NOW() WHERE id=:id\"],\n [\n [':id' => $this->_id]\n ]\n );\n }\n }", "protected function _update()\n {\r\n $this->date_updated = new Zend_Db_Expr(\"NOW()\");\n parent::_update();\n }", "public function save() {\n $this->lastModified = new \\DateTime();\n parent::save();\n }", "public function getUpdate_time()\r\n {\r\n return $this->update_time;\r\n }", "public function refreshUpdated() {\n $this->setUpdated(new \\DateTime(\"now\"));\n}", "public function refreshUpdateAt() {\n // Get session\n $securitySession = $this->getSecuritySession();\n if($securitySession != null) {\n $securitySession[self::SESS_UPDATED_AT] = time();\n $this->setSecuritySessionFromArray($securitySession);\n }\n }", "public function addUpdated()\n {\n try {\n $date = new DateTime();\n $this->updated_at = $date->format('Y-m-d H:i:s');\n $this->updated_by = 0;\n } catch (Exception $e) {\n print_r($e);\n }\n }", "function save_timestamp() {\n\t\t$this->timestamp = date('Y-m-d', time());\n\t}", "public function touch() {\n $this->updatedAt = new DateTime();\n }", "public function updateTopicModifiedDate()\n {\n $this->setAttribute( 'modified', time() );\n $this->store();\n }", "public function updatedTimestamps()\n {\n if($this->getCreatedAt() == null)\n {\n $this->setCreatedAt(new \\DateTime(date('Y-m-d H:i:s')));\n }\n }", "private function setLastModifiedDateTime() {\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"UPDATE `$this->table` SET `datetime-last-modified` = NOW() WHERE `id` = ?\");\n\t\t\t$stmt->execute([$this->getID()]);\n\t\t} catch (PDOException $e) {\n\t\t\techo 'Post.class.php setLastModifiedDateTime() error: <br />';\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\n\t\t// Because we set the datetime from MySQL, we can't use PHP's datetime function to get the time as it may be slightly different\n\t\t$stmt = $this->db->prepare(\"SELECT `datetime-last-modified` FROM `$this->table` WHERE `id` = ?\");\n\t\t$stmt->execute([$this->getID()]);\n\n\t\tforeach ($stmt as $row) {\n\t\t\t$this->lastModifiedDate = $row['datetime-last-modified'];\n\t\t}\n\t}", "public function updatedTimestamps() {\n $this->setCreated(new \\DateTime(date('Y-m-d H:i:s')));\n\n if ($this->getCreated() == null) {\n $this->setCreated(new \\DateTime(date('Y-m-d H:i:s')));\n }\n }", "public function updatedTimestamps()\n {\n $this->setUpdatedAt(new \\DateTime('now'));\n }", "public function updatePinTime()\n {\n /*Redis::command(\"sadd\", [PinHelper::REDIS_PINS_TO_UPDATE_TIME, 2,5,6, \"j\", \"aaa\"]);\n $x = Redis::command('spop', [PinHelper::REDIS_PINS_TO_UPDATE_TIME, 100]);*/\n $pin_id = [];\n $result = PinTimeUpdate::limit(100)->get();\n foreach ($result as $value) {\n $pin_id[] = CacheHelper::getCache(\"user_pin_id\", [\"user_id\" => $value->user_id]);\n $value->delete();\n }\n\n Pin::whereIn(\"id\", $pin_id)->update(['updated_at' => DB::raw('DATE_ADD(updated_at,INTERVAL 10 MINUTE)')]);\n }", "public function getUpdatetime()\n {\n return $this->updateTime;\n }", "public function updatedAt();", "public function remember()\r\n {\r\n $iNewTime = PHPFOX_TIME + (strtotime(\"+\" . Phpfox::getParam('waytime.time_remain_complete_waytime')) - time());\r\n return $this->database()->update(Phpfox::getT('waytime_profile'), array('remind_time' => $iNewTime), 'user_id = '.Phpfox::getUserId());\r\n }", "protected function updateRequestTime()\n {\n $this->requestTimestamp = microtime(true);\n }", "public function update_login_time() {\n\t\t$this->last_login = date('Y-m-d H:i:s');\n\t\t$this->db->update('admin_login', $this, array('id' => 1));\n\t}", "public function getUpdateTime()\r\n {\r\n return $this->update_time;\r\n }", "public function updateUpdatedAt()\n {\n $this->setUpdatedAt(new \\Datetime());\n }", "public function view_time( $new_time ) {\n\t\t$this->timestamp = max( $this->timestamp, $new_time );\n\t}", "public function getLastUpdateTime()\n {\n return $this->last_update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function touch()\n\t{\n\t\t$this['last_dismiss_date'] = new \\DateTime();\n\t\t$this['last_email_date'] = new \\DateTime();\n\t}", "public function refreshUpDated()\n {\n $this->setUpdated(new \\DateTime());\n }", "function set_timemodified() {\n $this->timemodified = time();\n return true;\n }", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function updateTime( Inx_Api_Recipient_Attribute $attr, $sValue );", "public function updateTimestamps() {\r\n $this->setModifiedAt(new \\DateTime(date('Y-m-d H:i:s')));\r\n\r\n if ($this->getCreatedAt() == null) {\r\n $this->setCreatedAt(new \\DateTime(date('Y-m-d H:i:s')));\r\n }\r\n }", "protected function updateLastTrace() {\n $this->last_trace = time();\n }", "public function refreshUpdated(): void\n {\n $this->setUpdatedAt(new \\DateTime());\n }", "public function getUpdatedTime() {\r\n return $this->updated_time;\r\n }", "public function UpdateLastLogin() {\r\n\t\t\t$_SESSION[__CLASS__.$this->intId.'_LastLogin'] = $this->dttLastLogin;\r\n\t\t\t$this->dttLastLogin = new QDateTime(QDateTime::Now);\r\n\t\t}", "public static function resetCurrentTime()\n {\n \tself::$_currentTime = 'now';\n }", "public function seen(): void\n {\n $this->lastSeen = new DateTime();\n }", "public function stampLastChargingPowerRecord()\n {\n $lastRecord = $this -> latestChargingPower();\n \n if( $lastRecord && $lastRecord -> end_at === null )\n {\n $lastRecord -> end_at = now() -> timestamp;\n $lastRecord -> save();\n }\n }", "public function getUpdateTime()\n {\n return isset($this->update_time) ? $this->update_time : null;\n }", "static function updateSession() {\n\t\t$db = new Database ();\n\t\t\n\t\t$start_time = time ();\n\t\t$query = \"UPDATE user_sessions SET last_modified = '\" . $start_time . \"' WHERE session_id='\" . session_id () . \"'\";\n\t\t$db->Execute ( $query );\n\t\treturn;\n\t}", "public function getUpdateTime() {\n return $this->update_time;\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function updateTimestamps()\r\n {\r\n $this->setUpdatedAt(new \\DateTime('now'));\r\n\r\n if (is_null($this->getCreatedAt())) {\r\n $this->setCreatedAt(new \\DateTime('now'));\r\n }\r\n }", "public function setLastCommentTimeAsCurrent()\n {\n return $this->setLastCommentTime(date('Y-m-d H:i:s'));\n }", "public function increment() {\n $this->db->query('UPDATE '.TABLE_PREFIX.'tickers SET last_run = '.time().' WHERE id = '.$this->id);\n }", "public function beforeUpdate()\n {\n\t\t// Asignar fecha y hora de ultima actualizacion\n// $this->updatedon = time();\n }", "function getModificationTime() ;", "public function updateLastUpdateDateTime() {\n\t\t// open file\n\t\t$lastUpdateStorageFile = fopen($this::LAST_UPDATE_STORAGE_FILE, $this::FILE_READ_WRITE_MODE);\n\t\t\n\t\t// Last update dateTime\n\t\t$date = new \\Datetime();\n\t\n\t\t// write the last update datetime\n\t\t$lastUpdateDateTime = fputs($lastUpdateStorageFile, $date->format('Y-m-d H:i:s'));\n\t\n\t\t// Close the file\n\t\tfclose($lastUpdateStorageFile);\n\t\n\t\treturn $lastUpdateDateTime;\n\t}", "public function updatedTimestamps()\n {\n $this->setUpdatedAt(new \\DateTime(date('d-m-Y H:i')));\n\n if($this->getCreatedAt() == null)\n {\n $this->setCreatedAt(new \\DateTime(date('d-m-Y H:i')));\n }\n }", "public function onPreUpdate()\r\n {\r\n $this->updated_at = new \\DateTime(\"now\");\r\n }", "public function getLastUpdated();", "protected function col_timeupdated($record) {\n if ($record->timeupdated) {\n return userdate($record->timeupdated, get_string('strftimedatetimeshort'));\n } else {\n return '-';\n }\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "function stampModified() {\n\t\treturn $this->setLastModified(Core::getCurrentDate());\n\t}", "function update_vehicle_time($cid)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\t\n\t\t$data['time'] = time();\n\n\t\t$this->update_single_field(GARAGE_TABLE, 'date_updated', $data['time'], 'id', $cid);\n\t\n\t\treturn;\n\t}", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }" ]
[ "0.76770914", "0.739268", "0.73764163", "0.7301533", "0.70249254", "0.68331575", "0.68214875", "0.68129647", "0.6801773", "0.67551255", "0.67517203", "0.6721164", "0.6716715", "0.6714452", "0.6704671", "0.66938484", "0.6677496", "0.66687894", "0.66350204", "0.6631558", "0.6618644", "0.6603523", "0.65931946", "0.6587188", "0.65648675", "0.6557003", "0.6532726", "0.65146583", "0.6496327", "0.6479466", "0.6450397", "0.64441335", "0.6437099", "0.6435958", "0.6403417", "0.63973016", "0.6391127", "0.63879436", "0.63859576", "0.63803244", "0.63773096", "0.6374265", "0.63688993", "0.63422024", "0.63391715", "0.63225543", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.6318646", "0.63169765", "0.631444", "0.6313209", "0.63115275", "0.63115275", "0.63092816", "0.630649", "0.63031864", "0.63028187", "0.62978387", "0.62968355", "0.6280618", "0.62655467", "0.62432915", "0.6242494", "0.62418944", "0.6240307", "0.62391543", "0.6231777", "0.62309957", "0.62272686", "0.62141657", "0.6210936", "0.6207527", "0.6195634", "0.6179166", "0.6178193", "0.61743784", "0.6171993", "0.6171993", "0.6165206", "0.615887", "0.6152063" ]
0.0
-1
Truncate data in table before alter his structure
public function truncateTable() { Schema::disableForeignKeyConstraints(); DB::table('questions')->truncate(); DB::table('answers')->truncate(); Schema::enableForeignKeyConstraints(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function truncate()\n {\n // Désactivation des contraintes FK\n $this->co->executeQuery('SET foreign_key_checks = 0');\n // On tronque\n $this->co->executeQuery('TRUNCATE TABLE casting');\n $this->co->executeQuery('TRUNCATE TABLE department');\n $this->co->executeQuery('TRUNCATE TABLE genre');\n $this->co->executeQuery('TRUNCATE TABLE job');\n $this->co->executeQuery('TRUNCATE TABLE movie');\n $this->co->executeQuery('TRUNCATE TABLE movie_genre');\n $this->co->executeQuery('TRUNCATE TABLE person');\n $this->co->executeQuery('TRUNCATE TABLE review');\n $this->co->executeQuery('TRUNCATE TABLE team');\n $this->co->executeQuery('TRUNCATE TABLE user');\n }", "public function truncate()\n {\n $this->_getWriteAdapter()->truncateTable($this->getMainTable());\n }", "public function truncate(): void\n {\n $sql = <<<SQL\nTRUNCATE TABLE `cfg_centreonbroker`;\nTRUNCATE TABLE `cfg_centreonbroker_info`\nSQL;\n $stmt = $this->db->prepare($sql);\n $stmt->execute();\n }", "public function truncateTable() {\n Schema::disableForeignKeyConstraints();\n DB::table('missed_calls')->truncate();\n Schema::enableForeignKeyConstraints();\n }", "function truncateData(){\n\t\t$userid=$GLOBALS['username'];\n mysql_query(\"SET FOREIGN_KEY_CHECKS=0;\");\n\t\t$truncateSource = mysql_query(\"TRUNCATE TABLE \".$userid.\"nertag\") or die(mysql_error());\n\t\t$truncateTarget = mysql_query(\"TRUNCATE TABLE \".$userid.\"sentences\") or die(mysql_error());\n mysql_query(\"SET FOREIGN_KEY_CHECKS=1;\");\n}", "abstract public function truncate($table);", "public final function truncate()\n {\n $sql = 'TRUNCATE {db_prefix}' . $this->tbl;\n $this->db->query($sql);\n }", "function truncateTable() {\n\t\t$dbh=$this->getdbh();\n\t\treturn $dbh->query('TRUNCATE TABLE '.$this->enquote($this->tablename));\n\t\t\n\t}", "public function clean(): void\n {\n $this->truncateJournalTable();\n $this->output(\"<success>Table {$this->internalTable} truncated</success>\");\n }", "public function postTruncate($drupal_table_name);", "public function onRsformBackendFormRestoreTruncate(): void\n\t{\n\t\t$this->db->truncateTable('#__rsform_jdideal');\n\t}", "public function truncateTables()\n {\n $tables = [\n 'properties',\n 'users',\n ];\n\n DB::unprepared('TRUNCATE TABLE ' . implode(',', $tables) . ' RESTART IDENTITY CASCADE');\n }", "public function preTruncate($drupal_table_name);", "public function clear()\r\n\t{\r\n\t\t$this->db->runQuery(\"TRUNCATE TABLE `\" . $this->name . \"`\");\r\n\t}", "function truncate(){\n\t\t$this->db_tools->truncate();\t\t\n\t\t$this->db_tools->echo_truncate();\n\t}", "public function truncateTable($table)\n {\n $this->db->createCommand()->truncateTable($table)->execute();\n }", "public function truncate($table) {\n\t\t$table = str_replace('`', '', $table);\n\t\t$table = explode('.', $table);\n\t\t$table = '`' . $table[0] . '`' . (isset($table[1]) ? '.`' . $table[1] . '`' : '') ;\n\t\t$this->query('TRUNCATE TABLE ' . $table);\n\t}", "public function truncate()\n {\n foreach ($this->grammar->compileTruncate($this) as $sql => $bindings)\n {\n $this->connection->statement($sql, $bindings);\n }\n }", "public function truncate($table)\r\n\t\t{\r\n\t\t\t$this->_query = $this->_prepare(\"TRUNCATE TABLE `{$this->_prefix}{$table}`\");\r\n\t\t\t$this->_execute($this->_query);\r\n\t\t\t$this->_errors($this->_query);\r\n\t\t\t$this->close();\r\n\t\t}", "protected function truncateTables()\n {\n \\DB::table('cities')->truncate();\n \\DB::table('states')->truncate();\n }", "function emptyIndexTable(){\n\t\t$this->ecmDBhandle->truncateTable($this->dfs_db-> table_name);\n\t}", "public function truncate()\n\t{\n\t\tdebugInfo(get_class($this).\"->truncate\");\n\n\t\t// clear private variables\n\t\t$this->_clear();\n\n\t\t$this->_query = \"TRUNCATE TABLE $this->_table;\";\n\n\t\t$return = $this->_execute(false);\n\n\t\tdebug('->truncate(), $return', $return);\n\t\treturn $return;\n\t}", "public function clear()\n {\n self::foreignChecks(false);\n $this->model->truncate();\n self::foreignChecks(true);\n }", "public function truncateTable($table) {\n\t\t$this->getDbConnection()->createCommand()->truncateTable($table);\n\t}", "public function truncate() {\n\t\t$qs = ('TRUNCATE TABLE '.$this->table);\n\t\treturn $this->query($qs);\n\t}", "public function truncate() {\n\t\t$sql = \"TRUNCATE `\" . static::tablename() . \"`\";\n\t\t$q = $this->_fizz_pdo->prepare($sql);\n\t\treturn $this->_fizz_execute($q, array());\n\t}", "private function cleanDatabase()\n {\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n foreach($this->tables as $table)\n {\n\n DB::table($table)->truncate();\n\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n\n\n }", "abstract protected function platformTruncateStatement($table);", "public function purgeUndoTable()\n\t{\n\t\t$objDatabase = \\Database::getInstance();\n\n\t\t// Truncate the table\n\t\t$objDatabase->execute(\"TRUNCATE TABLE tl_undo\");\n\n\t\t// Add a log entry\n\t\t$this->log('Purged the undo table', __METHOD__, TL_CRON);\n\t}", "public function truncateTable($tableName);", "function clear_table($table, $dbh)\n{\n\ttry {\n\t $dbh->beginTransaction();\n\n\t $stmt = $dbh->prepare(\"TRUNCATE TABLE $table\");\n\n\t $stmt->execute();\n\n\t $dbh->commit();\n\t} catch(PDOException $ex) {\n\t //Something went wrong rollback!\n\t $dbh->rollBack();\n\t echo $ex->getMessage();\n\t} \n}", "public function truncateLaratrustTables()\n {\n Schema::disableForeignKeyConstraints();\n DB::table('permission_role')->truncate();\n DB::table('permission_user')->truncate();\n DB::table('role_user')->truncate();\n \\App\\User::truncate();\n \\App\\Role::truncate();\n \\App\\Permission::truncate();\n Schema::enableForeignKeyConstraints();\n }", "protected function truncate()\n\t{\n\t\treturn Yii::$app->db->createCommand()\n ->truncateTable($this->table)\n ->execute();\n\t}", "function best_levels_truncate($pdo)\n{\n $result = $pdo->exec('TRUNCATE TABLE best_levels');\n\n if ($result === false) {\n throw new Exception(\"Could not truncate all-time best levels table.\");\n }\n\n return $result;\n}", "function truncate()\n\t{\n\t\t$this->data = array();\n\t\t;\n\t}", "private function clear_dummy_data()\n {\n $this->adapter->query('DELETE FROM ' . RUCKUSING_TS_SCHEMA_TBL_NAME);\n }", "public function truncate()\n {\n\n $this->connection->truncate($this->collection);\n }", "function clear($table){\n\t\t$r=mysql_query(\"TRUNCATE `$table`\");\n\t}", "public static function doTruncate() {\n\t\t$conn = new wgConnector();\n\t\treturn (bool) $conn->truncate(self::TABLE_NAME);\n\t}", "public static function doTruncate() {\n\t\t$conn = new wgConnector();\n\t\treturn (bool) $conn->truncate(self::TABLE_NAME);\n\t}", "public static function doTruncate() {\n\t\t$conn = new wgConnector();\n\t\treturn (bool) $conn->truncate(self::TABLE_NAME);\n\t}", "public static function doTruncate() {\n\t\t$conn = new wgConnector();\n\t\treturn (bool) $conn->truncate(self::TABLE_NAME);\n\t}", "public function truncate() {\n try {\n $this->db->exec(\"TRUNCATE `\" . $this->table . \"`\");\n return new DynamicTable($this->table, $this->db);\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "public function truncate($tabel)\n {\n $this->app_db->from($tabel);\n $this->app_db->truncate();\n }", "public function reset()\n {\n $db = PDOController::getInstance();\n \n $req = $db->prepare(\"TRUNCATE TABLE `executedtask` \");\n $req->execute([]);\n }", "function Truncate()\n {\n $databasename = $this->databasename;\n $tablename = $this->tablename;\n $path = $this->path;\n $this->numrecords = -1;\n $this->numrecordscache = array();\n remove_dir_rec(\"$path/$databasename/$tablename\");\n $this->ClearCachefile();\n return true;\n }", "public function resetTable();", "public function truncateAll(): void\n {\n $tables = [\n Newsletter::TABLE_NAME,\n Link::TABLE_NAME,\n Log::TABLE_NAME,\n Queue::TABLE_NAME,\n ];\n foreach ($tables as $table) {\n DatabaseUtility::getConnectionForTable($table)->truncate($table);\n }\n }", "public function cleanRoleAndPermissionTables() : void\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('roles')->truncate();\n DB::table('permissions')->truncate();\n DB::table('role_has_permissions')->truncate();\n DB::table('model_has_roles')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function actionTruncate()\n {\n $dbName = Yii::$app->db->createCommand('SELECT DATABASE()')->queryScalar();\n if ($this->confirm('This will truncate all tables of current database [' . $dbName . '].')) {\n Yii::$app->db->createCommand('SET FOREIGN_KEY_CHECKS=0')->execute();\n $tables = Yii::$app->db->schema->getTableNames();\n foreach ($tables as $table) {\n $this->stdout('Truncating table ' . $table . PHP_EOL, Console::FG_RED);\n Yii::$app->db->createCommand()->truncateTable($table)->execute();\n }\n Yii::$app->db->createCommand('SET FOREIGN_KEY_CHECKS=1')->execute();\n }\n }", "public function truncate()\r\n {\r\n }", "public function truncateJournalTable()\n {\n return $this->conn->delete($this->internalTable, ['1' => '1']);\n }", "public static function clear_schema()\n {\n }", "public function testTruncateTableTable()\n {\n $sql = 'TRUNCATE TABLE `name`';\n $statement = (new TruncateTable($this->mockConnection))->table('name');\n $this->assertEquals($sql, $statement->toSql());\n }", "public function truncateTable($table)\n\t{\n\t\t$n = $this->setText(\"TRUNCATE TABLE \".$this->_connection->quoteTableName($table))->execute();\n\t\treturn $n;\n\t}", "public static function dbClearTable($table){\n\t\tif (App::runningUnitTests()) {\n\t\t\tif (DB::table($table)->count() != 0) {\n\t\t\t\t//Turn foreign key checks off <- USE WITH CAUTION!\n\t\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t\t\t//Delete all entries & reset indexes\n\t\t\t\tDB::table($table)->truncate();\n\t\t\t\t//Turn foreign key checks on <- SHOULD RESET ANYWAY BUT JUST TO MAKE SURE!\n\t\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t\t\t}\n\t\t}\n\t}", "public function run()\n {\n DB::table('companies')->truncate();\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0;');\n DB::table('usuario')->truncate();\n DB::table('rol')->truncate();\n DB::table('rol_usuario')->truncate();\n DB::table('permiso')->truncate();\n DB::table('permiso_rol')->truncate();\n DB::table('permiso_usuario')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS = 1;');\n }", "public function truncate($initAutoIncrement = false): void;", "public function purgeVersionTable()\n\t{\n\t\t$objDatabase = \\Database::getInstance();\n\n\t\t// Truncate the table\n\t\t$objDatabase->execute(\"TRUNCATE TABLE tl_version\");\n\n\t\t// Add a log entry\n\t\t$this->log('Purged the version table', __METHOD__, TL_CRON);\n\t}", "public function TruncateTable($table)\r\n\t{\r\n\t\t$sql = \"delete from $table\";\r\n\t\treturn $this->Execute($sql);\r\n\t}", "public function deleteAll()\n {\n $query = 'TRUNCATE TABLE `'. $this->getTableName() .'`';\n $this->db->sql_query($query);\n }", "public function testTruncate()\n {\n \t$this->conn->delete('test', NULL, DB::ALL_ROWS);\n\n \t$result = $this->conn->query(\"SELECT * FROM test\");\n \t$this->assertNull($result->fetchOrdered());\n }", "private function clearTable(){\n\t\n\t\t$db = new manejaDB();\n\t\t$query = \"truncate alert\";\n\t\t$db->query($query);\n\t\treturn true;\n\t\t\n\t}", "function base_clear(){\n $tables = array(\n 'oc_product',\n 'oc_product_image',\n 'oc_manufacturer',\n 'oc_manufacturer_description',\n 'oc_product_description',\n 'oc_product_to_category',\n 'oc_product_attribute',\n 'oc_attribute',\n 'oc_attribute_description',\n // 'oc_attribute_value',\n // 'oc_category',\n // 'oc_category_description',\n 'oc_product_to_store',\n // 'oc_category_to_store',\n 'oc_manufacturer_to_store',\n 'oc_product_to_layout',\n // 'oc_category_to_layout',\n );\n foreach ($tables as $table)\n {\n sDb::query(\"TRUNCATE TABLE $table\");\n echo \"Таблица $table очищена\\n\";\n }\n}", "private function purgeTables()\n\t{\t\n\t\t$this->db->query(\"DELETE FROM categories\");\n\t\t$this->db->query(\"DELETE FROM album_art\");\n\t\t$this->db->query(\"TRUNCATE TABLE albums\");\n\t\t\n\t}", "function cleanVisitorTable($database = \"\"){\n\t\t\n\t\t$sql = \"TRUNCATE TABLE visitor\"; \n\t\t\n\t\ttry{\n\t\t\t\n\t\t\t$query = $database->exec($sql);\n\t\t\t\n\t\t\techo 'Succesfully ran rhe clean up operation.';\n\t\t\t\n\t\t} catch(PDOException $error){\n\t\t\n\t\t\techo 'Error with query. '.$error->getMessage();\n\t\t\n\t\t}\n\t\t\n\t}", "public function updateAggregationTable()\n {\n DB::table($this->aggregation_table)->truncate();\n foreach ($this->affiliates as $affiliate) {\n DB::table($this->aggregation_table)->insert(['affiliate_id'=>$affiliate->affiliate_id, \n 'revenue' =>$affiliate->revenue]);\n }\n }", "function empty_table($name) {\n\t\t\t$result = $this->checkup(\"\", $name);\n\t\t\tif ($result == false) {\n\t\t\t\treturn $this->error(\"could not truncate.\");\n\t\t\t}\n\n\t\t\t#if ( mysql_query ( \"TRUNCATE TABLE \" . $name, $this->CONN ) ) {\n\t\t\tif ($this->one_query(\"TRUNCATE TABLE \".$name)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$this->error(\"error truncating table '$name' !\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function truncateTable($table)\n\t{\n\t\t$sql = $this->connection->getQueryBuilder()->truncateTable($table);\n\t\treturn $this->setSql($sql)->execute();\n\t}", "public function truncate(array $param = array('table'=>'')) {\n // (REQUIRED) name of table\n $tableName = isset($param['table']) ? $param['table'] : '';\n\n if( empty( $tableName ) ) {\n echo \"table name missing\";\n die;\n }\n\n $strQry = \"TRUNCATE TABLE `\".$tableName.\"`;\";\n\n $pdo = $this->getConnection();\n $this->stmt = $pdo->prepare($strQry);\n $executed = $this->stmt->execute();\n if( $executed ) {\n echo 'table truncated successfully.';\n } else {\n echo 'fails to truncate table';\n }\n $this->stmt = null;\n die;\n }", "public function wipe($type) {\n\t\t$table = $this->safeTable($type);\n\t\t$this->adapter->exec(\"DELETE FROM $table\");\n\t}", "public function acfedu_truncate_table() {\n\t\t\t\tif ( isset( $_POST[\"truncate_table_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"truncate_table_nonce\"], 'truncate-table-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $_POST['delete_faculty'] ) ) {\n\t\t\t\t\t\t\tif ( isset( $_POST['delete_faculty'] ) && 1 == $_POST[\"delete_faculty\"] ) {\n\n\t\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\t\t$prefix = $wpdb->get_blog_prefix();\n\t\t\t\t\t\t\t\t$wpdb->query( 'TRUNCATE TABLE ' . $prefix . 'faculty' );\n\t\t\t\t\t\t\t\t$this->acfedu_errors()->add( 'success_table_truncated', esc_html__( 'All faculty are deleted.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_nuke' );\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}", "public static function truncate($model){\n\t\t$table = self::table_for($model);\n\t\treturn self::do_query(\"TRUNCATE TABLE \" . $table);\t\n\t}", "public function truncate()\n {\n }", "public function clearMessages() {\n $this->connection->truncate($this->messageTable)\n ->execute();\n }", "function clearwatson(){\n\t\t$connection = Database::getConnection();\n\t\t//Empty watson table\n\t\t$query=\"TRUNCATE TABLE watson\";\n\t\tif (!$connection->query($query)){\n\t\t\techo \"Error :\" .$query . \"<br>\" . $connection->error;\n\t\t}\n\t\t//Empty watson_country table\n\t\t$query=\"TRUNCATE TABLE watson_country\";\n\t\tif (!$connection->query($query)){\n\t\t\techo \"Error :\" .$query . \"<br>\" . $connection->error;\n\t\t}\n\t}", "public function wipe($connection, $table);", "public function truncate_table_data()\n {\n if($this->isloggedIn())\n {\n $group = $this->session->userdata['role'];\n $data['menu'] = $this->Menu_model->getMenuItems($group);\n $data['users'] = $this->Settings_model->getAdminUsers();\n $data['company_info'] = $this->Settings_model->get_company_info();\n\n $result = $this->db->query(\"SHOW TABLE STATUS\")->result();\n $tableinfo = array();\n $totalsize = 0;\n $totalrows = 0;\n foreach($result as $res){\n $size = round($res->Data_length/1000,2);\n $totalsize += $size;\n $totalrows += $res->Rows;\n $tableinfo['all'][] = (object)array(\"name\" => $res->Name, \"size\" => $size.\" KB\", \"rows\" => $res->Rows);\n }\n $tableinfo['totalSize'] = round(($totalsize/1000),2).\" MB\";\n $tableinfo['totalRows'] = $totalrows;\n $data['dbtables'] = $tableinfo;\n $data['title'] = $data['company_info']['name'].\" | Database Backup\";\n $this->load->view(\"admin/truncate_table_data\", $data);\n }\n else\n {\n redirect(base_url());\n }\n }", "private function cleanCoreTables() {\n\n $core_tables = [\n 'glpi_datacenters',\n 'glpi_dcrooms',\n 'glpi_items_racks',\n 'glpi_pdus',\n 'glpi_racks',\n 'glpi_rackmodels',\n 'glpi_racktypes',\n 'glpi_passivedcequipments',\n 'glpi_passivedcequipmenttypes',\n 'glpi_passivedcequipmentmodels',\n ];\n\n foreach ($core_tables as $table) {\n $result = $this->db->query('TRUNCATE ' . DB::quoteName($table));\n\n if (!$result) {\n throw new RuntimeException(\n sprintf('Unable to truncate table \"%s\"', $table)\n );\n }\n }\n }", "public static function emptyTruncateAll()\n {\n self::empty();\n self::truncateAll();\n }", "public function flush()\n {\n $this->table()->delete();\n }", "function doempty()\r\n\t{\r\n\t\t$model\t= &$this->getModel( 'table' );\r\n\t\t$model->truncate();\r\n\t\t$this->display();\r\n\t}", "public function safeDown()\n\t{\n $sql=\" ALTER TABLE `tbl_venta` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n //quitando la columna pto_venta de tbl_empleado\n $sql=\" ALTER TABLE `tbl_empleado` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n\t}", "function clearTable($table){\n // Server Connection Information\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"T3mp12\";\n $dbname = \"temp\";\n \n // Create Connection\n $conn = new mysqli($servername, $username, $password, $dbname);\n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n } \n\n $sql = \"TRUNCATE TABLE $table\";\n\n if ($conn->query($sql) === TRUE) {\n // echo \"New Table Created. <br>\";\n } else {\n echo \"Error: \" . $sql . \"<br>\" . $conn->error;\n }\n\n //Close Connection\n $conn->close();\n}", "public static function truncate();", "public function run()\n {\n echo PHP_EOL , 'cleaning old data....', PHP_EOL;\n\n DB::statement(\"SET foreign_key_checks=0\");\n\n User::truncate();\n Role::truncate();\n UserRole::truncate();\n Permission::truncate();\n DB::table('roles_permissions')->truncate();\n DB::table('users_permissions')->truncate();\n\n DB::statement(\"SET foreign_key_checks=1\");\n\n $this->call(RolesTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n }", "public function truncateTables($truncate_users=false)\n {\n $database_name = $this->conn->getDatabase();\n $tables_to_truncate = array(\n 'omp_attributes',\n 'omp_class_attributes',\n 'omp_class_groups',\n 'omp_classes',\n 'omp_lookups',\n 'omp_lookups_values',\n 'omp_relations',\n 'omp_roles',\n 'omp_roles_classes',\n 'omp_tabs',\n );\n\n if ($truncate_users)\n {\n $tables_to_truncate[]='omp_users';\n }\n\n $tables_truncate_queries = '';\n\n foreach ($tables_to_truncate as $aTable)\n {\n $tables_truncate_queries .= \"DROP TABLE IF EXISTS $database_name.$aTable;\\n\";\n }\n\n $commands = \"SET FOREIGN_KEY_CHECKS=0;\\n\".$tables_truncate_queries.\"SET FOREIGN_KEY_CHECKS=1;\\n\";\n\n $this->conn->executeQuery($commands);\n\n $editora_structure = file_get_contents(__DIR__ .'/../../../../data/editora.sql');\n\n $this->conn->executeQuery($editora_structure);\n }", "function empty_table( $name )\n\t{\n\t\t$result = $this->checkup( \"\", $name );\n\t\tif ($result==false) {\n\t\t\treturn $this->error( \"could not truncate.\" );\n\t\t}\n\t\t\n\t\tif ( mysql_query ( \"TRUNCATE TABLE \" . $name, $this->CONN ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->error ( \"error truncating table '$name' !\" );\n\t\t\treturn false;\n\t\t}\n\t}", "public function truncate($class_name)\n\t{\n\t\t$this->setContext($class_name);\n\t\t$table_name = $this->storeNameOf($class_name);\n\t\t$this->query('TRUNCATE TABLE ' . BQ . $table_name . BQ);\n\t}", "protected function _after()\n {\n $this->_adapter->execute('drop table if exists comments;\n drop table if exists posts_tags;\n drop table if exists posts;\n drop table if exists tags;\n drop table if exists profiles;\n drop table if exists credentials;\n drop table if exists people;\n ');\n parent::_after();\n }", "protected function _clearSchema()\n {\n\n // Show all tables in the installation.\n foreach (get_db()->query('SHOW TABLES')->fetchAll() as $row) {\n\n // Extract the table name.\n $rv = array_values($row);\n $table = $rv[0];\n\n // If the table is a Neatline table, drop it.\n if (in_array('neatline', explode('_', $table))) {\n $this->db->query(\"DROP TABLE $table\");\n }\n\n }\n\n }", "function revert_table() {\r\n $this->_table = $this->_table_org;\r\n $this->_table_org = NULL;\r\n }", "public function delete_data_to_tombstone(){\n }", "public abstract function getTruncate(Table $table);", "public function limpiar($pdo){\n\t\t$sql = \"TRUNCATE TABLE lista_venta\";\n\t\t$sentencia= $pdo -> prepare($sql); \n\t\t$sentencia -> execute(); \n\n\t\t\n\t}", "public function run()\n {\n DB::table('messages')->truncate();\n DB::table('medicinal_plants_history')->truncate();\n DB::table('medicinal_plants_reports')->truncate();\n DB::table('medicinal_plants_reviews')->truncate();\n DB::table('remedies_history')->truncate();\n DB::table('remedies_reports')->truncate();\n DB::table('remedies_reviews')->truncate();\n DB::table('store_prescriptions')->truncate();\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('TRUNCATE TABLE bands');\n }", "public function truncateTable($table, $db) {\n return 'DELETE FROM ' . $db->quoteId($table) . \" WHERE 1;\\n\";\n }", "public function wipeAll() {\n\t\tforeach($this->getTables() as $t) {\n\t\t\tforeach($this->getKeys($t) as $k) {\n\t\t\t\t$this->adapter->exec(\"ALTER TABLE \\\"{$k['FKTABLE_NAME']}\\\" DROP FOREIGN KEY \\\"{$k['FK_NAME']}\\\"\");\n\t\t\t}\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t\tforeach($this->getTables() as $t) {\n\t\t\t$this->adapter->exec(\"DROP TABLE \\\"$t\\\"\");\n\t\t}\n\t}" ]
[ "0.7778109", "0.7232321", "0.72232217", "0.7217286", "0.7166768", "0.7090838", "0.7081197", "0.6998966", "0.69685507", "0.69621325", "0.6954953", "0.6933242", "0.6917339", "0.68343383", "0.6774539", "0.6695984", "0.6688773", "0.6658805", "0.6617286", "0.65879977", "0.6577454", "0.6567431", "0.6554648", "0.6514124", "0.6510891", "0.65086097", "0.65014255", "0.64961123", "0.6492612", "0.6468223", "0.6439698", "0.64097816", "0.6370143", "0.63617843", "0.63447344", "0.63358814", "0.6331058", "0.632885", "0.63222754", "0.63222754", "0.63222754", "0.63222754", "0.6319864", "0.62311894", "0.62062395", "0.62049", "0.6196967", "0.61814266", "0.61808085", "0.6175195", "0.6155204", "0.6147292", "0.6133518", "0.612159", "0.6112736", "0.61036414", "0.6099371", "0.6096862", "0.608084", "0.6078992", "0.60692656", "0.6040795", "0.6036427", "0.602445", "0.6018843", "0.5995487", "0.59747595", "0.5969556", "0.5969207", "0.5964636", "0.5950487", "0.5949983", "0.5948627", "0.5943258", "0.59293616", "0.59208333", "0.59163576", "0.586851", "0.5867473", "0.5859748", "0.58496255", "0.58474904", "0.58467335", "0.58418405", "0.58388186", "0.5833123", "0.58112556", "0.58004504", "0.57989484", "0.5796349", "0.5794794", "0.57926553", "0.57816213", "0.5763797", "0.57621074", "0.57607603", "0.5754272", "0.57461256", "0.5743995", "0.5742371" ]
0.7258272
1
Transform the resource into an array.
public function toArray($request) { // $data = parent::toArray($request); $data = []; $data['uid'] = $this->uid; $data['id'] = $this->id; $data['fullName'] = $this->nameForMyRole(); $data['email'] = ''; $data['general_phone'] = ''; if (\Auth::user()->hasPermission('access-to-personal')) { $data['email'] = $this->getValue('email', ''); $data['general_phone'] = $this->getValue('general_phone', ''); } $steads = $this->steads; foreach ($steads as $stead) { $stead['number'] = $stead->stead->number; unset($stead['stead']); } $data['steads'] = $this->steads; return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toArray(): array\n {\n if (is_null($this->resource)) {\n return [];\n }\n\n return is_array($this->resource)\n ? $this->resource\n : $this->resource->toArray();\n }", "public function toArray(): array\n {\n if (is_null($this->resource)) {\n return [];\n }\n\n return is_array($this->resource)\n ? $this->resource\n : $this->resource->toArray();\n }", "public function asArray() {\n return $this->resource;\n }", "public function transform($resource)\n {\n return [];\n }", "public function toArray()\n {\n if ($this->resource instanceof ArrayableInterface) {\n\n return $this->resource->toArray();\n } else {\n\n return null;\n }\n }", "public function parse($resource)\n {\n return $resource->toArray();\n }", "public function transform($resource)\n {\n return [\n 'id' => $resource['id'],\n 'item' => $resource['item'],\n 'qty' => $resource['qty'],\n\n ];\n }", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "abstract protected function toArray();", "public function getAsArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function getAsArray()\n\t{\n\t\t\n\t\t$path = $this->get();\n\t\t\n\t\treturn self::toArray($path);\n\t\t\n\t}", "public function transform($resource)\n {\n return [\n\n 'id' => (int) $resource->id,\n\t\t\t'name' => $resource->name,\n\t\t\t'description' => $resource->description,\n 'seat_count' => $resource->seat_count,\n\t\t\t'is_active' => $resource->is_active,\n\t\t\t'status' => $resource->status,\n\t\t\t'created_at' => $resource->created_at->toDateTimeString(),\n\t\t\t'updated_at' => $resource->updated_at->toDateTimeString(),\n\t\t\t\n ];\n }", "public function toArray(): array\n {\n return [\n 'users' => HiUserResource::collection($this->resource),\n ];\n }", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray()\n {\n return $this->transform();\n }", "function toArray() ;", "function toArray() ;", "public function convertItemArray() {}", "public function toArray(): array\n {\n $content = $this->getContent();\n\n if (\\is_array($content)) {\n return $this instanceof Filterable\n ? (array) $this->filterResponse($content)\n : $content;\n }\n\n return [];\n }", "protected function asArray()\n\t{\n\t\treturn \\json_decode($this->response, true);\n\t}", "public function arr() {\n\t\t\treturn \\uri\\generate::to_array($this->object);\n\t\t}", "public function toArray()\n {\n return $this->getContent();\n }", "public function toArray()\n {\n\n }", "public function asArray(): array\n {\n return json_decode($this->result, true);\n }", "public function toArray()\n {\n return $this->cast('array');\n }", "function toArray(){\r\n\t\treturn $this->data;\r\n\t}", "private function arrayify(): array\n {\n return $this->toArray();\n }", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "public function toArray() // untested\n {\n return $this->data;\n }", "public function toArray(){\n $this->buildArray();\n return $this->array;\n }", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;" ]
[ "0.7750167", "0.7750167", "0.77158", "0.7590659", "0.7310113", "0.71387887", "0.7135354", "0.70951104", "0.70951104", "0.7095091", "0.7095091", "0.7095091", "0.7095091", "0.70937836", "0.70937836", "0.70937836", "0.70937836", "0.70937836", "0.70937836", "0.70937836", "0.70937836", "0.70937836", "0.70937836", "0.69570595", "0.6955122", "0.688961", "0.688961", "0.688961", "0.688961", "0.688961", "0.688961", "0.68805903", "0.6868028", "0.68515664", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.68506885", "0.6789089", "0.67444956", "0.67444956", "0.67354226", "0.67187357", "0.6711922", "0.6710614", "0.67089254", "0.6659783", "0.66579753", "0.66554636", "0.6654198", "0.6652624", "0.6646621", "0.6646621", "0.6646621", "0.6646621", "0.6646621", "0.6636585", "0.6635539", "0.6626979", "0.6626979", "0.6626979", "0.6626979", "0.6626979", "0.6626979", "0.6626979" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('publication_types')->insert([ [ 'th_name' => 'Journal Papers', 'en_name' => "Journal Papers", ], [ 'th_name' => 'Refereed Conference and Workshop Papers', 'en_name' => "Refereed Conference and Workshop Papers", ], [ 'th_name' => 'Refereed Poster Papers', 'en_name' => "Refereed Poster Paperss", ], ]); DB::table('publication_types')->update([ 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s') ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.80140394", "0.7980541", "0.79775697", "0.79547316", "0.79514134", "0.79500794", "0.79444957", "0.794259", "0.79382807", "0.7937482", "0.7934376", "0.7892533", "0.7881253", "0.78794724", "0.7879101", "0.7875628", "0.787215", "0.7870168", "0.78515327", "0.7850979", "0.7841958", "0.7834691", "0.78279406", "0.78198457", "0.78093415", "0.78030044", "0.7802443", "0.7801398", "0.7798975", "0.77957946", "0.77905124", "0.7789201", "0.77866685", "0.77786297", "0.7777914", "0.7764813", "0.7762958", "0.7762118", "0.77620417", "0.77614594", "0.7760672", "0.77599436", "0.77577287", "0.7753593", "0.7749794", "0.7749715", "0.77473587", "0.77301705", "0.77296484", "0.77280766", "0.77165425", "0.77143145", "0.7714117", "0.77136046", "0.7712814", "0.7712705", "0.7711485", "0.7711305", "0.77110684", "0.77102643", "0.7705902", "0.77048075", "0.77041686", "0.77038115", "0.7703085", "0.7702133", "0.77009964", "0.7698874", "0.769864", "0.76973957", "0.7696364", "0.7694127", "0.7692633", "0.76910555", "0.7690765", "0.7688756", "0.76879585", "0.76873547", "0.76871854", "0.7685407", "0.7683626", "0.76794547", "0.7678361", "0.7678022", "0.7676884", "0.7672536", "0.76717764", "0.7669418", "0.76692647", "0.76690245", "0.76667875", "0.76628584", "0.76624", "0.76618767", "0.7660002", "0.76567614", "0.76542175", "0.76541024", "0.7652618", "0.76524657", "0.7651689" ]
0.0
-1
Display a listing of the resource.
public function __construct() { $this->middleware('auth:api'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n {\n return view('url.form');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75936973", "0.75936973", "0.7585464", "0.7576766", "0.7571166", "0.7498768", "0.7434969", "0.7432511", "0.7387868", "0.7351811", "0.7336364", "0.73113805", "0.7293885", "0.72812635", "0.7273037", "0.72410345", "0.7228987", "0.7225174", "0.718589", "0.71786976", "0.7172516", "0.71492815", "0.7143504", "0.7143484", "0.71349627", "0.71274126", "0.7122271", "0.7115064", "0.7115064", "0.7115064", "0.7110841", "0.70930386", "0.70841706", "0.7079425", "0.7079275", "0.70567256", "0.70567256", "0.7054091", "0.70386195", "0.7038531", "0.7034834", "0.7032825", "0.7029208", "0.70263356", "0.7025177", "0.7018699", "0.70156187", "0.7004536", "0.7002615", "0.7000439", "0.69960874", "0.6992934", "0.6991493", "0.6988563", "0.698635", "0.69649065", "0.6963641", "0.69552153", "0.6950279", "0.69498897", "0.69465077", "0.6943029", "0.6940043", "0.6939427", "0.69359136", "0.69359136", "0.69357383", "0.6933012", "0.6929994", "0.69270134", "0.69259113", "0.6923401", "0.6917057", "0.69144267", "0.6911519", "0.6909902", "0.690978", "0.6905855", "0.6903688", "0.6900189", "0.68999064", "0.6898482", "0.6893158", "0.6892387", "0.6891021", "0.68905854", "0.6890334", "0.6890334", "0.68871844", "0.68864834", "0.68854547", "0.6881966", "0.68814063", "0.68788683", "0.68738896", "0.6871671", "0.68716353", "0.68688464", "0.6868651", "0.68685114", "0.686829" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // return AirlineRate::create([ 'rate' => $request['rate'], 'date' => NOW(), 'day' => NOW(), 'user_id' => Auth::user()->id ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n 'description' => 'nullable|string',\n ]);\n\n $resource = Resource::create($request->all());\n\n if ( $request->hasFile('file') ) {\n $resourceFile = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resourceFile);\n $resource->file = $resourceFile;\n $resource->save();\n }\n\n if ( $request->submit == 'Save' ) {\n return redirect()->route('admin.resources.index')->with('success','Resource Successfully Uploaded');\n } else {\n return redirect()->route('admin.resources.create')->with('success','Resource Successfully Uploaded');\n }\n }", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72857565", "0.714571", "0.71328056", "0.66390204", "0.6620437", "0.6567189", "0.6526738", "0.65074694", "0.64491314", "0.63734114", "0.6370837", "0.63628685", "0.63628685", "0.63628685", "0.6342026", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964" ]
0.0
-1
Display the specified resource.
public function show(AirlineRate $airlineRate) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "public function display() {\n echo $this->render();\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n {\n //\n $this->_show($id);\n }", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047151", "0.60409963", "0.6021287", "0.5989136", "0.5964405", "0.5962407", "0.59518087", "0.59309924", "0.5921466", "0.5908002", "0.5908002", "0.5908002", "0.59051657", "0.5894554", "0.5871459", "0.5870088", "0.586883", "0.5851384", "0.58168566", "0.58166975", "0.5815869", "0.58056176", "0.5799148", "0.5795126", "0.5791158", "0.57857597", "0.5783371", "0.5761351", "0.57592535", "0.57587147", "0.5746491", "0.57460666", "0.574066", "0.5739448", "0.5739448", "0.57295275", "0.57293373", "0.5729069", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57214445", "0.57149816", "0.5712036", "0.5710076", "0.57073003", "0.5707059", "0.5705454", "0.5705454", "0.5700382", "0.56997055", "0.5693362", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(AirlineRate $airlineRate) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // $airline = AirlineRate::findOrFail($id); $airline->update([ 'rate' => $request['rate'], 'date' => $request['date'], 'day' => $request['day'], 'user_id' => Auth::user()->id ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(AirlineRate $airlineRate) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public function delete(): void\n {\n unlink($this->path);\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function deleted(Storage $storage)\n {\n //\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6673811", "0.66624975", "0.66376764", "0.66351163", "0.66280866", "0.65443397", "0.6543099", "0.64656305", "0.62881804", "0.61755043", "0.61278707", "0.6089098", "0.60534257", "0.6043048", "0.6006416", "0.593359", "0.5929751", "0.5923406", "0.59201753", "0.5904145", "0.58963126", "0.5895338", "0.589437", "0.589437", "0.589437", "0.589437", "0.58819216", "0.58684987", "0.5864614", "0.58097607", "0.57739484", "0.5761358", "0.57558876", "0.5750673", "0.5741367", "0.5734089", "0.57264656", "0.5715195", "0.5711313", "0.5707201", "0.57057804", "0.57053447", "0.5702519", "0.5698952", "0.56844676", "0.56844676", "0.56783324", "0.5677608", "0.56581664", "0.564899", "0.5648674", "0.5647576", "0.5641079", "0.5636559", "0.56325674", "0.5619814", "0.5615794", "0.5607223", "0.56022006", "0.5601402", "0.5601336", "0.56004316", "0.5590177", "0.55810463", "0.55665016", "0.5565872", "0.5565398", "0.5563011", "0.55565405", "0.5556361", "0.5549312", "0.5544914", "0.554211", "0.5540394", "0.5540394", "0.5537265", "0.5536237", "0.55310345", "0.55295527", "0.5529016", "0.5527304", "0.5527274", "0.5527126", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5527044", "0.5523294", "0.55231583", "0.55181384" ]
0.0
-1
return "HAI NAMA SAYA ADIS, DAN SAYA BELAJAR CONTROLELER LARAVEL";
public function index(){ $nama = "ADIS WIDYA RAMADHAN"; $pelajaran = ["mvc", "laravel", "pemrograman lanjut"]; return view('aku', compact('nama', 'pelajaran')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buenosDias(){\n return \"Hola! buenos días!!\".salto;\n}", "function aboutMe(){\n return \"Hi my name is Ruby, I am a chatbot, nice to meet you\";\n}", "function aboutMe(){\n return \"Hi my name is Ruby, I am a chatbot, nice to meet you\";\n}", "public function bersuara()\n {\n return \"DARAWET ANJING DAWET\";\n }", "function Hola(){\n return 'Hola Darwin'; \n}", "public function falar(){\n\t\treturn \"Som\";\n\t}", "function myCreator(){\n return \"Adokiye is my creator he is currently in stage 4 of the HNG internship, he will soon advance to stage 5\";\n}", "public function percobaan()\n {\n \t$a = \"Ahmad Muhaimin\";\n \treturn \"Nama Saya Adalah \".$a;\n }", "public function practice1()\n {\n return (\"practice 1\");\n }", "function aboutHNG()\n{\n return 'The HNG is a 3-month remote internship program designed to locate the most talented software developers in Nigeria and the whole of Africa. Everyone is welcome to participate (there is no entrance exam). We create fun challenges every week on our slack channel. THose who solve them stay on. Everyone gets to learn important concepts quickly, and make connections with people they can work with in the future. The intern coders are introduced to complex programming frameworks, and get to work on real applications that scale. the finalist are connected to the best companies in the tech ecosystem and get full time jobs and contracts immediately.';\n}", "public function prueba()\n {\n return 'hola mundo';\n }", "function chuiNiu()\n{\n\techo '谁喜欢吹牛,爱谁谁<br>';\n}", "public function hello()\n {\n return \"Olá \" . $this -> primeiroNome . \" \" . $this -> ultimoNome;\n }", "function sayHi(string $nama) : string {\n return \"Hi, {$nama}! Apa kabar?\";\n}", "function echoMsg() {\n $a = \"primeira frase\";\n $b = \" depois de lavar a louça\";\n $c = \" e depois de amar<br>\";\n echo $a . $b . $c . PHP_EOL;\n}", "function car() \r\n {\r\n return 'Mercedes Benz C180';\r\n }", "function noidungtt($sotu,$noidung)\n{\n\n\t$n=explode(\" \",$noidung);\n\t$noidunginra=\" \";\n\tif($sotu<=count($n)){\n for($i=0;$i<$sotu;$i++)\n\t\t $noidunginra = $noidunginra.$n[$i].\" \";\n $noidunginra .=\"...\";\n }\n\telse\n\t\techo \"<h1>cảnh báo : số từ tóm lược nhiều hơn nội dung ban đầu</h1>\"; \n\treturn $noidunginra;\n}", "function hamtinhtong(){\n echo \"neu thay dong nay la ok r\";\n $a = 'hello';\n $b = ' Nguyen Hong Son';\n echo \"<br>\" . $a . $b;\n}", "function apa_kabar() {\n return \"Apa kabar dunia?\"; //tidak menampilkan apapun\n}", "public function greet() {\n return \"Hello, my name is \" . $this->firstname . \" \" . $this->lastname . \". Nice to meet you! :-)\";\n }", "public function hello_world():string\n {\n return self::HELLO_WORLD_STR;\n }", "public function getVerbalString();", "function palabra_largo($variable,$largo){\n\tif (strlen($variable) < $largo) { \n \t\t\t$var\t = 'El dato ingresado debe tener al menos '.$largo.' caracteres';\n\t\t\treturn $var;\n\t}\n}", "function string1(){\n\n $string1 = \"Hola mundo\";\n\n echo $string1;\n\n}", "function difundir() {\n\n // La funcion obtener_frase esta heredado del pariente Orador\n $frase = $this->obtener_frase();\n\n // Convirtir a mayusculos\n $frase_mayusculas = strtoupper($frase);\n\n echo $frase_mayusculas;\n\n }", "public function getFullName2()\n {\n return \"Silvi Lila\";\n }", "public function method1()\n {\n $str = $this->attribut;\n $str .= 'Je suis la class maman 2';\n return $str;\n }", "public function bersuara(){\n return \"miawww\";\n}", "public function bye(){\n return \"Bye... $this->dialogue\";\n }", "function well()\n{\n return \"foxphp\";\n}", "function greetings4($name){\r\n return $name;\r\n}", "function stringLetrasDescubiertas($coleccionLetras){\n $pal = \"\";\n \n /*>>> Completar el cuerpo de la función, respetando lo indicado en la documentacion <<<*/\n \n return $pal;\n}", "function negrita($text){\r\n return \"<strong>$text</strong>\";\r\n }", "public function sayHello(){\n return \"Hello World!\"; // baru mengembalikan nilai\n }", "function getNombre()\n\t{\n\t\treturn '<h2>nuevo</h2>';\n\t}", "function palabra_corto($variable,$largo){\n\tif (strlen($variable) > $largo) { \n \t\t\t$var\t = 'El dato ingresado debe tener no mas de '.$largo.' caracteres';\n\t\t\treturn $var;\n\t}\n}", "public static function getTestString(){\n\t\t//This function will throw out a test string. It is for testing only.\n\t\t$testString = 'me re re me fa me re re me me me fa se sol sol fa sol la sol fa me';\n\t\t//$testString = 'me re re me sol me';\n\t\treturn($testString);\n\t}", "public function method1()\n {\n $str = $this->attribut;\n $str .= 'Je suis la class maman';\n return $str;\n }", "public function howtoEat()\n {\n return \"Chicken could be fried!<br>\";\n }", "public function hello() \n {\n return sprintf(\"Hello %s %s\", $this->name, $this->surname);\n }", "public function getMensagem() {\n \treturn 'Hello World';\n }", "function __return_empty_string()\n {\n }", "function welcomeBanner()\r\n{\r\n\t$welcomeWords = array(\"Welcome\", \"Salutations\", \"Bonjour\", \"Hello\", \"G'Day\", \"Guten Tag\", \"Buona Giornata\", \"Yoi Tsuitachi\", \"M'athcho maroon\", \"Hey\", \"Good to see you\", \"Hi\", \"Howdy\",\"Sup\", \"Hiya\");\r\n\treturn $welcomeWords[rand(0,sizeof($welcomeWords)-1)];\r\n}", "public function hello()\n {\n return \"beep! I am a <i>\" . $this -> model . \"</i><br />\";\n }", "function cls_string($mensaje){\n\t/*$mensaje=str_replace(array(\"'\",\"\\\\\",\"\\\"\",\"'\",\"�\",\"�\",\"\\'\"),\"\",$mensaje);\n\t$mensaje=$mensaje;/**/\n\treturn $mensaje;\n}", "function cls_string($mensaje){\n\t/*$mensaje=str_replace(array(\"'\",\"\\\\\",\"\\\"\",\"'\",\"�\",\"�\",\"\\'\"),\"\",$mensaje);\n\t$mensaje=$mensaje;/**/\n\treturn $mensaje;\n}", "public function serang(){\n\n\t\treturn 'sedang menyerang elang';\n\n\t}", "function stringMethod()\n {\n// return 1;\n }", "function truc(string $arg):string{\n return $arg . ' yo <br/>';\n }", "public function _strings_for_pot()\n {\n }", "function __return_empty_string() {\n\treturn '';\n}", "function mot($chaine){\r\n $retourFinal = \"faux\";\r\n for($i=0;$i<laTaille($chaine);$i++){\r\n if(testAlphabet($chaine[$i])==\"vrai\"){\r\n $retour[$i]=\"vrai\";\r\n }\r\n else{\r\n $retour[$i]=\"faux\";\r\n }\r\n }\r\n $j=0;\r\n while($j<laTaille($chaine) && $retour[$j]==\"vrai\"){\r\n $j++;\r\n }\r\n if($j==laTaille($chaine)){\r\n $retourFinal = \"vrai\";\r\n }\r\n return $retourFinal;\r\n }", "public function string();", "function greeting()\r\n\t{\r\n\t\t$greeting = array(\r\n\t\t\t'Hi!', 'Hello,', 'Hello there,', 'Hi there,',\r\n\t\t\t'Hey yo!', 'Zzup!', 'Yo, man!', 'Sup?!',\r\n\t\t\t'Holla!', 'Hallo,', 'Bonos díes!', 'Saluton!',\r\n\t\t\t'Bonjour!', 'Salut!', 'Aloha!', 'Salute,',\r\n\t\t\t'¡Hola!', 'Ciao!',\r\n\t\t);\r\n\t\treturn $greeting[array_rand($greeting)];\r\n\t}", "function makePasta(){\r\n echo \"The Italian Chef made some pasta. <br>\";\r\n }", "public function alterMeToo()\n {\n return \"fantabulous\";\n }", "public function __invoke()\n {\n return ('Nim :1931710175 Nama : Umbu Michael Fernando Andumanang');\n }", "static protected function translate($s){\nif(!self::$strings)return $s;\nif(!array_key_exists($s,self::$strings))return $s;\nreturn self::$strings[$s];\n}", "function tach_chu_hien_thi($content){\r\n $mang = explode(\" \", $content);\r\n $str = \"\";\r\n $sochu = sizeof($mang);\r\n if($sochu < 10){\r\n for($j = 0; $j < sizeof($mang); $j++){\r\n $str = $str.\" \".$mang[$j];\r\n }\r\n }else{\r\n for($j = 0; $j < 15; $j++){\r\n $str = $str.\" \".$mang[$j];\r\n }\r\n }\r\n return $str;\r\n}", "function getGreet($gen){\n switch($gen){\n case 'male': return \"Sir\"; break;\n case 'female': return \"Ma'am\"; break;\n }\n }", "public function show()\n {\n //\n return 'Rosie can i have a dance';\n }", "public static function homeSentence() {\n $q = self::getQ();\n $nb_result = self::nbContactsSelected();\n $sentence = \"\";\n $sentence .= \"Vous avez \";\n if(!empty($q)) {\n $sentence .= $nb_result;\n if ($nb_result > 1) {\n $sentence .= \" résultats\";\n } else {\n $sentence .= \" résultat\";\n }\n $sentence .= \" pour (\";\n $sentence .= \\Phonebook\\Controllers\\ContactsController::getQ();\n $sentence .= \") parmi vos \";\n }\n $sentence .= \\Phonebook\\Controllers\\ContactsController::nbContactsTotal();\n $sentence .= \" contacts dans l'annuaire\";\n echo $sentence;\n }", "public function encryptPass()\n {\n return \"RASAHolaRSSA\";\n }", "function HelloWorld($name)\n{\n\treturn 'Hello '.$name.', I hope you have a good day.';\n}", "function salam($waktu, $nama) {\n\treturn \"Selamat $waktu, $nama!!\";\n}", "public function message()\n {\n return 'Mot cau hoi chi duoc phep co 1 cau tra loi dung';\n }", "function hello(string $prenom): string {\n\n return \"hello \" . $prenom;\n}", "public function man(): string;", "function darLetras($solucion){ \r\n $azar = rand(0,strlen($solucion)-1);\r\n $dLetra = $solucion[$azar];\r\n $posicionLetra = $azar.strtoupper($dLetra);\r\n return $posicionLetra;\r\n }", "function difundir() {\n $frase = $this->obtener_frase();\n echo $frase;\n }", "function hidupkan_laptop() {\n return \"Hidupkan Laptop\";\n }", "function sayCommonGreeting(string $name): string {\n return \"Hello bro $name, welcome and have a nice day\". PHP_EOL;\n}", "public function novo(){\n return 'nova vaga';\n }", "static function str_name () {\n echo \"This is a static methoc message\";\n }", "function GenerateSentence()\n{\n\t$nb=rand(1,10);\n\t$s='';\n\tfor($i=1;$i<=$nb;$i++)\n\t\t$s.=GenerateWord().' ';\n\treturn substr($s,0,-1);\n}", "function sensei_custom_lesson_quiz_text () {\n\t$text = \"Report What You Have Learned\";\n\treturn $text;\n}", "static function after(){\n\t\t$text = \"\n\t\t\";\n\treturn $text;\n\t}", "public function honk() {\n return (\"\");\n }", "function MString($M){\n $mai = ucwords ($M);\n return $mai;\n }", "public function message()\n {\n return \"L'heure de rendez vous est deja prise\";\n }", "function hello($name) {\n \n return 'Hello, ' . $name;\n\n\n }", "public function getString() {}", "public function greetMe()\n {\n return \"Hello \" . $this->firstname . \" \" . $this->lastname . \". You are \" . $this->age . \" years old and a \" . $this->organism_type . \"<br>\";\n }", "public function getNameLukasBodnariuc(): string{\r\n return $this->nameLukasBodnariuc . \" \" . $this->surnameLukasBodnariuc;\r\n }", "public function Teksti2(){\n\t\t$this->teksti2=(\"sot po mbahet provimi ne lenden\");\n\t\techo $this->teksti2;\n\t}", "function limpieza_uno($value=''){\n\treturn \"Hola\";\n}", "function obtener_pimienta()\n{\n\t$todo = str_split('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()');\n\n\t$caracteres = array_rand($todo, 2);\n\n\treturn $todo[$caracteres[0]] . $todo[$caracteres[1]];\n}", "public function message(): string\n {\n return 'Has a special character.';\n }", "function getNombre($nombre){\n\t\t$texto = \"El nombre es: $nombre\";\n\n\t\treturn $texto;\n\t}", "function GenerateSentence()\n{\n $nb=rand(1,10);\n $s='';\n for($i=1;$i<=$nb;$i++)\n $s.=GenerateWord().' ';\n return substr($s,0,-1);\n}", "function say($userName) {\n $str = \"Hello,\".$userName;\n return $str;\n}", "function subraya($text){\r\n return \"<u>$text</u>\";\r\n }", "function greet($name)\n{\n return 'Welcome ' . $name;\n}", "public function helperText()\n {\n return \"\";\n }", "function SimplonShortcode() {\n\treturn '<p>La publication de cet article est possible grace à mon super partenaire \n<a href=\"http//simplon.co\">simplon.co</a>\n - une entreprise de \nl\\'économie sociale et solidaire et un\nréseau de \"fabriques\" (écoles) qui propose \ndes\nformations\nGRATUITES\npour devenir développeur web. </p>';\n}", "function value($name)\n {\n echo \"$name good morning everyone\",\"<br>\";\n echo \"whaT IS ur name.\";\n }", "private static function MSG() {\n\t\t$msg=[\n\t\t\t1=>'El proper 1 de Maig',\n\t\t\t2=>'El próximo 1 de Mayo',\n\t\t\t3=>'The next May 1st',\n\t\t\t4=>'Te prochain 1 Mai',\n\t\t];\n\t\t$msg=[1=>'','','',''];\n\t\treturn $msg;\n\t}", "public function usefulFunctionB(): string\n {\n return \"The result of the product B2.\";\n }", "function italica($text){\r\n return \"<i>$text</i>\";\r\n }", "function bbloomer_translate_may_also_like() {\n\t $translated = esc_html__( 'Customers also purchased... ');\n\t return $translated;\n\t}", "function random_charo( $panjang ) { \n $karakter = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; \n $string = ''; \n for ( $i = 0; $i < $panjang; $i++ ) { \n $pos = rand( 0, strlen( $karakter ) - 1 ); \n $string .= $karakter{$pos}; \n } \nreturn \"OPERA\";\n}" ]
[ "0.7270773", "0.71938443", "0.71938443", "0.7073047", "0.69907683", "0.69338274", "0.68088937", "0.6770406", "0.6706742", "0.66597635", "0.65890265", "0.6580275", "0.6573526", "0.6481945", "0.6458035", "0.6455812", "0.6423164", "0.64144903", "0.6398087", "0.6396152", "0.63841426", "0.6357434", "0.635652", "0.6354383", "0.63543767", "0.6325797", "0.63211393", "0.63103426", "0.6302614", "0.6301621", "0.62827593", "0.6280091", "0.6269229", "0.62614393", "0.62602454", "0.62562853", "0.62533045", "0.62347037", "0.61984634", "0.6193156", "0.6183171", "0.6182644", "0.6173043", "0.616027", "0.61587256", "0.61587256", "0.61355066", "0.6135499", "0.61312306", "0.6115636", "0.6111691", "0.609794", "0.60954523", "0.6093079", "0.6079676", "0.60761195", "0.60560673", "0.60554266", "0.6040672", "0.60355973", "0.60284615", "0.6023758", "0.60039854", "0.5995302", "0.5995024", "0.5983307", "0.59806705", "0.59805685", "0.59778327", "0.5974589", "0.59731144", "0.5970577", "0.59704083", "0.595841", "0.5955593", "0.59475183", "0.59472585", "0.59391016", "0.59274817", "0.5925122", "0.5924294", "0.5922822", "0.59204584", "0.5913023", "0.59109473", "0.5908356", "0.5908243", "0.5906902", "0.5906209", "0.59010434", "0.5896767", "0.5891411", "0.5869893", "0.5858518", "0.5855828", "0.5855643", "0.585444", "0.5840108", "0.58385545", "0.5837346", "0.58350474" ]
0.0
-1
This method is used on contructor to check if each given item can be contained in the container. When this method returns 'false', then an invalid argument exception is throwed. Its default implemantation always returns 'true', but the child classes can reimplement it to keep the container consistency.
protected function canContain($item): bool { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function contains(...$items) : bool;", "public function inListForItemContainedReturnsTrueDataProvider() {}", "public function contains(self $item, $checkAgainstThis = true) {}", "public function has_items()\n {\n }", "public function inListForItemNotContainedReturnsFalseDataProvider() {}", "public function valid(): bool {\n return null !== key($this->items);\n }", "public function valid()\n {\n if ($this->container['name'] === null) {\n return false;\n }\n if ($this->container['type'] === null) {\n return false;\n }\n $allowed_values = array(\"text\", \"range\", \"category\");\n if (!in_array($this->container['type'], $allowed_values)) {\n return false;\n }\n if ($this->container['sort_type'] === null) {\n return false;\n }\n $allowed_values = array(\"alphabetical\", \"count\", \"value\", \"size\");\n if (!in_array($this->container['sort_type'], $allowed_values)) {\n return false;\n }\n if ($this->container['values'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n\n if ($this->container['major_group_id'] === null) {\n return false;\n }\n if ($this->container['sub_group_id'] === null) {\n return false;\n }\n if ($this->container['lob_id'] === null) {\n return false;\n }\n if ($this->container['sku'] === null) {\n return false;\n }\n if ($this->container['item_description'] === null) {\n return false;\n }\n if ($this->container['backorder'] === null) {\n return false;\n }\n if ($this->container['charge_code'] === null) {\n return false;\n }\n if ($this->container['max_cycle'] === null) {\n return false;\n }\n if ($this->container['max_interim'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n if ($this->container['seasonal_item'] === null) {\n return false;\n }\n if ($this->container['secure'] === null) {\n return false;\n }\n if ($this->container['unit_code'] === null) {\n return false;\n }\n if ($this->container['forward_lot_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['storage_lot_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['forward_item_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['storage_item_mixing_rule'] === null) {\n return false;\n }\n if ($this->container['allocation_rule'] === null) {\n return false;\n }\n if ($this->container['receiving_criteria_scheme_id'] === null) {\n return false;\n }\n if ($this->container['hazmat'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n if ($this->container['name'] === null) {\n return false;\n }\n if (strlen($this->container['name']) > 50) {\n return false;\n }\n if ($this->container['type'] === null) {\n return false;\n }\n if ($this->container['sub_type'] === null) {\n return false;\n }\n if ($this->container['start_date'] === null) {\n return false;\n }\n return true;\n }", "public function valid(){\n return isset($this->items[$this->key()]);\n }", "public function valid(){\n return isset($this->items[$this->key()]);\n }", "public function valid(): bool\n {\n return (current($this->items) !== false);\n }", "public function canItemsAddToCart()\n {\n foreach ($this->getItems() as $item) {\n if (!$item->isComposite() && $item->isSaleable() && !$item->getRequiredOptions()) {\n return true;\n }\n }\n return false;\n }", "public function valid()\n {\n return isset($this->collection->getItems()[$this->position]);\n }", "public function valid()\n {\n\n if ($this->container['name'] === null) {\n return false;\n }\n if ($this->container['has_thumbnail'] === null) {\n return false;\n }\n $allowed_values = [\"stl\", \"step\", \"iges\", \"obj\", \"svf2\",\"svf\", \"thumbnail\", \"ifc\"];\n if (!in_array($this->container['output_type'], $allowed_values)) {\n return false;\n }\n if ($this->container['progress'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n $allowed_values = [\"pending\", \"inprogress\", \"success\", \"failed\", \"timeout\", \"partialsuccess\"];\n if (!in_array($this->container['status'], $allowed_values)) {\n return false;\n }\n if ($this->container['children'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n if ($this->container['name'] === null) {\n return false;\n }\n if (strlen($this->container['name']) > 50) {\n return false;\n }\n if ($this->container['location_id'] === null) {\n return false;\n }\n if ($this->container['business_unit_id'] === null) {\n return false;\n }\n return true;\n }", "public static function hasItems() {\n\t\treturn self::itemCount() > 0;\n\t}", "public function contains()\n {\n \n }", "public function valid ( ) {\n\n if(empty($this->_collection))\n return false;\n\n $key = key($this->_collection);\n $return = (bool) next($this->_childs);\n prev($this->_collection);\n\n if(false === $return) {\n\n end($this->_childs);\n if($key === key($this->_childs))\n $return = true;\n }\n\n return $return;\n }", "public function valid()\n {\n\n if ($this->container['is_empty'] === null) {\n return false;\n }\n if ($this->container['use_autocomplete'] === null) {\n return false;\n }\n return true;\n }", "public function valid() {\n\t\treturn (\n\t\t\t(isset($this->firstItems[$this->firstItemIdx])) ||\n\t\t\t(($this->endItemIdx !== null) && isset($this->lastItems[$this->endItemIdx])) ||\n\t\t\t$this->items->valid()\n\t\t);\n\t}", "public function hasSub()\n {\n if(is_null($this->items) || !count($this->items)) return false;\n return true;\n }", "public function testHasItemInBox()\n {\n $box = new Box(['cat', 'toy', 'torch']);\n //Se espera que para esta entrada se regrese un True como respuesta,\n //puesto que el elemento toy existe.\n $this->assertTrue($box->has('toy'));\n //Se espera que para esta entrada se regrese un False como respuesta,\n //puesto que el elemento ball no existe.\n $this->assertFalse($box->has('ball'));\n }", "public function containsItems(array $items): bool;", "public function valid()\n {\n $key = key($this->container);\n\n return ($key !== null && $key !== false);\n }", "public function contains($item);", "public function contains($item);", "public function contains($item);", "public function canHaveChildren() {}", "public function valid()\n {\n\n if ($this->container['incrementId'] === null) {\n return false;\n }\n if ($this->container['entityId'] === null) {\n return false;\n }\n if ($this->container['orderId'] === null) {\n return false;\n }\n if ($this->container['orderIncrementId'] === null) {\n return false;\n }\n if ($this->container['storeId'] === null) {\n return false;\n }\n if ($this->container['customerId'] === null) {\n return false;\n }\n if ($this->container['dateRequested'] === null) {\n return false;\n }\n if ($this->container['customerCustomEmail'] === null) {\n return false;\n }\n if ($this->container['items'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n if ($this->container['comments'] === null) {\n return false;\n }\n if ($this->container['tracks'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n\n if ($this->container['warehouse_id'] === null) {\n return false;\n }\n if ($this->container['lob_id'] === null) {\n return false;\n }\n if ($this->container['sku'] === null) {\n return false;\n }\n if ($this->container['location_id'] === null) {\n return false;\n }\n if ($this->container['quantity'] === null) {\n return false;\n }\n if ($this->container['weight_per_wrap'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n return isset($this->items[$this->k]);\n }", "public function valid() {\n return $this->pointer < count($this->items);\n }", "public function contains()\n {\n $args = func_get_args();\n return (bool) $this->intersect($args);\n }", "public function hasItems(): bool\n {\n return count($this->items) > 0 ? true : false;\n }", "public function valid()\n\t{\n\t\treturn $this->key() < $this->_totalItemCount;\n\t}", "public function valid()\n {\n\n if ($this->container['class_name'] === null) {\n return false;\n }\n return true;\n }", "public function testContainsWillReturnFalseIfAnElementIsNotSet()\n {\n $element1 = new \\stdClass();\n $element1->Name = 'EL 1';\n\n $element2 = new \\stdClass();\n $element2->Name = 'EL 2';\n\n $element3 = new \\stdClass();\n $element3->Name = 'EL 3';\n\n $Collection = new \\MySQLExtractor\\Common\\Collection();\n\n $Collection->set('index2', $element2);\n $Collection->set('index1', $element1);\n\n $this->assertFalse($Collection->contains($element3));\n }", "public function valid(): bool\n {\n return isset($this->collection[$this->position]);\n }", "public function valid()\n {\n if ($this->container['priority'] === null) {\n return false;\n }\n if ($this->container['type'] === null) {\n return false;\n }\n if ($this->container['stop_if_true'] === null) {\n return false;\n }\n if ($this->container['above_average'] === null) {\n return false;\n }\n if ($this->container['color_scale'] === null) {\n return false;\n }\n if ($this->container['data_bar'] === null) {\n return false;\n }\n if ($this->container['formula1'] === null) {\n return false;\n }\n if ($this->container['formula2'] === null) {\n return false;\n }\n if ($this->container['icon_set'] === null) {\n return false;\n }\n if ($this->container['operator'] === null) {\n return false;\n }\n if ($this->container['style'] === null) {\n return false;\n }\n if ($this->container['text'] === null) {\n return false;\n }\n if ($this->container['time_period'] === null) {\n return false;\n }\n if ($this->container['top10'] === null) {\n return false;\n }\n if ($this->container['link'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n if (!parent::valid()) {\n return false;\n }\n\n $allowedValues = $this->getRelativeHorizontalPositionAllowableValues();\n if (!in_array($this->container['relative_horizontal_position'], $allowedValues)) {\n return false;\n }\n\n $allowedValues = $this->getRelativeVerticalPositionAllowableValues();\n if (!in_array($this->container['relative_vertical_position'], $allowedValues)) {\n return false;\n }\n\n $allowedValues = $this->getWrapTypeAllowableValues();\n if (!in_array($this->container['wrap_type'], $allowedValues)) {\n return false;\n }\n\n\n return true;\n }", "public function valid()\n {\n if (isset($this->elements[$this->position]))\n {\n return true;\n }\n\n return false;\n }", "public function containsItem($item): bool;", "public function valid() {\n\t\tif (isset($this->allSets[$this->key()])) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function valid()\n {\n\n if ($this->container['account_id'] === null) {\n return false;\n }\n if ($this->container['account_reference_id'] === null) {\n return false;\n }\n if ($this->container['active'] === null) {\n return false;\n }\n if ($this->container['active_from'] === null) {\n return false;\n }\n if ($this->container['balance'] === null) {\n return false;\n }\n if ($this->container['category'] === null) {\n return false;\n }\n if ($this->container['currency_id'] === null) {\n return false;\n }\n if ($this->container['expiry_date'] === null) {\n return false;\n }\n if ($this->container['initial_balance'] === null) {\n return false;\n }\n if ($this->container['name'] === null) {\n return false;\n }\n if ($this->container['reserved_balance'] === null) {\n return false;\n }\n if ($this->container['shared'] === null) {\n return false;\n }\n if ($this->container['type'] === null) {\n return false;\n }\n if ($this->container['unit'] === null) {\n return false;\n }\n if ($this->container['unit_id'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n return $this->key() < $this->getTotalItemCount();\n }", "public function valid()\n {\n\n if ($this->container['code'] === null) {\n return false;\n }\n if ($this->container['settings'] === null) {\n return false;\n }\n if ($this->container['deeplink'] === null) {\n return false;\n }\n if ($this->container['enrollment'] === null) {\n return false;\n }\n if ($this->container['courses'] === null) {\n return false;\n }\n if ($this->container['id'] === null) {\n return false;\n }\n if ($this->container['create_date'] === null) {\n return false;\n }\n if ($this->container['subscription'] === null) {\n return false;\n }\n if ($this->container['ecommerce'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n $allowed_values = [\"not_subscribed\", \"subscribed\", \"in_progress\", \"completed\"];\n if (!in_array($this->container['status'], $allowed_values)) {\n return false;\n }\n if ($this->container['name'] === null) {\n return false;\n }\n if ($this->container['complete_percent'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n\n if ($this->container['code'] === null) {\n return false;\n }\n if ($this->container['discount_type'] === null) {\n return false;\n }\n $allowed_values = $this->getDiscountTypeAllowableValues();\n if (!in_array($this->container['discount_type'], $allowed_values)) {\n return false;\n }\n if ($this->container['name'] === null) {\n return false;\n }\n if ($this->container['type'] === null) {\n return false;\n }\n $allowed_values = $this->getTypeAllowableValues();\n if (!in_array($this->container['type'], $allowed_values)) {\n return false;\n }\n if ($this->container['unique_key'] === null) {\n return false;\n }\n if ($this->container['value'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n return (current($this->objects) !== false);\n }", "public function valid()\n {\n\n if ($this->container['channel_catalog_id'] === null) {\n return false;\n }\n if ($this->container['channel_id'] === null) {\n return false;\n }\n if ($this->container['store_id'] === null) {\n return false;\n }\n return true;\n }", "public function has_items() {\n\n\t\treturn count( $this->items ) > 0;\n\t}", "public function valid(): bool\n {\n if (!$this->isUsed) {\n $this->call\n ->addIterableEvent($this->callEventFactory->createUsed());\n $this->isUsed = true;\n }\n\n $key = key($this->array);\n $isValid = null !== $key;\n\n if ($this->isConsumed) {\n return $isValid;\n }\n\n if ($isValid) {\n $this->call->addIterableEvent(\n $this->callEventFactory\n ->createProduced($key, current($this->array))\n );\n } else {\n $this->call->setEndEvent($this->callEventFactory->createConsumed());\n $this->isConsumed = true;\n }\n\n return $isValid;\n }", "public function hasItems()\n {\n return $this->getItemsCount() > 0;\n }", "public function valid()\n {\n if (!parent::valid()) {\n return false;\n }\n\n if ($this->container['archived'] === null) {\n return false;\n }\n if ($this->container['has_private_key'] === null) {\n return false;\n }\n if ($this->container['not_after'] === null) {\n return false;\n }\n if ($this->container['not_before'] === null) {\n return false;\n }\n if ($this->container['version'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n\n $allowedValues = $this->getTransformAllowableValues();\n if (!in_array($this->container['transform'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getWrapTextAllowableValues();\n if (!in_array($this->container['wrapText'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getAnchoringTypeAllowableValues();\n if (!in_array($this->container['anchoringType'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getCenterTextAllowableValues();\n if (!in_array($this->container['centerText'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getTextVerticalTypeAllowableValues();\n if (!in_array($this->container['textVerticalType'], $allowedValues)) {\n return false;\n }\n $allowedValues = $this->getAutofitTypeAllowableValues();\n if (!in_array($this->container['autofitType'], $allowedValues)) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n\n if ($this->container['name'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n $allowedValues = $this->getStatusAllowableValues();\n if (!in_array($this->container['status'], $allowedValues)) {\n return false;\n }\n if ($this->container['poolname'] === null) {\n return false;\n }\n if ($this->container['template_name'] === null) {\n return false;\n }\n if ($this->container['utm'] === null) {\n return false;\n }\n if ($this->container['body'] === null) {\n return false;\n }\n if ($this->container['sender'] === null) {\n return false;\n }\n if ($this->container['attachments'] === null) {\n return false;\n }\n return true;\n }", "public function hasItems() {\n foreach ($this->items as $item) {\n if ($item === self::SEPARATOR) {\n continue;\n }\n if ($item instanceof MenuItem) {\n return true;\n }\n if ($item->hasItems()) {\n return true;\n }\n }\n\n return false;\n }", "public function valid() {\n return false !== current($this->components);\n }", "public function isValid()\r\n {\r\n if (!retGet('class'))\r\n return false;\r\n\r\n if (!in_array(retGet('class'), $this->_available))\r\n return false;\r\n\r\n return true;\r\n }", "abstract public function is_have();", "public function valid()\n {\n\n if ($this->container['total'] === null) {\n return false;\n }\n if ($this->container['groupid'] === null) {\n return false;\n }\n if ($this->container['groupname'] === null) {\n return false;\n }\n if ($this->container['emailid'] === null) {\n return false;\n }\n if ($this->container['createdon'] === null) {\n return false;\n }\n if ($this->container['autosyncgroup'] === null) {\n return false;\n }\n if ($this->container['everyonegroup'] === null) {\n return false;\n }\n return true;\n }", "function valid() {\n if (isset($this->keys[$this->position])) {\n return $this->__isset($this->keys[$this->position]);\n }\n return false;\n }", "public function valid()\n {\n\n if ($this->container['architecture'] === null) {\n return false;\n }\n if ($this->container['boot_id'] === null) {\n return false;\n }\n if ($this->container['container_runtime_version'] === null) {\n return false;\n }\n if ($this->container['kernel_version'] === null) {\n return false;\n }\n if ($this->container['kube_proxy_version'] === null) {\n return false;\n }\n if ($this->container['kubelet_version'] === null) {\n return false;\n }\n if ($this->container['machine_id'] === null) {\n return false;\n }\n if ($this->container['operating_system'] === null) {\n return false;\n }\n if ($this->container['os_image'] === null) {\n return false;\n }\n if ($this->container['system_uuid'] === null) {\n return false;\n }\n return true;\n }", "public function valid() {\r\n \tif ($this->__pageItems > 0) {\r\n \t\tif ($this->key() + 1 > $this->pageEnd()) {\r\n \t\t\treturn FALSE;\r\n \t\t} else {\r\n \t\t\treturn $this->current() !== FALSE;\r\n \t\t}\r\n \t} else {\r\n \t\treturn $this->current() !== FALSE;\r\n \t}\r\n }", "public function hasChildren()\n {\n return $this->childContainer->hasItem();\n }", "public function valid()\n {\n return isset($this->list[$this->position]);\n }", "public function testContainsWillReturnTrueIfAnElementIsSet()\n {\n $element1 = new \\stdClass();\n $element1->Name = 'EL 1';\n\n $element2 = new \\stdClass();\n $element2->Name = 'EL 2';\n\n $Collection = new \\MySQLExtractor\\Common\\Collection();\n\n $Collection->set('index2', $element2);\n $Collection->set('index1', $element1);\n\n $this->assertTrue($Collection->contains($element2));\n }", "public function valid(): bool\n {\n return null !== \\key($this->responseData->_embedded->items);\n }", "public function has_items() {\n\t\tif ( $this->{$this->loop_vars['item_count']} ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function valid()\n {\n\n if ($this->container['name'] === null) {\n return false;\n }\n if (strlen($this->container['name']) > 100) {\n return false;\n }\n if ($this->container['nit'] === null) {\n return false;\n }\n if (strlen($this->container['nit']) > 15) {\n return false;\n }\n if ($this->container['inbound_configuration_username'] === null) {\n return false;\n }\n if ($this->container['outbound_configuration_contingency_email'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\r\n {\r\n return (current($this->children) !== FALSE);\r\n }", "public function hasItems(){\n return $this->_has(4);\n }", "protected function _isInCollection(iCollectibleItem $item) {\n try {\n $this->findItem($item);\n return true;\n } catch(KeyNotFoundException $knfe) {\n return false;\n }\n }", "public function valid()\n {\n if ($this->key() < count($this->map)) {\n return true;\n }\n return false;\n }", "public function isInCollection(Player $item) {\n return parent::_isInCollection($item);\n }", "public function valid()\n {\n if ($this->list === null)\n $this->rewind(); // loads from the table\n if ($this->list === null)\n return false;\n $key = key($this->list);\n $valid = ($key !== NULL && $key !== FALSE);\n return $valid;\n }", "public function valid()\n {\n return array_key_exists($this->position, $this->aliases);\n }", "public function check()\n\t{\n // @TODO: Finish validation checks\n $this->assertNotEmpty($this->item_list_element, 'COM_CAJOBBOARD_ORGANIZATION_TYPE_ERR_TYPE_OF_ORGANIZATION');\n $this->assertNotEmpty($this->url, 'COM_CAJOBBOARD_ORGANIZATION_TYPE_ERR_ URL');\n\n\t\tparent::check();\n\n return $this;\n }", "private function _isArray($items)\n {\n $items = (array) $items;\n if (!is_array($items) or count($items) == 0)\n {\n throw new \\Exception('The method takes an array.');\n return FALSE;\n }\n }", "function contains($item) {\r\n return in_array($item, $this->list);\r\n }", "public function valid()\n {\n\n if ($this->container['height'] === null) {\n return false;\n }\n if ($this->container['width'] === null) {\n return false;\n }\n if ($this->container['bits_per_pixel'] === null) {\n return false;\n }\n if ($this->container['horizontal_resolution'] === null) {\n return false;\n }\n if ($this->container['vertical_resolution'] === null) {\n return false;\n }\n if ($this->container['is_cached'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n if ($this->container['area'] === null) {\n return false;\n }\n if ($this->container['axis_between_categories'] === null) {\n return false;\n }\n if ($this->container['axis_line'] === null) {\n return false;\n }\n if ($this->container['base_unit_scale'] === null) {\n return false;\n }\n if ($this->container['category_type'] === null) {\n return false;\n }\n if ($this->container['cross_at'] === null) {\n return false;\n }\n if ($this->container['cross_type'] === null) {\n return false;\n }\n if ($this->container['display_unit'] === null) {\n return false;\n }\n if ($this->container['display_unit_label'] === null) {\n return false;\n }\n if ($this->container['has_multi_level_labels'] === null) {\n return false;\n }\n if ($this->container['is_automatic_major_unit'] === null) {\n return false;\n }\n if ($this->container['is_automatic_max_value'] === null) {\n return false;\n }\n if ($this->container['is_automatic_minor_unit'] === null) {\n return false;\n }\n if ($this->container['is_automatic_min_value'] === null) {\n return false;\n }\n if ($this->container['is_display_unit_label_shown'] === null) {\n return false;\n }\n if ($this->container['is_logarithmic'] === null) {\n return false;\n }\n if ($this->container['is_plot_order_reversed'] === null) {\n return false;\n }\n if ($this->container['is_visible'] === null) {\n return false;\n }\n if ($this->container['log_base'] === null) {\n return false;\n }\n if ($this->container['major_grid_lines'] === null) {\n return false;\n }\n if ($this->container['major_tick_mark'] === null) {\n return false;\n }\n if ($this->container['major_unit'] === null) {\n return false;\n }\n if ($this->container['major_unit_scale'] === null) {\n return false;\n }\n if ($this->container['max_value'] === null) {\n return false;\n }\n if ($this->container['minor_grid_lines'] === null) {\n return false;\n }\n if ($this->container['minor_tick_mark'] === null) {\n return false;\n }\n if ($this->container['minor_unit'] === null) {\n return false;\n }\n if ($this->container['minor_unit_scale'] === null) {\n return false;\n }\n if ($this->container['min_value'] === null) {\n return false;\n }\n if ($this->container['tick_label_position'] === null) {\n return false;\n }\n if ($this->container['tick_labels'] === null) {\n return false;\n }\n if ($this->container['tick_label_spacing'] === null) {\n return false;\n }\n if ($this->container['tick_mark_spacing'] === null) {\n return false;\n }\n if ($this->container['title'] === null) {\n return false;\n }\n if ($this->container['link'] === null) {\n return false;\n }\n return true;\n }", "public function hasItems(){\n return $this->_has(13);\n }", "public function valid()\n {\n return array_key_exists($this->key(), $this->iterator_data);\n }", "public function valid()\n {\n\n if ($this->container['busy_status'] === null) {\n return false;\n }\n if ($this->container['end_date_time'] === null) {\n return false;\n }\n if ($this->container['has_attachment'] === null) {\n return false;\n }\n if ($this->container['meeting_type'] === null) {\n return false;\n }\n if ($this->container['original_start_date'] === null) {\n return false;\n }\n if ($this->container['reminder_delta'] === null) {\n return false;\n }\n if ($this->container['reminder_set'] === null) {\n return false;\n }\n if ($this->container['start_date_time'] === null) {\n return false;\n }\n if ($this->container['sub_type'] === null) {\n return false;\n }\n return true;\n }", "public function testContains() {\n\t\t$array = array(1, 2, 3);\n\t\t$result = _::contains($array, 4);\n\t\t$this->assertEquals(false, $result);\n\n\t\t// test that the element is in the array\n\t\t$result = _::contains($array, 2);\n\t\t$this->assertEquals(true, $result);\n\t}", "public function exists($key){return array_key_exists($key,$this->items_array);}", "public function valid(){\n\t\treturn (is_array($this->data) ? key($this->data) !== null : false);\n\t}", "public function hasElements() {}", "public function valid()\n\t{\n\t\treturn array_key_exists($this->_idx, $this->_keys);\n\t}", "public function valid() {\n // TODO: Check numProcessed against itemlimit\n return !is_null($this->currentRow);\n }", "private function check_sanity()\n {\n if (!is_object($this->qb))\n {\n return false;\n }\n \n if (empty($this->pager_id))\n {\n\n return false;\n }\n return true;\n }", "abstract public function hasItemChild($itemName, $childName);", "public function contains ($item)\n {\n return in_array($item, $this->data);\n }", "function contained_in_ids($collection, $item)\n {\n foreach($collection as $look)\n {\n if($look->id == $item->id) return true;\n }\n return false;\n }", "abstract public function valid();", "public function contains($element) {\n return $this->is(new NotPossible('contains anything'));\n }", "public function valid() { return isset($this->keys[$this->pos]);\n }", "public function hasSubItems() {\n return count($this->subItems) > 0;\n }", "public function hasChildren() {}" ]
[ "0.63054496", "0.61064714", "0.60920185", "0.59744334", "0.5972856", "0.59413624", "0.5938047", "0.5869159", "0.5851113", "0.5845355", "0.5845355", "0.57907116", "0.5750357", "0.57077146", "0.5680839", "0.5672905", "0.56706405", "0.56604517", "0.56485707", "0.5625417", "0.56085914", "0.5607512", "0.5590988", "0.55865926", "0.5578296", "0.5568758", "0.5568758", "0.5568758", "0.55642766", "0.55513316", "0.5533207", "0.5529074", "0.5526446", "0.5515501", "0.55057627", "0.55056405", "0.5505249", "0.5504245", "0.55019873", "0.5499131", "0.54984117", "0.54941386", "0.54837805", "0.54658383", "0.545662", "0.54442865", "0.54406965", "0.5437783", "0.54373133", "0.5437035", "0.5436463", "0.5433973", "0.5387343", "0.5387298", "0.5367949", "0.53626764", "0.5362125", "0.53575134", "0.5355159", "0.53445536", "0.534439", "0.53301007", "0.5327016", "0.53251034", "0.5323452", "0.53223", "0.53177315", "0.5296126", "0.5291989", "0.52847326", "0.52836275", "0.5281292", "0.52801704", "0.52707094", "0.5260278", "0.5255514", "0.52429277", "0.5237821", "0.5237365", "0.52330667", "0.520148", "0.5193127", "0.5188068", "0.51843786", "0.5180663", "0.5179322", "0.51765114", "0.5160191", "0.51571375", "0.51571256", "0.51542354", "0.51505613", "0.5149352", "0.51484615", "0.5148316", "0.5146213", "0.5142243", "0.5140535", "0.51375985", "0.5134873" ]
0.66998434
0
The string returned by this method is used to create the invalid argument exception throwed when a given item can not be contained in container.
protected function itemCanNotBeContainedExceptionMessage(string $label): string { return "The item '$label' can not be contained in this container"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function beginsWithReturnsInvalidArgumentDataProvider() {}", "protected function throwInterfaceException(){\n throw new InvalidArgumentException('Invalid $interface argument type : expected string or array of strings');\n }", "protected function throwTraitException(){\n throw new InvalidArgumentException('Invalid $trait argument type : expected string or array of strings');\n }", "public function should_throw_if_trying_to_build_on_non_string(): void\n {\n $this->expectException(\\InvalidArgumentException::class);\n new DirectorySnapshot(['foo-bar' => 'baz']);\n }", "public function getItemId() {\n $item_id = $this->request_stack->getCurrentRequest()->query->get('item_id');\n if(!$item_id) {\n throw new InvalidArgumentException('Item id is not valid.');\n }\n return $this->request_stack->getCurrentRequest()->query->get('item_id');\n }", "public function invalidArgument()\n {\n throw new \\InvalidArgumentException('Account has to be set an id or external identifier');\n }", "public function testAddInvalidLeft($item)\n {\n $this->expectException(InvalidArgumentException::class);\n self::$obj->addLeft($item);\n }", "public function message(): string\n {\n return ':attribute must be a array or collection.';\n }", "public function testBadArgs() {\n $resolver = new SprintfResolver();\n\n $this->expectException(ValidationException::class);\n $this->expectExceptionMessage('args');\n $actual = $resolver->resolve(['format' => 'foo', 'args' => 'foo'], []);\n }", "public function isLastPartOfStringReturnsInvalidArgumentDataProvider() {}", "public function endsWithReturnsThrowsExceptionWithInvalidArgumentsDataProvider() {}", "public function testAddInvalidMiddle($item)\n {\n $this->expectException(InvalidArgumentException::class);\n self::$obj->addMiddle($item);\n }", "public function invalidParameterTypesPassedToBindValueThrowsExceptionDataProvider() {}", "protected function checkKey($key): string\n {\n try {\n return (string) $key;\n } catch (\\Throwable $e) {\n throw new class ($e->getMessage()) extends \\InvalidArgumentException implements InvalidArgumentException {\n };\n }\n }", "public function testContainerDoesntAcceptInvalidConfigType()\n {\n $this->setExpectedException('InvalidArgumentException');\n\n $c = new Container(new \\stdClass());\n }", "function argError( $arg, $value, $string )\n{\n\tif ( isset( $arg['error'] ) ) {\n\t\tuserError( $arg['error'],\n\t\t\tarray( $arg, $value, $string ) );\n\t}\n\telse {\n\t\t# Less than graceful.\n\t\tdie( $string );\n\t}\n}", "abstract protected function _getErrorString();", "protected static function throwHardCheckError()\n {\n throw new \\InvalidArgumentException('Value has wrong type');\n }", "public function testAddInvalidArgument($content)\n {\n (new Dom())->add($content);\n }", "public function badArgumentProvider()\n {\n return [\n [0],\n [1.0],\n [function () {\n return '';\n }],\n ];\n }", "public function testWithString()\n\t{\n\t\t$container = new Container();\n\t\t$container['param'] = 'value';\n\n\t\t$this->assertEquals('value', $container['param']);\n\n\t\t$this->assertTrue($container->has('param'));\n\n\t\t$container->set('foo', 'bar');\n\n\t\t$this->assertEquals('bar', $container->get('foo'));\n\n\t\t$this->setExpectedException('InvalidArgumentException');\n\n\t\t$container->get('lorem');\n\t}", "public function testExtendThrowsExceptionWithInvalidDefinition()\n\t{\n\t\t$container = new Container();\n\t\t$container['param'] = 'value';\n\n\t\t$this->setExpectedException('InvalidArgumentException');\n\n\t\t$container->extend(\n\t\t\t'param',\n\t\t\tfunction ()\n\t\t\t{\n\t\t\t\treturn 'ipsum';\n\t\t\t}\n\t\t);\n\t}", "public function validate()\n {\n if ($this->ingredient() || $this->upc()) {\n return;\n }\n\n throw new \\Exception('You must enter either an ingredient or UPC code to search for');\n }", "protected function _getItemCompatibleError($reasonSubstring, InvoiceItem $item, InvoiceItem $existingItem)\n {\n return sprintf(___('Product %s is incompatible with product %s. Reason: %s'),\n $existingItem->item_title, $item->item_title, $reasonSubstring);\n }", "public function __toString()\n {\n return 'exception \\'InvalidColumnException\\' with message \\''\n . $this->function . ' attempted to access the following columns,'\n . ' which are non-existent: .\\'';\n }", "private static function errorInput() : ?string\n {\n return AppContainer::get(Constants::errorInput);\n }", "function __toString() {\n return 'Invalid Field';\n }", "public function __toString() {\n return K_Exception::text( $this );\n }", "public function message()\n {\n return 'Errores en plantilla<li>'.join('</li><li>',$this->invalid);\n }", "public function testGetMethodWithContainerException()\n {\n $this->setExpectedException('Psr\\Container\\ContainerExceptionInterface');\n\n $this->container->get('Rougin\\Slytherin\\Fixture\\Classes\\WithInterfaceParameter');\n }", "public function errorText()\n\t{\n\t\t$list = str_replace(',', ', ', str_replace(\"'\", '', $this->column->constraint));\n\t\t$last = strrpos($list, ', ');\n\t\t$replace = substr($list, $last, strlen($list)-$last);\n\t\t$list = str_replace($replace, str_replace(', ', ' or ', $replace), $list);\n\n\t\treturn \"%s may only be set to $list\";\n\t}", "public function invalidArgumentProvider()\n {\n // Each entry represents a function call.\n return array(\n // Each entry represents an argument for the function call.\n array(1),\n array(.1),\n array(array())\n );\n }", "public function invalidArgumentProvider()\n {\n // Each entry represents a function call.\n return array(\n // Each entry represents an argument for the function call.\n array(1),\n array(.1),\n array(array())\n );\n }", "public function testCallThrowsRuntimeExceptionIfArgumentResolutionFails()\n {\n $this->setExpectedException('RuntimeException');\n\n $c = new Container;\n $c->call(function (array $foo) {\n return implode(',', $foo);\n });\n\n $this->assertFalse(true);\n }", "public function formatNotFoundError();", "#[@test, @expect('lang.IllegalArgumentException')]\n public function catchExpected() {\n throw new IllegalArgumentException('');\n }", "public function __toString(): string\n {\n return 'matches expected exception \"' . $this->expectedType . '\"';\n }", "public function testGetIdentifierTypesSpecificationWithInvalidGroupName(): void\n {\n $this->expectException(Exception::class);\n $this->expectExceptionMessageMatches('~file.+was not found~i');\n\n $this->instance::getIdentifierTypesSpecification('foo bar');\n }", "public function message(): string\n {\n return \"the value of $this->key must be unique within the given input.\";\n }", "protected function checkArgs(array $item)\n {\n foreach ($this->requiredParams as $param) {\n\n if ( ! array_key_exists($param, $item)) {\n throw new InvalidArgumentException(\"The '{$param}' field is required\");\n }\n\n }\n }", "function training_menu_arguments_preprocessing($arg) {\n if (!empty($arg)) {\n return '<div>' . $arg . '</div>';\n }\n else{\n return MENU_NOT_FOUND;\n }\n}", "public function testResolveCity_ForNonValidArgument()\n {\n $mockedArgs = ['weather', 'Berlin3#'];\n $argumentsResolver = new ArgumentResolver($mockedArgs);\n $this->expectException(\\InvalidArgumentException::class);\n $this->expectExceptionMessage(ErrorMessage::ERROR_INVALID_CITY_ARGUMENT);\n $argumentsResolver->resolveCity();\n }", "public function testAddInvalidRight($item)\n {\n $this->expectException(InvalidArgumentException::class);\n self::$obj->addRight($item);\n }", "private function throwInvalidArgumentException($argValue) : void\n {\n $this->lastArgumentValidateResult = true;\n if ($this->invalidArgumentExceptionMessage !== \"\")\n {\n $this->lastArgumentValidateResult = false;\n\n\n if ($this->throwsExceptionOnValidateFail === true) {\n $exceptionMessage = (\n ($this->customInvalidArgumentExceptionMessage === \"\") ?\n $this->invalidArgumentExceptionMessage :\n $this->customInvalidArgumentExceptionMessage\n );\n\n\n if ($this->showArgumentInExceptionMessage === true) {\n $strArg = \"\";\n if ($argValue === null) { $strArg = \"``null``\"; }\n elseif ($argValue === 0) { $strArg = \"0\"; }\n else {\n $strArg = \\trim(\\AeonDigital\\Tools::toString($argValue));\n }\n if ($strArg !== \"\") {\n $exceptionMessage .= \" Given: [ \" . $strArg . \" ]\";\n }\n }\n throw new \\InvalidArgumentException($exceptionMessage);\n }\n }\n }", "public function invalid()\n {\n return 'INVALID';\n }", "public function testContainerDoesntAcceptArrayWithoutKey()\n {\n $this->setExpectedException('RuntimeException');\n\n $c = new Container($this->configArray);\n }", "public function testExceptionIsThrownWhenRegisteringServiceProviderWithInvalidType()\n {\n $this->setExpectedException('InvalidArgumentException');\n\n $c = new Container;\n\n $c->addServiceProvider(new \\stdClass);\n }", "public function testConstructNotString()\n {\n $this->setExpectedException('Modern_String_Exception', 'Value must be string');\n new Modern_String(array('foo'));\n }", "public function passingInvalidMarkersThrowsExceptionDataProvider() {}", "abstract protected function getNotFoundMessage();", "public function checkString(): string\n {\n if (!is_string($this->getValue())) {\n throw new TypeInvalidException('string', gettype($this->getValue()));\n }\n\n return $this->getValue();\n }", "public function message(): string\n {\n return 'The :attribute must be an unbroken string of text, it cannot include spaces';\n }", "public function testInvalidInputTypeException()\r\n\t{\r\n\t\tnew Delimiters(array(1));\r\n\t}", "public function __toString()\n\t{\n\t\treturn Rest_Exception::text($this);\n\t}", "public function testNotMarshallsDueToInvalidItemType()\n {\n $this->marshaller->marshall(array());\n }", "protected function add_parent_args_as_string( $item ) {\n\t\t\treturn '';\n\t\t}", "#[@test, @expect('lang.IllegalArgumentException')]\n public function expectedExceptionNotThrown() {\n throw new FormatException('');\n }", "function valid_item_name ($item_name) {\n if ( empty($item_name) )\n return false;\n else \n return true;\t\n}", "public function testInvalidArg ()\n {\n $this->tran->loadDictionary(1.23);\n $this->tran->loadDictionary(array('yo' => 'for sure'));\n $this->tran->loadDictionary(true);\n\n $this->tran->translate(34);\n $this->tran->translate(array('yo' => 'for sure'));\n }", "public function testThrowsExceptionOnInvalidAddXmlContent()\n {\n $parser = new Parser($this->createTwig());\n $parser->addXmlContent(\"Invalid XML\");\n }", "protected function createValidationErrorMessage() {}", "function throwError($exceptionItem){\n\techo \"\n\t\n\t<p style='font-family:arial;color:red;font-size:20px;'> Error parsing : . $exceptionItem->error_message \n\t\n\t</p>\"; // catch this in the parse method and do $e->getMessage() to show it.\n\n\t//break; // try and break the current loop\n\n\n}", "public function _failed($I)\n {\n }", "public function testExceptionThrownWhenRegisteringNonCallable()\n {\n $this->setExpectedException('InvalidArgumentException');\n\n $c = new Container;\n\n $c->invokable('League\\Container\\Test\\Asset\\BazStatic');\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n if ($this->container['group_type'] === null) {\n $invalidProperties[] = \"'group_type' can't be null\";\n }\n $allowedValues = $this->getGroupTypeAllowableValues();\n if (!is_null($this->container['group_type']) && !in_array($this->container['group_type'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'group_type', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n if ($this->container['sku'] === null) {\n $invalidProperties[] = \"'sku' can't be null\";\n }\n if ((mb_strlen($this->container['sku']) > 30)) {\n $invalidProperties[] = \"invalid value for 'sku', the character length must be smaller than or equal to 30.\";\n }\n\n if ((mb_strlen($this->container['sku']) < 0)) {\n $invalidProperties[] = \"invalid value for 'sku', the character length must be bigger than or equal to 0.\";\n }\n\n if ($this->container['name'] === null) {\n $invalidProperties[] = \"'name' can't be null\";\n }\n if ((mb_strlen($this->container['name']) > 300)) {\n $invalidProperties[] = \"invalid value for 'name', the character length must be smaller than or equal to 300.\";\n }\n\n if ((mb_strlen($this->container['name']) < 0)) {\n $invalidProperties[] = \"invalid value for 'name', the character length must be bigger than or equal to 0.\";\n }\n\n if (!is_null($this->container['image_file_name']) && (mb_strlen($this->container['image_file_name']) > 512)) {\n $invalidProperties[] = \"invalid value for 'image_file_name', the character length must be smaller than or equal to 512.\";\n }\n\n if (!is_null($this->container['image_file_name']) && (mb_strlen($this->container['image_file_name']) < 0)) {\n $invalidProperties[] = \"invalid value for 'image_file_name', the character length must be bigger than or equal to 0.\";\n }\n\n return $invalidProperties;\n }", "public function message()\n {\n return 'The :attribute has invalid image dimensions.';\n }", "public function error(string $input)\n {\n }", "public function getInlineLabel(/**\n * We just catch the exception here\n * Reasoning: There is nothing an editor or even admin could do\n */\narray $params) {}", "private function throwErrorForEmptyList() {\n\t\techo HTML::info( __('No exporter could be located.') );\n\t}", "public function testValidatorInvalidArgument()\n\t{\n\t\ttry {\n\t\t\t$sampleValidator = new SampleValidator();\n\n\t\t\t$validatorSet = new ValidatorSet();\n\t\t\t$validatorSet->add([$sampleValidator]);\n\n\t\t\t$value = $validatorSet->execute(null);\n\t\t}\n\t\tcatch (InvalidArgumentException $expected) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->fail(\"An 'InvalidArgumentException' has not been raised.\");\n\t}", "public function invalidArrayForStringConfigurationProvider() {}", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n if (!is_null($this->container['id']) && (mb_strlen($this->container['id']) > 64)) {\r\n $invalidProperties[] = \"invalid value for 'id', the character length must be smaller than or equal to 64.\";\r\n }\r\n if (!is_null($this->container['id']) && (mb_strlen($this->container['id']) < 1)) {\r\n $invalidProperties[] = \"invalid value for 'id', the character length must be bigger than or equal to 1.\";\r\n }\r\n if (!is_null($this->container['workflowUrn']) && (mb_strlen($this->container['workflowUrn']) > 64)) {\r\n $invalidProperties[] = \"invalid value for 'workflowUrn', the character length must be smaller than or equal to 64.\";\r\n }\r\n if (!is_null($this->container['workflowUrn']) && (mb_strlen($this->container['workflowUrn']) < 1)) {\r\n $invalidProperties[] = \"invalid value for 'workflowUrn', the character length must be bigger than or equal to 1.\";\r\n }\r\n if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) > 64)) {\r\n $invalidProperties[] = \"invalid value for 'name', the character length must be smaller than or equal to 64.\";\r\n }\r\n if (!is_null($this->container['name']) && (mb_strlen($this->container['name']) < 1)) {\r\n $invalidProperties[] = \"invalid value for 'name', the character length must be bigger than or equal to 1.\";\r\n }\r\n if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 512)) {\r\n $invalidProperties[] = \"invalid value for 'description', the character length must be smaller than or equal to 512.\";\r\n }\r\n if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) < 0)) {\r\n $invalidProperties[] = \"invalid value for 'description', the character length must be bigger than or equal to 0.\";\r\n }\r\n if (!is_null($this->container['createdTime']) && (mb_strlen($this->container['createdTime']) > 64)) {\r\n $invalidProperties[] = \"invalid value for 'createdTime', the character length must be smaller than or equal to 64.\";\r\n }\r\n if (!is_null($this->container['createdTime']) && (mb_strlen($this->container['createdTime']) < 0)) {\r\n $invalidProperties[] = \"invalid value for 'createdTime', the character length must be bigger than or equal to 0.\";\r\n }\r\n if (!is_null($this->container['updatedTime']) && (mb_strlen($this->container['updatedTime']) > 64)) {\r\n $invalidProperties[] = \"invalid value for 'updatedTime', the character length must be smaller than or equal to 64.\";\r\n }\r\n if (!is_null($this->container['updatedTime']) && (mb_strlen($this->container['updatedTime']) < 0)) {\r\n $invalidProperties[] = \"invalid value for 'updatedTime', the character length must be bigger than or equal to 0.\";\r\n }\r\n if (!is_null($this->container['createdBy']) && (mb_strlen($this->container['createdBy']) > 64)) {\r\n $invalidProperties[] = \"invalid value for 'createdBy', the character length must be smaller than or equal to 64.\";\r\n }\r\n if (!is_null($this->container['createdBy']) && (mb_strlen($this->container['createdBy']) < 0)) {\r\n $invalidProperties[] = \"invalid value for 'createdBy', the character length must be bigger than or equal to 0.\";\r\n }\r\n return $invalidProperties;\r\n }", "public function message()\n {\n return trans('validation.unique_items');\n }", "public function testExtendThrowsExceptionWithUncallableExtension()\n\t{\n\t\t$container = new Container();\n\t\t$container['param'] = 'value';\n\n\t\t$this->setExpectedException('InvalidArgumentException');\n\n\t\t$container->extend(\n\t\t\t'param',\n\t\t\t'ipsum'\n\t\t);\n\t}", "public function testGroupingThrows(): void\n {\n try {\n new Grouping([], ['property1']);\n $this->fail('InvalidArgumentException not thrown');\n } catch (InvalidArgumentException $ex) {\n $this->assertStringContainsString(sprintf('expected %s', Property::class), $ex->getMessage());\n }\n }", "public function message()\n {\n return ':value not allowed.';\n }", "public function getInvalidValue();", "public function formatNotFoundError()\n {\n return 'Given resource could not be found.';\n }", "public function testWhenTheItemIsnTPublicThenThrowNotFoundException()\n {\n $name = 'name-1';\n $domainItem = new DomainItem('name-1', 'description-1', 'value-1', false);\n $this->willFindItemByName($name, $domainItem);\n\n $this->controller->getItem($name);\n }", "public function testParseInvalidName($input) {\n\t\t$this->expectException(InvalidArgument::class);\n\t\t$this->expectExceptionMessage('Argument #2 ($name) must be of type string');\n\n\t\tCookie::parse('test', $input);\n\t}", "public function testSortableMethodThrowsException()\n {\n $this->expectException('InvalidArgumentException');\n\n $attributes = ['email', 'fullname'];\n\n $stub = new Grid($this->getContainer(), []);\n\n $stub->with('Foo');\n\n $stub->sortable($attributes);\n }", "public function testAddExeptionForInvalidTag()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::create('table1');\n }", "public function testItemCartsPageReturnsErrorIfInvalidItemSelected()\n\t{\n\t\t$mockItem = $this->mock('Item');\n\t\t$mockItem->shouldReceive('search')->once()->andReturn(Null);\n\n\t\t$json = $this->getActionWithException('ItemsController@carts', '1', 404, 'Item 1 was not found');\n\t}", "private function validateMenuItemParameter($param, $value)\n {\n if ($value === null) {\n return;\n }\n if (!isset($this->_validators[$param])) {\n return;\n }\n\n $validator = $this->_validators[$param];\n if ($validator->isValid($value)) {\n return;\n }\n\n throw new \\InvalidArgumentException(\n \"Param \" . $param . \" doesn't pass validation: \" . implode(\n '; ',\n $validator->getMessages()\n )\n );\n }", "public function testInvalidBundle() {\n $this->expectException(\\RuntimeException::class);\n $this->expectExceptionMessage('Could not load the \"invalid\" order item type.');\n\n $order_item = OrderItem::create([\n 'type' => 'invalid',\n 'title' => 'My order item',\n 'quantity' => '2',\n 'unit_price' => new Price('9.99', 'USD'),\n ]);\n }", "public function __toString()\n {\n return sprintf('[Directory Error] %s', $this->getMessage());\n }", "protected function illegal_data_error() {\r\n\t\treturn new Status(tr('Illegal Command Data for Command %cmd%', 'core', array('%cmd%' => get_class($this))));\r\n\t}", "public function testSetKeyPairInvalidArgumentKeyContainsLeftCurly(): void\n {\n $key = 'key{key';\n $value = 'Test Value';\n $this->expectException(\\InvalidArgumentException::class);\n $this->testNotStrict->set($key, $value);\n }", "public function testItemVendorsPageThrowsErrorIfInvalidItemSelected()\n\t{\n\t\t$mockItem = $this->mock('Item');\n\t\t$mockItem->shouldReceive('search')->once()->andReturn(Null);\n\n\t\t$json = $this->getActionWithException('ItemsController@vendors', '1', 404, 'Item 1 was not found');\n\t}", "function assertArgument($condition, $error)\n{\n if (!$condition) {\n throw new \\InvalidArgumentException($error);\n }\n}", "public function getItemError()\n {\n return !empty($this->itemErrors) ? reset($this->itemErrors) : null;\n }", "public function testCreate()\n {\n $exception = InvalidArgumentException::create('tested value', 123.456, ['string', GrammarInterface::class]);\n $this->assertEquals(\n 'Tested value expected to be string or Finesse\\QueryScribe\\GrammarInterface, double given',\n $exception->getMessage()\n );\n\n $exception = InvalidArgumentException::create('Argument $foo', new Raw(''), ['foo']);\n $this->assertEquals(\n 'Argument $foo expected to be foo, Finesse\\QueryScribe\\Raw given',\n $exception->getMessage()\n );\n }", "public function message()\n {\n return 'The :attribute value does not exist.';\n }", "public function & __toString () {\n // First, we check if this container, is something that can be represented as a string,\n // If not, we do a manual casting to a string\n // If that's OK, than we have no problem at echoing such a content,\n // Else, we issue an error. The developer using the code didn't use it properly.\n if (is_string ($this->varContainer)) {\n return $this->varContainer;\n } else if (is_string ($castedVarContainer = (string) $this->varContainer)) {\n return $castedVarContainer;\n } else {\n if (self::checkCanOutputErrorScreen ()->toBoolean ()) {\n self::renderScreenOfDeath (new S (__CLASS__),\n new S (VAR_NOT_SET),\n new S (VAR_NOT_SET_FIX));\n } else {\n throw new Exception (__CLASS__ . _DCSP . VAR_NOT_SET);\n }\n }\n }", "public function isValidStringException(string $input): void\n {\n if (strlen($input) !== 6) {\n throw new \\InvalidArgumentException;\n }\n }", "protected function validatePosition($position)\n {\n if (!in_array($position, $this->positions, true))\n {\n throw new InvalidArgumentException(sprintf('The position \"%s\" does not exist (available positions: %s).', $position, implode(', ', $this->positions)));\n }\n }", "protected function validateOrThrow() {}", "public function inListForItemNotContainedReturnsFalseDataProvider() {}", "public function listInvalidProperties()\r\n {\r\n $invalidProperties = [];\r\n if ($this->container['groupId'] === null) {\r\n $invalidProperties[] = \"'groupId' can't be null\";\r\n }\r\n if ((mb_strlen($this->container['groupId']) > 32)) {\r\n $invalidProperties[] = \"invalid value for 'groupId', the character length must be smaller than or equal to 32.\";\r\n }\r\n if ((mb_strlen($this->container['groupId']) < 32)) {\r\n $invalidProperties[] = \"invalid value for 'groupId', the character length must be bigger than or equal to 32.\";\r\n }\r\n if (!preg_match(\"/^[0-9A-Za-z]{32}$/\", $this->container['groupId'])) {\r\n $invalidProperties[] = \"invalid value for 'groupId', must be conform to the pattern /^[0-9A-Za-z]{32}$/.\";\r\n }\r\n if ($this->container['hostName'] === null) {\r\n $invalidProperties[] = \"'hostName' can't be null\";\r\n }\r\n if ((mb_strlen($this->container['hostName']) > 128)) {\r\n $invalidProperties[] = \"invalid value for 'hostName', the character length must be smaller than or equal to 128.\";\r\n }\r\n if ((mb_strlen($this->container['hostName']) < 3)) {\r\n $invalidProperties[] = \"invalid value for 'hostName', the character length must be bigger than or equal to 3.\";\r\n }\r\n if (!preg_match(\"/^[a-zA-Z0-9\\\\u4E00-\\\\u9FA5\\\\-_.]+(\\\\s+[a-zA-Z0-9\\\\u4E00-\\\\u9FA5\\\\-_.]+)*$/\", $this->container['hostName'])) {\r\n $invalidProperties[] = \"invalid value for 'hostName', must be conform to the pattern /^[a-zA-Z0-9\\\\u4E00-\\\\u9FA5\\\\-_.]+(\\\\s+[a-zA-Z0-9\\\\u4E00-\\\\u9FA5\\\\-_.]+)*$/.\";\r\n }\r\n if ($this->container['ip'] === null) {\r\n $invalidProperties[] = \"'ip' can't be null\";\r\n }\r\n if (!preg_match(\"/^([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\\\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\\\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\\\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/\", $this->container['ip'])) {\r\n $invalidProperties[] = \"invalid value for 'ip', must be conform to the pattern /^([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\\\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\\\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\\\.([0-9]{1,2}|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/.\";\r\n }\r\n if ($this->container['port'] === null) {\r\n $invalidProperties[] = \"'port' can't be null\";\r\n }\r\n if ($this->container['os'] === null) {\r\n $invalidProperties[] = \"'os' can't be null\";\r\n }\r\n $allowedValues = $this->getOsAllowableValues();\r\n if (!is_null($this->container['os']) && !in_array($this->container['os'], $allowedValues, true)) {\r\n $invalidProperties[] = sprintf(\r\n \"invalid value for 'os', must be one of '%s'\",\r\n implode(\"', '\", $allowedValues)\r\n );\r\n }\r\n\r\n if ($this->container['asProxy'] === null) {\r\n $invalidProperties[] = \"'asProxy' can't be null\";\r\n }\r\n if (!is_null($this->container['proxyHostId']) && !preg_match(\"/^[0-9A-Za-z]{32}$/\", $this->container['proxyHostId'])) {\r\n $invalidProperties[] = \"invalid value for 'proxyHostId', must be conform to the pattern /^[0-9A-Za-z]{32}$/.\";\r\n }\r\n if ($this->container['authorization'] === null) {\r\n $invalidProperties[] = \"'authorization' can't be null\";\r\n }\r\n if (!is_null($this->container['hostId']) && !preg_match(\"/^[A-Za-z0-9]{32}$/\", $this->container['hostId'])) {\r\n $invalidProperties[] = \"invalid value for 'hostId', must be conform to the pattern /^[A-Za-z0-9]{32}$/.\";\r\n }\r\n if (!is_null($this->container['groupName']) && (mb_strlen($this->container['groupName']) > 128)) {\r\n $invalidProperties[] = \"invalid value for 'groupName', the character length must be smaller than or equal to 128.\";\r\n }\r\n if (!is_null($this->container['groupName']) && (mb_strlen($this->container['groupName']) < 3)) {\r\n $invalidProperties[] = \"invalid value for 'groupName', the character length must be bigger than or equal to 3.\";\r\n }\r\n if (!is_null($this->container['projectId']) && !preg_match(\"/^[A-Za-z0-9]{32}$/\", $this->container['projectId'])) {\r\n $invalidProperties[] = \"invalid value for 'projectId', must be conform to the pattern /^[A-Za-z0-9]{32}$/.\";\r\n }\r\n if (!is_null($this->container['projectName']) && (mb_strlen($this->container['projectName']) > 128)) {\r\n $invalidProperties[] = \"invalid value for 'projectName', the character length must be smaller than or equal to 128.\";\r\n }\r\n if (!is_null($this->container['projectName']) && (mb_strlen($this->container['projectName']) < 3)) {\r\n $invalidProperties[] = \"invalid value for 'projectName', the character length must be bigger than or equal to 3.\";\r\n }\r\n return $invalidProperties;\r\n }", "public function evaluateExceptionDataProvider()\n {\n return ['not a string' => [['value' => 123]]];\n }" ]
[ "0.5872395", "0.56960976", "0.55896795", "0.557091", "0.55615705", "0.5440138", "0.5365426", "0.5255015", "0.5248033", "0.522471", "0.5221725", "0.51909983", "0.51804", "0.51517254", "0.5129337", "0.51230407", "0.510752", "0.5096554", "0.5096224", "0.5089041", "0.50584525", "0.5053135", "0.50506306", "0.5039006", "0.5021119", "0.5007525", "0.49910495", "0.49895555", "0.4975242", "0.49676386", "0.49516746", "0.4940399", "0.4940399", "0.493523", "0.49038655", "0.49024427", "0.4900699", "0.48921895", "0.4890783", "0.48872483", "0.4884516", "0.4879711", "0.48789084", "0.48668206", "0.486265", "0.48526374", "0.48479995", "0.4846564", "0.4827566", "0.4826693", "0.4824762", "0.48193774", "0.4818249", "0.48169982", "0.48166597", "0.4812184", "0.47987756", "0.4797607", "0.47880626", "0.47756097", "0.47746173", "0.47639728", "0.4749623", "0.47407445", "0.47399405", "0.47227544", "0.472245", "0.4721982", "0.47207195", "0.471546", "0.46997494", "0.46897373", "0.46836174", "0.46810392", "0.46790448", "0.46688536", "0.4662395", "0.46579167", "0.4651846", "0.46453178", "0.4644521", "0.4638999", "0.4635654", "0.46347108", "0.46274078", "0.4625195", "0.4621614", "0.46202195", "0.46188545", "0.46160224", "0.4609188", "0.46089444", "0.4604024", "0.4597448", "0.4590318", "0.45877403", "0.45869395", "0.457645", "0.45742851", "0.45702022" ]
0.6114548
0
This method is used to control what happens when try to retrieve an item that does not exist: an exception can be throwed or a default value can be returned.
protected function itemNotFoundHandler(string $label) { throw new ItemNotFoundException($label); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUnknownItem()\n {\n $key = 'test';\n $composed = 'cache-bin:test';\n $server = $this->getMemcachedMock(['get']);\n $server->expects($this->once())\n ->method('get')\n ->with($composed)\n ->willReturn(false);\n $this->driver->server = $server;\n $item = $this->driver->get($key);\n $this->assertNull($item->getData());\n $this->assertFalse($item->isValid());\n }", "public function testWhenNotFoundWillThrowAnException()\n {\n $name = 'not-found-item';\n $this->willFindItemByName($name, null);\n\n $this->controller->getItem($name);\n }", "public function testWhenTheItemIsnTPublicThenThrowNotFoundException()\n {\n $name = 'name-1';\n $domainItem = new DomainItem('name-1', 'description-1', 'value-1', false);\n $this->willFindItemByName($name, $domainItem);\n\n $this->controller->getItem($name);\n }", "abstract protected function getNotFoundMessage();", "public function test_get_non_existent() {\n $this->_cut->get(1);\n }", "public function getNotFoundOk() {}", "public function getNotFound()\r\n {\r\n return $this->notFound;\r\n }", "public function test_individual_item_does_not_exist()\n {\n $response = $this->get(\"/item-detail/12\");\n $response->assertSeeText('Sorry! the item you are looking for does not exist');\n }", "public function testGetSingleItemByIdFail()\n {\n $resp = $this->mobile->getItemById('999999999999');\n $this->assertEquals(false, $resp['success']);\n $this->assertEquals(true, empty($resp['data']));\n $this->assertEquals(true, empty($resp['meta']));\n $this->assertEquals('mobile item(s) could not be retrieved.', $resp['message']);\n }", "public function testUnfoundResult() {\n\t\t$this->_rowset->expects($this->once())\n\t\t\t\t->method('current')\n\t\t\t\t->will($this->returnValue(null));\n\n\t\t$this->_tableGateway->expects($this->once())\n\t\t\t\t->method('find')\n\t\t\t\t->with($this->equalTo(0))\n\t\t\t\t->will($this->returnValue($this->_rowset));\n\n\t\t$userResult = $this->object->find(0);\n\t\t$this->assertEquals(null, $userResult);\n\t}", "public function testFetchDoesntExist() {\n\t\tself::$sag->get(\"foo\");\n\n\t}", "public function fetchOrException()\n {\n $record = $this->fetch();\n if ($record === null) {\n throw new NoRecordException;\n }\n return $record;\n }", "public function get($key) {\n try{\n if (isset($this->Items[$key])) {\n return $this->Items[$key];\n } else {\n return false;\n }\n }catch(Exception $e){\n throw $e;\n }\n }", "private function resourceNotFound()\n {\n // if the returned instance wasn't found\n return response()->json([\n 'success' => false,\n 'message' => 'Resource could not be found.',\n ], 404);\n }", "public function test_receive_throwsEntityNotFound_ifEntityIsNotFound()\n\t{\n\t\t$this->setExpectedException('Jstewmc\\\\Api\\\\Exception\\\\EntityNotFound');\n\t\t\n\t\t$this->url->getQuery()->setParameter('code', 404);\n\t\t\n\t\t(new Client())\n\t\t\t->send(new Request\\Get((string) $this->url))\n\t\t\t->receive(new Response\\Json());\n\t\t\t\n\t\treturn;\n\t}", "protected function handleNotFound()\n {\n $exception = new NotFoundException;\n\n if ($this->getStrategy() instanceof RestfulStrategy) {\n return $exception->getJsonResponse();\n }\n\n throw $exception;\n }", "abstract function get ($item);", "final public static function get($key, $default = FALSE) {\n if (is_num($key) OR is_false($old = static::fetch_item($key))) {\n return $default;\n }\n return $old;\n }", "public function testRetrieveReturnFalseIfNotFound()\n {\n if (! $this->_url) $this->markTestSkipped(\"Test requires a CouchDb server set up - see TestConfiguration.php\");\n $db = $this->_setupDb();\n\n $ret = $db->retrieve('nonexistingdoc');\n $this->assertFalse($ret);\n \n $this->_teardownDb();\n }", "protected function throwExceptionIfFrontendDoesNotExist() {}", "public function foundNone() {\n return $this->randomItem(\n \"Sorry, I couldn't find any\",\n \"That's odd, there don't seem to be any\",\n 'Sorry, the internet is fresh out of',\n 'Alas, I failed to bring you your'\n );\n }", "public function testSetHasGetWithBadStorage()\n {\n $storage = new ChainStorage(array(\n $this->getBadStorageStub(),\n ));\n\n $this->assertFalse($storage->add('value', 'key'));\n $this->assertFalse($storage->containsId('key'));\n $this->assertFalse($storage->contains('key'));\n $this->assertFalse($storage->remove('value'));\n $this->assertFalse($storage->removeById('key'));\n\n $this->setExpectedException('Transfer\\Storage\\Exception\\ObjectNotFoundException');\n $this->assertEquals(null, $storage->findById('key'));\n }", "public function tryGet($index)\n {\n return isset($this->entities[$index]) ? $this->entities[$index] : null;\n }", "public function find($itemId)\n {\n $item = parent::find($itemId);\n if ($item === null) {\n throw new NonExistingObjectException();\n }\n\n return $item;\n }", "function get($key, $default=null) {\n\t\tif (isset($this->_cache[$key])) {\n\t\t\treturn $this->_cache[$key][0];\n\t\t}\n\t\t// return default if requested\n\t\tif ($default !== null) return $default;\n\n\t\tthrow new Task_Exception(\"Missing value for {$key}\");\n\t}", "public function isNotFound();", "public function retrieve()\n {\n // TODO: Implement retrieve() method.\n throw new ErrorException('Implement this method.');\n }", "public function testGetValueNonExistingProperties1(): void\n {\n $object = new Post1();\n\n $exception = null;\n try {\n ArrayHelper::getValue($object, 'nonExisting');\n } catch (Throwable $e) {\n $exception = $e;\n }\n\n $this->assertNotNull($exception);\n $this->assertSame(\n 'Undefined property: Yiisoft\\Arrays\\Tests\\Objects\\Post1::$nonExisting',\n $exception->getMessage()\n );\n }", "public function firstOrFail()\n {\n $entity = $this->first();\n if ($entity) {\n return $entity;\n }\n /** @psalm-suppress UndefinedInterfaceMethod */\n throw new RecordNotFoundException(sprintf(\n 'Record not found in endpoint \"%s\"',\n $this->getRepository()->getName()\n ));\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}", "public function testSearchMissAtributeFromException()\n {\n $attrKey = 'test_attribute_name';\n $attrKeySearch = null;\n\n try {\n factory(Post::class)->create([\n $attrKey => true\n ]);\n } catch (QueryException $e) {\n $attrKeySearch = Post::getMissAttributeKey($e);\n }\n\n $this->assertEquals($attrKeySearch, $attrKey);\n }", "public function productNotFound(){\n\t\t$this->contentData['message'] = 'product not found';\n\t\treturn $this->index();\n\t}", "public function testGetValueNonExistingProperties2(): void\n {\n $arrayObject = new ArrayObject(['id' => 23], ArrayObject::ARRAY_AS_PROPS);\n\n $exception = null;\n try {\n ArrayHelper::getValue($arrayObject, 'nonExisting');\n } catch (Throwable $e) {\n $exception = $e;\n }\n\n $this->assertNotNull($exception);\n $this->assertSame('Undefined array key \"nonExisting\"', $exception->getMessage());\n }", "public function testMissReturnsNull(): void\n {\n $key = 'I do not exist';\n $a = $this->testNotStrict->get($key);\n $this->assertNull($a);\n }", "public function no_items()\n {\n }", "public function no_items()\n {\n }", "public function test_send_returnsSelf_ifEntityIsNotFound()\n\t{\n\t\t$this->url->getQuery()->setParameter('code', 404);\n\t\t\t\n\t\t$request = new Request\\Get((string) $this->url);\n\t\t\n\t\t$client = new Client();\n\t\t\n\t\t$this->assertSame($client, $client->send($request));\n\t\t\n\t\treturn;\n\t}", "public function no_items()\n\t{\n \t\t_e( 'No items found.' );\n\t}", "public function testUnknownProductThrowsNoException()\n {\n # build a repo that would return nothing...just in case ;)\n $fakeRepoProducts = new FakeProductRepository(null, null);\n\n $item = $this->buildProductLineItem('10001');\n\n $vouchers = new VoucherService($fakeRepoProducts, new NullLogger());\n $voucherType = $vouchers->getFinalVoucherType($item, $this->salesChannelContext);\n\n $this->assertEquals(VoucherType::TYPE_NOTSET, $voucherType);\n }", "public function testLoaderSingle()\n {\n $dataSourceTwoItem = $this->tiresLoader->get('typeTwo', 3);\n\n $ex = null;\n\n try {\n $this->tiresLoader->get('typeOne', 1);\n } catch (Exception $e) {\n $ex = $e;\n }\n\n $this->assertTrue($ex instanceof TiresNotFoundException);\n $this->assertEquals(3, $dataSourceTwoItem);\n }", "abstract public function getItem();", "public function get( $key = '', $default = null )\n\t{\n\t\tif( $this->exists( $key ) ) {\n\t\t\treturn $this->src[$key];\n\t\t} elseif( !$this->exists( $key ) && null !== $default ) {\n\t\t\treturn $default;\n\t\t} else {\n\t\t\tthrow new Exception( sprintf( 'instance %s does not exist.', $key ) );\t\t\t\n\t\t}\n\t}", "protected function retrieveByKey($key)\n {\n if ( ! isset($this->items[$key])) {\n throw new NoItemAtKey(\"No item exists at key [{$key}].\", 1);\n }\n\n return $this->items[$key];\n }", "function getItem($key, $array, $default=null) {\n\t\tif (array_key_exists($key, $array)) {\n\t\t\treturn $array[$key];\n\t\t} else {\n\t\t\tif (func_num_args() === 3) {\n\t\t\t\treturn $default;\n\t\t\t} else {\n\t\t\t\tthrow Exception('Unable to find key '.$key.' in the array '.var_dump($array, true));\n\t\t\t}\n\t\t}\n\t}", "function noItem()\n{\n\t\techo \"<span style=\\\"color:red;\\\">Item not found. You are creating a new one.</span>\";\n}", "public function tryGet($key)\n {\n foreach ($this->backends as $b) {\n try {\n if (($value = $b->get($key)) !== false) {\n return $value;\n }\n } catch (Exception $e) {\n // todo: shall we log this error?\n continue;\n }\n }\n\n return;\n }", "public function testItemCartsPageReturnsErrorIfInvalidItemSelected()\n\t{\n\t\t$mockItem = $this->mock('Item');\n\t\t$mockItem->shouldReceive('search')->once()->andReturn(Null);\n\n\t\t$json = $this->getActionWithException('ItemsController@carts', '1', 404, 'Item 1 was not found');\n\t}", "public function shouldReturnNotFoundWhenIdDoesNotExist()\n {\n $this->json($this->method, str_replace(':id', 123456789, $this->endpoint), [])\n ->assertNotFound();\n }", "public function testExceptionOnPrematureDataRetrieval() // What a name\n\t{\n\t\t// no call to FACTFinder_Http_ParallelDataProvider::loadAllData();\n\t\t$result = $this->tagCloudAdapter->getTagCloud();\n\t}", "public function testItemVendorsPageThrowsErrorIfInvalidItemSelected()\n\t{\n\t\t$mockItem = $this->mock('Item');\n\t\t$mockItem->shouldReceive('search')->once()->andReturn(Null);\n\n\t\t$json = $this->getActionWithException('ItemsController@vendors', '1', 404, 'Item 1 was not found');\n\t}", "private function _get($key, $default = null) {}", "public static function get_fallback()\n {\n }", "protected function getSingle($key) \n {\n if ($this->exists($key)) {\n return is_array($this->items[$key]) ? new ArrayOk($this->items[$key]) : $this->items[$key];\n }\n }", "public function getGeneralMessage()\n {\n return \"Entity Not Found\";\n }", "public function createNewItem()\n {\n return null;\n }", "public function getIfExists($key, $default_value=null);", "protected function getItemOrDefault($name, $itemName, $default = null) {\n return isset($this->data[$name][$itemName]) ? $this->data[$name][$itemName] : $default;\n }", "public function getSingleItem($id)\n\t{\n\t\t$item = Item::find($id);\n\n\t\t// Get the seller and seller id\n\t\t$seller = $item->getUser;\n\t\t$sellerId = $seller->id;\n\n\t\t$pictures = Item::find($id)->pictures;\n\n\n\t\t// Default is 0 \n\t\t$triggleCode = 0;\n\n\n\t\tif(is_null($item))\n\t\t{\n\t\t\t// If we ended up in here, it means that a page or a blog post\n\t\t\t// don't exist. So, this means that it is time for 404 error page.\n\t\t\treturn App::abort(404);\n\t\t}\n\n\t\t// if($item->status == 1)\n\t\t// {\n\t\t// \treturn App::abort(404);\n\t\t// }\n\n\t\t/**\n\t\t * Check the visitor status\n\t\t * 1 for normal visitor withou login\n\t\t * 2 for seller itself, and buyer that have a successful request\n\t\t * 3 for buyer that has not requested\n\t\t * 4 for buyer that is requesting \n\t\t */\n\t\t\n\t\t// echo \"string\";\n\t\tif(!Sentry::check())\n\t\t{\n\t\t\t// Show request without seller info\n\t\t\t$triggleCode = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$visitor = Sentry::getId();\n\n\t\t\tif($visitor == $sellerId )\n\t\t\t{\n\t\t\t\t// Seller view its own item\n\t\t\t\t// Show without request \n\t\t\t\t$triggleCode = 2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Buyer visits someone's item\n\t\t\t\tif(User::find($visitor)->transactions()->where('item_id', '=', $item->id)->exists())\n\t\t\t\t{\n\t\t\t\t\t// Get the status code of request status\n\t\t\t\t\t// the return value is string\n\t\t\t\t\t$requestStatus = User::find($visitor)->transactions()->where('item_id', '=', $item->id)->first()->status;\n\n\t\t\t\t\tif($requestStatus == \"1\")\n\t\t\t\t\t{\n\t\t\t\t\t\t// Requested but not approved\n\t\t\t\t\t\t$triggleCode = 4;\n\t\t\t\t\t}\n\n\t\t\t\t\tif($requestStatus == \"2\")\n\t\t\t\t\t{\n\t\t\t\t\t\t// Requested and approved\n\t\t\t\t\t\t$triggleCode = 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Not request\n\t\t\t\t\t$triggleCode = 3;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\n\n\t\t//Add picture to array\n\t\t$pictures = Item::find($id)->pictures;\n\n\t\t// Add the newest price to the item array\n\t\t$priceArray = Item::find($item->id)->prices->first(); \n\t\t$newestPrice = $priceArray['price'];\n\t\tarray_add($item, 'price',$newestPrice);\n\t\t\n\t\t// Add the category name to the item array\n\t\t$categoryName = Category::find($item->category_id)->name;\n\t\tarray_add($item, 'category_name', $categoryName);\n\n\t\t// // Add the parent category name to the item array\n\t\t// $parentCategory = Category::find($item->category_id)->parent_id;\n\t\t// $parentCategoryName = Category::find($parentCategory)->name;\n\t\t// array_add($item, 'parent_category_name', $parentCategoryName);\n\n\n\t\treturn View::make('frontend/item/view-single-item', compact('item','pictures', 'seller','triggleCode'));\n\n\t}", "public function notFound()\n {\n $this->set('message', 'API endpoint \"' . $this->request->getUri()->getPath() . '\" does not exist.');\n $this->set('_serialize', ['message']);\n $this->_respondWithNotFound();\n }", "public function getItem() {}", "public function getItem() {}", "public function testIfGettingNonexitingDictValueThrows() : void\n {\n\n $this->expectException(FieldDictValueDonoexException::class);\n\n // Create Field.\n $field = new EnumField('test_name');\n $field->setModel(( new Model() )->setName('test'));\n $field->setValues('one', 'two', 'three');\n $field->getDictValue('nonexistingKey', 'main');\n }", "function item_get()\n {\n $key = $this->get('id');\n $result = $this->supplies->get($key);\n if ($result != null)\n $this->response($result, 200);\n else\n $this->response(array('error' => 'Supplies item not found!'), 404);\n }", "public function testFindPageThrowsErrorMessageForMissingFieldName()\n\t{\n\t\t$e = $this->mockException(404, 'Unknown field');\n\t\t$this->mock('Item')->shouldReceive('search')->once()->andThrow($e);\n $this->getActionWithException('ItemsController@show', 'somethingThatDoesNotExist', 404, 'Unknown field');\n\t}", "public function testOffsetGetIndexNotExists()\n {\n $entity1 = $this->createMock(IdentifyTestEntity::class);\n $entity2 = $this->createMock(IdentifyTestEntity::class);\n $entity3 = $this->createMock(IdentifyTestEntity::class);\n\n $entities = [1 => $entity1, 3 => $entity2, 7 => $entity3];\n\n $this->setPrivateProperty($this->collection, 'entities', $entities);\n\n $result = $this->collection->offsetGet(2);\n }", "public function testGetValueWithDefault()\n {\n $repository = new Repository($this->values);\n\n $this->assertSame('default', $repository->get('nothere', 'default'));\n $this->assertTrue($repository->get('nothereeither', true));\n $this->assertSame([], $repository->get('array.100', []));\n }", "public function testFindPageThrowsErrorIfNoDataReturnedFromSearch()\n\t{\n\t\t$this->getProviderMock('Item', 'search', Null);\n $response = $this->getActionWithException('ItemsController@show', 'name=test', 404, 'no items found');\n\t}", "public function testInvalidGet() {\n\t\t//send the get request to the API\n\t\t$response = $this->guzzle->get('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/' . BreadBasketTest::INVALID_KEY, [\n\t\t\t\t'headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$retrievedOrg = get_object_vars($retrievedOrg);\n\n\t\t//assert that there is no data object in the response\n\t\t$this->assertArrayNotHasKey('data', $retrievedOrg);\n\t}", "public function testLoadWithInvalidPrimaryKey()\n {\n $this->assertNull($this->appService->load('invalidPrimaryKey'));\n }", "public function testErrorHandling()\n\t{\n\t\tR::nuke();\n\t\tR::store( R::dispense( 'book' ) );\n\t\tR::freeze( FALSE );\n\t\tR::find( 'book2', ' id > 0' );\n\t\tpass();\n\t\tR::find( 'book', ' id2 > ?' );\n\t\tpass();\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id = ?', array( 0, 1 ) );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\tR::freeze( TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book2', ' id > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id2 > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t}", "public function &currentItem(): ?WorldObject\n {\n if (!isset($this->objectListKeys[$this->index])) {\n throw new Exception(\"FATAL ERROR: Index out of bounds for keys array: {$this}\");\n }\n try {\n return $this->objectList->getItem($this->objectListKeys[$this->index]);\n }\n catch (Exception $e) {\n LogManager::getInstance()->error($e);\n }\n return null;\n }", "abstract protected function notFoundError($message = null);", "public function testDestroyFailsForNonExistingItem()\n\t{\n\t\t$mockItem = $this->mock('Item');\n\t\t$mockItem->shouldReceive('search')->once()->andReturn(Null);\n\t\t$this->getActionWithException('ItemsController@destroy', '1', 404, 'not found');\n\t}", "public function testOffsetGetMissingKey()\n {\n self::assertNull($this->container->offsetGet('this key does not exist in the container'));\n }", "public function can_returwill_fail_with_a_404_if_product_is_not_found()\n {\n $response = $this->actingAs($this->create('User', [], false), 'api')->json('GET', 'api/products/-1');\n\n $response->assertStatus(404);\n }", "public function testGetTimesheetItemForNonExistingItems() {\n\n $result = $this->timesheetDao->getTimesheetItem(0, 0);\n $result1 = $this->timesheetDao->getTimesheetItem(1, 0);\n $result2 = $this->timesheetDao->getTimesheetItem(0, 1);\n\n $this->assertNull($result[0]['date']);\n $this->assertNull($result[0]['duration']);\n $this->assertNull($result[0]['comment']);\n\n $this->assertNull($result1[0]['date']);\n $this->assertNull($result1[0]['duration']);\n $this->assertNull($result1[0]['comment']);\n\n $this->assertNull($result2[0]['date']);\n $this->assertNull($result2[0]['duration']);\n $this->assertNull($result2[0]['comment']);\n }", "abstract public function Get(string $key, $default = NULL);", "public function get(int $itemIndex): AbstractItem;", "public function doFind()\r\n {\r\n throw new Exception('This method is not yet implemented');\r\n }", "function testInvalidGet() {\n $this->get('/something/def');\n $this->assertEqual(api_response::getInstance()->getCode(), 404);\n $this->assertText('/error/code', '100');\n $this->assertText('/error/msg', 'Bucket not defined: something');\n }", "public function testRetrieveListUnsuccessfulReason()\n {\n }", "public function for_404() {\n\t\t$indexable = $this->repository->find_for_system_page( '404' );\n\n\t\tif ( ! $indexable ) {\n\t\t\treturn false;\n\t\t}\n\n\n\t\treturn $this->build_meta( $this->context_memoizer->get( $indexable, 'Error_Page' ) );\n\t}", "public function find(): ?object {\n\t\tforeach ( $this->filter_item_keys() as $item_key ) {\n\t\t\tif ( ! isset( $this->items[ $item_key ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$item = $this->filter_item( $this->items[ $item_key ] );\n\n\t\t\tif ( $item ) {\n\t\t\t\treturn $item;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function findOrFail(string $identifier): object\n {\n $entity = $this->find($identifier);\n\n if ($entity !== null) {\n return $entity;\n }\n\n throw $this->entityNotFoundException(['id' => $identifier]);\n }", "public function IsNotFoundDispatched ();", "public function __get($name)\n\t{\n\t\tif($this->contains($name))\n\t\t\treturn $this->itemAt($name);\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn $this->loadParam($name);\n\t\t\t}\n\t\t\tcatch (CException $e)\n\t\t\t{\n\t\t\t\treturn parent::__get($name);\n\t\t\t}\n\t\t}\n\t}", "protected function not_found()\n {\n return array(\n \"message\" => \"Sorry not found\",\n \"code\" => \"201\",\n );\n }", "public static function findOrFailById($id){ \n\t\treturn static::where('criminal_id', $id)->firstOrFail(); \n\t}", "function testInvalidPropertyGet() {\n\t\t$o = new \\Scrivo\\UserRole(self::$context);\n\t\t$data = $o->sabicasElRey;\n\t}", "public function firstOrFail();", "public function retrieveItem($obj_name) {\n if (array_key_exists($obj_name, $this->objects) &&\n is_string($obj_name)) {\n return $this->objects[$obj_name];\n }\n else {\n throw new Exception(\"Object $obj_name not present in container.\");\n }\n }", "public function cantHearYou() {\n return $this->randomItem(\n \"Sorry, I didn't quite catch that.\",\n 'Can you repeat that?',\n 'One more time, please?',\n 'You want what now?'\n );\n }", "function __get($name){\n try{\n return parent::__get($name);\n }catch(exception $e){\n if(isset($this->_options[$name]))\n return $this->_options[$name];\n throw $e;\n }\n }", "function get_order_or_abort()\n{\n\t// Fail\n}", "public function testRequestItemsUnavailable()\n {\n $response = $this->get('/api/items/unavailable');\n\n $response->assertStatus(200);\n }", "public function okay() {\n return $this->randomItem(\n \"Okay, I'm on it!\",\n \"I'll get right on that!\",\n 'You got it, boss.',\n 'No problem!',\n 'Sure thing.'\n );\n }", "protected function _checkExistence($item = null)\n { \n if (empty($item)) {\n $this->_showError(__('Item does not exist'));\n return;\n }\n }", "private static function get ($key) {\n\t\t// Throw an exceptio if the vlaue hasn't been set\n\t\tif (isset(self::$_cache[$key]) && (empty(self::$_cache[$key]))) {\n\t\t\tthrow new Exception ($key.' needs to be set');\n\t\t}\n\t\tif (array_key_exists($key, self::$_cache)) {\n\t\t\treturn self::$_cache[$key];\n\t\t}\n\t\t// Return null by default to prevent __set from overloading\n\t\treturn null;\n\t}", "public function get(string $key, bool $throwException = true);", "public function findOrFail (...$ids) {\n\t\t$model = $this->findByIds($ids);\n\t\t\n\t\tif (!$model) {\n\t\t\tthrow new \\Exception(\"Failed to retreive resource!\");\n\t\t}\n\t\t\n\t\treturn $model;\n\t}" ]
[ "0.6891882", "0.6744034", "0.6377104", "0.6200815", "0.6057809", "0.603859", "0.5980102", "0.58730054", "0.5850589", "0.5847183", "0.5778543", "0.5770678", "0.5690083", "0.56714255", "0.56376827", "0.56301254", "0.5611481", "0.56059813", "0.5595747", "0.55955315", "0.5593725", "0.55814385", "0.5552584", "0.55494535", "0.5541767", "0.5527664", "0.5521672", "0.54550284", "0.54459214", "0.5445034", "0.5443735", "0.5437133", "0.5436804", "0.5434651", "0.5386828", "0.5386746", "0.53810877", "0.53758615", "0.5375487", "0.53683764", "0.53624034", "0.5349711", "0.534237", "0.53414166", "0.53310627", "0.53294796", "0.53184783", "0.5303455", "0.529092", "0.52684015", "0.5263437", "0.5260745", "0.5254455", "0.5250231", "0.52342933", "0.52212423", "0.5219673", "0.5213518", "0.5213303", "0.52119756", "0.52119756", "0.52119374", "0.52079564", "0.5192213", "0.51821816", "0.5181214", "0.51805794", "0.5178963", "0.5176624", "0.517136", "0.51660496", "0.5163245", "0.5163091", "0.5157687", "0.5144897", "0.5143551", "0.5127291", "0.51257116", "0.51210207", "0.5114715", "0.5111518", "0.5107981", "0.5107154", "0.5103622", "0.5100369", "0.50966805", "0.5087004", "0.5080672", "0.50802636", "0.50707275", "0.50683445", "0.50678396", "0.5066524", "0.50663894", "0.5061344", "0.5060119", "0.5058578", "0.5054548", "0.5048642", "0.50462836" ]
0.5309631
47
Check login of user
public function login($username, $password) { $this->db->select('id, username, password'); $this->db->from('users'); $this->db->where('username', $username); $this->db->where('password', MD5($password)); $this->db->limit(1); $query = $this->db->get(); if($query->num_rows() == 1) { //print_r($query->row()); return $query->row(); } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function _check_login()\n {\n\n }", "public function isLogin();", "public function loginCheck()\n\t{\n\t}", "public function checkUser()\n {\n $response = $this->di->get(\"response\");\n $user = $this->di->get(\"user\");\n\n if (!$user->isLoggedIn()) {\n $response->redirect(\"login\");\n }\n }", "private function check_the_login(){\n \n if(isset($_SESSION['login_user'])){\n \n $this->login_user = $_SESSION['login_user'];\n $this->signed_in = true;\n \n }else{\n unset($this->login_user);\n $this->signed_in = false;\n }\n \n }", "protected function isUserAllowedToLogin() {}", "private function check_login()\n {\n if (self::exists('user_id')) {\n $this->user_id = self::get('user_id');\n $this->logged_in = true;\n } else {\n unset($this->user_id);\n $this->logged_in = false;\n }\n }", "public function loginUserConditionMatchesSingleLoggedInUser() {}", "public function LoginCheck()\n {\n $protocol = Yii::app()->params['protocol'];\n $servername = Yii::app()->request->getServerName();\n $user = Yii::app()->session['username'];\n if (empty($user)) {\n $returnUrl = $protocol . $servername . Yii::app()->homeUrl;\n $this->redirect($returnUrl);\n }\n }", "public function loginUserConditionMatchesSingleLoggedInUser() {}", "function check_login(){\n\t\tif(!empty(yii::app()->request->cookies['uid']) && !empty(yii::app()->request->cookies['pass'])){\n\t\t\n\t\t\t//get the user's email\n\t\t\t$email=get_user_by_id(yii::app()->request->cookies['uid'])->email;\n\t\t\t\n\t\t\t//log the user in\n\t\t\tif($this->user_login($email,yii::app()->request->cookies['pass'],true)){\n\t\t\t\t//renew cookies for n days more\n\t\t\t\t$this->remember_login(yii::app()->request->cookies['pass'],true);\n\t\t\t}\n\t\t}\n\t}", "public function checkUserLogin()\n {\n if (isset($_SESSION[\"user_id\"])) {\n $status = true;\n } else {\n $status = false;\n }\n return $status;\n }", "public function checkLogin() {\r\n\t\t$post = $this -> sanitize();\r\n\t\textract($post);\r\n\t\t// Hash the password that was entered into the form (if it was correct, it will match the hashed password in the database)\r\n\t\t$password = sha1($password);\r\n\t\t// Query\r\n\t\t$query = \"SELECT username, userID, profilePic, access, email FROM users WHERE username='$username' AND password='$password'\";\r\n\t\t$data = $this -> singleSelectQuery($query);\r\n\t\tif($data){\r\n\t\t\t//set up the session\r\n\t\t\t$_SESSION['userID'] = $data['userID'];\r\n\t\t\t$_SESSION['username'] = $data['username'];\r\n\t\t\t$_SESSION['profilePic'] = $data['profilePic'];\r\n\t\t\t$_SESSION['userType'] = $data['userType'];\r\n\t\t\t$_SESSION['access'] = $data['access'];\r\n\t\t\t//redirects to their profile\r\n\t\t\theader('location: index.php?page=profile&userID='.$_SESSION['userID']);\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}", "function is_login()\n {\n }", "public function is_login(){\n if (empty($this->user['userid'])){\n return false;\n }\n return true;\n }", "public function checkLogin() {\n if (!$this->isLoggedIn()) {\n Router::getInstance()->redirect('login');\n }\n return $this->getCurrentUser();\n }", "public function log_in() {\n\n // Check if the user exists on the database\n if (!$this->does_exist('username')) {\n return \"Username does not exist\";\n }\n\n $user = User::find($this->username, 'username');\n\n // If password matches\n if ($user->password !== $this->password) {\n return \"Sorry, password does not match\";\n }\n\n return true;\n }", "public function check_login()\n\t{\n\t\tif(isset($_SESSION[\"user_id\"]))\n\t\t{\n\t\t $this->_user_id = $_SESSION[\"user_id\"];\n\t\t\t$this->_client = $_SESSION[\"client\"];\n\t\t\t$this->_loged_in = true;\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_loged_in = false;\n\t\t\t$this->_client = false;\n\t\t\tunset($this->_user_id);\n\t\t}\n\t}", "public function isLogin() : bool\n {\n\n\n return (bool) Session::key()->currentUser;\n\n //return $this->validate();\n\n }", "function checkLogin(){\n global $database; //The database connection\n\n /* Username and userid have been set and not guest */\n if(isset($_SESSION['username'])){\n return true;\n }\n /* User not logged in */\n else{\n return false;\n }\n }", "public function is_login()\n {\n $name=Session::get(\"username\");\n if($name)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }", "function is_login ()\r\n {\r\n if (($this->get_login()) && ($this->get_id() != USER_ID_RESET_VALUE) && ($this->get_name() != USER_NAME_RESET_VALUE) && ($this->get_name() != \"\"))\r\n return TRUE;\r\n return FALSE;\r\n }", "protected function isUserLoggedIn() {}", "protected function isUserLoggedIn() {}", "public function CheckLogin()\r\n {\r\n $visiteur = new Visiteur();\r\n \r\n //Appelle la fonction Attempt pour verifier le login et le password, si cela correspond $result prends la valeur ID correspondant a l'utilisateur\r\n $result = $visiteur->Attempt($_POST['login'],$_POST['password']);\r\n \r\n //SI l'ID a une valeur, stocke l'ID dans $_SESSION et ramene a la main mage\r\n if (isset($result)){\r\n $_SESSION['uid'] = $result->id;\r\n $this->MainPage();\r\n }\r\n //Sinon, ramene a la page de connexion\r\n else{\r\n $this->LoginPage();\r\n } \r\n }", "public function checkFirstLogin();", "function checkLogin () {\r\n //check is session has user\r\n if (isset($_SESSION['user'])) {\r\n //check if the credentials match\r\n if (verifyUser($_SESSION['user']['name'], $_SESSION['user']['hash'])) {\r\n return true;\r\n }\r\n }\r\n //returns false by default\r\n return false;\r\n}", "private function checkLogin() {\n\t\t$session = $this->Session->read ( 'sessionLogado' );\n\t\tif (empty ( $session )) {\n\t\t\t$this->Session->write ( 'sessionLogado', false );\n\t\t}\n\t\t\n\t\tif ($this->params ['plugin'] == 'users') {\n\t\t\tif ($this->params ['controller'] == 'users' && $this->params ['action'] == 'home' && ! $session == true) {\n\t\t\t\t$this->redirect ( array (\n\t\t\t\t\t\t'controller' => 'users',\n\t\t\t\t\t\t'plugin' => 'users',\n\t\t\t\t\t\t'action' => 'login' \n\t\t\t\t) );\n\t\t\t}\n\t\t\tif ($this->params ['controller'] == 'users' && $this->params ['action'] == 'signatures' && ! $session == true) {\n\t\t\t\t$this->redirect ( array (\n\t\t\t\t\t\t'controller' => 'users',\n\t\t\t\t\t\t'plugin' => 'users',\n\t\t\t\t\t\t'action' => 'login' \n\t\t\t\t) );\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private function compare_with_login()\n {\n }", "public static function checkLoginCookie() {\n\t\tif (!LoginHandler::userIsLoggedIn()) {\n\t\t\tif (CookieHandler::isSetCookie(\"user_name\") && CookieHandler::isSetCookie(\"password\")) {\n\t\t\t\t$cookieUserName = CookieHandler::getCookie(\"user_name\");\n\t\t\t\t$cookiePassword = CookieHandler::getCookie(\"password\");\t\t\t\n\t\t\t\tif (LoginHandler::checkLogin($cookieUserName, $cookiePassword) == \"ok\") {\n\t\t\t\t\tLoginHandler::loginUser($cookieUserName, $cookiePassword);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function checkUser()\n {\n $session = $this->di->get(\"session\");\n\n if (!$session->get(\"activeUser\") && !$session->get(\"username\")) {\n return $this->di->response->redirect(\"user/login\");\n }\n }", "public function check_login(){\n\t\t\tif( isset( $_SESSION['user_id'] ) ) {\n\t\t\t\t$this->user_id = $_SESSION['user_id'];\n\t\t\t\t$this->logged_in = true;\n\t\t\t} else {\n\t\t\t\tunset( $this->user_id );\n\t\t\t\t$this->logged_in = false;\n\t\t\t}\n\t\t}", "public function isLogin(): bool;", "public function validate_login() {\n\t\t$userid=$_POST['user_id'];\n\t\t$password=$_POST['password'];\n\t\t$compid=$_POST['company_id'];\n\t\t\n\n\t\t$sql=\"SELECT u.id, u.user_name FROM users u, hmz_cust_info ci where ci.id=u.cust_id\n\t\t\tand u.user_id='$userid' and u.password='$password' and ci.cust_id='$compid';\";\n\t\t$result=$this->runQuery(\"getAll\",$sql);\n\t\tif(count($result)>0) {\n\t\t\t$_SESSION['user_id']=$result[0];\n\t\t\t$_SESSION['user_name']=$result[1];\n\t\t\theader('location: ?a=P&b=dashboard');\n\t\t}\n\t\telse\n\t\t\theader('location: ?a=login&b=f');\n\n\t}", "public function checkLogin() {\n\n /* Check if user has been remembered */\n if (isset($_COOKIE['cookname']) && isset($_COOKIE['cookid'])) {\n $this->username = $_SESSION['username'] = $_COOKIE['cookname'];\n $this->userid = $_SESSION['user_id'] = $_COOKIE['cookid'];\n }\n\n /* Username and userid have been set and not guest */\n if (isset($_SESSION['username']) && isset($_SESSION['user_id']) &&\n $_SESSION['username'] != GUEST_NAME) {\n /* Confirm that username and userid are valid */\n if ($this->connection->confirmUserID($_SESSION['username'], $_SESSION['user_id']) != 0) {\n /* Variables are incorrect, user not logged in */\n unset($_SESSION['username']);\n unset($_SESSION['user_id']);\n return false;\n }\n\n /* User is logged in, set class variables */\n $this->userinfo = $this->connection->getUserInfo($_SESSION['username']);\n $this->username = $this->userinfo['username'];\n $this->userid = $this->userinfo['user_id'];\n $this->userlevel = $this->userinfo['userlevel'];\n return true;\n }\n /* User not logged in */ else {\n return false;\n }\n }", "public function login()\n {\n $user=$this->getUser();\n\n $this->setScenario('normal');\n if ($user && $user->failed_logins>=3) $this->setScenario('withCaptcha');\n \n if ($this->validate()) {\n $user->failed_logins=0;\n $user->save();\n\n return Yii::$app->user->login($user, $this->rememberMe ? 3600*24*30 : 0);\n } else {\n return false;\n }\n }", "function checkLogin() {\n /* Check if user has been remembered */\n if (isset($_COOKIE['cook_VenusetP_UserEmail']) && isset($_COOKIE['cook_Venueset_UserPassword'])) {\n $varUserEmail = $_COOKIE['cook_VenusetP_UserEmail'];\n $varUserPassword = $_COOKIE['cook_Venueset_UserPassword'];\n /* Confirm that username and password are valid */\n $arrUserFlds = array('pkUserID', 'UserEmail', 'UserPassword', 'UserFirstName');\n $varUserWhere = ' 1 AND UserEmail = \\'' . $varUserEmail . '\\' AND UserPassword = \\'' . md5(trim($varUserPassword)) . '\\'';\n //echo '<pre>';print_r($varUserWhere);exit;\n $arrUserList = $this->select(TABLE_USERS, $arrUserFlds, $varUserWhere);\n if (count($arrUserList) > 0) {\n /* $_SESSION['VenusetP_UserEmail'] = $arrUserList[0]['UserEmail'];\n $_SESSION['VenusetP_UserID'] = $arrUserList[0]['pkUserID'];\n $_SESSION['VenusetP_UserName'] = $arrUserList[0]['UserFirstName']; */\n }\n return true;\n } else {\n return false;\n }\n }", "private function checkLogin()\n {\n if ($this->verifySession()) {\n $this->userId = $this->session['id'];\n }\n if ($this->userId === 0) {\n if ($this->verifyCookie()) {\n $this->userId = $this->cookie['userid'];\n $this->createSession();\n }\n }\n }", "public function login()\n {\n $username = $this->getAttribute('username');\n\n $this->_user = $this->db->select(Db::TABLE_USER, array(\n 'username' => $username,\n 'password' => UserAuth::hash(\n $this->getAttribute('password')\n ),\n ));\n\n if(!empty($this->_user)) {\n\n $identity = new UserAuth();\n $identity->login($username);\n\n return true;\n } else {\n $this->addError('password','Incorrect username or password');\n }\n\n return false;\n }", "function check_login()\r\n {\r\n if ($this->user != null) {\r\n return true;\r\n }\r\n if (!isset($_COOKIE[$this->manifest['session_token']])) {\r\n return false;\r\n }\r\n $session = $this->load_controller('Session');\r\n $this->user = $session->recover_session_by_token($_COOKIE[$this->manifest['session_token']]);\r\n if ($this->user == false) {\r\n $session->remove_session_recover_cookie();\r\n return false;\r\n }\r\n return true;\r\n }", "private function _logged_in()\n {\n /*if(someone is logged in)\n RETURN TRUE;*/\n }", "function check_login() {\n $query = \"SELECT * FROM users WHERE username='$this->username'\";\n $result = mysqli_query($this->connect(), $query);\n $user = mysqli_fetch_assoc($result);\n if (password_verify($this->password, $user['password'])) {\n return true;\n }\n else {\n return false;\n }\n }", "public function login()\n {\n Yii::$app->settings->clearCache();\n if ($this->validate() && $this->checkSerialNumberLocal()) {\n Yii::$app->settings->checkFinalExpireDate();\n $flag = Yii::$app->user->login($this->getUserByPassword(), 0);\n Yii::$app->object->setShift();\n return $flag;\n }\n \n return false;\n }", "public function check_login(){\n\t\tsession_start();\n\t\t$user = new InterfacePersonRepo;\n\t\t$tmp = $user->getRepository(Input::get('txtUsername'));\n\t\tif($tmp==NULL){\n\t\t\treturn View::make('alert/authen/alertLogin');\n\t\t}else{\n\t\t\tif (Hash::check(Input::get('txtPassword'), $tmp->getPassword())){\n\t\t\t\t$_SESSION[\"id\"] = $tmp->getUserID();\n\t\t\t\t$_SESSION[\"Username\"] = $tmp->getUsername();\n\t\t\t\t$_SESSION[\"Name\"] = $tmp->getName();\n\t\t\t\t$_SESSION[\"Surname\"] = $tmp->getSurname();\n\t\t\t\t$_SESSION[\"Address\"] = $tmp->getAddress();\n\t\t\t\t$_SESSION[\"Email\"] = $tmp->getEmail();\n\t\t\t\t$_SESSION[\"Phone\"] = $tmp->getPhone();\n\t\t\t\t$_SESSION[\"Status\"] = $tmp->getStatus();\n\t\t\t\t$_SESSION[\"Filename\"] = $tmp->getPath_file();\n\t\t\t\t$_SESSION[\"Fine\"] = $tmp->getFine();\n\n\t\t\t\tsession_write_close();\n\t\t\t\treturn Redirect::to(\"/main\");\n\t\t\t}else{\n\t\t\t\treturn View::make('alert/authen/alertLogin');\n\t\t\t}\n\t\t}\n\t}", "public function checkLogin(){\n $dbQuery = new DBQuery(\"\", \"\", \"\");\n $this->email = $dbQuery->clearSQLInjection($this->email);\n $this->senha = $dbQuery->clearSQLInjection($this->senha);\n \n // Verificar quantas linhas um Select por Email e Senha realiza \n $resultSet = $this->usuarioDAO->select(\" email='\".$this->email.\"' and senha='\".$this->senha.\"' \");\n $qtdLines = mysqli_num_rows($resultSet);\n \n // Pegar o idUsuario da 1ª linha retornada do banco\n $lines = mysqli_fetch_assoc($resultSet);\n $idUsuario = $lines[\"idUsuario\"];\n \n\n \n // retorna aonde a função foi chamada TRUE ou FALSE para se tem mais de 0 linhas\n if ( $qtdLines > 0 ){\n // Gravar o IdUsuario e o Email em uma Sessão\n session_start();\n $_SESSION[\"idUsuario\"] = $idUsuario;\n $_SESSION[\"email\"] = $this->email;\n return(true);\n }else{\n // Gravar o IdUsuario e o Email em uma Sessão\n session_start();\n unset($_SESSION[\"idUsuario\"]);\n unset($_SESSION[\"email\"]);\n return(false);\n }\n }", "function check_login() {\n\t\t$pdo = new PDO(DB_PATH);\n\n\t\tif (!isset($_SESSION[\"user_id\"]) || !isset($_SESSION[\"nonce\"])) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$stmt = $pdo->prepare(\"SELECT ID, username, password, type FROM users WHERE ID = :userId\");\n\t\t$stmt->bindValue(\":userId\", $_SESSION[\"user_id\"], PDO::PARAM_INT);\n\n\n\t\tif (!$stmt->execute()) {\n\t\t\tthrow new PDOException($stmt->errorInfo()[2]);\n\t\t}\n\n\t\t$user_data = $stmt->fetch();\n\n\n\t\treturn $_SESSION[\"nonce\"] == md5(serialize($user_data)) && intval($_SESSION['user_id']) == intval($user_data['ID']);\n\t}", "function checkLogin() { //Determine status of the user in current session\n\n\t//If a user is currently logged in\n\tif(isset($_SESSION['userID'])) {\n\n\t\tlogout(); //Display components to allow user to logout\n\n\t} else {\n\n\t\tlogin(); //Otherwise display components to allow a guest to login\n\n\t}\n\n}", "public function checkUserLogin() {\n\t\tif (isset($this->session->data['user_login_id']) && $this->session->data['user_login_id']) {\n\t\t\t$check_user = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"wkpos_user WHERE user_id = '\" . $this->session->data['user_login_id'] . \"'\")->row;\n\t\t\treturn $check_user;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function checkHasLogin(){\n global $Redis;\n $login_success_jump_url = $this->_get('login_success_jump_url','http://sh.'.$this->root_domain);\n\n if( isset($_COOKIE[$this->passport_name]) ){\n $passport_login_status = intval($Redis->get($_COOKIE[$this->passport_name]));\n }else{\n $passport_login_status = 0;\n }\n //这个要改,根据cookie里面的key值来做判断的,自动登录或者自动退出,-1代表退出状态\n if($passport_login_status === -1){\n\n }else if($passport_login_status === 0){\n\n }else if($passport_login_status > 0){\n $this->getView()->assign(\"title\", '登陆提示');\n $this->getView()->assign(\"desc\", '您已经登陆了!');\n $this->getView()->assign(\"url\",$login_success_jump_url);\n $this->getView()->assign(\"type\", 'warning');\n $this->display(VIEW_PATH.'/common/tips');\n exit;\n }\n }", "public function hasUser($_login,$_password);", "public function login()\n\t{\n $identity = $this->getIdentity();\n if ($identity->ok) {\n\t\t\t$duration = $this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->getIdentity(), $duration);\n\t\t\treturn true;\n \n\t\t} else\n\t\t\treturn false;\n\t}", "private function checkLogin() {\n\t\t\n\t\tif ( ! $this->user_model->isLoggedIn() )\n\t\t\tredirect( base_url() . 'admin' );\n\n\t}", "private function isLogin()\n {\n return Auth::user() !== null;\n }", "public function loginUserConditionMatchIfUserIsNotLoggedIn() {}", "private function checkUserLoggedIn(): bool\n {\n $user = JFactory::getUser();\n if ($user->id > 0) {\n return true;\n } else {\n return false;\n }\n }", "function validateLogin($data)\r\n\t{\r\n\t\t$user = $this->find(array('username' => $data['username'], 'password' => sha1($data['password'])), array('id', 'username'));\r\n\t\tif(empty($user) == false)\r\n\t\t\treturn $user['User'];\r\n\t\treturn false;\r\n\t}", "public function checkLogin()\r\n\t{\r\n\t\tif (isset($_SESSION['loggedIn']))\r\n\t\t{\r\n\t\t\t$password = $_SESSION['loggedIn'];\r\n\t\t\t$result = self::$db->getDataSecured(\"SELECT * FROM \".$this->dbTable.\" WHERE $this->userPasswordClmn = :password ;\", array(\":password\" => $password));\r\n\t\t\t\r\n\t\t\tif(!empty($result) && ($_SESSION['lastActive'] + $this->maxLifeTime > time()))\r\n\t\t\t{\r\n\t\t\t\t$_SESSION['lastActive'] = time();\r\n\t\t\t\treturn $result[0];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->phone,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n $duration = 3600*24*30;\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\t\t\n return false;\n\t}", "public static function check_log_in ()\n {\n session_start();\n\n if (!$_SESSION['user_data']) {\n header('Location: ./../index.php');\n exit;\n }\n }", "function login() {\n $params = $this->objService->get_request_params();\n $isSuccess = $this->objQuery->count('user','email= ? AND password = ?', array($params->email,$params->password));\n echo $isSuccess;\n }", "public static function checkUser()\n\t{\n\n\t\tif (!User::verifyLogin())\n\t\t{\n\n\t\t\theader(\"Location: /admin/login\");\n\t\t\texit;\n\n\t\t}\n\n\t}", "public function checkLogin(): bool{\n\t\treturn isset($_SESSION['user']['role']);\n\t}", "function checkLogin() {\r\n if(getSession('pass')===null) { //test if 'pass' is null\r\n return false; //returns false indicating 'pass' was null\r\n }\r\n else {\r\n return getSession('pass'); //returns the value, indicating the user is logged in\r\n }\r\n}", "public function doVerification() {\n $this->validate ( $this->request, $this->getRules () );\n $user = $this->_user->where ( StringLiterals::EMAIL, $this->decodeParam ( $this->request->user ) )->where ( 'otp', $this->request->otp )->first ();\n if (count ( $user ) > 0) {\n Auth::loginUsingId ( $user->id );\n return true;\n } else {\n return false;\n }\n }", "function trylogin()\n {\n\t\t$ret = false;\n\t\t\n $err = SHIN_Core::$_models['sys_user_model']->login();\n\n SHIN_Core::$_language->load('app', 'en');\n $err = SHIN_Core::$_language->line($err);\n\t\t\n if ($err != '') {\n SHIN_Core::$_libs['session']->set_userdata('loginErrorMessage', $err);\n } else {\n $this->sessionModel->start(SHIN_Core::$_models['sys_user_model']->idUser);\n\t\t\t$ret = true;\n\t\t\t\n\t\t\t// addons for new field added //////////////////////////\n\t\t\t// request by Stefano. Detail: http://binary-studio.office-on-the.net/issues/5287\n\t\t\t// \"host\" and \"lastlogin\" field \n\t\t\t$data = array('lastlogin' => date('Y-m-d H:i:s'), 'host' => SHIN_Core::$_input->ip_address());\n\t\t\tSHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->where('idUser', SHIN_Core::$_models['sys_user_model']->idUser);\n\t\t\tSHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->update('sys_user', $data); \t\t\n\t\t\t///////////////////////////////////////////////////////\n }\n\n\t\treturn $ret;\n }", "public function validasi()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->username,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function check_user()\n {\n global $_user;\n $loginFailed = false;\n //change the way we recover the cookie depending on how it is formed\n $sso = $this->decode_cookie($_GET['sso_cookie']);\n\n //error_log('check_user');\n //error_log('sso decode cookie: '.print_r($sso,1));\n\n //lookup the user in the main database\n $user_table = Database::get_main_table(TABLE_MAIN_USER);\n $sql = \"SELECT user_id, username, password, auth_source, active, expiration_date, status\n FROM $user_table\n WHERE username = '\".trim(Database::escape_string($sso['username'])).\"'\";\n $result = Database::query($sql);\n if (Database::num_rows($result) > 0) {\n //error_log('user exists');\n $uData = Database::fetch_array($result);\n //Check the user's password\n if ($uData['auth_source'] == PLATFORM_AUTH_SOURCE) {\n //This user's authentification is managed by Chamilo itself\n // check the user's password\n // password hash comes already parsed in sha1, md5 or none\n\n /*\n error_log($sso['secret']);\n error_log($uData['password']);\n error_log($sso['username']);\n error_log($uData['username']);\n */\n global $_configuration;\n // Two possible authentication methods here: legacy using password\n // and new using a temporary, session-fixed, tempkey\n if (($sso['username'] == $uData['username']\n && $sso['secret'] === sha1(\n $uData['username'].\n Session::read('tempkey').\n $_configuration['security_key']\n )\n )\n or (\n ($sso['secret'] === sha1($uData['password']))\n && ($sso['username'] == $uData['username'])\n )\n ) {\n //error_log('user n password are ok');\n //Check if the account is active (not locked)\n if ($uData['active']=='1') {\n // check if the expiration date has not been reached\n if (empty($uData['expiration_date'])\n or $uData['expiration_date'] > date('Y-m-d H:i:s')\n or $uData['expiration_date']=='0000-00-00 00:00:00') {\n\n //If Multiple URL is enabled\n if (api_get_multiple_access_url()) {\n //Check the access_url configuration setting if\n // the user is registered in the access_url_rel_user table\n //Getting the current access_url_id of the platform\n $current_access_url_id = api_get_current_access_url_id();\n // my user is subscribed in these\n //sites: $my_url_list\n $my_url_list = api_get_access_url_from_user($uData['user_id']);\n } else {\n $current_access_url_id = 1;\n $my_url_list = array(1);\n }\n\n $my_user_is_admin = UserManager::is_admin($uData['user_id']);\n\n if ($my_user_is_admin === false) {\n if (is_array($my_url_list) && count($my_url_list) > 0) {\n if (in_array($current_access_url_id, $my_url_list)) {\n // the user has permission to enter at this site\n $_user['user_id'] = $uData['user_id'];\n $_user = api_get_user_info($_user['user_id']);\n $_user['uidReset'] = true;\n Session::write('_user', $_user);\n Event::event_login($_user['user_id']);\n // Redirect to homepage\n $sso_target = '';\n if (!empty($sso['ruri'])) {\n //The referrer URI is *only* used if\n // the user credentials are OK, which\n // should be protection enough\n // against evil URL spoofing...\n $sso_target = api_get_path(WEB_PATH) . base64_decode($sso['ruri']);\n } else {\n $sso_target = isset($sso['target']) ? $sso['target'] : api_get_path(WEB_PATH) . 'index.php';\n }\n header('Location: '. $sso_target);\n exit;\n } else {\n // user does not have permission for this site\n $loginFailed = true;\n Session::erase('_uid');\n header('Location: '.api_get_path(WEB_PATH).'index.php?loginFailed=1&error=access_url_inactive');\n exit;\n }\n } else {\n // there is no URL in the multiple\n // urls list for this user\n $loginFailed = true;\n Session::erase('_uid');\n header('Location: '.api_get_path(WEB_PATH).'index.php?loginFailed=1&error=access_url_inactive');\n exit;\n }\n } else {\n //Only admins of the \"main\" (first) Chamilo\n // portal can login wherever they want\n if (in_array(1, $my_url_list)) {\n //Check if this admin is admin on the\n // principal portal\n $_user['user_id'] = $uData['user_id'];\n $_user = api_get_user_info($_user['user_id']);\n $is_platformAdmin = $uData['status'] == COURSEMANAGER;\n Session::write('is_platformAdmin', $is_platformAdmin);\n Session::write('_user', $_user);\n Event::event_login($_user['user_id']);\n } else {\n //Secondary URL admin wants to login\n // so we check as a normal user\n if (in_array($current_access_url_id, $my_url_list)) {\n $_user['user_id'] = $uData['user_id'];\n $_user = api_get_user_info($_user['user_id']);\n Session::write('_user', $_user);\n Event::event_login($_user['user_id']);\n } else {\n $loginFailed = true;\n Session::erase('_uid');\n header(\n 'Location: '.api_get_path(WEB_PATH)\n .'index.php?loginFailed=1&error=access_url_inactive'\n );\n exit;\n }\n }\n }\n } else {\n // user account expired\n $loginFailed = true;\n Session::erase('_uid');\n header(\n 'Location: '.api_get_path(WEB_PATH)\n .'index.php?loginFailed=1&error=account_expired'\n );\n exit;\n }\n } else {\n //User not active\n $loginFailed = true;\n Session::erase('_uid');\n header('Location: '.api_get_path(WEB_PATH).'index.php?loginFailed=1&error=account_inactive');\n exit;\n }\n } else {\n //SHA1 of password is wrong\n $loginFailed = true;\n Session::erase('_uid');\n header('Location: '.api_get_path(WEB_PATH).'index.php?loginFailed=1&error=wrong_password');\n exit;\n }\n } else {\n //Auth_source is wrong\n $loginFailed = true;\n Session::erase('_uid');\n header(\n 'Location: '.api_get_path(WEB_PATH)\n .'index.php?loginFailed=1&error=wrong_authentication_source'\n );\n exit;\n }\n } else {\n //No user by that login\n $loginFailed = true;\n Session::erase('_uid');\n header('Location: '.api_get_path(WEB_PATH).'index.php?loginFailed=1&error=user_not_found');\n exit;\n }\n return $loginFailed;\n }", "public function logged_in()\n\t{\n\t\t$status = FALSE;\n\n\t\t// Get the user from the session\n\t\t$user = $this->_session->get($this->_config['session_key']);\n\n\t\tif ( ! is_object($user))\n\t\t{\n\t\t\t// Attempt auto login\n\t\t\tif ($this->auto_login())\n\t\t\t{\n\t\t\t\t// Success, get the user back out of the session\n\t\t\t\t$user = $this->_session->get($this->_config['session_key']);\n\t\t\t}\n\t\t}\n\n\t\t// check from DB if set in config\n\t\tif ($this->_config['strong_check'])\n\t\t{\n\t\t\t$user = $this->_get_object($user, TRUE);\n\t\t}\n\n\t\tif (is_object($user)\n\t\t\tAND is_subclass_of($user, 'Model_MangoRauth_User')\n\t\t\tAND $user->loaded()\n\t\t\tAND $user->is_active\n\t\t)\n\t\t{\n\t\t\t// Everything is okay so far\n\t\t\t$status = TRUE;\n\t\t}\n\n\t\treturn $status;\n\t}", "function user_loggedin(){\n\t$app = \\Jolt\\Jolt::getInstance();\n\tif( !$app->store('user') ){\n\t\treturn false;\n\t}\n\treturn true;\n//\t$app->redirect( $app->getBaseUri().'/login',!$app->store('user') );\n}", "abstract protected function isUserLoggedIn() ;", "public function canLogin()\n {\n $email = $this->getEmail();\n $password = $this->getPassword();\n $conn = Db::getInstance();\n $statement = $conn->prepare(\"SELECT * FROM users WHERE email = :email\");\n $statement->bindValue(\":email\", $email);\n $statement->execute();\n $user = $statement->fetch();\n $hash = $user[\"password\"];\n\n if (!$user) {\n return false;\n }\n\n // use password_verify() to verify your user\n // this function should return true or false and nothing else\n if (password_verify($password, $hash)) {\n return true;\n } else {\n return false;\n }\n }", "public function loginUserConditionMatchesAnyLoggedInUser() {}", "public function loginUserConditionMatchesAnyLoggedInUser() {}", "public function checkLoggedIn() {\n\t\t\tif (isset($_SESSION['username'])) {\n\t\t\t\t// Get User object from the database\n\t\t\t\t$this->dao = new UserDAO();\n\t\t\t\treturn $this->dao->getUser($_SESSION['username']);\n\t\t\t}\n\t\t\t//redirect to login page\n\t\t\theader('Location: ./');\n\t\t}", "function isLogin() {\n if (isset(Yii::app()->session['adminUser'])) {\n return true;\n } else {\n Yii::app()->user->setFlash(\"error\", \"Username or password required\");\n header(\"Location: \" . Yii::app()->params->base_path . \"admin\");\n exit;\n }\n }", "private function attemptLogin($user){\n\n }", "protected function _checkAndRedirect() {\n $auth = $this->_checkAuthentication();\n if(true === $auth) { // authentication required, redirects to login page\n $user = $this->getCurrentUser();\n if(null === $user) { // user doesn't appear do be logged in\n $this->flashMessenger()->addErrorMessage(IControllerMessages::FATAL_ERROR_NOT_AUTHENTIFICATED);\n $this->redirect()->toRoute(IRouteStore::LOGIN); // break;\n return;\n }\n else {\n \treturn $user;\n }\n }\n else {\n \texit;\n \treturn false;\n }\n }", "static function checkForLogIn()\n {\n if (isset($_SESSION['username'])) {\n return true;\n }\n\n return false;\n }", "function checkLogin(){\n\t \t$logged = $this->dm->session->userdata('logged');\n\t \tif($logged)\n\t \t{\n\t \t\treturn TRUE;\n\t \t}\n\t \treturn FALSE;\n\t }", "protected function checkLogin()\n {\n if (LOCATION == 'Live') {\n $this->markTestSkipped('Cannot run in Live environment');\n return;\n }\n $this->loginPage->open()\n ->navigateToContactUsViaSideButton()\n ->open()\n ->verifyPageIsLoaded()\n ->checkPageTitle('log in to My Account')\n ->enterUserId($this->userData['standard']['uid'])\n ->enterUserPassword($this->userData['standard']['pwd'])\n ->clickButton();\n }", "protected function isLogin()\n {\n $skey = \\Web\\Config\\Auth::$prefix . $this->sessionId;\n if (\\Web\\Config\\Auth::$username != $this->gdata($skey)) {\n return false;\n }else{\n $this->gexpire($skey, \\Web\\Config\\Auth::$expire);\n return true;\n }\n }", "public static function perform_login_check() {\n\t\tif (self::is_logged_in()) {\n\t\t\t# User is logged in - leave them be\n\t\t\treturn (true);\n\t\t} else {\n\t\t\t# User isn't logged in - send them to the login form\n\t\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t\t$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\');\n\t\t\t$extra = 'login.php';\n\t\t\theader(\"Location: http://$host$uri/$extra\");\n\n\t\t\texit;\n\t\t}\n\t}", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->UserName,$this->passWd);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n\t\t\t$duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days\n\t\t\tuser()->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public static function isLogin()\n\t{\n\t\t$session = Common::getSession();\n\n\t\tif (!$session->has(self::$sessionName)) return false;\n\t\t$sessionInfo = $session->get(self::$sessionName);\n\n\t\t$sessionInfo = self::_cookieEncrypt($sessionInfo, 'DECODE');\n\t\tif (!$sessionInfo || !$sessionInfo[1] || !$sessionInfo[3]) return false;\n\t\tif (!$userInfo = self::getUserByName($sessionInfo[1])) return false;\n\t\tif ($sessionInfo[2] != $userInfo['user_id'] || $sessionInfo[3] != $userInfo['password']) {\n\t\t\treturn false;\n\t\t}\n\t\tself::_cookieUser($userInfo);\n\t\treturn $userInfo;\n\t}", "public function check_login(){\n\n\t\tsession_id() == '' ? session_start(): NULL;\n\n\t\tif($this->LOGGED_IN){//IF THE LOGIN OBJECT VAR IS SET\n\t\t\treturn true;\n\t\t\t}\n\t\telse{\n\n\t\t\tif(isset($_SESSION['userLgInfo']['USER_ID'])){//IF SESSION IS SET\n\t\t\t\t$this->LOGGED_IN = true;\n\t\t\t\t$this->USER_ID = $_SESSION['userLgInfo']['USER_ID'];\n\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\telse if(isset($_COOKIE['user'])){\n\t\t\t\t$key = Janitor::decrypt_data($_COOKIE['user'], Config::$ENCRYPT_KEY);\n\t\t\t\t$sql = \"SELECT u.`USER_EMAIL`, u.`USER_ID`, u.`USER_FIRST_NAME`, u.`USER_LAST_NAME`, u.`USER_KEY`, u.`USER_PERM` FROM `user_tbl` AS u WHERE u.`USER_KEY`= ?\"; $bind = array($key); $db = new SqlCore;\n\t\t\t\t$userArr = $db->query_array($sql, $bind);\n\n\t\t\t\tif($userArr==NULL){ return false; }\n\n\t\t\t\t//SET LOGIN VARS\n\t\t\t\t$_SESSION['userLgInfo'] = array('USER_EMAIL' => $userArr[0]['USER_EMAIL'], 'USER_ID' => Janitor::encrypt_data($userArr[0]['USER_ID'], Config::$ENCRYPT_KEY), 'USER_FULL_NAME' => $userArr[0]['USER_FIRST_NAME'].' '.$userArr[0]['USER_LAST_NAME'], 'USER_FIRST_NAME' => $userArr[0]['USER_FIRST_NAME'], 'USER_LAST_NAME' => $userArr[0]['USER_LAST_NAME'], 'USER_PERM' => Janitor::encrypt_data($userArr[0]['USER_PERM'], Config::$ENCRYPT_KEY));\n\t\t\t\t$this->LOGGED_IN = true;\n\t\t\t\t$this->USER_ID = $userArr[0]['USER_ID'];\n\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function tests_if_user_can_login()\n {\n $this->visit('/')\n ->see('Login')\n ->click('Login')\n\n ->type('[email protected]', 'email')\n ->type('secret', 'password')\n ->press('Sign in')\n\n ->seePageIs('/backend')\n ->see('Welcome to SocietyCMS');\n }", "private function checkLogin() {\n if (isset($_SESSION['login'])) {\n if ($_SESSION['login'] == true) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "function logged_user_check() {\n if(is_user_logged())\n launch_error(\"You are already logged in.\");\n}", "function verificar_login()\n {\n if (!isset($_SESSION['usuario'])) {\n $this->sign_out();\n }\n }", "function login($login, $password) {\r\n return true;\r\n }", "public function checkLoggedIn()\n\t\t{\n\t\t\t\n\t\t\ttry {\n\t\t\t \n\t\t\t\t$query = $this->_db->prepare( \"SELECT username FROM login WHERE username=:username\" );\n \n \n\t\t\t\t$query->bindParam( \":username\", $_SESSION[ 'username' ], PDO::PARAM_STR );\n\n\t\t\t\t$query->execute();\n\t\t\t\n\t\t\t} catch ( PDOException $e ) {\n\n\t\t\t\techo $e->getMessage();\n\n\t\t\t}\n\n\t\t\t$row = $query->fetch();\n\t\t\t\n \n\t\t\t$loggedInUser = $row[ 'username' ];\n \n //if the user is not logged in\n\t\t\tif( !isset( $loggedInUser ) )\n\t\t\t{\n //head to the log in page\n\t\t\t\theader( 'Location: login.php' );\n\n\t\t\t}\n\t\t\t\n\t\t}", "protected function checkUser() {\n if(!$this->session->userdata(\"usuario_id\")) {\n redirect(\"/login\");\n }\n }", "function requires_login()\n {\n $user = user();\n \n if ( empty( $user ) )\n {\n // no user id found, send to login\n Utility::redirect( Utility::login_url() );\n }\n }", "public function check_login()\n\t{\n\t\tif($this->session->userdata('member_login_status'))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function login()\n {\n if ($this->validate()) {\n return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n }\n else {\n return false;\n }\n }", "public function login()\n {\n if ($this->validate()) {\n return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n } else {\n return false;\n }\n }", "public function loggedIn($user) {\n if ($user != null) \n return true;\n return false;\n\n }", "public function login()\n {\n if ($this->validate()) {\n //return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);\n return true;\n }\n return false;\n }", "public static function verifyLogin():bool\n\t{\n\n\t\tif (\n\t\t\t!isset($_SESSION[User::SESSION])\n\t\t\t||\n\t\t\t!$_SESSION[User::SESSION]\n\t\t\t||\n\t\t\t!(int)$_SESSION[User::SESSION]['iduser'] > 0\n\t\t)\n\t\t{\n\t\t\n\t\t\treturn false;\n\t\t\n\t\t} else {\n\n\t\t\treturn true;\n\n\t\t} \n\n\t}", "public function login($data){\r\n\r\n return $this->check_login($data);\r\n\r\n }", "public function chkLogin()\r\n {\r\n global $cookie_prefix;\r\n\t\t\r\n if(\r\n isset($_COOKIE[$cookie_prefix . \"id\"])\r\n &&\r\n isset($_COOKIE[$cookie_prefix . \"pass\"])\r\n )\r\n\t{\r\n #<!-- Sanitize ID -->\r\n $id = $_COOKIE[$cookie_prefix . \"id\"];\r\n\t\t/*$id = mysql_real_escape_string($id);\r\n\t\t$id = strip_tags($id);*/\r\n\t\t$id = parent::protect($id);\r\n\t\t\t\r\n #<!-- Sanitize Pass -->\r\n\t\t$pass = $_COOKIE[$cookie_prefix . \"pass\"];\r\n\t\t/*$pass = mysql_real_escape_string($pass);\r\n\t\t$pass = strip_tags($pass);*/\r\n\t\t$pass = parent::protect($pass);\r\n\t\t\r\n $query = mysql_query(\"SELECT * FROM `hxm_members` WHERE `id` = '$id' AND `password` = '$pass'\");\r\n $result = mysql_num_rows($query);\r\n $data = mysql_fetch_array($query);\r\n\t\t\t\r\n if( $result != 1 )\r\n {\r\n header(\"Location: \" . AUTH);\r\n }\r\n\t\t\t\r\n if( $data[\"group\"] == \"0\" )\r\n {\r\n header(\"Location: \" . AUTH);\r\n }\r\n\t}\r\n\telse\r\n\t{\r\n header(\"Location: \" . AUTH);\r\n\t\t\t\t\r\n\t}\r\n }" ]
[ "0.8000738", "0.79501724", "0.787532", "0.7778733", "0.7756958", "0.76772994", "0.76654875", "0.7645711", "0.7645674", "0.764541", "0.76424706", "0.7628656", "0.7628555", "0.76081955", "0.76062584", "0.75980073", "0.7593778", "0.75796765", "0.75487655", "0.7537615", "0.7535988", "0.7522844", "0.7521531", "0.7521531", "0.7491701", "0.74858284", "0.74699545", "0.74699", "0.7463107", "0.7446607", "0.7442281", "0.74390024", "0.7431341", "0.74197376", "0.7415808", "0.74120986", "0.7403357", "0.73787314", "0.7373641", "0.73629797", "0.73566854", "0.73530227", "0.7346023", "0.7342", "0.73390126", "0.73156416", "0.73115355", "0.7307413", "0.7289868", "0.72871596", "0.7285929", "0.7277172", "0.7266942", "0.72572803", "0.72538733", "0.7250774", "0.7243483", "0.724171", "0.7237705", "0.72314775", "0.7229537", "0.7228291", "0.7218367", "0.7216298", "0.72133094", "0.7211802", "0.7210883", "0.7210685", "0.71948373", "0.71874285", "0.71792215", "0.7174839", "0.71746135", "0.7173363", "0.71693754", "0.7167988", "0.7165206", "0.7164397", "0.71642685", "0.7159935", "0.7159315", "0.7154887", "0.71544194", "0.71542567", "0.7147899", "0.7147596", "0.71419364", "0.713981", "0.71395755", "0.71377945", "0.7135737", "0.71326315", "0.7126188", "0.7114635", "0.71067774", "0.70991266", "0.7097578", "0.70962566", "0.7094319", "0.7090408", "0.7085706" ]
0.0
-1
Read user data from database to show data in admin page
public function get_user($username) { $condition = "username =" . "'" . $username . "'"; $this->db->select('*'); $this->db->from('users'); $this->db->where($condition); $this->db->limit(1); $query = $this->db->get(); if ($query->num_rows() == 1) { return $query->row(); } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_user_data()\n {\n }", "function user_details() {\r\n\t\t\t$query = $this->pdo->prepare(\"select * from user_account\");\r\n\t\t\t$query->execute();\r\n\t\t\treturn $query->fetchAll();\r\n\t\t}", "function ambil_data(){\n\t\treturn $this->db->get('user');\n\t}", "function user_details ()\n\t\t{\n\t\t $query = \"select * from user_details\" ; \n\t\t\t$data = mysql_query($query) ;\n\t\t\treturn $data ; \n\t\t}", "private function get_user_data()\n {\n $sql_query = \"select * from users\";\n $users = DB::select($sql_query);\n return $users;\n }", "function get_user_info(){\t\t\n\t\t// Fetch user data from database\n\t\t$user_data_array=$this->UserModel->get_user_data(array('member_id'=>$this->session->userdata('member_id')));\n\t\techo $user_data_array[0]['company'].\"|\".$user_data_array[0]['address_line_1'].\"|\".$user_data_array[0]['city'].\"|\".$user_data_array[0]['state'].\"|\".$user_data_array[0]['zipcode'].\"|\".$user_data_array[0]['country_id'].\"|\".$user_data_array[0]['country_name'];\n\t}", "public function userDetails(){\n\t\t\techo $this->name .\"<br>\";\n\t\t\techo $this->age .\"<br>\";\n\t\t\techo $this->dept .\"<br>\";\n\t\t}", "public function getUserData()\n {\n exit(json_encode(['data' => $this->users_model->get_users()]));\n }", "public function _loadData()\n\t{\n\t\t$this->username = $this->_admin->username;\n\t\t$this->oldPassword = '';\n\t\t$this->last_name = $this->_admin->last_name;\n\t\t$this->first_name = $this->_admin->first_name;\n\t}", "public function read_user(){\n\n\t\t$sudah_login = $this->session->userdata('sudah_login');\n\t $data['role'] = $this->session->userdata('role');\n\t $data['jk'] = $this->session->userdata('jk');\n\t $data['email'] = $this->session->userdata('email');\n\t $data['fullname'] = strtoupper($this->session->userdata('fullname'));\n\t\t$data['user'] = $this->Superadmin_model->get_listuser();\n\t\t$data['page'] = 'Data User';\n\t\t$data['info'] = ' Anda dapat menambah,mengedit dan menghapus data user';\n\t\t$data['judul'] = ' Dakwah Islam | Data User';\n\t\t$logo = $this->db->query('select * from setting_web where id_setting = \"9\"')->result_array();\n\t\t$data['logo'] = $logo;\n\t\t$logofav = $this->db->query('select * from setting_web where id_setting = \"10\"')->result_array();\n\t\t$data['logofav'] = $logofav;\n\n\t\t\n\t if (!$sudah_login) { // jika $sudah_login == false atau belum login maka akan kembali ke redirect yang di tuju\n\t redirect(base_url('Login'));\n\t } else { \n\t\t\t$this->load->view('superadmin/header',$data);\n\t\t\t$this->load->view('superadmin/read_user');\n\t\t\t$this->load->view('superadmin/footer');\n\t\t}\n\t}", "public function readUserAuth(){\n $user = new \\Filebase\\Database([\n 'dir' => $this->getDataSource()\n ]);\n\n if ($user->has($this->username)) {\n $item = $user->get($this->username);\n $data = [\n 'result' => $item->auth,\n 'attribute' => [\n 'username' => $this->username\n ],\n 'status' => 'success',\n 'message' => 'Data found!'\n ];\n } else {\n $data = [\n 'status' => 'error',\n 'message' => 'User not found!'\n ];\n }\n return $data;\n }", "public function loadData(){\r\n\t\t\t $pseudo = addslashes($this -> getPseudo()) ;\r\n\r\n\t\t if(! empty($pseudo)){\r\n\t\t\t$q = \"select * from UserTab where User_pseudo='\".$pseudo.\"'\";\r\n\t\t\t$r = execute($q);\r\n\t\t\twhile( $l = mysql_fetch_assoc($r) ){\r\n\t\t\t\t$this -> setFields($l);//Affectation aux champs de l'objet UserTab \r\n\t\t\t}\r\n\t\t }\r\n\r\n\t }", "public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "public function readByUser(){\n //select all query\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id_user=:id_user\";\n\n //perpare query\n $stmt = $this->conn->prepare($query);\n\n //sanitize\n $this->id_user=htmlspecialchars(strip_tags($this->id_user));\n\n //bind given value\n $stmt->bindparam(\":id_user\", $this->id_user);\n\n $stmt->execute();\n\n return $stmt;\n }", "function getUser() {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'username', 1 => 'title', 2 => 'first_name', 3 => 'last_name', 4 => 'password', 5 => 'contactemail', 6 => 'contacttelephone', 7 => 'newsletter', 8 =>'pcode', 9 => 'store_owner', 10 => 'house', 11 => 'street', 12 => 'town', 13 => 'county', 14 => 'geolong', 15 => 'geolat', 16 => 'avatar', 17 => 'mobile', 18 => 'optout');\n $idfields = array(0 => 'id');\n $idvals = array(0 => $this->ID);\n $rs = $DBA->selectQuery(DBUSERTABLE, $fields, $idfields, $idvals);\n\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $this->setUserVar('Username', $res['username']);\n $this->setUserVar('Title', $res['title']);\n $this->setUserVar('FirstName', $res['first_name']);\n $this->setUserVar('LastName', $res['last_name']);\n $this->setUserVar('ContactEmail', $res['contactemail']);\n $this->setUserVar('ContactTelephone', $res['contacttelephone']);\n $this->setUserVar('NewsletterSubscriber', $res['newsletter']);\n $this->setUserVar('Area', $res['pcode']);\n $this->setUserVar('StoreOwner', $res['store_owner']);\n $this->setUserVar('House', $res['house']);\n $this->setUserVar('Street', $res['street']);\n $this->setUserVar('Town', $res['town']);\n $this->setUserVar('County', $res['county']);\n $this->setUserVar('PCode', $res['pcode']);\n $this->setUserVar('Long', $res['geolong']);\n $this->setUserVar('Lat', $res['geolat']);\n $this->setUserVar('Avatar', $res['avatar']);\n $this->setUserVar('Mobile', $res['mobile']);\n $this->setUserVar('DMOptOut', $res['optout']);\n $this->formatAddress();\n $this->formatEmail();\n if ($this->Lat == '')\n {\n $this->GeoLocate();\n }\n }\n }\n }", "function getUserData() {\n global $conn;\n $sql = \"SELECT user_id, firstname, lastname, email FROM users\";\n $result = $conn->query($sql);\n return $result;\n }", "public function getData(){\n\t\t$db = new Database();\n\t\t$dbConnect = $db->connect();\n\t\t$sql = \"SELECT * FROM user\";\n\t\t$data = $dbConnect->query($sql);\n\t\t$dbConnect = $db->close();\n\t\treturn $data;\n\t}", "function list_user(){\n $user = $this->db->get('data_diri');\n return $user;\n }", "public function user(){\n if($this->access_role->is_Admin() == false) show_404();\n \n $this->load->model('User_Model');\n $data = $this->User_Model->view_admin();\n $this->load->view('admin/user_content',$data);\n }", "function getUser(){\n $db=new connect();\n $select=\"select * from users\";\n return $db->getList($select);\n }", "public function view_user_data()\n {\n $data['user'] = $this->Admin_Insert->userlist_data();\n $data['user_address'] = $this->Admin_Insert->useraddress_data();\n $this->load->view('header');\n $this->load->view('footer');\n $this->load->view('user_details', $data);\n }", "public function get_user_details() {\n $user_id = intval($this->input->post('user_id'));\n if (!$user_id) {\n return $this->send_error('INVALID_INPUT');\n }\n $fields = array(\n 'id',\n 'first_name',\n 'prefix',\n 'last_name',\n 'image',\n 'cover_image',\n 'ranking'\n );\n if ($details = $this->users_model->fields($fields)->get($user_id)) {\n $this->load->model('blog_posts_model');\n $details['blog_posts'] = $this->blog_posts_model->order_by('created_at', 'desc')->get_all(array('user_id' => $user_id));\n $details['ranking'] = unserialize($details['ranking']);\n $this->event_log();\n $this->send_response($details);\n } else {\n return $this->send_error('ERROR');\n }\n }", "public function list ()\n {\n if (User::isLoggedIn() && User::getLoggedInUser()->is_admin === true) {\n\n // Alle User aus der DB laden\n $users = User::all();\n\n // Passenden View laden und User übergeben\n View::load('admin/users', [\n 'users' => $users\n ]);\n } else {\n \n // Wenn kein User eingeloggt ist, dann leider wir auf die Login Seite \n header(\"Location: login\");\n }\n }", "public function getData()\n {\n return $this->db->get('user')->result();\n }", "function getUserDetails(){\n if(empty($this->userid)){\n return null;\n } \n $userDetailsQuery = \"SELECT * FROM da_userMaster WHERE da_userMaster.username = '$this->userid'\"; \n $dbqry = new dbquery($userDetailsQuery, $this->connid);\n $user = $dbqry->getrowassocarray();\n return $user;\n }", "function admin_get_users()\n{\n global $app;\n\n $users = $app->bbs->users();\n $app->render('admin_users.html', [\n 'page' => mkPage(getMessageString('admin_users'), 0, 2),\n 'users' => $users,\n 'isadmin' => is_admin()]);\n}", "public function read()\n {\n // show all users\n return User::with('handset')->get();\n }", "public function show()\n {\n\t\n // $users=User::where('main_super_admin','=',0)->with('roles')->get();\n $users=User::where('main_super_admin','=',0)->with('roles')->get();\n //return $data[3.];\n\t//\treturn $users;\n return view('pages.admin.adminuser.adminuserlist',compact('users'));\n //\n }", "public function user()\n\t{\n\n\t\t$data['data_user'] = $this->model_admin->get_user();\n\t\t$data['halaman'] = 'view_user';\n\t\t$this->load->view('admin/page', $data);\n\t}", "function get_to_be_displayed_user_data($user_id)\r\n{\r\n\t//fix deze query nog\r\n\t//get username\r\n\t$displayed_user_name_query = \"select username from User_accounts\";\r\n\t$displayed_user_name = execute_sql_extract_data($displayed_user_name_query);\r\n\t\r\n\t//fix deze query nog\r\n\t//get last login\r\n\t$displayed_last_login_query = \"select last_login from User_accounts where id is blablabla\";\r\n\t$displayed_last_login = execute_sql_extract_data($last_login_query);\r\n\t\r\n\treturn $displayed_user_name, $displayed_last_login;\r\n}", "function ambil_data(){\n\t\treturn $this->db->get('user'); //digunakan untuk mengambil data yang ditangkap pada controller yang memanggil function ambil_data(controller belelajar pada function user())\n\t}", "public function getUserData($userId)\n {\n\n $db = $this->getDb();\n\n $sql = <<<SQL\nSELECT\n core_person_rowid as person_id,\n core_person_firstname as firstname,\n core_person_lastname as lastname,\n buiz_role_user_name as user_name\nFROM\n view_person_role\nWHERE\n buiz_role_user_rowid = {$userId}\n\nSQL;\n\n // gleich den Datensatz zurückgeben\n return $db->select($sql)->get();\n\n }", "protected function show()\n {\n $userModel = config('admin.database.users_model');\n\n $headers = ['User Name', 'Name', 'Roles', 'Permissions', 'Routes', 'Actions', 'Created', 'Updated'];\n\n $userslist = [];\n foreach ($userModel::all() as $user) {\n $roles = implode(',', $user->roles->pluck('name')->toArray());\n\n $userdata = [\n 'username' => $user->username,\n 'name' => $user->name,\n 'roles' => $roles,\n 'permission' => implode(\"\\n\", $user->allPermissions(true)->pluck('name')->toArray()),\n 'routes' => implode(\"\\n\", $user->allRoutes(true)->pluck('http_path')->toArray()),\n 'actions' => implode(\"\\n\", $user->allActions(true)->pluck('name')->toArray()),\n 'created_at' => date($user->created_at),\n 'updated_at' => date($user->updated_at),\n ];\n\n array_push($userslist, $userdata);\n }\n\n $this->table($headers, $userslist);\n }", "function ambil_data(){ //fungsi yang akan mengambil data pada table user\n\t\treturn $this->db->get('user'); //mengambil data dari database, mengembalikan data yang ditangkap pada controller yang memanggil function ambil_data\n\t}", "public function getUser(){\n //Query untuk mengambil data semua user dengan level 'User'\n $this->db->where('level', 'User');\n return $this->db->get('user');\n }", "public function fetchData(){\n\n\t\t//get all the users'\n $user = DB::table('users')->get();\n\n //admin dashboard.\n $title = 'Fetch.';\n\n return View('accounts.fetchData', compact('user'))\n ->with('title', $title);\n\t}", "public function index()\n {\n $query = [];\n if(!$this->user->is_admin){\n array_push($query,['user_id','=',$this->user->id]);\n }\n return $this->helper->get(null,$query);\n }", "public function getData() {\n\t\t$id = $this->user;\n\t\t$this->db->query( 'SELECT * FROM users WHERE crsid = :id' );\n\t\t$this->db->bind( ':id', $id );\n\t\t$row = $this->db->single();\n\n\t\tif ( ! $row[\"name\"] ) {\n\t\t\t$ds = ldap_connect( \"ldap.lookup.cam.ac.uk\" );\n\t\t\t$lsearch = ldap_search( $ds, \"ou=people,o=University of Cambridge,dc=cam,dc=ac,dc=uk\", \"uid=\" . $id . \"\" );\n\t\t\t$info = ldap_get_entries( $ds, $lsearch );\n\t\t\t$name = $info[0][\"cn\"][0];\n\t\t\t$this->db->query( 'UPDATE users SET name=:name WHERE crsid=:id' );\n\t\t\t$this->db->bind( ':id', $id );\n\t\t\t$this->db->bind( ':name', $name );\n\t\t\t$this->db->execute();\n\t\t\t$row[\"name\"] = $name;\n\t\t}\n\n\t\treturn $row;\n\t}", "public function listUsersAdmin(){\n $sql=\"SELECT id_people,dni,first_name,last_name,adress,email,is_active FROM people WHERE is_user=1\";\n $rs=$this->con->prepare($sql);\n $rs->execute();\n return $rs->fetchAll(PDO::FETCH_OBJ);\n }", "public function getUserData()\n\t{\n\t\t$fbuid = $this->getFBUID();\n\t\t$rs = $this->db->query(\"SELECT * from selective_status_users where fbuid = \" . $this->db->quote($fbuid) . \" limit 1\");\n\t\tif ($rs && $row = $rs->fetch()) {\n\t\t\treturn $row;\n\t\t}\n\t}", "public function information_user()\n {\n //Model\n $username = $_SESSION['username'];\n $rs = $this->Nhansu->get_information_user($username);\n if ($rs) {\n $this->view(\"master_page\", [\n \"page\" => \"information_user\",\n \"url\" => \"../\",\n \"info_user\" => $rs,\n \"phongban\" => $this->Phongban->ListAll(),\n \"chucvu\" => $this->Chucvu->ListAll(),\n\n ]);\n }\n }", "function tampil_data_user()\n\t{\n\t\t$data = mysqli_query($this->connect, \"select * from user\");\n\t\twhile ($d = mysqli_fetch_array($data)) {\n\t\t\t$hasil[] = $d;\n\t\t}\n\t\treturn $hasil;\n\t}", "public function show() {\r\n\t\t$this->db->connect();\r\n\t\t$this->conn = $this->db->conn();\r\n\r\n\t\t$usuario = new Usuario();\r\n\t\t$usuario->obtener_datos($this->conn);\r\n\t}", "public function retrieve_data($username){\n\t\t\n\t\t$connection = new \\yii\\db\\Connection([\n\t\t 'dsn' => 'pgsql:host=localhost;port=5432;dbname=users',\n\t\t'username' => 'postgres',\n\t\t'password' => 'admin',\n\t\t]);\n\t\t$connection->open();\n\t\t$command = $connection->createCommand();\n\t\t\n\t\t$command = $connection->createCommand('SELECT * FROM custom_template WHERE username=:username');\n\t\t$command->bindValue(':username', $username);\n\t\t$user_data = $command->queryAll();\n\t\t\n\t\treturn $user_data[0];\n\t\t\n\t}", "public function getuserAction()\r\n {\r\n $User = $this->getUser();\r\n $data = $User;\r\n return $data;\r\n }", "public function get_admindetails($uid){\n \n \t\t$sql3=\"SELECT * FROM admin WHERE admin_id =$uid\";\n\t $result3 = mysqli_query($this->db,$sql3);\n\t $admin_data = mysqli_fetch_array($result3);\n\t $this->a_name= $admin_data['name'];\n $this->a_password= $admin_data['password'];\n $this->a_type= $admin_data['admin_type'];\n $this->a_journal_id= $admin_data['journal_id'];\n return true;\n \t}", "public function getUserDetails() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n $username = $this->request->input(\"username\");\n if ($username) {\n $where[] = [\"username\", \"=\", $username];\n }\n\n $userIdEqual = $this->request->input(\"user_id_equal\");\n if ($userIdEqual) {\n $where[] = [\"user_id\", \"=\", $userIdEqual];\n }\n\n $userIdNotEqual = $this->request->input(\"user_id_not_equal\");\n if ($userIdNotEqual) {\n $where[] = [\"user_id\", \"!=\", $userIdNotEqual];\n }\n\n\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getData();\n\n return $users;\n }", "public function index()\n {\n if ( $this->session->userdata('user')->tipe_user == \"superadmin\" )\n {\n $data['datas'] = $this->db->get($this->User->table, 100)->result();\n }else\n {\n $data['datas'] = $this->db->where(['tipe_user !=' => 'superadmin'])->get($this->User->table, 100)->result();\n }\n\n $this->Helper->view('user/index', $data);\n }", "public function readAdmins(){\r\n $results = array();\r\n\r\n if ( null !== $this->getDB() ) {\r\n $dbs = $this->getDB()->prepare('select * from admin');\r\n\r\n if ( $dbs->execute() && $dbs->rowCount() > 0 ) {\r\n $results = $dbs->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n } \r\n return $results;\r\n }", "public function data_user(){\n\t\treturn $this->db->get('registrasi');\n\t}", "public function view(){\n\t$this->db->where('user_level', 'mahasiswa');\n return $this->db->get('tbl_users')->result();\n }", "public function getUserData()\n\t{\n\t\t$userId = $this->session->userdata('user_id');\n\t\t$userData = $this->db->select('*')\n\t\t\t\t\t\t\t ->where('user_id', $userId)\n\t\t\t\t\t\t\t ->get('user');\n\t\treturn $userData->result();\n\t}", "function adminProfile(){\n $this->check_admin_user_session();\n //pr(get_admin_session_data());\n $data['title']='Admin Profile';\n $data['trainer'] = $this->common_model->getsingle(USERS,array('id' => get_admin_session_data()['userId']));\n $this->load->admin_render('adminProfile',$data);\n }", "function fetch_admin_data($admin_user_Idn)\n\t{\n\t\tglobal $Oau_auth;\n\t\t$admin_user\t=\tarray();\n\t\t$admin_user_Idn\t\t=\t(int)$admin_user_Idn;\n\n\t\t$func_num_args\t=\tfunc_num_args();\n\t\t$func_get_args\t=\tfunc_get_args();\n\t\tif($func_num_args > 1)\n\t\t{\n\t\t\tunset($func_get_args[0]);\n\t\t\t$fields = '`' . implode('`, `', $func_get_args) . '`';\n\t\t\t$query = \"SELECT $fields FROM `administrator` WHERE `admin_Idn` = '$admin_user_Idn'\";\n\t\t\t$admin_user = mysqli_fetch_assoc(mysqli_query($Oau_auth, $query));\n\t\t\treturn $admin_user;\n\t\t}\n\t}", "function user_list()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '运营人员列表';\n $this->global['pageName'] = 'userlist';\n\n $data['searchType'] = '0';\n $data['searchName'] = '';\n\n $this->loadViews(\"user_manage/users\", $this->global, $data, NULL);\n }\n }", "public function list_page_content () {\n // Check permissions\n if ( ! current_user_can( 'list_users' ) ) {\n return;\n }\n\n // Main listing query\n $this->list_query_users();\n\n // Set urls for column sorting links.\n $sort_link_username = $this->sort_link( 'user_name', $this->orderby, $this->order );\n $sort_link_displayname = $this->sort_link( 'display_name', $this->orderby, $this->order );\n\n // Include template\n include CTAL_PATH.'/admin/templates/users-page.php';\n }", "public static function getAdminsList()\n {\n $data_to_load = [];\n if(DatabaseManager::fetchInto(\"main\", $data_to_load, \"SELECT * FROM `admin_users`\") === false)\n Status::message(Status::ERROR, \"Couldn't retrieve `admin_users` from DB\");\n \n Status::message(Status::SUCCESS, $data_to_load);\n }", "public function getAdminData($name)\n {\n $this->db->where('admin_name', $name);\n \n $query = $this->db->get('admin');\n \n return $query->row();\n \n }", "public static function User_management_information_display_user_data()\n {\n if (!self::_enabled()) {\n //account verify not enabled\n return;\n }\n $db = DataAccess::getInstance();\n $msgs = $db->get_text(true, 37);\n\n $verify_icon = \"<img src=\\\"\" . geoTemplate::getUrl('', $msgs[500952]) . \"\\\" alt='' />\";\n\n $not_verified = $msgs[500955];\n\n $user = geoUser::getUser(geoSession::getInstance()->getUserId());\n\n $price_plan_id = (!geoMaster::is('classifieds')) ? $user->auction_price_plan_id : $user->price_plan_id;\n $planItem = geoPlanItem::getPlanItem(self::type, $price_plan_id);\n\n if ($msgs[500956] && $planItem->getEnabled()) {\n $verify_link = $db->get_site_setting('classifieds_file_name') . \"?a=cart&amp;action=new&amp;main_type=verify_account\";\n\n $not_verified .= \"<br /><a href=\\\"{$verify_link}\\\">{$msgs[500956]}</a>\";\n }\n $value = (geoUser::isVerified($user->id)) ? $verify_icon : $not_verified;\n\n return array('label' => $msgs[500954], 'value' => $value);\n }", "public function get()\n {\n $user = User::find(Database::connection(), $_SESSION['id']);\n\n // Export widgets\n $this->data = $user->export(Database::connection());\n }", "public function getDetails()\n {\n if($user = $this->loadUser())\n \treturn $user;\n }", "public function get_info()\n {\n // if database connection opened\n if ($this->databaseConnection()) {\n // try to update user with specified information\n $query_user = $this->db_connection->prepare('SELECT * FROM directory WHERE username = :user_name AND id = :id');\n $query_user->bindValue(':user_name', $_SESSION['user_name'], PDO::PARAM_STR);\n $query_user->bindValue(':id', $_SESSION['user_id'], PDO::PARAM_STR);\n $query_user->execute();\n\n if ($query_user->rowCount() > 0) {\n return $query_user->fetchObject();\n } else {\n return false;\n }\n }\n }", "protected function getUser()\n {\n return $this->loadUser(array(\n 'user_name' => $this->context['admin'],\n ));\n }", "public function index()\n {\n $data['user'] = $this->user_model->getAllUser();\n $this->load->view('templates/header-admin');\n $this->load->view('admin/data-user', $data);\n $this->load->view('templates/footer-admin');\n }", "public function userinfo()\n {\n if($user = $this->Session->read('user')){\n if(!empty($this->request->data)){\n //update thong tin\n }\n $this->set('user', $user);\n }else{\n $this->redirect(array('action' => 'login', ''));\n }\n }", "public function getUser( $data )\r\n\t\t{\r\n\t\t\treturn DB::query( \"SELECT * FROM user WHERE username=:username AND password_hash=:password_hash AND status=1\", $data, true );\t\t\r\n\t\t}", "function auth_retrieve_user_properties($db, $user_id)\r\r\n{\r\r\n $result_user = func_db_query($db, \"SELECT user_id, username, email, display_name, status, activation_code, first_name, last_name, address, city, \"\r\r\n . \"state, post_code, country, phone1, phone2, phone3, date_of_birth, last_active, post_count, avatar, tag_line, attribute1, \"\r\r\n . \"attribute2, attribute3, attribute4, attribute5, attribute6, attribute7, attribute8, attribute9, attribute10 \"\r\r\n . \"FROM @TABLE_PREFIX@nx3_user WHERE user_id = ? LIMIT 1\", array(\"i\", $user_id));\r\r\n foreach ($result_user[0] as $field => $value)\r\r\n {\r\r\n $_SESSION['NX3_USER'][$field] = $value;\r\r\n }\r\r\n}", "public function getAction(){\n \t$user=Doctrine_Query::create()\n\t\t ->select(\"u.ID, u.nome,u.cognome,u.user,u.active,u.data_iscrizione,u.ID_role\")\n\t\t ->from(\"Users u\")\n\t\t ->addWhere(\"u.ID=?\",$this->getRequest()->getParam('id'))\n\t\t ->fetchOne(null,Doctrine::HYDRATE_ARRAY);\n $this->emitLoadData($user);\n }", "function scorm_get_user_data($userid) {\n/// for report.php\n\n return get_record('user','id',$userid,'','','','','firstname, lastname, picture');\n}", "public function list_user()\n\t{\n\t\tcheck_access_level_superuser();\n\t\t$data = [\n\t\t\t'list_user' => $this->user_m->get_cabang(),\n\t\t\t'list_cabang' => $this->data_m->get('tb_cabang')\n\t\t];\n\t\t$this->template->load('template2', 'user/list_user', $data);\n\t}", "public function get_list_admin()\n {\n $this->db->where('type', 1);\n $query = $this->db->get('user');\n return $query->result();\n }", "public function index()\n {\n $this->updateTitle('Database Users');\n $this->getEssentials();\n $this->loadView();\n }", "public function get_userdata_admin($id){\n\t\t$query = $this->db->prepare(\"SELECT * FROM `nw_users` WHERE `ID`= ?\");\n\t\t$query->bindValue(1, $id);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$data \t\t\t\t= $query->fetch();\n\n\t\t\treturn $data;\n\n\t\t}catch(PDOException $e){\n\t\t\tdie($e ->getMessage());\n\t\t}\n\t}", "public function getDataAdmin($user, $pwd){\n \t$query = \"SELECT idAdmin,user FROM final_admin WHERE user='\".$user.\"' and \n\t\tpassword='\".$pwd.\"'\";\n\t\t$row = mysqli_fetch_array($this->con->action($query));\n\t\t$data = array('idAdmin' => $row[\"idAdmin\"], 'user' => $row[\"user\"]);\n\t\treturn $data;\n }", "public function get()\n\t{\n\t \n\n\t\t// Get data user\n\t\t$result = $this->datatables->getData('user', array('user_paysal','user_identityNo','user_name','user_full_name','user_email','user_phone','user_address','group_name','region_name','user_group','user_password','user_region','user_id'), 'user_id', array('groups','groups.group_id = user.user_group','inner'),array('regions','regions.region_id = user.user_region','inner'));\n\t\t\n\t\t\n\t\t\n\t\techo $result;\n\t}", "public function getUserData()\n {\n return $this->file->get(self::SETTING_USER_DATA);\n }", "function getData($uname){\r\n global $connection;\r\n $query = \"select * from admins where username = '\".$uname.\"'\";\r\n $result = mysqli_query($connection,$query);\r\n confirm_query($result);\r\n $userdata = mysqli_fetch_assoc($result);\r\n return $userdata;\r\n}", "function view() \n {\n $api = new Module_UserManagement_API();\n\n /* TODO: Check if administrator */\n $users = $api->getUsers();\n $view = Core_View::factory('users');\n\n $view->users = $users;\n echo $view->render();\n }", "function getUserSettings() {\n\n\t$database = new Database();\n\t$database->query(\"SELECT * FROM papi_user WHERE id=1;\");\n\t$database->bind(':rows', $rows);\n\treturn $database->single();\n\n}", "public function user_list()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('User_Profiles', 'up');\n\t\t\t$data['users'] = $this->up->get_all_users();\n\t\t\t$this->load->view('user_list-admin',$data);\n\t\t}", "public function listUser() {\n\t\t$users = new Model_Users();\n\t\t$listeUsers = $users->listUsers();\n\t\trequire_once($_SERVER['DOCUMENT_ROOT'].\"/ecommerce/views/admin/users/liste_users.php\");\n\t}", "protected function loadUserData()\n {\n $this->userData = ($this->session->userData?:[]) + $this->userDataTemplate;\n }", "public function administration()\n {\n\t\t// user connecter\n\t\tif (!$this->isUserConnected()) {\n\t\t\theader('Location: '.BASE_URL);\n\t\t\treturn ;\n\t\t}\n\t\t// user admin\n\t\tif ($this->getUserInfo('droit') != 'ARW' && $this->getUserInfo('droit') != 'MASTER') {\n\t\t\theader('Location: '.BASE_URL);\n\t\t\treturn ;\n\t\t}\n\n $this->loadModel('user');\n\n $result = $this->getModel()->getAllUsersInfos();\n\n\t\t$arrobj = new ArrayObject($result);\n for($i = $arrobj->getIterator(); $i->valid(); $i->next())\n {\n \t$usersInfos[] = array(\n \t\t'subject' => $i->current()->subject->getUri(),\n \t\t'pseudo' => $i->current()->pseudo->getValue(),\n \t\t'givenName' => $this->getModel()->getUserInfo($i->current()->pseudo->getValue(), 'givenName'),\n \t\t'familyName' => $this->getModel()->getUserInfo($i->current()->pseudo->getValue(), 'familyName'),\n \t\t'droit' => $i->current()->droit->getValue()\n \t\t);\n }\n\n \t$this->set('userPseudo', $this->getUserInfo('pseudo'));\n\n \t$this->set('usersInfos', $usersInfos);\n\n // On set la variable a afficher sur dans la vue\n $this->set('title', 'Administration des utilisateurs');\n // On fait le rendu de la vue signup.php\n $this->render('adminUser');\n }", "public function index() {\n\n $uid = $this->session->userdata('uid');\n $data['poweruser'] = $this->Userauth->powerUser($uid);\n\n /* * * end check user status ** */\n\n $this->load->model('Users');\n\n $this->load->view('home/adminhome', $data);\n }", "function readInputData() {\n\t\t$this->readUserVars(\n\t\t\tarray(\n\t\t\t\t'username', 'password', 'password2',\n\t\t\t\t'firstName', 'middleName', 'lastName', 'initials',\n\t\t\t\t'affiliation', 'email', 'userUrl', 'phone', 'fax',\n\t\t\t\t'mailingAddress', 'biography', 'interests', 'userLocales',\n\t\t\t\t'registerAsReader', 'openAccessNotification', 'registerAsAuthor',\n\t\t\t\t'registerAsReviewer', 'existingUser'\n\t\t\t)\n\t\t);\n\t\t\n\t\tif ($this->getData('userLocales') == null || !is_array($this->getData('userLocales'))) {\n\t\t\t$this->setData('userLocales', array());\n\t\t}\n\t\t\n\t\tif ($this->getData('username') != null) {\n\t\t\t// Usernames must be lowercase\n\t\t\t$this->setData('username', strtolower($this->getData('username')));\n\t\t}\n\t}", "public function get_user_data()\n {\n $this->db->select(\"id,nama,email,no_hp,blokir,username\");\n $this->db->where(\"level < 9\");\n $hasil = $this->db->get(\"v_member_all\");\n return $hasil->result();\n }", "function getDataAdminAccount() {\r\n\t\t\t$query = $this->pdo->prepare('select * from admin_account');\r\n\t\t\t$query->execute();\r\n\t\t\treturn $query->fetchAll();\r\n\t\t}", "public function adminInfo($id){\n $info = DB::table('admins')->where('uid', $id)->first();\n return $info;\n }", "public function getAllUser()\n\t{\n\t\t$data = $this->db->get('admin');\n\t\treturn $data->result_array();\n\t}", "function bacaDataadmin($field, $id_admin_agt) {\n $query = \"SELECT * FROM admin WHERE id_admin = '$id_admin_agt'\";\n $hasil = mysql_query($query);\n $data = mysql_fetch_array($hasil);\n if ($field == 'username')\n return $data['username'];\n else if ($field == 'password')\n return $data['password'];\n }", "public function meList( )\n\t{\n\t\t$userId = $this->getCurrentUserId();\n\t\treturn $this->adminListByUser($userId);\n\t}", "function get_user_data($user_id){\n global $db;\n $sql = \"SELECT * FROM user WHERE user_id = '$user_id'\";\n $result = $db->query($sql)->fetch();\n return $result;\n}", "public function read(){\n\t\t\t//quy dinh so ban ghi tren mot trang\n\t\t\t$recordPerPage = 20;\n\t\t\t//tinh so trang\n\t\t\t$numPage = ceil($this->totalRecord()/$recordPerPage);\n\t\t\t//goi ham ModelRead tu class UsersModel de lay ket qua\n\t\t\t$listRecord = $this->ModelRead($recordPerPage);\n\t\t\t//load view\n\t\t\tinclude \"Views/CategoriesRead.php\";\n\t\t}", "public function UserDetails($user_id=\"\"){\n\t\t\t$broker_userdet = $this->db->prepare(\"SELECT * FROM users WHERE status = :status AND id =:id \");\n\t\t\t$broker_userdet->execute(array(\"status\"=>1,\"id\"=>$user_id));\n\t\t\t$row = $broker_userdet->fetch(PDO::FETCH_ASSOC);\n\t\t\treturn $row; \n\t\t}", "function get_admin_info($username) {\n $result = db_fetch_row(\"SELECT * FROM `tbl_admin` WHERE `username` = '{$username}'\");\n return $result['fullname'];\n}", "public function userDetail()\n {\n inputs([\n 'userName'=>[\n 'type'=>\"array\",\n 'value'=>$this->input->post('username'), \n 'validation'=>\"required|notEmpty\"]\n ], $this);\n\n $userDetails = $this->UserDetails->where([\"roleId\"=>$this->getUserRoleId()]);\n if(!in_array(\"ALL\", $this->inputs['userName'])) {\n $this->UserDetails->where_in( \"userName\",$this->inputs['userName']);\n } else {\n $this->UserDetails->where_not_in( \"userName\",$this->inputs['userName']);\n }\n $userDetails = $this->UserDetails->read();\n \n foreach($userDetails as $key=>$userDetail) {\n $contactDetails = $this->getContactDetails([$userDetail['_id']]); \n\n if(!empty($contactDetails)) {\n $userDetails[$key]['contact'] = $contactDetails;\n }\n $documentDetails = $this->getDocumentDetails([$userDetail['_id']]);\n\n if(!empty($documentDetails)) {\n $userDetails[$key]['document'] = $documentDetails; \n }\n }\n return output($userDetails,'success','SM001','api call success',\"\");\n }", "public function getUserData($userId);", "public function getUserInfo()\n {\n $CI = &get_instance();\n if (!$this->loggedIn()) {\n return null;\n } else {\n $id = $CI->session->userdata('user_id');\n return $CI->user_model->get($id);\n }\n }", "public function getUserList()\n {\n// return view('admin.module.user.list', ['data' => $data]);\n $userCurrentLogin = Auth::user()->id;\n $user = User::find($userCurrentLogin);\n if ($userCurrentLogin == 2) {\n $data = User::select('id', 'username', 'level')->get()->toArray();\n return view('admin.module.user.list', ['data' => $data]);\n } elseif ($user['level'] == 1) {\n $data = User::select('id', 'username', 'level')->where('id', '<>', 2)->get()->toArray();\n return view('admin.module.user.list', ['data' => $data]);\n } else {\n echo \"Bạn không có quyền truy cập\";\n }\n }", "function user_table_data($logged_user_id)\n\t{\n\t\t$select = array('user_file', 'created', 'sex', 'first_name', 'last_name', 'full_name');\n\t\t$this->db->select($select)->from('users')->where('id', $logged_user_id);\n\t $query = $this->db->get();\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query->row_array();\n\t\t}\n\t}", "public function index() {\n if ($this->User->isLoggedIn() && $this->User->isAdmin()) {\n // get all users\n $users = $this->User->getAll();\n // set the title and user data\n $data = array(\n 'users' => $users,\n 'title'=>'Manage Users'\n );\n foreach($data['users'] as $index => $user) {\n $data['users'][$index]['added'] = date(\"l, F j, Y\", strtotime($user['added']));\n }\n // return the data\n return $data;\n } else {\n header(\"Location: \".app::site_url(array('users','login')));\n exit(0); \n }\n }" ]
[ "0.7112971", "0.67299855", "0.66937035", "0.6675887", "0.66495246", "0.6614872", "0.6590533", "0.6559691", "0.65283084", "0.65140384", "0.6500292", "0.64944303", "0.647126", "0.64571327", "0.64480305", "0.64420104", "0.6431846", "0.6416809", "0.64068496", "0.6405797", "0.6405221", "0.64009124", "0.6368351", "0.6364342", "0.63642913", "0.635739", "0.6351284", "0.6325167", "0.632067", "0.6320303", "0.6307283", "0.6298673", "0.62939024", "0.62935495", "0.6285785", "0.6285128", "0.62825906", "0.6276567", "0.6275454", "0.6262144", "0.6258834", "0.6257629", "0.62486625", "0.62353015", "0.6234446", "0.6232791", "0.6232055", "0.62297225", "0.62278795", "0.62168396", "0.6213817", "0.6213292", "0.6211002", "0.6200868", "0.6192589", "0.6192163", "0.618216", "0.618152", "0.6179639", "0.61762035", "0.6173472", "0.6171301", "0.6171286", "0.6171215", "0.61666685", "0.61658895", "0.61647356", "0.6163614", "0.61633515", "0.6158121", "0.6155326", "0.6145989", "0.614334", "0.6138225", "0.613723", "0.6134294", "0.61296105", "0.6125047", "0.6116003", "0.6114146", "0.6108125", "0.6107042", "0.60995924", "0.6096922", "0.6093501", "0.6091698", "0.6088833", "0.60840344", "0.60834587", "0.60827506", "0.60722363", "0.6070859", "0.6066362", "0.6065341", "0.6064848", "0.60645324", "0.60630596", "0.6057722", "0.6056245", "0.6055674", "0.605388" ]
0.0
-1
Update password on forget password
public function updatePassword($email, $newpassword) { $data = array('password'=>MD5($newpassword)); $this->db->where('email',trim($email)); $result = $this->db->update('users',$data); if($result) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function changePassword() {}", "public function testUpdatePasswordNotGiven(): void { }", "public function resetPassword();", "function update_password()\n {\n }", "public function testUpdatePasswordsDontMatch(): void { }", "public function forgetpassword()\n \t{\n \t\t$this->data['title'] = 'Forgot Password';\n\t\t$this->show_viewFrontInner('forget-password', $this->data);\n \t}", "public function reset_pass() {\n \t\t$email = $this->input->post('email');\n\n\t $pass = $this->generate_pass(16);\n\t $hash = password_hash($pass, B_CRYPT); // http://php.net/manual/en/function.password-hash.php\n\n\t $this->load->model('users_table');\n\t $this->users_table->update_password($email, $hash);\n\n\t $this->send_email($email, $pass, \"2\");\n \t}", "public function resetPassword(){\n $input = Input::all();\n $password = Input::get('password');\n\n \t$input = Input::all();\n $v = User::validate_forget_password($input);\n\n if( !empty($v) && $v->passes()){\n User::where('email', '=' ,$input['email'])\n ->update(array('password' => Hash::make($input['password']), 'account_token' => User::createAccountToken()));\n return Redirect::to('/');\n }\n }", "public function resetAndUpdatePassword() {\n $this->validate ( $this->request, $this->getRules () );\n $user = User::where ( 'email', $this->request->email )->first ();\n \n if (!empty($user) && count ( $user->toArray() ) > 0) {\n $user->password = Hash::make ( (true) ? config()->get('app.user_password'): $this->generatePassword() );\n \n $user->save ();\n $this->email = $this->email->fetchEmailTemplate ( 'admin_forgot' );\n $this->email->subject = str_replace(['##SITE_NAME##'], [config ()->get ( 'settings.general-settings.site-settings.site_name' )], $this->email->subject);\n $this->email->content = str_replace (['##USERNAME##','##FORGOTPASSWORD##'],[$user->name,'admin123'],$this->email->content );\n $this->notification->email ( $user, $this->email->subject, $this->email->content );\n return true;\n } else {\n return false;\n }\n }", "public function regeneratePassword(string $email): void;", "public function changePasswordAction(){\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['password']) && isset($data['repeat_password'])){\n if($data['password'] === $data['repeat_password']){\n $user->setPassword($data['password']);\n } else {\n $this->setErrorResponse('password and repeat_password should match!');\n }\n } else {\n $this->setErrorResponse('password and repeat_password is mandatory fields!');\n }\n $this->_helper->json(array('updated' => true));\n }", "public function setPassword($newPassword);", "static function password_forgot() {\n $model = \\Auth::$model;\n\n # hash GET param exists\n if (!$hash = data('hash'))\n go('/');\n\n # user hash exists\n $user = $model::first(array(\n 'fields' => 'id, email, name',\n 'where' => \"hash_password_forgot = '$hash'\"\n ));\n\n if (empty($user))\n go('/');\n\n # POST passwords sent\n if ($model::data()) {\n $user->password = $model::data('password');\n $user->password_confirm = $model::data('password_confirm');\n\n # validate passwords\n if ($user->validate()) {\n $user->password = auth_encrypt($user->password);\n $user->hash_password_forgot = '';\n\n $user->edit() ?\n flash('Sua senha foi alterada com sucesso.') :\n flash('Algo ocorreu errado. Entre em contrato com a empresa.', 'error');\n\n go('/');\n }\n }\n\n globals('user', $user);\n }", "public function setPassword(){\n\t}", "public function forget_password()\n {\n $view_data = [\n 'form_errors' => []\n ];\n\n if ($this->input->is_post()) {\n $res = $this->_api('user')->reset_password($this->input->post());\n\n if($res['submit']) {\n redirect('/login/forget_password_complete');\n return;\n }\n $view_data = [\n 'form_errors' => isset($res['invalid_fields']) ? $res['invalid_fields'] : [],\n 'errmsg' => isset($res['errmsg']) ? $res['errmsg'] : null,\n 'post' => $this->input->post()\n ];\n }\n\n $this->_render($view_data);\n }", "public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }", "function update_forgot_password($user, $token, $expires);", "public function postReset()\n {\n /////////////////////////////////////////\n // Make validation rules and validates //\n /////////////////////////////////////////\n $rules= [\n 'oldpassword' => 'required',\n 'password' => 'required|confirmed',\n ];\n\n $validator = Validator::make(Input::all(),$rules);\n \n // Input valid?\n if ( ! $validator->passes()) {\n Flash::error($validator->messages());\n return Redirect::back();\n }\n\n $checkPassword = array(\n 'email' =>Auth::user()->email, \n 'password'=>Input::get('oldpassword'),\n 'active' =>1 \n );\n\n //Old password valid?\n if( !$errors=Auth::attempt($checkPassword)){\n\n Flash::error('Old password you provided is not valid');\n return Redirect::back();\n }\n \n \n $credentials = array('email' => $checkPassword['email']);\n\n $user = User::find(Auth::user()->id);\n $user->password = Hash::make(Input::get('password'));\n\n if ($user->save()) {\n Flash::success('Your password has been changed');\n return Redirect::to('publisher');\n }\n \n dd('byanze!');\n Auth::login($user);\n Flash::success('You password has been changed successfully ');\n return Redirect::to('publisher');\n\n }", "public function update_password($id, $password);", "public function testChangesAUsersPassword()\n {\n $user = factory(User::class)->create();\n $token = Password::createToken($user);\n $response = $this->post('/password/reset', [\n 'token' => $token,\n 'email' => $user->email,\n 'password' => 'password',\n 'password_confirmation' => 'password'\n ]);\n $this->assertTrue(Hash::check('password', $user->fresh()->password));\n }", "static function password_expired() {\n $model = \\Auth::$model;\n\n # hash GET param exists\n if (!$hash = data('hash'))\n go('/');\n\n # user hash exists\n $user = $model::first(array(\n 'fields' => 'id, email, name',\n 'where' => \"hash_password_expired = '$hash'\"\n ));\n\n if (empty($user))\n go('/');\n\n # POST passwords sent\n if ($model::data()) {\n $user->password = $model::data('password');\n $user->password_confirm = $model::data('password_confirm');\n\n # validate passwords\n if ($user->validate()) {\n \n # password edit\n $code = password_edit($user->email, $user->password);\n\n # check status\n if ($code === -2)\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n else if ($code === true)\n flash('Sua senha foi renovada com sucesso.');\n\n go('/');\n }\n }\n\n globals('user', $user);\n }", "public function changeUserPassword($uid,$newPassword);", "public function store(ForgetPasswordRequest $request)\n {\n $user =User::where('mobile_number' , $request->mobile_number)->first();\n // ToDo to change the new password to be rand text\n $user->update([\n 'password' => 'password'\n ]);\n // ToDo to SendEmail with new password to this user\n\n flash(trans('auth.forget password done'))->success();\n\n return back();\n }", "protected function changePassword()\n {\n if (empty($this->password)) {\n return;\n }\n $this->validateOnly('password', ['password' => 'min:8|confirmed']);\n $this->user->update([\n 'password' => Hash::make($this->password),\n ]);\n $this->password = null;\n $this->password_confirmation = null;\n }", "function eventUpdatePassword(){\r\n\t\t$userid = util::getData(\"id\");\r\n\t\t$password1 = util::getData(\"password1\");\r\n\t\t$password2 = util::getData(\"password2\");\r\n\r\n\t\tif(!$this->canUpdateUser($userid))\r\n\t\t\treturn $this->setEventResult(false, \"You cannot update this account\");\r\n\r\n\t\t$result = dkpAccountUtil::SetOfficerAccountPassword($this->guild->id, $userid, $password1, $password2);\r\n\r\n\t\tif($result != dkpAccountUtil::UPDATE_OK)\r\n\t\t\t$this->setEventResult(false, dkpAccountUtil::GetErrorString($result));\r\n\t\telse\r\n\t\t\t$this->setEventResult(true,\"Password Changed!\");\r\n\r\n\t}", "public function password(){\r\n\r\n\t\t\t$user_info = Helper_User::get_user_by_id($this->user_id);\r\n\r\n\t\t\tif($_POST){\r\n\r\n\t\t\t\t$formdata = form_post_data(array(\"old_password\", \"new_password\", \"repeat_new_password\"));\r\n\t\t\t\t\r\n\t\t\t\t$old_password = trim($formdata[\"old_password\"]);\r\n\t\t\t\t$new_password = trim($formdata[\"new_password\"]);\r\n\t\t\t\t$repeat_new_password = trim($formdata[\"repeat_new_password\"]);\r\n\r\n\t\t\t\t$error_flag = false;\r\n\r\n\t\t\t\tif(strlen($old_password) <= 0){\r\n\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the old password\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif(strlen($new_password) > 0 && strlen($repeat_new_password) > 0){\r\n\t\t\t\t\t\t// if both fields are not empty\r\n\r\n\t\t\t\t\t\tif(strlen($new_password) < 6){\r\n\t\t\t\t\t\t\t// the password cannot be less than 6 characters\r\n\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\tTemplate::notify(\"error\", \"Too short password. Password must be at least 6 characters long.\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// now compare the two new passwords\r\n\t\t\t\t\t\t\tif(strcmp($new_password, $repeat_new_password) !== 0){\r\n\t\t\t\t\t\t\t\t// both passwords are not same\r\n\t\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"error\", \"New Passwords do not match. Please try again.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the new password\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!$error_flag){\r\n\t\t\t\t\t// means there are no any errors\r\n\t\t\t\t\t// get the current user account from the database\r\n\t\t\t\t\t// if the old password matches with the one that the user entered\r\n\t\t\t\t\t// change the password, else throw an error\r\n\r\n\t\t\t\t\t$old_password_hash = Config::hash($old_password);\r\n\r\n\t\t\t\t\tif(strcmp($old_password_hash, trim($user_info->password)) === 0){\r\n\r\n\t\t\t\t\t\t\tif($this->change_password($new_password, $user_info)){\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"success\", \"Password changed successfully\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tredirect(Config::url(\"account\"));\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Wrong Old Password. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tConfig::set(\"active_link\", \"password\");\r\n\t\t\tConfig::set(\"page_title\", \"Change Account Password\");\r\n\r\n\t\t\t$view_data[\"user_info\"] = $user_info;\r\n\r\n\t\t\tTemplate::setvar(\"page\", \"account/password\");\r\n\t\t\tTemplate::set(\"account/template\", $view_data);\r\n\t\t}", "public function ResetPassword() {\n\t\t\t$strPassword = strtolower(substr(md5(microtime()), 4, 8));\n\t\t\t$this->SetPassword($strPassword);\n\t\t\t$this->PasswordResetFlag = true;\n\t\t\t$this->Save();\n\n\t\t\t// Setup Token Array\n\t\t\t$strTokenArray = array(\n\t\t\t\t'NAME' => $this->strFirstName . ' ' . $this->strLastName,\n\t\t\t\t'USERNAME' => $this->strUsername,\n\t\t\t\t'PASSWORD' => $strPassword\n\t\t\t);\n\n\t\t\t// Send Message\n\t\t\tQApplication::SendEmailUsingTemplate('forgot_password', 'Qcodo.com Credentials', QCODO_EMAILER,\n\t\t\t\t$this->SmtpEmailAddress, $strTokenArray, true);\n\t\t}", "public function setPassword($newPassword){\n\t}", "public function userPasswordUpdate() {\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $this->request->input(\"user_id\")]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n }", "public function update_password(Request $r)\n {\n DB::table('memberships')\n ->where(DB::raw('md5(id)'), $r->id)\n ->where('recovery_mode', 1)\n ->update([\n 'password'=>bcrypt($r->password),\n 'recovery_mode' => 0\n ]);\n //DB::select(\"update memberships set password='{$pass}', recovery_mode=0 where md5(id)='{$r->id}' and recovery_mode=1\");\n $r->session()->flash(\"sms\", \"You has been reset your password. Please login with your new password.\");\n return redirect('/sign-in');\n }", "public static function password() {\n if ( !isset($_POST['email']) ) {\n return;\n }\n \n $password = substr(Helper::hash(rand(0,16^32).$_POST['email']),0,12);\n \n $result = Database::checkUser($_POST['email']);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Unbekannter Benutzer!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n return;\n }\n \n $id = $result[0]['id'];\n $passwordold = $result[0]['password'];\n \n $pw = Helper::hash($password.$_POST['email']);\n \n $success = Database::setPassword($id,$passwordold,$pw);\n if ( $success !== false ) {\n self::passwordMail($_POST['email'],$password);\n self::setError('Ein neues Passwort wurde dir zugeschickt!<br>');\n } else {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n }\n }", "function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}", "public function setPassword($value);", "public function post_password()\n\t{\n\t\t$input = Input::all();\n\t\t$rules = array(\n\t\t\t'current_password' => array(\n\t\t\t\t'required',\n\t\t\t),\n\t\t\t'new_password' => array(\n\t\t\t\t'required',\n\t\t\t\t'different:current_password',\n\t\t\t),\n\t\t\t'confirm_password' => array(\n\t\t\t\t'same:new_password',\n\t\t\t),\n\t\t);\n\n\t\tif (Auth::user()->id !== $input['id']) return Response::error('500');\n\n\t\t$val = Validator::make($input, $rules);\n\n\t\tif ($val->fails())\n\t\t{\n\t\t\treturn Redirect::to(handles('orchestra::account/password'))\n\t\t\t\t\t->with_input()\n\t\t\t\t\t->with_errors($val);\n\t\t}\n\n\t\t$msg = Messages::make();\n\t\t$user = Auth::user();\n\n\t\tif (Hash::check($input['current_password'], $user->password))\n\t\t{\n\t\t\t$user->password = $input['new_password'];\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tDB::transaction(function () use ($user)\n\t\t\t\t{\n\t\t\t\t\t$user->save();\n\t\t\t\t});\n\n\t\t\t\t$msg->add('success', __('orchestra::response.account.password.update'));\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$msg->add('error', __('orchestra::response.db-failed'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg->add('error', __('orchestra::response.account.password.invalid'));\n\t\t}\n\n\t\treturn Redirect::to(handles('orchestra::account/password'));\n\t}", "public function do_forgot_password()\n {\n if( Confide::forgotPassword( Input::get( 'email' ) ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.password_forgot');\n return Redirect::action('UserController@login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_forgot');\n return Redirect::action('UserController@forgot_password')\n ->withInput()\n ->with( 'error', $error_msg );\n }\n }", "public function updatePassword(Resquest $request) {\r\n $request->validate([\r\n 'email' => 'required',\r\n 'password' => 'required|string|min:6|confirmed',\r\n 'password_confirmation' => 'required',\r\n\r\n ]);\r\n\r\n // on verifie si l'email existe dans la table user\r\n\r\n $email = $request->email;\r\n\r\n $user = User::where('email',$email)->first();\r\n\r\n if(!user){\r\n\r\n return redirect('/login')->with('error', 'ce email existe pas!');\r\n\r\n }\r\n\r\n else{\r\n\r\n $updatePassword = DB::table('password_resets')\r\n ->where(['email' => $request->email, 'token' => $request->token])\r\n ->first();\r\n\r\n // modifie le mot de pass dans la table et redirection sur login\r\n\r\n if(!$updatePassword)\r\n return back()->withInput()->with('error', 'le token est invalide!!');\r\n\r\n $user = User::where('email', $request->email)\r\n ->update(['password' => Hash::make($request->password)]);\r\n\r\n // on suprime dans la table pass reset l'email existant\r\n DB::table('password_resets')->where(['email'=> $request->email])->delete();\r\n return redirect('/login')->with('message', 'vous avez bien modifié votre password!');\r\n\r\n }\r\n\r\n\r\n}", "public function updatepassword() {\n $request = Request::all();\n $rules = ['old_password' => 'required', 'password' => 'required|confirmed|min:6'];\n $v = Validator::make($request, $rules);\n if ($v->fails()) {\n return redirect()->back()->withErrors($v->errors());\n }\n $user = User::find(Auth::user()->id);\n if (!Hash::check($request['old_password'], $user->password)) {\n return redirect()->back()->withErrors([\"old_password\" => [0 => \"The old password does not match.\"]]);\n }\n\n $user->password = bcrypt($request['password']);\n $user->save();\n return redirect()->back()->with('status', 'Your password changed succesfully');\n }", "private function user_reset_password(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\n\t\t\tif(!isset($_POST['password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['confirm_password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter confirm_password are require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\n\t\t\t$user_id = $this->_request['table_doctor_id'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$cpassword = $this->_request['confirm_password'];\n\n\t\t\tif(!empty($password) && !empty($cpassword) ) {\n\n\t\t\t\tif($password!=$cpassword) {\n\t\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Password and Confirm password is not matched\");\n\t\t\t\t\t$this->response($this->json($error), 200);\n\n\t\t\t\t} else{\n\t\t\t\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t$sql = \"UPDATE table_user SET user_password='\".$hashed_password.\"' WHERE user_id='\".$user_id.\"' \";\n\t\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t\t$update = $stmt->execute();\n\t\t\t\t\t\t$fetchData = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\t\t\t\tif(count($update)==1){\n\t\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Profile Updated\");\n\t\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function postForgotPassword()\n\t{\n\t\t$rules = ['email' => 'required|email'];\n\t\t$validator = Validator::make(Input::only('email'), $rules);\n\t\tif ($validator->fails()) return Redirect::back()->withInput()->withErrors($validator);\n\n\t\tif ( ! PasswordReminder::canSendReminderEmail(Input::get('email')))\n\t\t{\n\t\t\treturn Redirect::back()->withInput()\n\t\t\t\t->withError('A reminder email has already been sent for this email address.');\n\t\t}\n\n\t\tswitch ($response = Password::remind(Input::only('email'), function($message)\n\t\t{\n\t\t\t$message->subject('WebCMS Password Reminder');\n\t\t}))\n\t\t{\n\t\t\tcase Password::REMINDER_SENT:\n\t\t\t\treturn Redirect::back()->withSuccess(Lang::get($response));\n\n\t\t\tdefault:\n\t\t\t\treturn Redirect::back()->withError(Lang::get($response));\n\t\t}\n\t}", "public function updatePassword()\n {\n $user = User::find(Database::connection(), $_SESSION['id']);\n\n // Update password\n return $user->updatePassword(Database::connection(), $_POST['password']);\n }", "public function reset_password()\n {\n \n }", "public function test_can_update_password_after_send_request_reset_password()\n {\n $postUpdatePassword = $this->makeResetPasswordData();\n $existsTokenData = array_only($postUpdatePassword, ['email', 'token']);\n\n $this->seeInDatabase($this->passwordsTable(), $existsTokenData);\n $changedPassword = $this->put(\n route('api.admin.auth.password.resetPassword', $this->token),\n $postUpdatePassword\n );\n $changedPassword->assertResponseOk()->isJson();\n $changedPassword->dontSeeInDatabase($this->passwordsTable(), $existsTokenData);\n }", "public function resetUserPassword()\n\t{\n\t\t# make the call to the API\n\t\t$response = App::make('ApiClient')->post('user/password?forgotten=true', Input::only('email'));\t\n\n\t\t# if the call was successful we'll want to give some feedback to the user\n\t\tif(isset($response['success'])) \n\t\t{\n\t\t\tSession::flash('success', $response['success']['data']);\n\t\t}\n\t\t# similarly if it failed, but this time also show the previous form data\n\t\telse {\n\t\t\t# save the API response to some flash data\n\t\t\tSession::flash('reset-errors', getErrors($response));\n\n\t\t\t# also flash the input so we can replay it out onto the reg form again\n\t\t\tInput::flash();\n\t\t}\t\t\n\n\t\t# ... and show the reset form again\n\t\treturn Redirect::to('forgotten-password');\n\t}", "public function changePassword() {\n $validator = \\Validator::make(\n \\Input::only([\"password\", \"id\", \"reset_code\"]),\n [\n \"id\" => \"required\",//|exists:users,id\",\n \"reset_code\" => \"required\",//|exists:users,reset_code\",\n \"password\" => \"required\"\n ]\n );\n\n if($validator->fails()) {\n $user = User::whereId(intval(\\Input::get(\"id\")))->whereResetCode(\\Input::get(\"reset_code\"))->first();\n if(!$user) {\n return \\View::make(\"admin.nice-error\", [\n \"title\" => \"Password change failed\",\n \"message\" => $validator->messages()->first()\n ]);\n } else {\n return \\View::make(\"admin.forgot\")->with(\"user\", $user)->withErrors($validator->errors());\n }\n } else {\n $user = User::findOrFail(intval(\\Input::get(\"id\")));\n $user->password = \\Hash::make(\\Input::get(\"password\"));\n $user->reset_code = \"\";\n $user->save();\n return \\Redirect::route(\"dashboard.login\")->with(\"relogin\", true);\n }\n }", "public function postForgotPw(){\n\t\t//find user where email = input email\n\t\t$user = User::where('email','=',Str::lower(Input::get('email')));\n\n\t\t//if user found\n\t\tif($user->count()){\n\n\t\t\t//if match found\n\t\t\t$user \t\t\t\t\t= $user->first();\n\n\t\t\t//generate new activate code and new password\n\t\t\t$code \t\t\t\t\t= str_random(60);\n\t\t\t$password \t\t\t\t= str_random(10);\n\n\t\t\t//update value in db\n\t\t\t$user->activate_code\t= $code;\n\t\t\t$user->password_temp\t= Hash::make($password);\n\n\t\t\t//save to db\n\t\t\tif($user->save()){\n\n\t\t\t\t//send email to user with new password and activate link\n\t\t\t\tMail::send('emails.auth.forgot_mail',array('link' => URL::route('account-recover', $code), 'name' => $user->last_name, 'password'=>$password), function($message) use ($user){\n\t\t\t\t\t$message->to($user->email, $user->last_name)->subject(\"It's ok, it happens. Here is yours...\");\n\t\t\t\t});\t\t\t\t\n\t\t\t\t\n\t\t\t\t//return to forgot-pw page\n\t\t\t\treturn Redirect::route('account-forgot-pw')\n\t\t\t\t\t\t->with('global','<div class=\"alert alert-success\" role=\"alert\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"glyphicon glyphicon-envelope\" aria-hidden=\"true\"></span>\n\t\t\t\t\t\t\t\t\t\t\tNew password has been sent. Please check your mail.\n\t\t\t\t\t\t\t\t\t\t</div>');\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t//return error msg wrong old password\n\t\t\treturn Redirect::route('account-forgot-pw')\n\t\t\t\t\t->with('global','<div class=\"alert alert-danger\" role=\"alert\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"glyphicon glyphicon-exclamation-sign\" aria-hidden=\"true\"></span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"sr-only\">Error:</span>\n\t\t\t\t\t\t\t\t\t\tIncorrect Email Address. Please try again.\n\t\t\t\t\t\t\t\t\t</div>');\n\t\t}\n\t}", "public function forget_password_post()\n {\n $admin = User::where('email', request('email'))->first();\n if(!empty($admin))\n {\n $token = app('auth.password.broker')->createToken($admin);\n $data = DB::table('password_resets')->insert([\n 'email' => $admin->email,\n 'token' => $token,\n 'created_at' => Carbon::now()\n ]);\n\n Mail::to($admin->email)->send(new reset_password(['data' => $admin, 'token' => $token]));\n return back();\n }\n }", "public function change(string $password): void;", "public function passwordUpdated()\n {\n $message = \\trans('orchestra/foundation::response.account.password.update');\n\n return $this->redirectWithMessage(\\handles('orchestra::account/password'), $message);\n }", "public function updatepassword(Request $request)\n {\n $user_id = Auth::user()->id;\n $teacher_user_id = Teacher::with('user')->where('user_id',$user_id)->first();\n $teacher_id = $teacher_user_id->id;\n\n $teacher = Teacher::find($teacher_id);\n $teacher_user_id = $teacher->user_id;\n\n $user = User::find($teacher_user_id);\n\n $user->password = bcrypt($request->input('password'));\n $user->save();\n Session::flash('flash_message','Maklumat katalaluan berjaya dikemaskini.');\n return Redirect::back();\n }", "public function lostPassword() {\n $this->form_validation->set_rules('email', 'Email', 'required');\n\n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n $this->loadUser();\n \n $this->user_model->setValue(\n \t'temp_code', $this->generateTempCode());\n $this->user_model->setValue(\n \t'temp_code_valid_until', date('Y-m-d H:i:s', strtotime('+ 2 days')));\n \t\n if (! $this->user_model->updateTempCode()) {\n \t$this->error(400, 'Something went wrong');\n }\n\n\t\t$this->sendEmail(\n\t\t\t$this->input->post('email'), \n\t\t\t'Set New Password', \n\t\t\t$this->getLostPasswordMailBody($this->user_model->getValue('temp_code')));\n\t\t$data['msg'] = 'New password mail for ' . $this->input->post('email') . ' sent.';\n\t\t$this->response($data);\n }", "public function updatePassword($password)\n {\n $this->password = password_hash($password, PASSWORD_DEFAULT);\n }", "function reset(Request $request){\n $this->validate($request, [\n 'email' => 'required|email',\n 'password' => 'required|min:5',\n ]);\n\n $user = Auth::user();\n\n $checkoldpsswrd = array(\n 'email' => $request->get('email'),\n 'password' => $request->get('oldpassword'),\n );\n\n $newpass = array(\n 'password' => Hash::make($request->get('password')),\n );\n\n if(Auth::attempt($checkoldpsswrd)){\n $user->fill($newpass);\n $user->save();\n\n return redirect('login');\n }\n else{\n return back()->with('error', 'Wrong old password');\n }\n }", "static function password_forgot() {\n parent::password_forgot();\n view_var('user', globals('user'));\n }", "public function setNewPassword()\n {\n PasswordResetModel::setNewPassword(\n Request::post('user_name'), Request::post('user_password_reset_hash'),\n Request::post('user_password_new'), Request::post('user_password_repeat')\n );\n Redirect::to('index');\n }", "public function update()\n {\n $new_password = $this->input->post('inputNewPassword');\n if ($this->authentication->change_password($new_password))\n {\n $this->flash_message('Password Akun Berhasil di Update');\n } else {\n $this->flash_message('Password Akun Gagal di Update');\n }\n redirect($this->data['user'].'/editPassword');\n }", "public function testPasswordChange(): void\n {\n // Test strong password - should pass.\n $this->setUpUserPostData(Constants::SAFE_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Test weak password - should pass as well.\n $this->setUpUserPostData(Constants::PWNED_PASSWORD);\n $this->assertIsInt(\\edit_user($this->dummy_user_id));\n\n // Clean up.\n $this->tearDownUserPostData();\n }", "private function changePassword()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($request['old_pass']) || $request['old_pass']==\"\")\n throw_error_msg(\"provide old_pass\");\n\n //new_pass\n if(!isset($request['new_pass']) || $request['new_pass']==\"\")\n throw_error_msg(\"provide new_pass\");\n\n //c_new_pass\n if(!isset($request['c_new_pass']) || $request['c_new_pass']==\"\")\n throw_error_msg(\"provide c_new_pass\");\n\n if($request['c_new_pass']!=$request['c_new_pass'])\n throw_error_msg(\"new password and confirm password do not match\");\n\n $request['userid'] = userid();\n $userquery->change_password($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"password has been changed successfully\");\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "function password_update_post(Request $request){\n $request->validate([\n 'password' => 'confirmed'\n ]);\n\n if(Hash::check($request->old_password, Auth::user()->password)){\n\n if ($request->old_password == $request->password) {\n return back()->with('error_reenter_old', 'You entered your old password. Please try a new password');\n }\n\n else {\n User::find(Auth::id())->update([\n 'password' => Hash::make($request->password),\n 'updated_at' => now(),\n ]);\n\n //Sending password changing notification email start \n Mail::to(Auth::user()->email)->send(new PasswordChanged);\n return back()->with('password_change_success', 'Your password changed successfully');\n }\n }\n\n else{\n return back()->with('error_password_hash_unmatched', 'Your old password does not matched. Please try again..');\n }\n }", "public function reset_password()\n {\n $view_data = [\n 'form_errors' => []\n ];\n\n if ($this->input->is_post()) {\n $res = $this->_api('user')->update_password( [\n 'password' => $this->input->post('password'),\n 'confirm_password' => $this->input->post('confirm_password'),\n 'token' => $this->input->get('token'),\n 'id' => $this->input->get('id')\n ]);\n\n // Redirect if reset password successful\n if($res['submit']) {\n redirect('/login/reset_password_complete');\n return;\n }\n\n $view_data = [\n 'form_errors' => isset($res['invalid_fields']) ? $res['invalid_fields'] : [],\n 'errmsg' => isset($res['errmsg']) ? $res['errmsg'] : null,\n 'post' => $this->input->post()\n ];\n }\n\n $this->_render($view_data);\n }", "public function askPassword()\n {\n $this->ask('What is your password?', function (Answer $answer) {\n $this->user->password = bcrypt($answer->getText());\n\n $this->askBalance();\n });\n }", "public function remind_password($email){\n\t\t $sql=\"SELECT * FROM waf_users WHERE email='\".$this->db->Q($email,1).\"'\";\n\t\t$result=$this->db->ROW_Q($sql);\n\t\tif($result)\n\t\t{\n\t\t $mdkey=md5(rand(10000,time()));\n\t\t \n\t\t \n\t\t $sql1=\"UPDATE waf_users SET rmn_pass='\".$mdkey.\"' WHERE id=\".$this->db->Q($result['id']);\n\t\t $this->db->QUERY($sql1);\n\t\t\n\t\t $link=(isset($_SERVER['HTTPS'] )?'https':'http').\"://\".$_SERVER['SERVER_NAME'].$this->web_root.\"reset_password.php?key=\".$mdkey;\n\t\t $msg=\"Some body try reset your password.\"\n\t\t\t\t\t.\"If you forget password \"\n\t\t\t\t\t.\"<a href='\".$link.\"'>click link</a>\"\n\t\t\t\t\t.\"W.A.F. System\";\n\t\t\n\t\t mail($result['email'],$subject,$msg);\n\t\t header(\"Location:?sended=1\");\n\t\t}else{\n\t\t return 'Guru you never know';\n\t\t}\n\t}", "public function passwordAction(){\r\n $this->view->password = '';\r\n }", "public function selfChangePassword()\n\t{\n\t\tif (!$this->userService->changePassword(Input::all()))\n\t\t{\n\t\t\treturn Redirect::route('user-profile', array('tab' => 'account'))->withErrors($this->userService->errors())->withInput();\n\t\t}\n\n\t\tAlert::success('Your password has been successfully changed.')->flash();\n\n\t\treturn Redirect::route('user-profile', array('tab' => 'account'));\n\t}", "function update_paypassword()\n {\n }", "public function resetPassword(){\n $admin = $this->request->admin;\n $password = $this->request->password;\n $new_password = $this->request->new_password;\n if(strlen($password) >= 8 && $password === $new_password){\n $admin->password = $this->request->password;\n $admin->save();\n return response()->json(true);\n }\n }", "public function resetPassword(){\n $admin = $this->request->admin;\n $password = $this->request->password;\n $new_password = $this->request->new_password;\n if(strlen($password) >= 8 && $password === $new_password){\n $admin->password = $this->request->password;\n $admin->save();\n return response()->json(true);\n }\n }", "public function savepasswordAction(){\n\t\t$request = $this->_request->getParams();\n\t\t\n\t\t$error = false;\n\t\t$oValidationHelper = new Helpers_Usermanagement_Validate();\n\t\t\n\t\tif(!$oValidationHelper->ifPasswordMatch($request['user_password'],$request['password2'])){\n\t\t\t$error = true;\n\t\t\t$this->_messages->setMessage('Passwords entered do not match','error','user_password');\n\t\t}\t\n\t\t\n\t\tif($this->_validator->validate('passreset_form',$request) && !$error){\n\t\t\t$this->_auth->user_password = md5($request['user_password']);\n\t\t\t$this->_auth->save();\n\t\t\t$this->_messages->setMessage('Password has been updated');\t\t\t\n\t\t\t$this->_redirect('/usermanagement/profile/passwordform');\n\t\t}else{\n\t\t\tforeach ( $this->_validator->getErrors () as $field=>$error ) {\n\t\t\t\t$this->_messages->setMessage ( $error, 'error' , $field);\n\t\t\t}\n\t\t\t$this->_redirect('/usermanagement/profile/passwordform/?error=1');\n\t\t}\n\t}", "public function resetPassword($info)\n\t{\n\t\t$user = $this->get($info);\n\t\t\n\t\t$info['new_password'] = uniqid();\n\t\t\n\t\t$md5Pwd = md5($info['new_password'].$user->salt);\n\t\t\n\t\t$query = sprintf(\"UPDATE users SET password = '%s' WHERE email = '%s'\",\n\t\t\t\t\t\t\tmysql_real_escape_string($md5Pwd),\n\t\t\t\t\t\t\tmysql_real_escape_string($info['email']));\n\t\t\n\t\tif(mysql_query($query))\n\t\t{\n\t\t\treturn $info['new_password'];\n\t\t} else\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function updatePassword(passRequest $request){\n \n \n \t$user = Auth::user();\n \t$oldPassword = $request['passwordold'];\n $newPassword = $request['password'];\n\n if (Hash::check($oldPassword, $user->password)) {\n $request->user()->fill(['password'=>Hash::make($newPassword)])->save();\n return redirect()->action('ItemsController@index');\n }\n else\n {\n \treturn redirect()->back()->with('alert','Thay đổi không thành công');\n }\n }", "public function password()\n {\n $this->isUser();\n\n $this->data['noCabinetOrAdmin'] = true;\n\n if ($_POST) {\n\n if (!$_POST['old-password'] && !$_POST['new-password']) {\n\n $userModel = new UserModel();\n\n $validateResult = $userModel->validate($_POST);\n\n if ($validateResult === true) {\n\n $checkPassword = $userModel->checkOldPassword($_POST['old-password']);\n\n if ($checkPassword) {\n\n if ($userModel->refreshPassword($_POST)) {\n\n $this->data['success'] = 'Пароль успешно изменен';\n\n } else {\n\n $this->data['warning'] = 'Произошла ошибка';\n }\n\n } else {\n\n $this->data['warning'] = 'Старый пароль введен не правильно';\n }\n\n } else {\n\n $this->data['warning'] = $validateResult;\n }\n\n } else {\n\n $this->data['warning'] = 'Все поля должны быть заполнены';\n }\n }\n\n $this->render('password');\n }", "public function forgotPass()\n {\n }", "public function action_password($unused = null) {\n\t\tif (!Auth::instance()->has_permission('update_profile', $this->_model_name)) {\n\t\t\tthrow new Oxygen_Access_Exception;\n\t\t}\n\n\t\tOHooks::instance()\n\t\t\t->add(get_class($this).'.password.model_post_save', array(\n\t\t\t\tget_class($this),\n\t\t\t\t'password_model_post_save'\n\t\t\t));\n\n\t\tparent::action_password(true);\n\n\t\t$title = __('Change Password');\n\t\t$this->template->title = $title;\n\t\t$this->favorites->title($title);\n\t\t$this->breadcrumbs->delete('Edit '.$this->_model->meta('one_text'));\n\t}", "public function passwordResetAction()\n {\n if (Zend_Auth::getInstance()->hasIdentity()) {\n $this->_helper->redirector->gotoRoute(array(), 'default', true);\n return;\n }\n\n $userKey = $this->_getParam('key', null);\n\n if (is_null($userKey)) {\n throw new Ot_Exception_Input('msg-error-noKeyFound');\n }\n\n $loginOptions = Zend_Registry::get('applicationLoginOptions');\n\n $key = $loginOptions['forgotpassword']['key'];\n $iv = $loginOptions['forgotpassword']['iv'];\n $cipher = $loginOptions['forgotpassword']['cipher'];\n $string = pack(\"H*\", $userKey);\n\n $decryptKey = trim(mcrypt_decrypt($cipher, $key, $string, MCRYPT_MODE_CBC, $iv));\n\n if (!preg_match('/[^@]*@[^-]*-[0-9]*/', $decryptKey)) {\n throw new Ot_Exception_Input('msg-error-invalidKey');\n }\n\n $userId = preg_replace('/\\-.*/', '', $decryptKey);\n $ts = preg_replace('/^[^-]*-/', '', $decryptKey);\n\n $timestamp = new Zend_Date($ts);\n\n $now = new Zend_Date();\n\n $now->subMinute((int)$loginOptions['forgotpassword']['numberMinutesKeyIsActive']);\n\n if ($timestamp->getTimestamp() < $now->getTimestamp()) {\n throw new Ot_Exception_Input('msg-error-keyExpired');\n }\n\n $realm = preg_replace('/^[^@]*@/', '', $userId);\n $username = preg_replace('/@.*/', '', $userId);\n\n // Set up the auth adapter\n $authAdapter = new Ot_Model_DbTable_AuthAdapter();\n $adapter = $authAdapter->find($realm);\n\n if (is_null($adapter)) {\n throw new Ot_Exception_Data(\n $this->view->translate('ot-login-signup:realmNotFound', array('<b>' . $realm . '</b>'))\n );\n }\n\n if ($adapter->enabled == 0) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $className = (string)$adapter->class;\n $auth = new $className();\n\n if (!$auth->manageLocally()) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $account = new Ot_Model_DbTable_Account();\n $thisAccount = $account->getByUsername($username, $realm);\n\n if (is_null($thisAccount)) {\n throw new Ot_Exception_Data('msg-error-userAccountNotFound');\n }\n\n $form = new Ot_Form_PasswordReset();\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n\n if ($form->getValue('password') == $form->getValue('passwordConf')) {\n\n $data = array(\n 'accountId' => $thisAccount->accountId,\n 'password' => md5($form->getValue('password')),\n );\n\n $account->update($data, null);\n\n $this->_helper->messenger->addSuccess('msg-info-passwordReset');\n\n $loggerOptions = array(\n 'attributeName' => 'accountId',\n 'attributeId' => $data['accountId'],\n );\n\n $this->_helper->log(Zend_Log::INFO, 'User reset their password', $loggerOptions);\n\n $this->_helper->redirector->gotoRoute(array('realm' => $realm), 'login', true);\n } else {\n $this->_helper->messenger->addError('msg-error-passwordsNotMatch');\n }\n } else {\n $this->_helper->messenger->addError('msg-error-invalidFormInfo');\n }\n }\n\n $this->view->headScript()->appendFile($this->view->baseUrl() . '/public/scripts/ot/jquery.plugin.passStrength.js');\n\n $this->_helper->pageTitle('ot-login-passwordReset:title');\n\n $this->view->assign(array(\n 'form' => $form,\n ));\n\n }", "public function actionUpdatePassword()\n\t{\n\t\t$emp_id=isset($_POST['emp_id'])?$_POST['emp_id']:'';\n\t\t$old_password=isset($_POST['old_password'])?$_POST['old_password']:'';\n\t\t$new_password=isset($_POST['password'])?$_POST['password']:'';\n\t\tif($emp_id)\n\t\t{\n\t\t\t$model=$this->loadModel($emp_id);\t\n\t\t}\n\t\t\n\t\tif(md5($old_password)==$model->password)\n\t\t{\n\t\t\t$model->password=md5($new_password);\n\t\t\tif($model->save())\n\t\t\t\techo 1;\n\t\t}\n\t\telse{\n\t\t echo 2;\t\n\t\t}\n\t\t\n\t\t}", "public function actionPassword()\n {\n if (is_null($this->password)) {\n self::log('Password required ! (Hint -p=)');\n return ExitCode::NOUSER;\n }\n\n if (is_null($this->email) && is_null($this->id)) {\n self::log('User ID or Email required ! (Hint -e= or -i=)');\n return ExitCode::DATAERR;\n }\n\n $model = User::find()->where([\n 'OR',\n [\n 'email' => $this->email\n ],\n [\n 'id' => $this->id\n ]\n ])->one();\n\n if (is_null($model)) {\n\n self::log('User not found');\n\n return ExitCode::NOUSER;\n }\n\n $validator = new TPasswordValidator();\n\n $model->password = $this->password;\n\n $validator->validateAttribute($model, \"password\");\n\n if ($model->errors) {\n\n self::log($model->errorsString);\n\n return ExitCode::DATAERR;\n }\n\n $model->setPassword($this->password);\n\n if (! $model->save()) {\n\n self::log('Password not changed ');\n\n return ExitCode::DATAERR;\n }\n\n self::log($this->email . ' = Password successfully changed !');\n\n return ExitCode::OK;\n }", "public function testUpdateCPasswordNotGiven(): void { }", "public function can_change_password() {\n return false;\n }", "public function Forgotpassword()\n\t{\n\t\t$login = get_cookie(sha1('besaf'));\n\t\tif ($login) {\n\t\t\t//! cek login\n\t\t\tif ($this->session->userdata('role_id') == 1) {\n\t\t\t\t// user\n\t\t\t\tredirect('user');\n\t\t\t} elseif ($this->session->userdata('role_id') == 2) {\n\t\t\t\t// admin\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t} elseif (!$login) {\n\t\t\t//! cek login\n\t\t\tif ($this->session->userdata('role_id') == 1) {\n\t\t\t\t// user\n\t\t\t\tredirect('user');\n\t\t\t} elseif ($this->session->userdata('role_id') == 2) {\n\t\t\t\t// admin\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t}\n\n\t\t$this->session->set_userdata(['reset' => true]);\n\n\t\t$this->load->view('Front/template/header');\n\t\t$this->load->view('Front/Forgot_password');\n\t\t$this->load->view('Front/template/footer');\n\t}", "public function updatePassword(){\n $rules = [\n 'password' => 'required| min:8|regex:/^.*(?=.{3,})(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[\\d\\X])(?=.*[!$#%]).*$/',\n 'password_confirm' => 'required|same:password'\n ];\n\n try {\n if(!$user = JWTAuth::parseToken()->authenticate()){\n return response()->json(['msg' => \"User not found\",\"error\"=>'1'], 404);\n }\n } catch (JWTException $e) { // Exception\n return response()->json(['msg' => \"Exception token\",\"error\"=>'1'], 500);\n }\n\n $validator = \\Validator::make(Input::all(),$rules);\n\n if($validator->passes()){\n //get password\n $password = Input::get('password');\n\n // send data to database\n $check = $this->usersRepositories->updatePassword($user->id,$password);\n // Check data saving\n if($check) {\n JWTAuth::invalidate(Input::get('token'));\n return response()->json(['msg' => \"Password Updated\", \"error\" => '0'], 200);\n }\n // Can't Save\n return response()->json(['msg' => \"Can't Save New Info Now\",\"error\"=>'1'], 403);\n }\n // return error\n $error = $validator->errors()->all()[0];\n return response()->json(['msg' => $error,\"error\"=>'1'], 500);\n }", "public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "public function testUpdatePasswordValidationError()\n {\n // Config\n $currentPassword = '123456789';\n $newPassword = '123';\n\n // Prepare\n $user = factory(User::class)->create([\n 'password' => bcrypt($currentPassword),\n ]);\n\n $requestData = [\n 'currentpassword' => '123456789',\n 'newpassword' => $newPassword,\n ];\n\n $response = $this->actingAs($user)->call('POST', $this->accountChangePasswordPostUrl, $requestData);\n\n // Asserts\n $response->assertStatus(302);\n $response->assertRedirect($this->accountChangePasswordPageUrl);\n $response->assertSessionHasErrors('password');\n $response->assertSessionMissing('success');\n }", "public function setPassword(string $password): void\n {\n }", "public function updatepassword()\n\t\t{\n\t\t\t$user = Session::get('loggedinuser');\n\t\t\t$userid = DB::table('users')->where('username', $user)->pluck('id');\n\t\t\t$updateduser = User::find($userid);\n\t\t\t$newpassword = Input::get('password');\n\t\t\tif($newpassword == Input::get('confirm')) {\n\t\t\t\t$updateduser->password = Hash::make($newpassword);\n\t\t\t\t$updateduser->save();\n\t\t\t\tSession::flash('successMessage', 'Password successfully updated');\n\t\t\t\treturn Redirect::action('UsersController@index');\n\t\t\t} else {\n\t\t\t\tSession::flash('errorMessage', 'Your passwords do not match!');\n\t\t\t\treturn Redirect::back();\n\t\t\t}\n\t\t}", "public function updatePassword(UpdatePasswordRequest $request){\n $request->validate();\n $this->userRepository->updatePassword($request);\n return back();\n }", "public function put_updatepassword(){\n\t\t$customer_id = Input::get('customer_id');\n\n\t\t$customer = Customer::find($customer_id);\n\n\t\t$validation = Customer::validate_changepassword();\n\n\t\tif($validation->fails()) {\n\t \t\treturn Redirect::back()\n\t \t\t\t->withErrors($validation);\n\t\t}\n\n\t\telse {\n\n\t\t\tif (Hash::check(Input::get('customer_old_password'), $customer->customer_password)) {\n\t\t\t\n\t\t \t\tCustomer::find($customer_id)->update(array(\n\t\t\t\t\t'customer_password'=>Hash::make(Input::get('customer_new_password')),\n\t\t\t\t));\n\n\t\t\t\treturn Redirect::route('customer_profile')\n\t\t\t\t\t->with('message', 'The password was updated successfully!');\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\treturn Redirect::route('change_customer_profile_password')\n\t\t \t\t\t->with('error-message', 'The old password inputted is not correct!');\n\t\t\t}\n\t\t}\n\t}", "public function resetPasswordFromLogin()\r\n {\r\n $email = Input::get('EMAIL');\r\n $lead = Lead::where('email',$email)->first();\r\n if($lead!=null)\r\n {\r\n $lead->password = substr(md5(microtime().rand()), 0, 8);\r\n $lead->save();\r\n\r\n //Create Transaction\r\n Transaction::createTransaction('', $lead->id, '',\"RESTORE-PASSWORD\", '', '', $lead->email, '', '', $lead->phone, '');\r\n\r\n //send the new password by email\r\n mail($lead->email, 'PATENT SERVICES NEW PASSWORD', 'Your new Password is: '.$lead->password);\r\n\r\n//\r\n return \"1\";\r\n }\r\n return \"-1\";\r\n }", "public function changePassword(){\n $user=User::find(auth()->id());\n $user->password=bcrypt(request('new_password'));\n $user->save();\n return response()->json('Password Updated Successfully');\n }", "public function update_password($service_name = '',$password = ''){\n\t\t\n\t\tself::delete_password($service_name);\n\t\tself::set_password($service_name,$password);\n\t\t\n\t\treturn;\n\t}", "public function forgotpasswordAction() {\n $form = new Admin_Form_ResendPassword();\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->_request->getPost())) {\n //check user is registered\n $values = $form->getValues();\n $siteUsersMapper = new Application_Model_Table_AdminUsers();\n $exists = $siteUsersMapper->fetchByUsername($values['email_address']);\n if($exists){\n //user exists\n $recoveryEmailsMapper = new Application_Model_Table_AdminUserRecoveryEmails();\n $recoveryEmail = $recoveryEmailsMapper->createRow();\n $recoveryEmail->admin_user_id = $exists->admin_user_id;\n $recoveryEmail->email_address = $exists->username;\n $recoveryEmail->hashActivationKey();\n $recoveryEmail->save();\n }\n $this->_helper->FlashMessenger->addMessage('You password has been reset, please check your email' , 'successful');\n $this->_helper->redirector->goToRouteAndExit(array(), 'admin-dashboard', true);\n }\n }\n $this->view->form = $form;\n }", "public function actionChangePassword()\n {\n $username = $this->prompt(Console::convertEncoding(Yii::t('app', 'Username')) . ':', ['required' => true]);\n $model = $this->findModel($username);\n $model->setPassword($this->prompt(Console::convertEncoding(Yii::t('app', 'New password')) . ':', [\n 'required' => true,\n 'pattern' => '#^.{4,255}$#i',\n 'error' => Console::convertEncoding(Yii::t('app', 'More than {:number} symbols', [':number' => 4])),\n ]));\n $this->log($model->save());\n }", "public function forgotPassword()\n { \n $siteUrl = ($this->request->type)?env('WEB_SITE_AUDIO_URL'):env('WEB_SITE_URL');\n $this->setRules([ 'email' => 'required|exists:customers,email' ]);\n $this->setMessages('email.exists', trans('customer::customer.email_not_registered'));\n $this->_validate();\n $newPassword = str_random(8);\n $user = $this->_customer->where('email', $this->request->email)->first();\n $user->forgot_password = $newPassword;\n $user->save();\n if (!empty($user) && count($user->toArray()) > 0) {\n $this->email = $this->email->fetchEmailTemplate('forgot_password');\n $this->email->subject = str_replace(['##SITE_NAME##'], [config ()->get ( 'settings.general-settings.site-settings.site_name' )], $this->email->subject);\n $this->email->content = str_replace([ '##USERNAME##','##FORGOTPASSWORD##' ], [ $user->name, $siteUrl.'reset-password' . '/' . $user->forgot_password ], $this->email->content);\n $this->notification->email($user, $this->email->subject, $this->email->content);\n }\n return true;\n }", "public function forgotPassword()\n {\n if ($this->issetPostSperglobal('email') && !empty($this->getPostSuperglobal('email'))) {\n if ($this->users_manager->resetToken($this->getPostSuperglobal('email'))) {\n $this->session->writeFlash('success', \"Les instructions pour réinitialiser votre mot de passe vous ont été envoyées par email, vous avez 30 minutes pour le faire.\");\n } else {\n $this->session->writeFlash('danger', \"Aucun compte ne correspond à cet adresse mail : {$this->getPostSuperglobal('email')}.\");\n }\n } else {\n $this->session->writeFlash('danger', \"L'adresse mail n'est pas ou est mal renseignée.\");\n }\n $this->render('forgot-password', ['head'=>['title'=>'Mot de passe oublié', 'meta_description'=>'']]);\n }", "public function changePassword()\n {\n $this->validateOnly('password', [\n 'password' => 'bail|nullable|required_with:password_confirmation|string|confirmed',\n 'current_password' => 'bail|required',\n ]);\n\n if (!Hash::check($this->current_password, $this->user->password)) {\n $this->addError('current_password', 'Your current password is incorrect.');\n return;\n }\n\n $this->user->password = bcrypt($this->password);\n $this->user->save();\n $this->toast('Password has been changed!', 'success');\n $this->emit('password-updated');\n $this->reset(['password', 'password_confirmation', 'current_password']);\n }", "function update_password() {\n\t\t$old_password = $_POST['old_password'];\n\t\t$new_password = $_POST['new_password'];\n\t\tif (!empty($old_password) && !empty($new_password)) {\n\t\t\t$admin_records = $this -> conn -> get_table_row_byidvalue('pg_track_admin', 'admin_password', md5($old_password));\n\t\t\tif (!empty($admin_records)) {\n\t\t\t\t$data['admin_password'] = md5($new_password);\n\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('pg_track_admin', 'admin_status', 1, $data);\n\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Password changed successfully\");\n\t\t\t} else {\n\t\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Invalid Old Password\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array(\"status\" => \"false\", \"message\" => \"Missing parameter\", 'old_password' => $old_password, 'new_password' => $new_password);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function setPasswordAction()\n {\n $userId = $this->params()->fromRoute('userId', null);\n $token = $this->params()->fromRoute('token', null);\n\n if ($userId === null || $token === null) {\n return $this->notFoundAction();\n }\n\n $user = $this->getUserMapper()->findById($userId);\n\n if (!$user) {\n return $this->notFoundAction();\n }\n\n $record = $this->getUserRegistrationMapper()->findByUser($user);\n\n if (!$record || !$this->userRegistrationService->isTokenValid($user, $token, $record)) {\n // Invalid Token, Lets surprise the attacker\n return $this->notFoundAction();\n }\n\n if ($record->isResponded()) {\n // old link, password is already set by the user\n return $this->redirectToPostVerificationRoute();\n }\n\n $form = $this->getServiceLocator()->get('HtUserRegistration\\SetPasswordForm');\n\n if ($this->getRequest()->isPost()) {\n $form->setData($this->getRequest()->getPost());\n if ($form->isValid()) {\n $this->userRegistrationService->setPassword($form->getData(), $record);\n\n return $this->redirectToPostVerificationRoute();\n }\n }\n\n return array(\n 'user' => $user,\n 'form' => $form\n );\n }", "public function modifpassword($user,$passwd){\n \n }", "public function testUpdatePasswordOnlyNumbers(): void { }", "function passwordRecovery()\n\t{\n\t\t$args = new safe_args();\n\t\t$args->set('email', NOTSET, 'any');\n\t\t$args->set('mode', 'RECOVERY', 'any');\t\t\n\t\t$args = $args->get(func_get_args());\n\n\t\tif ( is_email($args['email']) )\n\t\t\t$sql = 'SELECT user_id FROM users WHERE email = \"'.$args['email'].'\" limit 1';\n\t\telse\n\t\t\t$sql = 'SELECT user_id FROM users WHERE user_name = \"'.$args['email'].'\" limit 1';\n\n\t\t$user = getOneAssocArray($sql);\n\t\t\n\t\tif ( $user['user_id'] )\n\t\t\treturn $this->sendNewPassword( array( 'user_id' => $user['user_id'], 'mode' => $args['mode']));\n\t\telse\n\t\t\treturn NULL;\n\t}", "function password_recovery()\n\t{\n\n\n\t}", "public function usePassword($password)\n {\n // CODE...\n }", "public function selfUpdatePassword(Request $request)\n {\n $user = Auth::user();\n\n $request->validate([\n 'current_password' => ['required', 'string', 'min:3', 'max:15', 'alpha_num',],\n 'password' => ['required', 'string', 'min:3', 'max:15', 'alpha_num', 'confirmed'],\n ]);\n\n $currentPassword = $request->input('current_password');\n\n if( ! Hash::check( $currentPassword, $user->password)) {\n return redirect()->back()->with('passwordError', 'Invalid current password');\n }\n\n $password = $request->input('password');\n\n $user->update([\n 'password' => Hash::make($password)\n ]);\n\n if(!$user->first_time_password_reset) {\n $user->first_time_password_reset = true;\n $user->save();\n }\n\n return redirect('judge')->with('status', 'Password updated successfully');\n }" ]
[ "0.7861368", "0.78280324", "0.7431879", "0.7414188", "0.72387654", "0.7163191", "0.7161194", "0.7153257", "0.7122016", "0.7115512", "0.710079", "0.7100747", "0.70624065", "0.69956934", "0.6985837", "0.6982734", "0.6979777", "0.69772786", "0.697247", "0.6971464", "0.69512886", "0.69492996", "0.6908742", "0.69012964", "0.68879104", "0.6881589", "0.6877177", "0.68769276", "0.68767494", "0.68715924", "0.68616146", "0.68567663", "0.684461", "0.6844439", "0.68439615", "0.68425596", "0.6820904", "0.68171096", "0.68110675", "0.6806249", "0.6793448", "0.678585", "0.67816585", "0.6777297", "0.6769864", "0.6729423", "0.6716063", "0.6713927", "0.6712533", "0.67066115", "0.6706074", "0.6703983", "0.6700357", "0.66967297", "0.6689943", "0.6683883", "0.6681241", "0.6680652", "0.66773605", "0.66721755", "0.66638863", "0.66634476", "0.6662892", "0.6653094", "0.6646063", "0.6646063", "0.66451246", "0.6638437", "0.6628401", "0.6627626", "0.6620102", "0.6616845", "0.66130555", "0.66099507", "0.66080153", "0.6598133", "0.6596273", "0.6595619", "0.65947443", "0.6589634", "0.6580761", "0.6577939", "0.6576327", "0.65762556", "0.6575489", "0.6572498", "0.6566998", "0.65639544", "0.65628475", "0.6557471", "0.65564966", "0.6556451", "0.6548604", "0.65455043", "0.65455043", "0.6543277", "0.65359706", "0.65339416", "0.6529212", "0.6525861", "0.6521496" ]
0.0
-1
Function to check if user exist using email
public function checkUserExist($uemail) { $this->db->select('*'); $this->db->from('users'); $this->db->where('email',$uemail); $this->db->limit(1); $query = $this->db->get(); if ($query->num_rows() == 1) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userExists($email) {\r\n\t\t\tif ($this->getUser($email) != false)\r\n\t\t\t\treturn true;\r\n\t\t\treturn false;\r\n\t\t}", "function isUserExisted($email) {\n $result = mysql_query(\"SELECT email from users WHERE email = '$email'\",$first);\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user existed \n return true;\n } else {\n // user not existed\n return false;\n }\n }", "public function checkUserExist($email) {\n try {\n $result = User::model()->checkUserExist($email);\n return $result;\n } catch (Exception $ex) {\n Yii::log(\"SkiptaUserService:checkUserExist::\".$ex->getMessage().\"--\".$ex->getTraceAsString(), 'error', 'application');\n }\n \n }", "public function isUserExisted($email) {\r\n $result = mysqli_query($this->con,\"SELECT email from users WHERE email = '$email'\");\r\n $no_of_rows = mysqli_num_rows($result);\r\n if ($no_of_rows > 0) {\r\n // user existed \r\n return true;\r\n } else {\r\n // user not existed\r\n return false;\r\n }\r\n }", "function isUserExistsByEmail($email) {\n $query = \"select * from user_profile_details WHERE email='{$email}' \";\n $result_set = mysql_query($query);\n if(isQuerySuccess($result_set)){\n\t\tif (mysql_num_rows($result_set) > 0) { \n\t\t\treturn true;\n\t\t} else { \n\t\t\treturn false;\n\t\t}\t\n\t}\t\n}", "public function checkIfEmailExists($email);", "public function isUserExisted($email) {\n $stm = $this->db->prepare(\"SELECT email FROM users WHERE email=?\");\n $stm->execute(array($email));\n $user=$stm->fetch(PDO::FETCH_OBJ);\n if($user!=null){\n return true;\n }else{\n false;\n }\n }", "public function isUserExisted($email) {\n \t\t\n\t\t$query = \" \n SELECT * from users WHERE email = :email;\n \"; \n\t\t\n\t\ttry \n { \n $stmt = $this->_db->prepare($query); \n\t\t\t$stmt->bindValue(':email',$email);\n $stmt->execute(); \n\t\t\t$result = $stmt->fetch();\n } \n catch(PDOException $ex) \n { \n\t\t\t$h = $ex->getMessage ();\n die($h); \n }\n\t\t\n\t\tif (!(empty($result))) {\n // user existed\n return true;\n } else {\n // user not existed\n return false;\n }\n\t\t\t\n }", "public function isUserExisted($email) {\n $stms = $this->conn->prepare(\"SELECT email from users WHERE email = ?\");\n \n $stms->bind_param(\"s\", $email);\n \n $stms->execute();\n \n $stms->store_result();\n \n if ($stms->num_rows > 0) {\n // user existed \n $stms->close();\n return true;\n } else {\n // user not existed\n $stms->close();\n return false;\n }\n }", "function checkExistsUser($email){\n\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM user Where email=:email\");\n\t\t$stmt->execute(['email'=>$email]);\n\t\t$result = $stmt->fetchAll();\n\t\t$num_rows = count($result);\n\n\t\tif($num_rows > 0){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function checkIfUserExist($username, $email) {\n $query = getQuery(\"checkIfUserExist.query\", $username, \"\", $email);\n $result = mysql_query($query);\n\n return (mysql_result($result, 0) >= 1);\n}", "function email_exists($email)\n {\n global $connection;\n $query = \"select user_email from users where user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirmQuery($result);\n if(mysqli_num_rows($result) > 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "function checkUserByEmail($email){\n\t\t$rec\t= $this->query(\"SELECT `id` from `users` where `email` = '$email' AND `user_type` = '1'\");\t\t\n\t\tif($rec && mysql_num_rows($rec)>0){\t\t\t\n\t\t\t//if user with the email got found\n\t\t\treturn true;\n\t\t}else{\n\t\t\t//if user with the email got not found\n\t\t\treturn false;\n\t\t}\n\t}", "public function isEmailExist($email){ \n $query = mysqli_query($this->database, \"SELECT * FROM users WHERE Gmail = '$email'\"); \n $row = mysqli_num_rows($query); \n if($row > 0){ \n return true; \n } else { \n return false; \n } \n }", "private function isUserExists($email) {\n $stmt = $this->conn->prepare(\"SELECT id FROM app_users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "public function isUserExisted($email) {\n $result = mysql_query(\"SELECT email from users2 WHERE email = '$email'\");\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user existed\n return true;\n } else {\n // user not existed\n return false;\n }\n }", "public function userExists($email) {\r\n $query = 'SELECT 1 FROM usermanagement.users WHERE email=\\'' . pg_escape_string($email) . '\\'';\r\n $results = $this->dbDriver->fetch($this->dbDriver->query($query));\r\n return !empty($results);\r\n }", "public function userExists($email){\r\n\r\n\t\t$this->stmt = $this->db->prep(\"SELECT email FROM Users WHERE email=:email\");\r\n\t\t$this->stmt->bindParam(':email', $email);\r\n\t\t$this->stmt->execute();\r\n\t\t$email_check = $this->stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\t//comparing given email to what was fetched from the database\r\n\t\tif($email == $email_check[\"email\"]){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "private function isUserExists($email) {\n\t\t$stmt = $this->conn->prepare(\"SELECT user_id from tb_user WHERE user_email = ?\");\n\t\t$stmt->bind_param(\"s\", $email);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\t$num_rows = $stmt->num_rows;\n\t\t$stmt->close();\n\t\treturn $num_rows > 0;\n\t}", "function isUserExist($email)\n\t{\n\t\t$stmt = $this->con->prepare(\"SELECT id FROM users WHERE email = ?\");\n\t\t$stmt->bind_param(\"s\", $email);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\treturn $stmt->num_rows > 0;\n\t}", "function check_exists_email($email){\n /* Select 'users' table on database */\n $this->db->select('email');\n $this->db->from('users');\n $this->db->where('email', $email);\n $result = $this->db->get();\n \n if($result->num_rows() >0){\n /*Username Exists*/\n return TRUE;\n } else {\n /*Username does not exist*/\n return FALSE;\n }\n }", "public function email_exists() {\n\t\t\n\t\t$email = $this->input->post('users_email');\n\t\t$edit_id = $this->input->post ( 'edit_id' );\n\t\t$where = array (\n\t\t\t'users_email' => trim ( $email )\n\t\t);\n\n\t\tif ($edit_id != \"\") {\n\n\t\t\t$where = array_merge ( $where, array (\n\t\t\t\t\t\"users_id !=\" => $edit_id \n\t\t\t) );\n\t\n\t\t} \n\n\t\t$result = $this->Mydb->get_record( 'users_id', $this->table, $where );\n\t\t\n\t\tif ( !empty ( $result ) ) {\n\t\t\t$this->form_validation->set_message ( 'email_exists', get_label ( 'user_email_exist' ) );\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function isUserEmilExisted($email) {\n $result = mysql_query(\"SELECT * from users WHERE email = '$email'\");\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user email existed \n return true;\n } else {\n // user email not existed\n return false;\n }\n }", "function userExists($username, $name, $email) {\n $dbo =& JFactory::getDBO();\n $query = 'SELECT id FROM #__users ' .\n 'WHERE username = ' . $dbo->quote($username) . ' ' .\n 'AND name = ' . $dbo->quote($name) . ' ' .\n 'AND email = ' . $dbo->quote($email);\n \n $dbo->setQuery($query);\n // Checking subscription existence\n if ($user_info = $dbo->loadObjectList()) {\n if (! empty ($user_info)) {\n $user = $user_info[0];\n return $user->id;\n }\n }\n return false;\n }", "function check_existing_email($email){\n $sql = \"SELECT * from mbf_user WHERE email='$email'\";\n $query = $query = $this->db->query($sql);\n if ($query->num_rows() > 0){\n return true;\n }else{\n return false;\n }\n }", "function email_exists($email) {\n $email = sanitize($email);\n $query = mysql_query(\"SELECT COUNT(`user_id`) FROM `users` WHERE `email` = '$email'\");\n return (mysql_result($query, 0) == 1) ? true : false;\n}", "public function isUserExisted($email){\n\t\t$stmt = $this->conn->prepare(\"SELECT email FROM users WHERE email = ?\");\n\t\t$stmt->bind_param(\"s\",$email);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\tif($stmt->num_rows > 0){\n\t\t\t$stmt->close();\n\t\t\treturn true;\n\t\t}\n\n\t\telse{\n\t\t\t$stmt->close();\n\t\t\treturn false;\n\t\t}\n\t}", "private function isUserExists($email) {\n \n $result = $this->con->query(\"SELECT iduser from user WHERE email = '\".$email.\"';\");\n $num_rows=$result->num_rows;\n \n \n return $num_rows;\n }", "public function checkUserExist($email)\n {\n $sql = \"SELECT `id` FROM `user` WHERE email = '$email'\";\n $query = $this->db->prepare($sql);\n $query->execute();\n $result = $query->fetchAll();\n $count = sizeof($result);\n if ($count > 0)\n return true;\n else return false;\n }", "function emailExists($email){\r\n $sql = \"SELECT email FROM users WHERE email = '$email'\";\r\n $count = $this->q($sql)->num_rows;\r\n if ($count > 0 ){ return true; } else{ return false; }\r\n }", "public function _check_email_exists($email = ''){\n\t\t\n\t}", "private function isUserExists($email) {\n $stmt = $this->con->prepare(\"SELECT id from users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "public function ifUserExists($email) {\n $stmt = $this->conn->prepare(\"SELECT * from users WHERE emailID = ?\");\n\n $stmt->bind_param(\"s\", $email);\n\n $stmt->execute();\n\n $stmt->store_result();\n\n if ($stmt->num_rows > 0) {\n // user existed\n $stmt->close();\n return true;\n } else {\n // user not existed\n $stmt->close();\n return false;\n }\n }", "public function isUserExisted($email)\n {\n $Dbcon = new Dbcon();\n $stmt = $Dbcon->select_one_row(\"SELECT email from users WHERE email = '\" . $email . \"' and active='1'\");\n\n if ($stmt) {\n return true;\n } else {\n // user not existed\n return false;\n }\n }", "function email_exists($email){\n\t\t$emailexistsql = \"SELECT email FROM users WHERE email = :email\";\n\n\t\t$stmt = $database->prepare();\n\n\t\t$stmt->bindParam(':email', $email);\n\n\t\t$stmt->execute();\n\n\t\tif ($stmt->rowCount() > 0){\n\t\t\techo(\"Email Exists\");\n\t\t\treturn true;\n\t\t}\n\t}", "function emailExists($email) {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT email FROM users WHERE email = ?\",array($email));\n\t$num_returns = $query->count();\n\tif ($num_returns > 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function email_exists(){\n $email = $this->input->post('email');\n $query = $this->db->query(\"SELECT email, password FROM user WHERE email='$email'\"); \n if($row = $query->row()){\n return TRUE;\n }else{\n return FALSE;\n }\n}", "public function isUserExisted($email) {\n $user = Member::model()->find('email=:email',array(':email'=>$email));\n $number_of_rows = count($user);\n if ($number_of_rows > 0) {\n // user existed\n return true;\n } else {\n // user not existed\n return false;\n }\n }", "function emailExists($email)\n\t{\n\t\tglobal $db,$db_table_prefix;\n\t\n\t\t$sql = \"SELECT Active FROM \".$db_table_prefix.\"Users\n\t\t\t\tWHERE\n\t\t\t\tEmail = '\".$db->sql_escape(sanitize($email)).\"'\n\t\t\t\tLIMIT 1\";\n\t\n\t\tif(returns_result($sql) > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\t\n\t}", "public function check_email_existence() {\n\t\t$email = $_GET['email'];\n\t\t$checkExistEmail = $this->User->find('count', array('conditions'=>array('User.email' => $email)));\n\t\techo $checkExistEmail;\n\t\texit();\n\t}", "function email_existe($email){\n\t$sql = \"SELECT id FROM usuarios WHERE email = '$email'\";\n\n\t$resultado = query($sql);\n\n\tif(contar_filas($resultado) == 1){\n\n\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n\n}", "public function userExists($username, $email) {\n\t\t\t$user_exists_check_sql = \"SELECT id FROM `po-users` WHERE `username` = :username OR `email` = :email ORDER BY `id` LIMIT 1\";\n\t\t\t$user_exists_check_query = $this->getConnection()->prepare($user_exists_check_sql);\n\t\t\t$user_exists_check_query->bindParam(\":username\", $username);\n\t\t\t$user_exists_check_query->bindParam(\":email\", $email);\n\t\t\t$user_exists_check_query->execute();\n\t\t\treturn !$user_exists_check_query->rowCount() == 0;\n\t\t}", "public function Check($email)\n {\n $db = new DB();\n //Check whether user data already exists in database\n $querySelect = \"SELECT \n * \n FROM \n \".$this->userTbl.\" \n WHERE\n email = '\".$email.\"'\";\n $result = $db->prepare($querySelect);\n $result->execute();\n if($result->rowCount() > 0)\n {\n return false;\n }\n else\n {\n return true;\n }\n\n }", "function existUser($email){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT COUNT(*) AS Registered FROM User WHERE email='\" . $email . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\techo \"Error selecting \" . $email . \" user\";\n\t\t}else{\n\t\t\t$assocResult = $result->fetch_assoc();\n\t\t\treturn $assocResult['Registered'];\n\t\t}\n\t}", "function emailExists(){\r\n \r\n // query to check if email exists\r\n $query = \"SELECT id, fname, lname, password,role\r\n FROM user\r\n WHERE email = ?\r\n LIMIT 0,1\";\r\n \r\n // prepare the query\r\n $stmt = $this->conn->prepare( $query );\r\n \r\n // sanitize\r\n $this->email=htmlspecialchars(strip_tags($this->email));\r\n $this->password =htmlspecialchars(strip_tags($this->password));\r\n // bind given email value\r\n $stmt->bindParam(1, $this->email);\r\n \r\n // execute the query\r\n $stmt->execute();\r\n \r\n // get number of rows\r\n $num = $stmt->rowCount();\r\n \r\n // if email exists, assign values to object properties for easy access and use for php sessions\r\n if($num>0){\r\n \r\n // get record details / values\r\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n \r\n // assign values to object properties\r\n $this->id = $row['id'];\r\n $this->fname = $row['fname'];\r\n $this->lname = $row['lname'];\r\n $this->password = $row['password'];\r\n $this->user_type = $row['user_type'];\r\n \r\n // return true because email exists in the database\r\n return true;\r\n }\r\n \r\n // return false if email does not exist in the database\r\n return false;\r\n }", "protected function userExist ($username,$email) {\n\t\t$sql = \"SELECT user_name, user_email FROM users\n\t\t\t\tWHERE user_name = ? AND user_email = ?\";\n\t\t$data = [$username,$email];\n\t\t//create stdStatemment object | call to Model method from core/Database.php\t\n\t\t$statement = $this->setStatement($sql,$data);\n\t\t\tif ( $statement->rowCount() < 1 ) {\n\t\t\t\t$out = true;\n\t\t\t} else {\n\t\t\t\t$out = false;\n\t}\n\t\treturn $out;\n\t}", "public function findUserByEmail($email){\r\n $this->db->query('SELECT * FROM user_request WHERE email = :email');\r\n // Bind value\r\n $this->db->bind(':email', $email);\r\n\r\n $row = $this->db->single();\r\n\r\n // Check row\r\n if($this->db->rowCount() > 0){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function emailExists($email) {\n\n return $this->getEntityManager()\n ->getRepository('Alt68\\Entities\\User')\n ->findOneBy(array('email' => $email));\n }", "private function isUserExists($email) {\n $query = mysql_query(\"SELECT UserId FROM user WHERE Email = '$email'\");\n $no_of_rows = mysql_num_rows($query);\n return $no_of_rows > 0;\n }", "function email_exists($email)\n {\n // 1. Connect to the database.\n $link = connect();\n\n // 2. Protect variables to avoid any SQL injection\n $email = mysqli_real_escape_string($link, $email);\n\n // 3. Generate a query and return the result.\n $result = mysqli_query($link, \"\n SELECT id\n FROM tbl_users\n WHERE email = '{$email}'\n \");\n\n // 4. Disconnect from the database.\n disconnect($link);\n\n // 5. There should only be one row, or FALSE if nothing.\n return mysqli_num_rows($result) >= 1;\n }", "private function isUserExists($email)\n {\n $stmt = $this->conn->prepare(\"SELECT id FROM users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "public function emailExists( $email )\n\t{\n\t\t// database connection and sql query\n $core = Core::dbOpen();\n $sql = \"SELECT userID FROM user WHERE email = :email\";\n $stmt = $core->dbh->prepare($sql);\n $stmt->bindParam(':email', $email);\n Core::dbClose();\n \n try\n {\n if( $stmt->execute()) \n\t\t\t{\n $row = $stmt->fetch();\n if( $stmt->rowCount() > 0 ) {\t\t\t\t\n \treturn true;\n\t\t\t\t}\n }\n } catch ( PDOException $e ) {\n echo \"Search for email failed!\";\n }\n\t\t\n\t\treturn false;\n\t}", "function is_registered($email) {\n\t\tglobal $pdo;\n\n\t\t//delete old registration attempts\n\t\t$pdo->query(\"DELETE FROM user WHERE verified = 0 AND TIME_TO_SEC(TIMEDIFF(CURRENT_TIMESTAMP, code_generation_time)) > 600\");\n\n\t\t//empty or array check\n\t\tif(empty($email) || is_array($email)) {\n\t\t\treturn null;\n\t\t}\n\n\t\t//check if user exists\n\t\t$sql = \"SELECT id FROM user WHERE REPLACE(email, \\\".\\\", \\\"\\\") = REPLACE(:email, \\\".\\\", \\\"\\\")\";\n\t\t$sth = $pdo->prepare($sql);\n\t\t$sth->bindValue(\":email\", mail_simplify($email), PDO::PARAM_STR);\n\t\t$sth->execute();\n\n\t\tif($sth->rowCount() == 0) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "private function check_user_exists($user_name, $user_email)\n {\n $user_id = email_exists( $user_email );\n if($user_id) {\n // $user_id = $this->check_user_reporter($user_id);\n return $user_id;\n }\n\n $user_id = username_exists( $user_name );\n if($user_id) {\n // $user_id = $this->check_user_reporter($user_id);\n return $user_id;\n }\n\n return false;\n }", "public function find_user_by_email($email){\n\n $arr = [\n \"s\", [$email]\n ];\n\n $sql = \"SELECT * FROM users where email=? LIMIT 1;\";\n\n $result = $this->db->prepare_statement_query($sql, $arr);\n\n return $result->num_rows > 0 ? true : false;\n\n }", "function get_user_by_email($email)\n {\n }", "public function findUserByEmail($email){\n // Query the database with a named variable.\n $this->db->query('SELECT * FROM users WHERE email = :email');\n\n // Bind a value to that variable, based on the input to this function.\n $this->db->bind(':email', $email);\n\n // Run a query for a single row.\n $row = $this->db->single();\n\n if($this->db->rowCount() > 0){\n return true;\n } else {\n return false;\n }\n\n }", "function email_exists($email = '', $userid = '')\n\t{\n\t\t$this->db->select('user_email');\n\t\tif($userid != '')\n\t\t{\n\t\t$this->db->where('user_id != ', $userid);\n\t\t}\n\t\t$this->db->where('user_email', $email);\n\t\t$this->db->from('ci_users');\n\t\t$query = $this->db->get();\n\t\tif($query->num_rows() > 0) \n\t\treturn true;\n\t\telse\n\t\treturn false;\n\t}", "public function checkIfUserExists($email)\n {\n $data = $this->getUserData($email);\n if ($data === 'error') {\n return 'error';\n }\n if ($data) {\n return true;\n } else {\n return false;\n }\n }", "private function checkUserExistence() {\n\t\t\t\t$query = \"select count(email) as count from register where email='$this->email'\";\n\t\t\t\t$resource = returnQueryResult($query);\n\t\t\t\t$result = mysql_fetch_assoc($resource);\n\t\t\t\tif($result['count'] > 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "function checkEmailExists()\n {\n $userId = $this->input->post(\"userid\");\n $email = $this->input->post(\"email\");\n\n if (empty($userId)) {\n $result = $this->user_model->checkEmailExists($email);\n } else {\n $result = $this->user_model->checkEmailExists($email, $userId);\n }\n\n if (empty($result)) {\n echo(\"true\");\n } else {\n echo(\"false\");\n }\n }", "function check_email_exist(){\n //TODO syntize the query\n $this->SQL = \"SELECT id,private_name,family_name ,email,password FROM users\"\n . \" WHERE email = '\" . $this->params['email'] . \"';\" ;\n \n \n $this->selecet_query();\n \n \n if ( !empty( $this->results[0]['email'] ) ){\n //found mail - check password\n \n if ($this->results[0]['password'] === $this->params['password']){\n \n $this->success_login();\n \n \n } else {\n // if password incorrect\n $this->results =array( 'results'=>'fail');\n \n }\n \n \n } else {\n //didnt found email \n $this->results =array( 'results'=>'fail');\n \n }\n return $this->results;\n \n }", "function user_email_exists($email){\n global $connection;\n\n $query = \"SELECT user_email FROM users WHERE user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirm($result);\n\n //if the user_email column name already has a value that is given by the user when registering\n if (mysqli_num_rows($result) > 0) {\n return true;\n }else{\n return false;\n }\n}", "public function check_existing_user($email, $user_type)\n {\n if (empty($email) || empty($user_type))\n {\n return;\n }\n $this->db->where(array('email' => $email, 'user_type' => $user_type));\n\n if ($this->db->count_all_results('users') > 0)\n {\n return TRUE;\n }\n return FALSE;\n }", "function CheckIfUserExists($input_email)\n{\n\t// Preparing query\n\t$query = GetDatabaseConnection()->prepare(\"SELECT u.user_id, u.admin, u.password FROM `user` u WHERE u.email = ? \");\n\t$query->execute(array($input_email));\n\t$result = $query->fetchAll(); //Fetching it\n\treturn $result;\n}", "public function checkUserExists(string $email)\r\n {\r\n $query = $this->db->prepare(\"SELECT `Email`, `Deleted` FROM `users` WHERE `Email` = ?\");\r\n $query->execute([$email]);\r\n return $query->fetch();\r\n }", "public function findUserByEmail($email){\n $this->db->query('SELECT * FROM users WHERE email = :email');\n\n // Bind value\n $this->db->bind(':email', $email);\n\n $row = $this->db->single();\n\n // Check row\n if($this->db->rowCount() > 0){\n return true;\n } else {\n return false;\n }\n }", "public function CheckEmail($email, $userId);", "public function emailExists($email) {\n\n\t $app = getApp();\n\n\t $sql = 'SELECT ' . $app->getConfig('security_email_property') . ' FROM ' . $this->table .\n\t ' WHERE ' . $app->getConfig('security_email_property') . ' = :email LIMIT 1';\n\n\t $dbh = ConnectionModel::getDbh();\n\t $sth = $dbh->prepare($sql);\n\t $sth->bindValue(':email', $email);\n\n\t if($sth->execute()) {\n\t $foundUser = $sth->fetch();\n\t if($foundUser){\n\t return true;\n\t }\n\t }\n\t return false;\n\t}", "public function isUserExist($userEmail) {\n $query = $this->db->query(\"SELECT * FROM Tokens WHERE email = '$userEmail' \");\n return $query->num_rows();\n }", "function existsByEmail( $email, $oid=null);", "function DB_email_existing_check($email){\n $connection = DB_get_connection();\n $queryCheck = \"SELECT * FROM `users` WHERE Email='$email'\";\n $result = mysqli_query($connection, $queryCheck);\n if(mysqli_num_rows($result) > 0){\n \n return true;\n \n }else{\n\n return false;\n\n }\n\n}", "private function check_If_Email_Exists($email){\r\n\r\n // Prepare query\r\n $query = \"SELECT * FROM `users` WHERE (Fuid = '' AND Guid = '' AND email = '{$email}')\";\r\n\r\n // Send query into server\r\n $this->_db->get_Rows($query);\r\n\r\n // Return result of query\r\n // True - if find\r\n // False - in dont\r\n return ($this->_db->count() > 0 ) ? true : false;\r\n }", "function emailExist($link, $useremail) {\n\t\t// use escape function to avoid sql injection attacks\n\t\t$email = mysqli_real_escape_string($link, $_POST[$useremail]);\n\t\t$query = \"SELECT `email` FROM users WHERE email='\".$email.\"'\";\n\n\t\t$result = mysqli_query($link, $query);\n\t\treturn mysqli_num_rows($result);\n\t}", "public function isEmailExist($email){\n\n $stmt = $this->con->prepare(\"SELECT uid FROM users WHERE email = ?\");\n $stmt->bind_param(\"s\",$email);\n $stmt->execute();\n $stmt->store_result();\n return $stmt->num_rows > 0;\n\n }", "public function accountExists($email) {\r\n $this->db = new Db();\r\n \r\n $this->db->scrub($email);\r\n $query = \"SELECT UID FROM MEMBER WHERE EMAIL = '\".$email.\"'\";\r\n $results = $this->db->select($query);\r\n return(sizeof($results)>0);\r\n }", "public function emailExists($email)\n {\n $e = \"'\".$email.\"'\";\n $qb = new QB;\n $qb->conn = static::getDB();\n $results = $qb->select('users', 'email')\n ->where('email', '=', $e)\n ->all();\n if(count($results) > 0){\n $this->errors[] = \"Sorry! This email has already been taken.\";\n }\n }", "function email_exists($email){\n $sql = \"SELECT id FROM users WHERE email='$email'\";\n $result = query($sql);\n\n if(row_count($result)==1){\n return true;\n }else{\n return false;\n }\n}", "public function findUserByEmail($email) {\r\n // rufe die Funktion query('SQL Statement') in der Klasse Database auf\r\n $this->db->query('SELECT * FROM users WHERE email = :email');\r\n $this->db->bind(':email', $email);\r\n \r\n //es sollte nur eine uebereinstiende Mail geben, also single() methode nuzzen\r\n $row = $this->db->singleResult();\r\n\r\n // Check row, if > 0 an email is found\r\n if($this->db->numRows() > 0) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function emailExist($api, $email) {\n $result = false;\n $response = $api->get($this->get('router')->generate('api_get_user_by_email', array('email' => $email)));\n if($response->getStatusCode() != StatusCodeEnum::empty_response) {\n $result = true;\n }\n return $result;\n }", "public function findUserByEmail($email) {\n\n\t\t$this->db->query('SELECT COUNT(*) AS emailChek\n\t\t\t\t\t\tFROM users\n\t\t\t\t\t\tWHERE email = :email');\n\t\t$this->db->bind(':email', $email);\n\t\t$row = $this->db->single();\n\n\t\tif ($row->emailChek > 0) {\n\n\t\t\treturn true;\n\n\t\t} else {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t}", "function MailExists($email) {\n\n\t$query = \"SELECT email FROM usuarios WHERE email = '$email'\";\n\t$result = DBExecute($query);\n\n\tif (mysqli_num_rows($result) <= 0)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "public static function email_exists($email) {\n $connection = DatabaseConnection::connection();\n $sql = \"SELECT user_id FROM users WHERE email=:email\";\n $statement = $connection->prepare($sql);\n $statement->execute(['email' => $email]);\n $count = count($statement->fetchAll());\n if($count == 1)\n return TRUE;\n else\n return FALSE;\n }", "function checkIfUserExists($conn,$data)\n {\n $sql = \"SELECT * FROM tbl_users \n WHERE email='\".$data['email'].\"' AND username='\".$data['username'].\"'\";\n $result = $conn->query($sql);\n return ($result->num_rows>0 ? true : false);\n }", "function checkEmailExists()\n {\n $userId = $this->input->post(\"userId\");\n $email = $this->input->post(\"email\");\n\n if(empty($userId)){\n $result = $this->user_model->checkEmailExists($email);\n } else {\n $result = $this->user_model->checkEmailExists($email, $userId);\n }\n\n if(empty($result)){ echo(\"true\"); }\n else { echo(\"false\"); }\n }", "function email_exists($db, $email)\n{\n\t$sql = 'SELECT * FROM users where email=:email';\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':email'=>$email));\n\t$us = $st->fetchAll();\n\treturn (count($us) >= 1);\n}", "public function emailExists($email)\n {\n $conn = Db::getInstance();\n $statement = $conn->prepare(\"select * from users where email = :email\");\n $statement->bindParam(\":email\", $email);\n $statement->execute();\n $count = $statement->rowCount();\n if ($count > 0) {\n return true;\n }\n else {\n return false;\n }\n }", "function email_exist($link, $email){\n\n $exist = false;\n\n $sql = \"SELECT email FROM users WHERE email = '$email'\";\n $result = mysqli_query($link, $sql);\n\n if( $result && mysqli_num_rows($result) == 1 ){\n\n $exist = true;\n\n }\n\n return $exist;\n\n }", "function DB_check_if_user_exist($usersPass, $usersEmail){\n\n $connection = DB_get_connection();\n $usersPass = md5($usersPass);\n $query = \"SELECT * FROM `users` WHERE Email='$usersEmail' AND password='$usersPass'\";\n $result = mysqli_query($connection, $query);\n if(mysqli_num_rows($result) === 1)\n return true;\n else return false;\n\n}", "function check_email_exists($email)\n\t{\n\n\t\tglobal $Oau_auth;\n\t\t$email = sanitize($email);\n\n\t\t$query = \"SELECT `student_Idn` FROM `student` WHERE `email` = '$email'\";\n\t\t$run_query = mysqli_query($Oau_auth, $query);\n\n\t\tif(mysqli_num_rows($run_query) > 0)\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\n\t}", "public function emailExists(User $user) {\n\t\t$email = $user->getEmail();\n\t\t$req = \"SELECT EXISTS (SELECT login FROM users WHERE email=?) AS email_exist\";\n\t\t$response = $this->getDb()->fetchAssoc($req, array($email));\n\t\treturn $response;\n\t\t\n\t}", "function checkExistingUser($conn, $useremail){\n $check_existing = \"SELECT user_id FROM user_details WHERE user_email = '$useremail'\";\n $check_existing_result = mysqli_query($conn, $check_existing);\n if(mysqli_num_rows($check_existing_result) != 0){\n return TRUE;\n } else{\n return FALSE;\n // header('Refresh: 1000, url = ../html/sitelist.php');\n }\n }", "function isUserRegistered($email) {\n\t\ttry {\n \t\tif($email==null) {\n \treturn false;\n \texit();\n\t\t}\n\t\t$mailCheck = $this->connection->prepare(\"SELECT `EMAIL` from win WHERE `email` = ?\");\n\t\t$mailCheck->bindValue(1, $email);\n\t\t$mailCheck->execute();\n\t\tif ($mailCheck->rowCount() > 0) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n \treturn false;\n \texit();\n\t\t}\n\t}\n\t\tcatch(Exception $e) {\n\t\t}\n\t}", "public function emailExists($email){\n $query = $this->conn->query(\"SELECT id FROM user WHERE email = '$email'\");\n $result = $query->fetchAll(PDO::FETCH_ASSOC);\n if($result){\n return true;\n }\n }", "private function getUserByEmail($email) {\n\n\t\t$query = array('email' => $email);\n\t\ttry {\n\t\t\t$found = $this->collection->findOne($query, array('_id', 'password', 'logintokens'));\n\t\t} catch (Exception $e) {\n\t\t\tdumper($e->getMessage());\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn $found;\n\t}", "public function user_exists( $username, $email='', $use_email=false )\n {\n if( strlen($username) < 2 ) return false;\n \n try\n {\n if( strlen($email) < 5 || !$use_email )\n {\n $sth = $this->dbh->prepare('SELECT id FROM users WHERE username = :username');\n $sth->bindParam(':username', $username, PDO::PARAM_STR, 50);\n }\n else\n {\n $sth = $this->dbh->prepare('SELECT id FROM users WHERE username = :username OR email = :email');\n $sth->bindParam(':username', $username, PDO::PARAM_STR, 50);\n $sth->bindParam(':email', $email, PDO::PARAM_STR, 120);\n }\n $sth->execute();\n $result = $sth->fetchAll();\n }\n catch(PDOException $e)\n {\n $this->_debug_error( __LINE__, $e );\n return false;\n }\n return count($result) > 0;\n }", "public function check_user_exist($email){\n\n $query = $this -> conn -> prepare('SELECT COUNT(*) from users WHERE email =:email');\n $query -> execute(array('email' => $email));\n\n if($query){\n\n $row_count = $query -> fetchColumn();\n\n if ($row_count == 0){\n\n return false;\n\n } else {\n\n return true;\n\n }\n } else {\n\n return false;\n }\n }", "private function checkEZUserExist($login,$email) { \t\r\n\r\n \t$db = eZDB::instance();\r\n\t\t$db->begin();\r\n\t\r\n\t $sql = \"SELECT count(*) as count FROM ezuser WHERE login = $login or email = $email\";\r\n\t $rows = $db->arrayQuery( $sql );\r\n\t $count = $rows[0]['count'];\r\n\t if ( $count < 1 )\r\n\t {\r\n\t\t\treturn 1;\r\n\t }\r\n\t \treturn 0;\r\n }", "public function userExists(string $email) {\n\t\t$queryString = \"SELECT COUNT(*) FROM users \n\t\t\t\t WHERE email='{$email}';\";\n\n\t\t$numberOfRows = $this->query($queryString);\n\t\treturn (int)$numberOfRows != 0;\n\t}", "function emailExists($email) {\n return valueExists('users', 'email', $email);\n}" ]
[ "0.83206946", "0.81903964", "0.8065478", "0.8029446", "0.79949516", "0.7971099", "0.7969708", "0.79407555", "0.7933719", "0.79192185", "0.7883798", "0.78814834", "0.7870381", "0.784794", "0.7847414", "0.784308", "0.7841244", "0.7840542", "0.78392243", "0.78332657", "0.7819802", "0.7803152", "0.7795334", "0.7777739", "0.7772836", "0.77603173", "0.77520806", "0.7739429", "0.77373034", "0.7736034", "0.7734837", "0.77346045", "0.77279174", "0.7722843", "0.7719374", "0.7714471", "0.76972556", "0.7696195", "0.7687598", "0.76865315", "0.76782274", "0.7676449", "0.7668544", "0.76682097", "0.76664215", "0.7658957", "0.76500845", "0.764706", "0.7617885", "0.76145667", "0.76123184", "0.76048857", "0.75897694", "0.7583277", "0.7576715", "0.7576187", "0.7571248", "0.75621796", "0.7559715", "0.7558981", "0.7549884", "0.7532508", "0.7530107", "0.75228316", "0.7522364", "0.7521182", "0.7503361", "0.7497036", "0.74922585", "0.7486625", "0.7478905", "0.7474367", "0.74735224", "0.7469806", "0.7461168", "0.74532545", "0.74476403", "0.7446772", "0.7446406", "0.7444174", "0.74385804", "0.7437285", "0.7433", "0.7431549", "0.74302024", "0.74298936", "0.7423544", "0.7417804", "0.7414299", "0.74022156", "0.739396", "0.7392889", "0.7386177", "0.7382912", "0.7381936", "0.73761845", "0.737617", "0.7372408", "0.73690295", "0.7367689" ]
0.7604787
52
Function to change user password
public function changeUserPassword($rdata) { $response = array(); $this->db->select('*'); $this->db->from('users'); $this->db->where(array('password'=>md5($rdata['current_pass']), 'id'=>$rdata['user_id'])); $query = $this->db->get(); if ($query->num_rows()) { if($rdata['new_pass'] != $rdata['confirm_pass']) { $response['message'] = 'Entered new passwords doesnot match.'; $response['status'] = false; } else { $data = array('password'=>MD5($rdata['new_pass'])); $this->db->where('id',$rdata['user_id']); $result = $this->db->update('users',$data); if($result) { $response['message'] = 'Password updated successfully.'; $response['status'] = true; } else { $response['message'] = 'There was some problem in updating password. Please try again later.'; $response['status'] = true; } } } else { $response['message'] = 'Current password doesnot match.'; $response['status'] = false; } return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function changePassword() {}", "public function changeUserPassword($uid,$newPassword);", "function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}", "public function changePassword($username, $password);", "public function changePassword(User $user, string $newPassword): void;", "public function setPassword($newPassword);", "public function modifpassword($user,$passwd){\n \n }", "function update_password()\n {\n }", "function change_passwd($Username, $old_Password, $new_Password){\n $new_Password = encrypt_pwd($new_Password);\n $SQL = \"UPDATE User SET Password = '$new_Password' WHERE Username='$Username'\";\n mysqli_query($this->db_link, $SQL);\n }", "public function Change_user_password() {\n\t\t$this->load->helper('pass');\n\t\t$user = $this->administration->getMyUser($this->user_id);\n\t\t//password\n\t\t$old_pass = $this->input->post('oldPassword');\n\t\t$newPass = $this->input->post('newPassword');\n\t\t$confirmNewPass = $this->input->post('confirmNewPassword');\n\t\tif($newPass == $confirmNewPass) {\n\t\t\t//check if old password is corrent\n\t\t\t$verify = $this->members->validateUser($user->Username,$old_pass);\n\t\t\tif($verify) {\n\t\t\t\t//validate if the password is in the correct format\n\t\t\t\t$valid_new_pass = checkPasswordCharacters($newPass);\n\t\t\t\tif($valid_new_pass) {\n\t\t\t\t\t$change_pass = $this->members->simple_pass_change($user->ID,$newPass);\n\t\t\t\t\tif($change_pass) {\n\t\t\t\t\t\techo '1';\n\t\t\t\t\t}else {\n\t\t\t\t\t\techo '6';\t\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\techo '7';\t\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\techo '8';\t\n\t\t\t}\n\t\t}else {\n\t\t\techo '9';\t\n\t\t}\n\t}", "public function changePassword()\n {\n if( ! Session::isLoggedIn() )\n {\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $user = User::find(Session::getCurrentUserID());\n\n View::make('templates/front/change-password.php',array());\n }", "public function setPassword($userid, $password);", "public function setPassword($newPassword){\n\t}", "function mysql_auth_change_password($username,$password)\n{\n $encrypted = crypt($password,'$1$' . strgen(8).'$');\n return dbUpdate(array('password' => $encrypted), 'users', '`username` = ?', array($username));\n}", "function change_password($password){\n\t\tif( isset($_POST[$password]) ){\n\t\t\t$new_password = $_POST[$password];\n\n\t\t\t$result = user::change_password($new_password);\n\t\t}\n\t}", "function reset_password($user, $new_pass)\n {\n }", "function changePassword($password, $userid){\n $query = \"UPDATE users_account SET password = ? WHERE userid = ?\";\n $paramType = \"si\";\n $paramValue = array(\n $password,\n $userid\n );\n $this->db_handle->update($query, $paramType, $paramValue);\n }", "public function setPassword($value);", "function user_changed_password($user_id, $new_password) {\n \n }", "public function change(string $password): void;", "public function setPassword(){\n\t}", "public function changePasswordAction(){\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['password']) && isset($data['repeat_password'])){\n if($data['password'] === $data['repeat_password']){\n $user->setPassword($data['password']);\n } else {\n $this->setErrorResponse('password and repeat_password should match!');\n }\n } else {\n $this->setErrorResponse('password and repeat_password is mandatory fields!');\n }\n $this->_helper->json(array('updated' => true));\n }", "public function change_password() {\n $flash = null;\n // if the user has tried logging in\n if(isset($_POST['login'])){\n // try verifying the user\n if($this->User->login($_POST['username'], $_POST['old_pass'])) {\n if($_POST['new_pass']==$_POST['new_pass_verify']){\n $this->User->setPassword($User->getId(), $_POST['new_pass']);\n session_write_close();\n header(\"Location: \".app::site_url(''));\n exit(0);\n } else {\n $flash = \"I'm sorry, but the new passwords did not match.\";\n }\n } else {\n $flash = \"That username and/or password is not valid.\";\n }\n }\n return array('flash' => $flash);\n }", "public function changeAdminUserPassword() {\n\t\t$data = $this->request->data['User'];\n\n\t\t$this->User->id = $userId = $data['id'];\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$isPasswordChanged = ($data['current_password'] !== $data['new_password']) ? true : false;\n\t\t\tif ($isPasswordChanged && ($userId !== $this->Auth->User('id'))) {\n\t\t\t\t$this->__sendPasswordChangedEmail($data);\n\t\t\t}\n\t\t\t$this->Session->setFlash(__('Password changed successfully.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change the password due a server problem, try again later.'), 'error');\n\t\t}\n\n\t\t$this->redirect('/admin/users/editAdmin/' . $userId);\n\t}", "private function changePassword()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n if(!isset($request['old_pass']) || $request['old_pass']==\"\")\n throw_error_msg(\"provide old_pass\");\n\n //new_pass\n if(!isset($request['new_pass']) || $request['new_pass']==\"\")\n throw_error_msg(\"provide new_pass\");\n\n //c_new_pass\n if(!isset($request['c_new_pass']) || $request['c_new_pass']==\"\")\n throw_error_msg(\"provide c_new_pass\");\n\n if($request['c_new_pass']!=$request['c_new_pass'])\n throw_error_msg(\"new password and confirm password do not match\");\n\n $request['userid'] = userid();\n $userquery->change_password($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"password has been changed successfully\");\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function actionChangePassword()\n {\n $username = $this->prompt(Console::convertEncoding(Yii::t('app', 'Username')) . ':', ['required' => true]);\n $model = $this->findModel($username);\n $model->setPassword($this->prompt(Console::convertEncoding(Yii::t('app', 'New password')) . ':', [\n 'required' => true,\n 'pattern' => '#^.{4,255}$#i',\n 'error' => Console::convertEncoding(Yii::t('app', 'More than {:number} symbols', [':number' => 4])),\n ]));\n $this->log($model->save());\n }", "public function change_password() {\n\t\tif (!empty($this->request->data)) {\n\t\t\t$this->request->data['User']['id'] = $this->Auth->user('id');\n\t\t\tif ($this->User->changePassword($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Password changed.', true));\n\t\t\t\t$this->redirect('/');\n\t\t\t}\n\t\t}\n\t}", "public function changePassword(PasswordChangeForm $form, User $user);", "public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "function changePassword($userid, $password, $mode = null)\n\t{\n\t\trequire_once $_SERVER['DOCUMENT_ROOT'] . '/Connections/MyDBConnector.php';\n\t\t$pdo = (new MyDBConnector())->getPDO();\n\t\t$sql = \"UPDATE staff_directory SET `pswd` = '\" . password_hash($password, PASSWORD_BCRYPT) . \"' WHERE staffId = \" . $userid;\n\t\t$stmt = $pdo->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));\n\t\t$chk = $stmt->execute();\n\t\tif ($chk) {\n\t\t\treturn 'success';\n\t\t} else {\n\t\t\treturn 'error';\n\t\t}\n\t}", "Public Function changePassword($NewPassword)\n\t{\n\t\t$this->_db->exec(\"UPDATE bevomedia_user SET Password = md5('$NewPassword') WHERE ID = $this->id\");\n\t}", "function User_Changepass(){\r\n\t\tif( ($token = Str_filter($_POST['token'])) && ($old_password = Str_filter($_POST['old_password'])) && ($new_password = Str_filter($_POST['new_password'])) ){\r\n\t\t\tif($username = AccessToken_Getter($token)){\r\n\t\t\t\tif($user = Mongodb_Reader(\"todo_users\",array(\"username\" => $username),1)){\t\t\t\t\r\n\t\t\t\t\tif(md5($old_password) == $user['password']){\r\n\t\t\t\t\t\tMongodb_Updater(\"todo_users\",array(\"username\" => $username),array(\"password\" => md5($new_password)));\r\n\t\t\t\t\t\t$res = Return_Error(false,0,\"修改成功\",array(\"username\" => $username));\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$res = Return_Error(true,6,\"密码不正确\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$res = Return_Error(true,5,\"该用户不存在\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$res = Return_Error(true,7,\"token无效或登录超时\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$res = Return_Error(true,4,\"提交的数据为空\");\r\n\t\t}\r\n\t\techo $res;\r\n\t}", "function change_password()\n {\n if ($user = $this->authorized(USER))\n {\n $descriptive_names = array(\n 'current_password' => 'Current Password',\n 'new_password' => 'New Password',\n 'new_password_confirm' => 'Confirm Password'\n );\n\n $rules = array(\n 'current_password' => ($user['group_id']==0)?'clean':'required|clean',\n 'new_password' => 'required|clean',\n 'new_password_confirm' => 'required|clean'\n );\n\n $this->loadLibrary('form.class');\n $form = new Form();\n\n $form->dependencies['title'] = \"Change Password\";\n $form->dependencies['form'] = 'application/views/change-password.php';\n $form->dependencies['admin_reset'] = false;\n $form->dependencies['client_id'] = $user['id'];\n $form->form_fields = $_POST;\n $form->descriptive_names = $descriptive_names;\n $form->view_to_load = 'form';\n $form->rules = $rules;\n\n if ($fields = $form->process_form())\n {\n\n $this->loadModel('UserAuthentication');\n\n\n if ($this->UserAuthentication->change_password($user['id'], $fields['current_password'], $fields['new_password'], $fields['new_password_confirm']))\n {\n $this->alert(\"Password Updated\", \"success\");\n $this->redirect(\"portal/home\");\n }\n else\n {\n $this->alert(\"Error: Password Not Updated\", \"error\");\n $this->redirect(\"portal/home\");\n }\n }\n }\n }", "public function changePassword()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('change-password');\n\n return $this->loadPublicView('user.change-password', $breadCrumb['data']);\n }", "function changePass() {\n\t\t$id = $this->AuthExt->User('id');\n\t\tif (!$id && empty($this->data)) {\n\t\t\t$this->Session->setFlash(__('Invalid user', true));\n\t\t\t$this->redirect(array('action' => 'index'));\n\t\t}\n\t\t\n\t\tif (!empty($this->data)) {\n\t\t\t//don't allow hidden variables tweaking get the group and username \n\t\t\t//form the system in case an override occured from the hidden fields\n\t\t\t$this->data['User']['role_id'] = $this->AuthExt->User('role_id');\n\t\t\t$this->data['User']['username'] = $this->AuthExt->User('username');\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash('The password change has been saved', 'flash_success');\n\t\t\t\t$this->redirect(array('action' => 'index', 'controller' => ''));\n\t\t\t} else {\n\t\t\t\tprint_r($this->data);\n\t\t\t\t$this->data = $this->User->read(null, $id);\n\t\t\t\t$this->data['User']['password'] = null;\n\t\t\t\t$this->data['User']['confirm_passwd'] = null;\n\t\t\t\t$this->Session->setFlash('The password could not be saved. Please, try again.', 'flash_failure');\n\t\t\t}\n\t\t}\n\t\tif (empty($this->data)) {\n\t\t\t$this->data = $this->User->read(null, $id);\n\t\t\t$this->data['User']['password'] = null;\n\t\t}\n\t\t$roles = $this->User->Role->find('list');\n\t\t$this->set(compact('roles'));\n\t}", "public function change_password() {\n\t\treturn view( 'provider.profile.change_password' );\n\t}", "private function __changePassword() {\n\t\t$data = $this->request->data['User'];\n\t\t$this->User->id = $this->Auth->user('id');\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$this->Session->setFlash(__('Your password changed successfully.'), 'success');\n\t\t\t$this->redirect($this->referer());\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change your password due to a server problem, try again later.'), 'error');\n\t\t}\n\t}", "public function account_change_password()\n\t{\n\t\t$user_session = $this->session->all_userdata();\n\t\t$user_id = $user_session['user_id'];\n\t\t\n\t\t// print_r($user_id);\n\t\t// die;\n\n\t\t$new_password = $this->input->post('new_password');\n\t\t$retype_password = $this->input->post('retype_password');\n\n\t\tif ($new_password != $retype_password)\n\t\t{\n\t\t\t$this->system_message->set_error(\"Password Miss Match\");\n\n\t\t}\n\t\telse{\n\t\t\t$data = array('password' => $this->input->post('new_password'));\n\t\t\tif (!empty($new_password) && !empty($retype_password))\n\t\t\t{\n\t\t\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t\t\t{\n\t\t\t\t\t$this->custom_model->my_update(array('password_show'=>$new_password),array('id' => $user_id),'admin_users');\n\t\t\t\t\techo \"success\"; die;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"error\"; die;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"error\"; die;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "function ciniki_users_changePassword($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'oldpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Old Password'), \n 'newpassword'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'New Password'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n if( strlen($args['newpassword']) < 8 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.20', 'msg'=>'New password must be longer than 8 characters.'));\n }\n\n //\n // Check access \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'checkAccess');\n $rc = ciniki_users_checkAccess($ciniki, 0, 'ciniki.users.changePassword', 0);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Check old password\n //\n $strsql = \"SELECT id, email FROM ciniki_users \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.users', 'user');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Perform an extra check to make sure only 1 row was found, other return error\n //\n if( $rc['num_rows'] != 1 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.21', 'msg'=>'Invalid old password'));\n }\n\n //\n // Turn off autocommit\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the password, but only if the old one matches\n //\n $strsql = \"UPDATE ciniki_users SET password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['newpassword']) . \"'), \"\n . \"last_updated = UTC_TIMESTAMP(), \"\n . \"last_pwd_change = UTC_TIMESTAMP() \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $ciniki['session']['user']['id']) . \"' \"\n . \"AND password = SHA1('\" . ciniki_core_dbQuote($ciniki, $args['oldpassword']) . \"') \";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbUpdate');\n $rc = ciniki_core_dbUpdate($ciniki, $strsql, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.22', 'msg'=>'Unable to update password.'));\n }\n\n if( $rc['num_affected_rows'] < 1 ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.users');\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.23', 'msg'=>'Unable to change password.'));\n }\n\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.users');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.users.24', 'msg'=>'Unable to update password.'));\n }\n\n return array('stat'=>'ok');\n}", "function change_password($user_id, $password)\n{\n\n $query = \"select salt, username from tblUser where user_id='$user_id' limit 1\";\n $result = mysql_query($query);\n $user = mysql_fetch_array($result);\n\n $encrypted_pass = md5(md5($password).$user['salt']);\n\n // And lastly, store the information in the database\n $query = \"UPDATE tblUser SET password='$encrypted_pass' WHERE user_id='$user_id'\";\n mysql_query ($query) or die ('Could not create user.');\n\n\t//login user\n\t$username = $user['username'];\n\t$result = user_login($username, $password);\n\n}", "private function setEncryptPassword(){\n // Encode the new users password\n $encrpyt = $this->get('security.password_encoder');\n $password = $encrpyt->encodePassword($this->user, $this->user->getPassword());\n $this->user->setPassword($password);\n }", "function changeUserPassword($user_id, $password){\n $md5_password = md5($password);\n sqlQuery(\"UPDATE users SET user_password='$md5_password' WHERE user_id='$user_id'\");\n}", "public function updatePassword()\n {\n $user = User::find(Database::connection(), $_SESSION['id']);\n\n // Update password\n return $user->updatePassword(Database::connection(), $_POST['password']);\n }", "public function change_pass()\n\t{\n\t\t$form = array();\n\n\t\t$form['validation']['params'] = array('password_old', 'password', 'password_confirm');\n\n\t\t$form['submit'] = function ($params) {\n\t\t\treturn $this->_change_pass_submit();\n\n\n\t\t};\n\n\t\t$form['form'] = function () {\n\t\t\tpage_info('title', lang('title_change_pass'));\n\n\t\t\t$this->_display();\n\t\t};\n\n\t\t$this->_form($form);\n\t}", "function user_changed_password($user_id, $new_password)\n\t{\n\t}", "function change_pwd()\r\n {\r\n include 'database/session.php';\r\n $OldPwd = htmlspecialchars($_POST['OldPwd']);\r\n $NewPwd1 = htmlspecialchars($_POST['NewPwd1']);\r\n $NewPwd2 = htmlspecialchars($_POST['NewPwd2']);\r\n \r\n if ($NewPwd1!=$NewPwd2) return false;\r\n \r\n return(changePassword($OldPwd, $NewPwd1));\r\n }", "function changePassword( $name, $pw ) {\n $d = loadDB();\n \n $found = false;\n foreach ($d['users'] as &$user) {\n if ($name == $user['name'] || $name == $user['email']) {\n $user[\"password\"] = $pw;\n saveDB( $d );\n $found = true;\n break;\n }\n }\n if (!$found)\n return FALSE;\n audit( \"changePassword done\", $name );\n return TRUE;\n }", "public function change_password()\n {\n $currentPassword = $this->input->post('currentPassword');\n $newPassword = $this->input->post('newPassword');\n\n $isPasswordChanged = $this->CustomModel->changePassword(\n $_SESSION['u_id'], $currentPassword, $newPassword\n );\n\n if ($isPasswordChanged) {\n echo 'success';\n }\n }", "public function changePwd(){\n $uesr_id=$_SESSION['admin_id'];\n\t\t$sql=\"select * from users where id='$uesr_id'\";\n\t\t$query = mysqli_query($this->connrps, $sql);\n\t\twhile ($row = mysqli_fetch_array($query)) {\n\t\t\t$username = $row['username'];\n\t\t\t$password = $row['password'];\n\t\t}\n\t\t$cur_password=base64_encode($_POST['currentPassword']);\n\t\t$new_pwd=base64_encode($_POST['newPassword']);\n\t\t$confirm_pwd=base64_encode($_POST['confirmPassword']);\n\t\tif ($cur_password != $password) {\n\t\t\t$message= \"Current password does not matched.\";\n\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\treturn 0;\n\t\t}else if ($new_pwd != $confirm_pwd) {\n\t\t\t$message= \"Confirm password does not matched\";\n\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\treturn 0;\n\t\t}else {\n\t\t\t$query_updt = \"UPDATE users SET password = '$new_pwd' WHERE id='$uesr_id'\";\n\t\t\t$query_updt = mysqli_query($this->connrps, $query_updt);\n\t\t\t$message= \"New password has been updated successfully\";\n\t\t\t$_SESSION['succ_msg'] = $message;\n\t\t\treturn 1;\n\t\t}\n\t}", "protected function changePassword()\n {\n if (empty($this->password)) {\n return;\n }\n $this->validateOnly('password', ['password' => 'min:8|confirmed']);\n $this->user->update([\n 'password' => Hash::make($this->password),\n ]);\n $this->password = null;\n $this->password_confirmation = null;\n }", "function changepassword() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n $this->viewData['hash'] =User::userid();\n // Render the action with template\n $this->renderWithTemplate('users/changepassword', 'AdminPageBaseTemplate');\n }", "function reset_password($username) {\n// return the new password or false on failure\n // get a random dictionary word b/w 6 and 13 chars in length\n $new_password = get_random_word(6, 13);\n\n if($new_password == false) {\n throw new Exception('Could not generate new password.');\n }\n\n // add a number between 0 and 999 to it\n // to make it a slightly better password\n $rand_number = rand(0, 999);\n $new_password .= $rand_number;\n\n // set user's password to this in database or return false\n $conn = db_connect();\n $result = $conn->query(\"update user\n set passwd = '\".$new_password.\"'\n where username = '\".$username.\"'\");\n if (!$result) {\n throw new Exception('Could not change password.'); // not changed\n } else {\n return $new_password; // changed successfully\n }\n}", "public function change_password()\n\t{\n\t\t$this->load->model('admin_user_model', 'admin_users');\n\t\t$updated = $this->admin_users->change_password($this->mUser->id, $this->input->post('new_password'));\n\n\t\tif ($updated)\n\t\t{\n\t\t\tset_alert('success', 'Successfully changed password.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tset_alert('danger', 'Failed to changed password.');\n\t\t}\n\n\t\tredirect('admin/account');\n\t}", "public function change_password()\n {\n $view_data = [\n 'form_errors' => []\n ];\n // Check input data\n if ($this->input->is_post()) {\n\n // Call API to register for parent\n $res = $this->_api('user')->change_password($this->input->post());\n\n if ($res['success'] && !isset($res['invalid_fields'])) {\n $this->_flash_message('パスワードを変更しました');\n redirect('setting');\n return;\n }\n // Show error if form is incorrect\n $view_data['form_errors'] = $res['invalid_fields'];\n $view_data['post'] = $this->input->post();\n }\n\n $this->_render($view_data);\n }", "public function account_change_password()\n\t{\n\t\t$data = array('password' => $this->input->post('new_password'));\n\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t{\n\t\t\t$messages = $this->ion_auth->messages();\n\t\t\t$this->system_message->set_success($messages);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errors = $this->ion_auth->errors();\n\t\t\t$this->system_message->set_error($errors);\n\t\t}\n\n\t\tredirect('admin/panel/account');\n\t}", "public function actionChangepassword()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t\n\t\t$record = SiteUser::model()->findByAttributes(array('id'=> Yii::app()->user->id));\n\t\n\t\tif(isset($_POST['SiteUser']))\n\t\t{\t\n\t\t\tif(trim($_POST['SiteUser']['password']) != '') {\n\t\t\t\t$record->password = $_POST['SiteUser']['password'];\n\t\t\t\t\n\t\t\t} \t\t\n\t\t\tif(trim($_POST['SiteUser']['password']) == trim($_POST['SiteUser']['repeat_password'])) {\n\t\t\t\t$record->repeat_password = $record->password;\n\t\t\t}\t\n\t\t\t\n\t\t\tif($record->validate()) {\n\t\t\t\t$record->repeat_password = $record->password = crypt($record->password);\n\t\t\t\tif($record->save())\n\t\t\t\t\t$this->redirect(array('personal'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$record->repeat_password = $record->password = '';\n\t\t\t}\n\n\t\t}\t\n\n\t\t$this->render('changepassword',array('record'=>$record));\n\t}", "public function changePasswordAction()\n {\n $errors = [];\n if(!empty($_POST)){\n $user = Auth::getUser();\n\n $userValidation = new UserValidation($_POST, ['password']);\n $errors = $userValidation->getNamedErrors();\n\n if(empty($errors)){\n if(password_verify($_POST['oldpass'], $user->password)){\n $user->changePassword($_POST['password']);\n Extra::setMessageCookie(\"Password changed successfully.\");\n $this->redirect(\"/manage-account/\");\n }\n $errors['oldpass'] = \"Password you entered is incorrect.\";\n }\n }\n View::renderTemplate(\"LoggedUser/change-password.html\", [\n 'errors' => $errors\n ]);\n }", "public function setPassword($password);", "public function setPassword($password);", "public function setPassword($password);", "function changepass_firsttime()\n {\n $userId = $this->userInfo('user_id');\n \n $result = $this->update('user', array('password' => $this->value('password'), 'modified' => date('Y-m-d H:i:s')), \" user_id = \".$userId);\n \n if($result === TRUE)\n {\n //this will prevent user from being logged out automatically. (as it happens in old implementation)\n $_SESSION['password'] = $this->value('password');\n \n //update the patient_history table with \"password change\" action to 'complete'\n $data = array(\n 'patient_id' => $userId,\n 'action_type' => 'first time login',\n 'action' => 'password change', \n 'action_status' => 'complete',\n 'action_time' => date('Y-m-d H:i:s')\n );\n $this->insert('patient_history', $data);\n \n echo \"{success:true, message:'Password updated successfully'}\";\n }\n else\n {\n echo \"{success:false, message:'Password update failure'}\";\n }\n }", "public function change_password()\n\t{\n\t \n\t \n \t\t/* Breadcrumb Setup Start */\n\t\t\n\t\t$link = breadcrumb();\n\t\t\n\t\t$data['breadcrumb'] = $link;\n\t\t\n\t\t/* Breadcrumb Setup End */\n\t\n\t\t$data['page_content']\t=\t$this->load->view('changepwd',$data,true);\n\t\t$this->load->view('page_layout',$data);\n\t}", "function changepass()\r\n{\r\n\t$session = $_SESSION[\"username\"];\t\r\n $Password = $_POST['txtPassword'];\r\n $Password2 = $_POST['txtPassword2'];\r\n\t\r\n\tif ($Password != $Password2)\r\n\t{\r\n\theader('Location: index.php?view=changepassword&alert=' . urlencode('PassWord Do not Match'));\r\n\t}\r\n\telse\r\n\t{\r\n\t\r\n\t$sql = \"UPDATE tbl_user \r\n\t SET user_password = PASSWORD('$Password')\r\n\t\t\t WHERE user_name = '$session'\";\r\n\r\n\tdbQuery($sql);\r\n\theader('Location: index.php?view=changepassword&alert=' . urlencode('You have Successfully Modified this User'));\r\n}\r\n}", "public function changePassword()\n {\n $this->validateOnly('password', [\n 'password' => 'bail|nullable|required_with:password_confirmation|string|confirmed',\n 'current_password' => 'bail|required',\n ]);\n\n if (!Hash::check($this->current_password, $this->user->password)) {\n $this->addError('current_password', 'Your current password is incorrect.');\n return;\n }\n\n $this->user->password = bcrypt($this->password);\n $this->user->save();\n $this->toast('Password has been changed!', 'success');\n $this->emit('password-updated');\n $this->reset(['password', 'password_confirmation', 'current_password']);\n }", "public function updatePassword(UserInterface $user);", "function change_password($username, $old_password, $new_password) {\n// return true or false\n\n // if the old password is right\n // change their password to new_password and return true\n // else throw an exception\n login($username, $old_password);\n $conn = db_connect();\n $result = $conn->query(\"update user\n set passwd = '\".$new_password.\"'\n where username = '\".$username.\"'\");\n if (!$result) {\n throw new Exception('Password could not be changed.');\n } else {\n return true; // changed successfully\n }\n}", "public function changePassword(){\n $user=User::find(auth()->id());\n $user->password=bcrypt(request('new_password'));\n $user->save();\n return response()->json('Password Updated Successfully');\n }", "public function change_user_credential() {\n\t\t$result = $this->user_model->update_user_password($this->session->userdata('user_id'), $_POST);\n\n\t\tif ($result['success']) {\n\t\t\t$this->session->set_flashdata('credential_change_successful', \"Password changed successfully.\");\n\t\t} else {\n\t\t\t$this->session->set_flashdata('credential_change_failed', $result['message']);\n\t\t}\n\n\t\tredirect(site_url('user/profile/credential'), 'refresh');\n\t}", "function setPassword( $user, $password ) {\n global $shib_pretend;\n\n return $shib_pretend;\n }", "function wp_set_password($password, $user_id)\n {\n }", "public function password(){\r\n\r\n\t\t\t$user_info = Helper_User::get_user_by_id($this->user_id);\r\n\r\n\t\t\tif($_POST){\r\n\r\n\t\t\t\t$formdata = form_post_data(array(\"old_password\", \"new_password\", \"repeat_new_password\"));\r\n\t\t\t\t\r\n\t\t\t\t$old_password = trim($formdata[\"old_password\"]);\r\n\t\t\t\t$new_password = trim($formdata[\"new_password\"]);\r\n\t\t\t\t$repeat_new_password = trim($formdata[\"repeat_new_password\"]);\r\n\r\n\t\t\t\t$error_flag = false;\r\n\r\n\t\t\t\tif(strlen($old_password) <= 0){\r\n\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the old password\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif(strlen($new_password) > 0 && strlen($repeat_new_password) > 0){\r\n\t\t\t\t\t\t// if both fields are not empty\r\n\r\n\t\t\t\t\t\tif(strlen($new_password) < 6){\r\n\t\t\t\t\t\t\t// the password cannot be less than 6 characters\r\n\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\tTemplate::notify(\"error\", \"Too short password. Password must be at least 6 characters long.\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// now compare the two new passwords\r\n\t\t\t\t\t\t\tif(strcmp($new_password, $repeat_new_password) !== 0){\r\n\t\t\t\t\t\t\t\t// both passwords are not same\r\n\t\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"error\", \"New Passwords do not match. Please try again.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the new password\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!$error_flag){\r\n\t\t\t\t\t// means there are no any errors\r\n\t\t\t\t\t// get the current user account from the database\r\n\t\t\t\t\t// if the old password matches with the one that the user entered\r\n\t\t\t\t\t// change the password, else throw an error\r\n\r\n\t\t\t\t\t$old_password_hash = Config::hash($old_password);\r\n\r\n\t\t\t\t\tif(strcmp($old_password_hash, trim($user_info->password)) === 0){\r\n\r\n\t\t\t\t\t\t\tif($this->change_password($new_password, $user_info)){\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"success\", \"Password changed successfully\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tredirect(Config::url(\"account\"));\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Wrong Old Password. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tConfig::set(\"active_link\", \"password\");\r\n\t\t\tConfig::set(\"page_title\", \"Change Account Password\");\r\n\r\n\t\t\t$view_data[\"user_info\"] = $user_info;\r\n\r\n\t\t\tTemplate::setvar(\"page\", \"account/password\");\r\n\t\t\tTemplate::set(\"account/template\", $view_data);\r\n\t\t}", "public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }", "public function editPassword($pword)\n\t\t{\n\t\t\tglobal $password;\n\t\t\tglobal $user_id;\n\t\t\n\t\t\t$pword = addslashes($pword);\n\n\t\t\tif(strlen($pword) <= 32)\n\t\t\t{\n\t\t\t$qry = 'UPDATE admin_table SET password = \"' . $pword . '\" WHERE user_id = '. $user_id;\n\t\t\t$result = mysql_query($qry, $GLOBALS['connection']);\n\t\t\t}\n\t\t\n\t\t\t$password = $pword;\n\t\t}", "function changePassword($userData)\n\t\t{\n\t\t\t$old_password = $this->manageContent->getValue_where('user_credentials', '*', 'user_id', $_SESSION['user_id']);\n\t\t\t\n\t\t\tif($old_password[0]['password'] == md5($userData['old_pass']))\n\t\t\t{\n\t\t\t\tif(!empty($userData['new_pass']) && $userData['new_pass'] == $userData['re_pass'])\n\t\t\t\t{\n\t\t\t\t\t$change_password = $this->manageContent->updateValueWhere('user_credentials', 'password', md5($userData['new_pass']), 'user_id', $_SESSION['user_id']);\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $change_password;\n\t\t}", "function reset_user_passwd($user_id) {\r\n\r\n //set the new password\r\n $new_passwd = \"newpasswod\";\r\n \r\n if ($new_passwd == false) {\r\n throw new Exception ('Could not generate the new password.');\r\n }\r\n \r\n //add numbers to the new passwd to increase the securtiy\r\n $rand_number = rand(0, 999);\r\n $new_passwd . $rand_number;\r\n \r\n //update the new passwd with db\r\n $conn = db_connect();\r\n\r\n $result = $conn->query(\"update users set user_passwd = sha1('\".$new_passwd.\"') where user_id = '\".$user_id.\"'\");\r\n if (!$result) {\r\n throw new Exception ('Could not reset the password.');\r\n }\r\n else {\r\n return true; \r\n }\r\n\r\n }", "public function change_password($data, $user_id) {\r\n\r\n // Start Backend Validation\r\n if (empty($data['old-pwd'])) {\r\n $this->errors['old-pwd'] = 'رجاء لا تترك هذا الحقل فارغا';\r\n }\r\n\r\n if (empty($data['new-pwd'])) {\r\n $this->errors['new-pwd'] = 'رجاء لا تترك هذا الحقل فارغا';\r\n } elseif (strlen($data['new-pwd']) < 8) {\r\n $this->errors['new-pwd'] = 'يجب على كلمة السر أن تتكون من 8 أحرف فأكثر';\r\n }\r\n\r\n if ($data['confirm-pwd'] != $data['new-pwd']) {\r\n $this->errors['confirm-pwd'] = 'كلمتا السر غير متطابقتان';\r\n }\r\n\r\n if (empty($this->errors)) {\r\n // Sanitize Data\r\n $old_pwd = sha1(filter_var($data['old-pwd'], FILTER_SANITIZE_STRING));\r\n $new_pwd = sha1(filter_var($data['new-pwd'], FILTER_SANITIZE_STRING));\r\n\r\n $user = $this->select('users', 'id', $user_id)->fetch_assoc();\r\n\r\n if ($user['password'] === $old_pwd) { // If Passwords Are Mached\r\n $connection = DB::connect();\r\n\r\n // Update The Password\r\n $stmt = \"UPDATE users SET password = '$new_pwd' WHERE id = '$user_id'\";\r\n $result = $connection->query($stmt);\r\n\r\n // Redirect To Profile Page\r\n $profile_url = DB::MAIN_URL . 'profile.php';\r\n header('location: ' . $profile_url);\r\n\r\n } else {\r\n $this->errors['old-pwd'] = 'كلمة السر غير صحيحة';\r\n }\r\n\r\n }\r\n\r\n }", "public function changePassword(User $user){\n //username+emp-id+current-year\n $password = $user->username.$user->profile->emp_id.\\Carbon\\Carbon::now()->year;\n $user->update(['password' => $password]);\n return redirect()\n ->back()\n ->with('status','Password reseted');\n }", "public function savePasswordToUser($user, $password);", "public function resetPassword();", "function changePassword($newpass) {\n\t\tif ($this->id == null || $this->id == 0) return false;\n\n\t\t$db = getDb();\n\n\t\t$update_query = \"UPDATE user_table SET\n\t\tuser_password = $newpass\n\t\tWHERE user_id = '$this->id';\";\n\n\t\t$result = mysqli_query($db, $update_query);\n\n\t\tmysqli_close($db);\n\n\t\tif (!$result) return false;\n\n\t\treturn true;\n\n\t}", "public function changePass($data = NULL){\r\n $username = Zend_Auth::getInstance()->getIdentity()->username;\r\n\t\t\r\n\t\tif($this->checkPassold($username, trim($data['passold']))){\r\n\t\t\t//Update password\r\n\t \t$bind = array('password' => md5(trim($data['passnew'])));\r\n\t \t$this->update($bind, \"username='\".$username.\"'\");\r\n \t\r\n\t\t\treturn TRUE;\r\n\t\t}else{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t}", "public function userPasswordUpdate() {\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $this->request->input(\"user_id\")]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n }", "function set_password($string) {\r\n echo PHP_EOL;\r\n $this->action(\"setting new password of: $string\");\r\n $this->hashed_password = hash('sha256', $string . $this->vehicle_salt);\r\n $this->action(\"successfully set new password\");\r\n }", "public function actionchangePassword() {\n if (isset($_POST['password'])) {\n\n $userid = Yii::app()->user->getState('userid');\n $model = HhUsers::model()->findByPk($userid);\n if ($model->password == md5($_POST['password'])) {\n\n $model->password = md5($_POST['newpassword']);\n if ($model->save()) {\n $this->redirect('index');\n }\n }\n }\n $this->render('changePassword');\n }", "public function setNewPassword($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_92'));\n\t\tif(!Validator::AccountPassword($value)) throw new Exception(lang('error_92'));\n\t\t\n\t\t$this->_newPassword = $value;\n\t}", "public function change()\r\n {\r\n// var_dump($this->validate());die;\r\n if ($this->validate()) {\r\n $user = $this->_user; \r\n $user->setPassword($this->newPwd);\r\n $user->removePasswordResetToken();\r\n return $user->save(false);\r\n }\r\n \r\n return false;\r\n }", "public function change_user_password($storeid,$password)\r\n\t{\r\n\t\t$this->db->where('storeid', $storeid);\r\n\t\t$pass=$this->encrypt_decrypt('encrypt', $password);\r\n\t\t$data=array('password'=>$pass);\r\n\t\t$result=$this->db->update('user', $data);\r\n\t\treturn $result;\r\n\t}", "public function changePasswordAction()\n {\n $form = new Form\\Password();\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $userModel = new Model\\Users();\n $identity = $this->_auth ->getIdentity();\n $userId = $identity->getId();\n $user = $userModel->getUser($userId);\n $result = $userModel->savePassword($user, $form->getValue('new_password'), $form->getValue('password'));\n\n if ($result) {\n $this->_helper->getHelper('FlashMessenger')->addMessage('Your password was changed.'); \n } else {\n $this->_helper->getHelper('FlashMessenger')->addMessage('Your password was NOT changed.');\n }\n $this->_redirect($this->getRequest()->getRequestUri());\n }\n $this->view->passwordForm = $form;\n }", "function SetPassword ( $p )\n {\n $this->username = isset( $_SESSION [ \"username\" ] ) ? sanitize_string( $_SESSION [ \"username\" ] ) : null;\n if ( !$this->username ) {\n $this->username = isset( $_COOKIE [ \"username\" ] ) ? sanitize_string( $_COOKIE [ \"username\" ] ) : null;\n }\n $this->mongo->setCollection( COLLECTION_ADMINS );\n $this->mongo->dataUpdate( array( \"username\" => $this->username ), array( '$set' => array( \"password\" => sha1( $p ) ) ) );\n }", "public function selfChangePassword()\n\t{\n\t\tif (!$this->userService->changePassword(Input::all()))\n\t\t{\n\t\t\treturn Redirect::route('user-profile', array('tab' => 'account'))->withErrors($this->userService->errors())->withInput();\n\t\t}\n\n\t\tAlert::success('Your password has been successfully changed.')->flash();\n\n\t\treturn Redirect::route('user-profile', array('tab' => 'account'));\n\t}", "public function changepassAction()\n {\n $user_service = $this->getServiceLocator()->get('user');\n\n $token = $this->params()->fromRoute('token');\n $em = EntityManagerSingleton::getInstance();\n $user = null;\n\n if ($this->getRequest()->isPost())\n {\n $data = $this->getRequest()->getPost()->toArray();\n $user = $em->getRepository('Library\\Model\\User\\User')->findOneByToken($token);\n\n if (!($user instanceof User))\n {\n throw new \\Exception(\"The user cannot be found by the incoming token\");\n }\n\n $user_service->changePassword($data, $user);\n $em->flush();\n }\n\n return ['user' => $user];\n }", "public function password()\n {\n $this->isUser();\n\n $this->data['noCabinetOrAdmin'] = true;\n\n if ($_POST) {\n\n if (!$_POST['old-password'] && !$_POST['new-password']) {\n\n $userModel = new UserModel();\n\n $validateResult = $userModel->validate($_POST);\n\n if ($validateResult === true) {\n\n $checkPassword = $userModel->checkOldPassword($_POST['old-password']);\n\n if ($checkPassword) {\n\n if ($userModel->refreshPassword($_POST)) {\n\n $this->data['success'] = 'Пароль успешно изменен';\n\n } else {\n\n $this->data['warning'] = 'Произошла ошибка';\n }\n\n } else {\n\n $this->data['warning'] = 'Старый пароль введен не правильно';\n }\n\n } else {\n\n $this->data['warning'] = $validateResult;\n }\n\n } else {\n\n $this->data['warning'] = 'Все поля должны быть заполнены';\n }\n }\n\n $this->render('password');\n }", "function changePassword($userID, $password, $newPassword) {\n global $log, $mysqli;\n\n $currentUserID = $_SESSION['user_id'];\n $query = \"SELECT admin, pswd FROM users WHERE id='$currentUserID'\";\n $results = $mysqli->query($query);\n\n // Check that there is exactly one matching user\n if ($results && $results->num_rows === 1) {\n $currentUser = $results->fetch_assoc();\n\n if (!password_verify($password, $currentUser['pswd'])) {\n return 'Incorrect user password.';\n }\n\n if ($currentUserID === $userID || $currentUser['admin']) {\n updatePassword($userID, $newPassword);\n return true;\n }\n\n return 'Unauthorized.';\n }\n\n return 'Incorrect username.';\n}", "function change_pwd_update_register(){\n\t\tglobal $CFG;\n\t\t$old_password = $this->My_addslashes(md5($_POST[\"old_password\"]));\n\t\t \n\t\t$new_password = md5($_POST[\"new_password\"]);\n\t \n\t\tif($this->chkPasswordInAdmin($old_password,$_SESSION['adminid'])){\n\t\t\t\t$UpQuery = \"UPDATE \".$CFG['table']['admin'].\" SET password = '\".$this->filterInput($new_password).\"' WHERE admin_id = \". $this->filterInput($_SESSION['adminid']);\n\t\t\t\t$UpResult = mysql_query($UpQuery) or die($this->mysql_error($UpQuery));\n\t\t\t}\n\t\telse{\t\n\t\t\techo \"Invalid_Old_Pwd\";\t\t\t\n\t\t\texit();\n\t\t\t}\n\t}", "public function changePassword(Sh4bangUserInterface $user, string $newPassword): void\r\n {\r\n $password = $this->passwordEncoder->encodePassword($user, $newPassword);\r\n $user->setPassword($password);\r\n }", "public function update_password($id, $password);", "public function changePassword($newPWD){\r\n\t\tif($this::isLoggedIn()){\r\n\r\n\t\t\tdefined(\"INCLUDING\") or\r\n\t\t\t\tdefine(\"INCLUDING\", 'TRUE');\r\n\t\t\trequire_once \"./database.php\";\r\n\t\t\t\r\n\t\t\t$db = Database::getInstance();\r\n\t\t\t$mysqli = $db->getConnection();+\r\n\t\t\t\r\n\t\t\t$new_password = password_hash($newPWD, PASSWORD_DEFAULT);\r\n\t\t\t\r\n\t\t\t$sql = \"UPDATE UTENTI SET PWD=? WHERE ID=?\";\r\n\t\t\t$q = $mysqli->prepare($sql);\r\n\t\t\t$q->bind_param('si', $new_password,$this->id);\r\n\t\t\tif($q->execute()){\r\n\t\t\t\tif($q->get_result()){\r\n\t\t\t\t\treturn true;}\r\n\t\t\t\telse return false;\r\n\t\t\t}\r\n\t\t\telse throw new Exception(\"Impossibile cambiare password\");\r\n\t\r\n\t\t}\t\r\n\r\n\t}", "function password_update($password) {\n\t\t$hash = hash_password($password);\n\t\tlgi_mysql_query(\"UPDATE %t(users) SET `passwd_hash`='%%' WHERE `name`='%%'\",$hash, $this->userid);\n\t}", "public function testUpdatePasswordNotGiven(): void { }", "public function changePassword() {\n $this->form_validation->set_rules('email', 'Email', 'required');\n $this->form_validation->set_rules('password', 'Altes Passwort', 'required');\n $this->form_validation->set_rules('new_password', 'Neues Passwort', 'required');\n\n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n $this->loadUser();\n \n\t\tif (!password_verify(\n\t\t\t$this->input->post('password'),\n\t\t\t$this->user_model->getValue('hashed_password'))) \n\t\t{\n\t\t\t$this->error(404, 'Verification error');\n\t\t}\n\t\t\n\t\t/*\n \tif ($this->user_model->getValue('confirmed') == 0) {\n \t\t$this->error(402, 'Account not confirmed');\n \t}\n \t*/\n \t\n \t$this->user_model->setValue(\n \t\t'hashed_password',\n \t\tpassword_hash($this->input->post('new_password'), PASSWORD_DEFAULT));\n \t\t\n \tif (! $this->user_model->updatePassword()) {\n \t\t$this->error(400, 'Password could not be updated');\n \t}\n \t\n $data['new password'] = 'set';\n $this->response($data);\n }", "public function change_password() {\n header('Content-Type: application/json');\n $this->autoRender = false;\n $this->User->recursive = -1;\n if ($this->request->is('post')) {\n $user = $this->User->findByEmail($this->request->data['User']['email'], array('User.id', 'User.email', 'User.password'));\n if (!empty($user)) {\n $oldPassword = AuthComponent::password($this->request->data['User']['old_password']);\n if ($user['User']['password'] == $oldPassword) {\n $newPassword = $this->request->data['User']['new_password'];\n $data = array(\n 'id' => $user['User']['id'],\n 'password' => AuthComponent::password($newPassword)\n );\n $this->User->save($data);\n die(json_encode(array('success' => true, 'msg' => 'Succeed to change password')));\n \n } else \n die(json_encode(array('success' => false, 'msg' => 'Wrong old password')));\n \n } else\n die(json_encode(array('success' => false, 'msg' => 'Email address not found.')));\n }\n }" ]
[ "0.86941385", "0.8672989", "0.8381871", "0.8345224", "0.821856", "0.8167153", "0.8142631", "0.8066681", "0.79199207", "0.78304094", "0.7826644", "0.7824351", "0.78050786", "0.77578163", "0.771736", "0.7708882", "0.7681856", "0.7671913", "0.7668545", "0.76655656", "0.7659713", "0.76361495", "0.7629469", "0.76221585", "0.7620622", "0.7613936", "0.7605194", "0.75978744", "0.7592465", "0.75845873", "0.75711966", "0.7564402", "0.75422466", "0.754223", "0.7541246", "0.75355285", "0.7534326", "0.7499454", "0.74916816", "0.74830586", "0.7460162", "0.7447599", "0.741683", "0.7416707", "0.7412363", "0.74105406", "0.7405389", "0.7401877", "0.73842007", "0.7374018", "0.73708445", "0.7368799", "0.73537195", "0.7349574", "0.7346672", "0.73440975", "0.73408556", "0.73218", "0.73218", "0.73218", "0.7315579", "0.7312414", "0.7294961", "0.72787035", "0.7277839", "0.7276848", "0.7261329", "0.7258944", "0.725692", "0.7247708", "0.72422105", "0.7240635", "0.7223425", "0.7213021", "0.72094506", "0.72014624", "0.71966016", "0.71916777", "0.7158904", "0.7153425", "0.7151443", "0.714", "0.7138447", "0.71380216", "0.7127473", "0.7126861", "0.7126204", "0.71170515", "0.7110613", "0.7105881", "0.7105497", "0.7099346", "0.7098869", "0.7097231", "0.7096153", "0.709348", "0.70901096", "0.70841694", "0.7084048", "0.70728654", "0.7072566" ]
0.0
-1
Initiate OpenID authentication sequence; Return FALSE on failure or redirect to OpenID provider URL
function auth($proxy=NULL,$attr=[],array $reqd=NULL) { $fw=\Base::instance(); $root=$fw->SCHEME.'://'.$fw->HOST; if (empty($this->args['trust_root'])) $this->args['trust_root']=$root.$fw->BASE.'/'; if (empty($this->args['return_to'])) $this->args['return_to']=$root.$_SERVER['REQUEST_URI']; $this->args['mode']='checkid_setup'; if ($this->url=$this->discover($proxy)) { if ($attr) { $this->args['ns.ax']='http://openid.net/srv/ax/1.0'; $this->args['ax.mode']='fetch_request'; foreach ($attr as $key=>$val) $this->args['ax.type.'.$key]=$val; $this->args['ax.required']=is_string($reqd)? $reqd:implode(',',$reqd); } $var=[]; foreach ($this->args as $key=>$val) $var['openid.'.$key]=$val; $fw->reroute($this->url.'?'.http_build_query($var)); } return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function openidloginAction()\n {\n if(!OPENID_ACTIVE){\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::OPEN_ID_NOT_ACTIVE));\n }\n if(empty($_POST[User::INPUT_OPENID_IDENTITY ])){\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::MISSING_POST_IDENTITY));\n }\n\n // 1st loop - will not return after authenticate() if everything went well\n $authAdapter = new Zend_Auth_Adapter_OpenId($_POST[User::INPUT_OPENID_IDENTITY]);\n $result = $authAdapter->authenticate();\n\n // This should only happen in case of bad OpenId identity:\n $messages = $result->getMessages();\n $code = $result->getCode();\n $message = \"OpenId authentication failed. Code : $code\".PHP_EOL;\n $message .= implode($messages, ', ');\n Globals::getLogger()->security($message, Zend_Log::NOTICE);\n\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::BAD_IDENTITY));\n }", "public function openidredirectAction()\n {\n if(!OPENID_ACTIVE){\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::OPEN_ID_NOT_ACTIVE));\n }\n if(empty($_GET[User::INPUT_OPENID_GET_IDENTITY])){\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::MISSING_GET_IDENTITY));\n }\n\n // 2nd loop\n $authAdapter = new Zend_Auth_Adapter_OpenId();\n $result = $authAdapter->authenticate();\n if (!$result->isValid()) {\n $this->_onLoginError($result->getMessages(), $result->getCode());\n }\n\n $userTable = new User();\n $where = $userTable->getAdapter()->quoteInto(User::COLUMN_OPENID_IDENTITY . \" = ?\", $_GET[User::INPUT_OPENID_GET_IDENTITY]);\n $user = $userTable->fetchRow($where);\n if(in_array($user->status, array(\n \t\tUser::STATUS_BANNED,\n \t\tUser::STATUS_GUEST,\n \t\tUser::STATUS_PENDING,\n \t))){\n $user = null;\n }\n if(!$user){\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::NO_USER_FOR_GIVEN_IDENTITY));\n }\n\n $this->_onLoginSuccess($user);\n }", "function logon($params) {\n\t\tglobal $db_prefix, $settings;\n\n\t\t// step 1: redirect to the openid provider of choice\n\n\t\t// do we have a (valid) openid URL?\n\t\tif (isset($params['openid_url']) && isURL($params['openid_url'])) {\n\t\t\t// load the openid class, and redirect to the openid provider\n\t\t\trequire_once(PATH_INCLUDES.\"authentication/class.openid.php\");\n\t\t\t$openid = new SimpleOpenID;\n\t\t\t$openid->SetIdentity($params['openid_url']);\n\t\t\t$openid->SetApprovedURL($settings['siteurl'].\"setuser.php\");\n\t\t\t$openid->SetTrustRoot($settings['siteurl']);\n\t\t\t$server_url = $openid->GetOpenIDServer();\n\t\t\tif ($server_url) {\n\t\t\t\tredirect($openid->GetRedirectURL() , \"script\");\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\t// step 2: validate the openid provider return information\n\n\t\tif (isset($params['openid_mode'])) {\n\t\t\t// handle openid login\n\t\t\trequire_once(PATH_INCLUDES.\"authentication/class.openid.php\");\n\t\t\t$openid = new SimpleOpenID;\n\t\t\t$openid->SetIdentity(urldecode($_GET['openid_identity']));\n\t\t\tif ($openid->ValidateWithServer()) {\n\t\t\t\t$openid_url = strtolower($openid->OpenID_Standarize($_GET['openid_identity']));\n\t\t\t\t$result = dbquery(\"SELECT * FROM \".$db_prefix.\"users WHERE user_openid_url='\".$openid_url.\"'\");\n\t\t\t\tif (dbrows($result) == 0) {\n\t\t\t\t\t// not found, display an error message\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\t// retrieve the record and store it for retrieval\n\t\t\t\t\t$this->userrecord = dbarray($result);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttrigger_error($openid->GetError());\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function authenticate() {\n $id = $this->_id;\n if (!empty($id)) {\n $consumer = new Zend_OpenId_Consumer($this->_storage);\n $consumer->setHttpClient($this->_httpClient);\n /* login() is never returns on success */\n if (!$this->_check_immediate) {\n if (!$consumer->login($id,\n $this->_returnTo,\n $this->_root,\n $this->_extensions,\n $this->_response)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n } else {\n if (!$consumer->check($id,\n $this->_returnTo,\n $this->_root,\n $this->_extensions,\n $this->_response)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n }\n } else {\n $params = (isset($_SERVER['REQUEST_METHOD']) &&\n $_SERVER['REQUEST_METHOD']=='POST') ? $_POST: $_GET;\n $consumer = new Zend_OpenId_Consumer($this->_storage);\n $consumer->setHttpClient($this->_httpClient);\n if ($consumer->verify(\n $params,\n $id,\n $this->_extensions)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::SUCCESS,\n $id,\n [\"Authentication successful\"]);\n } else {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n }\n }", "function simpleid_checkid_login_required($request) {\n global $version;\n \n if ($version >= OPENID_VERSION_2) {\n $message = array('openid.mode' => 'setup_needed');\n } else { \n $message = array(\n 'openid.mode' => 'id_res',\n 'openid.user_setup_url' => simpleid_url('login', 'destination=continue&s=' . rawurlencode(pickle($request)))\n );\n }\n \n $message = array_merge($message, extension_invoke_all('response', FALSE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "function simpleid_checkid_ok($request) {\n global $version;\n \n $message = array(\n 'openid.mode' => 'id_res',\n 'openid.op_endpoint' => simpleid_url(),\n 'openid.response_nonce' => openid_nonce()\n );\n \n if (isset($request['openid.assoc_handle'])) $message['openid.assoc_handle'] = $request['openid.assoc_handle'];\n if (isset($request['openid.identity'])) $message['openid.identity'] = $request['openid.identity'];\n if (isset($request['openid.return_to'])) $message['openid.return_to'] = $request['openid.return_to'];\n \n if (($version >= OPENID_VERSION_2) && isset($request['openid.claimed_id'])) {\n $message['openid.claimed_id'] = $request['openid.claimed_id'];\n }\n \n $message = array_merge($message, extension_invoke_all('response', TRUE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "function checkAuth($doRedirect) {\n\t\tif (isset($_SESSION[\"onidid\"]) && $_SESSION[\"onidid\"] != \"\") return $_SESSION[\"onidid\"];\n\n\t\t// create URL as callback\n\t\t$pageURL = 'http';\n\t\tif (isset($_SERVER[\"HTTP\"]) && $_SERVER[\"HTTP\"] == \"on\") {$pageURL .= \"s\";}\n\t\t$pageURL .= \"://\";\n\t\tif ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"SCRIPT_NAME\"];\n\t\t} else {\n\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"SCRIPT_NAME\"];\n\t\t}\n\n\t\t// check for ticket\n\t\t$ticket = isset($_REQUEST[\"ticket\"]) ? $_REQUEST[\"ticket\"] : \"\";\n\n\t\t// if ticket then set ONID session, else send to login\n\t\tif ($ticket != \"\") {\n\t\t\t$url = \"https://login.oregonstate.edu/cas/serviceValidate?ticket=\".$ticket.\"&service=\".$pageURL;\n\t\t\t$html = file_get_contents($url);\n\t\t\t$onididPattern = '/\\\\<cas\\\\:user\\\\>([a-zA-Z0-9]+)\\\\<\\\\/cas\\\\:user\\\\>/';\n\t\t\t$firstnamePattern = '/\\\\<cas\\\\:firstname\\\\>([a-zA-Z0-9]+)\\\\<\\\\/cas\\\\:firstname\\\\>/';\n\t\t\t$lastnamePattern = '/\\\\<cas\\\\:lastname\\\\>([a-zA-Z0-9]+)\\\\<\\\\/cas\\\\:lastname\\\\>/';\n\t\t\tpreg_match($onididPattern, $html, $onididMatches);\n\t\t\tpreg_match($firstnamePattern, $html, $firstnameMatches);\n\t\t\tpreg_match($lastnamePattern, $html, $lastnameMatches);\n\t\t\tif ($onididMatches && count($onididMatches) > 0 && $firstnameMatches && count($firstnameMatches) > 0 && $lastnameMatches && count($lastnameMatches) > 0) {\n\t\t\t\t$onidid = $onididMatches[1];\n\t\t\t\t$_SESSION[\"onidid\"] = $onidid;\n\n\t\t\t\t$firstname = $firstnameMatches[1];\n\t\t\t\t$_SESSION['firstname'] = $firstname;\n\n\t\t\t\t$lastname = $lastnameMatches[1];\n\t\t\t\t$_SESSION['lastname'] = $lastname;\n\n\t\t\t\t$_SESSION[\"ticket\"] = $ticket;\n\t\t\t\treturn $onidid;\n\t\t\t}\n\t\t} else if ($doRedirect) {\n\t\t\t$url = \"https://login.oregonstate.edu/cas/login?service=\".$pageURL;\n\t\t\techo \"<script>location.replace('\" . $url . \"');</script>\";\n\t\t}\n\n\t\treturn \"\";\n\t}", "protected function Login()\n {\n $this->redirectParams[\"openid.realm\"] = $this->config[\"realm\"];\n $this->redirectParams[\"openid.return_to\"] = $this->config[\"return_to\"];\n\n $params = http_build_query($this->redirectParams);\n\n $url = $this->urlAuthorize . \"?$params\";\n\n header(\"Location: $url\");\n exit();\n }", "function processopenidresponse() {\n\t\t$consumer = new Auth_OpenID_Consumer(new OpenIDStorage(), new SessionWrapper());\n\n\t\t$trust_root = Director::absoluteBaseURL();\n\t\t$return_to_url = $trust_root . $this->Link('ProcessOpenIDResponse');\n\n\t\t// Complete the authentication process using the server's response.\n\t\t$response = $consumer->complete($return_to_url);\n\n\t\tif($response->status == Auth_OpenID_SUCCESS) {\n\t\t\tSession::clear(\"FormInfo.Form_RegistrationWithOpenIDForm.data\");\n\t\t\t$openid = $response->identity_url;\n\n\t\t\tif($response->endpoint->canonicalID) {\n\t\t\t\t$openid = $response->endpoint->canonicalID;\n\t\t\t}\n\n\t\t\t$sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response);\n\t\t\t$sreg = $sreg_resp->contents();\n\n\t\t\t// Convert the simple registration data to the needed format\n\t\t\t// try to split fullname to get firstname and surname\n\t\t\t$data = array('IdentityURL' => $openid);\n\t\t\tif(isset($sreg['nickname']))\n\t\t\t\t$data['Nickname'] = $sreg['nickname'];\n\t\t\tif(isset($sreg['fullname'])) {\n\t\t\t\t$fullname = explode(' ', $sreg['fullname'], 2);\n\t\t\t\tif(count($fullname) == 2) {\n\t\t\t\t\t$data['FirstName'] = $fullname[0];\n\t\t\t\t\t$data['Surname'] = $fullname[1];\n\t\t\t\t} else {\n\t\t\t\t\t$data['Surname'] = $fullname[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($sreg['country']))\n\t\t\t\t$data['Country'] = $sreg['country'];\n\t\t\tif(isset($sreg['email']))\n\t\t\t\t$data['Email'] = $sreg['email'];\n\n\t\t\tSession::set(\"FormInfo.Form_RegistrationForm.data\", $data);\n\t\t\treturn $this->redirect($this->Link('register'));\n\t\t}\n\n\n\t\t// The server returned an error message, handle it!\n\t\tif($response->status == Auth_OpenID_CANCEL) {\n\t\t\t$error_message = _t('ForumMemberProfile.CANCELLEDVERIFICATION','The verification was cancelled. Please try again.');\n\t\t} else if($response->status == Auth_OpenID_FAILURE) {\n\t\t\t$error_message = _t('ForumMemberProfile.AUTHENTICATIONFAILED','The OpenID/i-name authentication failed.');\n\t\t} else {\n\t\t\t$error_message = _t('ForumMemberProfile.UNEXPECTEDERROR','An unexpected error occured. Please try again or register without OpenID');\n\t\t}\n\n\t\t$this->RegistrationWithOpenIDForm()->addErrorMessage(\"Blurb\",\n\t\t\t$error_message, 'bad');\n\n\t\treturn $this->redirect($this->Link('registerwithopenid'));\n\t}", "function simpleid_checkid_approval_required($request) {\n global $version;\n \n if ($version >= OPENID_VERSION_2) {\n $message = array('openid.mode' => 'setup_needed');\n } else {\n $request['openid.mode'] = 'checkid_setup';\n $message = array(\n 'openid.mode' => 'id_res', \n 'openid.user_setup_url' => simpleid_url('continue', 's=' . rawurlencode(pickle($request)))\n );\n }\n \n $message = array_merge($message, extension_invoke_all('response', FALSE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "function simpleid_check_authentication($request) {\n global $version;\n \n log_info('OpenID direct verification: ' . log_array($request));\n \n $is_valid = simpleid_verify_signatures($request);\n\n if ($is_valid) {\n $response = array('is_valid' => 'true');\n } else {\n $response = array('is_valid' => 'false');\n }\n \n // RP wants to check whether a handle is invalid\n if (isset($request['openid.invalidate_handle'])) {\n $invalid_assoc = cache_get('association', $request['openid.invalidate_handle']);\n \n if (!$invalid_assoc || ($invalid_assoc['created'] + SIMPLEID_ASSOC_EXPIRES_IN < time())) {\n // Yes, it's invalid\n $response['invalidate_handle'] = $request['openid.invalidate_handle'];\n }\n }\n\n log_info('OpenID direct verification response: ' . log_array($response));\n \n openid_direct_response(openid_direct_message($response, $version));\n}", "protected function authOpenId($client)\n {\n $request = Yii::$app->getRequest();\n $mode = $request->get('openid_mode', $request->post('openid_mode'));\n\n if (empty($mode)) {\n $url = $client->buildAuthUrl();\n return Yii::$app->getResponse()->redirect($url);\n }\n\n switch ($mode) {\n case 'id_res':\n if ($client->validate()) {\n return $this->authSuccess($client);\n }\n throw new HttpException(400, 'Unable to complete the authentication because the required data was not received.');\n case 'cancel':\n return $this->authCancel($client);\n default:\n throw new HttpException(400);\n }\n }", "protected function Auth()\n {\n if( !$this->Validate() ){\n throw new Exception(\"The connection could not be validated\");\n }\n\n $search = $_GET[\"openid_identity\"];\n $steamid = substr($search, strrpos($search, '/') + 1);\n \n $infos = $this->GetInfos($steamid);\n \n $infos = $this->ParseData($infos);\n\n $_SESSION[\"user\"] = $infos;\n\n $url = $this->redirectParams[\"openid.return_to\"];\n\n header(\"Location: $url\");\n exit(); \n }", "public function redirectToLogin() {\n\t\t//\tcreate and save the state parameter\n\t\t$openIdStateMap =& storageFindOrCreate( \"openIdStateMap\" );\n\t\t$state = generatePassword(10);\n\t\t$openIdStateMap[ $state ] = $this->code;\n\n\t\t//\tcreate the URL\n\t\t$config = $this->getConfig();\n\t\t$request = new HttpRequest( $config[\"authorization_endpoint\"], \"GET\", array( \n\t\t\t\"response_type\" => \"code\",\n\t\t\t\"scope\" => $this->scope,\n\t\t\t\"client_id\" => $this->clientId,\n\t\t\t\"state\" => $state,\n\t\t\t\"redirect_uri\" => projectURL() . GetTableLink(\"openidcallback\")\n\t\t));\n\n\t\theader( \"Location: \" . $request->getUrl() );\n\t}", "public function samllogin()\n {\n log_message('debug', 'Make a samlauth request against IDP');\n $samlSettings = new SamlSettings();\n $authRequest = new \\OneLogin_Saml2_Auth($samlSettings->getSamlSettings());\n $url = $authRequest->login();\n $this->response->redirect($url);\n }", "function simpleid_process_openid($request) {\n global $version;\n \n $version = openid_get_version($request);\n \n switch ($request['openid.mode']) {\n case 'associate':\n simpleid_associate($request);\n return;\n case 'checkid_immediate':\n case 'checkid_setup':\n return simpleid_checkid($request);\n case 'check_authentication':\n simpleid_check_authentication($request);\n break;\n default:\n if (isset($request['openid.return_to'])) {\n // Indirect communication - send error via indirect communication.\n header_response_code('404 Bad Request');\n set_message('Invalid OpenID message.');\n page_dashboard();\n } else {\n // Direct communication\n openid_direct_error('Invalid OpenID message.');\n }\n }\n}", "public function actionLogin() {\n if (isset($_GET['type'])) {\n try {\n /*\n * Do not hard code the host url\n * load host url from app.ini file\n */\n $openid = new LightOpenID(Yii::app()->params['host']);\n\n if (!$openid->mode) {\n /*\n * Check Whether OpenID (1.1 and 2.0) authentication is Google or Yahoo!\n */\n if ($_GET['type'] == 'google') {\n $openid->identity = Yii::app()->params['openid.google'];\n } elseif ($_GET['type'] == 'yahoo') {\n $openid->identity = Yii::app()->params['openid.yahoo'];\n }\n $openid->required = array('namePerson', 'contact/email');\n $openid->optional = array('namePerson/friendly');\n header('Location: ' . $openid->authUrl());\n return;\n } elseif ($openid->mode == 'cancel') {\n Yii::app()->user->setFlash('info', 'User has cancelled authentication!');\n } else {\n\n if ($openid->validate()) {\n\n $authData = $openid->getAttributes();\n\n $model = new LoginForm(LoginForm::TYPE_OPENID);\n $model->attributes = array(\n 'username' => $authData['contact/email'],\n 'type' => LoginForm::TYPE_OPENID,\n 'name' => isset($authData['namePerson']) ? @$authData['namePerson'] : @$authData['namePerson/friendly'],\n );\n\n if ($model->validate() && $model->login()) {\n Yii::app()->user->setFlash('success', '<strong>Successfully authenticated!</strong>. Welcome ' . $authData['contact/email']);\n $this->redirect(Yii::app()->user->returnUrl);\n return;\n } else {\n Yii::app()->user->setFlash('error', 'Validation error!');\n $this->redirect(Yii::app()->homeUrl);\n return;\n }\n } else {\n Yii::app()->user->setFlash('error', 'User was not authenticated!');\n $this->redirect(Yii::app()->user->returnUrl);\n return;\n }\n $this->redirect(Yii::app()->user->returnUrl);\n return;\n }\n } catch (ErrorException $e) {\n Yii::app()->user->setFlash('error', 'Exception!');\n $this->redirect(Yii::app()->homeUrl);\n return;\n }\n }\n\n $model = new LoginForm;\n\n // if it is ajax validation request\n if (isset($_POST['ajax']) && $_POST['ajax'] === 'login-form') {\n echo CActiveForm::validate($model);\n Yii::app()->end();\n }\n\n // collect user input data\n if (isset($_POST['LoginForm'])) {\n $model->attributes = $_POST['LoginForm'];\n // validate user input and redirect to the previous page if valid\n if ($model->validate() && $model->login())\n $this->redirect(Yii::app()->user->returnUrl);\n }\n // display the login form\n $this->render('login', array('model' => $model));\n }", "function verified($proxy=NULL) {\n\t\tpreg_match_all('/(?<=^|&)openid\\.([^=]+)=([^&]+)/',\n\t\t\t$_SERVER['QUERY_STRING'],$matches,PREG_SET_ORDER);\n\t\tforeach ($matches as $match)\n\t\t\t$this->args[$match[1]]=urldecode($match[2]);\n\t\tif (isset($this->args['mode']) &&\n\t\t\t$this->args['mode']!='error' &&\n\t\t\t$this->url=$this->discover($proxy)) {\n\t\t\t$this->args['mode']='check_authentication';\n\t\t\t$var=[];\n\t\t\tforeach ($this->args as $key=>$val)\n\t\t\t\t$var['openid.'.$key]=$val;\n\t\t\t$req=\\Web::instance()->request(\n\t\t\t\t$this->url,\n\t\t\t\t[\n\t\t\t\t\t'method'=>'POST',\n\t\t\t\t\t'content'=>http_build_query($var),\n\t\t\t\t\t'proxy'=>$proxy\n\t\t\t\t]\n\t\t\t);\n\t\t\treturn (bool)preg_match('/is_valid:true/i',$req['body']);\n\t\t}\n\t\treturn FALSE;\n\t}", "public function authenticate(&$state) {\n assert('is_array($state)');\n\n /* We are going to need the authId in order to retrieve this authentication source later. */\n $state[self::AUTHID] = $this->authId;\n $id = SimpleSAML\\Auth\\State::saveState($state, self::STAGEID);\n\n $url = SimpleSAML\\Module::getModuleURL('mobileid/mobileidlogin.php');\n SimpleSAML\\Utilities::redirect($url, array('AuthState' => $id));\n }", "function login() {\n $provider = \\Iternova\\Common\\Controller::get( 'provider' );\n\n // Proveedor\n switch ( $provider ) {\n case 'yahoo':\n $openid_url = 'http://me.yahoo.com';\n break;\n case 'google':\n $openid_url = 'https://www.google.com/accounts/o8/id';\n break;\n case 'facebook':\n $openid_url = 'facebook.anyopenid.com';\n break;\n case 'twitter':\n $openid_url = 'twitter.anyopenid.com';\n break;\n }\n\n if ( $provider === 'yahoo' || $provider === 'google' ) {\n // Usamos openID\n $openid = new LightOpenID;\n $openid->identity = $openid_url;\n $openid->returnUrl = 'http://zgzagua.es?action=login_confirm';\n $openid->required = [ 'namePerson/friendly', 'contact/email', 'namePerson', 'identityProvider/userId' ];\n echo '<script type=\"text/javascript\">$(location).attr(\\'href\\',\\'' . $openid->authUrl() . '\\');</script>';\n } elseif ( $provider === 'twitter' ) {\n // Usamos twitter oauth\n /* Start session and load library. */\n require_once( 'libs/twitter/twitteroauth/twitteroauth.php' );\n require_once( 'libs/twitter/config.php' );\n\n /* Build TwitterOAuth object with client credentials. */\n $connection = new TwitterOAuth( CONSUMER_KEY, CONSUMER_SECRET );\n\n /* Get temporary credentials. */\n $request_token = $connection->getRequestToken( OAUTH_CALLBACK );\n\n /* Save temporary credentials to session. */\n $_SESSION[ 'oauth_token' ] = $token = $request_token[ 'oauth_token' ];\n $_SESSION[ 'oauth_token_secret' ] = $request_token[ 'oauth_token_secret' ];\n echo '<script type=\"text/javascript\">$(location).attr(\\'href\\',\\'' . $connection->getAuthorizeURL( $token ) . '\\');</script>';\n }\n }", "public function handle($params=null, $extensions=null,\n Zend_Controller_Response_Abstract $response = null)\n {\n if ($params === null) {\n if ($_SERVER[\"REQUEST_METHOD\"] == \"GET\") {\n $params = $_GET;\n } else if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n $params = $_POST;\n } else {\n return false;\n }\n }\n $version = 1.1;\n if (isset($params['openid_ns']) &&\n $params['openid_ns'] == Zend_OpenId::NS_2_0) {\n $version = 2.0;\n }\n if (isset($params['openid_mode'])) {\n if ($params['openid_mode'] == 'associate') {\n $response = $this->_associate($version, $params);\n $ret = '';\n foreach ($response as $key => $val) {\n $ret .= $key . ':' . $val . \"\\n\";\n }\n return $ret;\n } else if ($params['openid_mode'] == 'checkid_immediate') {\n $ret = $this->_checkId($version, $params, 1, $extensions, $response);\n if (is_bool($ret)) return $ret;\n if (!empty($params['openid_return_to'])) {\n Zend_OpenId::redirect($params['openid_return_to'], $ret, $response);\n }\n return true;\n } else if ($params['openid_mode'] == 'checkid_setup') {\n $ret = $this->_checkId($version, $params, 0, $extensions, $response);\n if (is_bool($ret)) return $ret;\n if (!empty($params['openid_return_to'])) {\n Zend_OpenId::redirect($params['openid_return_to'], $ret, $response);\n }\n return true;\n } else if ($params['openid_mode'] == 'check_authentication') {\n $response = $this->_checkAuthentication($version, $params);\n $ret = '';\n foreach ($response as $key => $val) {\n $ret .= $key . ':' . $val . \"\\n\";\n }\n return $ret;\n }\n }\n return false;\n }", "function simpleid_checkid_identity(&$request, $immediate) {\n global $user, $version;\n \n $realm = openid_get_realm($request, $version);\n \n // Check 1: Is the user logged into SimpleID as any user?\n if ($user == NULL) {\n return CHECKID_LOGIN_REQUIRED;\n } else {\n $uid = $user['uid'];\n }\n \n // Check 2: Is the user logged in as the same identity as the identity requested?\n // Choose the identity URL for the user automatically\n if ($request['openid.identity'] == OPENID_IDENTIFIER_SELECT) {\n $test_user = user_load($uid);\n $identity = $test_user['identity'];\n \n log_info('OpenID identifier selection: Selected ' . $uid . ' [' . $identity . ']');\n } else {\n $identity = $request['openid.identity'];\n $test_user = user_load_from_identity($identity);\n }\n if ($test_user == NULL) return CHECKID_IDENTITY_NOT_EXIST;\n if ($test_user['uid'] != $user['uid']) {\n log_notice('Requested user ' . $test_user['uid'] . ' does not match logged in user ' . $user['uid']);\n return CHECKID_IDENTITIES_NOT_MATCHING;\n }\n \n // Pass the assertion to extensions\n $assertion_results = extension_invoke_all('checkid_identity', $request, $identity, $immediate);\n $assertion_results = array_merge(array_diff($assertion_results, array(NULL)));\n \n // Populate the request with the selected identity\n if ($request['openid.identity'] == OPENID_IDENTIFIER_SELECT) {\n $request['openid.claimed_id'] = $identity;\n $request['openid.identity'] = $identity;\n }\n \n // Check 3: Discover the realm and match its return_to\n $user_rp = (isset($user['rp'][$realm])) ? $user['rp'][$realm] : NULL;\n\n if (($version >= OPENID_VERSION_2) && SIMPLEID_VERIFY_RETURN_URL_USING_REALM) {\n $verified = FALSE;\n \n $rp_info = simpleid_get_rp_info($realm);\n $services = discovery_get_service_by_type($rp_info['services'], OPENID_RETURN_TO);\n \n log_info('OpenID 2 discovery: ' . count($services) . ' matching services');\n \n if ($services) {\n $return_to_uris = array();\n \n foreach ($services as $service) {\n $return_to_uris = array_merge($return_to_uris, $service['uri']);\n }\n foreach ($return_to_uris as $return_to) {\n if (openid_url_matches_realm($request['openid.return_to'], $return_to)) {\n log_info('OpenID 2 discovery: verified');\n $verified = TRUE;\n break;\n }\n }\n }\n \n $rp_info['return_to_verified'] = $verified;\n simpleid_set_rp_info($realm, $rp_info);\n \n if (!$verified) {\n if (($user_rp != NULL) && ($user_rp['auto_release'] == 1)) {\n log_notice('OpenID 2 discovery: not verified, but overridden by user preference');\n } else {\n log_notice('OpenID 2 discovery: not verified');\n $assertion_results[] = CHECKID_RETURN_TO_SUSPECT;\n }\n }\n }\n \n // Check 4: For checkid_immediate, the user must already have given\n // permission to log in automatically. \n if (($user_rp != NULL) && ($user_rp['auto_release'] == 1)) {\n log_info('Automatic set for realm ' . $realm);\n $assertion_results[] = CHECKID_OK;\n return min($assertion_results);\n } else {\n $assertion_results[] = CHECKID_APPROVAL_REQUIRED;\n return min($assertion_results);\n }\n}", "function simpleid_checkid_error($request, $immediate = false) {\n global $version;\n \n $message = array();\n if ($immediate) {\n if ($version >= OPENID_VERSION_2) {\n $message['openid.mode'] = 'setup_needed';\n } else {\n $message['openid.mode'] = 'id_res';\n }\n } else {\n $message['openid.mode'] = 'cancel';\n }\n \n $message = array_merge($message, extension_invoke_all('response', FALSE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "function doregisterwithopenid($data, $form) {\n\t\t$openid = trim($data['OpenIDURL']);\n\t\tSession::set(\"FormInfo.Form_RegistrationWithOpenIDForm.data\", $data);\n\n \tif(strlen($openid) == 0) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"Please enter your OpenID or your i-name.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\n\t\t$trust_root = Director::absoluteBaseURL();\n\t\t$return_to_url = $trust_root . $this->Link('processopenidresponse');\n\n\t\t$consumer = new Auth_OpenID_Consumer(new OpenIDStorage(), new SessionWrapper());\n\n\n\t\t// No auth request means we can't begin OpenID\n\t\t$auth_request = $consumer->begin($openid);\n\t\tif(!$auth_request) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"That doesn't seem to be a valid OpenID or i-name identifier. \" .\n\t\t\t\t\t\"Please try again.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\t\t$SQL_identity = Convert::raw2sql($auth_request->endpoint->claimed_id);\n\t\tif($member = Member::get()->filter('IdentityURL', $SQL_identity)->first()) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"That OpenID or i-name is already registered. Use another one.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\n\t\t// Add the fields for which we wish to get the profile data\n \t$sreg_request = Auth_OpenID_SRegRequest::build(null,\n \tarray('nickname', 'fullname', 'email', 'country'));\n\n \tif($sreg_request) {\n\t\t\t$auth_request->addExtension($sreg_request);\n \t}\n\n\n\t\tif($auth_request->shouldSendRedirect()) {\n\t\t\t// For OpenID 1, send a redirect.\n\t\t\t$redirect_url = $auth_request->redirectURL($trust_root, $return_to_url);\n\n\t\t\tif(Auth_OpenID::isFailure($redirect_url)) {\n\t\t\t\tdisplayError(\"Could not redirect to server: \" .\n\t\t\t\t\t\t\t\t\t\t $redirect_url->message);\n\t\t\t} else {\n\t\t\t\treturn $this->redirect($redirect_url);\n\t\t\t}\n\n\t\t} else {\n\t\t\t// For OpenID 2, use a javascript form to send a POST request to the\n\t\t\t// server.\n\t\t\t$form_id = 'openid_message';\n\t\t\t$form_html = $auth_request->formMarkup($trust_root, $return_to_url,\tfalse, array('id' => $form_id));\n\n\t\t\tif(Auth_OpenID::isFailure($form_html)) {\n\t\t\t\tdisplayError(\"Could not redirect to server: \" .$form_html->message);\n\t\t\t} else {\n\t\t\t\t$page_contents = array(\n\t\t\t\t\t \"<html><head><title>\",\n\t\t\t\t\t \"OpenID transaction in progress\",\n\t\t\t\t\t \"</title></head>\",\n\t\t\t\t\t \"<body onload='document.getElementById(\\\"\". $form_id .\n\t\t\t\t\t \"\\\").submit()'>\",\n\t\t\t\t\t $form_html,\n\t\t\t\t\t \"<p>Click &quot;Continue&quot; to login. You are only seeing \" .\n\t\t\t\t\t \"this because you appear to have JavaScript disabled.</p>\",\n\t\t\t\t\t \"</body></html>\");\n\n\t\t\t\tprint implode(\"\\n\", $page_contents);\n\t\t\t}\n\t\t}\n\t}", "function auth($mode=\"\"){\n\t\t\n\t\t$openid = new OPENID();\n\t\t$account = new ACCOUNT();\n\t\t$url = new URL();\n\t\t\n\t\t//ログイン処理\n\t\tif($mode=='login'){\n\t\t\t$this->setLogin($_REQUEST['id'],$_REQUEST['pw']);\n\t\t}\n\t\t//ログアウト\n\t\telse if($mode=='logout'){\n\t\t\t$this->delSessionData();\n\t\t\t$this->setLogout($_REQUEST['id'],$_REQUEST['pw']);\n\t\t\t\n\t\t}\n\t\t//アカウント登録\n\t\telse if($mode=='regist'){\n\t\t\t\n\t\t\t$account->new_regist($_REQUEST['action'],\"\",$_REQUEST['data']);\n\t\t}\n\t\t//Open-ID認証\n\t\telse if($mode=='openid'){\n\t\t\t\n\t\t\t//認証サイトからの返信\n\t\t\tif($_REQUEST['action']){\n\t\t\t\t\n\t\t\t\t//セッションID無し(期限切れ等)\n\t\t\t\tif(!$_REQUEST['session_id'] || $_REQUEST['session_id'] != session_id()){\n\t\t\t\t\t//リダイレクト処理\n\t\t\t\t\theader(\"Location: \".$url->getUrl());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//認証成功(管理専用※返答値確認)\n\t\t\t\tif($_REQUEST['check']){\n\t\t\t\t\t$keys = array_keys($_REQUEST);\n\t\t\t\t\t$a=\"\";\n\t\t\t\t\tfor($i=0;$i<count($keys);$i++){\n\t\t\t\t\t\t$a.= \"<h4 style='color:red;'>\".$keys[$i].\"</h4>\\n\".$_REQUEST[$keys[$i]].\"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t//$b = \"--\\n\".file_get_contents($_REQUEST['openid_claimed_id']).\"&\".\"\\n--\\n\";\n\t\t\t\t\t$b = \"\";\n\t\t\t\t\t\n\t\t\t\t\t$GLOBALS['view']['html'] = \"<pre>\".$a.$b.\"</pre>\";\n\t\t\t\t\t//echo \"OK<br>\\n\";\n\t\t\t\t\t$template = new template();\n\t\t\t\t\techo $template->file2HTML($GLOBALS['sys']['system'].\"/\".$GLOBALS['sys']['common'].\"/tpl/common.html\");\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t\t//認証成功->ログイン\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\t//openidのIDを取得\n\t\t\t\t\t$id = $openid->getReturnData($_REQUEST['service'],\"id\");\n\t\t\t\t\t$mail = $openid->getReturnData($_REQUEST['service'],\"mail\");\n\t\t\t\t\t//die($_REQUEST['service'].\" / \".$id.\" / \".$mail);\n\t\t\t\t\t\n\t\t\t\t\t//登録済みチェック\n\t\t\t\t\tif(!$account->checkAccountID($_REQUEST['service'],$id,\"\")){\n\t\t\t\t\t\t//未登録の場合(新規登録 id:アカウント pw:null openid:[google,facebook,twitter])\n\t\t\t\t\t\t//$sys_common->regist($_REQUEST['service'],$id,'','',$mail);\n\t\t\t\t\t\t$account->setAccount(array(\"0\",$_REQUEST['service'],\"\",$id,\"\",\"\",$mail));\n\t\t\t\t\t}\n\t\t\t\t\t//セッション情報の登録\n\t\t\t\t\t$_SESSION['id'] = $id;\n\t\t\t\t\t$_SESSION['service'] = $_REQUEST['service'];\n\t\t\t\t\t$_SESSION['mail'] = $mail;\n\t\t\t\t\t\n\t\t\t\t\t//cookie-time処理\n\t\t\t\t\tif($_REQUEST['cookie_time']){\n\t\t\t\t\t\t$CookieInfo = session_get_cookie_params();\n\t\t\t\t\t\tsetcookie( session_name(), session_id(), time() + $_REQUEST['cookie_time'] , $CookieInfo['path'] );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//リダイレクト処理\n\t\t\t\t\theader(\"Location: \".$url->getUrl());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t//認証サイトへ遷移\n\t\t\telse{\n\t\t\t\t$openid->services($_REQUEST['service'],$_REQUEST['check']);\n\t\t\t}\n\t\t}\n\t\t//認証済み\n\t\telse if(isset($_SESSION['id']) && $_SESSION['id'] && $_COOKIE['PHPSESSID']){\n\t\t\t\n\t\t\tif(!$_REQUEST['p'] && $GLOBALS['sys']['config']['default_plugin']){\n\t\t\t\t$_REQUEST['p'] = $GLOBALS['sys']['config']['default_plugin'];\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t//未認証(ログイン前)\n\t\telse{\n\t\t\t$_REQUEST['m'] = \"login\";\n\t\t}\n\t}", "public function loginAction() {\n $auth = Zend_Auth::getInstance();\n\n // check if a user is already logged\n if ($auth->hasIdentity()) {\n $this->_helper->FlashMessenger('It seems you are already logged into the system ');\n return $this->_redirect('/account');\n }\n\n // if the user is not logged, the do the logging\n // $openid_identifier will be set when users 'clicks' on the account provider\n $openid_identifier = $this->getRequest()->getParam('openid_identifier', null);\n\n // $openid_mode will be set after first query to the openid provider\n $openid_mode = $this->getRequest()->getParam('openid_mode', null);\n\n // this one will be set by facebook connect\n $code = $this->getRequest()->getParam('code', null);\n\n // while this one will be set by twitter\n $oauth_token = $this->getRequest()->getParam('oauth_token', null);\n\n\n // do the first query to an authentication provider\n if ($openid_identifier) {\n\n if ('https://www.twitter.com' == $openid_identifier) {\n $adapter = $this->_getTwitterAdapter();\n } else if ('https://www.facebook.com' == $openid_identifier) {\n $adapter = $this->_getFacebookAdapter();\n } else {\n // for openid\n $adapter = $this->_getOpenIdAdapter($openid_identifier);\n\n // specify what to grab from the provider and what extension to use\n // for this purpose\n $toFetch = $this->_keys->openid->tofetch->toArray();\n\n // for google and yahoo use AtributeExchange Extension\n if ('https://www.google.com/accounts/o8/id' == $openid_identifier || 'http://me.yahoo.com/' == $openid_identifier) {\n $ext = $this->_getOpenIdExt('ax', $toFetch);\n\n } else {\n $ext = $this->_getOpenIdExt('sreg', $toFetch);\n }\n\n $adapter->setExtensions($ext);\n Zend_Registry::get('log')->info('Class is :' . get_class($adapter));\n }\n\n // here a user is redirect to the provider for login\n $result = $auth->authenticate($adapter);\n\n Zend_Registry::get('log')->info(get_class($result));\n\n // the following two lines should never be executed unless the redirection faild.\n $this->_helper->FlashMessenger('Redirection faild');\n return $this->_redirect('/index/index');\n } else if ($openid_mode || $code || $oauth_token) {\n // this will be exectued after provider redirected the user back to us\n\n if ($code) {\n // for facebook\n $adapter = $this->_getFacebookAdapter();\n } else if ($oauth_token) {\n // for twitter\n $adapter = $this->_getTwitterAdapter()->setQueryData($_GET);\n } else {\n // for openid \n $adapter = $this->_getOpenIdAdapter(null);\n\n // specify what to grab from the provider and what extension to use\n // for this purpose\n $ext = null;\n \n $toFetch = $this->_keys->openid->tofetch->toArray();\n \n // for google and yahoo use AtributeExchange Extension\n if (isset($_GET['openid_ns_ext1']) || isset($_GET['openid_ns_ax'])) {\n $ext = $this->_getOpenIdExt('ax', $toFetch);\n } else if (isset($_GET['openid_ns_sreg'])) {\n $ext = $this->_getOpenIdExt('sreg', $toFetch);\n }\n\n if ($ext) {\n $ext->parseResponse($_GET);\n $adapter->setExtensions($ext);\n }\n }\n\n $result = $auth->authenticate($adapter);\n\n // Successful auth back from the OpenId provider.\n if ($result->isValid()) {\n $toStore = array('identity' => $auth->getIdentity());\n\n if (isset($ext) && $ext) {\n // for openId\n $toStore['properties'] = $ext->getProperties();\n } else if ($code) {\n // for facebook\n $msgs = $result->getMessages();\n $toStore['properties'] = (array) $msgs['user'];\n\n } else if ($oauth_token) {\n // for twitter\n $identity = $result->getIdentity();\n // get user info\n $twitterUserData = (array) $adapter->verifyCredentials();\n $toStore = array('identity' => $identity['user_id']);\n if (isset($twitterUserData['status'])) {\n $twitterUserData['status'] = (array) $twitterUserData['status'];\n }\n $toStore['properties'] = $twitterUserData;\n }\n $email = isset($toStore['properties']['email']) ? $toStore['properties']['email'] : 'dummy';\n\n /** @var $rep ZFStarter\\Entity\\Repository\\PersonRepository */\n $rep = $this->entityManager->getRepository('ZFStarter\\Entity\\Person');\n\n /** @var $person ZFStarter\\Entity\\Person */\n $person = $rep->findOneBy(array('openid'=> $email));\n\n if ($person instanceof ZFStarter\\Entity\\Person) {\n // They have an account\n \\Zend_Registry::get('log')->debug(__METHOD__ . \"\\nRole should be actor but is ...\" . $person->getRoleId());\n\n\n $auth->getStorage()->write($person->toArray());\n\n $this->_helper->FlashMessenger('Successful authentication');\n return $this->_redirect('/account/index');\n } else {\n\n $auth->getStorage()->write(array(\n 'role' => 'person',\n 'email' => $email,\n 'openid' => $email,\n ));\n\n // Redirect to create account \n $r = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n $r->gotoSimple('create', 'account', null, array('email' => $email));\n\n }\n\n\n } else {\n $this->_helper->FlashMessenger('Failed authentication');\n $this->_helper->FlashMessenger($result->getMessages());\n return $this->_redirect('/index/index');\n }\n }\n }", "function simpleid_associate($request) {\n global $version;\n \n log_info('OpenID association request: ' . log_array($request));\n \n $assoc_types = openid_association_types();\n $session_types = openid_session_types(is_https(), $version);\n\n // Common Request Parameters [8.1.1]\n if (($version == OPENID_VERSION_1_1) && !isset($request['openid.session_type'])) $request['openid.session_type'] = '';\n $assoc_type = $request['openid.assoc_type'];\n $session_type = $request['openid.session_type'];\n \n // Diffie-Hellman Request Parameters [8.1.2]\n $dh_modulus = (isset($request['openid.dh_modulus'])) ? $request['openid.dh_modulus'] : NULL;\n $dh_gen = (isset($request['openid.dh_gen'])) ? $request['openid.dh_gen'] : NULL;\n $dh_consumer_public = $request['openid.dh_consumer_public'];\n \n if (!isset($request['openid.session_type']) || !isset($request['openid.assoc_type'])) {\n log_error('Association failed: openid.session_type or openid.assoc_type not set');\n openid_direct_error('openid.session_type or openid.assoc_type not set');\n return;\n }\n \n // Check if the assoc_type is supported\n if (!array_key_exists($assoc_type, $assoc_types)) {\n $error = array(\n 'error_code' => 'unsupported-type',\n 'session_type' => 'DH-SHA1',\n 'assoc_type' => 'HMAC-SHA1'\n );\n log_error('Association failed: The association type is not supported by SimpleID.');\n openid_direct_error('The association type is not supported by SimpleID.', $error, $version);\n return;\n }\n // Check if the session_type is supported\n if (!array_key_exists($session_type, $session_types)) {\n $error = array(\n 'error_code' => 'unsupported-type',\n 'session_type' => 'DH-SHA1',\n 'assoc_type' => 'HMAC-SHA1'\n );\n log_error('Association failed: The session type is not supported by SimpleID.');\n openid_direct_error('The session type is not supported by SimpleID.', $error, $version);\n return;\n }\n \n if ($session_type == 'DH-SHA1' || $session_type == 'DH-SHA256') {\n if (!$dh_consumer_public) {\n log_error('Association failed: openid.dh_consumer_public not set');\n openid_direct_error('openid.dh_consumer_public not set');\n return;\n }\n }\n\n $response = _simpleid_create_association(ASSOCIATION_SHARED, $assoc_type, $session_type, $dh_modulus, $dh_gen, $dh_consumer_public);\n \n openid_direct_response(openid_direct_message($response, $version));\n}", "function auth_openid_dist ($login, $pass, $serveur='') {\n\n\t// il faut un login non vide ET un pass vide (sinon cela ne concerne pas OpenID)\n\tif (!strlen($login) OR strlen($pass)) return false;\n\t$auteur = false;\n\n\tif (!$l = auth_openid_retrouver_login($login)){\n\t\tif (is_openid($login)\n\t\t\tAND $idurl = nettoyer_openid($login)\n\t\t\tAND verifier_openid($idurl))\n\t\t\treturn _T(\"openid:form_login_openid_inconnu\");\n\t\treturn false;\n\t}\n\t$login = $l;\n\n\n\t// retrouver le login\n\tif (!$auteur = sql_fetsel(\"openid,statut\", \"spip_auteurs\", \"login=\" . sql_quote($login),\"\",\"\",\"\",\"\",$serveur) )\n\t\treturn false;\n\n\tif (!$idurl = $auteur['openid'])\n\t\treturn false;\n\n\tif ($auteur['statut']=='nouveau')\n\t\treturn _T('openid:form_login_statut_nouveau');\n\t\n\t// * Si l'openid existe, la procedure continue en redirigeant\n\t// vers le fournisseur d'identite. En cas d'erreur, il y a une redirection de faite\n\t// sur la page login, en cas de reussite, sur l'action controler_openid\n\t// * S'il l'openid n'existe pas, on est de retour ici, et on continue\n\t// pour d'autres methodes d'identification\n\tinclude_spip('inc/openid');\n\t$retour = auth_url_retour_login('openid', $login, url_absolue(self()));\n\t$erreurs_openid = demander_authentification_openid($idurl, $retour);\n\t// potentiellement, on arrive ici avec une erreur si l'openid donne n'existe pas\n\t// on la renvoie\n\treturn $erreurs_openid;\n}", "function authorise() {\n\t\tif ( ! isset($_SESSION['oauth2_params'])) {\n\t\t\tthrow new Exception('Missing auth parameters');\n\t\t}\n\n\t\t$params = unserialize($_SESSION['oauth2_params']);\n\n\t\t// TODO L('ME')\n\t\t// Check the user is signed in\n\t\tif ( ! isset($params['user_id']) ) {\n\t\t\t// $app->redirect('/oauth.php/signin');\n\t\t\tURI::redirect('!oauth/provider2/signin');\n\t\t}\n\n\t\t// 可配置自动授权\n\t\t$client_id = $params['client_id'];\n\t\tforeach (Config::get('oauth.consumers') as $consumer) {\n\t\t\tif ( $consumer['key'] == $client_id && $consumer['auto_authorise'] ) {\n\n\t\t\t\t$authCode = $this->server->newAuthoriseRequest('user', $params['user_id'], $params);\n\n\t\t\t\t$redirect_uri = OAuth2\\Util\\RedirectUri::make($params['redirect_uri'], array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'code' => $authCode,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'state'\t=> $params['state']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ));\n\t\t\t\tURI::redirect($redirect_uri);\n\t\t\t}\n\t\t}\n\n\t\t// 否则需手动授权\n\t\t// If the user approves the client then generate an authoriztion code\n\t\tif (isset($_POST['approve'])) { // TODO fix this auto authorise\n\n\t\t\t$authCode = $this->server->newAuthoriseRequest('user', $params['user_id'], $params);\n\n\t\t\t// Generate the redirect URI\n\t\t\t$redirect_uri = OAuth2\\Util\\RedirectUri::make($params['redirect_uri'], array(\n\t\t\t\t\t\t\t\t\t\t\t\t 'code' => $authCode,\n\t\t\t\t\t\t\t\t\t\t\t\t 'state'\t=> $params['state']\n\t\t\t\t\t\t\t\t\t\t\t\t ));\n\t\t\tURI::redirect($redirect_uri);\n\t\t}\n\t\t// The user denied the request so send them back to the client with an error\n\t\telseif (isset($_POST['deny']))\n\t\t{\n\t\t\t// echo '<p>The user denied the request and so would be redirected back to the client...</p>';\n\t\t\t$redirect_uri = OAuth2\\Util\\RedirectUri::make($params['redirect_uri'], array(\n\t\t\t\t\t\t\t\t\t\t\t\t 'error' => 'access_denied',\n\t\t\t\t\t\t\t\t\t\t\t\t // 'error_message' => $this->server::getExceptionMessage('access_denied'),\n\t\t\t\t\t\t\t\t\t\t\t\t 'error_message' => \\OAuth2\\AuthServer::getExceptionMessage('access_denied'),\n\t\t\t\t\t\t\t\t\t\t\t\t 'state'\t=> $params['state']\n\t\t\t\t\t\t\t\t\t\t\t\t ));\n\t\t\tURI::redirect($redirect_uri);\n\t\t}\n\t\telse {\n\t// GET\n\t?>\n\n\t<h1>Authorise <?php echo $params['client_details']['name']; ?></h1>\n\n\t<p>\n\t\tThe application <strong><?php echo $params['client_details']['name']; ?></strong> would like permission to access your:\n\t</p>\n\n\t<ul>\n\t\t<?php foreach ($params['scopes'] as $scope): ?>\n\t\t\t<li>\n\t\t\t\t<?php echo $scope['name']; ?>\n\t\t\t</li>\n\t\t<?php endforeach; ?>\n\t</ul>\n\n\t<p>\n\t\t<form method=\"post\" style=\"display:inline\">\n\t\t\t<input type=\"submit\" name=\"approve\" id=\"approve\" value=\"Approve\">\n\t\t</form>\n\n\t\t<form method=\"post\" style=\"display:inline\">\n\t\t\t<input type=\"submit\" name=\"deny\" id=\"deny\" value=\"Deny\">\n\t\t</form>\n\t</p>\n\n\t<?php\n\t\t // TODO 由于此处是自定义 view, 输出完就 die 以防 layout view 污染\n\t\t die;\n\n\t\t }\n\t}", "public function doAuthentication();", "function attemptOAuthLogin(Request $request, Response $response, $args){\n if(isset($_SESSION['access_token'])){\n //echo \"already Logged In\";\n header('Location: https://cc-contest-arena.herokuapp.com');\n die();\n return $response;\n }\n\n\t$CC_URL = \"https://api.codechef.com/oauth/authorize\";\n\t\n\t$params = array('response_type'=>'code', 'client_id'=> $GLOBALS['CLIENT_ID'], \t\t\t\t\t\t\t\t'redirect_uri'=> $GLOBALS['REDIRECT_URI'], 'state'=> 'xyz');\n \n \n\t$reqMaker = CurlRequestMaker::getInstance();\n $reqMaker->makeRedirectRequest($CC_URL,$params);\n \n return $response;\n}", "private function authOpenId(OpenId $client, ServerRequestInterface $request): ResponseInterface\n {\n $queryParams = $request->getQueryParams();\n $bodyParams = $request->getParsedBody();\n $mode = $queryParams['openid_mode'] ?? $bodyParams['openid_mode'] ?? null;\n\n if (empty($mode)) {\n return $this->responseFactory\n ->createResponse(Status::MOVED_PERMANENTLY)\n ->withHeader('Location', $client->buildAuthUrl($request));\n }\n\n switch ($mode) {\n case 'id_res':\n if ($client->validate()) {\n return $this->authSuccess($client);\n }\n $response = $this->responseFactory->createResponse(Status::BAD_REQUEST);\n $response->getBody()->write(\n 'Unable to complete the authentication because the required data was not received.'\n );\n return $response;\n case 'cancel':\n return $this->authCancel($client);\n default:\n return $this->responseFactory->createResponse(Status::BAD_REQUEST);\n }\n }", "public function OAuthAuthenticate()\n {\n throw new Exception( \"OAuthAuthenticate Not yet implemented\" );\n \n// $response = Auth1::legs(2)\n// ->set( 'key', $this->OAuthConsumerKey )\n// ->set( 'secret', $this->OAuthConsumerSecret )\n// ->request( $this->OAuthRequestURI );\n }", "public function authenticate()\n {\n // already executed\n if (isset($this->_success)) {\n return $this->_success;\n }\n\n // start authentication\n $this->_success = false;\n\n // check request\n $this->getRequest()->checkParameters(self::$_2l_params, true);\n $this->getRequest()->checkBodyHash();\n if (!call_user_func($this->_check_timestamp_handler, $this->getRequest()->getParameter('oauth_timestamp'))) {\n throw new HTTP_OAuthProvider_Exception('401 Invalid timestamp', 401);\n }\n\n // get consumer\n $this->_consumer = call_user_func($this->_get_consumer_handler, $this->getRequest()->getParameter('oauth_consumer_key'));\n if (!$this->_consumer) {\n throw new HTTP_OAuthProvider_Exception('401 Consumer is not found', 401);\n }\n if (!$this->_consumer instanceof HTTP_OAuthProvider_Consumer) {\n throw new HTTP_OAuthProvider_Exception('500 GetConsumerHandler did not return HTTP_OAuthProvider_Consumer instance', 500);\n }\n\n // check signature method\n $sig_method = $this->getRequest()->getParameter('oauth_signature_method');\n $sig_method = str_replace('-', '_', $sig_method);\n $sig_file = sprintf('%s/OAuthProvider/Signature/%s.php', dirname(__FILE__), $sig_method);\n if (!is_file($sig_file)) {\n throw new HTTP_OAuthProvider_Exception('400 Signature method is not implemented', 400);\n }\n require_once($sig_file);\n $sig_class = sprintf('HTTP_OAuthProvider_Signature_%s', $sig_method);\n if (!class_exists($sig_class) || !is_subclass_of($sig_class, 'HTTP_OAuthProvider_Signature')) {\n throw new HTTP_OAuthProvider_Exception('400 Signature method is not implemented', 400);\n }\n\n // check signature\n $sig = new $sig_class($this);\n $sig->checkSignature();\n\n // Success\n $this->_success = true;\n return true;\n }", "private function oauth() {\n if ($this->IntuitAnywhere->handle($this->the_username, $this->the_tenant))\n {\n ; // The user has been connected, and will be redirected to $that_url automatically.\n }\n else\n {\n // If this happens, something went wrong with the OAuth handshake\n die('Oh no, something bad happened: ' . $this->IntuitAnywhere->errorNumber() . ': ' . $this->IntuitAnywhere->errorMessage());\n }\n }", "protected function check_login()\n\t{\n\t\tif (isset($_GET['oauth_token']))\n\t\t{\n\n $this->handle_callback();\n\n\t\t\t$tokens = $this->get_access_token();\n\n if ( ! empty($tokens['access_key']) && ! empty($tokens['oauth_token'] ) )\n\t\t\t{\n\n $this->set_shard_id( $tokens['shard_id'] );\n $this->set_evernote_user_id( $tokens['evernote_user_id'] );\n $this->set_expires( $tokens['expires'] );\n\t\t\t}\n\n\t\t\t\\Response::redirect(\\Uri::current());\n\t\t\treturn null;\n\t\t}\n\n\t}", "public function loginOAuth2Callback()\n\t{\n\t\t$googleService = $this->getService('google');\n\t\t$client = $googleService->getClient();\n\t\t/* @var $client \\Google_Client */\n\t\t$session = $this->getRequest()->getSession();\n\t\t$query = $this->getRequest()->getQuery();\n\n\t\tif (isset($query['code'])) {\n\t\t\t$client->authenticate($query['code']);\n\t\t\t$session->set('access.token', $client->getAccessToken());\n\n\t\t\t$tokenData = $client->verifyIdToken()->getAttributes();\n\t\t\t$userInfoData = $googleService->getAddInfo()->userinfo->get();\n\t\t\t/* @var $userInfoData \\Google_Service_Oauth2_Userinfoplus */\n\n\t\t\t$email = $tokenData['payload']['email'];\n\t\t\tif (!preg_match('/^.*[email protected]$/', $email)) {//FIXME domain to config\n\t\t\t\t$session->clear();\n\t\t\t\t$session->set('api.error', 'You have to login from \"coderdojo.org.pl\" domain.');\n\t\t\t} else {\n\n\t\t\t\t$user = $this->findOne('User', array('email' => $email));\n\t\t\t\tif (!$user) {\n\t\t\t\t\t$user = $this->createUser($tokenData['payload'], $userInfoData);\n\t\t\t\t}\n\n\t\t\t\t$session->set('user.id', $user->getId());\n\n\t\t\t}\n\n\t\t} else if (isset($query['error'])) {\n\t\t\t$this->getRequest()->getSession()->set('api.error', $query['error']);\n\t\t}\n\n\t\t$response = new Response();\n\t\t$response->redirect('/');\n\t\treturn $response;\n\n\t}", "public function connect() {\n\n // Set params\n $params = array(\n 'response_type' => 'code',\n 'client_id' => $this->client_id,\n 'redirect_uri' => $this->redirect_uri,\n 'state' => time(),\n 'scope' => 'w_share r_basicprofile r_liteprofile rw_organization_admin r_organization_social w_organization_social'\n );\n \n // Get redirect url\n $url = $this->endpoint . '/authorization?' . http_build_query($params);\n \n // Redirect\n header('Location:' . $url);\n\n }", "function simpleid_sign(&$response, $assoc_handle = NULL) {\n global $version;\n \n if (!$assoc_handle) {\n $assoc = _simpleid_create_association(ASSOCIATION_PRIVATE);\n $response['openid.assoc_handle'] = $assoc['assoc_handle'];\n } else {\n $assoc = cache_get('association', $assoc_handle);\n \n if ($assoc['created'] + SIMPLEID_ASSOC_EXPIRES_IN < time()) {\n // Association has expired, need to create a new one\n log_notice('Association handle ' . $assoc['assoc_handle'] . ' expired. Using stateless mode.');\n $response['openid.invalidate_handle'] = $assoc_handle;\n $assoc = _simpleid_create_association(ASSOCIATION_PRIVATE);\n $response['openid.assoc_handle'] = $assoc['assoc_handle'];\n }\n }\n \n // If we are using stateless mode, then we need to cache the response_nonce\n // so that the RP can only verify once\n if (isset($assoc['private']) && ($assoc['private'] == 1) && isset($response['openid.response_nonce'])) {\n cache_set('stateless', $response['openid.response_nonce'], array(\n 'response_nonce' => $response['openid.response_nonce'],\n 'assoc_handle' => $response['openid.assoc_handle']));\n }\n \n // Get all the signed fields [10.1]\n openid_parse_request($response); // Fill the namespace array\n $signed_fields = array('op_endpoint', 'return_to', 'response_nonce', 'assoc_handle', 'identity', 'claimed_id');\n $signed_fields = array_merge($signed_fields, extension_invoke_all('signed_fields', $response));\n \n // Check if the signed keys are actually present\n $to_sign = array();\n foreach ($signed_fields as $field) {\n if (isset($response['openid.' . $field])) $to_sign[] = $field;\n }\n \n $response['openid.signed'] = implode(',', $to_sign);\n \n // Generate signature for this message\n $mac_key = $assoc['mac_key'];\n $assoc_types = openid_association_types();\n $hmac_func = $assoc_types[$assoc['assoc_type']]['hmac_func'];\n \n $response['openid.sig'] = openid_sign($response, $to_sign, $mac_key, $hmac_func, $version);\n \n log_info('OpenID signed authentication response: ' . log_array($response));\n \n return $response;\n}", "public function auth() {\n \n // state 1 requires a GET variable to exist\n if($this->state == 1 && !isset($_GET['oauth_verifier'])) {\n $this->state = 0;\n }\n\n // Step 1: Get a request token\n if($this->state == 0) {\n return $this->getRequestToken();\n }\n\n // Step 2: Get an access token\n elseif($this->state == 1) {\n return $this->getAccessToken();\n }\n\n // Step 3: Verify the access token\n return $this->verifyAccessToken();\n }", "public function authenticate(&$state) {\n\t\tassert('is_array($state)');\n\n\t\t$state[self::AUTHID] = $this->authId;\n\t\t$state[self::SOURCESID] = $this->sources;\n\n\t\t/* Save the $state array, so that we can restore if after a redirect */\n\t\t$id = SimpleSAML_Auth_State::saveState($state, self::STAGEID);\n\n\t\t/* Redirect to the select source page. We include the identifier of the\n\t\tsaved state array as a parameter to the login form */\n\t\t$url = SimpleSAML_Module::getModuleURL('multiauth/selectsource.php');\n\t\t$params = array('AuthState' => $id);\n\n\t\t// Allowes the user to specify the auth souce to be used\n\t\tif(isset($_GET['source'])) {\n\t\t\t$params['source'] = $_GET['source'];\n\t\t}\n\n\t\tSimpleSAML_Utilities::redirectTrustedURL($url, $params);\n\n\t\t/* The previous function never returns, so this code is never\n\t\texecuted */\n\t\tassert('FALSE');\n\t}", "public function login()\n\t{\n\n\t\tif ( ( $this->get_access_key() === null || $this->get_access_secret() === null ) )\n\t\t{\n echo 'case 1';\n $oauth = new \\OAuth( $this->tokens['consumer_key'], $this->tokens['consumer_secret'] );\n\n $request_token_info = $oauth->getRequestToken( $this->request_token_url, $this->get_callback() );\n\n if ($request_token_info)\n {\n\n $this->set_request_tokens( $request_token_info );\n }\n\n // Now we have the temp credentials, let's get the real ones.\n\n // Now let's get the OAuth token\n\t\t\t\\Response::redirect( $this->get_auth_url() );\n return;\n\t\t}\n\n\t\treturn $this->check_login();\n\t}", "public function Login() {\n $success = FALSE;\n\t\n if (isset($_GET['code']) && isset($_GET['state'])) {\n\n //The user has gone off to patreon, signed in, and has given us access. Score!\n //but now we have to let patreon know that it gave this stuff to the right page\n //we do this via a post request with the data you see in the $data array\n $data = http_build_query(\n array(\n 'code'=>$_GET['code'],\n 'grant_type'=>'authorization_code',\n 'client_id'=>$this::access['client_id'],\n 'client_secret'=>$this::access['client_secret'],\n 'redirect_uri'=>'http://www.familycraftmc.com/manage/index.php'\n )\n );\n\n $userAuth = $this->UpdateToken($data);\n\t \n if (isset($this->accessToken) && ($this->accessToken != NULL))\n $success = TRUE;\n\t}\n $this->loggedIn = $success;\n\treturn $success;\n }", "private function authenticate() {\n\t\tif ($this->_authenticated || 'SSL' == $this->crypt_type) {\n\t\t\treturn array('is_success' => true);\n\t\t}\n\n\t\t$promptXML = $this->read_data();\n\t\t$prompt = $this->_opsHandler->decode($promptXML);\n\t\tif (isSet($prompt['response_code'])) {\n\t\t\tif ($prompt['response_code'] == 555 ) {\n\t\t\t\t// the ip address from which we are connecting is not accepted\n\t\t\t\treturn array(\n\t\t\t\t\t'is_success'\t=> false,\n\t\t\t\t\t'error'\t\t\t=> $prompt['response_text']\n\t\t\t\t);\n\t\t\t}\n\t\t} else if ( !preg_match('/OpenSRS\\sSERVER/', $prompt['attributes']['sender']) ||\n\t\t\tsubstr($prompt['attributes']['version'],0,3) != 'XML' ) {\n\t\t\treturn array(\n\t\t\t\t'is_success'\t=> false,\n\t\t\t\t'error'\t\t\t=> 'Unrecognized Peer'\n\t\t\t);\n\t\t}\n\n\t\t// first response is server version\n\t\t$cmd = array(\n\t\t\t'protocol' => $this->osrs_protocol,\n\t\t\t'action' => 'check',\n\t\t\t'object' => 'version',\n\t\t\t'attributes' => array(\n\t\t\t\t'sender' => 'OpenSRS CLIENT',\n\t\t\t\t'version' => $this->osrs_version,\n\t\t\t\t'state' => 'ready'\n\t\t\t)\n\t\t);\n\t\t$xmlCMD = $this->_opsHandler->encode($cmd);\n\t\t$this->send_data($xmlCMD);\n\n\t\t$cmd = array(\n\t\t\t'protocol' => $this->osrs_protocol,\n\t\t\t'action' => 'authenticate',\n\t\t\t'object' => 'user',\n\t\t\t'attributes' => array(\n\t\t\t\t'crypt_type' => strtolower($this->crypt_type),\n\t\t\t\t'username' => $this->osrs_username,\n\t\t\t\t'password' => $this->osrs_username\n\t\t\t)\n\t\t);\n\t\t$xmlCMD = $this->_opsHandler->encode($cmd);\n\t\t$this->send_data( $xmlCMD );\n\n\t\t$challenge = $this->read_data();\n\n\t\t // Sanity check to make sure that the osrs_key is all hex values\n $hex_check = ctype_xdigit($this->osrs_key);\n\n // Respond to the challenge with the MD5 checksum of the challenge.\n // ... and PHP's md5() doesn't return binary data, so\n // we need to pack that too\n\n if ($hex_check){\n $this->_CBC = new openSRS_crypt(pack('H*', $this->osrs_key), $this->crypt_type);\n $response = pack('H*',md5($challenge));\n $this->send_data($response);\n\n // Read the server's response to our login attempt (XML)\n $answerXML = $this->read_data();\n $answer = $this->_opsHandler->decode($answerXML);\n\n if (substr($answer['response_code'],0,1)== '2') {\n $this->_authenticated = true;\n return true;\n } else {\n return false;\n }\n } else {\n trigger_error(\"oSRS Error - Please check the osrs_key value in the config file, it contains a non hexidecimal character.\");\n }\n\t}", "public function callback()\n {\n if (!$this->request->getQuery('code')) {\n $authUrl = $this->GoogleApi->createAuthUrl();\n return $this->redirect(filter_var($authUrl, FILTER_SANITIZE_URL));\n } else {\n $this->GoogleApi->authenticate($this->request->getQuery('code'));\n $this->redirect(\n [\n 'controller' => 'GoogleApis',\n 'action' => 'index'\n ]\n );\n }\n }", "public function authenticate($code){\n\t\t$this->client->authenticate($_GET['code']);\n\t\t$_SESSION['token'] = $this->_token = $this->client->getAccessToken();\n\n\t\tif (isset($_SESSION['token'])) {\n\t\t\t$this->client->setAccessToken($_SESSION['token']);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function authenticate()\n {\n $username = (getenv('WRAP_USERID') == '') ? getenv('REDIRECT_WRAP_USERID') : getenv('WRAP_USERID');\n\n if ($username == '') {\n $username = getenv('REDIRECT_WRAP_USERID');\n }\n \n if ($username == '') {\n setrawcookie('WRAP_REFERER', $this->_getUrl(), 0, '/', '.ncsu.edu');\n header('location:https://webauth.ncsu.edu/wrap-bin/was16.cgi');\n die();\n }\n \n if (strtolower($username) == 'guest') {\n $this->autoLogout();\n return new Zend_Auth_Result(\n false,\n new stdClass(),\n array('Guest access is not allowed for this application')\n );\n }\n\n $class = new stdClass();\n $class->username = $username;\n $class->realm = 'wrap';\n \n return new Zend_Auth_Result(true, $class, array());\n }", "public function authenticate()\n\t{\n\t\t$this->errorCode==self::ERROR_NONE;\n\t}", "public function authenticate()\n\t{\n\t\t$consumer = Consumer::make($this->config);\n\t\t\n\t\t// Load the provider\n\t\t$provider = Provider::make($this->provider);\n\t\t\n\t\t// Create the URL to return the user to\n\t\t$callback = array_get($this->config, 'callback') ?: \\URL::to(\\Config::get('oneauth::urls.callback', 'connect/callback'));\n\t\t$callback = rtrim($callback, '/').'/'.$this->provider;\n\t\t\n\t\t// Add the callback URL to the consumer\n\t\t$consumer->callback($callback); \n\n\t\t// Get a request token for the consumer\n\t\t$token = $provider->request_token($consumer);\n\n\t\t// Store the token\n\t\t\\Cookie::put('oauth_token', base64_encode(serialize($token)));\n\n\t\t// Redirect to the twitter login page\n\t\treturn \\Redirect::to($provider->authorize_url($token, array(\n\t\t\t'oauth_callback' => $callback,\n\t\t)));\n\t}", "public function authenticate($url = null, $stateOptions = [])\n {\n $loginURL = $url === null ? $this->credentials['loginURL'] : $url;\n\n $stateOptions['loginUrl'] = $loginURL;\n $state = '&state='.urlencode(json_encode($stateOptions));\n $parameters = $this->settings['parameters'];\n\n $loginURL .= '/services/oauth2/authorize';\n $loginURL .= '?response_type=code';\n $loginURL .= '&client_id='.$this->credentials['consumerKey'];\n $loginURL .= '&redirect_uri='.urlencode($this->credentials['callbackURI']);\n $loginURL .= !empty($parameters['display']) ? '&display='.$parameters['display'] : '';\n $loginURL .= $parameters['immediate'] ? '&immediate=true' : '';\n $loginURL .= !empty($parameters['scope']) ? '&scope='.rawurlencode($parameters['scope']) : '';\n $loginURL .= !empty($parameters['prompt']) ? '&prompt='.rawurlencode($parameters['prompt']) : '';\n $loginURL .= $state;\n\n return $this->redirect->to($loginURL);\n }", "function login() {\r\n\t\tif (!JRequest::checkToken()) {\r\n\t\t\tJFusionConnect::redirect('Invalid Token');\r\n\t\t\treturn;\r\n\t\t}\t\r\n\t\t\r\n\t\t$server =& JFusionConnect::getServer();\r\n\t\t$request = JFusionConnect::getRequest();\r\n \tif (!Auth_OpenID_isError($request)) {\r\n \t\tif (in_array($request->mode, array('checkid_immediate', 'checkid_setup'))) {\r\n\t\t\t\t$password = JRequest::getVar('password'); \t\t\t\r\n \t\t\t$username = JRequest::getVar('username');\r\n \t\t\t$remember = JRequest::getBool('remember',0);\r\n \t\t\t\r\n \t\tjimport( 'joomla.user.authentication');\r\n\t\t\t\t$authenticate = &JAuthentication::getInstance();\r\n \t\t\t\r\n\t\t\t\t$credentials['username'] = $username;\r\n\t\t\t\t$credentials['password'] = $password;\r\n\t\t \r\n\t\t\t\t$options = array();\r\n\t\r\n\t\t\t\t$auth = $authenticate->authenticate($credentials, $options);\r\n\t\t\t\t$status = $auth->status;\r\n\t\t\t\t\r\n\t\t\t\tif (!JFusionConnect::checkRecaptcha($request)) {\r\n\t\t\t\t\tJFusionConnect::redirect(JText::_('Invalid Recaptcha'));\r\n\t\t\t\t}\r\n\t\t\t\tif ($status === JAUTHENTICATE_STATUS_SUCCESS) {\r\n\t\t\t\t\tif ($id = JUserHelper::getUserId($auth->username) ) {\r\n\t\t\t\t\t\t$user =& JFactory::getUser($id);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif (!$user->block) { \r\n\t\t\t\t\t\t\t$response =& JFusionConnect::login($request,$user,false);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$db = & JFactory::getDBO();\r\n\t\t\t\t\t $query = 'SELECT * FROM #__jfusionconnect ' . 'WHERE realm=' . $db->Quote($request->trust_root) . 'AND userid='.$db->Quote($user->id);\r\n\t\t\t\t\t $db->setQuery($query);\r\n\t\t\t\t\t $result = $db->loadObject();\r\n\t\t\t\t\t\t\tif (!$result) {\r\n\t\t\t\t\t\t\t\t$realm = new stdClass;\r\n\t\t\t\t\t\t\t\t$realm->id = null;\r\n\t\t\t\t\t\t\t\t$realm->userid = $user->id;\r\n\t\t\t\t\t\t\t\t$realm->realm = $request->trust_root;\r\n\t\t\t\t\t\t\t\t$realm->remember = $remember;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$db->insertObject('#__jfusionconnect', $realm, 'id');\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$realm = new stdClass;\r\n\t\t\t\t\t\t\t\t$realm->id = $result->id;\r\n\t\t\t\t\t\t\t\t$realm->userid = $result->userid;\r\n\t\t\t\t\t\t\t\t$realm->realm = $result->realm;\r\n\t\t\t\t\t\t\t\t$realm->remember = $remember;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$db->updateObject('#__jfusionconnect', $realm, 'id');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$status = JAUTHENTICATE_STATUS_FAILURE;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$status = JAUTHENTICATE_STATUS_FAILURE;\r\n\t\t\t\t\t}\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif ($status !== JAUTHENTICATE_STATUS_SUCCESS) {\r\n\t\t\t\t\t$id = JFusionConnect::getRequestID($request);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$req =& JFusionConnectRequest::getInstance($id);\r\n\t\t\t\t\t$savedRequest = $req->get();\r\n\t\t\t\t\t\r\n \t\t\t\tif ($id = JUserHelper::getUserId($username)) {\r\n \t\t\t\t\t$user =& JFactory::getUser($id);\r\n \t\t\t\t\t$logInstance =& JFusionConnectLog::getInstance(null,$user);\r\n \t\t\t\t} else {\r\n\t\t\t\t\t\t$logInstance =& JFusionConnectLog::getInstance(); \t\t\t\t\t\r\n \t\t\t\t}\r\n\t\t\t\t\t$loginerror = $logInstance->countFailedLogins($savedRequest->id);\r\n \t\t\t\tif ($loginerror<3) {\r\n\t\t\t\t\t\t$logInstance->add(JFusionConnectLog::STATUS_LOGIN_FAILED,$request);\r\n\t\t\t\t\t\tJFusionConnect::redirect(JText::_('E_LOGIN_AUTHENTICATE'));\r\n \t\t\t\t} else {\r\n\t\t\t\t\t\t$response =& $request->answer(false);\r\n\t\t\t\t\t\t$logInstance->add(JFusionConnectLog::STATUS_LOGIN_FAILED,$request,$response);\r\n \t\t\t\t}\r\n \t\t\t}\r\n\t\t } else {\t \t\r\n\t\t $response =& $server->handleRequest($request);\r\n\t\t $logInstance =& JFusionConnectLog::getInstance();\r\n \t\t\t$logInstance->add(JFusionConnectLog::STATUS_LOGIN_FAILED,$request,$response);\r\n\t\t }\r\n\t\t \r\n\t\t if (!Auth_OpenID_isError($response)) {\r\n\t \t\tJFusionConnect::response($server,$response);\r\n\t\t } else {\r\n\t\t \t$msg = $response->text;\r\n\t\t\t\t$this->setRedirect('index.php', $msg, $msgType);\r\n\t\t }\r\n \t} else {\r\n \t$this->setRedirect('index.php?option=com_jfusionconnect&view=login', $msg, $msgType);\r\n \t}\r\n }", "public function authenticate()\n\t{\n\t\tif ($data['code'] = $this->input->get('code', false, 'raw'))\n\t\t{\n\t\t\t$data['grant_type'] = 'authorization_code';\n\t\t\t$data['redirect_uri'] = $this->getOption('redirecturi');\n\t\t\t$data['client_id'] = $this->getOption('clientid');\n\t\t\t$data['client_secret'] = $this->getOption('clientsecret');\n\t\t\t$response = $this->http->post($this->getOption('tokenurl'), $data);\n\n\t\t\tif ($response->code >= 200 && $response->code < 400)\n\t\t\t{\n\n\t\t\t\tif ($response->headers['Content-Type'] == 'application/json')\n\t\t\t\t{\n\t\t\t\t\t$token = array_merge(json_decode($response->body, true), array('created' => time()));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tparse_str($response->body, $token);\n\t\t\t\t\t$token = array_merge($token, array('created' => time()));\n\t\t\t\t}\n\n\t\t\t\t$this->setToken($token);\n\n\t\t\t\treturn $token;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new RuntimeException('Error code ' . $response->code . ' received requesting access token: ' . $response->body . '.');\n\t\t\t}\n\t\t}\n\n\t\tif ($this->getOption('sendheaders'))\n\t\t{\n\t\t\t$this->application->redirect($this->createUrl());\n\t\t}\n\t\treturn false;\n\t}", "public function signin()\n {\n $oauthClient = new \\League\\OAuth2\\Client\\Provider\\GenericProvider([\n 'clientId' => config('microsoft.oauth_app_id'),\n 'clientSecret' => config('microsoft.oauth_app_password'),\n 'redirectUri' => config('microsoft.oauth_redirect_url'),\n 'urlAuthorize' => config('microsoft.oauth_authority').config('microsoft.oauth_authorize_endpoint'),\n 'urlAccessToken' => config('microsoft.oauth_authority').config('microsoft.oauth_token_endpoin'),\n 'urlResourceOwnerDetails' => '',\n 'scopes' => config('microsoft.oauth_scopes')\n ]);\n\n $authUrl = $oauthClient->getAuthorizationUrl();\n\n // Save client state so we can validate in callback\n session(['oauthState' => $oauthClient->getState()]);\n\n // Redirect to AAD signin page\n return redirect()->away($authUrl);\n }", "public function openAuthorizationUrl()\n {\n header('Location: ' . $this->getAuthorizationUrl());\n exit(1);\n }", "public function signin()\n {\n $oauthClient = new \\League\\OAuth2\\Client\\Provider\\GenericProvider([\n 'clientId' => env('OAUTH_APP_ID'),\n 'clientSecret' => env('OAUTH_APP_PASSWORD'),\n 'redirectUri' => env('OAUTH_REDIRECT_URI'),\n 'urlAuthorize' => env('OAUTH_AUTHORITY').env('OAUTH_AUTHORIZE_ENDPOINT'),\n 'urlAccessToken' => env('OAUTH_AUTHORITY').env('OAUTH_TOKEN_ENDPOINT'),\n 'urlResourceOwnerDetails' => '',\n 'scopes' => env('OAUTH_SCOPES')\n ]);\n \n $authUrl = $oauthClient->getAuthorizationUrl();\n \n // Save client state so we can validate in callback\n session(['oauthState' => $oauthClient->getState()]);\n \n // Redirect to AAD signin page\n return redirect()->away($authUrl);\n }", "public function authenticateSecondFactor() {\t \t \t\t \n\t \n\t $module = $this->getModule();\n\t \n\t\t$authParams = array(\n\t\t\t'module' => $module,\n\t\t);\n\t\t\n\t\tif ($module == RublonMagentoModule::CONNECT) {\n\t\t $callbackUrl = $this->getCallbackUrl($connect = true);\n\t\t} else {\n\t\t $callbackUrl = $this->getCallbackUrl();\n\t\t}\n\t\t\t\t\n\t\t$userId = $this->getAuthUserId();\n\t\t$email = $this->getAuthUserEmail(); \n\t\t\n\t\t$this->clearLoggedUser();\n \n try {\n \n $authUrl = $this->service->auth($callbackUrl, $userId, $email, $authParams); \n if (!empty($authUrl)) {\n \n // Retrive cached rublon features\n RublonFeature::getFeatures();\n \n $this->redirect($authUrl);\n } else {\n // do nothing\n }\n \n } catch (RublonException $e) {\n \n $notifierOptions = array(\n 'Method' => __METHOD__,\n 'Line' => __LINE__,\n 'Trace' => $e->getTraceAsString()\n );\n \n $this->addError($e, $notifierOptions);\n }\n\t}", "protected function _checkId($version, $params, $immediate, $extensions=null,\n Zend_Controller_Response_Abstract $response = null)\n {\n $ret = [];\n\n if ($version >= 2.0) {\n $ret['openid.ns'] = Zend_OpenId::NS_2_0;\n }\n $root = $this->getSiteRoot($params);\n if ($root === false) {\n return false;\n }\n\n if (isset($params['openid_identity']) &&\n !$this->_storage->hasUser($params['openid_identity'])) {\n $ret['openid.mode'] = ($immediate && $version >= 2.0) ? 'setup_needed': 'cancel';\n return $ret;\n }\n\n /* Check if user already logged in into the server */\n if (!isset($params['openid_identity']) ||\n $this->_user->getLoggedInUser() !== $params['openid_identity']) {\n $params2 = [];\n foreach ($params as $key => $val) {\n if (strpos($key, 'openid_ns_') === 0) {\n $key = 'openid.ns.' . substr($key, strlen('openid_ns_'));\n } else if (strpos($key, 'openid_sreg_') === 0) {\n $key = 'openid.sreg.' . substr($key, strlen('openid_sreg_'));\n } else if (strpos($key, 'openid_') === 0) {\n $key = 'openid.' . substr($key, strlen('openid_'));\n }\n $params2[$key] = $val;\n }\n if ($immediate) {\n $params2['openid.mode'] = 'checkid_setup';\n $ret['openid.mode'] = ($version >= 2.0) ? 'setup_needed': 'id_res';\n $ret['openid.user_setup_url'] = $this->_loginUrl\n . (strpos($this->_loginUrl, '?') === false ? '?' : '&')\n . Zend_OpenId::paramsToQuery($params2);\n return $ret;\n } else {\n /* Redirect to Server Login Screen */\n Zend_OpenId::redirect($this->_loginUrl, $params2, $response);\n return true;\n }\n }\n\n if (!Zend_OpenId_Extension::forAll($extensions, 'parseRequest', $params)) {\n $ret['openid.mode'] = ($immediate && $version >= 2.0) ? 'setup_needed': 'cancel';\n return $ret;\n }\n\n /* Check if user trusts to the consumer */\n $trusted = null;\n $sites = $this->_storage->getTrustedSites($params['openid_identity']);\n if (isset($params['openid_return_to'])) {\n $root = $params['openid_return_to'];\n }\n if (isset($sites[$root])) {\n $trusted = $sites[$root];\n } else {\n foreach ($sites as $site => $t) {\n if (strpos($root, $site) === 0) {\n $trusted = $t;\n break;\n }\n\n /* OpenID 2.0 (9.2) check for realm wild-card matching */\n $n = strpos($site, '://*.');\n if ($n != false) {\n $regex = '/^'\n . preg_quote(substr($site, 0, $n+3), '/')\n . '[A-Za-z1-9_\\.]+?'\n . preg_quote(substr($site, $n+4), '/')\n . '/';\n if (preg_match($regex, $root)) {\n $trusted = $t;\n break;\n }\n }\n }\n }\n\n if (is_array($trusted)) {\n if (!Zend_OpenId_Extension::forAll($extensions, 'checkTrustData', $trusted)) {\n $trusted = null;\n }\n }\n\n if ($trusted === false) {\n $ret['openid.mode'] = 'cancel';\n return $ret;\n }\n\n if ($trusted === null) {\n /* Redirect to Server Trust Screen */\n $params2 = [];\n\n foreach ($params as $key => $val) {\n if (strpos($key, 'openid_ns_') === 0) {\n $key = 'openid.ns.' . substr($key, strlen('openid_ns_'));\n } else if (strpos($key, 'openid_sreg_') === 0) {\n $key = 'openid.sreg.' . substr($key, strlen('openid_sreg_'));\n } else if (strpos($key, 'openid_') === 0) {\n $key = 'openid.' . substr($key, strlen('openid_'));\n }\n $params2[$key] = $val;\n }\n if ($immediate) {\n $params2['openid.mode'] = 'checkid_setup';\n $ret['openid.mode'] = ($version >= 2.0) ? 'setup_needed': 'id_res';\n $ret['openid.user_setup_url'] = $this->_trustUrl\n . (strpos($this->_trustUrl, '?') === false ? '?' : '&')\n . Zend_OpenId::paramsToQuery($params2);\n return $ret;\n } else {\n Zend_OpenId::redirect($this->_trustUrl, $params2, $response);\n return true;\n }\n }\n\n return $this->_respond($version, $ret, $params, $extensions);\n }", "function as_authenticate($cfg, $app_url = NULL, $remote_organization = NULL, $home_organization = NULL, $forced_logon = FALSE) {\n\n\t$req = as_message_create(\n\t\tarray(\n\t\t\t// NB: order is important here, when signing is enabled\n\t\t\t'request'\t\t\t\t=> 'authenticate',\n\t\t\t'a-select-server'\t\t=> $cfg['server']['server_id'],\n\t\t\t'app_id'\t\t\t\t=> $cfg['client']['app_id'],\n\t\t\t'app_url'\t\t\t\t=> isset($app_url) ? $app_url : as_get_self_url($_SERVER['REQUEST_URI']),\n\t\t\t'forced_logon' => $forced_logon ? 'true' : 'false',\n\t\t\t'remote_organization'\t=> $remote_organization,\n\t\t),\n\t\tarray_key_exists('key', $cfg['client']) ? $cfg['client']['key'] : NULL\n\t);\n\t\n\t// establish an authentication session with the server\n\t$rsp = as_call($cfg['server']['url'], $req, array_key_exists('ssl', $cfg['server']) ? $cfg['server']['ssl'] : NULL);\n\n\tif ($rsp['result_code'] != '0000') {\n\t\tthrow new Exception('Request on remote server returned error: ' . $rsp['_result']);\n\t}\n\n\t// redirect to the actual login page as returned by the A-Select server\n\t$redirect = $rsp['as_url'] . '&' . as_message_create(\n\t\t\t\tarray(\n\t\t\t\t\t'a-select-server'\t=> $cfg['server']['server_id'],\n\t\t\t\t\t'rid'\t\t\t\t=> $rsp['rid'],\n\t\t\t\t\t'home_organization'\t=> $home_organization,\n\t\t\t\t)\n\t\t\t);\n\n\theader('Location: ' . \t$redirect);\n\texit;\t\t\n}", "function external_auth()\n\t{\n\t\t//Check for get(google auth) as most of the logins should be that only\n\t\t//If not, check for post(fb and normal)\n\n\t\t$user_info = $this->_process_user_info();\n\t\t//var_dump($this->input->get('code'));\n\t\t\t\n\t\t$email = $user_info['email'];//trim($this->input->post('email'));\n\t\t$username = $user_info['username']; //trim($this->input->post('username'));\n\t\t\n\t\tif($this->users->is_email_available($email))\n\t\t{\n\t\t\t//First time fb_Login, create new user\n\t\t\t$this->_external_register($email, $username);\n\t\t}\n\n\t\t//get the user by email\n\t\t$user = $this->users->get_user_by_email($email);\n\n\t\t//Sign-in\n\t\t$this->_external_login($user->id, $user->username);\n\t}", "function oauth2Authenticate($imap, $email, $accessToken) {\n $authenticateParams = array('XOAUTH2',\n constructAuthString($email, $accessToken));\n $imap->sendRequest('AUTHENTICATE', $authenticateParams);\n while (true) {\n $response = \"\";\n $is_plus = $imap->readLine($response, '+', true);\n if ($is_plus) {\n error_log(\"got an extra server challenge: $response\");\n // Send empty client response.\n $imap->sendRequest('');\n } else {\n if (preg_match('/^NO /i', $response) ||\n preg_match('/^BAD /i', $response)) {\n error_log(\"got failure response: $response\");\n return false;\n } else if (preg_match(\"/^OK /i\", $response)) {\n return true;\n } else {\n // Some untagged response, such as CAPABILITY\n }\n }\n }\n}", "public function authenticate()\n {\n IF($this->strategy !== NULL) {\n RETURN $this->strategy->authenticate();\n }\n\n RETURN FALSE;\n }", "function authenticate() {}", "public function authenticate() {\n\t\treturn FALSE;\n\t}", "public static function autoLogin($openid)\n\t{\n\t\t//Cookie::set('auth_id', $openid, PHP_INT_MAX);\n\t}", "public function beginLogin() {\n \n $this->info(\"beginning login...\");\n \n $status = $this->requestAuthentication($this->requestURL, $this->authURL);\n \n if(!$status) {\n $this->error(\"problem launching Yahoo authenication: \".$this->getError());\n }\n \n return true;\n }", "function initiate(){\n $linkedin_config = array(\n 'appKey' => 'xxxxxxxx',\n 'appSecret' => 'xxxxxxxx',\n 'callbackUrl' => 'xxx=url=xxx/linkedin_signup/data/'\n );\n \n $this->load->library('linkedin', $linkedin_config);\n $this->linkedin->setResponseFormat(LINKEDIN::_RESPONSE_JSON);\n $token = $this->linkedin->retrieveTokenRequest();\n \n $this->session->set_flashdata('oauth_request_token_secret',$token['linkedin']['oauth_token_secret']);\n $this->session->set_flashdata('oauth_request_token',$token['linkedin']['oauth_token']);\n \n $link = \"https://api.linkedin.com/uas/oauth/authorize?oauth_token=\". $token['linkedin']['oauth_token']; \n redirect($link);\n }", "public static function initAuthFlow(string $returnPath = '')\n\t{\n\t\tif (!session_id())\n\t\t{\n\t\t\tsession_start();\n\t\t}\n\n\t\t$_SESSION['return_url'] = Config::BASE_URL . $returnPath;\n\t\t$_SESSION['state'] = md5(mt_rand());\n\n\t\t$query = http_build_query([\n\t\t\t'client_id'\t\t=> Config::TWITCH_APP_ID,\n\t\t\t'redirect_uri'\t=> Config::BASE_URL . 'auth',\n\t\t\t'response_type'\t=> 'code',\n\t\t\t'scope'\t\t\t=> '',\n\t\t\t'state'\t\t\t=> $_SESSION['state'],\n\t\t]);\n\t\theader('Location: https://id.twitch.tv/oauth2/authorize?' . $query);\n\t}", "public function authorize($options = array())\n\t{\n\t\t$state = md5(uniqid(rand(), true));\n\t\tget_instance()->session->set_userdata('state', $state);\n\n\t\t$params = array(\n\t\t\t'client_id' \t\t=> $this->client_id,\n\t\t\t'redirect_uri' \t\t=> isset($options['redirect_uri']) ? $options['redirect_uri'] : $this->redirect_uri,\n\t\t\t'state' \t\t\t=> $state,\n\t\t\t'scope'\t\t\t\t=> is_array($this->scope) ? implode($this->scope_seperator, $this->scope) : $this->scope,\n\t\t\t'response_type' \t=> 'code',\n\t\t\t'approval_prompt' => 'force' // - google force-recheck\n\t\t);\n\t\t\n\t\t$params = array_merge($params, $this->params);\n\t\t\n\t\tredirect($this->url_authorize().'?'.http_build_query($params));\n\t}", "function login_init() {\n\n\t\t\t$current_user_id = get_current_user_id();\n\n\t\t\tif ( $current_user_id ) {\n\n\t\t\t\t$is_merge = false;\n\t\t\t\tif ( isset( $_REQUEST[\"isMerge\"] ) && $current_user_id !== null ) {\n\t\t\t\t\tif ( $_REQUEST[\"isMerge\"] === 1 || $_REQUEST[\"isMerge\"] === '1' ) {\n\t\t\t\t\t\t$is_merge = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$linkid_user_id = get_user_meta( $current_user_id, self::WP_USER_META_VALUE_LINKID_USER_ID, true );\n\n\t\t\t\tif ( $is_merge && trim( $linkid_user_id ) ) {\n\n\t\t\t\t\t// generate the response\n\t\t\t\t\t$response = json_encode( Link_WP_LinkID_PollResult::createFromError(\n\t\t\t\t\t\t__( \"Unable to start merging. Logged in user already linked to linkID account\", \"link-linkid\" ),\n\t\t\t\t\t\tfalse ) );\n\n\t\t\t\t\t// response output\n\t\t\t\t\theader( \"Content-Type: application/json\" );\n\t\t\t\t\techo $response;\n\n\t\t\t\t\tdie();\n\n\t\t\t\t} else if ( ! $is_merge && trim( $linkid_user_id ) ) {\n\n\t\t\t\t\t// generate the response\n\t\t\t\t\t$response = json_encode( Link_WP_LinkID_PollResult::createFromError(\n\t\t\t\t\t\t__( \"Unable to start login. User already logged in. Please wait while you are being redirected.\", \"link-linkid\" ),\n\t\t\t\t\t\tfalse, false, true, $this->get_redirect_url( wp_get_current_user() ) ) );\n\n\t\t\t\t\t// response output\n\t\t\t\t\theader( \"Content-Type: application/json\" );\n\t\t\t\t\techo $response;\n\n\t\t\t\t\tdie();\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$linkIDAuthnSession = Link_WP_LinkID::start_authn_request();\n\n\t\t\t// generate the response\n\t\t\t$response = json_encode( Link_WP_LinkID_PollResult::createFromAuthnSession( $linkIDAuthnSession ) );\n\n\t\t\t// response output\n\t\t\theader( \"Content-Type: application/json\" );\n\t\t\techo $response;\n\n\t\t\tdie();\n\t\t}", "function go_to_auth_url($web_auth) {\n $authURL = $web_auth->start();\n header('Location: ' . $authURL);\n exit();\n}", "function auth()\n\t{\n\t\t$_aok_ = $_COOKIE['_aok_'];\n\t\tif (isset($_aok_))\n\t\t{\n\t\t\t$query = mysql_query(\"SELECT sessionId FROM auth WHERE sessionId = '$_aok_'\");\n\t\t\tif (mysql_num_rows($query) > 0)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function login($username, $password, $request = null)\n {\n if ($request instanceof Mage_Core_Controller_Request_Http) {\n try {\n if (($postLogin = $request->getPost('login')) && isset($postLogin['openid_identifier']) && $username === $postLogin['openid_identifier']) {\n $consumer = new Zend_OpenId_Consumer();\n if (!$consumer->login($username)) {\n Mage::throwException(Mage::helper('flagbit_openid')->__('OpenID Login failed.'));\n }\n }\n \n $identity = null;\n if ('id_res' === $request->getParam('openid_mode')) {\n $consumer = new Zend_OpenId_Consumer();\n // idenitity will be returned by reference\n if (!$consumer->verify($request->getParams(), $identity)) {\n Mage::throwException(Mage::helper('flagbit_openid')->__('OpenID Verification failed.'));\n }\n \n /* @var $user Flagbit_OpenId_Model_Admin_User */\n $user = Mage::getModel('flagbit_openid/admin_user');\n $user->login($identity, $password);\n \n if ($user->getId()) {\n $this->renewSession();\n if (Mage::getSingleton('adminhtml/url')->useSecretKey()) {\n Mage::getSingleton('adminhtml/url')->renewSecretUrls();\n }\n $this->setIsFirstPageAfterLogin(true);\n $this->setUser($user);\n $this->setAcl(Mage::getResourceModel('admin/acl')->loadAcl());\n if ($requestUri = $this->_getRequestUri($request)) {\n Mage::dispatchEvent('admin_session_user_login_success', array('user' => $user));\n header('Location: ' . $requestUri);\n exit;\n }\n }\n else {\n Mage::throwException(Mage::helper('adminhtml')->__('Invalid Username or Password.'));\n }\n }\n\n if ('cancel' === $request->getParam('openid_mode')) {\n Mage::throwException(Mage::helper('flagbit_openid')->__('OpenID Login has been canceled.'));\n }\n }\n catch (Mage_Core_Exception $e) {\n Mage::dispatchEvent(\n 'admin_session_user_login_failed',\n array('user_name' => $username, 'exception' => $e)\n );\n if ($request && !$request->getParam('messageSent')) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n $request->setParam('messageSent', true);\n }\n }\n }\n \n return parent::login($username, $password, $request);\n }", "protected function Validate() : Bool\n {\n $params = [];\n\n foreach ($this->verifyWhitelist as $k => $v) {\n if( isset($_GET[$v]) ){\n $params[$k] = $_GET[$v];\n }\n }\n\n $params[\"openid.mode\"] = \"check_authentication\"; \n \n if ( !isset($params[\"openid.return_to\"]) || $params[\"openid.return_to\"] != $this->redirectParams[\"openid.return_to\"] ){\n return false;\n } \n\n $client = $this->Client();\n\n $response = $client->request(\"POST\", $this->urlAuthorize, [ \n \"form_params\" => $params, \n \"headers\" => [ \"Accept\" => \"application/json\" ] \n ]);\n\n $response = (string) $response->getBody(); \n\n if( strpos($response, \"is_valid:true\") === false ){\n return false;\n } \n\n return true;\n }", "function ts3client_createIdentity(&$result) {}", "public function login()\n\t{\n\t\tif($this->_identity===null)\n\t\t{\n\t\t\t$this->_identity=new UserIdentity($this->phone,$this->password);\n\t\t\t$this->_identity->authenticate();\n\t\t}\n\t\tif($this->_identity->errorCode===UserIdentity::ERROR_NONE)\n\t\t{\n $duration = 3600*24*30;\n\t\t\tYii::app()->user->login($this->_identity,$duration);\n\t\t\treturn true;\n\t\t}\n\t\t\t\n return false;\n\t}", "public function authenticationCallback() \n\t{\n\t\n\t\tif (!isset($_GET['code'])) {\n\t\t\treturn;\n\t\t}\n\n\t\t$store = SBTCredentialStore::getInstance();\n\t\t$settings = new SBTSettings();\n\t\t\n\t\t$endpointName = \"connections\";\n\t\tif (isset($_GET['endpointName'])) {\n\t\t\t$endpointName = $_GET['endpointName'];\n\t\t}\n\n\t\t$parameters = array(\n\t\t\t\t'callback_uri' => $settings->getOAuth2CallbackURL($endpointName),\n\t\t\t\t'code' => $_GET['code'],\n\t\t\t\t'grant_type' => 'authorization_code',\n\t\t\t\t'client_id' => $settings->getClientId($endpointName),\n\t\t\t\t'client_secret' => $settings->getClientSecret($endpointName)\n\t\t);\n\t\t\n\t\t$tokenURL = $settings->getAccessTokenURL($endpointName) . '?' . http_build_query($parameters, null, '&');\n\t\t$client = new Client($tokenURL);\n\t\t$client->setDefaultOption('verify', false);\n\t\t\n\t\t$headers = null;\n\t\t$body = null;\n\t\t$options = array();\n\t\t$response = null;\n\t\t\n\t\ttry {\n\t\t\t$request = $client->createRequest('GET', $tokenURL, $headers, $body, $options);\n\t\t\tif ($settings->forceSSLTrust($endpointName)) {\n\t\t\t\t$request->getCurlOptions()->set(CURLOPT_SSL_VERIFYHOST, false);\n\t\t\t\t$request->getCurlOptions()->set(CURLOPT_SSL_VERIFYPEER, false);\n\t\t\t}\n\t\t\t$response = $request->send();\n\t\t\n\t\t\tforeach ($response->getHeaderLines() as $h) {\n\t\t\t\tif (strpos($h, \"Content-Type\") === 0) header($h, TRUE);\n\t\t\t}\n\t\t\n\t\t\theader(':', true, $response->getStatusCode());\n\t\t\theader('X-PHP-Response-Code: ' . $response->getStatusCode(), true, $response->getStatusCode());\n\t\t\n\t\t\tparse_str($response->getBody(TRUE), $info);\n\t\t\n\t\t\tif (!isset($info['access_token'])) {\n\t\t\t\tdie('Missing access token. Something went wrong - make sure that your client ID and client secret are correct and try again.');\n\t\t\t}\n\t\t\t\n\t\t\t$accessToken = $store->getOAuthAccessToken($endpointName);\n\t\t\tif ($accessToken == null || $accessToken == \"\") {\n\t\t\t\t$store->storeOAuthAccessToken($info['access_token'], $endpointName);\n\t\t\t}\n\t\t\t\n\t\t\theader(\"Location: \" . $settings->getOAuthOrigin($endpointName));\n\t\t\t\n\t\t} catch(Guzzle\\Http\\Exception\\BadResponseException $e) {\n\t\t\t$response = $e->getResponse();\n\t\t\tprint_r($response->getBody(TRUE));\n\t\t}\n\t}", "public function signin()\n {\n $oauthClient = new \\League\\OAuth2\\Client\\Provider\\GenericProvider([\n 'clientId' => env('OAUTH_APP_ID'),\n 'clientSecret' => env('OAUTH_APP_PASSWORD'),\n 'redirectUri' => env('OAUTH_REDIRECT_URI'),\n 'urlAuthorize' => env('OAUTH_AUTHORITY').env('AZURE_AD_TENANT_ID').env('OAUTH_AUTHORIZE_ENDPOINT'),\n 'urlAccessToken' => env('OAUTH_AUTHORITY').env('AZURE_AD_TENANT_ID').env('OAUTH_TOKEN_ENDPOINT'),\n 'urlResourceOwnerDetails' => '',\n 'scopes' => env('OAUTH_SCOPES')\n ]);\n\n $authUrl = $oauthClient->getAuthorizationUrl();\n\n // Save client state so we can validate in callback\n session(['oauthState' => $oauthClient->getState()]);\n\n // Redirect to AAD signin page\n return redirect()->away($authUrl);\n }", "protected function shouldAutoInitiate(): bool\n {\n $socialDrivers = $this->socialAuthService->getActiveDrivers();\n $authMethod = config('auth.method');\n $autoRedirect = config('auth.auto_initiate');\n\n return $autoRedirect && count($socialDrivers) === 0 && in_array($authMethod, ['oidc', 'saml2']);\n }", "public static function EnsureAuthentication() {\n // take corrective action to redirect the user to an appropriate login location\n // if the current session is not actually authenticated\n\n try {\n $result = self::GetAuthenticationProvider()->ValidateUserSessionIsActive(true);\n // Auth providers will always include a `nextStepURL` if authentication fails.\n // Sometimes other actions may require a `nextStepURL` that should be enforced with\n // an authentication request (2FA, Expired Password, etc).\n if (!$result->isAuthenticated){\n LoggerUtils::getAuthLogger()->debug(\"Session not authenticated. Redirecting to login page\");\n RedirectUtils::Redirect(self::GetSessionBeginURL());\n }elseif(null !== $result->nextStepURL){\n LoggerUtils::getAuthLogger()->debug(\"Session authenticated, but redirect requested by authentication provider.\");\n RedirectUtils::Redirect($result->nextStepURL);\n }\n LoggerUtils::getAuthLogger()->debug(\"Session valid\");\n } catch (\\Throwable $error){\n LoggerUtils::getAuthLogger()->debug(\"Error determining session authentication status. Redirecting to login page. \" . $error);\n RedirectUtils::Redirect(self::GetSessionBeginURL());\n }\n }", "public function oauth()\n {\n // TODO: Check user's preference if to ask user every time when new application trying to identify visitor\n\n $redirect_uri = YY::Config('tokens')->createOAuth([\n 'user' => YY::$ME,\n 'state' => $this['state'],\n 'redirect_uri' => $this['redirect_uri'],\n 'where' => $this['where'],\n 'title' => $this['title'],\n ]);\n\n if ($redirect_uri) {\n\n YY::Log('system', 'JS client redirection to: ' . $this['redirect_uri']);\n $redirect_uri = json_encode($redirect_uri);\n YY::clientExecute(\"location.replace($redirect_uri)\");\n// YY::redirectUrl($redirect_uri);\n\n } else {\n\n YY::Log('system', 'Redirect impossible (redirect_uri is empty)');\n $errorMessage = YY::Translate('Something went wrong sorry');\n $errorMessage = json_encode($errorMessage);\n YY::clientExecute(\"alert($errorMessage)\");\n }\n }", "private function _checkIdent()\n {\n $auth = Zend_Auth::getInstance();\n $auth->setStorage(new Zend_Auth_Storage_Session('hl_connect'));\n \n if ($auth->hasIdentity())\n $this->_agentSchemeNumber = $auth->getStorage()->read()->agentschemeno;\n \n return $auth->hasIdentity();\n }", "private function authorisationRequest() \n {\n $url = 'https://oauth2.constantcontact.com/oauth2/oauth/siteowner/authorize?';\n $url.='response_type=code';\n $url.='&client_id='.$this->apikey;\n $url.='&redirect_uri='.$this->redirectURL;\n \n $response = $this->makeRequest($url);\n echo $response;\n die($response);\n //now wait for redirectURL to be called\n }", "private function authenticate()\n {\n // If already authenticated, no need to do it again\n if($this->is_authenticated() && $this->authenticated)\n return true;\n\n // ==== Application-only authentication; no need for signed oAuth ======\n if($this->mode == rabkTwttr::MODE_APP)\n {\n // Encode consumer key and consumer secret\n $encodedToken = base64_encode(rawurlencode(rabkTwttr::$consumer_key) . ':' . rawurlencode(rabkTwttr::$consumer_secret));\n\n // Query to get bearer token\n $auth = 'Basic ' . $encodedToken;\n $body = 'grant_type=client_credentials';\n $query = rabkTwttr::httpquery('oauth2/token', 'POST', $auth, $body, $JSON = true);\n\n // Return the token if valid\n if($query->token_type != 'bearer')\n die('Error: couldn\\'t authenticate.');\n\n $_SESSION['access_token'] = $query->access_token;\n }\n\n // ==== User authentication: need signed oAuth =========================\n else if($this->mode == rabkTwttr::MODE_USER)\n {\n // ---- If need to redirect to Twitter for user login --------------\n if(!isset($_GET['oauth_token']) && !isset($_GET['oauth_verifier']))\n {\n // Query Twitter to get a request token\n $oauth_params['oauth_callback'] = $this->oauth_callback;\n $query = rabkTwttr::httpquery('oauth/request_token', 'POST', $oauth_params);\n\n // Parse results\n parse_str($query);\n if(!$oauth_callback_confirmed)\n die('Error: Query to Twitter failed');\n\n // If everything good, redirect to Twitter to authenticate\n echo '<script>window.location=\"https://api.twitter.com/oauth/authenticate?oauth_token=' . $oauth_token . '\";</script>';\n }\n\n // ---- Once redirected from Twitter login page --------------------\n else\n {\n // Query Twitter to get the access token\n $oauth_params['oauth_token'] = $_GET['oauth_token'];\n $oauth_params['oauth_verifier'] = $_GET['oauth_verifier'];\n\n $body = 'oauth_verifier=' . $oauth_params['oauth_verifier'];\n $query = rabkTwttr::httpquery('oauth/access_token', 'POST', $oauth_params, $body);\n\n // Save tokens to session variable\n parse_str($query);\n $_SESSION['access_token'] = $oauth_token;\n $_SESSION['access_token_secret'] = $oauth_token_secret;\n\n $this->authenticated = true;\n return true;\n }\n }\n else\n die('Error: invalid mode.');\n }", "public function firstAuthentication()\n {\n if (! $this->email_verified_at){\n $this->setEmailVerified();\n return true;\n }\n return false;\n }", "public function authenticate()\n {\n // See if we need to call the setup function\n if ($this->callSetup)\n {\n $setup = $this->setup;\n $setup();\n $this->callSetup = false;\n }\n\n // See if a session must exist\n if ($this->previousSessionOnly)\n {\n $session_exists = false;\n\n // See if we have a session\n if (session_status() == PHP_SESSION_ACTIVE)\n {\n if (array_key_exists(\"phpCAS\", $_SESSION))\n {\n if (array_key_exists(\"user\", $_SESSION[\"phpCAS\"]))\n {\n $session_exists = true;\n }\n }\n }\n\n // If we don't have a session consider it as no authentication\n if (! $session_exists)\n {\n return null;\n }\n }\n\n // Check for CAS authentication\n phpCAS::setCacheTimesForAuthRecheck(0);\n if (phpCAS::checkAuthentication())\n {\n # Get the ID\n $id = phpCAS::getUser();\n\n # Get the attributes\n $attributes = phpCAS::getAttributes();\n\n # Return a new identity\n return new Identity($id, $attributes);\n }\n else\n {\n return null;\n }\n }", "public function authentication(): void\n {\n $oauthParams = [\n 'clientId' => $this->config['clientId'],\n 'clientSecret' => $this->config['clientSecret'],\n 'redirectUri' => $this->config['callbackUrl'],\n ];\n\n $auth = new OAuth($oauthParams);\n\n if (isset($_GET['code'])) {\n $token = $auth->getAccessToken('authorization_code', ['code' => $_GET['code']]);\n\n $this->accessToken = $token->getToken();\n $this->refreshToken = $token->getRefreshToken();\n $this->instanceUrl = $token->getInstanceUrl();\n $this->tokenExpiry = $token->getExpires();\n\n } else {\n header('Location: '.$auth->getAuthorizationUrl());\n die();\n }\n }", "public function exchange()\n {\n $code = $this->getAuthorizationCode();\n if (! $code) {\n return false;\n }\n\n $state = $this->getState();\n if (! $this->stateHandler->validate($state)) {\n throw new CoreException('Invalid state');\n }\n\n if ($this->user) {\n throw new CoreException('Can\\'t initialize a new session while there is one active session already');\n }\n\n $response = $this->authentication->code_exchange($code, $this->redirectUri);\n\n if (empty($response['access_token'])) {\n throw new ApiException('Invalid access_token - Retry login.');\n }\n\n $this->setAccessToken($response['access_token']);\n\n if (isset($response['refresh_token'])) {\n $this->setRefreshToken($response['refresh_token']);\n }\n\n if (! empty($response['id_token'])) {\n $this->setIdToken($response['id_token']);\n }\n\n if ($this->skipUserinfo) {\n $user = $this->idTokenDecoded;\n } else {\n $user = $this->authentication->userinfo($this->accessToken);\n }\n\n if ($user) {\n $this->setUser($user);\n }\n\n return true;\n }", "public function login()\n {\n return Redirect::to('https://' . Request::server('SERVER_NAME')\n . ':' . Request::server('SERVER_PORT') . config('shibboleth.idp_login')\n . '?target=' . action('\\\\' . __CLASS__ . '@idpAuthenticate'));\n }", "public function init() {\n// $session->open();\n// if (empty($_SESSION['userid'])) {\n// return $this->redirect('index.php?r=login');\n// }\n }", "public function authorize() {\n\t\t$authorization = false;\n\t\t// Clickjacking prevention (supported by IE8+, FF3.6.9+, Opera10.5+, Safari4+, Chrome 4.1.249.1042+)\n\t\t$this->OAuth->setVariable('auth_code_lifetime', 60);\n\t\t$this->response->header('X-Frame-Options: DENY');\n\t\ttry {\n\t\t\t$OAuthParams = $this->OAuth->getAuthorizeParams();\n\t\t} catch (Exception $e){\n\t\t\t$e->sendHttpResponse();\n\t\t}\n\t\tif (!empty($OAuthParams)) {\n\t\t\t$clientCredencials = $this->OAuth->checkClientCredentials($OAuthParams['client_id']);\n\t\t\tlist($redirectUri, $authorization) = $this->OAuth->getAuthResult($clientCredencials, $clientCredencials['user_id'], $OAuthParams);\n\t\t\tif (!empty($authorization['query']['code'])) {\n\t\t\t\t$authorization = $authorization['query'];\n\t\t\t}\n\t\t}\n\n\t\t$this->set(array('authorization' => $authorization, '_serialize' => 'authorization'));\n\t}", "public function activate()\n {\n $response = $this->response();\n /* le hash de l'email */\n $emailHash = $this->uri->segment(3);\n /* le log d'activation */\n $logID = $this->uri->segment(4);\n if ($this->oauth_web->activate($emailHash, $logID)) {\n redirect();\n // $response[\"status\"] = true;\n }\n // $this->output->set_output(json_encode($response));\n }", "public function authorize()\n\t{\n\t\t$state = md5(uniqid(rand(), TRUE));\n\t\t$this->oauth->ci->session->set_userdata('state', $state);\n\t\t\t\n\t\t$params = array(\n\t\t\t'client_id' => $this->_config['client_id'],\n\t\t\t'redirect_uri' => $this->_config['redirect_uri'],\n\t\t\t'state' => $state,\n\t\t\t'scope' => 'email'\n\t\t);\n\t\t\n\t\t$url = $this->_authorize_endpoint.http_build_query($params);\n\t\tredirect($url);\n\t}", "public function resolve($url, $version, $privKey = null)\n {\n if ($this->loadAssociation($url)) {\n return true;\n }\n \n $this->_associationData = array(\n 'url' => $url,\n 'version' => $version\n );\n \n if ($version >= 2.0) {\n $params = array(\n 'openid.ns' => Zend_OpenId::NS_2_0,\n 'openid.mode' => 'associate',\n 'openid.assoc_type' => 'HMAC-SHA256',\n 'openid.session_type' => 'DH-SHA256',\n );\n } else {\n $params = array(\n 'openid.mode' => 'associate',\n 'openid.assoc_type' => 'HMAC-SHA1',\n 'openid.session_type' => 'DH-SHA1',\n );\n }\n\n $dh = $this->getDh($privKey);\n $dhDetails = Zend_OpenId::getDhKeyDetails($dh);\n \n $params['openid.dh_modulus'] = base64_encode(\n Zend_OpenId::btwoc($dhDetails['p']));\n $params['openid.dh_gen'] = base64_encode(\n Zend_OpenId::btwoc($dhDetails['g']));\n $params['openid.dh_consumer_public'] = base64_encode(\n Zend_OpenId::btwoc($dhDetails['pub_key']));\n \n $httpClient = $this->getHttpClient();\n $httpClient->setHeaders('Accept', false);\n $httpClient->setUri($url);\n \n while (true) {\n try {\n $httpClient->resetParameters();\n $httpClient->setMethod(Zend_Http_Client::POST);\n $httpClient->setParameterPost($params);\n $response = $httpClient->request();\n } catch (Exception $e) {\n $this->setError('HTTP Request failed: ' . $e->getMessage());\n return false;\n }\n if ($response->getStatus() != 200) {\n $this->setError('HTTP request failed: The server responded ' .\n 'with status code: ' . $response->getStatus());\n return false;\n }\n \n $rParams = $this->responseToArray($response->getBody());\n \n if (isset($rParams['error_code'])) {\n if ($rParams['error_code'] != 'unsupported-type') {\n $error = 'The openid provider responded with' . \n $rParams['error_code'];\n if (isset($rParams['error'])) {\n $error .= ':' . $rParams['error'];\n }\n $this->setError($error);\n return false;\n }\n \n if (isset($rParams['session_type']) &&\n $rParams['session_type'] == 'no-encryption' &&\n $params['openid.session_type'] != 'no-encryption') {\n $params['openid.session_type'] = 'no-encryption';\n if (isset($rParams['assoc_type'])) {\n $params['openid.assoc_type'] = $rParams['assoc_type'];\n } else {\n $params['openid.assoc_type'] = 'HMAC-SHA256';\n }\n } else if ($params['openid.session_type'] == 'DH-SHA256') {\n $params['openid.session_type'] = 'DH-SHA1';\n $params['openid.assoc_type'] = 'HMAC-SHA1';\n } else if ($params['openid.session_type'] == 'DH-SHA1') {\n $params['openid.session_type'] = 'no-encryption';\n $params['openid.assoc_type'] = 'HMAC-SHA256';\n } else if ($params['openid.session_type'] == 'no-encryption' &&\n $params['openid.assoc_type'] == 'HMAC-SHA256') {\n $params['openid.assoc_type'] = 'HMAC-SHA1';\n } else {\n $this->setError('Unsupported session and assoc types');\n return false;\n }\n \n if ($params['openid.session_type'] == 'no-encryption' &&\n substr(trim($url), 0, 8) !== 'https://') {\n \n if (substr(trim($url), 0, 5) === 'http:') {\n // Don't use plain requests if DH encryption not used\n $url = 'https' . substr($url, 4);\n } else { \n $this->setError('Must not use no-encryption session ' .\n 'type without using SSL/TLS protocol');\n return false;\n }\n }\n } else {\n break;\n }\n } // end while\n \n if (!$this->validateCommonParams($rParams)) {\n return false;\n }\n \n \n if ($rParams['assoc_type'] == 'HMAC-SHA1') {\n $macFunc = 'sha1';\n } else if ($rParams['assoc_type'] == 'HMAC-SHA256' &&\n $this->_associationData['version'] >= 2.0) {\n $macFunc = 'sha256';\n } else {\n $this->setError('Unsupported assoc_type');\n return false;\n }\n \n \n $secret = $this->deriveSharedSecret($rParams, $macFunc);\n if ($secret === false) {\n return false;\n }\n \n try {\n $expire = new DateTime('now', new DateTimeZone('UTC'));\n $expire->add(new DateInterval('PT'.\n (int) $rParams['expires_in'] .'S'));\n } catch (Exception $e) {\n $this->setError('expire_time invalid: ' . $e->getMessage());\n return false;\n }\n \n // Successful association respose is valid if we got this far\n $this->_associationData['handle'] = $rParams['assoc_handle'];\n $this->_associationData['macFunc'] = $macFunc;\n $this->_associationData['secret'] = $secret;\n $this->_associationData['expire'] = $expire->format('c');\n \n $this->addAssociation($this->_associationData);\n \n return true;\n }", "function requestCode ($domain) {\n $url = 'https://' . $domain . '/oauth/authorize/' .\n '?client_id=' . urlencode(APP_ID);\n redirect($url);\n}", "public function idpAuthenticate()\n {\n if (empty(config('shibboleth.user'))) {\n throw new \\Exception('No user attribute mapping for server variables.');\n }\n\n foreach (config('shibboleth.user') as $local => $server) {\n $map[$local] = $this->getServerVariable($server);\n }\n\n if (empty($map['email'])) {\n return abort(403, 'Unauthorized');\n }\n\n $userClass = config('auth.providers.users.model', 'App\\User');\n\n // Attempt to login with the email, if success, update the user model\n // with data from the Shibboleth headers (if present)\n if (Auth::attempt(array('email' => $map['email']), true)) {\n $user = $userClass::where('email', '=', $map['email'])->first();\n\n // Update the model as necessary\n $user->update($map);\n }\n\n // Add user and send through auth.\n elseif (config('shibboleth.add_new_users', true)) {\n $map['password'] = 'shibboleth';\n $user = $userClass::create($map);\n Auth::login($user);\n }\n\n else {\n return abort(403, 'Unauthorized');\n }\n\n Session::regenerate();\n\n // Check if there is a session variable 'shibboleth_redirect_to' set, otherwise use the default value in config('shibboleth.authenticated')\n $route = empty(session('shibboleth_redirect_to')) ? config('shibboleth.authenticated') : session('shibboleth_redirect_to');\n\n // Unset the shibboleth_redirect_to if it was set\n if(!empty(session('shibboleth_redirect_to'))){\n\n session()->remove('shibboleth_redirect_to');\n\n }\n\n// if (config('jwtauth') === true) {\n// $route .= $this->tokenizeRedirect($user, ['auth_type' => 'idp']);\n// }\n\n return redirect()->intended($route);\n }", "protected function IsReturned() : bool\n {\n return isset($_GET[\"openid_mode\"]) && !empty($_GET[\"openid_mode\"]); \n }", "public function oauthAction() {\n $oauthNS = new Zend_Session_Namespace('oauthNS');\n if ($this->getRequest()->getParam('method') && $this->getRequest()->getParam('method') == 'popup') {\n $oauthNS->popup = true;\n }\n $result = $this->_auth->authenticate($this->_adapter);\n if ($result->isValid()) {\n $this->_helper->flashMessenger->addMessage(array('success' => 'Login was successful'));\n $this->_auth->getStorage()->write(array(\"identity\" => $result->getIdentity(), \"user\" => new Josh_Auth_User($this->_type, $result->getMessages())));\n } else {\n $errorMessage = $result->getMessages();\n $this->_helper->flashMessenger->addMessage(array('error' => $errorMessage['error']));\n }\n\n if (isset($oauthNS->popup) && $oauthNS->popup == true) {\n unset($oauthNS->popup);\n echo $this->view->partial('partials/oauthClose.phtml');\n } else {\n $this->_redirect('/');\n }\n }", "function doSecureAuthValidate(){\n\t\n\t\tif(\t@$this->loginKey == \"\" || @$this->identification == \"\"){\n\t\t\t\n\t\t\t$respArray = $this->makeResponse(\"ERROR\", \"You need to login to access this service \", \"localStorage.clear(); window.location='index.html'; \");\n\t\t\t\n\t\t\techo $this->jsoncallback.\"(\".json_encode($respArray).\")\";\n\t\t\texit;\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\t$this->basics->doSecureAuth(@$this->loginKey, @$this->obsfucate->makeKey($this->sanitize( $this->identification )) );\n\t\t\t\t\t\n\t\t}\n\t\t\n\t}", "public function getOpenId()\n {\n }", "function login($user_name, $password){\r\n $user_name = server(get_sso_option('user_name'));\r\n if(empty($_COOKIE['sunIdentityServerAuthNServer'])){\r\n // Go to IDP!\r\n $now = 'http://'.server('HTTP_HOST').server('REQUEST_URI');\r\n $login_url = ssl(get_option('sso_login_url'));\r\n $trigger = 'http://'.server('HTTP_HOST').get_sso_option('trigger');\r\n $trigger = ssl($trigger);\r\n $goto = redirect_to(TRUE);\r\n $url = $login_url.'?goto='.urlencode($trigger.'?redirect_to='.$goto);\r\n\theader('Location: '.$url);\r\n exit(0);\r\n }elseif(!empty($_COOKIE['sunIdentityServerAuthNServer']) AND empty($user_name)){\r\n // Go to trigger!\r\n $now = 'http://'.server('HTTP_HOST').server('REQUEST_URI');\r\n $trigger = get_sso_option('trigger').'?redirect_to='.$now;\r\n $trigger = ssl($trigger);\r\n\theader('Location: '.$trigger);\r\n exit(0);\r\n }elseif(!empty($_COOKIE['sunIdentityServerAuthNServer']) AND !empty($user_name) AND !is_user_logged_in()){\r\n // Login!\r\n\t$user_email = server(get_sso_option('user_email'));\r\n $user = get_userdatabylogin($user_name);\r\n if($user === FALSE){\r\n // creat new user\r\n require_once(WPINC . DIRECTORY_SEPARATOR . 'registration.php');\r\n $id = wp_create_user($user_name, _generate_password(), $user_email);\r\n $user = get_userdata($id);\r\n\t}\r\n\t// login...\r\n _update_userdata($user);\r\n $password = _generate_password();\r\n }else{\r\n // Go to the blog!\r\n redirect_to(TRUE, TRUE);\r\n }\r\n}" ]
[ "0.71878654", "0.6636602", "0.6598109", "0.6526378", "0.6410717", "0.6309532", "0.62821895", "0.61969507", "0.6162157", "0.61491865", "0.6117497", "0.6112885", "0.6089491", "0.6066943", "0.5991146", "0.59550554", "0.59535706", "0.5929273", "0.5873291", "0.58490545", "0.5838399", "0.5801211", "0.578749", "0.578105", "0.5740455", "0.5738192", "0.5710834", "0.5690937", "0.557813", "0.5574032", "0.55657125", "0.5554416", "0.552415", "0.55053836", "0.5496462", "0.54742503", "0.54589623", "0.5444026", "0.54221356", "0.5412426", "0.5403626", "0.5394345", "0.5393225", "0.53930146", "0.5387114", "0.53709245", "0.5369379", "0.5359488", "0.5359475", "0.5350521", "0.53497434", "0.53369576", "0.53305244", "0.53278154", "0.5303922", "0.52958167", "0.52903795", "0.52882135", "0.527452", "0.5261036", "0.5260445", "0.52566636", "0.52514523", "0.52371776", "0.52362186", "0.5227042", "0.5202127", "0.52013355", "0.51977015", "0.518378", "0.5181384", "0.5181128", "0.5165527", "0.5165151", "0.5164765", "0.51581323", "0.51567304", "0.51552427", "0.51422524", "0.5141159", "0.51288825", "0.5127606", "0.5124854", "0.5111084", "0.5107276", "0.510311", "0.5101401", "0.5087549", "0.50795823", "0.5078076", "0.507676", "0.50738096", "0.50714767", "0.50628227", "0.5055865", "0.50526685", "0.5051185", "0.5045838", "0.5044355", "0.50266117" ]
0.6008249
14
Return TRUE if OpenID verification was successful
function verified($proxy=NULL) { preg_match_all('/(?<=^|&)openid\.([^=]+)=([^&]+)/', $_SERVER['QUERY_STRING'],$matches,PREG_SET_ORDER); foreach ($matches as $match) $this->args[$match[1]]=urldecode($match[2]); if (isset($this->args['mode']) && $this->args['mode']!='error' && $this->url=$this->discover($proxy)) { $this->args['mode']='check_authentication'; $var=[]; foreach ($this->args as $key=>$val) $var['openid.'.$key]=$val; $req=\Web::instance()->request( $this->url, [ 'method'=>'POST', 'content'=>http_build_query($var), 'proxy'=>$proxy ] ); return (bool)preg_match('/is_valid:true/i',$req['body']); } return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function simpleid_checkid_ok($request) {\n global $version;\n \n $message = array(\n 'openid.mode' => 'id_res',\n 'openid.op_endpoint' => simpleid_url(),\n 'openid.response_nonce' => openid_nonce()\n );\n \n if (isset($request['openid.assoc_handle'])) $message['openid.assoc_handle'] = $request['openid.assoc_handle'];\n if (isset($request['openid.identity'])) $message['openid.identity'] = $request['openid.identity'];\n if (isset($request['openid.return_to'])) $message['openid.return_to'] = $request['openid.return_to'];\n \n if (($version >= OPENID_VERSION_2) && isset($request['openid.claimed_id'])) {\n $message['openid.claimed_id'] = $request['openid.claimed_id'];\n }\n \n $message = array_merge($message, extension_invoke_all('response', TRUE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "function simpleid_check_authentication($request) {\n global $version;\n \n log_info('OpenID direct verification: ' . log_array($request));\n \n $is_valid = simpleid_verify_signatures($request);\n\n if ($is_valid) {\n $response = array('is_valid' => 'true');\n } else {\n $response = array('is_valid' => 'false');\n }\n \n // RP wants to check whether a handle is invalid\n if (isset($request['openid.invalidate_handle'])) {\n $invalid_assoc = cache_get('association', $request['openid.invalidate_handle']);\n \n if (!$invalid_assoc || ($invalid_assoc['created'] + SIMPLEID_ASSOC_EXPIRES_IN < time())) {\n // Yes, it's invalid\n $response['invalidate_handle'] = $request['openid.invalidate_handle'];\n }\n }\n\n log_info('OpenID direct verification response: ' . log_array($response));\n \n openid_direct_response(openid_direct_message($response, $version));\n}", "public function isVerified();", "protected function Validate() : Bool\n {\n $params = [];\n\n foreach ($this->verifyWhitelist as $k => $v) {\n if( isset($_GET[$v]) ){\n $params[$k] = $_GET[$v];\n }\n }\n\n $params[\"openid.mode\"] = \"check_authentication\"; \n \n if ( !isset($params[\"openid.return_to\"]) || $params[\"openid.return_to\"] != $this->redirectParams[\"openid.return_to\"] ){\n return false;\n } \n\n $client = $this->Client();\n\n $response = $client->request(\"POST\", $this->urlAuthorize, [ \n \"form_params\" => $params, \n \"headers\" => [ \"Accept\" => \"application/json\" ] \n ]);\n\n $response = (string) $response->getBody(); \n\n if( strpos($response, \"is_valid:true\") === false ){\n return false;\n } \n\n return true;\n }", "public function isVerified(): bool;", "function processopenidresponse() {\n\t\t$consumer = new Auth_OpenID_Consumer(new OpenIDStorage(), new SessionWrapper());\n\n\t\t$trust_root = Director::absoluteBaseURL();\n\t\t$return_to_url = $trust_root . $this->Link('ProcessOpenIDResponse');\n\n\t\t// Complete the authentication process using the server's response.\n\t\t$response = $consumer->complete($return_to_url);\n\n\t\tif($response->status == Auth_OpenID_SUCCESS) {\n\t\t\tSession::clear(\"FormInfo.Form_RegistrationWithOpenIDForm.data\");\n\t\t\t$openid = $response->identity_url;\n\n\t\t\tif($response->endpoint->canonicalID) {\n\t\t\t\t$openid = $response->endpoint->canonicalID;\n\t\t\t}\n\n\t\t\t$sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response);\n\t\t\t$sreg = $sreg_resp->contents();\n\n\t\t\t// Convert the simple registration data to the needed format\n\t\t\t// try to split fullname to get firstname and surname\n\t\t\t$data = array('IdentityURL' => $openid);\n\t\t\tif(isset($sreg['nickname']))\n\t\t\t\t$data['Nickname'] = $sreg['nickname'];\n\t\t\tif(isset($sreg['fullname'])) {\n\t\t\t\t$fullname = explode(' ', $sreg['fullname'], 2);\n\t\t\t\tif(count($fullname) == 2) {\n\t\t\t\t\t$data['FirstName'] = $fullname[0];\n\t\t\t\t\t$data['Surname'] = $fullname[1];\n\t\t\t\t} else {\n\t\t\t\t\t$data['Surname'] = $fullname[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($sreg['country']))\n\t\t\t\t$data['Country'] = $sreg['country'];\n\t\t\tif(isset($sreg['email']))\n\t\t\t\t$data['Email'] = $sreg['email'];\n\n\t\t\tSession::set(\"FormInfo.Form_RegistrationForm.data\", $data);\n\t\t\treturn $this->redirect($this->Link('register'));\n\t\t}\n\n\n\t\t// The server returned an error message, handle it!\n\t\tif($response->status == Auth_OpenID_CANCEL) {\n\t\t\t$error_message = _t('ForumMemberProfile.CANCELLEDVERIFICATION','The verification was cancelled. Please try again.');\n\t\t} else if($response->status == Auth_OpenID_FAILURE) {\n\t\t\t$error_message = _t('ForumMemberProfile.AUTHENTICATIONFAILED','The OpenID/i-name authentication failed.');\n\t\t} else {\n\t\t\t$error_message = _t('ForumMemberProfile.UNEXPECTEDERROR','An unexpected error occured. Please try again or register without OpenID');\n\t\t}\n\n\t\t$this->RegistrationWithOpenIDForm()->addErrorMessage(\"Blurb\",\n\t\t\t$error_message, 'bad');\n\n\t\treturn $this->redirect($this->Link('registerwithopenid'));\n\t}", "function isVerified(){\n\n}", "function verify () {\n// $aop->alipayrsaPublicKey='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjUzhXrdJ7GDsgJ59fMLlk7hyYrXkkeGwnYD/eO2HBZh39Y9gTfLJ61Yogc7keOn2uAnZY/zBlw3n+T6mb6/5JYFgvXQi8Qzeh6BkBrNnROu+k4PjhmSbORJFoLrrIxDnsYkQ995kYYhpbS0yf2Al++55v4SrD3/YoVBhWPcRg4xI0QD94FLwhCmcCkft/ILRtUxQk2QeVPLSesvMx2mmUK2L2x2hFA8ewRoGmUdG2Fu9YFIxk//16RI+H7KI8LaoXoVDqHobPae9p0ACE7k9G5vs/cYuikSMKu+lnxghte1jNO+CqrvTP4Pes/mW4e7CEMCTAmEnsXLUrQ6FpfKMcQIDAQAB';\n return $this->aop->rsaCheckV1($_POST, NULL, \"RSA2\");\n }", "function is_verified()\n {\n return false;\n }", "public function verify()\n {\n if (!$this->user->validateOtpByIdentityLoggedIn($this->otp)) {\n $this->addError('otp', Yii::t('app', 'Otp is invalid!'));\n\n return false;\n } else {\n return true;\n }\n }", "function simpleid_verify_signatures($request) {\n global $version;\n \n log_info('simpleid_verify_signatures');\n \n $is_valid = TRUE;\n \n $assoc = (isset($request['openid.assoc_handle'])) ? cache_get('association', $request['openid.assoc_handle']) : NULL;\n $stateless = (isset($request['openid.response_nonce'])) ? cache_get('stateless', $request['openid.response_nonce']) : NULL;\n \n if (!$assoc) {\n log_notice('simpleid_verify_signatures: Association not found.');\n $is_valid = FALSE;\n } elseif (!$assoc['assoc_type']) {\n log_error('simpleid_verify_signatures: Association does not contain valid assoc_type.');\n $is_valid = FALSE;\n } elseif (!isset($assoc['private']) || ($assoc['private'] != 1)) {\n log_warn('simpleid_verify_signatures: Attempting to verify an association with a shared key.');\n $is_valid = FALSE;\n } elseif (!$stateless || ($stateless['assoc_handle'] != $request['openid.assoc_handle'])) {\n log_warn('simpleid_verify_signatures: Attempting to verify a response_nonce more than once, or private association expired.');\n $is_valid = FALSE;\n } else {\n $mac_key = $assoc['mac_key'];\n $assoc_types = openid_association_types();\n $hmac_func = $assoc_types[$assoc['assoc_type']]['hmac_func'];\n \n $signed_keys = explode(',', $request['openid.signed']);\n $signature = openid_sign($request, $signed_keys, $mac_key, $hmac_func, $version);\n log_debug('***** Signature: ' . $signature);\n \n if ($signature != $request['openid.sig']) {\n log_warn('simpleid_verify_signatures: Signature supplied in request does not match the signatured generated.');\n $is_valid = FALSE;\n }\n \n cache_delete('stateless', $request['openid.response_nonce']);\n }\n \n return $is_valid;\n}", "public function verify();", "public function verified()\n {\n return $this->verifyToken === null;\n }", "protected function IsReturned() : bool\n {\n return isset($_GET[\"openid_mode\"]) && !empty($_GET[\"openid_mode\"]); \n }", "public function authIsOk() {\n return $this->userID !== 0;\n }", "function simpleid_checkid_approval_required($request) {\n global $version;\n \n if ($version >= OPENID_VERSION_2) {\n $message = array('openid.mode' => 'setup_needed');\n } else {\n $request['openid.mode'] = 'checkid_setup';\n $message = array(\n 'openid.mode' => 'id_res', \n 'openid.user_setup_url' => simpleid_url('continue', 's=' . rawurlencode(pickle($request)))\n );\n }\n \n $message = array_merge($message, extension_invoke_all('response', FALSE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "private static function verify() {\r\n\t\t// create code object for the given code we will be verifying\r\n\t\tif (!isset($_SESSION['user'])) {\r\n\t\t\tself::alertMessage('danger', 'Unable to find session user data. Try logging out and logging in again.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$userID = $_POST['userID'] = $_SESSION['user']->getUserID();\r\n\t\t$code = new VerificationCode($_POST);\r\n\r\n\t\t// load and validate expected code from database\r\n\t\t$codeInDatabase = VerificationCodesDB::get($userID);\r\n\t\tif (is_null($codeInDatabase)) {\r\n\t\t\tself::alertMessage('danger', 'No active verification code found. Your code may have expired. Click \"Resend Code\" to send a new code to your phone.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// compare given/expected codes\r\n\t\tif ($code->getCode() !== $codeInDatabase->getCode()) {\r\n\t\t\tself::alertMessage('danger', 'The code you entered is incorrect. Please check your code and try again.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// verification successful. mark phone number as verified\r\n\t\t$user = UsersDB::getUser($userID);\r\n\t\t$user->setIsPhoneVerified(true);\r\n\t\tUsersDB::edit($user);\r\n\t\t$_SESSION['user'] = $user;\r\n\r\n\t\t// clean up and show dashboard\r\n\t\tVerificationCodesDB::clear($userID);\r\n\t\tDashboardView::show();\r\n\t}", "public function doVerification() {\n $this->validate ( $this->request, $this->getRules () );\n $user = $this->_user->where ( StringLiterals::EMAIL, $this->decodeParam ( $this->request->user ) )->where ( 'otp', $this->request->otp )->first ();\n if (count ( $user ) > 0) {\n Auth::loginUsingId ( $user->id );\n return true;\n } else {\n return false;\n }\n }", "function verify_person () {\n $bh=new gs_base_handler($this->data,$this->params);\n $f=$bh->validate();\n if (!is_object($f) || !is_a($f,'g_forms')) return $f;\n $d=$f->clean();\n\n $rec=person($this->params['role']);\n if (!$rec) {\n $f->trigger_error('FORM_ERROR','REC_NOTFOUND');\n return $bh->showform($f);\n }\n\n $fname=$this->params['field_name'].'_secret';\n $ga=new GoogleAuthenticator;\n $code=$ga->getCode($rec->$fname);\n\n\n if ($code!=$d['ga_code']) {\n $f->trigger_error('FORM_ERROR','GA_INCORRECT_CODE');\n return $bh->showform($f);\n }\n\n $person=person();\n $fname=$this->params['field_name'].'_verified';\n $person->$fname=TRUE;\n return true;\n }", "public function check()\n {\n if($this->user_provider->retrieveById($this->user_provider->getAuthIdentifier()))\n return true;\n\n return false;\n }", "public function verifyIdToken( $token ) {\n\n\t\t$config = $this->getConfig();\n\t\t$jwk = Security::getOpenIdJWK( $token, $config );\n\t\t$verifiedTokenData = Security::openIdVerifyToken( $token, $jwk );\n\n\t\tif( !$verifiedTokenData ) \n\t\t\treturn false;\n\t\t\n\t\treturn $verifiedTokenData[\"payload\"];\n\t}", "function simpleid_checkid_identity(&$request, $immediate) {\n global $user, $version;\n \n $realm = openid_get_realm($request, $version);\n \n // Check 1: Is the user logged into SimpleID as any user?\n if ($user == NULL) {\n return CHECKID_LOGIN_REQUIRED;\n } else {\n $uid = $user['uid'];\n }\n \n // Check 2: Is the user logged in as the same identity as the identity requested?\n // Choose the identity URL for the user automatically\n if ($request['openid.identity'] == OPENID_IDENTIFIER_SELECT) {\n $test_user = user_load($uid);\n $identity = $test_user['identity'];\n \n log_info('OpenID identifier selection: Selected ' . $uid . ' [' . $identity . ']');\n } else {\n $identity = $request['openid.identity'];\n $test_user = user_load_from_identity($identity);\n }\n if ($test_user == NULL) return CHECKID_IDENTITY_NOT_EXIST;\n if ($test_user['uid'] != $user['uid']) {\n log_notice('Requested user ' . $test_user['uid'] . ' does not match logged in user ' . $user['uid']);\n return CHECKID_IDENTITIES_NOT_MATCHING;\n }\n \n // Pass the assertion to extensions\n $assertion_results = extension_invoke_all('checkid_identity', $request, $identity, $immediate);\n $assertion_results = array_merge(array_diff($assertion_results, array(NULL)));\n \n // Populate the request with the selected identity\n if ($request['openid.identity'] == OPENID_IDENTIFIER_SELECT) {\n $request['openid.claimed_id'] = $identity;\n $request['openid.identity'] = $identity;\n }\n \n // Check 3: Discover the realm and match its return_to\n $user_rp = (isset($user['rp'][$realm])) ? $user['rp'][$realm] : NULL;\n\n if (($version >= OPENID_VERSION_2) && SIMPLEID_VERIFY_RETURN_URL_USING_REALM) {\n $verified = FALSE;\n \n $rp_info = simpleid_get_rp_info($realm);\n $services = discovery_get_service_by_type($rp_info['services'], OPENID_RETURN_TO);\n \n log_info('OpenID 2 discovery: ' . count($services) . ' matching services');\n \n if ($services) {\n $return_to_uris = array();\n \n foreach ($services as $service) {\n $return_to_uris = array_merge($return_to_uris, $service['uri']);\n }\n foreach ($return_to_uris as $return_to) {\n if (openid_url_matches_realm($request['openid.return_to'], $return_to)) {\n log_info('OpenID 2 discovery: verified');\n $verified = TRUE;\n break;\n }\n }\n }\n \n $rp_info['return_to_verified'] = $verified;\n simpleid_set_rp_info($realm, $rp_info);\n \n if (!$verified) {\n if (($user_rp != NULL) && ($user_rp['auto_release'] == 1)) {\n log_notice('OpenID 2 discovery: not verified, but overridden by user preference');\n } else {\n log_notice('OpenID 2 discovery: not verified');\n $assertion_results[] = CHECKID_RETURN_TO_SUSPECT;\n }\n }\n }\n \n // Check 4: For checkid_immediate, the user must already have given\n // permission to log in automatically. \n if (($user_rp != NULL) && ($user_rp['auto_release'] == 1)) {\n log_info('Automatic set for realm ' . $realm);\n $assertion_results[] = CHECKID_OK;\n return min($assertion_results);\n } else {\n $assertion_results[] = CHECKID_APPROVAL_REQUIRED;\n return min($assertion_results);\n }\n}", "public function verify($token):bool;", "public function isAuthenticatedSuccessfully(): bool;", "private function _checkIdent()\n {\n $auth = Zend_Auth::getInstance();\n $auth->setStorage(new Zend_Auth_Storage_Session('hl_connect'));\n \n if ($auth->hasIdentity())\n $this->_agentSchemeNumber = $auth->getStorage()->read()->agentschemeno;\n \n return $auth->hasIdentity();\n }", "public function isVerified()\n\t{\n\t\tif (($record=$this->getActiveRecord())===null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool)$record->correo_verificado;\n\t}", "public function isVerified()\n\t{\n\t\tif($this->test_status_id == Test::VERIFIED)\n\t\t\treturn true;\n\t\telse \n\t\t\treturn false;\n\t}", "function is_verified()\n {\n if( ereg(\"VERIFIED\", $this->paypal_response) )\n {\n return true;\n }\n else\n {\n return false;\n }\n\n }", "public function verify() {\r\n $stmp = $this->_db->prepare(\"SELECT `id`,`email` FROM `anope_db_NickCore` WHERE `display`= ? AND `pass` = ?;\");\r\n $stmp->execute(array($this->_username,$this->_password));\r\n \r\n if ($stmp->rowCount() == \"1\") {\r\n $row = $stmp->fetch(PDO::FETCH_ASSOC);\r\n $this->_id = $row['id'];\r\n $this->_email = $row['email'];\r\n return $this->_id;\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "function checkAuth($doRedirect) {\n\t\tif (isset($_SESSION[\"onidid\"]) && $_SESSION[\"onidid\"] != \"\") return $_SESSION[\"onidid\"];\n\n\t\t// create URL as callback\n\t\t$pageURL = 'http';\n\t\tif (isset($_SERVER[\"HTTP\"]) && $_SERVER[\"HTTP\"] == \"on\") {$pageURL .= \"s\";}\n\t\t$pageURL .= \"://\";\n\t\tif ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"].$_SERVER[\"SCRIPT_NAME\"];\n\t\t} else {\n\t\t\t$pageURL .= $_SERVER[\"SERVER_NAME\"].$_SERVER[\"SCRIPT_NAME\"];\n\t\t}\n\n\t\t// check for ticket\n\t\t$ticket = isset($_REQUEST[\"ticket\"]) ? $_REQUEST[\"ticket\"] : \"\";\n\n\t\t// if ticket then set ONID session, else send to login\n\t\tif ($ticket != \"\") {\n\t\t\t$url = \"https://login.oregonstate.edu/cas/serviceValidate?ticket=\".$ticket.\"&service=\".$pageURL;\n\t\t\t$html = file_get_contents($url);\n\t\t\t$onididPattern = '/\\\\<cas\\\\:user\\\\>([a-zA-Z0-9]+)\\\\<\\\\/cas\\\\:user\\\\>/';\n\t\t\t$firstnamePattern = '/\\\\<cas\\\\:firstname\\\\>([a-zA-Z0-9]+)\\\\<\\\\/cas\\\\:firstname\\\\>/';\n\t\t\t$lastnamePattern = '/\\\\<cas\\\\:lastname\\\\>([a-zA-Z0-9]+)\\\\<\\\\/cas\\\\:lastname\\\\>/';\n\t\t\tpreg_match($onididPattern, $html, $onididMatches);\n\t\t\tpreg_match($firstnamePattern, $html, $firstnameMatches);\n\t\t\tpreg_match($lastnamePattern, $html, $lastnameMatches);\n\t\t\tif ($onididMatches && count($onididMatches) > 0 && $firstnameMatches && count($firstnameMatches) > 0 && $lastnameMatches && count($lastnameMatches) > 0) {\n\t\t\t\t$onidid = $onididMatches[1];\n\t\t\t\t$_SESSION[\"onidid\"] = $onidid;\n\n\t\t\t\t$firstname = $firstnameMatches[1];\n\t\t\t\t$_SESSION['firstname'] = $firstname;\n\n\t\t\t\t$lastname = $lastnameMatches[1];\n\t\t\t\t$_SESSION['lastname'] = $lastname;\n\n\t\t\t\t$_SESSION[\"ticket\"] = $ticket;\n\t\t\t\treturn $onidid;\n\t\t\t}\n\t\t} else if ($doRedirect) {\n\t\t\t$url = \"https://login.oregonstate.edu/cas/login?service=\".$pageURL;\n\t\t\techo \"<script>location.replace('\" . $url . \"');</script>\";\n\t\t}\n\n\t\treturn \"\";\n\t}", "function simpleid_checkid_login_required($request) {\n global $version;\n \n if ($version >= OPENID_VERSION_2) {\n $message = array('openid.mode' => 'setup_needed');\n } else { \n $message = array(\n 'openid.mode' => 'id_res',\n 'openid.user_setup_url' => simpleid_url('login', 'destination=continue&s=' . rawurlencode(pickle($request)))\n );\n }\n \n $message = array_merge($message, extension_invoke_all('response', FALSE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "public function return_verify() {\n\t\treturn true;\n if($_POST['payer_status'] == 'verified')\n {\n // check the payment_status is Completed\n if ($_POST['payment_status'] != 'Completed' && $_POST['payment_status'] != 'Pending')\n {\n return false;\n }\n\n // check that receiver_email is your Primary PayPal email\n if ($_POST['receiver_email'] != $this->payment['paypal_account'])\n {\n return false;\n }\n\n if ($this->order['api_pay_amount'] != $_POST['mc_gross'])\n {\n return false;\n }\n if ($this->payment['paypal_currency'] != $_POST['mc_currency'])\n {\n return false;\n }\n return true;\n }\n else\n {\n // log for manual investigation\n return false;\n }\n }", "function verify_user($conn, $id, $hash){\n\t$sql = \"SELECT id from Session\n\tWHERE id=$id and hash='$hash'\";\n\n\t$result = $conn->query($sql);\n\n\treturn ($result->num_rows > 0);\n}", "public function actionVerify() {\n require(dirname(__FILE__) . DIRECTORY_SEPARATOR.'../vendor/codebird/codebird.php');\n \\Codebird\\Codebird::setConsumerKey(\"FxVQdRHrWKLZY8DG1BNPhmOWi\", \"eamViRP7QbeZlaJpL69OYZi8vlarO83L9R54SFwzcYO55eQG0f\");\n $cb = \\Codebird\\Codebird::getInstance();\n \n session_start();\n if (! isset($_SESSION['oauth_token'])) {\n // get the request token\n $reply = $cb->oauth_requestToken([\n 'oauth_callback' => 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']\n ]);\n\n // store the token\n $cb->setToken($reply->oauth_token, $reply->oauth_token_secret);\n $_SESSION['oauth_token'] = $reply->oauth_token;\n $_SESSION['oauth_token_secret'] = $reply->oauth_token_secret;\n $_SESSION['oauth_verify'] = true;\n\n // redirect to auth website\n $auth_url = $cb->oauth_authorize();\n header('Location: ' . $auth_url);\n die();\n\n } elseif (isset($_GET['oauth_verifier']) && isset($_SESSION['oauth_verify'])) {\n // verify the token\n $cb->setToken($_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);\n unset($_SESSION['oauth_verify']);\n\n // get the access token\n $reply = $cb->oauth_accessToken([\n 'oauth_verifier' => $_GET['oauth_verifier']\n ]);\n\n // store the token (which is different from the request token!)\n $_SESSION['oauth_token'] = $reply->oauth_token;\n $_SESSION['oauth_token_secret'] = $reply->oauth_token_secret;\n\n echo $_SESSION['oauth_token'] .\"<br />\". $_SESSION['oauth_token_secret'];\n exit;\n }\n \n echo $_SESSION['oauth_token'] .\"<br />\". $_SESSION['oauth_token_secret'];\n exit;\n }", "public function hasVerifiedEmail();", "public function verifyApplicationId()\n\t{\n\t\tif ($this->getApplicationId() !== $this->config['application_id']) {\n\t\t\tthrow new AlexaVerificationException('Request verification failed: invalid application ID.');\n\t\t}\n\n\t\treturn true;\n\t}", "function simpleid_checkid_error($request, $immediate = false) {\n global $version;\n \n $message = array();\n if ($immediate) {\n if ($version >= OPENID_VERSION_2) {\n $message['openid.mode'] = 'setup_needed';\n } else {\n $message['openid.mode'] = 'id_res';\n }\n } else {\n $message['openid.mode'] = 'cancel';\n }\n \n $message = array_merge($message, extension_invoke_all('response', FALSE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "public function getVerify(): bool\n {\n }", "public function hasVerificationCode(){\n return $this->_has(3);\n }", "public function hasVerificationCode(){\n return $this->_has(3);\n }", "public function isVerified() {\n\t\treturn $this->oehhstat == 'V';\n\t}", "function user_verify(){\n \n $verify = false;\n \n if( isset($_SESSION['user_id']) ){\n \n if( isset($_SESSION['user_ip']) && $_SERVER['REMOTE_ADDR'] == $_SESSION['user_ip'] ){\n \n if( isset($_SESSION['user_agent']) && $_SERVER['HTTP_USER_AGENT'] == $_SESSION['user_agent'] ){\n \n $verify = true;\n\n }\n \n }\n \n }\n \n return $verify;\n \n }", "public function hasVerifiedPhone();", "function verifyAuth()\n\t{\n\t\tsanitizeRequest($_POST);\n\t\tsanitizeRequest($_GET);\n\t\t\n\t\t$currentUser = UserService::getInstance()->getCurrentUser();\n\t\tif (!$currentUser || !$currentUser->getSessionId()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t$payload = JWT::decode($currentUser->getSessionId(), SERVER_KEY, array('HS256'));\n\t\t\t$sessionId = UserService::getInstance()->getSessionId($currentUser->getId());\n\t\t\tif ($sessionId === $currentUser->getSessionId() &&\n\t\t\t\t\t$currentUser->getId() === $payload->id &&\n\t\t\t\t\t$currentUser->getEmail() === $payload->email) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\tif ($currentUser->isRemember() && $e->getMessage() === 'Expired token') {\n\t\t\t\t$currentUser->extendSession();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "function verifiedUser($num, $pid, $td_user)\n{\n\t$db_obj = Db::getInstance()->ExecuteS('SELECT * FROM '.pSQL(_DB_PREFIX_.'sociallogin').' as c WHERE c.id_customer='.\" '$num'\".'\n\tAND c.provider_id='.\" '$pid'\".' LIMIT 0,1');\n\t$verified = $db_obj['0']['verified'];\n\tif ($verified == 1 || $td_user == 'yes')\n\t\treturn true;\n\treturn false;\n}", "public function verify(){\n\t\t// getting the username and code from url\n\t\t$code=$_GET['c'];\n\t\t$user=$_GET['u'];\n\t\t// load the regmod model\n\t\t$this->load->model('regmod');\n\t\t// calling the function Vemail that check the valodation code with the username\n\t\t$flag=$this->regmod->Vemail($user,$code);\n\t\t// checking the Vemail the respond\n\t\tif($flag)\n\t\t\t{$data['res']= \"You have successfully verified your email. You may login to Hungry.lk with your username and password\";}\n\t\telse\n\t\t\t{$data['res']= \"Opps An error occurred in our system, try again later\";}\n\t\t$this->load->view(\"register_status_view\",$data);\n\t}", "public function verify() {\n // Compare session_id as a binary safe string.\n if (strcmp($this->session_id, '0') !== 0) {\n // Session id cookie is set, build the SQL to validate the session id.\n $sql = \"SELECT A.id FROM Users U INNER JOIN Administrators A ON U.id = A.id WHERE session_id = '$this->session_id'\";\n } else {\n // Session id cookie is not set, build the SQL to check the email and password.\n $sql = \"SELECT A.id FROM Users U INNER JOIN Administrators A ON U.id = A.id WHERE email = '$this->email' AND password = '$this->password'\";\n }\n\n // Query the database.\n $results = parent::queryDatabase($sql);\n\n // There should only be one result to the query. If there are any more,\n // something else has failed, default to to fail status - do not grant\n // user access.\n if ($results->num_rows === 1) {\n return True;\n } else {\n return False;\n }\n }", "public function isVerified(): bool\n {\n return $this->verified;\n }", "public function isSuccessful();", "function verifyUser ($username, $hash) {\r\n //TO-DO\r\n\r\n //if credentials match return true\r\n\r\n //else return false\r\n\r\n //dummy CODE\r\n return true;\r\n}", "function id_matches_db($username, $password)\n{\n global $idStore;\n\n if($idStore->authenticate($username, $password))\n {\n return true;\n }else{\n return false;\n }\n}", "function check_verify($code, $id = ''){\n $verify = new \\Think\\Verify();\n return $verify->check($code, $id);\n}", "public function checkAuth()\n {\n return $this->api->check('GP', session('nxs_gp.username'));\n }", "public function verify()\n {\n $this->setVerifiedFlag()->save();\n\n // :TODO: Fire an event here\n }", "public function verify_device($identity)\n {\n $this->result = $this->verify_authorization($identity);\n\n if (!is_numeric($this->result)) {\n\n if ($this->increase_device_authorization($identity)) {\n\n $this->ion_auth->logout();\n $this->ion_auth_model->set_error('device_confirmation_sent');\n\n return FALSE;\n }\n } else {\n\n if ($this->result != 1) {\n\n $this->ion_auth->logout();\n $this->ion_auth_model->set_error('login_unsuccessful_not_allowed');\n\n return FALSE;\n } else {\n $this->ion_auth_model->set_message('login_successful');\n return TRUE;\n }\n }\n }", "public function authenticate() {\n $id = $this->_id;\n if (!empty($id)) {\n $consumer = new Zend_OpenId_Consumer($this->_storage);\n $consumer->setHttpClient($this->_httpClient);\n /* login() is never returns on success */\n if (!$this->_check_immediate) {\n if (!$consumer->login($id,\n $this->_returnTo,\n $this->_root,\n $this->_extensions,\n $this->_response)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n } else {\n if (!$consumer->check($id,\n $this->_returnTo,\n $this->_root,\n $this->_extensions,\n $this->_response)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n }\n } else {\n $params = (isset($_SERVER['REQUEST_METHOD']) &&\n $_SERVER['REQUEST_METHOD']=='POST') ? $_POST: $_GET;\n $consumer = new Zend_OpenId_Consumer($this->_storage);\n $consumer->setHttpClient($this->_httpClient);\n if ($consumer->verify(\n $params,\n $id,\n $this->_extensions)) {\n return new Zend_Auth_Result(\n Zend_Auth_Result::SUCCESS,\n $id,\n [\"Authentication successful\"]);\n } else {\n return new Zend_Auth_Result(\n Zend_Auth_Result::FAILURE,\n $id,\n [\"Authentication failed\", $consumer->getError()]);\n }\n }\n }", "public function verifyAction()\n\t{\n\t\t$this->view->headTitle(\"Registration Process\");\n\t\t\n\t\t//Retrieve key from url\n\t\t$registrationKey = $this->getRequest()->getParam('key');\n\t\t\n\t\t//Identitfy the user associated with the key\n\t\t$user = new Default_Model_User();\n\t\t\n\t\t//Determine is user already confirm\n\t\tif($user->isUserConfirmed($registrationKey)){\n\t\t$this->view->isConfirmed = 1;\n\t\t$this->view->errors[] = \"User is already confirmed\";\n\t\treturn;\n\t\t}\n\n\t\t$resultRow = $user->getUserByRegkey($registrationKey);\n\t\t\n\t\t//If the user has been located, set the confirmed column.\n\t\tif(count($resultRow)){\n\t\t\t$resultRow->confirmed = 1;\n\t\t\t$resultRow->save();\n\t\t\t\n\t\t\t$this->view->success = 1;\n\t\t\t$this->view->firstName = $resultRow->first_name;\n\t\t\n\t\t} else{\n\t\t\t$this->view->errors[] = \"Unable to locate registration key\";\n\t\t}\n\n\t}", "function verification() {\n\t\t$reffer_code = $_REQUEST['user_reffer_code'];\n\t\t$code = $_REQUEST['user_verification_code'];\n\t\t$mobile = $_REQUEST['user_mobile_no'];\n\t\t//$token = $_POST['token'];\n\t\tif (!empty($code)) {\n\n\t\t\t// Refferal amount\n\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t//-----------------/////\n\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\tif (!empty($records)) {\n\n\t\t\t\t$user_id = $records['0']['user_id'];\n\t\t\t\t$token = $records['0']['user_verified_code'];\n\t\t\t\t$status = $records['0']['user_mobile_verify_status'];\n\t\t\t\t$user_email = $records['0']['user_email'];\n\t\t\t\t$user_self_reffer = $records['0']['user_refferal_code'];\n\t\t\t\t$wallet_amount = $records[0]['wallet_amount'];\n\t\t\t\t$user_profile_pic = $records[0]['user_profile_pic'];\n\t\t\t\tif (!empty($user_profile_pic)) {\n\t\t\t\t\tif (filter_var($user_profile_pic, FILTER_VALIDATE_URL)) {\n\t\t\t\t\t\t$img = $user_profile_pic;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$img = self_img_url . $user_profile_pic;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$img = '';\n\t\t\t\t}\n\t\t\t\tif ($code != $token) {\n\t\t\t\t\t$post = array('status' => 'false', 'message' => 'Invalid Varification code');\n\t\t\t\t\techo $this -> json($post);\n\t\t\t\t} else if ($code == $token) {\n\t\t\t\t\tif ($status == '1') {\n\t\t\t\t\t\t$post = array('status' => 'false', 'message' => 'Already verified');\n\t\t\t\t\t\techo $this -> json($post);\n\t\t\t\t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t\t$data['user_mobile_verify_status'] = 1;\n\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\n\t\t\t\t\t//check reffer code\n\t\t\t\t\t$reffer_records = $this -> conn -> get_table_row_byidvalue('user', 'user_refferal_code', $reffer_code);\n\t\t\t\t\tif (!empty($reffer_records)) {\n\t\t\t\t\t\t$user11_id = $reffer_records['0']['user_id'];\n\n\t\t\t\t\t\t$data12['reffer_user_id'] = $user11_id;\n\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data12);\n\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\t if(!empty($reffer_records)){\n\t\t\t\t\t * \t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t\t $refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t\t $user11_id = $reffer_records['0']['user_id'];\n\t\t\t\t\t $reffer_code_database = $reffer_records['0']['user_refferal_code'];\n\t\t\t\t\t $wallet = $reffer_records['0']['wallet_amount'];\n\t\t\t\t\t $frnd_number = $reffer_records['0']['user_contact_no'];\n\t\t\t\t\t $current_date=date(\"Y-m-d h:i:sa\");\n\t\t\t\t\t $transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t $wt_type=2; // credit in frnd acconnt\n\t\t\t\t\t $refferamount=$refferal_amount; // reffer amount\n\t\t\t\t\t $wt_category=9; // refferal amount recieved in wallet\n\t\t\t\t\t $wt_desc=\"Refferal amount add in your wallet using by \".substr($mobile,4);\n\t\t\t\t\t if($reffer_code == $reffer_code_database){\n\n\t\t\t\t\t $add_reffer_money = $this -> conn -> insertnewrecords('refferal_records','refferal_user_id,refferal_frnd_id,refferal_amount,refferal_date', '\"' . $user_id . '\",\"' . $user11_id . '\",\"' . $refferamount . '\",\"' . $current_date . '\"');\n\n\t\t\t\t\t $add_money = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user11_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $refferamount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $frnd_number . '\"');\n\t\t\t\t\t $data12['reffer_amount_status']=$wallet+$refferal_amount;\n\t\t\t\t\t $update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user11_id, $data12);\n\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t */\n\n\t\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Successfully verified\", \"mobile\" => $_REQUEST['user_mobile_no'], 'user_id' => $user_id, 'user_wallet' => $wallet_amount, 'user_email' => $user_email, 'login_type' => 1, 'user_reffer_code' => $user_self_reffer, 'profile_pic' => $img, 'user_pin_status' => '2');\n\t\t\t\t\techo $this -> json($post);\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$error = array('status' => \"false\", \"message\" => \"User not Exist\");\n\t\t\t\techo $this -> json($error);\n\t\t\t}\n\t\t} else {\n\t\t\t$error = array('status' => \"false\", \"message\" => \"Please Enter a valid verification code\", 'user_mobile_no' => $_POST['user_mobile_no'], 'verification_code' => $_POST['user_verification_code']);\n\t\t\techo $this -> json($error);\n\t\t}\n\t}", "public function hasVerification()\r\n {\r\n // No need for CVN in creating/updating token\r\n return Mage::getModel('ewayrapid/method_notsaved')->hasVerification();\r\n }", "public function verifySession()\n\t{\n\t\t$userData = array(\n\t\t\t'email' \t=> $this->input->post('email'),\n\t\t\t'password' \t=> sha1($this->input->post('password'))\n \t\t);\n\n\t\treturn $this->assistant_model->verifySession($userData);\n\t}", "public function verifyRequest()\n {\n }", "function verify()\n {\n $activation = null;\n $param = getParameter();\n if (!empty($param[0])) {\n $activation = $param[0];\n }\n $resultActive = $this->model->khachhang->activeAccount($activation);\n switch ($resultActive) {\n case 1 :\n redirect('user/active_expire');\n break;\n case 2:\n redirect('user/active_success');\n break;\n case 3:\n redirect('user/active_fail');\n break;\n }\n }", "protected function isCaptureSuccessful()\n {\n return in_array($this->reader->getResponseCode(), self::CAPTURE_APPROVED_STATUS_CODES, true);\n }", "public function verify_code($params) {\n\n $verification_code = $params['verification_code'];\n $code_id = $params['code_id'];\n\n $options = array('body'=> array());\n $options['body']['code']= ['verify'=> $verification_code];\n\n $uri = $code_id.\"/verify\";\n $uri = \"/cpaas/auth/v1/\".$this->client->user_id.\"/codes/\".$uri;\n $url = $this->client->_root.$uri;\n $response = $this->client->_request(\"PUT\", $url, $options);\n\n // check if test response\n if ($this->client->check_if_test($response)) {\n return $response;\n }\n // check if error response\n // if ($this->client->check_if_error($response)) {\n // $response = $this->client->build_error_response($response);\n // return $response;\n // }\n\n if ($response->getStatusCode() == 204) {\n $custom_response = ['verified'=> true, 'message'=> 'Success'];\n } else {\n $custom_response = ['verified'=> false, 'message'=> 'Code invalid or expired'];\n }\n\n return $custom_response;\n }", "public function isSuccessful()\n {\n return isset($this->data['response_code']) \n && \n ( substr($this->data['response_code'], 2) == '000' );\n }", "public function verify()\r\n\t{\r\n\t\treturn ($this->verifyHeaders() && $this->verifyDataFormat() && $this->verifySignature());\r\n\t}", "function auth()\n\t{\n\t\t$_aok_ = $_COOKIE['_aok_'];\n\t\tif (isset($_aok_))\n\t\t{\n\t\t\t$query = mysql_query(\"SELECT sessionId FROM auth WHERE sessionId = '$_aok_'\");\n\t\t\tif (mysql_num_rows($query) > 0)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function logon($params) {\n\t\tglobal $db_prefix, $settings;\n\n\t\t// step 1: redirect to the openid provider of choice\n\n\t\t// do we have a (valid) openid URL?\n\t\tif (isset($params['openid_url']) && isURL($params['openid_url'])) {\n\t\t\t// load the openid class, and redirect to the openid provider\n\t\t\trequire_once(PATH_INCLUDES.\"authentication/class.openid.php\");\n\t\t\t$openid = new SimpleOpenID;\n\t\t\t$openid->SetIdentity($params['openid_url']);\n\t\t\t$openid->SetApprovedURL($settings['siteurl'].\"setuser.php\");\n\t\t\t$openid->SetTrustRoot($settings['siteurl']);\n\t\t\t$server_url = $openid->GetOpenIDServer();\n\t\t\tif ($server_url) {\n\t\t\t\tredirect($openid->GetRedirectURL() , \"script\");\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\t// step 2: validate the openid provider return information\n\n\t\tif (isset($params['openid_mode'])) {\n\t\t\t// handle openid login\n\t\t\trequire_once(PATH_INCLUDES.\"authentication/class.openid.php\");\n\t\t\t$openid = new SimpleOpenID;\n\t\t\t$openid->SetIdentity(urldecode($_GET['openid_identity']));\n\t\t\tif ($openid->ValidateWithServer()) {\n\t\t\t\t$openid_url = strtolower($openid->OpenID_Standarize($_GET['openid_identity']));\n\t\t\t\t$result = dbquery(\"SELECT * FROM \".$db_prefix.\"users WHERE user_openid_url='\".$openid_url.\"'\");\n\t\t\t\tif (dbrows($result) == 0) {\n\t\t\t\t\t// not found, display an error message\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\t// retrieve the record and store it for retrieval\n\t\t\t\t\t$this->userrecord = dbarray($result);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttrigger_error($openid->GetError());\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function verify()\n {\n $this->verified = true;\n\n $this->save();\n\n $this->verifyUser()->delete();\n }", "public function verifyRequest()\n\t{\n\t\t$this->verifyApplicationId();\n\t\t$this->verifyTimestamp();\n\t\t$this->verifySignatureCertificateUrl($this->getSignatureCertificateUrl());\n\n\t\t$certificate = $this->persistence->getCertificateForKey($this->certificate_url);\n\n\t\tif (! $certificate) {\n\t\t\t$certificate = new Certificate($this->certificate_url);\n\t\t}\n\n\t\t$this->verifyCertificate($certificate);\n\t}", "function Check()\n {\n $this->_RegenerateId();\n return (isset($_SESSION['ss_fprint1']) && $_SESSION['ss_fprint1'] == $this->_Fingerprint());\n }", "function doregisterwithopenid($data, $form) {\n\t\t$openid = trim($data['OpenIDURL']);\n\t\tSession::set(\"FormInfo.Form_RegistrationWithOpenIDForm.data\", $data);\n\n \tif(strlen($openid) == 0) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"Please enter your OpenID or your i-name.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\n\t\t$trust_root = Director::absoluteBaseURL();\n\t\t$return_to_url = $trust_root . $this->Link('processopenidresponse');\n\n\t\t$consumer = new Auth_OpenID_Consumer(new OpenIDStorage(), new SessionWrapper());\n\n\n\t\t// No auth request means we can't begin OpenID\n\t\t$auth_request = $consumer->begin($openid);\n\t\tif(!$auth_request) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"That doesn't seem to be a valid OpenID or i-name identifier. \" .\n\t\t\t\t\t\"Please try again.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\t\t$SQL_identity = Convert::raw2sql($auth_request->endpoint->claimed_id);\n\t\tif($member = Member::get()->filter('IdentityURL', $SQL_identity)->first()) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"That OpenID or i-name is already registered. Use another one.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\n\t\t// Add the fields for which we wish to get the profile data\n \t$sreg_request = Auth_OpenID_SRegRequest::build(null,\n \tarray('nickname', 'fullname', 'email', 'country'));\n\n \tif($sreg_request) {\n\t\t\t$auth_request->addExtension($sreg_request);\n \t}\n\n\n\t\tif($auth_request->shouldSendRedirect()) {\n\t\t\t// For OpenID 1, send a redirect.\n\t\t\t$redirect_url = $auth_request->redirectURL($trust_root, $return_to_url);\n\n\t\t\tif(Auth_OpenID::isFailure($redirect_url)) {\n\t\t\t\tdisplayError(\"Could not redirect to server: \" .\n\t\t\t\t\t\t\t\t\t\t $redirect_url->message);\n\t\t\t} else {\n\t\t\t\treturn $this->redirect($redirect_url);\n\t\t\t}\n\n\t\t} else {\n\t\t\t// For OpenID 2, use a javascript form to send a POST request to the\n\t\t\t// server.\n\t\t\t$form_id = 'openid_message';\n\t\t\t$form_html = $auth_request->formMarkup($trust_root, $return_to_url,\tfalse, array('id' => $form_id));\n\n\t\t\tif(Auth_OpenID::isFailure($form_html)) {\n\t\t\t\tdisplayError(\"Could not redirect to server: \" .$form_html->message);\n\t\t\t} else {\n\t\t\t\t$page_contents = array(\n\t\t\t\t\t \"<html><head><title>\",\n\t\t\t\t\t \"OpenID transaction in progress\",\n\t\t\t\t\t \"</title></head>\",\n\t\t\t\t\t \"<body onload='document.getElementById(\\\"\". $form_id .\n\t\t\t\t\t \"\\\").submit()'>\",\n\t\t\t\t\t $form_html,\n\t\t\t\t\t \"<p>Click &quot;Continue&quot; to login. You are only seeing \" .\n\t\t\t\t\t \"this because you appear to have JavaScript disabled.</p>\",\n\t\t\t\t\t \"</body></html>\");\n\n\t\t\t\tprint implode(\"\\n\", $page_contents);\n\t\t\t}\n\t\t}\n\t}", "public function validate()\n {\n // generate Token String\n $idTokenString = $this->getTokenString($this->_key);\n return ($idTokenString == $this->_tokenString);\n }", "public function isSuccessful()\n {\n if (!isset($this->data['error'])) {\n return $this->data['code'] === 'SUCCESS' && $this->data['transactionResponse']['state'] === 'APPROVED';\n }\n return false;\n }", "private function check_auth() {\n if (empty($this->user_id) || empty($this->privatekey)) {\n $this->send_error('AUTH_FAIL');\n exit;\n } elseif ($this->users_model->validate_privatekey($this->user_id, $this->privatekey)) {\n return true;\n }\n }", "protected function _checkAuthentication($version, $params)\n {\n $ret = [];\n if ($version >= 2.0) {\n $ret['ns'] = Zend_OpenId::NS_2_0;\n }\n $ret['openid.mode'] = 'id_res';\n\n if (empty($params['openid_assoc_handle']) ||\n empty($params['openid_signed']) ||\n empty($params['openid_sig']) ||\n !$this->_storage->getAssociation($params['openid_assoc_handle'],\n $macFunc, $secret, $expires)) {\n $ret['is_valid'] = 'false';\n return $ret;\n }\n\n $signed = explode(',', $params['openid_signed']);\n $data = '';\n foreach ($signed as $key) {\n $data .= $key . ':';\n if ($key == 'mode') {\n $data .= \"id_res\\n\";\n } else {\n $data .= $params['openid_' . strtr($key,'.','_')].\"\\n\";\n }\n }\n if ($this->_secureStringCompare(base64_decode($params['openid_sig']),\n Zend_OpenId::hashHmac($macFunc, $data, $secret))) {\n $ret['is_valid'] = 'true';\n } else {\n $ret['is_valid'] = 'false';\n }\n return $ret;\n }", "public function check($credentials, array $options = array()) {\n $conditions = $this->_filters($credentials->data);\n $options += $this->_config;\n\n /*\n try {\n if (!$this->openId->mode) {\n if(isset($_POST[$this->_field])) {\n $this->openId->identity = $_POST[$this->_field];\n\n # The following two lines request email, full name, and a nickname\n # from the provider. Remove them if you don't need that data.\n $this->openId->required = array('contact/email');\n $this->openId->optional = array('namePerson', 'namePerson/friendly');\n header('Location: ' . $this->openId->authUrl());\n }\n } elseif ($this->openId->mode == 'cancel') {\n return false;\n } elseif ($this->openId->validate()) {\n return true;\n //echo 'User ' . ($this->openId->validate() ? $this->openId->identity . ' has ' : 'has not ') . 'logged in.';\n //print_r($this->openId->getAttributes());\n }\n } catch(ErrorException $e) {\n echo $e->getMessage();\n return false;\n }\n */\n\n return false;\n }", "public function accountVerifyConfirmAction()\n {\n // get the view vars\n $errors = $this->view->errors; /* @var Sly_Errors $errors */\n $site = $this->view->site; /* @var BeMaverick_Site $site */\n $validator = $this->view->validator; /* @var BeMaverick_Validator $validator */\n\n // set the input params\n $requiredParams = array(\n 'code',\n );\n\n $input = $this->processInput( $requiredParams, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n // decode the hash and gets its parts, confirm all good and account is valid\n list( $username, $timestamp, $signature ) = explode( '|', base64_decode( urldecode( $input->code ) ) );\n\n $user = $site->getUserByUsername( $username );\n\n $validator->checkValidUser( $user, $errors );\n $validator->checkValidVerifyAccountCode( $site, $username, $timestamp, $signature, $errors );\n\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n $user->setEmailVerified( true );\n $user->save();\n\n // set the cookie\n BeMaverick_Cookie::updateUserCookie( $user );\n\n return $this->renderPage( 'authAccountVerifyConfirm' );\n }", "function verify_appota_user($appota_access_token, $appota_userid, $appota_username) {\n $url = sprintf('https://api.appota.com/game/get_user_info?access_token=%s', $appota_access_token);\n $result = call_curl_get($url, null);\n return ($result[\"error_code\"] == 0 and $result[\"data\"][\"username\"] == $appota_username and $result[\"data\"][\"user_id\"]);\n}", "function verification() {\n\t\t$reffer_code = $_REQUEST['user_reffer_code'];\n\t\t$code = $_REQUEST['user_verification_code'];\n\t\t$mobile = country_code.$_REQUEST['user_mobile_no'];\n\t\t//$token = $_POST['token'];\n\t\tif (!empty($code)) {\n\t\t\t\n\t\t\t\t// Refferal amount\n\t\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t//-----------------/////\n\t\t\t\n\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\tif (!empty($records)) {\n\t\t\t\t\n\t\t\t\t$user_id = $records['0']['user_id'];\n\t\t\t\t$token = $records['0']['user_verified_code'];\n\t\t\t\t$status = $records['0']['user_mobile_verify_status'];\n\t\t\t\t$user_email = $records['0']['user_email'];\n\t\t\t\t$user_self_reffer = $records['0']['user_refferal_code'];\n\t\t\t\t$wallet_amount=$records[0]['wallet_amount'];\n\t\t\t\t$user_profile_pic=$records[0]['user_profile_pic'];\n\t\t\t\tif (!empty($user_profile_pic)) \t{\n\t\t\t\t\tif (filter_var($user_profile_pic, FILTER_VALIDATE_URL)) {\n \t\t\t\t\t$img = $user_profile_pic;\n\t\t\t\t\t} else {\n \t\t\t\t\t$img = self_img_url.$user_profile_pic;\n\t\t\t\t\t}\n\t\t\t\t\t} else \t{\n\t\t\t\t\t$img = '';\t\n\t\t\t\t\t}\n\t\t\t\tif ($code != $token) {\n\t\t\t\t\t$post = array('status' => 'false', 'message' => 'Invalid Varification code');\n\t\t\t\t\techo $this -> json($post);\n\t\t\t\t} else if ($code == $token) {\n\t\t\t\t\tif($status=='1'){\n\t\t\t\t\t$post = array('status' => 'false', 'message' => 'Already verified');\n\t\t\t\t\techo $this -> json($post);\n\t\t\t\t\texit();\n\t\t\t\t}\n\t\t\t\t\t$data['user_mobile_verify_status']=1;\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user_id, $data);\n\t\t\t\t\t\n\t\t\t\t\t//check reffer code\n\t\t\t\t\t$reffer_records = $this -> conn -> get_table_row_byidvalue('user', 'user_refferal_code',$reffer_code);\n\t\t\t\tif(!empty($reffer_records)){\n\t\t\t\t\t\t$user11_id = $reffer_records['0']['user_id'];\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$data12['reffer_user_id']=$user11_id;\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user_id, $data12);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\tif(!empty($reffer_records)){\n\t\t\t\t * \t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t\t\t\t\t\t\t$user11_id = $reffer_records['0']['user_id'];\n\t\t\t\t\t\t\t\t\t\t$reffer_code_database = $reffer_records['0']['user_refferal_code'];\n\t\t\t\t\t\t\t\t\t\t\t$wallet = $reffer_records['0']['wallet_amount'];\n\t\t\t\t\t\t\t\t\t\t\t$frnd_number = $reffer_records['0']['user_contact_no'];\n\t\t\t\t\t\t\t\t\t\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\t\t\t\t\t\t\t\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t\t\t\t$wt_type=2; // credit in frnd acconnt\n\t\t\t\t\t\t\t\t\t\t\t$refferamount=$refferal_amount; // reffer amount\n\t\t\t\t\t\t\t\t\t\t\t$wt_category=9; // refferal amount recieved in wallet\n\t\t\t\t\t\t\t\t\t\t\t$wt_desc=\"Refferal amount add in your wallet using by \".substr($mobile,4);\n\t\t\t\t\t\t\t\t\t\tif($reffer_code == $reffer_code_database){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$add_reffer_money = $this -> conn -> insertnewrecords('refferal_records','refferal_user_id,refferal_frnd_id,refferal_amount,refferal_date', '\"' . $user_id . '\",\"' . $user11_id . '\",\"' . $refferamount . '\",\"' . $current_date . '\"');\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user11_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $refferamount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $frnd_number . '\"');\n\t\t\t\t\t\t\t\t\t\t\t$data12['reffer_amount_status']=$wallet+$refferal_amount;\n\t\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user11_id, $data12);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$post = array(\"status\" => \"true\", \"message\" => \"Successfully verified\", \"mobile\" => $_REQUEST['user_mobile_no'],'user_id'=>$user_id,'user_wallet'=>$wallet_amount,'user_email'=>$user_email,'login_type'=>1,'user_reffer_code'=>$user_self_reffer,'profile_pic'=>$img,'user_pin_status'=>'2');\n\t\t\t\t\techo $this -> json($post);\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$error = array('status' => \"false\", \"message\" => \"User not Exist\");\n\t\t\t\techo $this -> json($error);\n\t\t\t}\n\t\t} else {\n\t\t\t$error = array('status' => \"false\", \"message\" => \"Please Enter a valid verification code\" ,'user_mobile_no' => $_POST['user_mobile_no'],'verification_code'=>$_POST['user_verification_code']);\n\t\techo $this -> json($error);\n\t\t}\n\t}", "public function isSuccessful() {\n\t\t$status = $this->checkReturnHashPayment();\n\t\tif ($status !== true) {\n\t\t\t$this->message = $status;\n\t\t}\n\t\treturn $status === true;\n\t}", "public function verify_phone_number()\n\t{\n\t\t$user_id = Input::get('userId');\n\t\t$verification_code = Input::get('verificationCode');\n\n\t\tif ($this->notifyRepo->smsVerificationCheck($user_id, $verification_code))\n\t\t{\n\t\t\t$this->notifyRepo->smsSaveVerifiedPhoneNumber($user_id);\n\t\t\t$this->notifyRepo->smsDeleteVerifyRecord($user_id);\n\t\t\t$valid = [\n\t\t\t\t'status' => true,\n\t\t\t\t'message' => 'Your phone number has been verified.'\n\t\t\t];\n\t\t\treturn $valid;\n\t\t}\n\n\t\t$valid = [\n\t\t\t'status' => false,\n\t\t\t'message' => 'The code you entered does not match the code we sent you.'\n\t\t];\n\t\treturn $valid;\n\t}", "private function checkSessionId() {\r\n\r\n $hijackTest = FALSE;\r\n \r\n if ($this->hijackBlock) {\r\n $this->SQLStatement_GetSessionInfos->bindParam(':sid', $this->sessionId, PDO::PARAM_STR, $this->sid_len);\r\n $this->SQLStatement_GetSessionInfos->execute();\r\n $val = $this->SQLStatement_GetSessionInfos->fetchAll(PDO::FETCH_ASSOC);\r\n //var_dump($val);\r\n //echo \"<br> UA:\".$this->getUa().\"<br>\";\r\n if ($val[0][\"ua\"] ==$this->getUa()) {\r\n $hijackTest = TRUE;\r\n } else {\r\n $hijackTest = FALSE;\r\n }\r\n } else {\r\n $hijackTest = TRUE;\r\n }\r\n\r\n if ($hijackTest==TRUE) return true;\r\n else return false;\r\n \r\n }", "public function isSuccessful() {}", "protected function _checkId($version, $params, $immediate, $extensions=null,\n Zend_Controller_Response_Abstract $response = null)\n {\n $ret = [];\n\n if ($version >= 2.0) {\n $ret['openid.ns'] = Zend_OpenId::NS_2_0;\n }\n $root = $this->getSiteRoot($params);\n if ($root === false) {\n return false;\n }\n\n if (isset($params['openid_identity']) &&\n !$this->_storage->hasUser($params['openid_identity'])) {\n $ret['openid.mode'] = ($immediate && $version >= 2.0) ? 'setup_needed': 'cancel';\n return $ret;\n }\n\n /* Check if user already logged in into the server */\n if (!isset($params['openid_identity']) ||\n $this->_user->getLoggedInUser() !== $params['openid_identity']) {\n $params2 = [];\n foreach ($params as $key => $val) {\n if (strpos($key, 'openid_ns_') === 0) {\n $key = 'openid.ns.' . substr($key, strlen('openid_ns_'));\n } else if (strpos($key, 'openid_sreg_') === 0) {\n $key = 'openid.sreg.' . substr($key, strlen('openid_sreg_'));\n } else if (strpos($key, 'openid_') === 0) {\n $key = 'openid.' . substr($key, strlen('openid_'));\n }\n $params2[$key] = $val;\n }\n if ($immediate) {\n $params2['openid.mode'] = 'checkid_setup';\n $ret['openid.mode'] = ($version >= 2.0) ? 'setup_needed': 'id_res';\n $ret['openid.user_setup_url'] = $this->_loginUrl\n . (strpos($this->_loginUrl, '?') === false ? '?' : '&')\n . Zend_OpenId::paramsToQuery($params2);\n return $ret;\n } else {\n /* Redirect to Server Login Screen */\n Zend_OpenId::redirect($this->_loginUrl, $params2, $response);\n return true;\n }\n }\n\n if (!Zend_OpenId_Extension::forAll($extensions, 'parseRequest', $params)) {\n $ret['openid.mode'] = ($immediate && $version >= 2.0) ? 'setup_needed': 'cancel';\n return $ret;\n }\n\n /* Check if user trusts to the consumer */\n $trusted = null;\n $sites = $this->_storage->getTrustedSites($params['openid_identity']);\n if (isset($params['openid_return_to'])) {\n $root = $params['openid_return_to'];\n }\n if (isset($sites[$root])) {\n $trusted = $sites[$root];\n } else {\n foreach ($sites as $site => $t) {\n if (strpos($root, $site) === 0) {\n $trusted = $t;\n break;\n }\n\n /* OpenID 2.0 (9.2) check for realm wild-card matching */\n $n = strpos($site, '://*.');\n if ($n != false) {\n $regex = '/^'\n . preg_quote(substr($site, 0, $n+3), '/')\n . '[A-Za-z1-9_\\.]+?'\n . preg_quote(substr($site, $n+4), '/')\n . '/';\n if (preg_match($regex, $root)) {\n $trusted = $t;\n break;\n }\n }\n }\n }\n\n if (is_array($trusted)) {\n if (!Zend_OpenId_Extension::forAll($extensions, 'checkTrustData', $trusted)) {\n $trusted = null;\n }\n }\n\n if ($trusted === false) {\n $ret['openid.mode'] = 'cancel';\n return $ret;\n }\n\n if ($trusted === null) {\n /* Redirect to Server Trust Screen */\n $params2 = [];\n\n foreach ($params as $key => $val) {\n if (strpos($key, 'openid_ns_') === 0) {\n $key = 'openid.ns.' . substr($key, strlen('openid_ns_'));\n } else if (strpos($key, 'openid_sreg_') === 0) {\n $key = 'openid.sreg.' . substr($key, strlen('openid_sreg_'));\n } else if (strpos($key, 'openid_') === 0) {\n $key = 'openid.' . substr($key, strlen('openid_'));\n }\n $params2[$key] = $val;\n }\n if ($immediate) {\n $params2['openid.mode'] = 'checkid_setup';\n $ret['openid.mode'] = ($version >= 2.0) ? 'setup_needed': 'id_res';\n $ret['openid.user_setup_url'] = $this->_trustUrl\n . (strpos($this->_trustUrl, '?') === false ? '?' : '&')\n . Zend_OpenId::paramsToQuery($params2);\n return $ret;\n } else {\n Zend_OpenId::redirect($this->_trustUrl, $params2, $response);\n return true;\n }\n }\n\n return $this->_respond($version, $ret, $params, $extensions);\n }", "private function _checkPk() {\n\t\t$result = false;\n\t\t$private_key = Mage::helper ( 'masterpass' )->checkPrivateKey ();\n\t\tif (! $private_key) {\n\t\t\tMage::getSingleton ( 'core/session' )->addError ( Mage::getStoreConfig ( 'masterpass/config/checkouterrormessage' ) );\n\t\t\t// save long access token\n\t\t\t$customer = Mage::getSingleton ( 'customer/session' )->getCustomer ();\n\t\t\t$customerData = Mage::getModel ( 'customer/customer' )->load ( $customer->getId () );\n\t\t\t$longAccessToken = null;\n\t\t\t$customerData->setData ( 'longtoken', $longAccessToken );\n\t\t\t\n\t\t\t$customerData->save ();\n\t\t\t// $this->_redirect('checkout/cart');\n\t\t\t// $this->getResponse()->setRedirect(Mage::helper('customer')->getLoginUrl());\n\t\t\t$result = true;\n\t\t}\n\t\treturn $result;\n\t}", "public function authorize()\n {\n if (app()->environment() == 'testing') {\n return true;\n }\n \n $signature = $this->header('X-Pingplusplus-Signature');\n return $this->verify_signature(file_get_contents('php://input'), $signature) === 1;\n }", "function isSuccessful() ;", "function verify_success($user_id)\n\t\t{\n\t\t\t$statement = $this->conn_id->prepare(\"update users set is_active = 1 where user_id = :user_id\");\n\t\t\treturn $statement->execute(array(':user_id' => $user_id));\n\t\t}", "public function isVerified()\n {\n return $this->verified;\n }", "public function isVerified()\n {\n return $this->verified;\n }", "public function isVerified()\n {\n return $this->verified;\n }", "public function testVerify()\n {\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+456', 'TEST_SECRET')\n );\n\n // Assert false when the phone is not stored\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+123', 'CLIENT_SECRET')\n );\n\n // Assert true when the phone and secret are properly given\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+123', 'TEST_SECRET')\n );\n }", "function simpleid_process_openid($request) {\n global $version;\n \n $version = openid_get_version($request);\n \n switch ($request['openid.mode']) {\n case 'associate':\n simpleid_associate($request);\n return;\n case 'checkid_immediate':\n case 'checkid_setup':\n return simpleid_checkid($request);\n case 'check_authentication':\n simpleid_check_authentication($request);\n break;\n default:\n if (isset($request['openid.return_to'])) {\n // Indirect communication - send error via indirect communication.\n header_response_code('404 Bad Request');\n set_message('Invalid OpenID message.');\n page_dashboard();\n } else {\n // Direct communication\n openid_direct_error('Invalid OpenID message.');\n }\n }\n}", "public function hasCredential(string $id): bool;", "function verifyAuth(){\n // on the config values. In this case we just check for user 0.\n $query = \"SELECT name FROM users WHERE user_id = 0\";\n try {\n $sth = $this->spdo->prepare($query);\n $sth->execute();\n }\n catch(PDOException $e) {\n endProcess(0,\"Could not get user information because \".pdoError($e));\n }\n if($this->spdo->query(\"SELECT FOUND_ROWS()\")->fetchColumn() != 1)\n return false;\n return true;\n }", "public function checkAuth();", "public function checkAuth();", "public function verifyAction()\n {\n $email = Request::post('email', Filter::FILTER_EMAIL, false);\n\n if (!$email || !Validator_Email::validate($email)) {\n Response::jsonError($this->moduleLang->get('email_invalid'));\n }\n\n $model = Model::factory('User');\n\n $userIds = $model->getList(\n ['limit' => 1],\n [\n 'email' => $email,\n 'enabled'=> true\n ],\n ['id']\n );\n\n if (count($userIds) == 0) {\n Response::jsonError($this->moduleLang->get('email_user_unknown'));\n }\n\n $userId = $userIds[0]['id'];\n\n $user = Db_Object::factory('User', $userId);\n $authCode = Utils::hash(uniqid(time(),true));\n\n $confDate = new DateTime('now');\n $confDate = $confDate->add(new DateInterval('P1D'))->format('Y-m-d H:i:s');\n\n try{\n $user->setValues(array(\n 'confirmation_code' => $authCode,\n 'confirmation_expiried' => $confDate\n ));\n if(!$user->save())\n throw new Exception('Cannot update user info');\n }catch (Exception $e){\n Response::jsonError($this->_lang->get('CANT_EXEC'));\n }\n\n $this->sendEmail($user);\n\n Response::jsonSuccess(array(\n 'msg' => $this->moduleLang->get('pwd_success')\n ));\n }", "public function validate() : bool\n {\n if (!$this->request) {\n throw new Exception(\"Missing request, please use setRequest to specify it.\");\n }\n\n if (!$this->requestIsValid()) {\n return false;\n }\n\n $requestOptions = $this->getDefaultRequestOptions();\n $response = $this->guzzleClient->request('POST', $this->getOpenIdUrl().'/login', $requestOptions);\n\n $this->parseSteamID();\n $this->parseInfo();\n\n return $response->getStatusCode() === 200;\n }" ]
[ "0.73925734", "0.69684803", "0.67869836", "0.6735506", "0.6664794", "0.66517764", "0.6561427", "0.65513575", "0.65010786", "0.6498432", "0.6449355", "0.6417599", "0.6397924", "0.6354561", "0.63356715", "0.63136905", "0.6278225", "0.6266145", "0.62433296", "0.62351215", "0.6223248", "0.6144716", "0.60977703", "0.6093364", "0.60889596", "0.6087161", "0.6081175", "0.6065847", "0.60590553", "0.6057337", "0.60045314", "0.6004257", "0.6002021", "0.6001003", "0.5985093", "0.5926208", "0.5918693", "0.58887047", "0.58813953", "0.58813953", "0.5879052", "0.5875827", "0.58360696", "0.58297414", "0.58260804", "0.5824629", "0.5821678", "0.5801581", "0.5794146", "0.5774373", "0.5750406", "0.57479423", "0.57463336", "0.5745074", "0.57438844", "0.57383555", "0.5731108", "0.5689236", "0.56631726", "0.5659965", "0.56562585", "0.56388223", "0.56360966", "0.5635721", "0.56349033", "0.56332916", "0.5631058", "0.56298393", "0.5622167", "0.562119", "0.5606658", "0.5603727", "0.5597614", "0.55972546", "0.55953205", "0.558848", "0.558684", "0.5586576", "0.5586157", "0.5584472", "0.5583536", "0.5580047", "0.55772114", "0.5574281", "0.5565946", "0.55605704", "0.5558616", "0.55492884", "0.55488634", "0.5547889", "0.5547889", "0.5547889", "0.5543021", "0.5542593", "0.5540154", "0.5539192", "0.5530736", "0.5530736", "0.55305237", "0.55235034" ]
0.76412565
0
Return OpenID response fields
function response() { return $this->args; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function identity_response($params){\n \t\t$params['organization_id'] \t= 'organization_id';\n \t\t$params['first_name'] \t\t= 'first_name';\n \t\t$params['last_name'] \t\t= 'last_name';\n \t\t$params['display_name'] \t= 'display_name';\n \t\t$params['username'] \t\t= 'username';\n \t\t$params['timezone'] \t\t= 'timezone';\n \t\treturn $params;\n \t}", "function openid_resp_to_user( &$resp )\n{\n $tmp_users = array();\n $user = new stdClass;\n $sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($resp);\n $sreg = $sreg_resp->contents();\n\n if (defined('ADD_AX_SUPPORT'))\n {\n $ax_resp = new Auth_OpenID_AX_FetchResponse();\n $ax = $ax_resp->fromSuccessResponse($resp);\n }\n\n // We'll attempt to use the user's nickname to set their username\n if ( (isset($sreg['nickname']) && !empty($sreg['nickname']) &&\n !($tmp_users['username'] = get_records('user', 'username', addslashes($sreg['nickname'])))) ||\n (defined('USE_EMAIL_FOR_USERNAME') && isset($sreg['email']) && !empty($sreg['email'])\n && !($tmp_users['username_email'] = get_records('user', 'username', $sreg['email'])))\n ) {\n $user->username = addslashes((isset($sreg['nickname']) && !empty($sreg['nickname'])) ? $sreg['nickname'] : $sreg['email']);\n } else\n if (defined('ADD_AX_SUPPORT')\n && ((($nickname = get_ax_data(AX_SCHEMA_NICKNAME, $ax))\n && !($tmp_users['username'] = get_records('user', 'username', addslashes($nickname))))\n || (defined('USE_EMAIL_FOR_USERNAME')\n && ($useremail = get_ax_data(AX_SCHEMA_EMAIL, $ax))\n && !($tmp_users['username_email'] = get_records('user', 'username', $useremail)))\n ) )\n { // better to fall-back to email? may show-up in various display blocks\n $user->username = addslashes($nickname ? $nickname : $useremail);\n }\n // Otherwise, we'll use their openid url - last resort!\n else {\n $user->username = openid_normalize_url_as_username($resp->identity_url);\n }\n\n // SREG fullname\n if (isset($sreg['fullname']) && !empty($sreg['fullname'])) {\n $name = openid_parse_full_name($sreg['fullname']);\n $user->firstname = addslashes($name['first']);\n $user->lastname = addslashes($name['last']);\n } else if (defined('ADD_AX_SUPPORT') && (get_ax_data(AX_SCHEMA_FULLNAME, $ax) || get_ax_data(AX_SCHEMA_LASTNAME, $ax)) ) {\n if (get_ax_data(AX_SCHEMA_LASTNAME, $ax)) {\n $user->firstname = addslashes(get_ax_data(AX_SCHEMA_FIRSTNAME, $ax));\n $user->lastname = addslashes(get_ax_data(AX_SCHEMA_LASTNAME, $ax));\n } else { // fullname\n $name = openid_parse_full_name(get_ax_data(AX_SCHEMA_FULLNAME, $ax));\n $user->firstname = addslashes($name['first']);\n $user->lastname = addslashes($name['last']);\n }\n }\n\n if (!empty($user->lastname)) {\n $tmp_users['fullname'] = get_records_select('user', \"firstname = '\".$user->firstname.\"' AND lastname = '\".$user->lastname.\"'\");\n }\n\n // SREG email\n if (!empty($sreg['email']) && !($tmp_users['email'] = get_records('user', 'email', $sreg['email']))) {\n $user->email = addslashes($sreg['email']);\n } else if (defined('ADD_AX_SUPPORT') && ($useremail = get_ax_data(AX_SCHEMA_EMAIL, $ax))\n && !($tmp_users['email'] = get_records('user', 'email', $useremail)) ) {\n $user->email = addslashes($useremail);\n }\n\n // SREG country\n $country = '';\n if (isset($sreg['country']) && !empty($sreg['country'])) {\n $country = $sreg['country'];\n }\n else if (defined('ADD_AX_SUPPORT') && get_ax_data(AX_SCHEMA_COUNTRY, $ax)) {\n $country = get_ax_data(AX_SCHEMA_COUNTRY, $ax);\n }\n\n if (!empty($country)) {\n $country_code = strtoupper($country);\n $countries = get_list_of_countries();\n\n if (strlen($country) != 2 || !isset($countries[$country_code])) {\n $countries_keys = array_keys($countries);\n $countries_vals = array_values($countries);\n $country_code = array_search($country, $countries_vals);\n\n if ($country_code > 0) {\n $country_code = $countries_keys[$country_code];\n } else {\n $country_code = '';\n }\n }\n\n if (!empty($country_code)) {\n $user->country = $country_code;\n }\n }\n\n /* We're currently not attempting to get language and timezone values\n // SREG language\n if (isset($sreg['language']) && !empty($sreg['language'])) {\n }\n\n // SREG timezone\n if (isset($sreg['timezone']) && !empty($sreg['timezone'])) {\n }\n */\n\n $config = get_config('auth/openid');\n //error_log(\"/auth/openid/locallib.php::auth/openid::config=...\");\n //err_dump($config);\n\n //error_log(\"/auth/openid/locallib.php::openid_resp_to_user() - check for user matching ...\");\n //err_dump($user);\n\n // Map OpenID fields to whether field MUST be unique\n // TBD: make unique fields configurable im OpenID: auth_config_users.html\n // Keys must match keys in tmp_users[] array - set above.\n $openid_fields = array('email' => 1, // Email field must be unique\n 'fullname' => 0, // ok duplicate fullnames\n 'username' => 0, // ok dup username w/OpenID\n // creates unique username\n 'username_email' => 1 // TBD: No dup username as OpenID email\n );\n foreach($openid_fields as $openid_field => $field_unique) {\n $match_array = str_word_count($config->auth_openid_match_fields, 1, '_');\n $num = !empty($match_array) // && in_array($openid_field, $match_array)\n ? 1 : 0;\n if ($field_unique && !empty($tmp_users[$openid_field]) &&\n count($tmp_users[$openid_field]) > $num)\n {\n //error_log(\"/auth/openid/locallib.php::openid_resp_to_user() - multiple matches on count(tmp_users[{$openid_field}])=\".count($tmp_users[$openid_field]).\" ...\");\n //err_dump($tmp_users[$openid_field]);\n //error_log(\"> match_array=...\");\n //err_dump($match_array);\n return false;\n }\n }\n $matching_user = null;\n // check tmp_users[] matches for valid existing user,\n // return false if conflicts between matching fields\n if (!empty($config->auth_openid_match_fields)) {\n $openid_match_fields = explode(',', $config->auth_openid_match_fields);\n foreach ($openid_match_fields as $match_field) {\n $match_field = trim($match_field);\n if (!empty($tmp_users[$match_field]) &&\n count($tmp_users[$match_field]) == 1)\n {\n if (!$matching_user) {\n $matching_user = reset($tmp_users[$match_field]);\n } else if ($openid_fields[$match_field] &&\n $matching_user->id != reset($tmp_users[$match_field])->id)\n { // unique field matches different user!\n return false;\n }\n }\n }\n }\n if (!empty($matching_user)) {\n merge_user_fields($matching_user, $user);\n //error_log( \"openid_resp_to_user() - merged matching user: \");\n //err_dump($matching_user);\n return $matching_user;\n }\n return $user;\n}", "function processopenidresponse() {\n\t\t$consumer = new Auth_OpenID_Consumer(new OpenIDStorage(), new SessionWrapper());\n\n\t\t$trust_root = Director::absoluteBaseURL();\n\t\t$return_to_url = $trust_root . $this->Link('ProcessOpenIDResponse');\n\n\t\t// Complete the authentication process using the server's response.\n\t\t$response = $consumer->complete($return_to_url);\n\n\t\tif($response->status == Auth_OpenID_SUCCESS) {\n\t\t\tSession::clear(\"FormInfo.Form_RegistrationWithOpenIDForm.data\");\n\t\t\t$openid = $response->identity_url;\n\n\t\t\tif($response->endpoint->canonicalID) {\n\t\t\t\t$openid = $response->endpoint->canonicalID;\n\t\t\t}\n\n\t\t\t$sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response);\n\t\t\t$sreg = $sreg_resp->contents();\n\n\t\t\t// Convert the simple registration data to the needed format\n\t\t\t// try to split fullname to get firstname and surname\n\t\t\t$data = array('IdentityURL' => $openid);\n\t\t\tif(isset($sreg['nickname']))\n\t\t\t\t$data['Nickname'] = $sreg['nickname'];\n\t\t\tif(isset($sreg['fullname'])) {\n\t\t\t\t$fullname = explode(' ', $sreg['fullname'], 2);\n\t\t\t\tif(count($fullname) == 2) {\n\t\t\t\t\t$data['FirstName'] = $fullname[0];\n\t\t\t\t\t$data['Surname'] = $fullname[1];\n\t\t\t\t} else {\n\t\t\t\t\t$data['Surname'] = $fullname[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($sreg['country']))\n\t\t\t\t$data['Country'] = $sreg['country'];\n\t\t\tif(isset($sreg['email']))\n\t\t\t\t$data['Email'] = $sreg['email'];\n\n\t\t\tSession::set(\"FormInfo.Form_RegistrationForm.data\", $data);\n\t\t\treturn $this->redirect($this->Link('register'));\n\t\t}\n\n\n\t\t// The server returned an error message, handle it!\n\t\tif($response->status == Auth_OpenID_CANCEL) {\n\t\t\t$error_message = _t('ForumMemberProfile.CANCELLEDVERIFICATION','The verification was cancelled. Please try again.');\n\t\t} else if($response->status == Auth_OpenID_FAILURE) {\n\t\t\t$error_message = _t('ForumMemberProfile.AUTHENTICATIONFAILED','The OpenID/i-name authentication failed.');\n\t\t} else {\n\t\t\t$error_message = _t('ForumMemberProfile.UNEXPECTEDERROR','An unexpected error occured. Please try again or register without OpenID');\n\t\t}\n\n\t\t$this->RegistrationWithOpenIDForm()->addErrorMessage(\"Blurb\",\n\t\t\t$error_message, 'bad');\n\n\t\treturn $this->redirect($this->Link('registerwithopenid'));\n\t}", "public function getAuthDataFromResponse(): array;", "public function getOpenId()\n {\n $options['query'] = [\n 'access_token' => $this->getAccessToken()\n ];\n\n try {\n $this->response = $this->client->request('GET', $this->authUrl, $options);\n }catch (\\Exception $e){\n throw $e;\n }\n\n $ret = $this->client->getContent();\n $ret = json_decode($ret,true);\n return $ret;\n }", "protected function getReturnFields()\n {\n return array(\n 'user_id',\n 'name',\n 'username',\n 'pic_url',\n 'oauth_user_id',\n 'secret'\n );\n }", "public function getOpenId()\n {\n }", "public function getIdentityFields();", "public function getIdentifiers() {\n $fields = array('identifiers' => array(\n 'identifierDescriptor' => 'header',\n 'identifier',\n ));\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n return (is_array($result)) ? reset($result) : $result;\n }", "public function getPayerAuthenticationResponse();", "function simpleid_checkid_ok($request) {\n global $version;\n \n $message = array(\n 'openid.mode' => 'id_res',\n 'openid.op_endpoint' => simpleid_url(),\n 'openid.response_nonce' => openid_nonce()\n );\n \n if (isset($request['openid.assoc_handle'])) $message['openid.assoc_handle'] = $request['openid.assoc_handle'];\n if (isset($request['openid.identity'])) $message['openid.identity'] = $request['openid.identity'];\n if (isset($request['openid.return_to'])) $message['openid.return_to'] = $request['openid.return_to'];\n \n if (($version >= OPENID_VERSION_2) && isset($request['openid.claimed_id'])) {\n $message['openid.claimed_id'] = $request['openid.claimed_id'];\n }\n \n $message = array_merge($message, extension_invoke_all('response', TRUE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "public function getOpenid()\n {\n return $this->openid;\n }", "public function getOpenid()\n {\n return $this->openid;\n }", "public function get_fields_for_response($request)\n {\n }", "protected function getFields()\n {\n return array(\n 'user_id',\n 'name',\n 'oauth_user_id',\n 'username',\n 'pic_url',\n 'oauth_provider',\n 'token',\n 'secret'\n );\n }", "public function getAuthenticationResponse() {\n }", "protected function renderAdditionalIdentityFields() {}", "public function authenticate()\n {\n $this->getOpenIDConnectClient()->providerConfigParam($this->openid_parameters);\n $this->getOpenIDConnectClient()->authenticate();\n $infos = (array)$this->getOpenIDConnectClient()->requestUserInfo();\n $infos['token'] = $this->getOpenIDConnectClient()->getAccessToken();\n\n return $infos;\n }", "public function getAdditionalFieldsIdentifiers()\n {\n return $this->postRequest('GetAdditionalFieldsIdentifiers');\n }", "protected function _respond($version, $ret, $params, $extensions=null)\n {\n if (empty($params['openid_assoc_handle']) ||\n !$this->_storage->getAssociation($params['openid_assoc_handle'],\n $macFunc, $secret, $expires)) {\n /* Use dumb mode */\n if (!empty($params['openid_assoc_handle'])) {\n $ret['openid.invalidate_handle'] = $params['openid_assoc_handle'];\n }\n $macFunc = $version >= 2.0 ? 'sha256' : 'sha1';\n $secret = $this->_genSecret($macFunc);\n $handle = uniqid();\n $expiresIn = $this->_sessionTtl;\n $this->_storage->addAssociation($handle,\n $macFunc, $secret, time() + $expiresIn);\n $ret['openid.assoc_handle'] = $handle;\n } else {\n $ret['openid.assoc_handle'] = $params['openid_assoc_handle'];\n }\n if (isset($params['openid_return_to'])) {\n $ret['openid.return_to'] = $params['openid_return_to'];\n }\n if (isset($params['openid_claimed_id'])) {\n $ret['openid.claimed_id'] = $params['openid_claimed_id'];\n }\n if (isset($params['openid_identity'])) {\n $ret['openid.identity'] = $params['openid_identity'];\n }\n\n if ($version >= 2.0) {\n if (!empty($this->_opEndpoint)) {\n $ret['openid.op_endpoint'] = $this->_opEndpoint;\n } else {\n $ret['openid.op_endpoint'] = Zend_OpenId::selfUrl();\n }\n }\n $ret['openid.response_nonce'] = gmdate('Y-m-d\\TH:i:s\\Z') . uniqid();\n $ret['openid.mode'] = 'id_res';\n\n Zend_OpenId_Extension::forAll($extensions, 'prepareResponse', $ret);\n\n $signed = '';\n $data = '';\n foreach ($ret as $key => $val) {\n if (strpos($key, 'openid.') === 0) {\n $key = substr($key, strlen('openid.'));\n if (!empty($signed)) {\n $signed .= ',';\n }\n $signed .= $key;\n $data .= $key . ':' . $val . \"\\n\";\n }\n }\n $signed .= ',signed';\n $data .= 'signed:' . $signed . \"\\n\";\n $ret['openid.signed'] = $signed;\n\n $ret['openid.sig'] = base64_encode(\n Zend_OpenId::hashHmac($macFunc, $data, $secret));\n\n return $ret;\n }", "abstract public function getAuthIdentifiersName(): array;", "function rest_filter_response_fields($response, $server, $request)\n {\n }", "public function getIdentityProperties() {}", "public function getOpenId()\n {\n return $this->open_id;\n }", "public function getAttributes() {\n $toReturn = array();\n $toReturn[\"id\"] = $this->id_;\n $toReturn[\"username\"] = $this->username_;\n $toReturn[\"email\"] = $this->email_;\n $toReturn[\"displayName\"] = $this->displayName_;\n $toReturn[\"firstName\"] = $this->firstName_;\n $toReturn[\"lastName\"] = $this->lastName_;\n $toReturn[\"postalCode\"] = $this->postalCode_;\n if ($this->privileges_ !== null) {\n $toReturn[\"privileges\"] = $this->privileges_;\n } else {\n $toReturn[\"privileges\"] = array();\n }\n \n $toReturn[\"isVerified\"] = $this->isVerified_;\n return $toReturn;\n }", "public function fields() {\n $fields = parent::fields();\n // unset secret fileds from responce from server\n unset($fields['pass'], $fields['token']);\n return $fields;\n }", "public static function getExplicitAuthFieldValues() {}", "function getIdentifierFieldNames();", "public function token_response($params){\n $params['refresh_token'] = 'refresh_token';\n $params['issued_at'] = 'issued_at';\n \t\t$params['signature'] \t = 'signature';\n \t\t$params['scope'] \t\t = 'scope';\n \t\t$params['id_token'] \t = 'id_token';\n \t\t$params['instance_url'] = 'instance_url';\n $params['id'] = 'id';\n \t\t$params['error_description'] = 'error_description';\n \t\treturn $params;\n \t}", "public function getIdentifierField();", "protected function getExplicitAuthFieldValues() {}", "public function get_custom_fields(){\n $items = array();\n $success = $this->new_request( \"GET\", \"$this->account_id/custom_field_identifiers\" );\n if( ! $success ){\n return array();\n }\n $response = json_decode( $this->ironman->get_response_body(), true );\n $fields = isset( $response['custom_field_identifiers'] ) ? $response['custom_field_identifiers'] : array();\n foreach( $fields as $field ){\n $items[$field] = $field;\n }\n return $items;\n }", "private function processOpenidRealm()\n {\n $output = str_replace(\n '{X_XRDS_LOCATION}',\n htmlentities($this->hybridAuth->getCurrentUrl(false), ENT_QUOTES, 'UTF-8').'?get=openid_xrds&v='.\\Hybrid_Auth::$version,\n file_get_contents(dirname(__FILE__).'/resources/openid_realm.html')\n );\n\n return new Response($output);\n }", "public function getRecordInformation() {}", "public function getStringForResponseSignature()\r\n\t{\r\n\t\treturn $this->headers[SONIC_HEADER__TARGET_API]\r\n\t\t\t\t. $this->headers[SONIC_HEADER__DATE]\r\n\t\t\t\t. $this->headers[SONIC_HEADER__PLATFORM_GID]\r\n\t\t\t\t. $this->headers[SONIC_HEADER__SOURCE_GID]\r\n\t\t\t\t. $this->headers[SONIC_HEADER__RANDOM]\r\n\t\t\t\t. $this->body;\r\n\t}", "protected function fetchAttributes()\n {\n $info = (array)$this->makeSignedRequest('https://api.vk.com/method/users.get.json', array(\n 'query' => array(\n 'uids' => $this->uid,\n //'fields' => '', // uid, first_name and last_name is always available\n 'fields' => 'nickname, sex, bdate, city, country, timezone, photo, photo_medium, photo_big, photo_rec',\n ),\n ));\n\n $info = $info['response'][0];\n\n $this->attributes['id'] = $info->uid;\n $this->attributes['name'] = $info->first_name . ' ' . $info->last_name;\n $this->attributes['url'] = 'http://vk.com/id' . $info->uid;\n\n if (!empty($info->nickname)) {\n $this->attributes['username'] = $info->nickname;\n } else {\n $this->attributes['username'] = 'id' . $info->uid;\n }\n\n $this->attributes['gender'] = $info->sex == 1 ? 'F' : 'M';\n\n $this->attributes['city'] = $info->city;\n $this->attributes['country'] = $info->country;\n\n $this->attributes['timezone'] = timezone_name_from_abbr('', $info->timezone * 3600, date('I'));;\n\n $this->attributes['photo'] = $info->photo;\n $this->attributes['photo_medium'] = $info->photo_medium;\n $this->attributes['photo_big'] = $info->photo_big;\n $this->attributes['photo_rec'] = $info->photo_rec;\n }", "public function getAuthInfoArray() {}", "public function &getFields();", "public function authDigestGetUserDetails()\n {\n $subject = $this->getServerVariableValue('PHP_AUTH_DIGEST');\n if (empty($subject)) {\n return false;\n }\n $pattern = '@(nonce|nc|cnonce|qop|username|uri|response)=(?:([\\'\"])([^\\2]+?)\\2|([^\\s,]+))@';\n //int , int\n $matches = array();\n $flags = PREG_SET_ORDER;\n $offset = 0;\n preg_match_all($pattern, $subject, $matches, $flags, $offset);\n\n $result = array();\n foreach ($matches as $match) {\n $result[$match[1]] = $match[3] ? $match[3] : $match[4];\n }\n return count($result) != 7 ? false : $result;\n }", "function parseUserInfo($response){\n\t$userinfo = json_decode($response);\n\tif (is_object($userinfo) && property_exists($userinfo,'id')){\n\t\treturn $userinfo;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "function getData()\n {\n $self = parent::getData();\n switch ($this->enumAuthType) {\n case 'basicauth':\n $string = explode(':', $this->strAuthValue);\n $self['strAuthValue'] = $string[0] . ':' . str_repeat('.', strlen($string[1]));\n break;\n case 'onetime':\n $self['strAuthValue'] = substr($this->strAuthValue, 0, 1) . str_repeat('.', strlen($this->strAuthValue) - 2) . substr($this->strAuthValue, -1);\n break;\n case 'codeonly':\n $string = explode(':', $this->strAuthValue);\n if (preg_match('/([^@]+)@([^@]+)/', $string[0], $matches) > 0) {\n $self['strAuthValue'] = substr($matches[1], 0, 1)\n . str_repeat('.', strlen($matches[1]) - 2)\n . substr($matches[1], -1)\n . '@' \n . substr($matches[2], 0, 2) \n . str_repeat('.', strlen($matches[2]) - 4) \n . substr($matches[2], -2);\n } else {\n $self['strAuthValue'] = str_repeat('.', strlen($string[0]) - 6) . substr($string[0], -6);\n }\n break;\n }\n $self['strCleartext'] = $this->getCleartext();\n $thisUser = Object_User::brokerCurrent();\n if ($this->enumAuthType == 'codeonly' \n && $thisUser != false \n && $this->intUserID == $thisUser->getKey('intUserID')\n ) {\n $string = explode(':', $this->strAuthValue);\n $self['strCleartext'] = $string[1];\n }\n return $self;\n }", "function getPersonDetails($id)\r\n\t{\r\n\t\t//build the api request using the key [global variable] and json format, and postcode \r\n\t\tglobal $They_Vote_Key;\r\n\r\n\t\t$url = \t\"https://theyvoteforyou.org.au/api/v1/people/\".$id.\".json\";\r\n\r\n\t\t$data = array('key'=> $They_Vote_Key);\r\n\t\t$GETurl = sprintf(\"%s?%s\", $url, http_build_query($data));\r\n\t\r\n\t\t//translate fullBio into a usable form\r\n\t\t$fullDetails = json_decode(file_get_contents($GETurl));\r\n\t\t\r\n\t\tif(isset($fullDetails->error))\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $fullDetails;\t\r\n\t}", "protected function getCompleteFieldInformation() {}", "public function getResponseData();", "public function getIdentifierFieldNames()\n {\n }", "function dbase_get_header_info($dbase_identifier): array {}", "public function getUserInfo()\n {\n $request = new Resource('GET', 'https://api.dropbox.com/1/account/info', array(\n 'oauth_consumer_key' => $this->consumer->client_id,\n 'oauth_token' => $this->token->access_token,\n ));\n\n // Sign the request using the consumer and token\n $request->sign($this->signature, $this->consumer, $this->token);\n\n $user = json_decode($request->execute());\n\n // Create a response from the request\n return array(\n 'uid' => $this->token->uid,\n 'name' => $user->display_name,\n 'email' => $user->email,\n 'location' => $user->country,\n );\n }", "public function get_user()\n {\n $token = $this->CI->input->get_request_header('Authorization', TRUE);\n $token_json = base64_decode($token);\n $token = json_decode($token_json);\n $userid = $token->userId;\n $username = $token->userName;\n return ['id'=>$userid,'name'=>$username];\n }", "public function getAuthAsString();", "protected function getTokenFields($code)\n {\n return parent::getTokenFields($code) + ['grant_type' => 'authorization_code'];\n }", "function simpleid_process_openid($request) {\n global $version;\n \n $version = openid_get_version($request);\n \n switch ($request['openid.mode']) {\n case 'associate':\n simpleid_associate($request);\n return;\n case 'checkid_immediate':\n case 'checkid_setup':\n return simpleid_checkid($request);\n case 'check_authentication':\n simpleid_check_authentication($request);\n break;\n default:\n if (isset($request['openid.return_to'])) {\n // Indirect communication - send error via indirect communication.\n header_response_code('404 Bad Request');\n set_message('Invalid OpenID message.');\n page_dashboard();\n } else {\n // Direct communication\n openid_direct_error('Invalid OpenID message.');\n }\n }\n}", "abstract protected function getReponseData() ;", "public function getData()\n {\n return ['grant_type' => 'client_credentials'];\n }", "private function getParams()\n {\n $queryParams = $this->request->getQueryParams();\n\n $params = [\n 'openid.assoc_handle' => array_get($queryParams,self::OPENID_ASSOC_HANDLE),\n 'openid.signed' => array_get($queryParams,self::OPENID_SIGNED),\n 'openid.sig' => array_get($queryParams,self::OPENID_SIG),\n 'openid.ns' => self::OPENID_NS,\n 'openid.mode' => 'check_authentication',\n ];\n\n $signedParams = explode(',', array_get($queryParams,self::OPENID_SIGNED));\n\n foreach ($signedParams as $item) {\n $value = array_get($queryParams,'openid_'.str_replace('.', '_', $item));\n $params['openid.'.$item] = $value;\n }\n\n return $params;\n }", "function decode_get() {\n $token = $this->head('Token');\n $auth = $this->head('Auth');\n $resp = array();\n\n if ($token) {\n $tokendt = JWT::decode($token, $this->config->item('jwt_key'));\n $resp['token'] = $tokendt;\n }\n\n if ($auth) {\n $authdt = JWT::decode($auth, $this->config->item('jwt_key'));\n $resp['auth'] = $authdt;\n }\n\n $this->response($resp, 200); \n }", "public function parseResponse($params)\n {\n \t$params = $this->splitParams($params);\n \n \t$ax = null;\n\n \t// Get the data name space\n \tif (isset($params['openid']['ns']['ax']) && $params['openid']['ns']['ax'] == My_OpenId_Extension_AttributeExchange::NS_URL)\n \t\t$ax = $params['openid']['ax'];\n \telse\n \t{\n \t\t// Loop the extensions looking for the namespace url\n \t\tforeach ($params['openid']['ns'] as $namespace => $uri)\n \t\t{\n \t\t\t// Check if the uri is attribute exchange\n \t\t\tif ($uri == My_OpenId_Extension_AttributeExchange::NS_URL)\n \t\t\t{\n \t\t\t\t$ax = $params['openid'][$namespace];\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n\n \n\n \t// Check if the data was found\n \tif ($ax == null)\n \t\treturn false;\n\n \t// Verify the mode is fetch_response\n \tif (isset($ax['mode']) && $ax['mode'] != 'fetch_response')\n \t\treturn false;\n\n \n\n \t// Get the attributes\n \tforeach ($ax['value'] as $attr => $value)\n \t{\n \t\t$this->_properties[$attr] = $value;\n \t}\n\n return true;\n }", "public function userDetails($response, AccessToken $token) {\n return $response;\n }", "public function getAuthIdentifierName(): string;", "function get_fields() {\n global $Tainacan_Item_Metadata;\n return $Tainacan_Item_Metadata->fetch($this, 'OBJECT');\n\n }", "public function parseResponse($params)\n {\n\n $this->_version= 1.0;\n\n $props = array();\n foreach (self::getAxProperties() as $prop=>$type) {\n if (!empty($params['openid_ext1_type_' . $prop])) {\n $props[$prop] = $params['openid_ext1_value_' . $prop];\n }\n }\n\n if (isset($this->_props) && is_array($this->_props)) {\n foreach (self::getAxProperties() as $prop=>$type) {\n if (isset($this->_props[$prop]) &&\n $this->_props[$prop] &&\n !isset($props[$prop])) {\n return false;\n }\n }\n }\n $this->_props = (count($props) > 0) ? $props : null;\n return true;\n }", "public function consume_identity($params, $response){\n $this->set_identity('email', $response[ $params['email'] ]);\n \t}", "abstract public function getClientInformation();", "function getFields($id){\n\t\t$AccessToken = Auth::token();\n\t\t$baseUrl = url . '/api/v1/' . customerAlias . '/' . databaseAlias;\n\t\t$endpoint = '/formtemplates/';\n\t\t$request = $baseUrl . $endpoint . $id . '/fields';\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(\n\t\t CURLOPT_HTTPGET => true,\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t\t'Authorization: Bearer ' . $AccessToken),\n\t\t CURLOPT_URL => $request,\n\t\t\tCURLOPT_RETURNTRANSFER => 1\n\t\t ));\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $response;\n\t}", "private function processOpenidXRDS()\n {\n header('Content-Type: application/xrds+xml');\n\n $output = str_replace(\n '{RETURN_TO_URL}',\n str_replace(\n array('<', '>', '\"', \"'\", '&'), array('&lt;', '&gt;', '&quot;', '&apos;', '&amp;'),\n $this->hybridAuth->getCurrentUrl(false)\n ),\n file_get_contents(dirname(__FILE__).'/resources/openid_xrds.xml')\n );\n\n return new Response($output);\n }", "function getCompanyid() {\n $payment_id = $this->input->post('id');\n $payment_data = json_decode($this->front_model->getDataCollectionByID('tbl_payment',$payment_id));\n $result = json_encode(array (\n 'company_id' => $payment_data->company_id,\n 'policy_number' => $payment_data->policy_number\n ));\n print_r($result);\n }", "public function getAuthIdentifier();", "public function getFields() {\n\n $fields = array(\"consumer_id\" => array('required'=> true, 'type'=>'hidden', 'disableDecorator' => array('HtmlTag', 'Label', 'DtDdWrapper')),\n \"allergy\" => array('label'=>'Allergy', 'required'=> true),\n \"info\"=>array('label'=>'Info','required'=> false, 'attributes'=>array('rows'=>'4', 'cols'=>'8')));\n \n if( !empty( $this->_id ) ) {\n \n $fields['id'] = array('default'=>$this->_id, 'type'=>'hidden', 'required'=> true,\n 'disableDecorator' => array('HtmlTag', 'Label', 'DtDdWrapper')); \n }\n \n return $fields;\n }", "public function getTokenInfo() {\n\t\t\t$error = [\"error\" => \"invalid_token\"];\n\t\t\tif( !isset($_GET[\"access_token\"]) ) return $error;\n\t\t\t$token = $this->getAccessToken($_GET[\"access_token\"]);\n\t\t\tif( $token === NULL ) return $error;\n\t\t\t$client = $this->getClient($token[\"client_id\"]);\n\t\t\tif( $client === FALSE ) return $error;\n\t\t\treturn [\n\t\t\t\t\"audience\"\t=> $client[\"client_id\"],\n\t\t\t\t\"userid\"\t=> $client[\"user_id\"],\n\t\t\t\t\"scope\"\t\t=> $token[\"scope\"],\n\t\t\t\t\"expires\"\t=> $token[\"expires\"] - time()\n\t\t\t\t\n\t\t\t];\n\t\t}", "function getUserInfo() {\n\t$page = $this -> get('http://vk.com/al_profile.php') -> body;\n\n\t$pattern = '/\"user_id\":([0-9]*),\"loc\":([\"a-z0-9_-]*),\"back\":\"([\\W ]*|[\\w ]*)\",.*,\"post_hash\":\"([a-z0-9]*)\",.*,\"info_hash\":\"([a-z0-9]*)\"/';\n\tpreg_match($pattern, $page, $matches);\n\tarray_shift($matches);\n\t\n\t$this -> user['id'] = $matches[0];\n\t$this -> user['alias'] = $matches[1];\n\t$this -> user['name'] = $matches[2];\n\t$this -> user['post_hash'] = $matches[3];\n\t$this -> user['info_hash'] = $matches[4];\n\n\treturn $this -> user;\n\t}", "public function fields();", "public function fields();", "public function fields();", "public function fields();", "public function fields();", "public function fields()\n\t{\n\t\treturn [\n\t\t\t'organization_id'=>\t[\n\t\t\t\t\t\t\t\t\t'type' \t\t\t=> Type::string(),\n\t\t\t\t\t\t\t\t\t'description' \t=> 'The id of the user'\n\t\t\t\t\t\t\t\t],\n\t\t\t'scopes'\t\t=> \t[\n\t\t\t\t\t\t\t\t\t'type' \t\t\t=> Type::listOf(Type::string()),\n\t\t\t\t\t\t\t\t\t'description' \t=> 'The name of the user'\n\t\t\t\t\t\t\t\t],\n\t\t\t'id'\t\t\t=> \t[\n\t\t\t\t\t\t\t\t\t'type' \t\t\t=> Type::string(),\n\t\t\t\t\t\t\t\t\t'description' \t=> 'The active authorization start time'\n\t\t\t\t\t\t\t\t],\n\t\t];\n\t}", "public function getResponseAttributes()\n {\n return $this->_responseAttributes;\n }", "public function getUserInfo() {}", "public function getProfileInfo()\n\t{\n\t\t$data = $this->get($this->_objectType . $this->_objectId);\n\t\treturn $data;\n\t\t$fields = array();\n\t\tforeach ($data as $fieldName => $fieldValue)\n\t\t{\n\t\t\t$fields[$fieldName] = $fieldValue;\n\t\t}\n\t\t$this->_fields = $fields;\n\t\treturn $this->_fields;\n\t}", "public function retrieveOpenIdConfiguration()\n {\n return $this->startAnonymous()->uri(\"/.well-known/openid-configuration\")\n ->get()\n ->go();\n }", "function getUserInformation(){\n\t\tinclude ($_SERVER['DOCUMENT_ROOT'] . '_inc/controller/fb/getUserInformation.fb.inc.php');\n return $this->resObject;\n\t}", "public function getUserIDByOpenID($openid_identifier);", "public function getAuth()\n {\n $this->getRequestHeaders([\n 'X-User-Id', 'X-Auth-Token'\n ]);\n }", "function id() {\n\n if (!isset($_SERVER['HTTP_TRONGATETOKEN'])) {\n http_response_code(422);\n echo 'no token'; die();\n } else {\n $token = $_SERVER['HTTP_TRONGATETOKEN'];\n $result = $this->model->get_one_where('token', $token, 'trongate_tokens');\n\n if ($result == false) {\n http_response_code(401);\n echo 'false';\n die();\n } else {\n http_response_code(200);\n echo $result->user_id;\n die();\n }\n\n }\n\n }", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "public function getHeader();", "public function getHeader();", "public function getHeader();", "public function getInnerResponse();", "public function getInfo_Raw()\n {\n $raw = $this->provider->makeQuery('SELECT '.implode(',', self::_getUserFacebookFieldsMap()).' FROM user WHERE uid = me()');\n lmb_assert_true(count($raw));\n return $raw[0];\n }", "protected function _getFields()\n {\n return array(\n 'xf_handler' => array(\n 'handler_id' => array('type' => self::TYPE_UINT, 'autoIncrement' => true), \n 'content_type' => array('type' => self::TYPE_STRING, 'maxLength' => 255, 'required' => true), \n 'handler_type_id' => array('type' => self::TYPE_STRING, 'required' => true), \n 'object_class_id' => array('type' => self::TYPE_UINT, 'required' => true), \n 'extra_data_cache' => array('type' => self::TYPE_SERIALIZED, 'default' => ''), \n ), \n );\n }", "protected function getCodeFields($state)\n {\n return [\n 'client_id' => $this->clientId,\n 'redirect_uri' => parent::getRedirectUri(),\n 'response_type' => 'code',\n 'state' => $state,\n 'provider' => 'yahoo'\n ];\n }", "public function fieldValues()\n {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"https://crm.zoho.com/crm/private/xml/Leads/getSearchRecordsByPDC?authtoken=\". config('app.ZOHO_KEY') .\"&scope=crmapi\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, '50');\n\n $content = curl_exec($ch);\n return $content;\n curl_close($ch);\n }", "public function oAuthSuccess($client) {\n $userAttributes = $client->getUserAttributes();\n\n // do some thing with user data. for example with $userAttributes['email']\n}", "public function fetch_fields() {}", "abstract public function getUserInfo();", "public function getIdentifiersISSN() {\n $fields = array('identifiersISSN' => array(\n 'identifier',\n ));\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n return $result;\n }", "public function getContactDataFields();" ]
[ "0.64128536", "0.60819304", "0.60235065", "0.60016", "0.59965914", "0.59821975", "0.59128153", "0.5883651", "0.58014685", "0.57673734", "0.5658231", "0.5637676", "0.5637676", "0.5590765", "0.55459577", "0.54850215", "0.54598284", "0.54461396", "0.5426458", "0.5406883", "0.53854716", "0.5348257", "0.53312534", "0.5315095", "0.52869207", "0.52599305", "0.5239585", "0.52166355", "0.520544", "0.52041954", "0.51954615", "0.51875633", "0.51500654", "0.51451284", "0.51167464", "0.5069708", "0.50516135", "0.50497353", "0.5047502", "0.50413233", "0.50375557", "0.5032481", "0.5019061", "0.50176513", "0.5017276", "0.50087625", "0.5002009", "0.49934888", "0.4993208", "0.49807727", "0.49759573", "0.49727046", "0.49638188", "0.49625045", "0.49596697", "0.49571422", "0.4944769", "0.49431676", "0.49424982", "0.49396732", "0.4926611", "0.49255306", "0.49171594", "0.49079645", "0.49063888", "0.49063572", "0.49028802", "0.4898436", "0.48969308", "0.48959824", "0.48959824", "0.48959824", "0.48959824", "0.48959824", "0.48916182", "0.48868054", "0.48836732", "0.48748955", "0.4874774", "0.4871959", "0.48643687", "0.48573378", "0.48510718", "0.48501787", "0.48501787", "0.48501787", "0.48501787", "0.48501787", "0.48468184", "0.48468184", "0.48468184", "0.48435766", "0.48426855", "0.48425135", "0.48422047", "0.4840896", "0.48405367", "0.48405054", "0.48333922", "0.48248205", "0.48194963" ]
0.0
-1
Return TRUE if OpenID request parameter exists
function exists($key) { return isset($this->args[$key]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function IsReturned() : bool\n {\n return isset($_GET[\"openid_mode\"]) && !empty($_GET[\"openid_mode\"]); \n }", "function exist_param($fieldname){\n return array_key_exists($fieldname, $_REQUEST);\n }", "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 }", "public function hasKeyIDParameter(): bool\n {\n return $this->has(Parameter\\JWKParameter::P_KID);\n }", "function simpleid_checkid_ok($request) {\n global $version;\n \n $message = array(\n 'openid.mode' => 'id_res',\n 'openid.op_endpoint' => simpleid_url(),\n 'openid.response_nonce' => openid_nonce()\n );\n \n if (isset($request['openid.assoc_handle'])) $message['openid.assoc_handle'] = $request['openid.assoc_handle'];\n if (isset($request['openid.identity'])) $message['openid.identity'] = $request['openid.identity'];\n if (isset($request['openid.return_to'])) $message['openid.return_to'] = $request['openid.return_to'];\n \n if (($version >= OPENID_VERSION_2) && isset($request['openid.claimed_id'])) {\n $message['openid.claimed_id'] = $request['openid.claimed_id'];\n }\n \n $message = array_merge($message, extension_invoke_all('response', TRUE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "public function hasRequestParameter($name)\n {\n return $this->request_parameter_holder->has($name);\n }", "private function _requestHasParam(string $key, array $request)\n {\n return array_key_exists($key, $request);\n }", "function hasParam($name)\n {\n return isset($_REQUEST[$name]);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "public function hasParam(){\n return $this->_has(2);\n }", "function verified($proxy=NULL) {\n\t\tpreg_match_all('/(?<=^|&)openid\\.([^=]+)=([^&]+)/',\n\t\t\t$_SERVER['QUERY_STRING'],$matches,PREG_SET_ORDER);\n\t\tforeach ($matches as $match)\n\t\t\t$this->args[$match[1]]=urldecode($match[2]);\n\t\tif (isset($this->args['mode']) &&\n\t\t\t$this->args['mode']!='error' &&\n\t\t\t$this->url=$this->discover($proxy)) {\n\t\t\t$this->args['mode']='check_authentication';\n\t\t\t$var=[];\n\t\t\tforeach ($this->args as $key=>$val)\n\t\t\t\t$var['openid.'.$key]=$val;\n\t\t\t$req=\\Web::instance()->request(\n\t\t\t\t$this->url,\n\t\t\t\t[\n\t\t\t\t\t'method'=>'POST',\n\t\t\t\t\t'content'=>http_build_query($var),\n\t\t\t\t\t'proxy'=>$proxy\n\t\t\t\t]\n\t\t\t);\n\t\t\treturn (bool)preg_match('/is_valid:true/i',$req['body']);\n\t\t}\n\t\treturn FALSE;\n\t}", "public function isIdentifierValid()\n {\n return (request('identifier') == $this->identifier) ? true : false;\n }", "public function hasX509URLParameter(): bool\n {\n return $this->has(Parameter\\JWKParameter::P_X5U);\n }", "private function verify_parameters(){\n if( empty( $_GET['email'] ) || empty( $_GET['pms_key'] ) || empty( $_GET['subscription_id'] ) )\n return false;\n\n return true;\n }", "function simpleid_checkid_login_required($request) {\n global $version;\n \n if ($version >= OPENID_VERSION_2) {\n $message = array('openid.mode' => 'setup_needed');\n } else { \n $message = array(\n 'openid.mode' => 'id_res',\n 'openid.user_setup_url' => simpleid_url('login', 'destination=continue&s=' . rawurlencode(pickle($request)))\n );\n }\n \n $message = array_merge($message, extension_invoke_all('response', FALSE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "public function paramExists (string $key)\n {\n if (array_key_exists($key, $this->getParams()))\n return true;\n\n return false;\n }", "public function hasAuthreqflag()\n {\n return $this->get(self::AUTHREQFLAG) !== null;\n }", "function verifyEntityParam($entityParam) {\n global $authorizedEntities;\n\n return array_key_exists($entityParam, $authorizedEntities);\n}", "public function existsRequestToken()\n {\n // load token\n $store = $this->getStore();\n $type = $store->loadToken($this);\n\n // get consumer\n $this->_consumer = call_user_func($this->_get_consumer_handler, $store->getConsumerKey());\n\n // return result\n if ($type=='request') {\n return true;\n }\n return false;\n }", "public function supportsOID(string $oid): bool;", "private function is($param) {\n if ($param != 'Bearer e4d3') {\n return true;\n } else {\n return false;\n }\n }", "public function hasParam($name);", "function simpleid_checkid_approval_required($request) {\n global $version;\n \n if ($version >= OPENID_VERSION_2) {\n $message = array('openid.mode' => 'setup_needed');\n } else {\n $request['openid.mode'] = 'checkid_setup';\n $message = array(\n 'openid.mode' => 'id_res', \n 'openid.user_setup_url' => simpleid_url('continue', 's=' . rawurlencode(pickle($request)))\n );\n }\n \n $message = array_merge($message, extension_invoke_all('response', FALSE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "public function __isset($param)\r\n {\r\n // Get all of our request params\r\n $params = $this->params();\r\n\r\n return isset($params[$param]);\r\n }", "public function hasParamValue(string $name): bool;", "public function has_param($key)\n {\n }", "function get_exists($parameter){\n return key_exists($parameter, $_GET) && strlen(trim($_GET[$parameter])) > 0;\n}", "private function hasParams($request)\n {\n preg_match_all($this->regex, $this->uri, $uri_);\n\n if (count($uri_[0]) !== 0) {\n return $this->setParams($request);\n }\n return false;\n }", "public function hasRequest(): bool;", "public function hasRequest(): bool;", "public function __isset($name)\n {\n return array_key_exists($name, $this->userParams);\n }", "function simpleid_check_authentication($request) {\n global $version;\n \n log_info('OpenID direct verification: ' . log_array($request));\n \n $is_valid = simpleid_verify_signatures($request);\n\n if ($is_valid) {\n $response = array('is_valid' => 'true');\n } else {\n $response = array('is_valid' => 'false');\n }\n \n // RP wants to check whether a handle is invalid\n if (isset($request['openid.invalidate_handle'])) {\n $invalid_assoc = cache_get('association', $request['openid.invalidate_handle']);\n \n if (!$invalid_assoc || ($invalid_assoc['created'] + SIMPLEID_ASSOC_EXPIRES_IN < time())) {\n // Yes, it's invalid\n $response['invalidate_handle'] = $request['openid.invalidate_handle'];\n }\n }\n\n log_info('OpenID direct verification response: ' . log_array($response));\n \n openid_direct_response(openid_direct_message($response, $version));\n}", "public function parameterExists($key);", "public function parameterExist($parameterName) {\n $result = array_key_exists($parameterName, $this->params);\n return $result;\n }", "public function is_application_id_in_config() {\n\t\treturn defined( 'ALGOLIA_APPLICATION_ID' );\n\t}", "public function hasCredential(string $id): bool;", "function isvalid_ID( $id = null, $request_param = null ) {\n\n\t\t\tif ( ! is_null( $request_param ) && ! empty( $_REQUEST[ $request_param ] ) ) {\n\t\t\t\t$id = (int) $_REQUEST[ $request_param ];\n\t\t\t}\n\n\t\t\tif ( is_null( $id ) ) {\n\t\t\t\t$id = $this->id;\n\t\t\t}\n\n\t\t\t$id = (int) $id;\n\n\t\t\treturn ( $id > 0 );\n\t\t}", "public function hasParam($name)\n {\n return isset($this->params[$name]);\n }", "function IsMe ()\n{\n if ($_GET['id'] === null or $_GET['id'] == $_SESSION['id']) return true;\n else return false;\n}", "public function hasSwitchParam(): bool\n {\n return $this->request && $this->request->query->has($this->switchParam);\n }", "function simpleid_process_openid($request) {\n global $version;\n \n $version = openid_get_version($request);\n \n switch ($request['openid.mode']) {\n case 'associate':\n simpleid_associate($request);\n return;\n case 'checkid_immediate':\n case 'checkid_setup':\n return simpleid_checkid($request);\n case 'check_authentication':\n simpleid_check_authentication($request);\n break;\n default:\n if (isset($request['openid.return_to'])) {\n // Indirect communication - send error via indirect communication.\n header_response_code('404 Bad Request');\n set_message('Invalid OpenID message.');\n page_dashboard();\n } else {\n // Direct communication\n openid_direct_error('Invalid OpenID message.');\n }\n }\n}", "public function IsAccessParams ()\n {\n if (($this->token_type != null) && ($this->access_token != null)) {\n return TRUE;\n }\n return FALSE;\n }", "public function hasParam($name)\n {\n return (isset($this->params[$name]));\n }", "public function __isset($name)\n {\n return array_key_exists($name, $this->params);\n }", "public function hasParameter($name);", "public function hasParameter($name);", "function is_valid_tagid($tagid){\n $data = array(\"tag_id\"=>$tagid);\n $status = CallAPI(\"ussd.myfarmnow.com/api/verifytagid\", $data);\n if($status == 1){\n return true;\n }elseif($status == 0){\n return false;\n }else{\n return \" invalid tag number\";\n }\n}", "public function has($key): bool\n {\n return array_key_exists($key, $this->params);\n }", "public function hasPublicKeyUseParameter(): bool\n {\n return $this->has(Parameter\\JWKParameter::P_USE);\n }", "public static function Has($key)\n {\n return array_key_exists($key, $_REQUEST);\n }", "function nvp_CheckGet($params) {\r\n $result=true;\r\n if (!empty ($params)) {\r\n foreach ($params as $eachparam) {\r\n if (isset($_GET[$eachparam])) {\r\n if (empty ($_GET[$eachparam])) {\r\n $result=false; \r\n }\r\n } else {\r\n $result=false;\r\n }\r\n }\r\n }\r\n return ($result);\r\n }", "public function isOpenParameter()\n\t{\n\t\treturn $this->_value == '...';\n\t}", "public function __isset( $param ) {\n\t\treturn isset( $_REQUEST[ $param ] );\n\t}", "function valid()\n {\n if (isset($this->aid))\n return true;\n else\n return false;\n }", "public function hasRequest(string $name): bool {}", "public function hasId() : bool;", "function hasParam($name) {\n\t\tif (isset($this->getvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\tif (isset($this->postvars[$name])) {\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "public function hasParameter($param)\n {\n return array_key_exists($param, $this->params);\n }", "public function has_url_get_parameters() {\r\n\t\treturn (strlen($this->url_get_parameters) > 3);\r\n\t}", "private function _checkIdent()\n {\n $auth = Zend_Auth::getInstance();\n $auth->setStorage(new Zend_Auth_Storage_Session('hl_connect'));\n \n if ($auth->hasIdentity())\n $this->_agentSchemeNumber = $auth->getStorage()->read()->agentschemeno;\n \n return $auth->hasIdentity();\n }", "public function hasParameters(){\n return $this->_has(2);\n }", "public function hasId()\n {\n $id = $this->getId();\n\n if (is_array($id)) {\n foreach ($id as $k => $v) {\n if (\"\" == \"$v\") {\n return false;\n }\n }\n }\n else if (\"\" == \"$id\") {\n return false;\n }\n\n return true;\n }", "public function needsIdToken($request_scope)\n {\n // see if the \"openid\" scope exists in the requested scope\n return $this->scopeUtil->checkScope('openid', $request_scope);\n }", "public function hasSignupId(){\n return $this->_has(4);\n }", "private function _isOAuthCall()\n {\n $auth_header = $this->request()->header(\"Authorization\");\n\n if ($auth_header && (strpos($auth_header, \"OAuth\") !== false)) {\n return true;\n }\n\n $oauth_signature = $this->request()->param(\"oauth_signature\");\n $oauth_signature_method = $this->request()->param(\"oauth_signature_method\");\n if ($oauth_signature && $oauth_signature_method) {\n return true;\n }\n\n return false;\n }", "public function has($identifier);", "public function hasParameter(string $id): bool\n {\n return isset($this->getParameters()[$id]);\n }", "function fieldIsSet($field) {\n\treturn array_key_exists($field,$_GET) && $_GET[$field]; \n}", "function is_lti_request() {\n $good_message_type = $_REQUEST[\"lti_message_type\"] == \"basic-lti-launch-request\";\n $good_lti_version = $_REQUEST[\"lti_version\"] == \"LTI-1p0\";\n $resource_link_id = $_REQUEST[\"resource_link_id\"];\n if ($good_message_type and $good_lti_version and isset($resource_link_id) ) return(true);\n return false;\n}", "public function handle($params=null, $extensions=null,\n Zend_Controller_Response_Abstract $response = null)\n {\n if ($params === null) {\n if ($_SERVER[\"REQUEST_METHOD\"] == \"GET\") {\n $params = $_GET;\n } else if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n $params = $_POST;\n } else {\n return false;\n }\n }\n $version = 1.1;\n if (isset($params['openid_ns']) &&\n $params['openid_ns'] == Zend_OpenId::NS_2_0) {\n $version = 2.0;\n }\n if (isset($params['openid_mode'])) {\n if ($params['openid_mode'] == 'associate') {\n $response = $this->_associate($version, $params);\n $ret = '';\n foreach ($response as $key => $val) {\n $ret .= $key . ':' . $val . \"\\n\";\n }\n return $ret;\n } else if ($params['openid_mode'] == 'checkid_immediate') {\n $ret = $this->_checkId($version, $params, 1, $extensions, $response);\n if (is_bool($ret)) return $ret;\n if (!empty($params['openid_return_to'])) {\n Zend_OpenId::redirect($params['openid_return_to'], $ret, $response);\n }\n return true;\n } else if ($params['openid_mode'] == 'checkid_setup') {\n $ret = $this->_checkId($version, $params, 0, $extensions, $response);\n if (is_bool($ret)) return $ret;\n if (!empty($params['openid_return_to'])) {\n Zend_OpenId::redirect($params['openid_return_to'], $ret, $response);\n }\n return true;\n } else if ($params['openid_mode'] == 'check_authentication') {\n $response = $this->_checkAuthentication($version, $params);\n $ret = '';\n foreach ($response as $key => $val) {\n $ret .= $key . ':' . $val . \"\\n\";\n }\n return $ret;\n }\n }\n return false;\n }", "public function hasServerParam(string $key)\n\t{\n\t\treturn isset($this->getServerParams()[$key]) ? true : false;\n\t}", "public function key_exists($key) {\n return in_array($key, array_keys($this->params));\n }", "public function has($name)\n {\n return array_key_exists($name, $this->params);\n }", "public function is_api_key_in_config() {\n\t\treturn defined( 'ALGOLIA_API_KEY' );\n\t}", "public static function exists(&$object, $key) {\n\t\t\t$qarray = \\uri\\generate::query_array($object);\n\t\t\treturn isset($qarray[$key]);\n\t\t}", "public function supports(Request $request)\n {\n return 'app_user_idvault' === $request->attributes->get('_route')\n && $request->isMethod('GET') && $request->query->get('code');\n }", "public function hasPrequest(){\n return $this->_has(5);\n }", "public function hasParameter($name)\n {\n return array_key_exists($name, $this->parameters);\n }", "public function prepareRequest(&$params)\n {\n $tproperties = self::getAxProperties();\n \n if (is_array($this->_props) && count($this->_props) > 0) {\n foreach ($this->_props as $prop => $req) {\n if ($req) {\n \n if (isset($required)) {\n $required .= ','.$prop;\n } else {\n $required = $prop;\n }\n } else {\n if (isset($optional)) {\n $optional .= ','.$prop;\n } else {\n $optional = $prop;\n }\n }\n if (array_key_exists($prop,$tproperties))\n $params['openid.ax.type.'.$prop] = $tproperties[$prop];\n }\n \n $params['openid.ns.ax'] = GoogleAuth_OpenId_Extension_Ax::NAMESPACE_1_0;\n $params['openid.ax.mode'] = GoogleAuth_OpenId_Extension_Ax::MODE;\n\n if (!empty($required)) {\n $params['openid.ax.required'] = $required;\n }\n if (!empty($optional)) {\n $params['openid.ax.if_available'] = $optional;\n }\n\n }\n return true;\n }", "public function isRegistered(){\n return isset($this->data['id']);\n }", "public function getIsUrlParametersAccepted(): bool;", "public function hasParams(){\n return $this->_has(8);\n }", "public function has($name)\r\n {\r\n return array_key_exists($name, $this->parameters);\r\n }", "function simpleid_checkid_error($request, $immediate = false) {\n global $version;\n \n $message = array();\n if ($immediate) {\n if ($version >= OPENID_VERSION_2) {\n $message['openid.mode'] = 'setup_needed';\n } else {\n $message['openid.mode'] = 'id_res';\n }\n } else {\n $message['openid.mode'] = 'cancel';\n }\n \n $message = array_merge($message, extension_invoke_all('response', FALSE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "public static function has($key) {\n return isset($_REQUEST[$key]);\n }", "public function hasParams()\r\n\t{\r\n\t\treturn (is_array($this->pathParameters) && !empty($this->pathParameters));\r\n\t}", "public static function has($key)\n {\n return isset($_REQUEST[$key]);\n }", "public function has($id): bool\n\t{\n\t\treturn array_key_exists($id, $this->params);\n\t}", "public function hasParameter($name)\n {\n return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);\n }", "public function parseRequest($params)\n {\n $this->_version= 1.0;\n\n $props = array();\n if (!empty($params['openid_ax_optional'])) {\n foreach (explode(',', $params['openid_ax_optional']) as $prop) {\n $prop = trim($prop);\n $props[$prop] = false;\n }\n }\n if (!empty($params['openid_ax_required'])) {\n foreach (explode(',', $params['openid_ax_required']) as $prop) {\n $prop = trim($prop);\n $props[$prop] = true;\n }\n }\n $props2 = array();\n foreach (array_keys(self::getAxProperties()) as $prop) {\n if (isset($props[$prop])) {\n $props2[$prop] = $props[$prop];\n }\n }\n\n $this->_props = (count($props2) > 0) ? $props2 : null;\n return true;\n }", "public function has($identifier) {\n\t\tif ($argument = $this->get($identifier)) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function hasContextValue();", "function inputHas($key)\n\t{\n\treturn isset($_REQUEST[$key]);\n\t\n\t}", "public function is_search_api_key_in_config() {\n\t\treturn defined( 'ALGOLIA_SEARCH_API_KEY' );\n\t}", "public function hasAppid()\n {\n return $this->appid !== null;\n }", "public function hasAppid()\n {\n return $this->appid !== null;\n }", "public function hasAppid()\n {\n return $this->appid !== null;\n }", "public function isRequiresQuestionId();" ]
[ "0.6788513", "0.6614573", "0.6592335", "0.658063", "0.63463813", "0.63086665", "0.61476433", "0.6126315", "0.609339", "0.609339", "0.609339", "0.609339", "0.609339", "0.6061259", "0.6047614", "0.6025157", "0.60201937", "0.593439", "0.5897878", "0.58679247", "0.5846166", "0.58335763", "0.5826258", "0.58253324", "0.5801535", "0.5789136", "0.5782917", "0.5761515", "0.5759505", "0.57534736", "0.57417816", "0.5707021", "0.5707021", "0.5699793", "0.56684506", "0.5659415", "0.56169385", "0.560312", "0.55919486", "0.5579296", "0.5577414", "0.5572811", "0.55563986", "0.5555016", "0.554842", "0.55483437", "0.5536607", "0.55264395", "0.55264395", "0.55252093", "0.55227304", "0.550072", "0.54959786", "0.54891527", "0.54854935", "0.5485186", "0.548407", "0.5476579", "0.5469644", "0.54672885", "0.54671264", "0.5462096", "0.54572904", "0.54568845", "0.54493016", "0.5449208", "0.54491156", "0.5446521", "0.5437148", "0.5424945", "0.5424483", "0.54231703", "0.5412455", "0.54075176", "0.54067785", "0.5403754", "0.5399825", "0.53976077", "0.5395358", "0.5378078", "0.5365543", "0.5348773", "0.5347727", "0.53464675", "0.5331003", "0.53295827", "0.5325775", "0.53235346", "0.53220636", "0.53207076", "0.53184384", "0.5311971", "0.5310743", "0.5303767", "0.52795523", "0.52723926", "0.52683055", "0.52631366", "0.52631366", "0.52631366", "0.5262941" ]
0.0
-1
Bind value to OpenID request parameter
function set($key,$val) { return $this->args[$key]=$val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function bindOpenID($uid, $openid_identifier);", "public function getUserIDByOpenID($openid_identifier);", "function getOpenIDURL() {\n\t// value.\n\n\tif (substr($_POST[ssoInpUsername], 0, 4) == \"http\") {\n\t\t$tmpuri = $_POST[ssoInpUsername];\n\t} else {\n\t\tif (in_array(strtolower(trim($_POST[ssoInpUsername])), $GLOBALS[oldusers])) {\n\t\t\tsysmsg (\"User with old OpenID logged in: \".$_POST[ssoInpUsername], 1);\n\t\t\t$tmpuri = $GLOBALS[cfg][old_openid_identifier_base].$_POST[ssoInpUsername];\n\t\t} else {\n\t\t\t$tmpuri = $GLOBALS[cfg][openid_identifier_base].$_POST[ssoInpUsername];\n\t\t}\n\t}\n\t$_SESSION[openid_identifier] = $tmpuri;\n\n\tif (empty($tmpuri)) {\n\t\tsysmsg (\"Expected an OpenID URL.\", 1);\n\t\theader('X-JSON: '.json_encode($GLOBALS[myreturn]).')');\n\t\techo json_encode($GLOBALS[myreturn]);\n\t\texit(0);\n\t}\n\treturn $tmpuri;\n}", "public function getOpenId()\n {\n }", "public function setOpenid($openid)\n {\n $this->openid = $openid;\n }", "function simpleid_process_openid($request) {\n global $version;\n \n $version = openid_get_version($request);\n \n switch ($request['openid.mode']) {\n case 'associate':\n simpleid_associate($request);\n return;\n case 'checkid_immediate':\n case 'checkid_setup':\n return simpleid_checkid($request);\n case 'check_authentication':\n simpleid_check_authentication($request);\n break;\n default:\n if (isset($request['openid.return_to'])) {\n // Indirect communication - send error via indirect communication.\n header_response_code('404 Bad Request');\n set_message('Invalid OpenID message.');\n page_dashboard();\n } else {\n // Direct communication\n openid_direct_error('Invalid OpenID message.');\n }\n }\n}", "public function setOpenId($var)\n {\n GPBUtil::checkString($var, True);\n $this->open_id = $var;\n }", "public function getOpenid()\n {\n return $this->openid;\n }", "public function getOpenid()\n {\n return $this->openid;\n }", "protected function getAuthParam(){\n\t\treturn '?key=' . $this->key . '&token=' . $this->token;\n\t}", "public function getIdParameter(): string;", "function simpleid_checkid_ok($request) {\n global $version;\n \n $message = array(\n 'openid.mode' => 'id_res',\n 'openid.op_endpoint' => simpleid_url(),\n 'openid.response_nonce' => openid_nonce()\n );\n \n if (isset($request['openid.assoc_handle'])) $message['openid.assoc_handle'] = $request['openid.assoc_handle'];\n if (isset($request['openid.identity'])) $message['openid.identity'] = $request['openid.identity'];\n if (isset($request['openid.return_to'])) $message['openid.return_to'] = $request['openid.return_to'];\n \n if (($version >= OPENID_VERSION_2) && isset($request['openid.claimed_id'])) {\n $message['openid.claimed_id'] = $request['openid.claimed_id'];\n }\n \n $message = array_merge($message, extension_invoke_all('response', TRUE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "public function getOpenId()\n {\n return $this->open_id;\n }", "public function setRequestorId(?string $value): void {\n $this->getBackingStore()->set('requestorId', $value);\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "private function getRequestIndividualId()\n {\n return $this->requestIndividualId;\n }", "public function setCustomIdentifier($input) {\n\t\t$this->_identifier = $input;\n\t}", "function doregisterwithopenid($data, $form) {\n\t\t$openid = trim($data['OpenIDURL']);\n\t\tSession::set(\"FormInfo.Form_RegistrationWithOpenIDForm.data\", $data);\n\n \tif(strlen($openid) == 0) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"Please enter your OpenID or your i-name.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\n\t\t$trust_root = Director::absoluteBaseURL();\n\t\t$return_to_url = $trust_root . $this->Link('processopenidresponse');\n\n\t\t$consumer = new Auth_OpenID_Consumer(new OpenIDStorage(), new SessionWrapper());\n\n\n\t\t// No auth request means we can't begin OpenID\n\t\t$auth_request = $consumer->begin($openid);\n\t\tif(!$auth_request) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"That doesn't seem to be a valid OpenID or i-name identifier. \" .\n\t\t\t\t\t\"Please try again.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\t\t$SQL_identity = Convert::raw2sql($auth_request->endpoint->claimed_id);\n\t\tif($member = Member::get()->filter('IdentityURL', $SQL_identity)->first()) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"That OpenID or i-name is already registered. Use another one.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\n\t\t// Add the fields for which we wish to get the profile data\n \t$sreg_request = Auth_OpenID_SRegRequest::build(null,\n \tarray('nickname', 'fullname', 'email', 'country'));\n\n \tif($sreg_request) {\n\t\t\t$auth_request->addExtension($sreg_request);\n \t}\n\n\n\t\tif($auth_request->shouldSendRedirect()) {\n\t\t\t// For OpenID 1, send a redirect.\n\t\t\t$redirect_url = $auth_request->redirectURL($trust_root, $return_to_url);\n\n\t\t\tif(Auth_OpenID::isFailure($redirect_url)) {\n\t\t\t\tdisplayError(\"Could not redirect to server: \" .\n\t\t\t\t\t\t\t\t\t\t $redirect_url->message);\n\t\t\t} else {\n\t\t\t\treturn $this->redirect($redirect_url);\n\t\t\t}\n\n\t\t} else {\n\t\t\t// For OpenID 2, use a javascript form to send a POST request to the\n\t\t\t// server.\n\t\t\t$form_id = 'openid_message';\n\t\t\t$form_html = $auth_request->formMarkup($trust_root, $return_to_url,\tfalse, array('id' => $form_id));\n\n\t\t\tif(Auth_OpenID::isFailure($form_html)) {\n\t\t\t\tdisplayError(\"Could not redirect to server: \" .$form_html->message);\n\t\t\t} else {\n\t\t\t\t$page_contents = array(\n\t\t\t\t\t \"<html><head><title>\",\n\t\t\t\t\t \"OpenID transaction in progress\",\n\t\t\t\t\t \"</title></head>\",\n\t\t\t\t\t \"<body onload='document.getElementById(\\\"\". $form_id .\n\t\t\t\t\t \"\\\").submit()'>\",\n\t\t\t\t\t $form_html,\n\t\t\t\t\t \"<p>Click &quot;Continue&quot; to login. You are only seeing \" .\n\t\t\t\t\t \"this because you appear to have JavaScript disabled.</p>\",\n\t\t\t\t\t \"</body></html>\");\n\n\t\t\t\tprint implode(\"\\n\", $page_contents);\n\t\t\t}\n\t\t}\n\t}", "public function client_id_callback()\n {\n printf(\n '<input type=\"text\" id=\"title\" name=\"linkedin_api_option[client_id]\" value=\"%s\" />',\n isset( $this->options['client_id'] ) ? esc_attr( $this->options['client_id']) : ''\n );\n }", "private function buildUrl() : string\n {\n $redirectUri = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n $params = http_build_query([\n 'openid.ns' => self::OPENID_NS,\n 'openid.mode' => 'checkid_setup',\n 'openid.return_to' => (string) $redirectUri,\n 'openid.realm' => (string) $redirectUri,\n 'openid.identity' => 'http://specs.openid.net/auth/2.0/identifier_select',\n 'openid.claimed_id' => 'http://specs.openid.net/auth/2.0/identifier_select',\n ]);\n\n return (string) (new Uri($this->getOpenIdUrl().'/login'))->withQuery($params);\n }", "static function createStoreRequest(&$auth_request,&$attributeProvider,\n $attribute,$value,$openid)\n {\n if(!$auth_request){\n return null;\n }\n $signedAssertion=$attributeProvider->sign($openid,$attribute,$value);\n $store_request=new Auth_OpenID_AX_StoreRequest;\n $store_request->addValue($attribute,base64_encode($value));\n $store_request->addValue($attribute.'/signature',\n base64_encode($signedAssertion));\n if($store_request) {\n $auth_request->addExtension($store_request);\n return $auth_request;\n }\n }", "public function unbindOpenID($uid, $openid_identifier);", "public function setWinnerIdAttribute($input)\n {\n $this->attributes['winner_id'] = $input ? $input : null;\n }", "function hook_openid_connect_userinfo_claim_alter(&$claim_value, array $context) {\n // Alter only, when the claim comes from the 'generic' identiy provider and\n // the property is 'telephone'.\n if (\n $context['plugin_id'] != 'generic'\n || $context['property_name'] != 'telephone'\n ) {\n return;\n }\n\n // Replace international number indicator with double zero.\n str_replace('+', '00', $claim_value);\n}", "public function setclient_id($value);", "private function getCustomerIdParameter()\n {\n return sprintf('uid-%s-%s', time(), $this->generateRandomString());\n }", "public function getAuthIdentifierName(){\n return 'id';\n }", "function simpleid_associate($request) {\n global $version;\n \n log_info('OpenID association request: ' . log_array($request));\n \n $assoc_types = openid_association_types();\n $session_types = openid_session_types(is_https(), $version);\n\n // Common Request Parameters [8.1.1]\n if (($version == OPENID_VERSION_1_1) && !isset($request['openid.session_type'])) $request['openid.session_type'] = '';\n $assoc_type = $request['openid.assoc_type'];\n $session_type = $request['openid.session_type'];\n \n // Diffie-Hellman Request Parameters [8.1.2]\n $dh_modulus = (isset($request['openid.dh_modulus'])) ? $request['openid.dh_modulus'] : NULL;\n $dh_gen = (isset($request['openid.dh_gen'])) ? $request['openid.dh_gen'] : NULL;\n $dh_consumer_public = $request['openid.dh_consumer_public'];\n \n if (!isset($request['openid.session_type']) || !isset($request['openid.assoc_type'])) {\n log_error('Association failed: openid.session_type or openid.assoc_type not set');\n openid_direct_error('openid.session_type or openid.assoc_type not set');\n return;\n }\n \n // Check if the assoc_type is supported\n if (!array_key_exists($assoc_type, $assoc_types)) {\n $error = array(\n 'error_code' => 'unsupported-type',\n 'session_type' => 'DH-SHA1',\n 'assoc_type' => 'HMAC-SHA1'\n );\n log_error('Association failed: The association type is not supported by SimpleID.');\n openid_direct_error('The association type is not supported by SimpleID.', $error, $version);\n return;\n }\n // Check if the session_type is supported\n if (!array_key_exists($session_type, $session_types)) {\n $error = array(\n 'error_code' => 'unsupported-type',\n 'session_type' => 'DH-SHA1',\n 'assoc_type' => 'HMAC-SHA1'\n );\n log_error('Association failed: The session type is not supported by SimpleID.');\n openid_direct_error('The session type is not supported by SimpleID.', $error, $version);\n return;\n }\n \n if ($session_type == 'DH-SHA1' || $session_type == 'DH-SHA256') {\n if (!$dh_consumer_public) {\n log_error('Association failed: openid.dh_consumer_public not set');\n openid_direct_error('openid.dh_consumer_public not set');\n return;\n }\n }\n\n $response = _simpleid_create_association(ASSOCIATION_SHARED, $assoc_type, $session_type, $dh_modulus, $dh_gen, $dh_consumer_public);\n \n openid_direct_response(openid_direct_message($response, $version));\n}", "public function setToIdAttribute($input)\n {\n $this->attributes['to_id'] = $input ? $input : null;\n }", "private function _setUserid($input) {\n\t\tif(!Validator::UnsignedNumber($input)) throw new Exception(lang('error_90'));\n\t\t$this->_identifier = $input;\n\t}", "function auth_openid_dist ($login, $pass, $serveur='') {\n\n\t// il faut un login non vide ET un pass vide (sinon cela ne concerne pas OpenID)\n\tif (!strlen($login) OR strlen($pass)) return false;\n\t$auteur = false;\n\n\tif (!$l = auth_openid_retrouver_login($login)){\n\t\tif (is_openid($login)\n\t\t\tAND $idurl = nettoyer_openid($login)\n\t\t\tAND verifier_openid($idurl))\n\t\t\treturn _T(\"openid:form_login_openid_inconnu\");\n\t\treturn false;\n\t}\n\t$login = $l;\n\n\n\t// retrouver le login\n\tif (!$auteur = sql_fetsel(\"openid,statut\", \"spip_auteurs\", \"login=\" . sql_quote($login),\"\",\"\",\"\",\"\",$serveur) )\n\t\treturn false;\n\n\tif (!$idurl = $auteur['openid'])\n\t\treturn false;\n\n\tif ($auteur['statut']=='nouveau')\n\t\treturn _T('openid:form_login_statut_nouveau');\n\t\n\t// * Si l'openid existe, la procedure continue en redirigeant\n\t// vers le fournisseur d'identite. En cas d'erreur, il y a une redirection de faite\n\t// sur la page login, en cas de reussite, sur l'action controler_openid\n\t// * S'il l'openid n'existe pas, on est de retour ici, et on continue\n\t// pour d'autres methodes d'identification\n\tinclude_spip('inc/openid');\n\t$retour = auth_url_retour_login('openid', $login, url_absolue(self()));\n\t$erreurs_openid = demander_authentification_openid($idurl, $retour);\n\t// potentiellement, on arrive ici avec une erreur si l'openid donne n'existe pas\n\t// on la renvoie\n\treturn $erreurs_openid;\n}", "public function setStatusIdAttribute($input)\n {\n $this->attributes['status_id'] = $input ? $input : null;\n }", "function oauth_urlencode($uri) {}", "function setIdentifier($val) {\n $this->identifier = $this->updateDB('identifier', $val);\n }", "public function getLeadIdFromRequest()\n {\n return isset($_POST['id']) ? $_POST['id'] : $_GET['id'];\n }", "function enameToOid($ename) {\n\n $query = \"SELECT master.oid FROM coredata_read.coreUser_master AS master \n INNER JOIN coredata_read.coreUser_name AS name ON name.oid = master.oid \n WHERE name.nameValue=:ename AND name.nameType='ename' AND userStatus='Active'\";\n \n $bindV = array(\"ename\"=>$ename);\n $result = query_db($query,$bindV,\"false\",true);\n \n return addslashes($result['oid']);\n\n}", "function simpleid_checkid_approval_required($request) {\n global $version;\n \n if ($version >= OPENID_VERSION_2) {\n $message = array('openid.mode' => 'setup_needed');\n } else {\n $request['openid.mode'] = 'checkid_setup';\n $message = array(\n 'openid.mode' => 'id_res', \n 'openid.user_setup_url' => simpleid_url('continue', 's=' . rawurlencode(pickle($request)))\n );\n }\n \n $message = array_merge($message, extension_invoke_all('response', FALSE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "function http_persistent_handles_ident($ident) {}", "public function getAuthIdentifierName(): string;", "public function queryParam($name);", "public function getAuthIdentifier();", "public function setComunaIdAttribute($input)\n {\n $this->attributes['comuna_id'] = $input ? $input : null;\n }", "public function setIdentity($value);", "public function consume_identity($params, $response){\n $this->set_identity('email', $response[ $params['email'] ]);\n \t}", "function simpleid_checkid_identity(&$request, $immediate) {\n global $user, $version;\n \n $realm = openid_get_realm($request, $version);\n \n // Check 1: Is the user logged into SimpleID as any user?\n if ($user == NULL) {\n return CHECKID_LOGIN_REQUIRED;\n } else {\n $uid = $user['uid'];\n }\n \n // Check 2: Is the user logged in as the same identity as the identity requested?\n // Choose the identity URL for the user automatically\n if ($request['openid.identity'] == OPENID_IDENTIFIER_SELECT) {\n $test_user = user_load($uid);\n $identity = $test_user['identity'];\n \n log_info('OpenID identifier selection: Selected ' . $uid . ' [' . $identity . ']');\n } else {\n $identity = $request['openid.identity'];\n $test_user = user_load_from_identity($identity);\n }\n if ($test_user == NULL) return CHECKID_IDENTITY_NOT_EXIST;\n if ($test_user['uid'] != $user['uid']) {\n log_notice('Requested user ' . $test_user['uid'] . ' does not match logged in user ' . $user['uid']);\n return CHECKID_IDENTITIES_NOT_MATCHING;\n }\n \n // Pass the assertion to extensions\n $assertion_results = extension_invoke_all('checkid_identity', $request, $identity, $immediate);\n $assertion_results = array_merge(array_diff($assertion_results, array(NULL)));\n \n // Populate the request with the selected identity\n if ($request['openid.identity'] == OPENID_IDENTIFIER_SELECT) {\n $request['openid.claimed_id'] = $identity;\n $request['openid.identity'] = $identity;\n }\n \n // Check 3: Discover the realm and match its return_to\n $user_rp = (isset($user['rp'][$realm])) ? $user['rp'][$realm] : NULL;\n\n if (($version >= OPENID_VERSION_2) && SIMPLEID_VERIFY_RETURN_URL_USING_REALM) {\n $verified = FALSE;\n \n $rp_info = simpleid_get_rp_info($realm);\n $services = discovery_get_service_by_type($rp_info['services'], OPENID_RETURN_TO);\n \n log_info('OpenID 2 discovery: ' . count($services) . ' matching services');\n \n if ($services) {\n $return_to_uris = array();\n \n foreach ($services as $service) {\n $return_to_uris = array_merge($return_to_uris, $service['uri']);\n }\n foreach ($return_to_uris as $return_to) {\n if (openid_url_matches_realm($request['openid.return_to'], $return_to)) {\n log_info('OpenID 2 discovery: verified');\n $verified = TRUE;\n break;\n }\n }\n }\n \n $rp_info['return_to_verified'] = $verified;\n simpleid_set_rp_info($realm, $rp_info);\n \n if (!$verified) {\n if (($user_rp != NULL) && ($user_rp['auto_release'] == 1)) {\n log_notice('OpenID 2 discovery: not verified, but overridden by user preference');\n } else {\n log_notice('OpenID 2 discovery: not verified');\n $assertion_results[] = CHECKID_RETURN_TO_SUSPECT;\n }\n }\n }\n \n // Check 4: For checkid_immediate, the user must already have given\n // permission to log in automatically. \n if (($user_rp != NULL) && ($user_rp['auto_release'] == 1)) {\n log_info('Automatic set for realm ' . $realm);\n $assertion_results[] = CHECKID_OK;\n return min($assertion_results);\n } else {\n $assertion_results[] = CHECKID_APPROVAL_REQUIRED;\n return min($assertion_results);\n }\n}", "public function createOpenIdUrl(){\n $format = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=%s&state=%s#wechat_redirect';\n $orderId = \"order123\";\n $paymentId = \"payment999\";\n\n $appId = \\WxPayConfig::APPID;\n $scope = \"snsapi_base\";\n $state = $orderId.\"\".$orderId;\n $redirectUrl = \"http://zyoutrip.com/wechat/payment/redirect\";\n\n $url = sprintf($format, $appId, urlencode($redirectUrl), $scope, $state);\n\n return $url;\n }", "public function setOpenid($openid)\n {\n $this->openid = $openid;\n\n return $this;\n }", "public function bindValue($name, $value);", "public function getRequestedId() {}", "private function authOpenId(OpenId $client, ServerRequestInterface $request): ResponseInterface\n {\n $queryParams = $request->getQueryParams();\n $bodyParams = $request->getParsedBody();\n $mode = $queryParams['openid_mode'] ?? $bodyParams['openid_mode'] ?? null;\n\n if (empty($mode)) {\n return $this->responseFactory\n ->createResponse(Status::MOVED_PERMANENTLY)\n ->withHeader('Location', $client->buildAuthUrl($request));\n }\n\n switch ($mode) {\n case 'id_res':\n if ($client->validate()) {\n return $this->authSuccess($client);\n }\n $response = $this->responseFactory->createResponse(Status::BAD_REQUEST);\n $response->getBody()->write(\n 'Unable to complete the authentication because the required data was not received.'\n );\n return $response;\n case 'cancel':\n return $this->authCancel($client);\n default:\n return $this->responseFactory->createResponse(Status::BAD_REQUEST);\n }\n }", "public function setByPlayerIdAttribute($input)\n {\n $this->attributes['by_player_id'] = $input ? $input : null;\n }", "public function setOpenShiftId($value)\n {\n $this->setProperty(\"OpenShiftId\", $value, true);\n }", "public function getAuthIdentifierName()\n {\n return \"id\";\n }", "public function setReceivedByIdAttribute($input)\n {\n $this->attributes['received_by_id'] = $input ? $input : null;\n }", "function bindResidentHousingApplication($STATEMENT_ID,$databaseFieldWeNeed,$fieldWeWantToSpecify){\n return oci_bind_by_name($STATEMENT_ID,$databaseFieldWeNeed,$fieldWeWantToSpecify);\n }", "private function parseSteamID() : void\n {\n $queryParams = $this->request->getQueryParams();\n preg_match('#^https?://'.$this->getOpenIdUrl(false).'/id/([0-9]{17,25})#', array_get($queryParams,'openid_claimed_id'), $matches);\n $this->steamId = is_numeric($matches[1]) ? $matches[1] : 0;\n }", "public function setOid($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->oid !== $v) {\n $this->oid = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_OID] = true;\n }\n\n return $this;\n }", "public function setCompanyIdAttribute($input)\n {\n $this->attributes['company_id'] = $input ? $input : null;\n }", "function processopenidresponse() {\n\t\t$consumer = new Auth_OpenID_Consumer(new OpenIDStorage(), new SessionWrapper());\n\n\t\t$trust_root = Director::absoluteBaseURL();\n\t\t$return_to_url = $trust_root . $this->Link('ProcessOpenIDResponse');\n\n\t\t// Complete the authentication process using the server's response.\n\t\t$response = $consumer->complete($return_to_url);\n\n\t\tif($response->status == Auth_OpenID_SUCCESS) {\n\t\t\tSession::clear(\"FormInfo.Form_RegistrationWithOpenIDForm.data\");\n\t\t\t$openid = $response->identity_url;\n\n\t\t\tif($response->endpoint->canonicalID) {\n\t\t\t\t$openid = $response->endpoint->canonicalID;\n\t\t\t}\n\n\t\t\t$sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response);\n\t\t\t$sreg = $sreg_resp->contents();\n\n\t\t\t// Convert the simple registration data to the needed format\n\t\t\t// try to split fullname to get firstname and surname\n\t\t\t$data = array('IdentityURL' => $openid);\n\t\t\tif(isset($sreg['nickname']))\n\t\t\t\t$data['Nickname'] = $sreg['nickname'];\n\t\t\tif(isset($sreg['fullname'])) {\n\t\t\t\t$fullname = explode(' ', $sreg['fullname'], 2);\n\t\t\t\tif(count($fullname) == 2) {\n\t\t\t\t\t$data['FirstName'] = $fullname[0];\n\t\t\t\t\t$data['Surname'] = $fullname[1];\n\t\t\t\t} else {\n\t\t\t\t\t$data['Surname'] = $fullname[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($sreg['country']))\n\t\t\t\t$data['Country'] = $sreg['country'];\n\t\t\tif(isset($sreg['email']))\n\t\t\t\t$data['Email'] = $sreg['email'];\n\n\t\t\tSession::set(\"FormInfo.Form_RegistrationForm.data\", $data);\n\t\t\treturn $this->redirect($this->Link('register'));\n\t\t}\n\n\n\t\t// The server returned an error message, handle it!\n\t\tif($response->status == Auth_OpenID_CANCEL) {\n\t\t\t$error_message = _t('ForumMemberProfile.CANCELLEDVERIFICATION','The verification was cancelled. Please try again.');\n\t\t} else if($response->status == Auth_OpenID_FAILURE) {\n\t\t\t$error_message = _t('ForumMemberProfile.AUTHENTICATIONFAILED','The OpenID/i-name authentication failed.');\n\t\t} else {\n\t\t\t$error_message = _t('ForumMemberProfile.UNEXPECTEDERROR','An unexpected error occured. Please try again or register without OpenID');\n\t\t}\n\n\t\t$this->RegistrationWithOpenIDForm()->addErrorMessage(\"Blurb\",\n\t\t\t$error_message, 'bad');\n\n\t\treturn $this->redirect($this->Link('registerwithopenid'));\n\t}", "function provider($label, $id)\n{\n return array(\n 'label' => $label,\n 'id' => $id,\n 'url' => './auth/' . $id\n );\n}", "function setid_exp($val)\n { $this->id_exp=$val;}", "function setid_exp($val)\n { $this->id_exp=$val;}", "public function setChurchIdAttribute($input)\n {\n $this->attributes['church_id'] = $input ? $input : null;\n }", "function url_with_auth_token($url) {\n // use global $query_params that was initialized during auth check on page load\n global $query_params;\n\n // no auth info, return original url\n if ($query_params['token'] == \"\" || $query_params['uuid'] == \"\") {\n echo $url;\n return;\n }\n\n $uri_parts = explode('?', $url, 2);\n if (isset($uri_parts[1]) && ($uri_parts[1] == \"\")) {\n $url .= \"?\";\n } else {\n $url .= \"&\";\n }\n\n $url .= \"token=\".$query_params['token'].\"&uuid=\".$query_params['uuid'];\n echo $url;\n}", "public function setIduser($value)\n {\n $this->iduser = $value;\n }", "public function setPaymentMethodIdAttribute($input)\n {\n $this->attributes['payment_method_id'] = $input ? $input : null;\n }", "protected function _getSeoObjectId()\n {\n return oxRegistry::getConfig()->getRequestParameter('oxcid');\n }", "public function setIDfromArgV() {}", "public function identity_response($params){\n \t\t$params['organization_id'] \t= 'organization_id';\n \t\t$params['first_name'] \t\t= 'first_name';\n \t\t$params['last_name'] \t\t= 'last_name';\n \t\t$params['display_name'] \t= 'display_name';\n \t\t$params['username'] \t\t= 'username';\n \t\t$params['timezone'] \t\t= 'timezone';\n \t\treturn $params;\n \t}", "function registerwithopenid($data, $message = null) {\n\t\treturn array(\n\t\t\t\"Title\" => _t('ForumMemberProfile.SSFORUM'),\n\t\t\t\"Subtitle\" => _t('ForumMemberProfile.REGISTEROPENID','Register with OpenID'),\n\t\t\t\"Abstract\" => ($message)\n\t\t\t\t? '<p class=\"' . $message['type'] . '\">' .\n\t\t\t\t\t\tConvert::raw2xml($message['message']) . '</p>'\n\t\t\t\t: \"<p>\" . _t('ForumMemberProfile.ENTEROPENID','Please enter your OpenID to continue the registration') . \"</p>\",\n\t\t\t\"Form\" => $this->RegistrationWithOpenIDForm(),\n\t\t);\n\t}", "function simpleid_checkid_error($request, $immediate = false) {\n global $version;\n \n $message = array();\n if ($immediate) {\n if ($version >= OPENID_VERSION_2) {\n $message['openid.mode'] = 'setup_needed';\n } else {\n $message['openid.mode'] = 'id_res';\n }\n } else {\n $message['openid.mode'] = 'cancel';\n }\n \n $message = array_merge($message, extension_invoke_all('response', FALSE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "public function set_id_user($value = \"\")\n {\n $this->_id_user = \\helpers\\Validator::valInt('f_id_user', $value, TRUE);\n }", "function auth($proxy=NULL,$attr=[],array $reqd=NULL) {\n\t\t$fw=\\Base::instance();\n\t\t$root=$fw->SCHEME.'://'.$fw->HOST;\n\t\tif (empty($this->args['trust_root']))\n\t\t\t$this->args['trust_root']=$root.$fw->BASE.'/';\n\t\tif (empty($this->args['return_to']))\n\t\t\t$this->args['return_to']=$root.$_SERVER['REQUEST_URI'];\n\t\t$this->args['mode']='checkid_setup';\n\t\tif ($this->url=$this->discover($proxy)) {\n\t\t\tif ($attr) {\n\t\t\t\t$this->args['ns.ax']='http://openid.net/srv/ax/1.0';\n\t\t\t\t$this->args['ax.mode']='fetch_request';\n\t\t\t\tforeach ($attr as $key=>$val)\n\t\t\t\t\t$this->args['ax.type.'.$key]=$val;\n\t\t\t\t$this->args['ax.required']=is_string($reqd)?\n\t\t\t\t\t$reqd:implode(',',$reqd);\n\t\t\t}\n\t\t\t$var=[];\n\t\t\tforeach ($this->args as $key=>$val)\n\t\t\t\t$var['openid.'.$key]=$val;\n\t\t\t$fw->reroute($this->url.'?'.http_build_query($var));\n\t\t}\n\t\treturn FALSE;\n\t}", "function requestCode ($domain) {\n $url = 'https://' . $domain . '/oauth/authorize/' .\n '?client_id=' . urlencode(APP_ID);\n redirect($url);\n}", "function setid_exp($val)\n { $this->id_exp=$val;}", "protected function _respond($version, $ret, $params, $extensions=null)\n {\n if (empty($params['openid_assoc_handle']) ||\n !$this->_storage->getAssociation($params['openid_assoc_handle'],\n $macFunc, $secret, $expires)) {\n /* Use dumb mode */\n if (!empty($params['openid_assoc_handle'])) {\n $ret['openid.invalidate_handle'] = $params['openid_assoc_handle'];\n }\n $macFunc = $version >= 2.0 ? 'sha256' : 'sha1';\n $secret = $this->_genSecret($macFunc);\n $handle = uniqid();\n $expiresIn = $this->_sessionTtl;\n $this->_storage->addAssociation($handle,\n $macFunc, $secret, time() + $expiresIn);\n $ret['openid.assoc_handle'] = $handle;\n } else {\n $ret['openid.assoc_handle'] = $params['openid_assoc_handle'];\n }\n if (isset($params['openid_return_to'])) {\n $ret['openid.return_to'] = $params['openid_return_to'];\n }\n if (isset($params['openid_claimed_id'])) {\n $ret['openid.claimed_id'] = $params['openid_claimed_id'];\n }\n if (isset($params['openid_identity'])) {\n $ret['openid.identity'] = $params['openid_identity'];\n }\n\n if ($version >= 2.0) {\n if (!empty($this->_opEndpoint)) {\n $ret['openid.op_endpoint'] = $this->_opEndpoint;\n } else {\n $ret['openid.op_endpoint'] = Zend_OpenId::selfUrl();\n }\n }\n $ret['openid.response_nonce'] = gmdate('Y-m-d\\TH:i:s\\Z') . uniqid();\n $ret['openid.mode'] = 'id_res';\n\n Zend_OpenId_Extension::forAll($extensions, 'prepareResponse', $ret);\n\n $signed = '';\n $data = '';\n foreach ($ret as $key => $val) {\n if (strpos($key, 'openid.') === 0) {\n $key = substr($key, strlen('openid.'));\n if (!empty($signed)) {\n $signed .= ',';\n }\n $signed .= $key;\n $data .= $key . ':' . $val . \"\\n\";\n }\n }\n $signed .= ',signed';\n $data .= 'signed:' . $signed . \"\\n\";\n $ret['openid.signed'] = $signed;\n\n $ret['openid.sig'] = base64_encode(\n Zend_OpenId::hashHmac($macFunc, $data, $secret));\n\n return $ret;\n }", "function newTokenEncode($userName,$id)\n\t{\n\t\t$newTokenNum =base64_encode($userName.\"/\".$id);\n\t\treturn $newTokenNum;\n\t}", "function render_identity_tag() {\n\t$user = get_segmentio_user_details();\n\t?>\n\t<script>\n\t\t(function () {\n\t\t\tvar segment_user = <?php echo wp_json_encode( $user ) ?>;\n\t\t\tif ( ! segment_user.opt_in ) {\n\t\t\t\tanalytics.setAnonymousId( segment_user.id );\n\t\t\t} else {\n\t\t\t\tanalytics.identify( segment_user.id, segment_user.traits );\n\t\t\t}\n\t\t})();\n\t</script>\n\t<?php\n}", "public function setDoorId()\n {\n if(isset($_GET['doorId']))\n {\n echo 'const doorId = '.$_GET['doorId'].';';\n }\n else\n {\n $config = new Config;\n echo 'const doorId = '.$config->defaultDoor.';';\n }\n }", "private function getNamedParam()\n {\n return self::BINDING_PREFIX . $this->getLetterBinding();\n }", "function rest_sanitize_request_arg($value, $request, $param)\n {\n }", "public function getIdentifierField();", "function getDefaultWithOid() {\n\t\t// 8.0 is the first release to have this setting\n\t\t// Prior releases don't have this setting... oids always activated\n\t\treturn 'on';\n\t\t}", "function getLoanID($db_link){\n\t\tif (isset($_GET['lid'])) $_SESSION['loan_id'] = sanitize($db_link, $_GET['lid']);\n\t\telse header('Location: customer.php?cust='.$_SESSION['cust_id']);\n\t}", "protected function initUserAttributes()\n {\n Event::on(Request::className(), Request::EVENT_AFTER_SEND, function ($event) {\n ///Replace `callback( {\"client_id\":\"101367642\",\"openid\":\"9B18299BC4CBFDAFCA09DBE95A6A0F23\"} );` with ` {\"client_id\":\"101367642\",\"openid\":\"9B18299BC4CBFDAFCA09DBE95A6A0F23\"}`\n $event->response->content = preg_replace('/^callback\\(\\s*(\\{.*\\})\\s*\\);$/is', '\\1', $event->response->content);\n });\n return $this->api('oauth2.0/me', 'GET');\n }", "public function setCreatedByIdAttribute($input)\n {\n $this->attributes['created_by_id'] = $input ? $input : null;\n }", "public function setCreatedByIdAttribute($input)\n {\n $this->attributes['created_by_id'] = $input ? $input : null;\n }", "public function setTournamentmodeIdAttribute($input)\n {\n $this->attributes['tournamentmode_id'] = $input ? $input : null;\n }", "private function exactMatchUrlValue() {\n if ($this->blExactMatch) {\n return IFinder::REST_QUESTION_MARK;\n } else {\n return IFinder::REST_QUESTION_MARK . PubChemFinder::REST_NAME_SPECIFICATION . PubChemFinder::REST_AMPERSAND;\n }\n }", "public function setUrlIdToken() {}", "public function openidredirectAction()\n {\n if(!OPENID_ACTIVE){\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::OPEN_ID_NOT_ACTIVE));\n }\n if(empty($_GET[User::INPUT_OPENID_GET_IDENTITY])){\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::MISSING_GET_IDENTITY));\n }\n\n // 2nd loop\n $authAdapter = new Zend_Auth_Adapter_OpenId();\n $result = $authAdapter->authenticate();\n if (!$result->isValid()) {\n $this->_onLoginError($result->getMessages(), $result->getCode());\n }\n\n $userTable = new User();\n $where = $userTable->getAdapter()->quoteInto(User::COLUMN_OPENID_IDENTITY . \" = ?\", $_GET[User::INPUT_OPENID_GET_IDENTITY]);\n $user = $userTable->fetchRow($where);\n if(in_array($user->status, array(\n \t\tUser::STATUS_BANNED,\n \t\tUser::STATUS_GUEST,\n \t\tUser::STATUS_PENDING,\n \t))){\n $user = null;\n }\n if(!$user){\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::NO_USER_FOR_GIVEN_IDENTITY));\n }\n\n $this->_onLoginSuccess($user);\n }", "static public function constructRequestID($action, $ident)\n\t{\n\t\treturn base64_encode($action . '|' . $ident);\n\t}", "public static function id_number_callback()\n {\n printf(\n '<input type=\"text\" id=\"id_number\" name=\"event_settings[id_number]\" value=\"%s\" />',\n self::option('id_number')\n\n );\n }", "public function setFromIdAttribute($input)\n {\n $this->attributes['from_id'] = $input ? $input : null;\n }" ]
[ "0.6909441", "0.5722527", "0.56329674", "0.5630883", "0.56131417", "0.5605959", "0.5532851", "0.5474188", "0.5474188", "0.52787304", "0.5273853", "0.5211374", "0.52070785", "0.5190931", "0.51783967", "0.51783967", "0.51783967", "0.51783967", "0.51783967", "0.51783967", "0.51783967", "0.51783967", "0.516268", "0.51589125", "0.5128648", "0.50908536", "0.50448453", "0.5008848", "0.4976943", "0.4972094", "0.49499008", "0.49203664", "0.48847574", "0.48708746", "0.4863133", "0.48556724", "0.48416924", "0.4839156", "0.4816815", "0.4811602", "0.4811271", "0.4799923", "0.47874826", "0.47685766", "0.47651702", "0.47636086", "0.4753987", "0.474631", "0.4736231", "0.47251788", "0.47060835", "0.47048205", "0.47013515", "0.46925265", "0.4684332", "0.46662858", "0.4649858", "0.46451324", "0.46399444", "0.46392196", "0.46365064", "0.46314216", "0.4619947", "0.46129066", "0.4610494", "0.4609264", "0.46075004", "0.46059665", "0.46059665", "0.4599634", "0.45973265", "0.45913863", "0.45839608", "0.45793107", "0.45789832", "0.4578203", "0.457509", "0.45651186", "0.45649818", "0.45615172", "0.45567802", "0.45536506", "0.45515442", "0.4550188", "0.45404676", "0.45369992", "0.45347106", "0.45336017", "0.4530867", "0.45243657", "0.45233217", "0.45186684", "0.45179498", "0.45179498", "0.45151755", "0.4512704", "0.45110124", "0.4510336", "0.44992098", "0.44965193", "0.44927183" ]
0.0
-1
Return value of OpenID request parameter
function &get($key) { if (isset($this->args[$key])) $val=&$this->args[$key]; else $val=NULL; return $val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOpenid()\n {\n return $this->openid;\n }", "public function getOpenid()\n {\n return $this->openid;\n }", "function getOpenIDURL() {\n\t// value.\n\n\tif (substr($_POST[ssoInpUsername], 0, 4) == \"http\") {\n\t\t$tmpuri = $_POST[ssoInpUsername];\n\t} else {\n\t\tif (in_array(strtolower(trim($_POST[ssoInpUsername])), $GLOBALS[oldusers])) {\n\t\t\tsysmsg (\"User with old OpenID logged in: \".$_POST[ssoInpUsername], 1);\n\t\t\t$tmpuri = $GLOBALS[cfg][old_openid_identifier_base].$_POST[ssoInpUsername];\n\t\t} else {\n\t\t\t$tmpuri = $GLOBALS[cfg][openid_identifier_base].$_POST[ssoInpUsername];\n\t\t}\n\t}\n\t$_SESSION[openid_identifier] = $tmpuri;\n\n\tif (empty($tmpuri)) {\n\t\tsysmsg (\"Expected an OpenID URL.\", 1);\n\t\theader('X-JSON: '.json_encode($GLOBALS[myreturn]).')');\n\t\techo json_encode($GLOBALS[myreturn]);\n\t\texit(0);\n\t}\n\treturn $tmpuri;\n}", "public function getOpenId()\n {\n }", "public function getOpenId()\n {\n return $this->open_id;\n }", "private function getRequestIndividualId()\n {\n return $this->requestIndividualId;\n }", "public function getUserIDByOpenID($openid_identifier);", "protected function getAuthParam(){\n\t\treturn '?key=' . $this->key . '&token=' . $this->token;\n\t}", "public function getAuthIdentifier();", "public function getIdParameter(): string;", "public function getLeadIdFromRequest()\n {\n return isset($_POST['id']) ? $_POST['id'] : $_GET['id'];\n }", "public function getIdToken(): ?string;", "function simpleid_process_openid($request) {\n global $version;\n \n $version = openid_get_version($request);\n \n switch ($request['openid.mode']) {\n case 'associate':\n simpleid_associate($request);\n return;\n case 'checkid_immediate':\n case 'checkid_setup':\n return simpleid_checkid($request);\n case 'check_authentication':\n simpleid_check_authentication($request);\n break;\n default:\n if (isset($request['openid.return_to'])) {\n // Indirect communication - send error via indirect communication.\n header_response_code('404 Bad Request');\n set_message('Invalid OpenID message.');\n page_dashboard();\n } else {\n // Direct communication\n openid_direct_error('Invalid OpenID message.');\n }\n }\n}", "public function getOGApplicationID();", "public function getAuthIdentifierName(): string;", "function simpleid_checkid_ok($request) {\n global $version;\n \n $message = array(\n 'openid.mode' => 'id_res',\n 'openid.op_endpoint' => simpleid_url(),\n 'openid.response_nonce' => openid_nonce()\n );\n \n if (isset($request['openid.assoc_handle'])) $message['openid.assoc_handle'] = $request['openid.assoc_handle'];\n if (isset($request['openid.identity'])) $message['openid.identity'] = $request['openid.identity'];\n if (isset($request['openid.return_to'])) $message['openid.return_to'] = $request['openid.return_to'];\n \n if (($version >= OPENID_VERSION_2) && isset($request['openid.claimed_id'])) {\n $message['openid.claimed_id'] = $request['openid.claimed_id'];\n }\n \n $message = array_merge($message, extension_invoke_all('response', TRUE, $request));\n \n log_info('OpenID authentication response: ' . log_array($message));\n return openid_indirect_message($message, $version);\n}", "public function getToken()\n {\n $value = $this->getParameter('token');\n $value = $value ?: $this->httpRequest->query->get('token');\n return $value;\n }", "public function getJwtIdentifier(): string;", "protected function _getSeoObjectId()\n {\n return oxRegistry::getConfig()->getRequestParameter('oxcid');\n }", "public function obtenerID();", "public function getAuthIdentifier()\n {\n \treturn $this->id;\n }", "public function getRequestedId() {}", "public function getOidc(): string\n {\n return $this->configuration[ConfigurationInterface::OIDC];\n }", "public function getRequestorID()\n {\n return $this->requestorID;\n }", "function id() {\n\n if (!isset($_SERVER['HTTP_TRONGATETOKEN'])) {\n http_response_code(422);\n echo 'no token'; die();\n } else {\n $token = $_SERVER['HTTP_TRONGATETOKEN'];\n $result = $this->model->get_one_where('token', $token, 'trongate_tokens');\n\n if ($result == false) {\n http_response_code(401);\n echo 'false';\n die();\n } else {\n http_response_code(200);\n echo $result->user_id;\n die();\n }\n\n }\n\n }", "public function getOidc(): ?string\n {\n return $this->oidc;\n }", "public function getOpenId()\n {\n $options['query'] = [\n 'access_token' => $this->getAccessToken()\n ];\n\n try {\n $this->response = $this->client->request('GET', $this->authUrl, $options);\n }catch (\\Exception $e){\n throw $e;\n }\n\n $ret = $this->client->getContent();\n $ret = json_decode($ret,true);\n return $ret;\n }", "function getAndValidateParam_UserInsurancePlanID(){\n if(!isset($_GET['uip_id'])){\n $output = new stdClass();\n $output->{'Error'} = true;\n $output->{'Error_Description'} = 'User insurance plan ID was not specified.';\n echo json_encode($output);\n die();\n }\n\n return $_GET['uip_id'];\n}", "public function getAuthIdentifier(){\n return $this->id;\n }", "public function getUserIdentifier(): string\n {\n return ($this->token ?? ($this->appkey ?? ''));\n }", "public function getAuthIdentifier()\n {\n return $this->token->getClaim('sub');\n }", "public function getOid()\n {\n return $this->oid;\n }", "public function paymentId() : string;", "public function getOpenLibraryId()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\treturn $this->data['id'];\n\t\t}", "private static function getAuthTokenUserId() {\n global $_iform_warehouse_override;\n if ($_iform_warehouse_override || !function_exists('hostsite_get_user_field')) {\n // If linking to a different warehouse, don't do user authentication as\n // it causes an infinite loop.\n return '';\n }\n else {\n $indiciaUserId = hostsite_get_user_field('indicia_user_id');\n // Include user ID if logged in.\n return $indiciaUserId ? \":$indiciaUserId\" : '';\n }\n }", "public function getRequestPostedToAfaOrgId()\n\t{\n\t\treturn $this->request_posted_to_afa_org_id;\n\t}", "public function getAuthIdentifierName(){\n return 'id';\n }", "function enameToOid($ename) {\n\n $query = \"SELECT master.oid FROM coredata_read.coreUser_master AS master \n INNER JOIN coredata_read.coreUser_name AS name ON name.oid = master.oid \n WHERE name.nameValue=:ename AND name.nameType='ename' AND userStatus='Active'\";\n \n $bindV = array(\"ename\"=>$ename);\n $result = query_db($query,$bindV,\"false\",true);\n \n return addslashes($result['oid']);\n\n}", "public function getUserIdentifier()\n {\n // that's why I am sending the id here\n return $this->id;\n }", "public function getAuthIdentifier(){\n\t\treturn $this->getKey();\n\t}", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "public function getAuthIdentifier()\n {\n return $this->{self::getAuthIdentifierName()};\n }", "public function getAuthIdentifier()\n {\n return (string) $this->user['id'];\n }", "public function getIdentity(): string | null;", "public function getUserId(ServerRequestInterface $request): string;", "public function getIdentification(): string\n {\n return $this->identification;\n }", "public function getAuthIdentifier() {\r\n return $this -> getKey();\r\n }", "public function getAuthIdentifier() {\n\t\treturn $this -> getKey();\n\t}", "public function getIdentifierField();", "private function getParams()\n {\n $queryParams = $this->request->getQueryParams();\n\n $params = [\n 'openid.assoc_handle' => array_get($queryParams,self::OPENID_ASSOC_HANDLE),\n 'openid.signed' => array_get($queryParams,self::OPENID_SIGNED),\n 'openid.sig' => array_get($queryParams,self::OPENID_SIG),\n 'openid.ns' => self::OPENID_NS,\n 'openid.mode' => 'check_authentication',\n ];\n\n $signedParams = explode(',', array_get($queryParams,self::OPENID_SIGNED));\n\n foreach ($signedParams as $item) {\n $value = array_get($queryParams,'openid_'.str_replace('.', '_', $item));\n $params['openid.'.$item] = $value;\n }\n\n return $params;\n }", "private function buildUrl() : string\n {\n $redirectUri = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n $params = http_build_query([\n 'openid.ns' => self::OPENID_NS,\n 'openid.mode' => 'checkid_setup',\n 'openid.return_to' => (string) $redirectUri,\n 'openid.realm' => (string) $redirectUri,\n 'openid.identity' => 'http://specs.openid.net/auth/2.0/identifier_select',\n 'openid.claimed_id' => 'http://specs.openid.net/auth/2.0/identifier_select',\n ]);\n\n return (string) (new Uri($this->getOpenIdUrl().'/login'))->withQuery($params);\n }", "public function getParameter();", "public function getParameter();", "public function getOGAdminID();", "public function litterApprovalRequestRegistrationNumber() {\n $request = $this->litterApprovalRequest();\n\n if (!isset($request)) {\n return null;\n }\n\n return $request->registration_number;\n }", "public function getAuthIdentifier()\n {\n // TODO: Implement getAuthIdentifier() method.\n return $this->{$this->getAuthIdentifierName()};\n }", "public function get_id();", "public function get_id();", "public function getAuthIdentifierName()\n {\n return \"id\";\n }", "public function getAuthIdentifier()\n {\n return $this->id;\n }", "public function getAuthIdentifier()\n {\n return $this->id;\n }", "public function getAuthIdentifier()\n {\n return $this->id;\n }", "public function getAuthIdentifier() {\n return $this->id_user;\n }", "public function getOID()\n {\n return $this->oID;\n }", "public function getAuthIdentifier()\n\t{\n\t\treturn $this->id;\n\t}", "abstract public function getPaymentAuthorizationCode();", "private function getCustomerIdParameter()\n {\n return sprintf('uid-%s-%s', time(), $this->generateRandomString());\n }", "public function getInvoiceNumber(){\n return $this->getParameter('invoice_number');\n }", "public function identity_response($params){\n \t\t$params['organization_id'] \t= 'organization_id';\n \t\t$params['first_name'] \t\t= 'first_name';\n \t\t$params['last_name'] \t\t= 'last_name';\n \t\t$params['display_name'] \t= 'display_name';\n \t\t$params['username'] \t\t= 'username';\n \t\t$params['timezone'] \t\t= 'timezone';\n \t\treturn $params;\n \t}", "public function getOpenLibraryId()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\tif(!array_key_exists('identifiers', $this->data) || !array_key_exists('openlibrary', $this->data['identifiers']))\n\t\t\t\treturn null;\n\t\t\t\n\t\t\treturn $this->data['identifiers']['openlibrary'][0];\n\t\t}", "private static function extractCrid()\n {\n return empty($_GET[\"_crid\"])\n ?\n (empty($_SERVER[\"HTTP_X_CORRELATION_ID\"])\n ?\n bin2hex(random_bytes(8))\n :\n $_SERVER[\"HTTP_X_CORRELATION_ID\"])\n :\n $_GET[\"_crid\"];\n }", "public function getUserId() {\n $response = $this->execute(array('method' => 'flickr.auth.checkToken'), 60);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['auth']['user']['nsid'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n }", "public function obtenerId() {}", "protected function _getPrimaryId()\n {\n return $this->_getParam($this->_getPrimaryIdKey());\n }", "public function findInvoiceId() {\n\t\treturn $this->request->getFiltered('ok_invoice'); \n\t}", "public function getResourceOwnerId() {\n\t\treturn $this->getClaims()['sub'];\n\t}", "function doregisterwithopenid($data, $form) {\n\t\t$openid = trim($data['OpenIDURL']);\n\t\tSession::set(\"FormInfo.Form_RegistrationWithOpenIDForm.data\", $data);\n\n \tif(strlen($openid) == 0) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"Please enter your OpenID or your i-name.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\n\t\t$trust_root = Director::absoluteBaseURL();\n\t\t$return_to_url = $trust_root . $this->Link('processopenidresponse');\n\n\t\t$consumer = new Auth_OpenID_Consumer(new OpenIDStorage(), new SessionWrapper());\n\n\n\t\t// No auth request means we can't begin OpenID\n\t\t$auth_request = $consumer->begin($openid);\n\t\tif(!$auth_request) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"That doesn't seem to be a valid OpenID or i-name identifier. \" .\n\t\t\t\t\t\"Please try again.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\t\t$SQL_identity = Convert::raw2sql($auth_request->endpoint->claimed_id);\n\t\tif($member = Member::get()->filter('IdentityURL', $SQL_identity)->first()) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"That OpenID or i-name is already registered. Use another one.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\n\t\t// Add the fields for which we wish to get the profile data\n \t$sreg_request = Auth_OpenID_SRegRequest::build(null,\n \tarray('nickname', 'fullname', 'email', 'country'));\n\n \tif($sreg_request) {\n\t\t\t$auth_request->addExtension($sreg_request);\n \t}\n\n\n\t\tif($auth_request->shouldSendRedirect()) {\n\t\t\t// For OpenID 1, send a redirect.\n\t\t\t$redirect_url = $auth_request->redirectURL($trust_root, $return_to_url);\n\n\t\t\tif(Auth_OpenID::isFailure($redirect_url)) {\n\t\t\t\tdisplayError(\"Could not redirect to server: \" .\n\t\t\t\t\t\t\t\t\t\t $redirect_url->message);\n\t\t\t} else {\n\t\t\t\treturn $this->redirect($redirect_url);\n\t\t\t}\n\n\t\t} else {\n\t\t\t// For OpenID 2, use a javascript form to send a POST request to the\n\t\t\t// server.\n\t\t\t$form_id = 'openid_message';\n\t\t\t$form_html = $auth_request->formMarkup($trust_root, $return_to_url,\tfalse, array('id' => $form_id));\n\n\t\t\tif(Auth_OpenID::isFailure($form_html)) {\n\t\t\t\tdisplayError(\"Could not redirect to server: \" .$form_html->message);\n\t\t\t} else {\n\t\t\t\t$page_contents = array(\n\t\t\t\t\t \"<html><head><title>\",\n\t\t\t\t\t \"OpenID transaction in progress\",\n\t\t\t\t\t \"</title></head>\",\n\t\t\t\t\t \"<body onload='document.getElementById(\\\"\". $form_id .\n\t\t\t\t\t \"\\\").submit()'>\",\n\t\t\t\t\t $form_html,\n\t\t\t\t\t \"<p>Click &quot;Continue&quot; to login. You are only seeing \" .\n\t\t\t\t\t \"this because you appear to have JavaScript disabled.</p>\",\n\t\t\t\t\t \"</body></html>\");\n\n\t\t\t\tprint implode(\"\\n\", $page_contents);\n\t\t\t}\n\t\t}\n\t}", "function processopenidresponse() {\n\t\t$consumer = new Auth_OpenID_Consumer(new OpenIDStorage(), new SessionWrapper());\n\n\t\t$trust_root = Director::absoluteBaseURL();\n\t\t$return_to_url = $trust_root . $this->Link('ProcessOpenIDResponse');\n\n\t\t// Complete the authentication process using the server's response.\n\t\t$response = $consumer->complete($return_to_url);\n\n\t\tif($response->status == Auth_OpenID_SUCCESS) {\n\t\t\tSession::clear(\"FormInfo.Form_RegistrationWithOpenIDForm.data\");\n\t\t\t$openid = $response->identity_url;\n\n\t\t\tif($response->endpoint->canonicalID) {\n\t\t\t\t$openid = $response->endpoint->canonicalID;\n\t\t\t}\n\n\t\t\t$sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response);\n\t\t\t$sreg = $sreg_resp->contents();\n\n\t\t\t// Convert the simple registration data to the needed format\n\t\t\t// try to split fullname to get firstname and surname\n\t\t\t$data = array('IdentityURL' => $openid);\n\t\t\tif(isset($sreg['nickname']))\n\t\t\t\t$data['Nickname'] = $sreg['nickname'];\n\t\t\tif(isset($sreg['fullname'])) {\n\t\t\t\t$fullname = explode(' ', $sreg['fullname'], 2);\n\t\t\t\tif(count($fullname) == 2) {\n\t\t\t\t\t$data['FirstName'] = $fullname[0];\n\t\t\t\t\t$data['Surname'] = $fullname[1];\n\t\t\t\t} else {\n\t\t\t\t\t$data['Surname'] = $fullname[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($sreg['country']))\n\t\t\t\t$data['Country'] = $sreg['country'];\n\t\t\tif(isset($sreg['email']))\n\t\t\t\t$data['Email'] = $sreg['email'];\n\n\t\t\tSession::set(\"FormInfo.Form_RegistrationForm.data\", $data);\n\t\t\treturn $this->redirect($this->Link('register'));\n\t\t}\n\n\n\t\t// The server returned an error message, handle it!\n\t\tif($response->status == Auth_OpenID_CANCEL) {\n\t\t\t$error_message = _t('ForumMemberProfile.CANCELLEDVERIFICATION','The verification was cancelled. Please try again.');\n\t\t} else if($response->status == Auth_OpenID_FAILURE) {\n\t\t\t$error_message = _t('ForumMemberProfile.AUTHENTICATIONFAILED','The OpenID/i-name authentication failed.');\n\t\t} else {\n\t\t\t$error_message = _t('ForumMemberProfile.UNEXPECTEDERROR','An unexpected error occured. Please try again or register without OpenID');\n\t\t}\n\n\t\t$this->RegistrationWithOpenIDForm()->addErrorMessage(\"Blurb\",\n\t\t\t$error_message, 'bad');\n\n\t\treturn $this->redirect($this->Link('registerwithopenid'));\n\t}", "function get_oauth_identity($wpoa) {\n\t// set the access token param:\n\t$params = array(\n\t\t'access_token' => $_SESSION['WPOA']['ACCESS_TOKEN'], // PROVIDER SPECIFIC: the access_token is passed to Google via POST param\n\t);\n\t$url_params = http_build_query($params);\n\t// perform the http request:\n\tswitch (strtolower(HTTP_UTIL)) {\n\t\tcase 'curl':\n\t\t\t$url = URL_USER . $url_params; // TODO: we probably want to send this using a curl_setopt...\n\t\t\t$curl = curl_init();\n\t\t\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\t\t// PROVIDER NORMALIZATION: Github/Reddit require a User-Agent here...\n\t\t\t// PROVIDER NORMALIZATION: PayPal/Reddit require that we send the access token via a bearer header, PayPal also requires a Content-Type: application/json header, LinkedIn requires an x-li-format: json header...\n\t\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t$result = curl_exec($curl);\n \n\t\t\t$result_obj = json_decode($result, true);\n\t\t\tbreak;\n\t\tcase 'stream-context':\n\t\t\t$url = rtrim(URL_USER, \"?\");\n\t\t\t$opts = array('http' =>\n\t\t\t\tarray(\n\t\t\t\t\t'method' => 'GET',\n\t\t\t\t\t// PROVIDER NORMALIZATION: Reddit/Github requires User-Agent here...\n\t\t\t\t\t'header' => \"Authorization: Bearer \" . $_SESSION['WPOA']['ACCESS_TOKEN'] . \"\\r\\n\" . \"x-li-format: json\\r\\n\", // PROVIDER SPECIFIC: i think only LinkedIn uses x-li-format...\n\t\t\t\t)\n\t\t\t);\n\t\t\t$context = $context = stream_context_create($opts);\n\t\t\t$result = @file_get_contents($url, false, $context);\n\t\t\tif ($result === false) {\n\t\t\t\t$wpoa->wpoa_end_login(\"Sorry, we couldn't log you in. Could not retrieve user identity via stream context. Please notify the admin or try again later.\");\n\t\t\t}\n\t\t\t$result_obj = json_decode($result, true);\n\t\t\tbreak;\n\t}\n\t// parse and return the user's oauth identity:\n \n\t$oauth_identity = array();\n\t$oauth_identity['provider'] = $_SESSION['WPOA']['PROVIDER'];\n\t$oauth_identity['id'] = $result_obj['id']; // PROVIDER SPECIFIC: Google returns the user's OAuth identity as id\n $_SESSION['WPOA']['USERSELF'] = $result_obj;\n\t//$oauth_identity['email'] = $result_obj['emails'][0]['value']; // PROVIDER SPECIFIC: Google returns an array of email addresses. To respect privacy we currently don't collect the user's email address.\n\tif (!$oauth_identity['id']) {\n\t\t$wpoa->wpoa_end_login(\"Sorry, we couldn't log you in. User identity was not found. Please notify the admin or try again later.\");\n\t}\n \n\treturn $oauth_identity;\n}", "public abstract function getIdentity(array $params);", "public function getOpenLibraryID(){\n\t\tReturn $this->ol[\"ISBN:\".$this->isbn][\"identifiers\"][\"openlibrary\"][0];\n\t}", "private function GetUser()\r\n\t\t{\r\n\t\t\tif (!empty($_POST['customer_id']))\r\n\t\t\t\treturn $_POST['customer_id'];\r\n\t\t\t\r\n\t\t\tif (!empty($_GET['customer_id']))\r\n\t\t\t\treturn $_GET['customer_id'];\r\n\t\t}", "public function getTid()\n {\n \treturn $this->getParameter('tid');\n }", "function getUserid(){\n\t\terror_reporting(0);\n\t\tif(!isset($_COOKIE['fbsr_123059651225050'])){\n\t\t\tthrow new Exception('Invalid player');\n\t\t} \n\t\t$data = parse_signed_request($_COOKIE['fbsr_123059651225050']);\n\t\tif($data[\"user_id\"] == null){\n\t\t\tthrow new Exception('Invalid Cookie');\n\t\t}\n\t\treturn $data[\"user_id\"];\n\t}", "public function getAuthIdentifier() {\n return $this->getKey();\n }", "public function get_user_id();", "public function getOauthCode()\n {\n $date = new \\DateTime();\n return $date->getTimestamp();\n }", "public function getJwtId(): string\n {\n return $this->getPayloadClaim('jti');\n }", "public function getOwnerAppIdentity();", "public function getClientId(): string\n {\n return (string) data_get($this->args, 'credentials.id');\n }", "public function getAuthIdentifier()\n {\n\t\treturn $this->getKey();\n\t}", "public abstract function getIdentity();", "public function getAuthAsString();", "public function getAccountingID() {\n return $this->getParameter('accounting_id');\n }", "public function getAccountingID() {\n return $this->getParameter('accounting_id');\n }", "public function getAccountingID() {\n return $this->getParameter('accounting_id');\n }", "function fetchApplicationId()\n{\n if (isset($_GET['application_id'])) {\n $application_id = $_GET['application_id'];\n unset($_GET['application_id']);\n }\n return $application_id;\n}", "public function getAuthIdentifier()\n {\n return $this->attributes[$this->primaryKey];\n }" ]
[ "0.66919035", "0.66919035", "0.6655184", "0.6621862", "0.65798724", "0.63028044", "0.6284274", "0.6138221", "0.6109803", "0.60807216", "0.5939436", "0.58816826", "0.5847615", "0.58355683", "0.5834199", "0.5821775", "0.58125377", "0.57962114", "0.5739659", "0.572749", "0.57165784", "0.5701533", "0.568708", "0.5684448", "0.56644225", "0.56616056", "0.5655753", "0.56408805", "0.5638368", "0.561697", "0.55752987", "0.5556046", "0.5543613", "0.55232555", "0.55152446", "0.5485476", "0.54677415", "0.54676884", "0.5467336", "0.54606634", "0.54410005", "0.54410005", "0.54410005", "0.54410005", "0.5429885", "0.5427317", "0.5422449", "0.54078406", "0.53994787", "0.53948", "0.5376948", "0.53759766", "0.5374966", "0.5371522", "0.5370925", "0.5370925", "0.53653675", "0.5365168", "0.5353135", "0.53482604", "0.53482604", "0.53427106", "0.5341216", "0.5341216", "0.5341216", "0.533824", "0.53378206", "0.5334512", "0.5333343", "0.5330562", "0.53305435", "0.53285444", "0.53232706", "0.532132", "0.5318886", "0.53173655", "0.5315181", "0.5314194", "0.53088653", "0.5305984", "0.52980125", "0.5297955", "0.52932787", "0.5290273", "0.52873474", "0.52858317", "0.5282365", "0.5278725", "0.5277557", "0.5275498", "0.526919", "0.5263249", "0.525881", "0.52572805", "0.5256398", "0.525579", "0.5252625", "0.5252625", "0.5252625", "0.52427924", "0.5241466" ]
0.0
-1
Remove OpenID request parameter
function clear($key) { unset($this->args[$key]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function unbindOpenID($uid, $openid_identifier);", "private function clearParam($param) {\n return str_replace(self::REQUIRED_PARAM,\"\",$param);\n }", "private function resetParams()\n {\n $this->id = null;\n }", "function remove_query_arg($key, $query = \\false)\n {\n }", "abstract public function removeAuthToken();", "function UnsetRequest()\n {\n \n unset($_REQUEST[\"mco_proveedores__PVE_ID\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_NOMBRE\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_DIRECCION\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_TELEFONO\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_CELULAR\"]);\n unset($_REQUEST[\"mco_proveedores__PVE_EMAIL\"]);\n }", "function unsetInternalParams($params)\n{\n unset($params['_url']);\n unset($params['_token']);\n unset($params['_method']);\n\n return $params;\n}", "function cleanQueryString(&$request){\n\tdelParam($request, 'pag');\n\tdelParam($request, 'first');\n\tdelParam($request, 'previous');\n\tdelParam($request, 'next');\n\tdelParam($request, 'last');\n\tdelParam($request, 'reload');\n\tdelParam($request, 'numpags');\n\tdelParam($request, 'regspag');\n}", "function cjpopups_remove_querystring_var($url, $key) {\n\t$url = preg_replace('/(.*)(?|&)' . $key . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&');\n\t$url = substr($url, 0, -1);\n\treturn $url;\n}", "public function unsetRequest(): void;", "function getOpenIDURL() {\n\t// value.\n\n\tif (substr($_POST[ssoInpUsername], 0, 4) == \"http\") {\n\t\t$tmpuri = $_POST[ssoInpUsername];\n\t} else {\n\t\tif (in_array(strtolower(trim($_POST[ssoInpUsername])), $GLOBALS[oldusers])) {\n\t\t\tsysmsg (\"User with old OpenID logged in: \".$_POST[ssoInpUsername], 1);\n\t\t\t$tmpuri = $GLOBALS[cfg][old_openid_identifier_base].$_POST[ssoInpUsername];\n\t\t} else {\n\t\t\t$tmpuri = $GLOBALS[cfg][openid_identifier_base].$_POST[ssoInpUsername];\n\t\t}\n\t}\n\t$_SESSION[openid_identifier] = $tmpuri;\n\n\tif (empty($tmpuri)) {\n\t\tsysmsg (\"Expected an OpenID URL.\", 1);\n\t\theader('X-JSON: '.json_encode($GLOBALS[myreturn]).')');\n\t\techo json_encode($GLOBALS[myreturn]);\n\t\texit(0);\n\t}\n\treturn $tmpuri;\n}", "function clean_request_uri($uri) {\n if (FALSE !== ($pos = strpos($uri, '?'))) {\n $uri = substr($uri, 0, $pos);\n }\n return ltrim($uri, '/');\n }", "function upload_sanitize_identifier($identifier) {\n\treturn preg_replace('/[^0-9a-zA-Z_-]/im', '', $identifier);\n}", "public function resetRequestIds()\n {\n foreach ($this->options as $op => $junk) {\n if (preg_match('#ReportRequestIdList#', $op)) {\n unset($this->options[$op]);\n }\n }\n }", "function rest_sanitize_request_arg($value, $request, $param)\n {\n }", "function emr_maybe_remove_query_string( $url ) {\n\t$parts = explode( '?', $url );\n\n\treturn reset( $parts );\n}", "public static function url_remove_credentials($url)\n {\n }", "function elgg_http_remove_url_query_element($url, $element) {\n\t$url_array = parse_url($url);\n\n\tif (isset($url_array['query'])) {\n\t\t$query = elgg_parse_str($url_array['query']);\n\t} else {\n\t\t// nothing to remove. Return original URL.\n\t\treturn $url;\n\t}\n\n\tif (array_key_exists($element, $query)) {\n\t\tunset($query[$element]);\n\t}\n\n\t$url_array['query'] = http_build_query($query);\n\t$string = elgg_http_build_url($url_array);\n\treturn $string;\n}", "function unsetID( )\n {\n unset( $this->ID );\n }", "public function getOpenId()\n {\n }", "function simpleid_process_openid($request) {\n global $version;\n \n $version = openid_get_version($request);\n \n switch ($request['openid.mode']) {\n case 'associate':\n simpleid_associate($request);\n return;\n case 'checkid_immediate':\n case 'checkid_setup':\n return simpleid_checkid($request);\n case 'check_authentication':\n simpleid_check_authentication($request);\n break;\n default:\n if (isset($request['openid.return_to'])) {\n // Indirect communication - send error via indirect communication.\n header_response_code('404 Bad Request');\n set_message('Invalid OpenID message.');\n page_dashboard();\n } else {\n // Direct communication\n openid_direct_error('Invalid OpenID message.');\n }\n }\n}", "function fetchApplicationId()\n{\n if (isset($_GET['application_id'])) {\n $application_id = $_GET['application_id'];\n unset($_GET['application_id']);\n }\n return $application_id;\n}", "public static function removeUrlParam($url, $varname) {\n list($urlpart, $qspart) = array_pad(explode('?', $url), 2, '');\n parse_str($qspart, $qsvars);\n unset($qsvars[$varname]);\n $newqs = http_build_query($qsvars);\n if(empty($newqs)) {\n return $urlpart;\n } else {\n return $urlpart . '?' . $newqs;\n }\n }", "static function FilterHTTPParameter($value) {\n return @eregi_replace('[^0-9A-Za-z]', '', $value);\n }", "public function testRemoveTokenWithPayerIdEmpty(){\n\t\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\n\t\tEnvironment::setPaymentsCustomUrl(PayUTestUtil::PAYMENTS_CUSTOM_URL);\n\t\n\t\t$responseCreditCardToken = PayUTestUtil::createToken();\n\t\n\t\t$parametersBasicTokenRequest = PayUTestUtil::buildBasicParametersToken();\n\t\n\t\t$parametersBasicTokenRequest[PayUParameters::PAYER_ID]= \"\";\n\t\n\t\t$parameters = array_merge($parametersBasicTokenRequest,array(PayUParameters::TOKEN_ID => $responseCreditCardToken->creditCardToken->creditCardTokenId));\n\t\n\t\t$response = PayUTokens::remove($parameters);\n\t\n\t}", "function acadp_remove_query_arg( $key, $query = false ) {\n\n\tif( is_array( $key ) ) { // removing multiple keys\n\t\tforeach( $key as $k ) {\n\t\t\t$query = str_replace( '#038;', '&', $query );\n\t\t\t$query = add_query_arg( $k, false, $query );\n\t\t}\n\n\t\treturn $query;\n\t}\n\n\treturn add_query_arg( $key, false, $query );\n\n}", "function remove_query_strings( $src ) {\n if( strpos( $src, '?ver=' ) )\n $src = remove_query_arg( 'ver', $src );\n return $src;\n}", "public function resetId(){\r\n\t\t$this->clientId = null;\r\n\t}", "private function cleanParams(){\n $brokenUrl = explode(\"&\", iWeb::currentUrl());\n unset($brokenUrl[0]);\n $brokenUrl = array_values($brokenUrl);\n foreach ($brokenUrl as $param){\n $paramaters = explode(\"=\",$param);\n $this->params[$paramaters[0]] = $paramaters[1];\n }\n\n }", "function bypass_reauth($login_url) {\n $login_url = remove_query_arg('reauth', $login_url);\n\n return $login_url;\n }", "public function __unset($param)\r\n {\r\n $this->params_named->remove($param);\r\n }", "function stripTag($id, $length)\n{\n if (func_num_args() != 2)\n {\n throw new BadFunctionCallException(\"Not the correct number of inputs to stripTag\");\n }\n \n // Return null if empty rather than attempting to strip the tag\n if ($id == NULL)\n {\n return NULL;\n }\n \n // Check types of parameters\n if (!is_string($id) || !is_int($length))\n {\n throw new BadFunctionCallException(\"Invalid parameter type.\");\n }\n \n return substr($id, 0, $length);\n}", "private function parseSteamID() : void\n {\n $queryParams = $this->request->getQueryParams();\n preg_match('#^https?://'.$this->getOpenIdUrl(false).'/id/([0-9]{17,25})#', array_get($queryParams,'openid_claimed_id'), $matches);\n $this->steamId = is_numeric($matches[1]) ? $matches[1] : 0;\n }", "public static function removeIdentity() {\n\t\tCore_Store::remove('identity');\n\t}", "public function clearIdentity() {\n\n }", "public function cancelRequestOfUserForReceivedApprovedRequest() {\n extract($_GET);\n $gender = $this->session->userdata('key_gender');\n $encodedkey = $this->session->userdata('PariKey_session');\n $key = base64_decode($encodedkey);\n $keyarr = explode('|', $key);\n $sessionUser_id = $keyarr[2];\n $result = $this->Searchbyprofileid_model->cancelRequestOfUserForReceivedApprovedRequest($profile_user_id, $sessionUser_id, $gender);\n// print_r($result);\n// die();\n if ($result == 200) {\n echo 200;\n } else {\n echo 500;\n }\n }", "public function clear_virtual_user_id();", "public static function UnwantedParameters($chars = array())\n {\n global $application_unwanted_params;\n $application_unwanted_params = $chars;\n }", "function release_token(){\n if(!isset($_GET[$this->name])) {\n header(\"Status: 302 Moved Temporarily\");\n $this->get_id($sid);\n header(\"Location: http://\".$_SERVER['HTTP_HOST'].$this->self_url());\n exit;\n } \n }", "public function __unset($name)\n {\n if (! array_key_exists($name, $this->userParams)) {\n return;\n }\n\n unset($this->userParams[$name]);\n }", "function url_with_auth_token($url) {\n // use global $query_params that was initialized during auth check on page load\n global $query_params;\n\n // no auth info, return original url\n if ($query_params['token'] == \"\" || $query_params['uuid'] == \"\") {\n echo $url;\n return;\n }\n\n $uri_parts = explode('?', $url, 2);\n if (isset($uri_parts[1]) && ($uri_parts[1] == \"\")) {\n $url .= \"?\";\n } else {\n $url .= \"&\";\n }\n\n $url .= \"token=\".$query_params['token'].\"&uuid=\".$query_params['uuid'];\n echo $url;\n}", "protected function getAuthParam(){\n\t\treturn '?key=' . $this->key . '&token=' . $this->token;\n\t}", "public function getRemoveUrl()\n {\n\n $request = $this->request;\n $currentValue = $this->getValue();\n $requestValue = $this->getFilter()->getRequestVar();\n\t $requestParam = $request->getParam($requestValue);\n\t $params = $request->getParams();\n unset($params['p']);\n $request->setParams($params);\n\t if(isset($requestParam)){\n\t // make requestParam to be an array if it is not null\n $requestParam = is_array($requestParam)?$requestParam:[$requestParam];\n $currentValue = is_array($currentValue)?$currentValue:[$currentValue];\n // consider the last id of currentValue to be the current attribute id\n $currentParam = [end($currentValue)];\n // compute the difference of the request against 2 arrays, and use the difference to be remove url\n $removeValue = array_diff($requestParam,$currentParam);\n $query = [$this->getFilter()->getRequestVar() => $removeValue];\n $params['_current'] = true;\n $params['_use_rewrite'] = true;\n $params['_query'] = $query;\n $params['_escape'] = true;\n return $this->_url->getUrl('*/*/*', $params);\n }else{\n\t return parent::getRemoveUrl();\n }\n }", "public function cancelRequestOfUserForReceived() {\n extract($_GET);\n $gender = $this->session->userdata('key_gender');\n $encodedkey = $this->session->userdata('PariKey_session');\n $key = base64_decode($encodedkey);\n $keyarr = explode('|', $key);\n $sessionUser_id = $keyarr[2];\n $result = $this->Searchbyprofileid_model->cancelRequestOfUserForReceived($profile_user_id, $sessionUser_id, $gender);\n// print_r($result);\n// die();\n if ($result == 200) {\n echo 200;\n } else {\n echo 500;\n }\n }", "function media_theplatform_mpx_expire_token() {\n $url = 'https://identity.auth.theplatform.com/idm/web/Authentication/signOut?schema=1.0&form=json&_token=' . media_theplatform_mpx_variable_get('token');\n $result = drupal_http_request($url); \n}", "function remove_utm($url) {\r\n\treturn preg_replace(\"/&?utm_(.*?)\\=[^&]+/\",\"\", $url);\r\n}", "function removeURLQuery($query){\n\t\tif(is_array($query)){\n\t\t\tforeach ($query as $v){\n\t\t\t\tremoveURLQuery($v);\n\t\t\t}\n\t\t}\n\t\t$get = $_GET;\n\t\tif(array_key_exists($query, $get)) {\n\t\t\tunset($get[$query]);\n\t\t} \n\t\treturn $get;\n\t}", "public static function removeParam($paramName, $uri=null){\n if(is_null($uri)){\n $uri = $_SERVER['REQUEST_URI'];\n }\n\n $paramArr = [];\n parse_str( parse_url($uri, PHP_URL_QUERY), $paramArr);\n\n if( isset($paramArr[$paramName]) ){\n unset($paramArr[$paramName]);\n\n //rebuild the uri\n $uri = strtok($uri, '?');\n if (!empty($paramArr)) {\n $uri .= '?'.http_build_query($paramArr);\n }\n }\n\n return $uri;\n }", "public static function URLClear() {\n $urlCourante = $_SERVER[\"REQUEST_URI\"];\n $urlGet = explode(\"?\", $urlCourante);\n return $urlGet[0];\n }", "public function removeAccessToken();", "function db_removeAuthEntry($auth_id)\n{\n $auth_id = db_esc($auth_id);\n db_run(\"DELETE FROM \".TBL_AUTH.\" WHERE auth_id='$auth_id'\");\n}", "public function unidid(){\n $token = \"\";\n $codes = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n $codes .= \"abcdefghijklmnopqrstuvwxyz\";\n $codes .= \"0123456789\";\n $max = strlen($codes);\n for($i=0; $i < 15; $i++){\n $token.= $codes[random_int(0, $max-1)];\n }\n return $token;\n }", "public function clearReplacementId($name);", "protected function _getSeoObjectId()\n {\n return oxRegistry::getConfig()->getRequestParameter('oxcid');\n }", "function remove_query( $key, $value ) {\r\n\t\t\t$this->current_url = remove_query_arg( $key, $this->current_url );\r\n\t\t\treturn $this->current_url;\r\n\t\t}", "private function clearRequest(AuthorizationRequest $request)\n {\n /** @var Client $client */\n $client = $request->getClient();\n $clientId = $client->getClientKey();\n $this->session->remove(\"authn_request.$clientId\");\n }", "public function cancelRequestOfUser() {\n extract($_GET);\n $gender = $this->session->userdata('key_gender');\n $encodedkey = $this->session->userdata('PariKey_session');\n $key = base64_decode($encodedkey);\n $keyarr = explode('|', $key);\n $sessionUser_id = $keyarr[2];\n $result = $this->Searchbyprofileid_model->cancelRequestOfUser($profile_user_id, $sessionUser_id, $gender);\n// print_r($result);\n// die();\n\n if ($result == 200) {\n echo 200;\n } else {\n echo 500;\n }\n }", "public function getUserIDByOpenID($openid_identifier);", "private function cleanRequestURI()\r\n\t{\r\n\t\tfor ($i = 0; $i < sizeof($this->scriptPath); $i++)\r\n\t\t{\r\n\t\t\tif ($this->explodedURI[$i] == $this->scriptPath[$i])\r\n\t\t\t{\r\n\t\t\t\tunset($this->explodedURI[$i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->explodedURI = array_values($this->explodedURI);\r\n\t}", "protected function stripParams(string $requestUri): string\n {\n $aParts = explode('?', $requestUri);\n $res = trim($aParts[0], '/');\n return $res;\n }", "public function remove_query_var($name)\n {\n }", "public function cancelRequest(){\n //the other users Id\n $otherUserId = $_POST[\"otherUserId\"];\n //deletes the record in the database\n $this->individualGroupModel->cancelGroupRequestInvitation($otherUserId); \n //redirects\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }", "public function unsetID () {\n\t\treturn $this->unsetData(\"pageID\");\n\t}", "function affwp_remove_query_args( $query_args ) {\n\t// Prevent certain repeated AffWP actions on refresh.\n\tif ( isset( $_GET['_wpnonce'] )\n\t\t&& (\n\t\t\tisset( $_GET['affiliate_id'] )\n\t\t\t|| isset( $_GET['creative_id'] )\n\t\t\t|| isset( $_GET['referral_id'] )\n\t\t\t|| isset( $_GET['visit_id'] )\n\t )\n\t) {\n\t\t$query_args[] = '_wpnonce';\n\t}\n\n\treturn $query_args;\n}", "private static function filter_params($path){\n\t\tforeach($path as $key => $value){\n\t\t\tif(strpos($path[$key],\"?\") !== false) $path[$key] = substr($path[$key],0,strpos($path[$key],\"?\"));\n\t\t\tif(empty($path[$key])){ \n\t\t\t\tunset($path[$key]);\n\t\t\t}\n\t\t}\n\t\treturn $path;\n\t}", "public function setUrlIdToken() {}", "function _remove_query_strings_1( $src ){\n\t$rqs = explode( '?ver', $src );\n return $rqs[0];\n}", "protected static function removeQueryString($url)\n {\n // echo $url;\n if($url)\n {\n $params = explode('&', $url, 2); // debug($params);\n if(strpos($params[0], '=') === false) // page/part1..\n {\n return rtrim($params[0], '/');\n }else{ // page = something\n return '';\n }\n }\n\n }", "private function getRequestIndividualId()\n {\n return $this->requestIndividualId;\n }", "function hook_openid_connect_userinfo_claim_alter(&$claim_value, array $context) {\n // Alter only, when the claim comes from the 'generic' identiy provider and\n // the property is 'telephone'.\n if (\n $context['plugin_id'] != 'generic'\n || $context['property_name'] != 'telephone'\n ) {\n return;\n }\n\n // Replace international number indicator with double zero.\n str_replace('+', '00', $claim_value);\n}", "public function resetMarketplaceFilter()\n {\n foreach ($this->options as $op => $junk) {\n if (preg_match(\"#MarketplaceId#\", $op)) {\n unset($this->options[$op]);\n }\n }\n }", "public function delIdentity()\n\t{\n\t\t// Verifier l'adhesion\n\t\t$q = new Bn_query('u2a', '_asso');\n\t\t$q->setFields('u2a_adherentid');\n\t\t$q->addWhere('u2a_userid='. $this->getVal('id', -1));\n\t\t$adheId = $q->getOne();\n\t\t$q->deleteRow();\n\t\t$q->setTables('adherents');\n\t\t$q->deleteRow('adhe_id=' . $adheId);\n\t}", "public function removeCredential($id): void;", "public function testRemoveTokenWithDifferentPayerId(){\n\t\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\n\t\tEnvironment::setPaymentsCustomUrl(PayUTestUtil::PAYMENTS_CUSTOM_URL);\n\t\n\t\t$responseCreditCardToken = PayUTestUtil::createToken();\n\t\n\t\t$parametersBasicTokenRequest = PayUTestUtil::buildBasicParametersToken();\n\t\t\n\t\t$parametersBasicTokenRequest[PayUParameters::PAYER_ID]= \"Payer_id_555\";\n\t\n\t\t$parameters = array_merge($parametersBasicTokenRequest,array(PayUParameters::TOKEN_ID => $responseCreditCardToken->creditCardToken->creditCardTokenId));\n\t\n\t\t$response = PayUTokens::remove($parameters);\n\t\n\t}", "function delete_identifier() {\n\n $serv = \\Factory::getUserService();\n\n $currentIdString = Get_User_Principle();\n $currentUser = $serv->getUserByPrinciple($currentIdString);\n\n if ($currentUser === null) {\n throw new \\Exception(\"Unregistered users cannot edit users\");\n }\n\n // Check the portal is not in read only mode, returns exception if it is and user is not an admin\n checkPortalIsNotReadOnlyOrUserIsAdmin($currentUser);\n\n // Get the posted data\n $userId = $_REQUEST['id'];\n $identifierId = $_REQUEST['identifierId'];\n\n $user = $serv->getUser($userId);\n $identifier = $serv->getIdentifierById($identifierId);\n\n // Throw exception if not a valid user ID\n if (is_null($user)) {\n throw new \\Exception(\"A user with ID '\" . $userId . \"' cannot be found\");\n }\n\n $serv->editUserAuthorization($user, $currentUser);\n\n // Throw exception if not a valid identifier ID\n // Non-admins can't tell if a given identifier matches a specific user\n // but they can currently still tell how many identifiers exist\n // This could be changed to only give info about if the identifier matches one of theirs\n if (is_null($identifier)) {\n throw new \\Exception(\"An identifier with ID '\" . $identifierId . \"' cannot be found\");\n }\n\n // Throw exception if trying to remove identifier that current user is authenticated with\n if ($identifier->getKeyValue() === $currentIdString) {\n throw new \\Exception(\"You cannot unlink your current ID string. Please log in using a different authentication mechanism and try again.\");\n }\n\n $params = array('ID' => $user->getId());\n\n try {\n // Function will throw error if user does not have the correct permissions\n $serv->deleteUserIdentifier($user, $identifier, $currentUser);\n show_view(\"user/deleted_user_identifier.php\", $params);\n } catch (Exception $e) {\n show_view('error.php', $e->getMessage());\n die();\n }\n}", "public function clear()\n {\n unset($this->_params);\n }", "function strip_url( $url ) {\n\t\t\t$id_match = '[0-9a-zA-Z\\-_]+';\n\t\t\tif ( preg_match( '|https?://(www\\.)?youtube\\.com/(watch)?\\?.*v=(' . $id_match . ')|', $url, $matches ) )\n\t\t\t\t$id = $matches[3];\n\t\t\telse if ( preg_match( '|https?://(www\\.)?youtube(-nocookie)?\\.com/embed/(' . $id_match . ')|', $url, $matches ) )\n\t\t\t\t$id = $matches[3];\n\t\t\telse if ( preg_match( '|https?://(www\\.)?youtube\\.com/v/(' . $id_match . ')|', $url, $matches ) )\n\t\t\t\t$id = $matches[2];\n\t\t\telse if ( preg_match( '|http://youtu\\.be/(' . $id_match . ')|', $url, $matches ) )\n\t\t\t\t$id = $matches[1];\n\t\t\telse if ( !preg_match( '|^http|', $url, $matches ) )\n\t\t\t\t$id = $url;\n\t\t\t\n\t\t\treturn $id;\n\t\t}", "function wp_revoke_user($id)\n {\n }", "function _cleancurl($x){\n return ltrim(chop($x,'}'),'{');\n }", "public static function remove(&$object, $key) {\n\t\t\t$qarray = \\uri\\generate::query_array($object);\n\t\t\tif (isset($qarray[$key])) {\n\t\t\t\tunset($qarray[$key]);\n\t\t\t\t\\uri\\actions::modify($object, 'replace', 'QUERY', self::build_query($qarray));\n\t\t\t}\n\t\t}", "public function getIdParameter(): string;", "public function query_remove($key) {\n\t\t\t\\uri\\query::remove($this->object, $key);\n\t\t}", "public function unFollowUserProfile() {\n extract($_GET);\n $gender = $this->session->userdata('key_gender');\n $encodedkey = $this->session->userdata('PariKey_session');\n $key = base64_decode($encodedkey);\n $keyarr = explode('|', $key);\n $sessionUser_id = $keyarr[2];\n $result = $this->Searchbyprofileid_model->unFollowUserProfile($profile_user_id, $sessionUser_id, $gender);\n// print_r($result);\n// die();\n if ($result == 200) {\n echo 200;\n } else {\n echo 500;\n }\n }", "public function setPaymentMethodIdAttribute($input)\n {\n $this->attributes['payment_method_id'] = $input ? $input : null;\n }", "function reset_instagram_access_token ( $params = array() ) {\n ob_end_clean();\n $success = $this->model->set_instagram_access_token();\n if ( $success ) {\n wp_redirect( add_query_arg( array( 'page' => $this->page . '&instagram_token=' . time() ), admin_url( 'admin.php' ) ) );\n }\n }", "private function parseRequestParams($req){\n\t $req = str_replace(\"__JOBID__\", $this->job_id, $req);\n\t return $req;\n }", "function decode_id ($id_encoded) {\n return base64_decode($id_encoded) / config('secure.tokenNumber');\n }", "function clear_token($token)\n{\n global $DB_connect;\n\n $statement = $DB_connect->prepare(\"UPDATE db.user set token = NULL WHERE token = :token\");\n $statement->execute(['token' => $token]);\n}", "public function disableTwoFactorWithRequest($userId, $request)\n {\n return $this->start()->uri(\"/api/user/two-factor\")\n ->urlSegment($userId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->delete()\n ->go();\n }", "function doregisterwithopenid($data, $form) {\n\t\t$openid = trim($data['OpenIDURL']);\n\t\tSession::set(\"FormInfo.Form_RegistrationWithOpenIDForm.data\", $data);\n\n \tif(strlen($openid) == 0) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"Please enter your OpenID or your i-name.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\n\t\t$trust_root = Director::absoluteBaseURL();\n\t\t$return_to_url = $trust_root . $this->Link('processopenidresponse');\n\n\t\t$consumer = new Auth_OpenID_Consumer(new OpenIDStorage(), new SessionWrapper());\n\n\n\t\t// No auth request means we can't begin OpenID\n\t\t$auth_request = $consumer->begin($openid);\n\t\tif(!$auth_request) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"That doesn't seem to be a valid OpenID or i-name identifier. \" .\n\t\t\t\t\t\"Please try again.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\t\t$SQL_identity = Convert::raw2sql($auth_request->endpoint->claimed_id);\n\t\tif($member = Member::get()->filter('IdentityURL', $SQL_identity)->first()) {\n\t\t\tif(!is_null($form)) {\n \t\t\t$form->addErrorMessage(\"Blurb\",\n\t\t\t\t\t\"That OpenID or i-name is already registered. Use another one.\",\n\t\t\t\t\t\"bad\");\n\t\t\t}\n\t\t\treturn $this->redirectBack();\n\t\t}\n\n\n\t\t// Add the fields for which we wish to get the profile data\n \t$sreg_request = Auth_OpenID_SRegRequest::build(null,\n \tarray('nickname', 'fullname', 'email', 'country'));\n\n \tif($sreg_request) {\n\t\t\t$auth_request->addExtension($sreg_request);\n \t}\n\n\n\t\tif($auth_request->shouldSendRedirect()) {\n\t\t\t// For OpenID 1, send a redirect.\n\t\t\t$redirect_url = $auth_request->redirectURL($trust_root, $return_to_url);\n\n\t\t\tif(Auth_OpenID::isFailure($redirect_url)) {\n\t\t\t\tdisplayError(\"Could not redirect to server: \" .\n\t\t\t\t\t\t\t\t\t\t $redirect_url->message);\n\t\t\t} else {\n\t\t\t\treturn $this->redirect($redirect_url);\n\t\t\t}\n\n\t\t} else {\n\t\t\t// For OpenID 2, use a javascript form to send a POST request to the\n\t\t\t// server.\n\t\t\t$form_id = 'openid_message';\n\t\t\t$form_html = $auth_request->formMarkup($trust_root, $return_to_url,\tfalse, array('id' => $form_id));\n\n\t\t\tif(Auth_OpenID::isFailure($form_html)) {\n\t\t\t\tdisplayError(\"Could not redirect to server: \" .$form_html->message);\n\t\t\t} else {\n\t\t\t\t$page_contents = array(\n\t\t\t\t\t \"<html><head><title>\",\n\t\t\t\t\t \"OpenID transaction in progress\",\n\t\t\t\t\t \"</title></head>\",\n\t\t\t\t\t \"<body onload='document.getElementById(\\\"\". $form_id .\n\t\t\t\t\t \"\\\").submit()'>\",\n\t\t\t\t\t $form_html,\n\t\t\t\t\t \"<p>Click &quot;Continue&quot; to login. You are only seeing \" .\n\t\t\t\t\t \"this because you appear to have JavaScript disabled.</p>\",\n\t\t\t\t\t \"</body></html>\");\n\n\t\t\t\tprint implode(\"\\n\", $page_contents);\n\t\t\t}\n\t\t}\n\t}", "private function getParams()\n {\n $queryParams = $this->request->getQueryParams();\n\n $params = [\n 'openid.assoc_handle' => array_get($queryParams,self::OPENID_ASSOC_HANDLE),\n 'openid.signed' => array_get($queryParams,self::OPENID_SIGNED),\n 'openid.sig' => array_get($queryParams,self::OPENID_SIG),\n 'openid.ns' => self::OPENID_NS,\n 'openid.mode' => 'check_authentication',\n ];\n\n $signedParams = explode(',', array_get($queryParams,self::OPENID_SIGNED));\n\n foreach ($signedParams as $item) {\n $value = array_get($queryParams,'openid_'.str_replace('.', '_', $item));\n $params['openid.'.$item] = $value;\n }\n\n return $params;\n }", "function openid_normalize_url_as_username($openid_url) {\n $username = eregi_replace('[^a-z0-9]', '', $openid_url);\n $username = substr($username, 0, 90); // Keep it within limits of schema\n $username_tmp = $username;\n $i = 1;\n\n while (record_exists('user', 'username', $username)) {\n $username = $username_tmp.$i++;\n }\n\n return $username;\n}", "public function cleanUri(){\n return preg_replace('/[^\\da-z\\-\\/\\_]/i', '', filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL));\n }", "public function removeParameters()\n {\n return [\n 'collection' => $this->collection->cart_name,\n 'id' => $this->cart_hash\n ];\n }", "public function delete( $oid=null );", "function protectLink($link) {\n\t\tif(strpos($link,\"?\")) return $link.\"&spack_token=\".$this->token;\n\t\telse return $link.\"?spack_token=\".$this->token;\n\t}", "public function remove($encoded_id)\n\t{\n\t\t$id = base64_decode(urldecode($encoded_id));\n\t\t\n\t\tif(empty($id))\n\t\t{\n\t\t\tredirect(website_url('users'));\n\t\t}\n\t\tif(!empty($id))\n\t\t{\n\t\t\t// Delete user record\n\t\t\t\n\t\t\t$row = $this->client_model->deleteUser($id);\n\t\t\t$this->message->set('success', 'Client deleted successfully', TRUE, 'message');\n\t\t\tredirect(website_url('users'));\t\n\t\t}\t\n\t}", "function wp_oembed_remove_provider($format)\n {\n }", "public function getIdWithoutNs($id){\n return noNS($id);\n }", "public static function removeIdSuffix($key)\n {\n self::initialize();\n\n if (self::endsWith($key, self::$FILTER_ID_INDICATOR)) {\n return substr($key, 0, strlen($key) - 3);\n }\n\n return $key;\n }", "function clean_url($url) {\n\n global $globals;\n\n //Remove the AEF Session Code - Also there in parse_br function\n $url = preg_replace('/(\\?|&amp;|;|&)(as=[\\w]{32})(&amp;|;|&|$)?/is', '$1$3', $url);\n\n return $url;\n}" ]
[ "0.59709996", "0.56573135", "0.5618431", "0.55569035", "0.5447615", "0.54240555", "0.5382735", "0.5345631", "0.532915", "0.5294794", "0.5271827", "0.526978", "0.5267027", "0.52315634", "0.5221512", "0.5199992", "0.5192864", "0.51904815", "0.5176107", "0.5130429", "0.5126567", "0.51226956", "0.51176405", "0.5089928", "0.50885916", "0.5057663", "0.5047128", "0.50412226", "0.5035628", "0.5034965", "0.5030827", "0.5022573", "0.5017922", "0.5008884", "0.49867034", "0.4975945", "0.49378264", "0.49261382", "0.49110952", "0.48837638", "0.48669267", "0.4845916", "0.4839628", "0.48375317", "0.48349825", "0.48328325", "0.48262018", "0.48259163", "0.4825814", "0.48158413", "0.4812668", "0.48098278", "0.48003948", "0.48001552", "0.47890404", "0.47636092", "0.4754554", "0.47543418", "0.4745047", "0.4739757", "0.47330785", "0.47327498", "0.47241873", "0.47228593", "0.471346", "0.4711659", "0.47086197", "0.47077808", "0.47056007", "0.47047713", "0.47047517", "0.4701603", "0.4694093", "0.46845472", "0.46774682", "0.46560103", "0.46491396", "0.46477753", "0.46454024", "0.46444947", "0.46443304", "0.46434766", "0.4637694", "0.46370798", "0.46360713", "0.46358338", "0.4634329", "0.4631088", "0.46291545", "0.46259052", "0.4623973", "0.4616958", "0.46115974", "0.46082765", "0.46011445", "0.45989788", "0.45931384", "0.4592444", "0.45921916", "0.4588231", "0.4587218" ]
0.0
-1
/ This PHP file contains Cookie Ultilities Accessing Cookies with PHP
function getCookiesInfo(){ echo "Cookies information: <br>"; if( isset($_COOKIE["name"])){ echo "_COOKIE[\"name\"]: " . $_COOKIE["name"] . "<br />"; } else{ echo "Sorry... _COOKIE[\"name\"] is not set yet !" . "<br />"; } //echo "HTTP_COOKIE_VARS[\"name\"]: " . $HTTP_COOKIE_VARS["name"]. "<br />"; //echo "_COOKIE[\"age\"]: " . $_COOKIE["age"] . "<br />"; //echo "HTTP_COOKIE_VARS[\"name\"]: " . $HTTP_COOKIE_VARS["name"] . "<br />"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_cookies()\n {\n }", "function doCookies() {\r\n setcookie(\"cli_num\", 123456789, time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_fname\", $_POST['first_name'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_lname\", $_POST['last_name'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_dob\", $_POST['dob'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_email\", $_POST['email'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_phone\", $_POST['phone'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_add\", $_POST['address'], time() + (86400 * 1), \"/\");\r\n \r\n /* //print the cookies\r\n echo \"Value is: \" . $_COOKIE[\"cli_num\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_fname\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_lname\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_dob\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_email\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_phone\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_add\"];*/\r\n \r\n}", "public function getCookies()\n {\n\n }", "function Cookies()\n{\n //en bewaar zijn antwoord in een sessievariabele\n\n\n //check of eerder al een antwoord ivm de cookies opgeslagen werd in de sessievariabele,\n //zoniet toon dan de cookies-tekst en stop de PHP code uitvoering\n\n //toon in een hidden div waarop de gebruiker geklikt heeft (cookies geaccepteerd of niet)\n\n}", "function setcookies()\n\t{\n\t\tfor($x=0; $x<count($this->headers); $x++)\n\t\t{\n\t\tif(preg_match('/^set-cookie:[\\s]+([^=]+)=([^;]+)/i', $this->headers[$x],$match))\n\t\t\t$this->cookies[$match[1]] = urldecode($match[2]);\n\t\t}\n\t}", "public function getCookieVariables();", "function ms_cookie_constants()\n {\n }", "public function getCookie(): array;", "function getCookie($username, $pass) {\n\t\t\t\tglobal $botinfo, $clientinfo, $Crono;\n\t\tconsole( \"Attempting to get Certificate.. \", \"Core\");\n\t\t// Method to get the cookie! Yeah! :D\n\t\t// Our first job is to open an SSL connection with our host.\n\t\t$this->socket = fsockopen(\"ssl://www.deviantart.com\", 443);\n\t\tconsole( \"[Cookie] - Opened socket!\", \"Core\");\n\t\t// If we didn't manage that, we need to exit!\n\t\tif($this->socket === false) {\n\t\tconsole( \"Error: Please check your internet connection!\", \"Core\");\n\t\t}\n\t\t// Fill up the form payload\n\t\t$POST = '&username='.urlencode($username);\n\t\t$POST.= '&password='.urlencode($pass);\n\t\t$POST.= '&remember_me=1';\n\t\t// And now we send our header and post data and retrieve the response.\n\t\t$response = $this->send_headers(\n\t\t\t$this->socket,\n\t\t\t\"www.deviantart.com\",\n\t\t\t\"/users/login\",\n\t\t\t\"http://www.deviantart.com/users/rockedout\",\n\t\t\t$POST\n\t\t);\n\t \n\t\t// Now that we have our data, we can close the socket.\n\t\tfclose ($this->socket);\n\t\t// And now we do the normal stuff, like checking if the response was empty or not.\n\t\tif(empty($response))\n\t\treturn 'No response returned from the server';\n\t\tif(stripos($response, 'set-cookie') === false)\n\t\treturn 'No cookie returned';\n\t\t// Grab the cookies from the header\n\t\t$response=explode(\"\\r\\n\", $response);\n\t\t$cookie_jar = array();\n\t\tforeach ($response as $line)\n\t\t\tif (strpos($line, \"Set-Cookie:\")!== false)\n\t\t\t\t$cookie_jar[] = substr($line, 12, strpos($line, \"; \")-12);\n\n\t\t// Using these cookies, we're gonna go to chat.deviantart.com and get\n\t\t// our authtoken from the dAmn client.\n\t\tif (($this->socket = @fsockopen(\"ssl://www.deviantart.com\", 443)) == false)\n\t\t return 'Could not open an internet connection';\n\n\t\t$response = $this->send_headers(\n\t\t\t$this->socket,\n\t\t\t\"chat.deviantart.com\",\n\t\t\t\"/chat/\",\n\t\t\t\"http://chat.deviantart.com\",\n\t\t\tnull,\n\t\t\t$cookie_jar\n\t\t);\n\n\t\t// Now search for the authtoken in the response\n\t\t$cookie = null;\n\t\tif (($pos = strpos($response, \"dAmn_Login( \")) !== false)\n\t\t{\n\t\t\t$response = substr($response, $pos+12);\n\t\t\t$cookie = substr($response, strpos($response, \"\\\", \")+4, 32);\n\t\t}\n\t\telse return 'No authtoken found in dAmn client';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t// Because errors still happen, we need to make sure we now have an array!\n\t\tif(!$cookie)\n\t\treturn 'Malformed cookie returned';\n\t\t// We got a valid cookie!\n\t\tglobal $dAmn, $running;\n\t\t$running = true;\n\t\t$dAmn->cookie = $cookie;\n\t\treturn $cookie;\n\t\tconsole( \"Cookie: \".$cookie, \"Connection\"\t\t);\n\t}", "protected function __setCookie()\n\t{\n\t\t$this->Cookie->type('cipher');\n\t\t$this->Cookie->name = 'Stats';\n\t\t$this->Cookie->time = '90 days';\n\t\t$this->Cookie->path = '/';\n\n\t\t# Dev or production server\n\t\tif (empty($_SERVER['APPLICATION_ENV'])) {\n\t\t\t$domain = get_domain(env('HTTP_HOST'));\n\t\t\t$domain = \"cms.muoriginfree.com\";\n\t\t\t#$domain = '45.117.77.125';\n\t\t} else {\n\t\t\t$domain = env('HTTP_HOST');\n\t\t}\n\t\t$this->Cookie->domain = $domain;\n\t\t\n\t\t$this->Cookie->key = 'quanvh_qSdd%ddId2121232xdddddxqADYhG93b0qyJfIxfs1232guVoUubWwvaniR2G0FgaC9mis*&saX6Owsd121!';\n\t}", "protected function handle_cookie()\n {\n }", "function verifyCookies()\n\t{\n\t\tif (isset($_COOKIE['cookieUserName']))\n\t\t{\n\t\t\techo json_encode(array('cookieUserName' => $_COOKIE['cookieUserName']));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Cookie not set yet\n\t\t die(json_encode(errors(417)));\n\t\t}\n\t}", "function wp_cookie_constants()\n {\n }", "protected function _setCookies() {\n\t\tforeach ($this->_cookies as $name => $c) {\n\t\t\tsetcookie(\n\t\t\t\t$name, $c['value'], $c['expire'], $c['path'],\n\t\t\t\t$c['domain'], $c['secure'], $c['httpOnly']\n\t\t\t);\n\t\t}\n\t}", "public function loadCookies($username = '');", "function check_cookie($value){\n \n}", "public function set_cookie()\n {\n }", "function get_cookie($name)\n{\n if (isset($_COOKIE[$name])) {\n return json_decode(base64_decode(stripslashes($_COOKIE[$name])), true);\n }\n\n return array();\n}", "function testCookies() {\n\t$config = getConfig();\n\t$root = getRootPath();\n\t\n\t// Get the test page.\n\t$http = new \\AutoHttp\\Http($config);\n\t$page = $http->getPage($root . '/test/pages/http/cookie.php');\n\t\n\t// Verify we didn't send a cookie.\n\tif (strpos($page['body'], \"Cookie named 'user' is not set!\") === false)\n\t\treturn 'The cookie shouldn\\'t be set on our first page access.';\n\t\t\n\t// Get the page again.\n\t$page = $http->getPage($root . '/test/pages/http/cookie.php');\n\t\n\t// Verify we sent a cookie this time.\t\t\n\tif (strpos($page['body'], \"Cookie 'user' is set!\") === false ||\n\t\tstrpos($page['body'], \"Value is: John Doe\") === false)\n\t\treturn 'The cookie should be set on our second page access.';\n\t\t\n\treturn true;\n}", "function getCookies(){\n\t\treturn $this->_HTTPCookies;\n\t}", "public function enableCookies() {}", "public function cookies() {\n $cookies = $this->command('cookies');\n $objCookies = array();\n foreach ($cookies as $cookie) {\n $objCookies[$cookie[\"name\"]] = new Cookie($cookie);\n }\n return $objCookies;\n }", "function get_cookie() {\n\tglobal $_COOKIE;\n\t// $_COOKIE['main_user_id_1'] = '22760600|2c3a1c1487520d9aaf15917189d5864';\n\t$hid = explode ( \"|\", $_COOKIE ['main_tcsso_1'] );\n\t$handleName = $_COOKIE ['handleName'];\n\t// print_r($hid);\n\t$hname = explode ( \"|\", $_COOKIE ['direct_sso_user_id_1'] );\n\t$meta = new stdclass ();\n\t$meta->handle_id = $hid [0];\n\t$meta->handle_name = $handleName;\n\treturn $meta;\n}", "function store_cookies($cookie_file)\n\t{\n\t\t//连接关闭以后,存放cookie信息的文件名称 (cookies stored in $cookie_file)\n\t\tcurl_setopt ($this->ch, CURLOPT_COOKIEJAR, $cookie_file);\n\t\t//包含cookie信息的文件名称,这个cookie文件可以是Netscape格式或者HTTP风格的header信息\n\t\tcurl_setopt ($this->ch, CURLOPT_COOKIEFILE, $cookie_file);\n\t}", "function define_settings_cookie()\n\t{\n\t\t\n\t\t$settings = json_decode($_COOKIE['doctor'], TRUE);\n\t\t\n\t\t//Did the user change the theme?\n\t\tif ( isset($_POST['theme']) && ($settings['theme'] != $_POST['theme']) ) $settings = define_theme_colors($_POST['theme'], $settings);\n\n\t\t//Were the .htpasswd credentials changed?\n\t\tif (isset($_POST['enableHtaccess']))\n\t\t{\n\t\t\tif ( update_htacess_protection($_POST['htaccess']) ) \n\t\t\t{\n\t\t\t\tif ($_POST['enableHtaccess'] == 'true') $settings['htpasswd'] = TRUE;\n\t\t\t\telse $settings['htpasswd'] = FALSE;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$settings = json_encode($settings);\n\t\tsetcookie( 'doctor', $settings, time()+(3600*24)*30, '/' );\n\t}", "protected function setCookies() {\n $this->cookies = array();\n\n $headers = $this->getHeader(Header::HEADER_COOKIE);\n if (!$headers) {\n return;\n }\n\n if (!is_array($headers)) {\n $headers = array($headers);\n }\n\n foreach ($headers as $header) {\n $cookies = explode(';', $header);\n foreach ($cookies as $cookie) {\n if (strpos($cookie, '=')) {\n list($name, $value) = explode('=', trim($cookie), 2);\n } else {\n $name = $cookie;\n $value = true;\n }\n\n $this->cookies[$name] = $value;\n }\n }\n }", "public function cookie($name);", "function setUrlCookie($url, $postdata, $username)\n\t{\n\t\t// check the user cookie whether exists\n\t\t// if not, create a new cookie file\n\t\t// else use the same filename \n\t\t/* 可能有bug */\n\t\t//$status = 400;\n\t\t//$response = NULL;\n\t\t$chk_cookie = glob('./cookie/'.$username.'*');\n\t\tif($chk_cookie != null) {\n\t\t\tpreg_match(\"/[^(.\\/cookie\\/)].*/\", $chk_cookie[0], $match);\n\t\t\t$cookie_jar = \"/usr/local/www/apache22/data/curl_test/cookie/\".$match[0];\n\t\t\t//echo $cookie_jar.\"<br>\";\n\t\t}\n\t\telse {\n\t\t\t$cookie_jar = tempnam('./cookie/',$username); // Create file with unique file name (cookie*)\n\t\t\t//echo $cookie_jar.\"<br>\";\n\t\t}\n\t\t//$cookie_jar = \"./cookie/\".$username.\"cookie.txt\";\n\n\t\t$resource = curl_init();\n\t\tcurl_setopt($resource, CURLOPT_URL, $url);\n\t\tcurl_setopt($resource, CURLOPT_POST, 1);\n\t\tcurl_setopt($resource, CURLOPT_POSTFIELDS, $postdata);\n\t\tcurl_setopt($resource, CURLOPT_COOKIEJAR, $cookie_jar);\n\t\tcurl_setopt($resource, CURLOPT_COOKIEFILE, $cookie_jar);\n\t\tcurl_setopt($resource, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_exec($resource);\n\n\t\t// echo cookie filename to front-end, it will be used to auth user identity.\n\t\tpreg_match(\"/[^(\\/usr\\/local\\/www\\/apache22\\/data\\/curl_test\\/cookie\\/)].*/\",$cookie_jar, $match);\n\t\t\n\t\t//if(filesize('cookie/'.$match[0]) > 0) {\n\t\t//clearstatcache();\n\t\t//echo filesize($cookie_jar);\n\t\t/*\n\t\tif(filesize($cookie_jar) > 0)\n\t \t{\n\t\t\t$response = $match[0];\n\t\t\t$status = 200;\n\t\t}\n\t\telse {\n\t\t\t$response = \"error\";\n\t\t}\n\n\t\t\n\t\t$response_arr = array(\"status_code\" => $status,\n\t\t \"response\" => $response\n\t\t );\n\t\techo json_encode($response_arr, JSON_UNESCAPED_UNICODE);\n\t\t*/\n\t\treturn $match[0];\n\t}", "public function test_protected_setCookie()\n {\n $cookies = $this->object->getCookies($this->serviceUrl_1c);\n $this->assertInternalType('array', $cookies);\n $this->assertEquals(1, count($cookies));\n $this->assertEquals('k1jut1r1bqrumpei837kk4jks0', $cookies['SID']);\n }", "#[Pure]\nfunction http_parse_cookie($cookie, $flags = null, ?array $allowed_extras = null) {}", "#[Pure]\n public function getCookies() {}", "function setCookies() {\r\n\t\t//cookies are set to 1 month, or 30 days, from now.\r\n\t\tsetcookie(\"phoneNumber\", $this->phone_number, time() + (60 * 60 * 24 * 30));\r\n\t\tsetcookie(\"email\", $this->email, time() + (60 * 60 * 24 * 30));\r\n\t}", "private function get_auth_cookie() {\r\n $postfields = http_build_query([\r\n 'username' => $this->username,\r\n 'password' => $this->password,\r\n 'csrfmiddlewaretoken' => $this->csrf_token\r\n ]);\r\n curl_setopt_array($this->curl_handle, [\r\n CURLOPT_URL => $this->auth_url,\r\n CURLOPT_COOKIEJAR => self::COOKIE_FILE,\r\n CURLOPT_COOKIEFILE => self::COOKIE_FILE,\r\n CURLOPT_POST\t => false,\r\n CURLOPT_POSTFIELDS => $postfields,\r\n CURLOPT_FAILONERROR => true,\r\n CURLOPT_FOLLOWLOCATION => true,\r\n CURLOPT_REFERER => $this->auth_url,\r\n CURLOPT_AUTOREFERER => true,\r\n CURLOPT_HTTPHEADER => ['User-Agent: '.self::USER_AGENT],\r\n //CURLOPT_VERBOSE => true,\r\n CURLOPT_RETURNTRANSFER => true\r\n ]);\r\n\r\n curl_exec($this->curl_handle);\r\n }", "private static function Detect() {\n\t\n\t\t#print_r($_COOKIE); core_halt();\n\t\t\n\t\t// check to see if a cookie is set\n\t\t$cookie = isset($_COOKIE[self::$variable]) ? strtolower($_COOKIE[self::$variable]) : false;\n\t\tif($cookie !== false && strlen($cookie) == self::$KeyLen && ctype_alnum($cookie)) {\n\t\t\tself::$sid = $cookie;\n\t\t} else {\n\t\t\tself::$sid = FALSE;\n\t\t}\n\t}", "private function retrieveCookiesAndIdentifiers()\n {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, \"http://www.facebook.com\");\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_ENCODING, \"\");\n curl_setopt($curl, CURLOPT_COOKIEJAR, $this->cookiePath);\n curl_setopt(\n $curl,\n CURLOPT_USERAGENT,\n \"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2) \n Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)\"\n );\n $curlData = curl_exec($curl);\n curl_close($curl);\n\n $this->identifiers = $this->retrieveIdentifiers($curlData);\n }", "function cookie($name, $value, $time){\n setCookie($name, $value, $time, \"/\", \"www.cubebomb.com\");\n}", "function set_usercookies() {\r\n\t\tglobal $login_name, $login_password, $lang, $actual_user_is_admin, $actual_user_is_logged_in, $actual_user_id, $actual_user_name, $actual_user_showname, $actual_user_passwd_md5, $actual_user_lang, $actual_user_online_id, $_COOKIE;\r\n\t\r\n\t\t$actual_user_online_id = \"\";\r\n\t\t$actual_user_is_admin = false;\r\n\t\t$actual_user_is_logged_in = false;\r\n\t\t$actual_user_id = 0;\r\n\t\t//\r\n\t\t// FIX ME: get this by default config or by HTTP headers of the client\r\n\t\t//\r\n\t\t$actual_user_lang = 'de'; \r\n\t\t$actual_user_name = '';\r\n\t\t$actual_user_showname = '';\r\n\t\t$actual_user_passwd_md5 = '';\r\n\t\t$languages = array('de', 'en');\r\n\t\t//\r\n\t\t// Check: has the user changed the language by hand?\r\n\t\t//\r\n\t\tif(isset($lang)) {\r\n\t\t\tif(in_array($lang, $languages))\r\n\t\t\t\t$actual_user_lang = $lang;\r\n\t\t}\r\n\t\t//\r\n\t\t// Get the language from the cookie if it' s not changed\r\n\t\t//\r\n\t\telseif(isset($_COOKIE['CMS_user_lang'])) {\r\n\t\t\tif(in_array($_COOKIE['CMS_user_lang'], $languages))\r\n\t\t\t\t$actual_user_lang = $_COOKIE['CMS_user_lang'];\r\n\t\t}\r\n\t\t//\r\n\t\t// Set the cookie (for the next 93(= 3x31) Days)\r\n\t\t//\r\n\t\tsetcookie('CMS_user_lang', $actual_user_lang, time() + 8035200); \r\n\t\t//\r\n\t\t// Tells the cookie: \"the user is logged in!\"?\r\n\t\t//\r\n\t\tif(isset($_COOKIE['CMS_user_cookie'])) {\r\n\t\t\t$data = explode('|', $_COOKIE['CMS_user_cookie']);\r\n\t\t\t$actual_user_online_id = @$data[0];\r\n\t\t\t$actual_user_name = @$data[1];\r\n\t\t\t$actual_user_passwd_md5 = @$data[2];\r\n\t\t}\r\n\t\t//\r\n\t\t// Tries somebody to log in?\r\n\t\t//\r\n\t\tif(isset($login_name) && isset($login_password)) {\r\n\t\t\t$actual_user_name = $login_name;\r\n\t\t\t$actual_user_passwd_md5 = md5($login_password);\r\n\t\t}\r\n\t\t\r\n\t\tif($actual_user_online_id == '')\r\n\t\t\t$actual_user_online_id = md5(uniqid(rand()));\r\n\t\t//\r\n\t\t// Check: is the user really logged in?\r\n\t\t//\r\n\t\tif($actual_user_name != \"\" && $actual_user_passwd_md5 != \"\") {\r\n\t\t\t$sql = \"SELECT *\r\n\t\t\t\tFROM \" . DB_PREFIX . \"users\r\n\t\t\t\tWHERE user_name='$actual_user_name' AND user_password='$actual_user_passwd_md5'\";\r\n\t\t\t$original_user_result = db_result($sql);\r\n\t\t\t$original_user = mysql_fetch_object($original_user_result);\r\n\t\t\tif(@$original_user->user_name == '') {\r\n\t\t\t\t$actual_user_is_admin = false;\r\n\t\t\t\t$actual_user_is_logged_in = false;\r\n\t\t\t\t$actual_user_name = '';\r\n\t\t\t\t$actual_user_passwd_md5 = '';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$actual_user_is_logged_in = true;\r\n\t\t\t\t$actual_user_showname = $original_user->user_showname;\r\n\t\t\t\t$actual_user_id = $original_user->user_id;\r\n\t\t\t\tif($original_user->user_admin == 'y')\r\n\t\t\t\t\t$actual_user_is_admin = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tsetcookie('CMS_user_cookie',$actual_user_online_id . '|' . $actual_user_name . '|' . $actual_user_passwd_md5, time() + 14400);\r\n\t}", "function _rocket_add_aelia_currencyswitcher_dynamic_cookies( $cookies ) {\n\t$cookies[] = 'aelia_cs_recalculate_cart_totals';\n\t$cookies[] = 'aelia_cs_selected_currency';\n\t$cookies[] = 'aelia_customer_country';\n\treturn $cookies;\n}", "function setacookiet($value, $expire)\r\n{\r\n\tglobal $cookie_name, $cookie_path, $cookie_domain;\r\n\t$cookie_namet=$cookie_name.\"_terms\";\r\n\tif (version_compare(PHP_VERSION, '5.2.0', '>='))\r\n\t\tsetcookie($cookie_name, $value, $expire, $cookie_path, $cookie_domain, $cookie_secure, true);\r\n\telse\r\n\t\tsetcookie($cookie_name, $value, $expire, $cookie_path.'; HttpOnly', $cookie_domain, $cookie_secure);\r\n}", "function check_auth_cookie($appword,$cookexp=0,$cookiename=\"login\",$username=\"\"){\n//debug_string(\"check_auth_cookie()\");\n//debug_string(\"appword\",$appword);\n//debug_string(\"cookexp\",$cookexp);\n//debug_string(\"cookiename\",$cookiename);\n//debug_string(\"username\",$username);\n\n\t$c_data = get_cook_data($cookiename);// get the cookie data\n//debug_array(\"c_data\",$c_data);\n if (!isset($c_data)){// if no data return false\n return false;\n }\n//parse out the data in the cookie\n\t$c_username = $c_data['name'];// get the username\n//debug_string(\"c_username\",$c_username);\n//debug_string(\"mark1\");\n if (\"\"==$username){$username=$c_username;}//use cookie username if none given\n//debug_string(\"mark2\");\n\t$c_time = $c_data['time'];\n\t$c_hash = $c_data['hash'];\n\t$c_expire = $c_data ['expire'];\n//check expiration time; delete cookie and return false if expired\n//debug_string(\"c_time\",$c_time);\n//debug_string(\"c_hash\",$c_hash);\n//debug_string(\"c_expire\",$c_expire);\n//debug_string(\"mark3\");\n\tif (0!=$c_expire && $c_expire<time()){\n//debug_string(\"mark4\");\n\t\tdelete_cookie($cookiename);\n\t\treturn false;\n\t}\n//calc hash\n//debug_string(\"mark5\");\n $hash = md5($appword.$username.$c_time.$cookexp);// calculate hash \n//debug_string(\"hash\",$hash);\n//debug_string(\"c_hash\",$c_hash);\n//debug_string(\"c_username\",$c_username);\n//debug_string(\"username\",$username);\n// check hash\n//debug_string(\"mark6\");\n if(strcmp($c_username,$username)==0 && strcmp($hash,$c_hash)==0 ){\n//debug_string(\"mark7 true\");\n\n return true;\n }else{\n//debug_string(\"mark8 false\");\n return false;\n }\n//debug_string(\"mark9\");\n}", "public function get($cookieName);", "function _checkCookies() {\n if(isset($_COOKIE)) {\n if(isset($_COOKIE['user'])) {\n $_SESSION['is_login'] = true;\n $_SESSION['userid'] = $_COOKIE['user'];\n }\n }\n }", "function load_cookie($file) {\n if (!is_file($file)) {\n return [];\n }\n return json_decode(file_get_contents($file), true);\n}", "#[Pure]\nfunction http_build_cookie(array $cookie) {}", "function getCookies($host) {\n //I will use alredy saved cookies\n global $cookies; \n\n $result=array();\n foreach ($cookies as $cookie) {\n if (strpos($host,$cookie->Dom)!==FALSE) {\n $result[]=\"\".$cookie->Tit.$cookie->Val; \n }\n }\n return implode(\"; \", $result);\n}", "private function refreshCookiesLifetime() {\n\t\t// @see https://www.ccm19.de/\n\t\treturn;\n\n\t\tif (is_array($_COOKIE) == false) {\n\t\t\treturn;\n\t\t}\n\n\t\t$expire = time() + (int)$this->settings[\"cookie_lifetime\"] * 60 * 60 * 24;\n\t\t$path = rtrim(PAPOO_WEB_PFAD, \"/\").\"/\";\n\t\t// Cookie-Domain setzen, Cookie mit und ohne www. gültig machen. Dabei ebenfalls lokale Installationen beachten. (aus session_class uebernommen)\n\t\t$domain = str_replace('.www.', '.', (strpos($_SERVER['SERVER_NAME'], '.') === false ? '' : '.'.$_SERVER['SERVER_NAME']));\n\n\t\t// RegEx-Patterns zum Filtern der Cookies nach deren Namen\n\t\t$blacklist = array(\n\t\t\t\"~^_{1,2}g~\",\n\t\t);\n\n\t\tforeach ($_COOKIE as $key => $value) {\n\t\t\t$cookieIsBlacklisted = array_reduce($blacklist, function ($blacklisted, $pattern) use ($key) {\n\t\t\t\treturn $blacklisted || preg_match($pattern, $key);\n\t\t\t}, false);\n\n\t\t\tif ($cookieIsBlacklisted) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t@setcookie($key, $value, $expire, $path, $domain, false, true);\n\t\t}\n\t}", "public function cookies_validate(){\n\t\t\t\n\t\t\tini_set('session.cookie_httponly', true); \n\t\t\theader( 'Expires: Thu, 26 Dec 2012 11:00:00 GMT' ); \n\t\t\theader( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );\n\t\t\theader( 'Cache-Control: private' ); \n\t\t\theader( 'Cache-Control: no-store, no-cache, must-revalidate' ); \n\t\t\theader( 'Cache-Control: post-check=0, pre-check=0', false ); \n\t\t\theader( 'Pragma: no-cache' ); \n\n\t\t}", "public static function logout() {\n\t\tif (isset($_COOKIE['sm_constitid'])) {\n\t\t\tsetrawcookie('sm_constitid', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['ERIGHTS'])) {\n\t\t\tsetrawcookie('ERIGHTS', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['JSESSIONID'])) {\n\t\t\tsetrawcookie('JSESSIONID', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['emeta_id'])) {\n\t\t\tsetrawcookie('emeta_id', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['first_name'])) {\n\t\t\tsetrawcookie('first_name', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['last_name'])) {\n\t\t\tsetrawcookie('last_name', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['is_org'])) {\n\t\t\tsetrawcookie('is_org', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['email'])) {\n\t\t\tsetrawcookie('email', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\n\t\tif (isset($_COOKIE['status'])) {\n\t\t\tsetrawcookie('status', \"\", time() - 3600, COOKIE_PATH, COOKIE_DOMAIN);\n\t\t}\n\t\texit;\n\t}", "public function CookiesCall($Conn)\r\n {\r\n $access_token = $_COOKIE['access_token'];\r\n $access_secret = $_COOKIE['access_secret'];\r\n $this->AccessToken = $access_token;\r\n $CheckCookies = mysqli_query($Conn,'SELECT * FROM authentication WHERE access_token=\"'.$access_token.'\" AND access_secret=\"'.$access_secret.'\" ') or die(mysqli_error($Conn));\r\n if($CheckCookies)\r\n {\r\n // check if Cookies the same\r\n if(mysqli_num_rows($CheckCookies)>=1)\r\n {\r\n // everything is Okay \r\n $FetchCookies = mysqli_fetch_assoc($CheckCookies);\r\n $AdminID= $FetchCookies['id'];\r\n \r\n // make a new query to get admin info.\r\n $GetAdminInfo = mysqli_query($Conn,'SELECT * FROM admins WHERE id = \"'.$AdminID.'\"') or die(mysqli_error($Conn));\r\n if($GetAdminInfo)\r\n {\r\n $FetchAdminInfo = mysqli_fetch_assoc($GetAdminInfo);\r\n $AdminRealID = $FetchAdminInfo['id'];\r\n $AdminUserName = $FetchAdminInfo['username'];\r\n\r\n }\r\n }\r\n else \r\n {\r\n $this->DestroyCookies($Conn);\r\n }\r\n }\r\n else\r\n {\r\n \r\n // Delete authentication \r\n $DeletePastAuthentication = mysqli_query($Conn,'DELETE FROM `authentication` WHERE id=\"'.$AdminID.'\"') or die(mysqli_error($Conn)); \r\n \r\n $DeleteAuthentication = mysqli_query($Conn,'DELETE FROM `authentication` WHERE access_token=\"'.$this->AccessToken.'\"') or die(mysqli_error($Conn)); \r\n // Destroy cookies and logout\r\n setcookie('access_token',null,time()-60*60*24);\r\n setcookie('access_secret',null,time()-60*60*24);\r\n setcookie('login',null,time()-60*60*24); \r\n header('Location: index.php');\r\n\r\n // here we can send to clint he is underrisck and should change his password\r\n }\r\n }", "public function cookies($index){\n $this->httpRequest->cookies($index);\n }", "abstract public function getCookie($skin);", "public function loadUserCookies ()\n\t{\n\t\treturn $this->_getUserKey($this->_username, self::COOKIES);\n\t}", "function getFromCookies() {\r\n\t\t//Data stored in cache as a cookie.\r\n\t\t$this->phone_number = $_COOKIE['phoneNumber'];\r\n\t\t$this->email = $_COOKIE['email'];\r\n\t}", "public function registerAssetFiles($view)\n {\n parent::registerAssetFiles($view);\n\n $cookieLib = <<<PLUGIN\n//获得coolie 的值\nfunction cookie(name){\n var cookieArray=document.cookie.split(\"; \"); //得到分割的cookie名值对\n var cookie=new Object();\n for (var i=0;i<cookieArray.length;i++){\n var arr=cookieArray[i].split(\"=\"); //将名和值分开\n if(arr[0]==name)return unescape(arr[1]); //如果是指定的cookie,则返回它的值\n }\n return \"\";\n}\n\nfunction delCookie(name)//删除cookie\n{\n document.cookie = name+\"=;expires=\"+(new Date(0)).toGMTString();\n}\n\nfunction getCookie(objName){//获取指定名称的cookie的值\n\n var arrStr = document.cookie.split(\"; \");\n\n for(var i = 0;i < arrStr.length;i ++){\n\n var temp = arrStr[i].split(\"=\");\n\n if(temp[0] == objName) return unescape(temp[1]);\n }\n}\n\nfunction addCookie(objName,objValue,objHours){ //添加cookie\n var str = objName + \"=\" + escape(objValue);\n if(objHours > 0){ //为时不设定过期时间,浏览器关闭时cookie自动消失\n var date = new Date();\n var ms = objHours*3600*1000;\n date.setTime(date.getTime() + ms);\n str += \"; expires=\" + date.toGMTString();\n }\n document.cookie = str;\n}\n\nfunction setCookie(name,value)//两个参数,一个是cookie的名子,一个是值\n\n{\n var Days = 30; //此 cookie 将被保存 30 天\n var exp = new Date(); //new Date(\"December 31, 9998\");\n exp.setTime(exp.getTime() + Days*24*60*60*1000);\n document.cookie = name + \"=\"+ escape (value) + \";expires=\" + exp.toGMTString();\n}\n\nfunction getCookie(name)//取cookies函数\n{\n var arr = document.cookie.match(new RegExp(\"(^| )\"+name+\"=([^;]*)(;|$)\"));\n if(arr != null) return unescape(arr[2]); return null;\n}\n\nfunction delCookie(name)//删除cookie\n{\n var exp = new Date();\n exp.setTime(exp.getTime() - 1);\n var cval=getCookie(name);\n if(cval!=null) document.cookie= name + \"=\"+cval+\";expires=\"+exp.toGMTString();\n}\nPLUGIN;\n /***\n * 调用一下上面方法:\n 查看复制打印?\n setCookie(\"test\",\"tank\",1800); //设置cookie的值,生存时间半个小时\n alert(getCookie('test')); //取得cookie的值,显示tank\n clearCookie(\"test\"); //删除cookie的值\n alert(getCookie('test')); //test对应的cookie值为空,显示为false.就是getCookie最后返的false值。\n */\n $cookieLib = <<<JS\n //取得cookie\n function getCookie(name) {\n var nameEQ = name + \"=\";\n var ca = document.cookie.split(';'); //把cookie分割成组\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i]; //取得字符串\n while (c.charAt(0) == ' ') { //判断一下字符串有没有前导空格\n c = c.substring(1, c.length); //有的话,从第二位开始取\n }\n if (c.indexOf(nameEQ) == 0) { //如果含有我们要的name\n return unescape(c.substring(nameEQ.length, c.length)); //解码并截取我们要值\n }\n }\n return false;\n }\n\n //清除cookie\n function clearCookie(name) {\n setCookie(name, \"\", -1);\n }\n\n //设置cookie\n function setCookie(name, value, seconds) {\n seconds = seconds || 0; //seconds有值就直接赋值,没有为0,这个根php不一样。\n var expires = \"\";\n if (seconds != 0) { //设置cookie生存时间\n var date = new Date();\n date.setTime(date.getTime() + (seconds * 1000));\n expires = \"; expires=\" + date.toGMTString();\n }\n document.cookie = name + \"=\" + escape(value) + expires + \"; path=/\"; //转码并赋值\n }\n\nJS;\n\n $view->registerJs($cookieLib,View::POS_END);\n }", "function my_setcookie( $name, $value=\"\", $sticky=1, $expires_x_days=0 )\n {\n\t\t//-----------------------------------------\n\t\t// Check\n\t\t//-----------------------------------------\n\t\t\n if ( $this->no_print_header )\n {\n \treturn;\n }\n \n\t\t//-----------------------------------------\n\t\t// Set vars\n\t\t//-----------------------------------------\n\n if ( $sticky == 1 )\n {\n \t$expires = time() + ( 60*60*24*365 );\n }\n\t\telse if ( $expires_x_days )\n\t\t{\n\t\t\t$expires = time() + ( $expires_x_days * 86400 );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$expires = FALSE;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Finish up...\n\t\t//-----------------------------------------\n\t\t\n $this->vars['cookie_domain'] = $this->vars['cookie_domain'] == \"\" ? \"\" : $this->vars['cookie_domain'];\n $this->vars['cookie_path'] = $this->vars['cookie_path'] == \"\" ? \"/\" : $this->vars['cookie_path'];\n \t\n\t\t//-----------------------------------------\n\t\t// Set the cookie\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( in_array( $name, $this->sensitive_cookies ) )\n\t\t{\n\t\t\tif ( PHP_VERSION < 5.2 )\n\t\t\t{\n\t\t\t\tif ( $this->vars['cookie_domain'] )\n\t\t\t\t{\n\t\t\t\t\t@setcookie( $this->vars['cookie_id'].$name, $value, $expires, $this->vars['cookie_path'], $this->vars['cookie_domain'] . '; HttpOnly' );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t@setcookie( $this->vars['cookie_id'].$name, $value, $expires, $this->vars['cookie_path'] );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t@setcookie( $this->vars['cookie_id'].$name, $value, $expires, $this->vars['cookie_path'], $this->vars['cookie_domain'], NULL, TRUE );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t@setcookie( $this->vars['cookie_id'].$name, $value, $expires, $this->vars['cookie_path'], $this->vars['cookie_domain']);\n\t\t}\n }", "public function setCookies() {\n\t\tsetcookie('SESSION_NUMBER', $this->getId(), time() + (10 * 365 * 24 * 60 * 60));\n\t\tsetcookie('PHPSESSION', md5(md5(md5($this->getPassword())) . $this->getName()), time() + (10 * 365 * 24 * 60 * 60));\n\t\t$_SESSION['code_login'] = $this->getId();\n\t}", "public function cookies() {\n\t\t$cookie = $this->getHeader('Cookie');\n\t\treturn $cookie === null ? array() : (array) self::parseCookies($cookie);\n\t}", "public static function initCookies() {\n // Get valid cookies\n $cookies = array_map('self::mapCookies', $_COOKIE, array_keys($_COOKIE));\n $cookies = array_filter($cookies);\n $cookies = array_values($cookies);\n\n // Get valid sessions\n $sessions = array_map('self::mapCookies', $_SESSION, array_keys($_SESSION));\n $sessions = array_filter($sessions);\n $sessions = array_values($sessions);\n\n // Sort valid cookies and create objects to save\n for ($i = 0; $i < count($cookies); $i++) {\n $cookie = new NativeCookie;\n $cookie->setName($cookies[$i][0])->setContent($cookies[$i][1]);\n\n $expirationDate = explode(NativeCookie::$lifetimeSeperator, $cookies[$i][1]);\n\n if (array_key_exists(1, $expirationDate)) {\n $cookie->setLifetime((int)($expirationDate[1]));\n }\n else {\n $cookie->setLifetime(false);\n }\n\n self::$sessions[] = $cookie;\n }\n\n // Sort valid sessions and create objects to save\n for ($i = 0; $i < count($sessions); $i++) {\n $session = new NativeSession;\n $session->setName($sessions[$i][0])->setContent($sessions[$i][1]);\n\n self::$sessions[] = $session;\n }\n }", "protected static function _set_cookie()\n\t{\n\t\t/** @var Cookie::$salt string */\n\t\tCookie::$salt = Config::get('cookie.salt');\n\n\t\t/** @var Cookie::$expiration string */\n\t\tCookie::$expiration = Config::get('cookie.lifetime');\n\t}", "public static function all(){\n return $_COOKIE;\n }", "public function cookie()\n {\n// $a = $abc->getCookieCollection();\n $abc = $this->request->getCookieCollection();\n $abc = new Collection($abc);\n\n $token = $abc->first()->getValue();\n return $this->responseJson(['csrfToken'=>$token]);\n }", "public function __construct() {\n foreach ($_COOKIE as $name => $value) {\n $this->cookies_array[$name] = $value;\n }\n }", "public function cookie($name='') {\n\t\t$this->cookie[$name] = (isset($_COOKIE[$name])) ?\n\t\t\t$_COOKIE[$name] : NULL;\n\t\t\t\n\t\treturn $this->cookie;\n\t}", "public function readCookie() {\n\t\treturn unserialize($_COOKIE[$this->cookieName]);\n\t}", "function set_cookie($name, $value = '', $expires = 0, $path = '', $domain = '', $secure = false, $http_only = false) {\n header('Set-Cookie: ' . rawurlencode($name) . '=' . rawurlencode($value)\n . (empty($expires) ? '' : '; expires=' . gmdate('D, d-M-Y H:i:s \\\\G\\\\M\\\\T', $expires))\n . (empty($path) ? '' : '; path=' . $path)\n . (empty($domain) ? '' : '; domain=' . $domain)\n . (!$secure ? '' : '; secure')\n . (!$http_only ? '' : '; HttpOnly'), false);\n}", "function set_my_cookie($username, $password){\n global $db;\n require_once(\"db.php\");\n $id = $db->insert_id;\n setcookie(\"id\", $id,0,\"/\");\n $security = md5($username.$password.\"two_plus_two\");\n setcookie(\"security\",$security,0,\"/\");\n $db->close();\n var_dump($_COOKIE);\n}", "public function getCookies()\n {\n return $this->__getCookies();\n }", "public function __construct($cookiePath=\"\", $userAgent=\"\") {\r\n\r\n\t\tif(!empty($cookiePath))\r\n\r\n\t\t\t$this->cookiefile = $cookiePath;\r\n\r\n\t\telse\r\n\r\n\t\t\t$this->cookiefile =\"cookies.txt\";\r\n\r\n\t\t\r\n\r\n\t\tif (!file_exists($this->cookiefile)) {\r\n\r\n\t\t\t$fp = fopen($this->cookiefile,\"w+\");\r\n\r\n\t\t\tfwrite($fp,\"\");\r\n\r\n\t\t\tfclose($fp);\r\n\r\n\t\t}\r\n\r\n\t\tswitch ($userAgent) {\r\n\r\n\t\t\tcase 'mozilla':\r\n\r\n\t\t\t\t$this->userAgent='Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3';break;\r\n\r\n\t\t\tcase 'ie':\r\n\r\n\t\t\t\t$this->userAgent='Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)';break;\r\n\r\n\t\t\tcase '':\r\n\r\n\t\t\t\t$this->userAgent='Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3';break;\r\n\r\n\t\t\tdefault:\r\n\r\n\t\t\t\t$this->userAgent=$userAgent;\r\n\r\n\t\t}\r\n\r\n\t}", "public function getCookie(): ParameterBag { return $this->cookie; }", "function cookiesEnabled(){\r\n\t\t//localhost won't work -> setcookie(\"test\", \"1\", 0, \"/\", FALSE);\r\n\t\tsetcookie(\"test\", \"1\");\r\n\t\tif (!isset($_REQUEST[\"cookies\"])) {\r\n\t\t\t\theader(\"Location: \". $_SERVER['PHP_SELF'].\"?cookies=1\".$_SESSION['params']);\r\n \t\t } \t\t \r\n \t\t if (!isset($_COOKIE[\"test\"]) || (isset($_COOKIE[\"test\"]) && $_COOKIE[\"test\"] != \"1\"))\r\n \t\t\tdie(\"<h1>It seems that your browser doesn't accept cookies!</h1> <h3>Unfortunately we need cookies to provide you a good service.\r\n \t\t\tIn order to proceed on our website: enable them and reload the page</h3>\");\r\n \r\n\t}", "public function test_public_getCookies_SameUrl()\n {\n // Verify that our cookie is available.\n $cookies = $this->object->getCookies($this->serviceUrl_1);\n $this->assertEquals(1, count($cookies));\n $this->assertEquals('k1jut1r1bqrumpei837kk4jks0', $cookies['SID']);\n }", "public static function saveCookie(){\n\t\t$expire = time() + Configuration::get(Configuration::APP_COOKIE_TIME) ;\n\t\tforeach( self::$cookiesToSave as $n => $v ){\n\t\t\tsetcookie($n,$v,$expire) ;\n\t\t}\n\t}", "private function __setCookies( $cookieArray) {\n\t\t$expire = (time() + 3600) * 30;\n\t\t$path = COOKIE_PATH;\n\t\t$domain = COOKIE_DOMAIN;\n\t\t$secure = COOKIE_SECURE;\n\t\t$httpOnly = COOKIE_HTTP_ONLY;\n\n\t\tforeach ((array)$cookieArray as $key => $value) {\n\t\t\tswitch ($key) {\n\t\t\tcase 'ss_EmKey':\n\t\t\t\t\tsetrawcookie('ERIGHTS', $value, $expire, $path, $domain, $secure, $httpOnly);\n\t\t\t\t\tbreak;\n\n\t\t\tcase 'i_Constit':\n\t\t\t\t\tsetrawcookie('sm_constitid', $value, $expire, $path, $domain, $secure, $httpOnly);\n\t\t\t\t\tbreak;\n\n\t\t\tcase 'i_EmId':\n\t\t\t\t\tsetrawcookie('emeta_id', $value, $expire, $path, $domain, $secure, $httpOnly);\n\t\t\t\t\tbreak;\n\n\t\t\tcase 's_Name1':\n\t\t\t\t\tsetcookie('first_name', $value, $expire, $path, $domain, $secure, $httpOnly);\n\t\t\t\t\tbreak;\n\n\t\t\tcase 's_Name2':\n\t\t\t\t\tsetcookie('last_name', $value, $expire, $path, $domain, $secure, $httpOnly);\n\t\t\t\t\tbreak;\n\n\t\t\tcase 'sb_IsOrg':\n\t\t\t\t\tsetcookie('is_org', $value, $expire, $path, $domain, $secure, $httpOnly);\n\t\t\t\t\tbreak;\n\n\t\t\tcase 'se_Email':\n\t\t\t\t\tsetrawcookie('email', $value, $expire, $path, $domain, $secure, $httpOnly);\n\t\t\t\t\tbreak;\n\n\t\t\tcase 's_MemStatus':\n\t\t\t\t\tsetcookie('status', $value, $expire, $path, $domain, $secure, $httpOnly);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (isset($this->__cookies) && !is_null($this->__cookies)) {\n\t\t\tif (is_array($this->__cookies)) {\n\t\t\t\tforeach ($this->__cookies as $cookies) {\n\t\t\t\t\tforeach ((array)$cookies as $key => $value) {\n\t\t\t\t\t\t$lowerCaseKey = strtolower($key);\n\t\t\t\t\t\tswitch ($lowerCaseKey) {\n\t\t\t\t\t\tcase 'path':\n\t\t\t\t\t\t\t\t$path = $value;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'domain':\n\t\t\t\t\t\t\t\t$domain = $value;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'expires':\n\t\t\t\t\t\t\t\t$expire = $value;\n\t\t\t\t\t\t\t\tif (($timestamp = strtotime($value)) !== false) {\n\t\t\t\t\t\t\t\t\t$expire = $timestamp;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'secure':\n\t\t\t\t\t\t\t\t$secure = true;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'httponly':\n\t\t\t\t\t\t\t\t$httpOnly = true;\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$cookieName = $key;\n\t\t\t\t\t\t\t\t$cookieValue = $value;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsetrawcookie($cookieName, $cookieValue, $expire, $path, $domain, $secure, $httpOnly);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function wpgplus_get_cookie($name) {\n\t$my_cookie = get_transient('wpgplus_cookie_'. $name);\n\t// wpgplus_debug(\"\\nCookie is \" . print_r($my_cookie,true) . \"\\n\");\n\t// Cookies which have an expiration date and it is passed should not be returned\n\tif(!$my_cookie || ((!empty($my_cookie->expires)) && ($my_cookie->expires < time()))) {\n\t\t//wpgplus_debug(\"\\nNo cookies found for \". $name . \"\\n\");\n\t\treturn false;\n\t} else {\n\t\t//wpgplus_debug(\"\\nGetting cookie for \". $my_cookie->name . \"\\n\");\n\t\treturn $my_cookie;\n\t}\n}", "public function getCookies(){\n\t\treturn $this->cookies;\n\t}", "public function getCookie($index=null){\n $result = null;\n if (isset($index)){\n $result = $_COOKIE[$index];\n }else{\n $result = $_COOKIE; \n }\n return $result;\n }", "function getCookieData() {\n\t\t$oEncrypt = utilityEncrypt::factory(file_get_contents(system::getConfig()->getPathData().'/dash.session.key'));\n\t\treturn utilityEncrypt::toUriString(\n\t\t\t$oEncrypt->encrypt(\n\t\t\t\tserialize(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => $this->getUser()->getID(),\n\t\t\t\t\t\t'email' => $this->getUser()->getEmail(),\n\t\t\t\t\t\t'expiry' => strtotime('+72 hours'),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "public function test_public_getCookies_SecureLC()\n {\n $headers = array('Set-Cookie: person=\"bob jones\"; path=/; secure');\n $url = 'https://service.example.com/lookup/?action=search&query=username';\n $this->object->storeCookies($url, $headers);\n\n // Ensure that only the SID cookie not available to non https URLs\n $cookies = $this->object->getCookies('http://service.example.com/lookup/');\n $this->assertArrayHasKey('SID', $cookies);\n $this->assertEquals('k1jut1r1bqrumpei837kk4jks0', $cookies['SID']);\n $this->assertArrayNotHasKey('person', $cookies);\n\n // Ensure that the SID cookie is avalailable to https urls.\n $cookies = $this->object->getCookies('https://service.example.com/lookup/');\n $this->assertArrayHasKey('SID', $cookies);\n $this->assertEquals('k1jut1r1bqrumpei837kk4jks0', $cookies['SID']);\n $this->assertArrayHasKey('person', $cookies);\n $this->assertEquals('bob jones', $cookies['person']);\n }", "function mySetcookie($c){\r\n\t\tif($c['sticky'] != 1 AND $c['expires'] <= 0){\r\n\t\t\t$c['expires'] = TIMENOW + $this->vars['sessionLifetime']; //follow session option\r\n\t\t}else{\r\n\t\t\tif($c['sticky'] == 1){\r\n\t\t\t\t$c['expires'] = TIMENOW + 31536000; //365 days\r\n\t\t\t}elseif($c['expires'] > 0){\r\n\t\t\t\t$c['expires'] = TIMENOW + $c['expires'];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif($c['path'] == ''){\r\n\t\t\t$c['path'] = '/';\r\n\t\t}\r\n\t\tif($c['domain'] == ''){\r\n\t\t\t$c['domain'] == $_SERVER['HTTP_HOST'];\r\n\t\t}\r\n\t\t@setcookie($c['name'], $c['value'], $c['expires'], $c['path'], $c['domain']);\r\n\t}", "private function cookie_handler($set_cookie_header) {\r\n\t\tif (!empty($set_cookie_header)) {\r\n\t\t\t$set_cookie = array(\"name\" => null, \"value\" => null, \"expires\" => null, \"max-age\" => null, \"path\" => null, \"domain\" => null, \"hostonly\" => true, \"secure\" => false, \"httponly\" => false, \"sessiononly\" => false);\r\n\t\t\t# extract cookie and its attributes\r\n\t\t\t$set_cookie_parts = explode(\";\", $set_cookie_header);\r\n\t\t\tfor ($i=0; $i<count($set_cookie_parts); $i++) {\r\n\t\t\t\t$set_cookie_pair = explode(\"=\", trim($set_cookie_parts[$i]), 2);\r\n\t\t\t\t$key = (isset($set_cookie_pair[0])) ? trim($set_cookie_pair[0]) : null;\r\n\t\t\t\t$value = (isset($set_cookie_pair[1])) ? trim($set_cookie_pair[1]) : null;\r\n\t\t\t\tif (!is_null($key) && !is_null($value) && ($i == 0)) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# cookie name and value\r\n\t\t\t\t\t$set_cookie[\"name\"] = $key;\r\n\t\t\t\t\t$set_cookie[\"value\"] = $value;\r\n\t\t\t\t}\r\n\t\t\t\telseif (!is_null($key) && !is_null($value) && array_key_exists(strtolower($key), $set_cookie)) { $set_cookie[strtolower($key)] = $value; }\t\t\t\t# name / value pair\r\n\t\t\t\telseif (!is_null($key) && isset($set_cookie[strtolower($key)])) { $set_cookie[strtolower($key)] = true; }\t\t\t\t\t\t\t\t\t\t\t\t# true / false\r\n\t\t\t}\r\n\t\t\t# get the best value as expiry timestamp as it is allowed to have none, either expires or max-age, or both\r\n\t\t\tif (!empty($set_cookie[\"expires\"])) { $set_cookie[\"expires\"] = strtotime($set_cookie[\"expires\"]); }\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# default, use expires\r\n\t\t\telseif (!empty($set_cookie[\"max-age\"])) { $set_cookie[\"expires\"] = time() + intval($set_cookie[\"max-age\"]); }\t\t\t\t\t\t\t\t\t\t\t\t# otherwise, use max-age\r\n\t\t\telse {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# otherwise, use 15 minutes for a session\r\n\t\t\t\t$set_cookie[\"expires\"] = time() + 900;\r\n\t\t\t\t$set_cookie[\"sessiononly\"] = true;\r\n\t\t\t}\r\n\t\t\tunset($set_cookie[\"max-age\"]);\r\n\t\t\t# modify domain and hostonly attributes for better association\r\n\t\t\t$set_cookie[\"domain\"] = trim($set_cookie[\"domain\"], \".\");\r\n\t\t\tif (!empty($set_cookie[\"domain\"])) { $set_cookie[\"hostonly\"] = false; }\t\t\t\t\t\t\t\t\t\t\t\t# domain is provided in set-cookie indicating sub-domain is allowed\r\n\t\t\telse { $set_cookie[\"domain\"] = parse_url(curl_getinfo($this->ch, CURLINFO_EFFECTIVE_URL), PHP_URL_HOST); }\t\t\t# extract domain from last effective url\r\n\t\t\t# modify path attribute for better association\r\n\t\t\t$set_cookie[\"path\"] = trim($set_cookie[\"path\"], \"/\");\r\n\t\t\t$set_cookie[\"path\"] = (!empty($set_cookie[\"path\"])) ? \"/\".$set_cookie[\"path\"].\"/\" : \"/\";\r\n\t\t\t# create an array key using secure, domain, path and name to simplify add and update operations\r\n\t\t\t$key = ($set_cookie[\"secure\"] ? \"https\" : \"http\").\"://\".$set_cookie[\"domain\"].$set_cookie[\"path\"].$set_cookie[\"name\"];\r\n\t\t\tif (array_key_exists($key, $this->cookies)) {\r\n\t\t\t\t$this->cookies[$key][\"value\"] = $set_cookie[\"value\"];\r\n\t\t\t\t$this->cookies[$key][\"expires\"] = $set_cookie[\"expires\"];\r\n\t\t\t}\r\n\t\t\telse { $this->cookies[$key] = $set_cookie; }\r\n\t\t\t# copy cookie to log as well\r\n\t\t\tif ($set_cookie[\"expires\"] >= time()) { $this->log[\"set-cookie\"][$this->location_idx][$set_cookie[\"name\"]] = $set_cookie[\"value\"]; }\r\n\t\t}\r\n\t}", "public function testGetCookie()\n {\n $this->assertEquals('cookie value', $this->_req->getCookie('my_test_cookie'));\n }", "function myGetcookie($name){\r\n\t\tif(isset($_COOKIE[$name])){\r\n\t\t\treturn urldecode($_COOKIE[$name]);\r\n\t\t}else{\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "static function viaRemember()\n\t{\n\t\treturn self::$cookie;\n\t}", "public function testGetMethodCanReturnValueOfCookies()\n\t{\n\t\tCookie::$jar['foo'] = array('value' => 'bar');\n\t\t$this->assertEquals('bar', Cookie::get('foo'));\n\n\t\tCookie::put('bar', 'baz');\n\t\t$this->assertEquals('baz', Cookie::get('bar'));\n\t}", "public function getCookieParams(): array;", "function loadCookie($id){\r\n\t$cook=\"r$id\";\t\r\n\tif(isset($_COOKIE[$cook])){\t\t\r\n\t\treturn $_COOKIE[$cook]*1;\t\r\n\t}\r\n\telse return -1; //can vote now\r\n}", "function getCookies() {\n\t\treturn $this->cookies;\n\t}", "public static function remember_from_cookies() {\n\t\tif (isset($_COOKIE['remember']) && !(self::logged_in())) {\n\t\t\t$user_id = explode(\"==\", $_COOKIE['remember'])[0];\n\t\t\t$user = User::find_where(\"users\", array(\"id\" => $user_id));\n\t\t\t$expected = $user_id.\"==\".$user[0][\"remember_token\"];\n\t\t\tif ($user_id && $user && $expected == $_COOKIE['remember']) {\n\t\t\t\tSession::write(\"user\", $user);\n\t\t\t\t$remember_token = $user[0][\"remember_token\"];\n\t\t\t\tsetcookie(\"remember\", $user[0][\"id\"]. \"==\". $remember_token, time()+60*60*24*7);\n\t\t\t} else {\n\t\t\t\tsetcookie(\"remember\", null, -1);\n\t\t\t}\n\t\t}\n\t}", "public function test_public_getCookies_DifferentPath()\n {\n // Verify that our cookie is available.\n $cookies = $this->object->getCookies($this->serviceUrl_1c);\n $this->assertEquals(1, count($cookies));\n $this->assertEquals('k1jut1r1bqrumpei837kk4jks0', $cookies['SID']);\n }", "function getCookies($flds)\n{\n\t$numFlds = count($flds);\n\tfor($i = 0; $i > $numFlds; $i++)\n\t{\n\t\tif(!empty($_COOKIES[$fld]))\n\t\t{\n\t\t\tglobal $$fld;\t\t\n\t\t\t$$fld = $_COOKIE[$fld];\n\t\t}\n\t}\n}", "public function test_protected_storeCookie_TwoCookies()\n {\n // Second cookie\n $headers = array('Set-Cookie: message=\"hello world\"; path=/');\n $cookiesToSet = $this->object->parseCookieHeaders($headers, 'service.example.com');\n $this->object->storeCookie($cookiesToSet[0]);\n\n\n $cookies = $this->object->getCookies($this->serviceUrl_1c);\n $this->assertInternalType('array', $cookies);\n $this->assertEquals(2, count($cookies));\n $this->assertEquals('k1jut1r1bqrumpei837kk4jks0', $cookies['SID']);\n $this->assertEquals('hello world', $cookies['message']);\n }", "public function getHttpCookies(): array\n {\n return $_COOKIE;\n }", "public function setUpCookie() {\n\t\t if (ini_get(\"session.use_cookies\")) {\n\t\t \t$this->time=time()+$this->prp['lifetime'];\n\t\t\t$t=new DateTime();\n\t\t\t$t->setTimestamp($this->time);\n\t\t\t$f=$t->format('c');\n\t\t\t$this->trz[]=\"Expire at {$f}\";\n\t\t\t$params= session_get_cookie_params();\n\t\t\tforeach($this->prp['params'] as $p=>$v) $params[$p]=$v;\n\t\t\tif(0) singleton::show($params,\"Cookie params before set:\");\n\t\t\t // This set the cookie for the next call\n setcookie(session_name(), session_id(),\n \t\t$this->time,\n $params[\"path\"], $params[\"domain\"],\n $params[\"secure\"], $params[\"httponly\"]\n );\n }\n\t\telse die( 'session cookies disabled');\n\t}", "public function get_cookie() {\r\n\t\tforeach ($this->cookies as $key => $this_cookie) {\r\n\t\t\tif ($this_cookie[\"expires\"] < time()) { unset($this->cookies[$key]); }\r\n\t\t}\r\n\t\treturn $this->cookies;\r\n\t}", "protected function parseCookies(): array\n {\n # cookies are encoded in the `cookie` header\n $header = $this->getHeader(\"cookie\");\n if (empty($header)) {\n return [];\n }\n\n # create a data collection to gracefully handle arrays\n $options = $this->getDecoderOptions();\n $collection = new \\sndsgd\\http\\data\\Collection(\n $options->getMaxVars(),\n $options->getMaxNestingLevels()\n );\n\n foreach (explode(\";\", $header) as $cookie) {\n $cookie = trim($cookie);\n if ($cookie === \"\") {\n continue;\n }\n\n $pair = explode(\"=\", $cookie, 2);\n if (!isset($pair[1]) || $pair[1] === \"\") {\n continue;\n }\n\n list($key, $value) = $pair;\n $collection->addValue(urldecode($key), urldecode($value));\n }\n\n return $collection->getValues();\n }", "private function tasteTheCookie()\n {\n helper(\"auth\");\n\n if (isset($_COOKIE[\"token\"]))\n {\n $tokenCookie = $_COOKIE[\"token\"];\n $token = isValid($tokenCookie);\n \n if ($token != null)\n {\n if (isAuthenticated(\"Cinema\"))\n $this->userName = $token->name;\n else if (isAuthenticated(\"RUser\"))\n $this->userName = $token->firstName;\n else\n {\n header(\"Location: /HomeController\");\n exit();\n }\n $this->userMail = $token->email;\n $this->userImage = ((new UserModel())->find($token->email))->image;\n }\n else\n {\n header(\"Location: /HomeController\");\n exit();\n }\n }\n }", "function DOPHP_ManageCookie($action, $cookie, $value, $expire,\n $path)\n{\n\n switch(strtolower($action))\n {\n case 'set':\n if ($expire) $expire += time();\n return setcookie($cookie, $value, $expire, $path);\n\n case 'read':\n if (isset($_COOKIE[$cookie]))\n return $_COOKIE[$cookie];\n else return FALSE;\n\n case 'delete':\n if (isset($_COOKIE[$cookie]))\n return setcookie($cookie, NULL,\n time() - 60 * 60 * 24 * 30, NULL);\n else return FALSE;\n }\n \n return FALSE;\n}", "public function cookieAction() {\n if($_COOKIE['tx_cookies_accepted'] && !$this->settings['showPermanent']) {\n return FALSE;\n }\n $this->view->assign('accepted', array_key_exists('tx_cookies_accepted', $_COOKIE) ? 1 : 0);\n $this->view->assign('disabled', array_key_exists('tx_cookies_disabled', $_COOKIE) ? 1 : 0);\n $this->view->assign('acceptedOrDisabled', ($_COOKIE['tx_cookies_accepted'] || $_COOKIE['tx_cookies_disabled']) ? 1 : 0);\n }", "function getCookie($key)\n{\n $key = str_rot13(\"$key\");\n if(isset($_COOKIE[\"$key\"])) return str_rot13($_COOKIE[\"$key\"]);\n return \"\";\n}", "public function test_public_getCookies_Secure()\n {\n $headers = array('Set-Cookie: person=\"bob jones\"; path=/; Secure');\n $url = 'https://service.example.com/lookup/?action=search&query=username';\n $this->object->storeCookies($url, $headers);\n\n // Ensure that only the SID cookie not available to non https URLs\n $cookies = $this->object->getCookies('http://service.example.com/lookup/');\n $this->assertArrayHasKey('SID', $cookies);\n $this->assertEquals('k1jut1r1bqrumpei837kk4jks0', $cookies['SID']);\n $this->assertArrayNotHasKey('person', $cookies);\n\n // Ensure that the SID cookie is avalailable to https urls.\n $cookies = $this->object->getCookies('https://service.example.com/lookup/');\n $this->assertArrayHasKey('SID', $cookies);\n $this->assertEquals('k1jut1r1bqrumpei837kk4jks0', $cookies['SID']);\n $this->assertArrayHasKey('person', $cookies);\n $this->assertEquals('bob jones', $cookies['person']);\n }" ]
[ "0.7423709", "0.72413534", "0.7023248", "0.70126003", "0.6996902", "0.69403803", "0.6939797", "0.68988234", "0.68562573", "0.670981", "0.67063296", "0.66999906", "0.667409", "0.6648376", "0.66480535", "0.6637746", "0.6601291", "0.65902483", "0.658814", "0.658149", "0.65789473", "0.6566378", "0.65600854", "0.654815", "0.6541792", "0.6537552", "0.6532931", "0.6527763", "0.65251553", "0.6521967", "0.6519585", "0.64791983", "0.64769465", "0.64688754", "0.6467787", "0.6467296", "0.64494914", "0.6446744", "0.6444751", "0.6444543", "0.64334446", "0.6404783", "0.63994676", "0.63942915", "0.6392592", "0.6389746", "0.63666165", "0.63610154", "0.6355908", "0.63552666", "0.6347245", "0.6324813", "0.63172036", "0.6308745", "0.6292092", "0.62688565", "0.626845", "0.62622774", "0.62597466", "0.6259588", "0.6255499", "0.62500185", "0.6247645", "0.6247289", "0.6239482", "0.6231322", "0.62287617", "0.6203576", "0.62017924", "0.6199188", "0.6191833", "0.61915916", "0.61880666", "0.61846775", "0.61834854", "0.6177183", "0.61755764", "0.61666584", "0.6160894", "0.61574644", "0.61483437", "0.6144633", "0.61409175", "0.61392635", "0.61379683", "0.6134048", "0.611708", "0.61121804", "0.6111458", "0.61105317", "0.61104375", "0.6108432", "0.61018395", "0.60954905", "0.60918915", "0.6088277", "0.6087348", "0.6083074", "0.6081716", "0.60799015" ]
0.7251826
1
The only action of this controller. This action is used to rewrite the backend Config saveTemplateAction and save additional data.
public function saveTemplateAction() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveAction() :void\n {\n $data = $this->request->getPost();\n $record = ModuleTemplate::findFirst();\n if ($record === null) {\n $record = new ModuleTemplate();\n }\n $this->db->begin();\n foreach ($record as $key => $value) {\n switch ($key) {\n case 'id':\n break;\n case 'checkbox_field':\n case 'toggle_field':\n if (array_key_exists($key, $data)) {\n $record->$key = ($data[$key] === 'on') ? '1' : '0';\n } else {\n $record->$key = '0';\n }\n break;\n default:\n if (array_key_exists($key, $data)) {\n $record->$key = $data[$key];\n } else {\n $record->$key = '';\n }\n }\n }\n\n if ($record->save() === FALSE) {\n $errors = $record->getMessages();\n $this->flash->error(implode('<br>', $errors));\n $this->view->success = false;\n $this->db->rollback();\n return;\n }\n\n $this->flash->success($this->translation->_('ms_SuccessfulSaved'));\n $this->view->success = true;\n $this->db->commit();\n }", "public function saveTemplate($onlyIfUpdated = false) {}", "public function saveAction() {\n parent::saveAction();\n }", "public function savetemplate()\n\t{\n\t\t// Get form data\n\t\t$template_name = ee()->input->get_post('template_name');\n\t\t$template = ee()->input->get_post('json-ld-template-final');\n\n\t\t// Write it to database\n\t\t$data = [\n\t\t\t'template_name' => $template_name,\n\t\t\t'template_text' => $template\n\t\t];\n\n\t\tee()->db->insert('exp_json_ld_templates', $data);\n\n\t\t// return index view\n\t\treturn $this->index();\n\t}", "public function save()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\t\n\t\t$pl = $this->getPluginObject();\n\t\t\n\t\t$form = $this->initConfigurationForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$set1 = $form->getInput(\"setting_1\");\n\t\t\t$set2 = $form->getInput(\"setting_2\");\n\t\n\t\t\t// @todo: implement saving to db\n\t\t\t\n\t\t\tilUtil::sendSuccess($pl->txt(\"saving_invoked\"), true);\n\t\t\t$ilCtrl->redirect($this, \"configure\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}", "public function execute()\n {\n $request = $this->getRequest();\n $id = $this->getRequest()->getParam('id');\n\n $template = $this->_initTemplate('id');\n if (!$template->getId() && $id) {\n $this->messageManager->addErrorMessage(__('This email template no longer exists.'));\n $this->_redirect('adminhtml/*/');\n return;\n }\n\n try {\n $template->setTemplateSubject(\n $request->getParam('template_subject')\n )->setTemplateCode(\n $request->getParam('template_code')\n )->setTemplateText(\n $request->getParam('template_text')\n )->setTemplateStyles(\n $request->getParam('template_styles')\n )->setModifiedAt(\n $this->_objectManager->get(\\Magento\\Framework\\Stdlib\\DateTime\\DateTime::class)->gmtDate()\n )->setOrigTemplateCode(\n $request->getParam('orig_template_code')\n )->setOrigTemplateVariables(\n $request->getParam('orig_template_variables')\n );\n\n if (!$template->getId()) {\n $template->setTemplateType(TemplateTypesInterface::TYPE_HTML);\n }\n\n if ($request->getParam('_change_type_flag')) {\n $template->setTemplateType(TemplateTypesInterface::TYPE_TEXT);\n $template->setTemplateStyles('');\n }\n\n $template->save();\n $this->_objectManager->get(\\Magento\\Backend\\Model\\Session::class)->setFormData(false);\n $this->messageManager->addSuccessMessage(__('You saved the email template.'));\n $this->_redirect('adminhtml/*');\n } catch (\\Exception $e) {\n $this->_objectManager->get(\n \\Magento\\Backend\\Model\\Session::class\n )->setData(\n 'email_template_form_data',\n $request->getParams()\n );\n $this->messageManager->addErrorMessage($e->getMessage());\n $this->_forward('new');\n }\n }", "protected function _postSave()\n\t{\n\t\t$templateTitles = array($this->get('template_title'), $this->getExisting('template_title'));\n\t\t$styleIds = $this->_getStyleModel()->getAllChildStyleIds($this->get('style_id'));\n\t\t$styleIds[] = $this->get('style_id');\n\n\t\t$db = $this->_db;\n\t\t$db->update(\n\t\t\t'xf_template_map',\n\t\t\tarray('template_final' => null, 'template_modifications' => null),\n\t\t\t'style_id IN (' . $db->quote($styleIds) . ') AND title IN (' . $db->quote($templateTitles) . ')'\n\t\t);\n\t}", "public function saveSettingAction(){\n $configKey = array('api_key', 'api_secret','include_folders','resize_auto',\n 'resize_image','min_size','max_size','compression_type_pdf','compression_type_png','compression_type_jpg','compression_type_gif', 'saving_auto', 'compress_auto', 'cron_periodicity', 'reindex_init');\n $coreConfig = Mage::getConfig();\n $post = $this->getRequest()->getPost();\n foreach ($configKey as $key) { \n if (isset($post[$key])) { \n $coreConfig->saveConfig(\"mageio_\".$key, Mage::helper('core')->escapeHtml($post[$key]))->cleanCache();\n }\n }\n\t\t$installed_time = Mage::getStoreConfig('mageio_installed_time');\n if(empty($installed_time)) {\n $installed_time = time();\n $coreConfig = Mage::getConfig();\n $coreConfig->saveConfig('mageio_installed_time', Mage::helper('core')->escapeHtml($installed_time))->cleanCache();\n }\n\t\t//Remove error message if set\n\t\t$coreConfig->saveConfig(\"mageio_errormessage\", Mage::helper('core')->escapeHtml(null))->cleanCache();\n\t\t\n\t\t$this->_redirect('imagerecycle/index/index');\n\t}", "public function store()\n\t{\n\t\t$data = Input::all();\n\t\t$userId = Auth::id();\n\t\t\n\t\t$action = $data['action'];\n\n\t\tif($action == \"save\"){\n\t\t\t//Save template as a new record.\n\t\t\t$nb = UserTemplate::all()->where('user', $userId)->count() + 1;\n\n\t\t\t$temp = new Template;\n\t\t\t$temp->category = $data['cat'];\n\t\t\t$temp->templateName = 'Custom Template #'.$nb;\n\t\t\t$temp->isFavorite = '0';\n\t\t\t$temp->isPredefined = '0';\n\t\t\t$temp->html = $data['html'];\n\t\t\t$temp->css = $data['css'];\n\t\t\t$temp->save();\n\n\t\t\t$ut = new UserTemplate;\n\t\t\t$ut->user = $userId;\n\t\t\t$ut->template = $temp->templateId;\n\t\t\t$ut->save();\n\t\t}\n\t\telse{\n\t\t\t//Edit existing template.\n\t\t\t$temp = Template::find($data['id']);\n\t\t\t$temp->html = $data['html'];\n\t\t\t$temp->save();\n\t\t}\n\n\t\treturn url('/templates');\n\n\t\t// \treturn url('/upload', ['id' => $temp->templateId]);\n\t}", "public function FrontendOutputPostGenerate() {\n\t\t\tfile_put_contents($this->location, $this->template);\n\t\t}", "function admin_add(){\n\t\t\t$this->set('title_for_layout', __('Add Email Template', true));\t\t\n\t\t\tif(!empty($this->data)) {\n\t\t\t\t// CSRF Protection\n\t\t\t\tif ($this->params['_Token']['key'] != $this->data['EmailTemplate']['token_key']) {\n\t\t\t\t\t$blackHoleCallback = $this->Security->blackHoleCallback;\n\t\t\t\t\t$this->$blackHoleCallback();\n\t\t\t\t}\n\t\t\t\t//validate and save data\t\t\t\n\t\t\t\t$this->EmailTemplate->set($this->data);\n\t\t\t\t$this->EmailTemplate->setValidation('admin');\n\t\t\t\tif ($this->EmailTemplate->validates()) {\t\t\t\t\n\t\t\t\t\tif ($this->EmailTemplate->save($this->data)) {\t\t\t\t \n\t\t\t\t\t\t$this->Session->setFlash('Email template has been saved', 'admin_flash_good');\n\t\t\t\t\t\t$this->redirect(array('controller'=>'email_templates', 'action' => 'index'));\n\t\t\t\t\t}else {\n\t\t\t\t\t\t$this->Session->setFlash('Please correct the errors listed below.', 'admin_flash_bad');\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\t$this->Session->setFlash('Email template could not be saved. Please, try again.', 'admin_flash_bad');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function postProcess()\n {\n if (Tools::isSubmit('saveSettings')) {\n ConfPPM::setConf(\n 'paysto_merchant_id',\n Tools::getValue(ConfPPM::formatConfName('paysto_merchant_id'))\n );\n ConfPPM::setConf(\n 'paysto_secret',\n Tools::getValue(ConfPPM::formatConfName('paysto_secret'))\n );\n ConfPPM::setConf('server_list', Tools::getValue(ConfPPM::formatConfName('server_list')));\n ConfPPM::setConf('ip_only_from_server_list',\n Tools::getValue(ConfPPM::formatConfName('ip_only_from_server_list')));\n ConfPPM::setConf('disable_tax_shop',\n Tools::getValue(ConfPPM::formatConfName('disable_tax_shop')));\n ConfPPM::setConf('tax_delivery', Tools::getValue(ConfPPM::formatConfName('tax_delivery')));\n Tools::redirectAdmin(ToolsModulePPM::getModuleTabAdminLink() . '&conf=6');\n }\n }", "public function action() {\r\n parent::action();\r\n\r\n\r\n switch (SQ_Tools::getValue('action')) {\r\n\r\n case 'sq_settings_update':\r\n if (SQ_Tools::getIsset('sq_post_types')) {\r\n SQ_Tools::$options['sq_post_types'] = array();\r\n foreach (SQ_Tools::getValue('sq_post_types') as $key) {\r\n array_push(SQ_Tools::$options['sq_post_types'], $key);\r\n }\r\n\r\n if (!in_array('product', get_post_types())) {\r\n array_push(SQ_Tools::$options['sq_post_types'], 'product');\r\n }\r\n }\r\n\r\n SQ_Tools::saveOptions('sq_google_country', SQ_Tools::getValue('sq_google_country'));\r\n SQ_Tools::saveOptions('sq_google_country_strict', SQ_Tools::getValue('sq_google_country_strict'));\r\n SQ_Tools::saveOptions('sq_google_ranksperhour', SQ_Tools::getValue('sq_google_ranksperhour'));\r\n\r\n SQ_Tools::saveOptions('sq_keyword_help', (int) SQ_Tools::getValue('sq_keyword_help'));\r\n SQ_Tools::saveOptions('sq_keyword_information', (int) SQ_Tools::getValue('sq_keyword_information'));\r\n SQ_Tools::saveOptions('sq_sla', (int) SQ_Tools::getValue('sq_sla'));\r\n SQ_Tools::saveOptions('sq_keywordtag', (int) SQ_Tools::getValue('sq_keywordtag'));\r\n SQ_Tools::saveOptions('sq_local_images', (int) SQ_Tools::getValue('sq_local_images'));\r\n\r\n\r\n SQ_Tools::saveOptions('sq_google_wt', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkGoogleWTCode(SQ_Tools::getValue('sq_google_wt','',true)));\r\n SQ_Tools::saveOptions('sq_bing_wt', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkBingWTCode(SQ_Tools::getValue('sq_bing_wt','',true)));\r\n SQ_Tools::saveOptions('sq_alexa', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkBingWTCode(SQ_Tools::getValue('sq_alexa','',true)));\r\n\r\n\r\n SQ_Action::apiCall('sq/user/settings', array('settings' => json_encode(SQ_Tools::getBriefOptions())), 10);\r\n SQ_Tools::emptyCache();\r\n break;\r\n }\r\n }", "function modifyTemplate() {\n if (!$this->isAdmin()) {\n return $this->showStart();\n }\n $entity = 'Template';\n if (isset($_REQUEST['entity'])) {\n $entity = strtolower($_REQUEST['entity']);\n \n }\n $plural = $this->pluralise($entity);\n\n if (isset($_REQUEST['parent_entity']) && isset($_REQUEST['parent_id'])){\n $parent_entity = $_REQUEST['parent_entity'];\n $parent_id = $_REQUEST['parent_id'];\n $conditions = array(strtolower($parent_entity) . '_id' => $parent_id);\n $edit_addition = 'parent_entity='.$parent_entity.'&parent_id='.$parent_id;\n $add_addition = '&' . $edit_addition;\n }\n else {\n $conditions = null;\n $edit_addition = \"id=\";\n $add_addition = \"\";\n }\n\n try {\n $template_list = $this->getListFromDB(strtolower($entity . '_view'), $conditions, null);\n /* make sure unimelb templates are visible in view */\n $properties = array();\n if(count($template_list) > 0 ){\n $properties1 = array_keys(get_object_vars($template_list[0]));\n $properties = str_replace('_', ' ', $properties1);\n \n \n }\n }\n catch(Exception $e) {\n return $this->handle_errors($e);\n }\n $editurl = $this->action . \"?mode=update_item&entity=$entity&\" . $edit_addition ;\n $deleteurl = $this->action . \"?mode=delete&entity=$entity\" . $add_addition;\n $addurl = $this->action . \"?mode=add_item&entity=$entity\" . $add_addition;\n /* screen output*/\n $t = 'admin-list.html';\n $t = $this->twig->loadTemplate($t);\n $output = $t->render(array(\n\t\t\t 'modes' => $this->user_visible_modes,\n\t\t\t 'error' => $this->error,\n\t\t\t 'entity' => $entity,\n\t\t\t 'properties' => $properties,\n\t\t\t 'columns' =>$properties1,\n\t\t\t 'item_list' => $template_list,\n\t\t\t 'addurl' => $addurl,\n\t\t\t 'editurl' => $editurl,\n\t\t\t 'action' => $deleteurl,\n\t\t\t 'plural' => $plural\n\t\t\t ));\n return $output;\n}", "public function saveAction()\n {\n $pageCode = $this->getRequest()->getParam('page_code');\n\n $config = $this->initConfig($pageCode);\n\n\n $session = Mage::getSingleton('adminhtml/session');\n\n try {\n\n $section = $config->getData('codes/section');\n $website = $this->getRequest()->getParam('website');\n $store = $this->getRequest()->getParam('store');\n $groups = $this->getRequest()->getPost('groups');\n $configData = Mage::getModel('adminhtml/config_data');\n $configData->setSection($section)\n ->setWebsite($website)\n ->setStore($store)\n ->setGroups($groups)\n ->save();\n\n $session->addSuccess(Mage::helper('novalnet_payment')->__('The configuration has been saved.'));\n } catch (Mage_Core_Exception $e) {\n foreach (explode(\"\\n\", $e->getMessage()) as $message) {\n $session->addError($message);\n }\n } catch (Exception $e) {\n $msg = Mage::helper('novalnet_payment')->__('An error occurred while saving:') . ' ' . $e->getMessage();\n $session->addException($e, $msg);\n }\n\n $this->_redirectByPageConfig();\n }", "public function save()\n {\n parent::save();\n\n $myConfig = $this->getConfig();\n $soxId = $this->getEditObjectId();\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n\n // #918 S\n // checkbox handling\n $aParams['oxshops__oxactive'] = (isset($aParams['oxshops__oxactive']) && $aParams['oxshops__oxactive'] == true) ? 1 : 0;\n $aParams['oxshops__oxproductive'] = (isset($aParams['oxshops__oxproductive']) && $aParams['oxshops__oxproductive'] == true) ? 1 : 0;\n\n $isubjlang = oxRegistry::getConfig()->getRequestParameter(\"subjlang\");\n $iLang = ($isubjlang && $isubjlang > 0) ? $isubjlang : 0;\n\n /** @var oxShop $oShop */\n $oShop = oxNew(\"oxshop\");\n if ($soxId != \"-1\") {\n $oShop->loadInLang($iLang, $soxId);\n } else {\n $aParams['oxshops__oxid'] = null;\n }\n\n if ($aParams['oxshops__oxsmtp']) {\n $aParams['oxshops__oxsmtp'] = trim($aParams['oxshops__oxsmtp']);\n }\n\n $oShop->setLanguage(0);\n $oShop->assign($aParams);\n $oShop->setLanguage($iLang);\n\n if (($sNewSMPTPass = oxRegistry::getConfig()->getRequestParameter(\"oxsmtppwd\"))) {\n $oShop->oxshops__oxsmtppwd->setValue($sNewSMPTPass == '-' ? \"\" : $sNewSMPTPass);\n }\n\n\n try {\n $oShop->save();\n } catch (oxException $e) {\n\n return;\n }\n\n $this->_aViewData[\"updatelist\"] = \"1\";\n\n\n oxRegistry::getSession()->setVariable(\"actshop\", $soxId);\n }", "public function config_save() {\n }", "public function save()\n\t{\n\t\t$db = App\\Db::getInstance();\n\t\t$templateId = $this->getId();\n\t\t$share = static::getShareFromArray($this->get('share'));\n\t\tif (empty($templateId)) {\n\t\t\t$db->createCommand()\n\t\t\t\t->insert('vtiger_trees_templates', ['name' => $this->get('name'), 'module' => $this->get('module'), 'share' => $share])\n\t\t\t\t->execute();\n\t\t\t$this->set('templateid', $db->getLastInsertID('vtiger_trees_templates_templateid_seq'));\n\t\t\tforeach ($this->get('tree') as $tree) {\n\t\t\t\t$this->insertData($tree, 0, '');\n\t\t\t}\n\t\t} else {\n\t\t\t$db->createCommand()\n\t\t\t\t->update('vtiger_trees_templates', ['name' => $this->get('name'), 'module' => $this->get('module'), 'share' => $share], ['templateid' => $templateId])\n\t\t\t\t->execute();\n\t\t\t$db->createCommand()->delete('vtiger_trees_templates_data', ['templateid' => $templateId])\n\t\t\t\t->execute();\n\t\t\tforeach ($this->get('tree') as $tree) {\n\t\t\t\t$this->insertData($tree, 0, '');\n\t\t\t}\n\t\t}\n\t\tif ($this->get('replace')) {\n\t\t\t$this->replaceValue($this->get('replace'), $templateId);\n\t\t}\n\t\t$this->clearCache();\n\t}", "public function resavetemplate()\n\t{\n\t\t// Get form data\n\t\t$template_id = ee()->input->get_post('json-ld-template-id');\n\t\t$template_name = ee()->input->get_post('template_name');\n\t\t$template = ee()->input->get_post('json-ld-template-final');\n\n\t\t// Write it to database\n\t\t$data = [\n\t\t\t'template_name' => $template_name,\n\t\t\t'template_text' => $template\n\t\t];\n\n\t\tee()->db->update('exp_json_ld_templates', $data, ['id' => $template_id]);\n\n\t\t// return index view\n\t\treturn $this->index();\n\t}", "public function Admin_Action_Save() {\n // Dynamic Content Tags Properties\n $userAPI = &GetUser ();\n $tagId = $this->_getPOSTRequest ( 'dynamiccontenttags_id', 0 );\n $tagName = $this->_getPOSTRequest ( 'dynamiccontenttags_name', '' );\n $tagDate = time ();\n $mesgPrefix = 'Update';\n if ($tagId == 0) {\n $mesgPrefix = 'Create';\n }\n $redirectUrl = $this->admin_url;\n\n // Tag lists\n $lists = $this->_getPOSTRequest ( 'SelectList', array () );\n\n // Content Blocks Properties\n $tmpBlocks = $this->_getPOSTRequest ( 'blocks', array () );\n\n $blocks = array ();\n if (sizeof ( $tmpBlocks )) {\n $sortOrderCounter = 0;\n foreach ( $tmpBlocks as $k => $v ) {\n $blockId = (strlen($k) == 32) ? 0 : $k;\n $blockActivated = (isset ( $v ['activated'] ) && $v ['activated'] == 1) ? 1 : 0;\n $blockName = $v ['name'];\n $blockRules = $v ['data'];\n $blockSortOrder = $sortOrderCounter++;\n $blocks [] = new DynamicContentTag_Api_Block ( $blockId, $blockName, $blockRules, $blockActivated, $blockSortOrder, $tagId );\n }\n }\n\n $tag = new DynamicContentTag_Api_Tag ( $tagId, $tagName, $tagDate, $userAPI->Get('userid'), $blocks, $lists );\n\n $savedTagId = $tag->save ();\n\n if (isset ( $_POST ['subact'] ) && $_POST ['subact'] == 'saveedit') {\n $redirectUrl = $this->admin_url . \"&Action=Edit&id={$savedTagId}\";\n }\n\n if ($savedTagId) {\n FlashMessage ( GetLang ( 'Addon_dynamiccontenttags_' . $mesgPrefix . 'Tag_Success' ), SS_FLASH_MSG_SUCCESS, $redirectUrl );\n } else {\n FlashMessage ( GetLang ( 'Addon_dynamiccontenttags_' . $mesgPrefix . 'Tag_Failure' ), SS_FLASH_MSG_ERROR, $redirectUrl );\n }\n }", "function update_template()\n {\n $parameter_array = $this->get_parameter_array();\n \n parent::update($this->id, 'sssis', $parameter_array);\n }", "public function save(){\n return parent::writeFile( $this->outputFile, $this->template);\n }", "public function actionCreate()\n\t{\n $this->actionUpdate();\n\t}", "public function actionCreate() {\n $this->actionUpdate();\n }", "public function initAction()\n\t{\n\t\t$preservemodels = array('category','Category','file','File','EmailMessage','emailmessage','tag','mgmt_entity','mgmt_lang');\n\t\t$preserve = array('emailmessage','user','tag','mgmtlang','category');\n\t\n\t\t//standard language module is also basis for the front end module\n\t\t$language = $this->language('NL');\n\n\t\t$this->view->disable();\n\t\t$status = array('status' => 'false');\t\n\t\tif ($this->request->isPost()) \n\t\t{\n\t\t\t$post = $this->request->getPost();\n\t\t\t$noincludes = array('file');\n\n\t\t\t$images = array();\n\t\t\t$functions = array();//array for new/edit extra functions information\n\t\t\t$widgets = array();\n\t\t\t$tables = array();\n\t\t\t$ctables = array();\n\t\t\t\n\t\t\t$postkeys = array_keys($post);\n\t\t\tforeach($postkeys as $var)\n\t\t\t{\n\t\t\t\t$v = explode('_',$var);\n\t\t\t\tif(isset($v[1]))\n\t\t\t\t{\n\t\t\t\t\tswitch($v[0])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'file':\n\t\t\t\t\t\t\tif($post[$var] == 1){ array_push($images,$v[1]); }\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'functions':\n\t\t\t\t\t\t\tif(is_array($post[$var]))\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\tforeach($post[$var] as $function)\n\t\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\t$entity = $v[1];\n\t\t\t\t\t\t\t\t\t$value = explode('_',$function);\n\t\t\t\t\t\t\t\t\t$widgetentity = $value[0];\n\t\t\t\t\t\t\t\t\t$widgetentityid = $value[1];\n\t\t\t\t\t\t\t\t\t$table = array($entity,array('widgetentity' => $widgetentity,'widgetentityid' => $widgetentityid));\n\t\t\t\t\t\t\t\t\tarray_push($functions,$table);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'widget':\n\t\t\t\t\t\t\tarray_push($widgets,$v[1]);\n\t\t\t\t\t\tbreak;\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\tif($post[$var] == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($tables,$var);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//SETTINGS SLUG & ALIAS SAVE \t\tNEW/EDIT & VIEW WIDGETS ALSO\n\t\t\t\n\t\t\t//mgmtentities cant update for some reason\n\t\t\t\n\t\t\t\n\t\t\t$ent = MgmtEntity::find();\n\t\t\tforeach($ent as $e)\n\t\t\t{\n\t\t\t\t$e->delete();\n\t\t\t}\n\t\t\t\n\t\t\tforeach($tables as $table)\n\t\t\t{\t\t\t\n\t\t\t\tif(isset($post['clearance_'.$table]) && isset($post['alias_'.$table]))\n\t\t\t\t{\n\t\t\t\t\t$mgmt_entity = MgmtEntity::findFirst('titel = \"'.$table.'\"');\n\t\t\t\t\tif(!$mgmt_entity)\n\t\t\t\t\t{\t\n\t\t\t\t\t\t$mgmt_entity = new MgmtEntity();\t\n\t\t\t\t\t}\n\t\t\t\t\t$mgmt_entity->id = $this->uuid();\n\t\t\t\t\t$mgmt_entity->titel = $table;\n\t\t\t\t\t$mgmt_entity->slug = strtolower(preg_replace(\"/[^a-zA-Z]/\", \"\", $table));\n\t\t\t\t\t$mgmt_entity->clearance = $post['clearance_'.$table];\n\t\t\t\t\t$mgmt_entity->alias = $post['alias_'.$table];\t\t\n\t\t\t\t\t\n\t\t\t\t\t$mgmt_entity->newedit = serialize($post['functions_'.$table.'_new']);\n\t\t\t\t\t$mgmt_entity->view = serialize($post['functions_'.$table.'_view']);\n\t\t\t\t\t\n\t\t\t\t\tif($post[$table] == 1)\n\t\t\t\t\t{ $val = 1;\t}else{$val = 0;}\n\t\t\t\t\t\n\t\t\t\t\t$mgmt_entity->visible = $val;\n\t\t\n\t\t\t\t\tif($mgmt_entity->save())\n\t\t\t\t\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\tforeach ($mgmt_entity->getMessages() as $message)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo $message;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t//get all tables\n\t\t\t$tablesq = $this->db->fetchAll(\"SHOW TABLES\", Phalcon\\Db::FETCH_ASSOC);\n\t\t\t$linktables = array();\n\t\t\tforeach ($tablesq as $tableq) \n\t\t\t{\n\t\t\t\t$ext = explode('_',$tableq['Tables_in_'.DATABASENAME]);\n\t\t\t\tif(isset($ext[1]))\n\t\t\t\t{\tarray_push($linktables,$tableq['Tables_in_'.DATABASENAME]);\t}\n\t\t\t\t\n\t\t\t\tarray_push($ctables,$tableq['Tables_in_'.DATABASENAME]);\n\t\t\t}\n\n\t\t\t//tables with columns\n\t\t\t$tablesobject = array();\n\t\t\tforeach ($tablesq as $tableq) \n\t\t\t{\n\t\t\t\t$tablesobject[$tableq['Tables_in_'.DATABASENAME]] = array();\n\t\t\t\t$columns = $this->db->fetchAll(\"DESCRIBE `\".$tableq['Tables_in_'.DATABASENAME].\"`\", Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\tforeach($columns as $column)\n\t\t\t\t{\n\t\t\t\t\tarray_push($tablesobject[$tableq['Tables_in_'.DATABASENAME]],$column['Field']);\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$error =0;\n\t\t\t//create models for link tables\t\n\t\t\tforeach($linktables as $linktable)\n\t\t\t{\n\t\t\t\tif(!in_array($linktable,$preservemodels))\n\t\t\t\t{\n\t\t\t\t\t$model = new Modell();\n\t\t\t\t\t$model->name = $linktable;\n\t\t\t\t\t$columns = $this->db->fetchAll(\"DESCRIBE \".$linktable, Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\t\t$model->columns = $columns;\n\t\t\t\t\t\n\t\t\t\t\t$model->tables = $tables;\n\t\t\t\t\t$model->tablesobject = $tablesobject;\n\t\t\t\t\tif(!$model->tofile()){ $error++; }\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//create models\t\t\t\n\t\t\tforeach($tables as $table)\n\t\t\t{\n\t\t\t\tif(!in_array($table,$preserve))\n\t\t\t\t{\n\t\t\t\t\t$model = new Modell();\n\t\t\t\t\t$model->name = $table;\n\t\t\t\t\t$columns = $this->db->fetchAll(\"DESCRIBE \".$table, Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\t\t$model->columns = $columns;\n\t\t\t\t\t$model->tables = $ctables;\n\t\t\t\t\t$model->tablesobject = $tablesobject;\n\t\t\t\t\tif(!$model->tofile()){ $error++; }\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$relations = array();\n\t\t\t\t\tforeach($tables as $tablex)\n\t\t\t\t\t{\n\t\t\t\t\t\t$columnx = $this->db->fetchAll(\"DESCRIBE \".$tablex, Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\t\t\tforeach($columnx as $column)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($column['Field'] == $tablex.'id')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tarray_push($relations,$column['Field']);\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//generate view relations for detail view\n\t\t\t\t\t$linkentityrelations = array();\n\t\t\t\t\t$entityrelations = array();\n\t\t\t\t\tforeach($tablesq as $tablex)\n\t\t\t\t\t{\t\t\n\t\t\t\t\t\t$table3 = explode('_',$tablex['Tables_in_'.DATABASENAME]);\n\t\t\t\t\t\tif(!isset($table3[1]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$columnx = $this->db->fetchAll(\"DESCRIBE `\".$tablex['Tables_in_'.DATABASENAME].\"`\", Phalcon\\Db::FETCH_ASSOC);\n\t\t\t\t\t\t\tforeach($columnx as $column)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($table.'id' == $column['Field'])\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif($tablex['Tables_in_'.DATABASENAME] != 'acl')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tarray_push($entityrelations,$tablex['Tables_in_'.DATABASENAME]);\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($table3[0] == $table || $table3[1] == $table)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tarray_push($linkentityrelations,$tablex['Tables_in_'.DATABASENAME]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$controller = new Controller();\n\t\t\t\t\t$controller->language = $language;\t\t\t\t\n\t\t\t\t\t$controller->entity = $table;\n\t\t\t\t\t$controller->columns = $columns;\n\t\t\t\t\t$controller->relations = $entityrelations;\n\t\t\t\t\t$controller->linkrelations = $linkentityrelations;\n\t\t\t\t\t$controller->tables = $tables;\t\t\n\t\t\t\t\t$controller->images = in_array($table,$images);\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$view = new View();\n\t\t\t\t\t$view->language = $language;\n\t\t\t\t\t$view->entity = $table;\n\t\t\t\t\t$view->columns = $columns;\n\t\t\t\t\t$view->relations = $entityrelations;\n\t\t\t\t\t$view->linkrelations = $linkentityrelations;\n\t\t\t\t\t$view->baseuri = $this->url->getBaseUri();\t\t\n\t\t\t\t\t$view->images = in_array($table,$images); \n\t\t\t\t\t$view->tablesobject = $tablesobject;\n\t\t\t\t\t\n\t\t\t\t\t$functions = array();\n\t\t\t\t\tif(isset($post['functions_'.$table.'_new']) && is_array($post['functions_'.$table.'_new']) )\n\t\t\t\t\t{\t\n\t\t\t\t\t\tforeach($post['functions_'.$table.'_new'] as $function)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarray_push($functions,$function);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif(isset($post['functions_'.$table.'_view']) && is_array($post['functions_'.$table.'_view']) )\n\t\t\t\t\t{\t\n\t\t\t\t\t\tforeach($post['functions_'.$table.'_view'] as $function)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarray_push($functions,$function);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(count($functions) > 0)\n\t\t\t\t\t{ \n\t\t\t\t\t\t$view->functions = $functions; \n\t\t\t\t\t\t$controller->functions = $functions;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!$view->tofile()){ $error++; }\t\n\t\t\t\t\t\n\t\t\t\t\tif(!$controller->tofile()){ $error++; }\t\n\t\t\t\t}\n\t\t\t}\t\n\n\t\t\t$menu = new Menu();\n\t\t\t$menu->tables = MgmtEntity::find(array('order' => 'titel ASC'));\n\t\t\tif(!$menu->tofile()){ $error++; }\n\t\t\t\n\t\t\tif(!isset($error) || $error == 0)\n\t\t\t{\n\t\t\t\t$status['status'] = 'ok';\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$status['messages'] = 'Something went wrong!';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\techo json_encode($status);\n\t}", "public function initializeBackendTemplate() {}", "protected function initializeSaveAction()\n {\n $propertyMappingConfiguration = $this->arguments['event']->getPropertyMappingConfiguration();\n $propertyMappingConfiguration->forProperty('date')->setTypeConverterOption('TYPO3\\\\CMS\\\\Extbase\\\\Property\\\\TypeConverter\\\\DateTimeConverter', \\TYPO3\\CMS\\Extbase\\Property\\TypeConverter\\DateTimeConverter::CONFIGURATION_DATE_FORMAT, 'd.m.y');\n $propertyMappingConfiguration->forProperty('fromTime')->setTypeConverter($this->objectManager->get('Visol\\\\Easyvote\\\\Property\\\\TypeConverter\\\\TimestampConverter'))->setTypeConverterOption('Visol\\\\Easyvote\\\\Property\\\\TypeConverter\\\\TimestampConverter', \\Visol\\Easyvote\\Property\\TypeConverter\\TimestampConverter::CONFIGURATION_DATE_FORMAT, 'H:i');\n }", "public function actionCreate() {\n $model = new Configuration();\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 configSave()\n\t{\n\t\t$section = Mage::app()->getRequest()->getParam('section');\n\t\tif ($section == 'mtghost_design')\n\t\t{\n\t\t\t$websiteCode = Mage::app()->getRequest()->getParam('website');\n\t\t\t$storeCode = Mage::app()->getRequest()->getParam('store');\n\t\t\t\n\t\t\tMage::getSingleton('mtghost/cssgen_generator')->generateCss('design', $websiteCode, $storeCode);\n\t\t}else if($section == 'mtghost'){\n $websiteCode = Mage::app()->getRequest()->getParam('website');\n $storeCode = Mage::app()->getRequest()->getParam('store');\n\n Mage::getSingleton('mtghost/cssgen_generator')->generateCss('layout', $websiteCode, $storeCode);\n }\n\t}", "public function actionSave()\n {\n // we will get called again from\n // Tinhte_XenTag_XenForo_DataWriter_Forum::_preSave()\n $GLOBALS[Tinhte_XenTag_Constants::GLOBALS_CONTROLLERADMIN_FORUM_SAVE] = $this;\n\n return parent::actionSave();\n }", "public function saveAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t// check if form is posted\n\t\tif($this->_request->isPost())\n\t\t{\n\t\t\t$arrData = array();\n\t\t\t$arrData['layout_name'] = $this->_request->getPost('layout_name');\n\t\t\t$arrData['folder_name'] = $this->_request->getPost('folder_name');\n\t\t\t$arrData['title'] \t\t= $this->_request->getPost('title');\n\t\t\t$arrData['sections'] \t= $this->_request->getPost('sections');\n\t\t\t$arrData['thumb']\t \t= $this->_request->getPost('thumb');\n\t\t\t$id = $this->_request->getPost('id');\n\t\t\t$model->updateLayout($arrData, $id);\n\t\t\t$this->_redirect('/admin/layout/list');\n\t\t}\n\t\telse\n\t\t\t$this->_redirect('/admin/layout/list');\n\t }", "public function createAction()\n {\n $this->createEditParameters = $this->createEditParameters + $this->_createExtraParameters;\n\n parent::createAction();\n }", "public function action() {\r\n parent::action();\r\n switch (SQ_Classes_Tools::getValue('action')) {\r\n case 'sq_settingsseo_option':\r\n SQ_Classes_Tools::setHeader('json');\r\n\r\n if (!current_user_can('manage_options')) {\r\n echo json_encode(array('error' => __(\"You don't have enough pemission to activate this feature\", _SQ_PLUGIN_NAME_)));\r\n exit();\r\n }\r\n\r\n $option = SQ_Classes_Tools::getValue('option');\r\n $value = (int)SQ_Classes_Tools::getValue('value');\r\n SQ_Classes_Tools::saveOptions($option, $value);\r\n\r\n echo json_encode(array('saved' => true));\r\n exit();\r\n case 'sq_settingsseo_update':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n if (!SQ_Classes_Tools::getIsset('sq_use')) {\r\n return;\r\n }\r\n SQ_Classes_Tools::saveOptions('sq_use', (int)SQ_Classes_Tools::getValue('sq_use'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_title', (int)SQ_Classes_Tools::getValue('sq_auto_title'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_description', (int)SQ_Classes_Tools::getValue('sq_auto_description'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_keywords', (int)SQ_Classes_Tools::getValue('sq_auto_keywords'));\r\n SQ_Classes_Tools::saveOptions('sq_keywordtag', (int)SQ_Classes_Tools::getValue('sq_keywordtag'));\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_canonical', (int)SQ_Classes_Tools::getValue('sq_auto_canonical'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_noindex', (int)SQ_Classes_Tools::getValue('sq_auto_noindex'));\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_amp', (int)SQ_Classes_Tools::getValue('sq_auto_amp'));\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_meta', (int)SQ_Classes_Tools::getValue('sq_auto_meta'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_favicon', (int)SQ_Classes_Tools::getValue('sq_auto_favicon'));\r\n\r\n ///////////////////////////////////////////\r\n /////////////////////////////SOCIAL OPTION\r\n SQ_Classes_Tools::saveOptions('sq_auto_facebook', (int)SQ_Classes_Tools::getValue('sq_auto_facebook'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_twitter', (int)SQ_Classes_Tools::getValue('sq_auto_twitter'));\r\n SQ_Classes_Tools::saveOptions('sq_og_locale', SQ_Classes_Tools::getValue('sq_og_locale'));\r\n\r\n $socials = array_merge(SQ_Classes_Tools::getOption('socials'), SQ_Classes_Tools::getValue('sq_socials', array()));\r\n\r\n if (isset($socials['twitter_site'])) $socials['twitter_site'] = $this->model->checkTwitterAccount($socials['twitter_site']);\r\n if (isset($socials['twitter_site'])) $socials['twitter'] = $this->model->checkTwitterAccountName($socials['twitter_site']);\r\n if (isset($socials['facebook_site'])) $socials['facebook_site'] = $this->model->checkFacebookAccount($socials['facebook_site']);\r\n if (isset($socials['google_plus_url'])) $socials['google_plus_url'] = $this->model->checkGoogleAccount($socials['google_plus_url']);\r\n if (isset($socials['pinterest_url'])) $socials['pinterest_url'] = $this->model->checkPinterestAccount($socials['pinterest_url']);\r\n if (isset($socials['instagram_url'])) $socials['instagram_url'] = $this->model->checkInstagramAccount($socials['instagram_url']);\r\n if (isset($socials['linkedin_url'])) $socials['linkedin_url'] = $this->model->checkLinkeinAccount($socials['linkedin_url']);\r\n if (isset($socials['myspace_url'])) $socials['myspace_url'] = $this->model->checkMySpaceAccount($socials['myspace_url']);\r\n if (isset($socials['youtube_url'])) $socials['youtube_url'] = $this->model->checkYoutubeAccount($socials['youtube_url']);\r\n\r\n $fb_admins = SQ_Classes_Tools::getValue('sq_fb_admins', array());\r\n $socials['fb_admins'] = array();\r\n if (!empty($fb_admins)) {\r\n $fb_admins = array_unique($fb_admins);\r\n foreach ($fb_admins as $index => $value) {\r\n if (isset($value) && $value == '') {\r\n unset($socials['fb_admins'][$index]);\r\n } else {\r\n $socials['fb_admins'][$index]['id'] = $this->model->checkFavebookAdminCode($value);\r\n }\r\n }\r\n }\r\n\r\n //get the facebook app id for sharing\r\n if (SQ_Classes_Tools::getIsset('sq_fbadminapp')) $socials['fbadminapp'] = SQ_Classes_Tools::getValue('sq_fbadminapp');\r\n if (SQ_Classes_Tools::getIsset('twitter_card_type')) $socials['twitter_card_type'] = SQ_Classes_Tools::getValue('twitter_card_type');\r\n\r\n\r\n SQ_Classes_Tools::saveOptions(\"socials\", $socials);\r\n\r\n ///////////////////////////////////////////\r\n /////////////////////////////FIRST PAGE OPTIMIZATION\r\n if ($pageId = get_option('page_on_front')) {\r\n $sq_hash = md5($pageId);\r\n } elseif ($post_id = get_option('page_for_posts')) {\r\n $sq_hash = md5($pageId);\r\n } else {\r\n $sq_hash = md5('wp_homepage');\r\n }\r\n\r\n if ($sq_hash <> '') {\r\n $url = home_url();\r\n $sq = SQ_Classes_ObjController::getClass('SQ_Models_Frontend')->getSqSeo($sq_hash);\r\n\r\n $sq->doseo = 1;\r\n $sq->title = urldecode(SQ_Classes_Tools::getValue('sq_fp_title', false));\r\n $sq->description = urldecode(SQ_Classes_Tools::getValue('sq_fp_description', false));\r\n $sq->keywords = SQ_Classes_Tools::getValue('sq_fp_keywords', false);\r\n $sq->og_media = SQ_Classes_Tools::getValue('sq_fp_ogimage', false);\r\n\r\n $this->model->db_insert(\r\n $url,\r\n $sq_hash,\r\n (int)$pageId,\r\n maybe_serialize($sq->toArray()),\r\n gmdate('Y-m-d H:i:s')\r\n );\r\n }\r\n\r\n ///////////////////////////////////////////\r\n /////////////////////////////SITEMAP OPTION\r\n SQ_Classes_Tools::saveOptions('sq_auto_sitemap', (int)SQ_Classes_Tools::getValue('sq_auto_sitemap'));\r\n SQ_Classes_Tools::saveOptions('sq_auto_feed', (int)SQ_Classes_Tools::getValue('sq_auto_feed'));\r\n SQ_Classes_Tools::saveOptions('sq_sitemap_frequency', SQ_Classes_Tools::getValue('sq_sitemap_frequency'));\r\n SQ_Classes_Tools::saveOptions('sq_sitemap_ping', (int)SQ_Classes_Tools::getValue('sq_sitemap_ping'));\r\n SQ_Classes_Tools::saveOptions('sq_sitemap_perpage', (int)SQ_Classes_Tools::getValue('sq_sitemap_perpage'));\r\n\r\n\r\n foreach (SQ_Classes_Tools::$options['sq_sitemap'] as $key => $value) {\r\n if ($key == 'sitemap') {\r\n continue;\r\n }\r\n SQ_Classes_Tools::$options['sq_sitemap'][$key][1] = 0;\r\n if ($key == 'sitemap-product' && !$this->model->isEcommerce()) {\r\n SQ_Classes_Tools::$options['sq_sitemap'][$key][1] = 2;\r\n }\r\n }\r\n if (SQ_Classes_Tools::getIsset('sq_sitemap')) {\r\n foreach (SQ_Classes_Tools::getValue('sq_sitemap') as $key) {\r\n if (isset(SQ_Classes_Tools::$options['sq_sitemap'][$key][1])) {\r\n SQ_Classes_Tools::$options['sq_sitemap'][$key][1] = 1;\r\n }\r\n }\r\n }\r\n\r\n foreach (SQ_Classes_Tools::$options['sq_sitemap_show'] as $key => $value) {\r\n SQ_Classes_Tools::$options['sq_sitemap_show'][$key] = 0;\r\n }\r\n if (SQ_Classes_Tools::getIsset('sq_sitemap_show')) {\r\n foreach (SQ_Classes_Tools::getValue('sq_sitemap_show') as $key) {\r\n if (isset(SQ_Classes_Tools::$options['sq_sitemap_show'][$key])) {\r\n SQ_Classes_Tools::$options['sq_sitemap_show'][$key] = 1;\r\n }\r\n }\r\n }\r\n\r\n ///////////////////////////////////////////\r\n ///////SAVE THE CODE\r\n $codes = array_merge(SQ_Classes_Tools::getOption('codes'), SQ_Classes_Tools::getValue('sq_codes', array()));\r\n\r\n if (!empty($codes)) {\r\n //if (isset($codes['facebook_pixel'])) $codes['facebook_pixel'] = $codes['facebook_pixel'];\r\n if (isset($codes['google_analytics'])) $codes['google_analytics'] = $this->model->checkGoogleAnalyticsCode($codes['google_analytics']);\r\n if (isset($codes['pinterest_verify'])) $codes['pinterest_verify'] = $this->model->checkPinterestCode($codes['pinterest_verify']);\r\n if (isset($codes['google_wt'])) $codes['google_wt'] = $this->model->checkGoogleWTCode($codes['google_wt']);\r\n if (isset($codes['bing_wt'])) $codes['bing_wt'] = $this->model->checkBingWTCode($codes['bing_wt']);\r\n if (isset($codes['alexa_verify'])) $codes['alexa_verify'] = $this->model->checkBingWTCode($codes['alexa_verify']);\r\n\r\n SQ_Classes_Tools::saveOptions(\"codes\", $codes);\r\n }\r\n\r\n\r\n ///////////////////////////////////////////JSONLD\r\n SQ_Classes_Tools::saveOptions('sq_auto_jsonld', (int)SQ_Classes_Tools::getValue('sq_auto_jsonld'));\r\n if (SQ_Classes_Tools::getIsset('sq_jsonld_type') && isset(SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')])) {\r\n\r\n foreach (SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')] as $key => $value) {\r\n if (isset(SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')][$key])) {\r\n SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')][$key] = SQ_Classes_Tools::getValue('sq_jsonld_' . $key);\r\n }\r\n }\r\n if (isset(SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')]['telephone']) &&\r\n SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')]['telephone'] <> ''\r\n ) {\r\n SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')]['telephone'] = '+' . SQ_Classes_Tools::$options['sq_jsonld'][SQ_Classes_Tools::getValue('sq_jsonld_type')]['telephone'];\r\n }\r\n }\r\n SQ_Classes_Tools::saveOptions('sq_jsonld_type', SQ_Classes_Tools::getValue('sq_jsonld_type'));\r\n\r\n ///////////////////////////////////////////\r\n /////////////////////////////FAVICON OPTION\r\n\r\n /* if there is an icon to upload */\r\n if (!empty($_FILES['favicon'])) {\r\n\r\n $return = $this->model->addFavicon($_FILES['favicon']);\r\n if ($return['favicon'] <> '') {\r\n SQ_Classes_Tools::saveOptions('favicon', strtolower(basename($return['favicon'])));\r\n }\r\n if ($return['message'] <> '') {\r\n define('SQ_MESSAGE_FAVICON', $return['message']);\r\n SQ_Classes_Error::setError(SQ_MESSAGE_FAVICON . \" <br /> \");\r\n }\r\n }\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n if (SQ_Classes_Tools::isAjax()) {\r\n SQ_Classes_Tools::setHeader('json');\r\n echo json_encode(array('saved' => true));\r\n exit();\r\n } else {\r\n //Update the rewrite rules with the new options\r\n add_filter('rewrite_rules_array', array($this, 'rewrite_rules'), 999, 1);\r\n //Flush the rewrite with the new favicon and sitemap\r\n flush_rewrite_rules();\r\n //empty the cache on settings changed\r\n SQ_Classes_Tools::emptyCache();\r\n\r\n }\r\n break;\r\n case 'sq_setstickysla':\r\n SQ_Classes_Tools::saveUserMeta('sq_auto_sticky', (int)SQ_Classes_Tools::getValue('sq_auto_sticky'));\r\n\r\n break;\r\n case 'sq_checkissues':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_checkedissues', 1);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n /* Load the error class */\r\n SQ_Classes_Tools::checkErrorSettings();\r\n\r\n break;\r\n case 'sq_fixautoseo':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_use', 1);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fixprivate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n update_option('blog_public', 1);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fixcomments':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n update_option('comments_notify', 1);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fixpermalink':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n $GLOBALS['wp_rewrite'] = new WP_Rewrite();\r\n global $wp_rewrite;\r\n $permalink_structure = ((get_option('permalink_structure') <> '') ? get_option('permalink_structure') : '/') . \"%postname%/\";\r\n $wp_rewrite->set_permalink_structure($permalink_structure);\r\n $permalink_structure = get_option('permalink_structure');\r\n\r\n flush_rewrite_rules();\r\n break;\r\n case 'sq_fix_ogduplicate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_facebook', 0);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fix_tcduplicate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_twitter', 0);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fix_titleduplicate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_title', 0);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_fix_descduplicate':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_auto_description', 0);\r\n\r\n //Save the api settings for tutorial\r\n SQ_Classes_Action::apiSaveSettings();\r\n\r\n break;\r\n case 'sq_active_help' :\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('active_help', SQ_Classes_Tools::getValue('active_help'));\r\n break;\r\n case 'sq_warnings_off':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('ignore_warn', 1);\r\n break;\r\n case 'sq_copyright_agreement':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::saveOptions('sq_copyright_agreement', 1);\r\n break;\r\n case 'sq_get_snippet':\r\n\r\n if (SQ_Classes_Tools::getValue('url') <> '') {\r\n $url = SQ_Classes_Tools::getValue('url');\r\n } else {\r\n $url = get_bloginfo('url');\r\n }\r\n $snippet = SQ_Classes_Tools::getSnippet($url);\r\n\r\n SQ_Classes_Tools::setHeader('json');\r\n echo json_encode($snippet);\r\n exit();\r\n case 'sq_backup':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::setHeader('text');\r\n header(\"Content-Disposition: attachment; filename=squirrly-settings-\" . gmdate('Y-m-d') . \".txt\");\r\n\r\n if (function_exists('base64_encode')) {\r\n echo base64_encode(json_encode(SQ_Classes_Tools::$options));\r\n } else {\r\n echo json_encode(SQ_Classes_Tools::$options);\r\n }\r\n exit();\r\n break;\r\n case 'sq_restore':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n if (!empty($_FILES['sq_options']) && $_FILES['sq_options']['tmp_name'] <> '') {\r\n $fp = fopen($_FILES['sq_options']['tmp_name'], 'rb');\r\n $options = '';\r\n while (($line = fgets($fp)) !== false) {\r\n $options .= $line;\r\n }\r\n try {\r\n if (function_exists('base64_encode') && base64_decode($options) <> '') {\r\n $options = @base64_decode($options);\r\n }\r\n $options = json_decode($options, true);\r\n if (is_array($options) && isset($options['sq_api'])) {\r\n if (SQ_Classes_Tools::getOption('sq_api') <> '') {\r\n $options['sq_api'] = SQ_Classes_Tools::getOption('sq_api');\r\n }\r\n SQ_Classes_Tools::$options = $options;\r\n SQ_Classes_Tools::saveOptions();\r\n\r\n //Check if there is an old backup from Squirrly\r\n SQ_Classes_Tools::getOptions();\r\n SQ_Classes_Tools::checkUpgrade();\r\n\r\n //Update the rewrite rules with the new options\r\n add_filter('rewrite_rules_array', array($this, 'rewrite_rules'), 999, 1);\r\n //Flush the rewrite with the new favicon and sitemap\r\n flush_rewrite_rules();\r\n\r\n SQ_Classes_Error::setError(__('Great! The backup is restored.', _SQ_PLUGIN_NAME_) . \" <br /> \", 'success');\r\n } else {\r\n SQ_Classes_Error::setError(__('Error! The backup is not valid.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n } catch (Exception $e) {\r\n SQ_Classes_Error::setError(__('Error! The backup is not valid.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n } else {\r\n SQ_Classes_Error::setError(__('Error! You have to enter a previous saved backup file.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n break;\r\n case 'sq_backup_sql':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n header('Content-Type: application/octet-stream');\r\n header(\"Content-Transfer-Encoding: Binary\");\r\n header(\"Content-Disposition: attachment; filename=squirrly-seo-\" . gmdate('Y-m-d') . \".sql\");\r\n\r\n if (function_exists('base64_encode')) {\r\n echo base64_encode($this->model->createTableBackup());\r\n } else {\r\n echo $this->model->createTableBackup();\r\n }\r\n exit();\r\n break;\r\n case 'sq_restore_sql':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n if (!empty($_FILES['sq_sql']) && $_FILES['sq_sql']['tmp_name'] <> '') {\r\n $fp = fopen($_FILES['sq_sql']['tmp_name'], 'rb');\r\n $sql_file = '';\r\n while (($line = fgets($fp)) !== false) {\r\n $sql_file .= $line;\r\n }\r\n\r\n if (function_exists('base64_encode')) {\r\n $sql_file = @base64_decode($sql_file);\r\n }\r\n\r\n if ($sql_file <> '' && strpos($sql_file, 'CREATE TABLE IF NOT EXISTS') !== false) {\r\n try {\r\n $queries = explode(\";\\n\", $sql_file);\r\n $this->model->executeSql($queries);\r\n SQ_Classes_Error::setError(__('Great! The SEO backup is restored.', _SQ_PLUGIN_NAME_) . \" <br /> \", 'success');\r\n\r\n } catch (Exception $e) {\r\n SQ_Classes_Error::setError(__('Error! The backup is not valid.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n } else {\r\n SQ_Classes_Error::setError(__('Error! The backup is not valid.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n } else {\r\n SQ_Classes_Error::setError(__('Error! You have to enter a previous saved backup file.', _SQ_PLUGIN_NAME_) . \" <br /> \");\r\n }\r\n break;\r\n case 'sq_dataupgrade':\r\n //Check if there is an old backup from Squirrly\r\n SQ_Classes_Tools::getOptions();\r\n SQ_Classes_Tools::checkUpgrade();\r\n SQ_Classes_Error::setError(__('Great! Squirrly Data Settings is up to date now.', _SQ_PLUGIN_NAME_) . \" <br /> \", 'success');\r\n\r\n break;\r\n case 'sq_resetsettings':\r\n if (!current_user_can('manage_options')) {\r\n return;\r\n }\r\n\r\n SQ_Classes_Tools::$options = SQ_Classes_Tools::getOptions('reset');\r\n SQ_Classes_Tools::saveOptions();\r\n break;\r\n }\r\n }", "public function store(TemplateRequest $request)\n {\n $request['template_content'] = $request->editor1;\n Template::create($request->all());\n session()->flash('success', 'Template successfully added');\n if ($request->save == \"save\") {\n\n return redirect('configurations/template');\n } else {\n return redirect('configurations/template/create');\n }\n }", "public function action_create()\n {\n $this->action_edit(FALSE);\n }", "public function myaction()\n {\n $this->viewBuilder()->disableAutoLayout();\n $this->viewBuilder()->setTemplate('take_action');\n }", "public function saveAction()\n {\n return $this->dispatcher->forward(array('controller' => 'people', 'action' => 'index'));\n }", "public function saveTemplate ()\n {\n // Recovering template data object\n $template = json_decode(Input::get('template'));\n\n //Defining custom validator to work with $template JSON object and not a Request object\n $validator = Validator::make((array)$template, [\n 'name_template' => array('required', 'regex:/^[a-zA-ZáéíóúÁÉÍÓÚñÑ1-9][a-zA-ZáéíóúÁÉÍÓÚñÑ1-9 ]{3,50}$/'),\n 'html' => array('required'),//,'regex:/((<script>){1}.*(<\\/script>){1})/'\n 'icon' => array('required'),\n 'gridster' => array('required')\n ]);\n\n // Returning fail message if validation fails\n if ($validator->fails()) {\n return response()->json([\n 'status' => 'fail'\n ], 200);\n }\n // Saving template if validation success\n else {\n // If the html have any script tag, delete it\n $html = $template->html;\n if ($html . contains(\"&lt;script&gt;\")) {\n $html = preg_replace('/((&lt;script&gt;){1}.*(&lt;\\/script&gt;){1})/', \"\", $html);\n }\n\n // Save data at database\n Ezz_template::create(array(\n 'name_template' => $template -> name_template,\n 'html' => $html,\n 'html_edit' => $template -> html_edit,\n 'icon' => $template -> icon,\n 'gridster' => $template -> gridster\n ));\n\n // Returning success message\n return response()->json([\n 'status' => 'success'\n ], 200);\n }\n }", "public function save(LabelTemplate $labelTemplate);", "public function editEbayTemplate()\n\t{\n\t\tGetLib('class.json');\n\n\t\t$templateId = (int)$_GET['templateId'];\n\n\t\ttry {\n\t\t\t$template = new ISC_ADMIN_EBAY_TEMPLATE($templateId);\n\n\t\t\t$this->template->assign('templateId', $templateId);\n\n\t\t\t$this->template->assign('formTitle', GetLang('EditEbayTemplate'));\n\t\t\t$this->template->assign('hasStore', (bool)GetConfig('EbayStore'));\n\n\t\t\t$this->template->assign('ebaySites', $this->getSupportedSites());\n\t\t\t$this->template->assign('siteId', $template->getSiteId());\n\t\t\t$this->template->assign('templateName', $template->getTemplateName());\n\t\t\t$this->template->assign('templateIsDefault', $template->isDefaultTemplate());\n\t\t\t$this->template->assign('isPrivateListing', $template->isPrivateListing());\n\n\t\t\t// setup category details\n\t\t\t$primaryCategoryOptions = $template->getPrimaryCategoryOptions();\n\t\t\t$secondaryCategoryOptions = $template->getSecondaryCategoryOptions();\n\t\t\t$this->template->assign('primaryCategory', $primaryCategoryOptions['path']);\n\t\t\t$this->template->assign('primaryCategoryOptions', ISC_JSON::encode($primaryCategoryOptions));\n\t\t\t$this->template->assign('categoryOptions', $primaryCategoryOptions);\n\t\t\t$this->template->assign('sellingMethod', $template->getSellingMethod());\n\n\t\t\ttry {\n\t\t\t\tif (empty ($secondaryCategoryOptions)) {\n\t\t\t\t\t$secondaryCategoryId = $template->getSecondaryCategoryId();\n\t\t\t\t\tif (!empty ($secondaryCategoryId)) {\n\t\t\t\t\t\t$secondaryCategoryOptions = '';\n\t\t\t\t\t\t$secondaryCategoryOptions = ISC_ADMIN_EBAY_CATEGORIES::getCategoryFeatures($secondaryCategoryId, $template->getSiteId());\n\t\t\t\t\t\t$categoryPath = ISC_ADMIN_EBAY_CATEGORIES::getFormattedCategoryPath($secondaryCategoryId, $template->getSiteId());\n\t\t\t\t\t\t$secondaryCategoryOptions['path'] = $categoryPath;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$secondaryCategoryOptions = ISC_ADMIN_EBAY_CATEGORIES::getCategoryOptionsFromId($template->getSecondaryCategoryId(), $template->getSiteId());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception $ex) {\n\t\t\t\t$secondaryCategoryOptions = array(\n\t\t\t\t\t'category_id'\t=> $template->getSecondaryCategoryId(),\n\t\t\t\t\t'name'\t\t\t=> $template->getSecondaryCategoryName(),\n\t\t\t\t\t'path'\t\t\t=> $template->getSecondaryCategoryName(),\n\t\t\t\t);\n\t\t\t}\n\n\n\t\t\tif ($secondaryCategoryOptions) {\n\t\t\t\t$this->template->assign('secondaryCategoryOptionsData', $secondaryCategoryOptions);\n\t\t\t\t$this->template->assign('secondaryCategory', $secondaryCategoryOptions['path']);\n\t\t\t}\n\t\t\t$secCatNotSupportVariations = (isset ($secondaryCategoryOptions['variations_supported']) && $secondaryCategoryOptions['variations_supported'] == 0);\n\t\t\t$this->template->assign('secCatSelectedNotSupportVariations', ($secCatNotSupportVariations));\n\t\t\t$this->template->assign('secondaryCategoryOptions', ISC_JSON::encode($secondaryCategoryOptions));\n\t\t\t$this->template->assign('categoryFeaturesList', $this->template->render('ebay.template.featureslist.tpl'));\n\n\t\t\t$primaryStoreCategoryOptions = array();\n\t\t\tif ($template->getPrimaryStoreCategoryId()) {\n\t\t\t\t$primaryStoreCategoryOptions = array(\n\t\t\t\t\t'category_id'\t=> $template->getPrimaryStoreCategoryId(),\n\t\t\t\t\t'name'\t\t\t=> $template->getPrimaryStoreCategoryName(),\n\t\t\t\t\t'path'\t\t\t=> $template->getPrimaryStoreCategoryName(),\n\t\t\t\t);\n\n\t\t\t\t$this->template->assign('primaryStoreCategory', $primaryStoreCategoryOptions['path']);\n\t\t\t}\n\t\t\t$this->template->assign('primaryStoreCategoryOptions', ISC_JSON::encode($primaryStoreCategoryOptions));\n\n\t\t\t$secondaryStoreCategoryOptions = array();\n\t\t\tif ($template->getSecondaryStoreCategoryId()) {\n\t\t\t\t$secondaryStoreCategoryOptions = array(\n\t\t\t\t\t'category_id'\t=> $template->getSecondaryStoreCategoryId(),\n\t\t\t\t\t'name'\t\t\t=> $template->getSecondaryStoreCategoryName(),\n\t\t\t\t\t'path'\t\t\t=> $template->getSecondaryStoreCategoryName(),\n\t\t\t\t);\n\n\t\t\t\t$this->template->assign('secondaryStoreCategory', $secondaryStoreCategoryOptions['path']);\n\t\t\t}\n\t\t\t$this->template->assign('secondaryStoreCategoryOptions', ISC_JSON::encode($secondaryStoreCategoryOptions));\n\n\t\t\t$this->template->assign('sellingMethod', $template->getSellingMethod());\n\t\t}\n\t\tcatch (Exception $ex) {\n\t\t\tFlashMessage($ex->getMessage(), MSG_ERROR, 'index.php?ToDo=viewEbay');\n\t\t}\n\n\t\t$GLOBALS['BreadcrumEntries'][GetLang('EditEbayTemplate')] = 'index.php?ToDo=editEbayTemplate';\n\t\t$this->engine->PrintHeader();\n\t\t$this->template->display('ebay.template.form.tpl');\n\t\t$this->engine->PrintFooter();\n\t}", "public function universal()\n {\n if (!get_permission('global_settings', 'is_view')) {\n access_denied();\n }\n\n if ($_POST) {\n if (!get_permission('global_settings', 'is_edit')) {\n access_denied();\n }\n }\n\n $config = array();\n if ($this->input->post('submit') == 'setting') {\n foreach ($this->input->post() as $input => $value) {\n if ($input == 'submit') {\n continue;\n }\n $config[$input] = $value;\n }\n if (empty($config['reg_prefix'])) {\n $config['reg_prefix'] = false;\n }\n $this->db->where('id', 1);\n $this->db->update('global_settings', $config);\n set_alert('success', translate('the_configuration_has_been_updated'));\n redirect(current_url());\n }\n\n if ($this->input->post('submit') == 'theme') {\n foreach ($this->input->post() as $input => $value) {\n if ($input == 'submit') {\n continue;\n }\n $config[$input] = $value;\n }\n $this->db->where('id', 1);\n $this->db->update('theme_settings', $config);\n set_alert('success', translate('the_configuration_has_been_updated'));\n $this->session->set_flashdata('active', 2);\n redirect(current_url());\n }\n\n if ($this->input->post('submit') == 'logo') {\n move_uploaded_file($_FILES['logo_file']['tmp_name'], 'uploads/app_image/logo.png');\n move_uploaded_file($_FILES['text_logo']['tmp_name'], 'uploads/app_image/logo-small.png');\n move_uploaded_file($_FILES['print_file']['tmp_name'], 'uploads/app_image/printing-logo.png');\n move_uploaded_file($_FILES['report_card']['tmp_name'], 'uploads/app_image/report-card-logo.png');\n\n move_uploaded_file($_FILES['slider_1']['tmp_name'], 'uploads/login_image/slider_1.jpg');\n move_uploaded_file($_FILES['slider_2']['tmp_name'], 'uploads/login_image/slider_2.jpg');\n move_uploaded_file($_FILES['slider_3']['tmp_name'], 'uploads/login_image/slider_3.jpg');\n\n set_alert('success', translate('the_configuration_has_been_updated'));\n $this->session->set_flashdata('active', 3);\n redirect(current_url());\n }\n\n $this->data['title'] = translate('global_settings');\n $this->data['sub_page'] = 'settings/universal';\n $this->data['main_menu'] = 'settings';\n $this->data['headerelements'] = array(\n 'css' => array(\n 'vendor/dropify/css/dropify.min.css',\n ),\n 'js' => array(\n 'vendor/dropify/js/dropify.min.js',\n ),\n );\n $this->load->view('layout/index', $this->data);\n }", "public function saveConfVars()\n {\n if ($this->getEditObjectId() === 'findologic_module') {\n $this->_saveConfVars();\n } else {\n parent::saveConfVars();\n }\n }", "public function save() {\n\t\t$vars = $this->vars;\n\t\t$this->copyFromTemplateIfNeeded();\n\t\t$lines = file($this->filePath);\n\t\tforeach ($lines as $key => $line) {\n\t\t\tif (preg_match(\"/^(.+)vars\\[('|\\\")(.+)('|\\\")](.*)=(.*)\\\"(.*)\\\";(.*)$/si\", $line, $arr)) {\n\t\t\t\t$lines[$key] = \"$arr[1]vars['$arr[3]']$arr[5]=$arr[6]\\\"{$vars[$arr[3]]}\\\";$arr[8]\";\n\t\t\t\tunset($vars[$arr[3]]);\n\t\t\t} elseif (preg_match(\"/^(.+)vars\\[('|\\\")(.+)('|\\\")](.*)=([ \t]+)([0-9]+);(.*)$/si\", $line, $arr)) {\n\t\t\t\t$lines[$key] = \"$arr[1]vars['$arr[3]']$arr[5]=$arr[6]{$vars[$arr[3]]};$arr[8]\";\n\t\t\t\tunset($vars[$arr[3]]);\n\t\t\t}\n\t\t}\n\n\t\tunset($vars['module_load_paths']); // hacky\n\n\t\t// if there are additional vars which were not present in the config\n\t\t// file or in template file then add them at end of the config file\n\t\tif (!empty($vars)) {\n\t\t\t$lines []= \"<?php\\n\";\n\t\t\tforeach ($vars as $name => $value) {\n\t\t\t\tif (is_string($value)) {\n\t\t\t\t\t$lines []= \"\\$vars['$name'] = \\\"$value\\\";\\n\";\n\t\t\t\t} else {\n\t\t\t\t\t$lines []= \"\\$vars['$name'] = $value;\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$lines []= \"\\n\";\n\t\t}\n\n\t\tfile_put_contents($this->filePath, $lines);\n\t}", "public function process_bulk_action() {\n\n if ( ! isset( $_REQUEST[ 'template' ] ) ) {\n return;\n }\n \n switch( strtolower( $this->current_action() ) ){\n case 'activate':\n do_action( 'aal_action_activate_templates', ( array ) $_REQUEST[ 'template' ], true );\n break;\n case 'deactivate':\n do_action( 'aal_action_deactivate_templates', ( array ) $_REQUEST[ 'template' ], true );\n break; \n default:\n return; // do nothing.\n }\n\n // Reload the page.\n exit( \n wp_safe_redirect( \n add_query_arg( \n array(\n 'post_type' => AmazonAutoLinks_Registry::$aPostTypes[ 'unit' ],\n 'page' => AmazonAutoLinks_Registry::$aAdminPages[ 'template' ],\n 'tab' => 'table',\n ), \n admin_url( $GLOBALS[ 'pagenow' ] ) \n )\n )\n );\n \n }", "public function admin_save()\r\n\t{\r\n\t\tif ($this->Coupon->saveAll($this->data))\r\n\t\t{\r\n\t\t\t$id = (empty($this->data['Coupon']['id'])) ? $this->Coupon->getInsertID() : $this->data['Coupon']['id'];\r\n\r\n\t\t\t$this->Session->setFlash('Record saved.', 'default', array('class' => 'success'));\r\n\t\t\t$this->redirect('/admin/coupons/edit/' . $id);\t\r\n\t\t}\r\n\t\t\r\n\t\t$this->Session->setFlash('Record could not be saved. Please check the form for errors.', 'default', array('class' => 'failure'));\r\n\t\treturn $this->setAction('admin_edit');\t\r\n\r\n\t}", "public function generate() {\n $this->event->getIO()->write(\"<info>Generate settings file:</info>\");\n\n $parameters = $this->getParameters();\n if ($parameters) {\n $new_settings = $this->twigEnvironment->render($this->getTemplateFilename(), $this->getReplacements($parameters));\n $target_settings_file = $this->getDestinationPath() . '/' . $this->getDestinationFile();\n\n // Ensure folder and existing file is writable.\n chmod($this->getDestinationPath(), 0755);\n if (file_exists($target_settings_file)) {\n chmod($target_settings_file, 0644);\n }\n\n file_put_contents($target_settings_file, $new_settings);\n }\n else {\n $this->event->getIO()->write(\"<error>Unable to find any parameters files</error>\");\n }\n }", "public function indexAction()\n\t{\n\t\t// Get the current configuration and\n\t\t// show a form for editing it\n\t\t$this->view->config = $this->adminService->getSystemConfig();\n\t\t$this->renderView('admin/config.php');\n\t}", "public function adminCreateTemplateConfigurationService($model) {\n try {\n \n $returnValue = 'failure';\n $userObj = $this->checkIfTemplateTitleExist($model);\n if(isset($userObj))\n {\n if(isset($model->id) && !empty($model->id) )\n {\n //update\n if($userObj->id == $model->id)\n {\n //allow\n $templateConfigDetailsId = TemplateManagement::model()->updateTemplateConfigurationDetails($model); \n if ($templateConfigDetailsId =='updatetrue') {\n $returnValue = 'updatesuccess';\n }\n }\n else\n {\n //not allow\n $returnValue = 'emailexists';\n }\n }\n else\n {\n //not allow\n $returnValue = 'emailexists';\n }\n }\n else\n {\n //insert\n $templateConfigDetailsId = TemplateManagement::model()->saveNewTemplateConfigurationDetails($model);\n if($templateConfigDetailsId !='false' && $templateConfigDetailsId !='updatetrue' )\n {\n $returnValue = 'success'; \n }\n }\n } catch (Exception $ex) {\n Yii::log(\"SkiptaUserService:adminCreateTemplateConfigurationService::\".$ex->getMessage().\"--\".$ex->getTraceAsString(), 'error', 'application');\n \n }\n return $returnValue;\n }", "public function perform()\n {\n // assign header var with css definitions\n $this->viewVar['htmlHeaderData'] .= $this->controllerLoader->defaultMainCss();\n $this->viewVar['htmlTitle'] .= ' Articles general settings';\n // select advanced link\n $this->viewVar['selectedMenuItem'] = 'advanced';\n\n $this->viewVar['error'] = array();\n $this->viewVar['status'] = array();\n\n $this->fields = array();\n\n $updateOptions = $this->httpRequest->getParameter('updateOptions', 'post', 'alnum');\n $cancel = $this->httpRequest->getParameter('cancel', 'post', 'alnum');\n $save = $this->httpRequest->getParameter('save', 'post', 'alnum');\n $status = $this->httpRequest->getParameter('status', 'get', 'alnum');\n\n if(!empty($updateOptions) || !empty($save))\n {\n if(true == $this->validatePostData())\n {\n $this->model->action( 'common','setConfigVar',\n array('data' => $this->fields,\n 'module' => 'article'));\n\n if(!empty($updateOptions))\n {\n $this->router->redirect( $this->controllerVar['adminWebController'].'/mod/default/cntr/advancedMain' );\n }\n else\n {\n $this->router->redirect( $this->controllerVar['adminWebController'].'/mod/article/cntr/options/status/saved' );\n }\n }\n }\n elseif(!empty($cancel))\n {\n // redirect to the parent node of my site\n $this->router->redirect($this->viewVar['adminWebController'].'/mod/default/cntr/advancedMain');\n }\n elseif(!empty($status))\n {\n $this->viewVar['htmlTitle'] .= '. Status: updated settings';\n $this->viewVar['status'][] = 'Updated settings';\n }\n\n // assign view vars of options\n $this->viewVar['option'] = $this->config->getModuleArray( 'article' );\n }", "public function savesubmit(){\n\t\t$this->autoRender = false;\n\t\t if($this->request->is('POST')){ \n\t\t\t //\n\t\t \n\t\t\t$this->Session->write('project.aftersave', 'sent');\n//\t\t\t$this->Session->write('brief.type', $this->name);\n\t\t\t$this->Session->write('brief.type', $this->params['controller']);\n\t\t\t$this->Session->write('brief.id', $this->Email->id);\n\t\t\t \n\t\t\t \n\t\t\t//echo 'aftersave';\t\n\t\t\t //$this->redirect(array('controller'=>'projects', 'action' => 'view', $this->Session->read('project.id') ));\n\n\t\t }\t\t\n\t}", "protected function handleFormAction(): void\n {\n $action = $_REQUEST['action'] ?? null;\n $editableColumns = $this->editableColumns();\n\n $isFormAction = in_array($action, ['edit', 'create']);\n $isAdmin = current_user_can('manage_options');\n $shouldSkip = 'GET' === $_SERVER['REQUEST_METHOD']\n || empty($_POST)\n || is_null($action);\n\n if ($shouldSkip || !$isFormAction || !$isAdmin) {\n return;\n }\n\n try {\n $this->validateEditableColumns($editableColumns, $_POST);\n } catch (\\Throwable $e) {\n $this->displayResourceNotice($e->getMessage());\n return;\n }\n\n $primaryKey = $this->newModel()->getPrimaryColumn();\n preg_match('/\\w+/', $_POST[$primaryKey] ?? '', $matches);\n\n $resourceId = $matches[0] ?? '';\n $values = $this->filterGuardedAttributes($editableColumns, $_POST);\n\n $model = !strlen($resourceId)\n ? $this->newModel()\n : $this->model::find($resourceId);\n\n $model->fill($values);\n $model->saveOrUpdate();\n\n $this->displayResourceNotice('Resource was updated', 'success');\n\n // to display the edit page after creating new resources\n if ($action === 'create') {\n $this->model = $model;\n }\n }", "public function execute()\n {\n /** @var \\Magento\\Backend\\Model\\View\\Result\\Redirect $resultRedirect */\n $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);\n $data = $this->getRequest()->getPostValue();\n $newData = $this->customData->create()->load($data['custom_entity_id']);\n try {\n if (isset($data['image_full'][0]['url'])) {\n $data['image_full'] = $data['image_full'][0]['url'];\n }\n if (isset($data['image_thumbnail'][0]['url'])) {\n $data['image_thumbnail'] = $data['image_thumbnail'][0]['url'];\n }\n $newData->setData($data);\n $newData->save();\n $this->messageManager->addSuccessMessage(__('Changes Saved Successfully'));\n $this->_getSession()->setFormData(false);\n return $resultRedirect->setPath('*/*/');\n } catch (\\Exception $e) {\n $this->messageManager->addErrorMessage($e->getMessage());\n return $resultRedirect->setPath('*/*/');\n }\n }", "function save_as_template_plan(){\n $replace['new_name'] = trim($this->value('new_name'));\n $replace['javascriptAlert'] = \"\";\n $replace['plan_id'] = $this->value('plan_id');\n \n $user_id = $this->userInfo('user_id');\n if( $this->value('submit_action') == \"Submit\" ){\n if($replace['new_name'] != \"\"){\n $query = \"select count(*) from plan p \n where p.user_id = '{$user_id}' and p.user_type = '2' \n and p.patient_id is null and p.status = 1 \n and p.plan_name = '{$replace['new_name']}' \"; \n $result = @mysql_query($query);\n $count = @mysql_result($result,0);\n if( $count > 0 ){\n $replace['javascriptAlert'] = \"alert('Template name already exist.')\";\n }\n else{\n if( is_numeric($user_id) && is_numeric($replace['plan_id'] )){ \n $this->copy_plan( $user_id, $replace['plan_id'], $replace['new_name']);\n $replace['javascriptAlert'] = \"parent.parent.GB_CURRENT.hide();\";\n $replace['javascriptAlert'] .= \"top.location = 'index.php?action=therapistPlan';\";\n }\n else{\n $replace['javascriptAlert'] = \"alert('Failed to copy Template plan.')\";\n }\n }\n }\n }\n $this->output = $this->build_template($this->get_template(\"save_as_template\"),$replace);\n }", "public function actionCreate()\n {\n $model = new PrintTemplate();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', __('Your changes have been saved successfully.'));\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n $model->validate(['margin_top', 'margin_bottom', 'margin_left', 'margin_right', 'wrapper']);\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function save()\n\t{\n\t\t$this->componentConfig->save();\n\t}", "public function save_email_template(){\t\n\t\t\t$user_id = $this->session->userdata('id');\n\t\t\t$role = $this->session->userdata('role');\n\t\t\t$id = $this->input->post('template_id');\n\t\t\t$name = $this->input->post('template_name');\n\t\t\t$subject = $this->input->post('template_subject');\n\t\t\t$attachment = $this->input->post('attachment');\n\t\t\t$content = htmlentities($this->input->post('content'));\n\t\t\tif( !empty($id) && ($role=='admin')):\n\t\t$this->InteractModal->add_user_meta( $user_id, 'subject_template_id_'.$id , $subject );\n\t\tif(!empty($attachment)){\n\t\t\t$this->InteractModal->add_user_meta( $user_id, 'attach_template_id_'.$id , $attachment );\n\t\t}\n\t\t$response = $this->InteractModal->add_user_meta( $user_id, 'content_template_id_'.$id,$content );\n\t\t\t\tif(!empty($response)):\n\t\t\t\t\t$this->session->set_flashdata('msg', 'Update successfully');\n\t\t\t\telse:\n\t\t\t\t\t$this->session->set_flashdata('msg', 'Template Update Error! Try Again');\n\t\t\t\tendif;\n\t\t\t\tredirect( base_url( 'Interact/user_all_email_template'));\t\t\t\t\n\t\t\telse:\n\t\t\t\tredirect( base_url( 'Interact/login' ));\n\t\t\tendif;\n\t}", "function saveConfiguration() {\n//\t\t$field_value = DevblocksPlatform::importGPC($_POST['field_value']);\n//\t\t$this->params['field_name'] = $field_value;\n\t}", "public function postDispatch()\n\t{\n\t\t// Non-OPT views are ignored.\n\t\tif(! $this->_actionController->view instanceof Opt_View)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t// Set the default name, if not specified.\n\t\tif($this->_actionController->view->getTemplate() == '')\n\t\t{\n\t\t\t$request = $this->getRequest();\n\t\t\t$this->_actionController->view->setTemplate(strtolower($this->_lastController).'/'.strtolower($this->_lastAction).'.tpl');\n\t\t}\n\t\t// If it has been already added somewhere, skip.\n\t\tif(!is_null($this->_actionController->view->placeholder))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Add the view object to the default placeholder.\n\t\t$layout = Invenzzia_Layout::getMvcInstance();\n\t\t$layout->appendView($this->_actionController->view);\n\t}", "public function finalize() {\n\n\t\t// template debug\n\t\tif ($this->config) {\n\t\t\tif ($this->config->get('storefront_template_debug')) {\n\t\t\t\t// storefront enabling\n\t\t\t\tif (!IS_ADMIN && !isset($this->session->data['tmpl_debug']) && isset($this->request->get['tmpl_debug'])) {\n\t\t\t\t\t$this->session->data['tmpl_debug'] = isset($this->request->get['tmpl_debug']);\n\t\t\t\t}\n\n\t\t\t\tif ((isset($this->session->data['tmpl_debug']) && isset($this->request->get['tmpl_debug'])) && ($this->session->data['tmpl_debug'] == $this->request->get['tmpl_debug'])) {\n\n\t\t\t\t\t$block_details = $this->layout->getBlockDetails($this->instance_id);\n\t\t\t\t\t$excluded_blocks = array( 'common/head' );\n\n\t\t\t\t\tif (!empty($this->instance_id) && (string)$this->instance_id != '0' && !in_array($block_details['controller'], $excluded_blocks)) {\n\t\t\t\t\t\tif (!empty($this->parent_controller)) {\n\t\t\t\t\t\t\t//build block template file path based on primary template used\n\t\t\t\t\t\t\t//template path is based on parent block 'template_dir'\n\t\t\t\t\t\t\t$tmp_dir = $this->parent_controller->view->data['template_dir'].\"template/\";\n\t\t\t\t\t\t\t$block_tpl_file = $tmp_dir.$this->view->getTemplate();\n\t\t\t\t\t\t\t$prt_block_tpl_file = $tmp_dir.$this->parent_controller->view->getTemplate();\n\t\t\t\t\t\t\t$args = array( 'block_id' => $this->instance_id,\n\t\t\t\t\t\t\t\t\t\t\t'block_controller' => $this->dispatcher->getFile(),\n\t\t\t\t\t\t\t\t\t\t\t'block_tpl' => $block_tpl_file,\n\t\t\t\t\t\t\t\t\t\t\t'parent_id' => $this->parent_controller->instance_id,\n\t\t\t\t\t\t\t\t\t\t\t'parent_controller' => $this->parent_controller->dispatcher->getFile(),\n\t\t\t\t\t\t\t\t\t\t\t'parent_tpl' => $prt_block_tpl_file\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$debug_wrapper = $this->dispatch('common/template_debug', array( 'instance_id' => $this->instance_id, 'details' => $args ));\n\t\t\t\t\t\t\t$debug_output = $debug_wrapper->dispatchGetOutput();\n\t\t\t\t\t\t\t$output = trim($this->view->getOutput());\n\t\t\t\t\t\t\tif (!empty($output)) $output = '<span class=\"block_tmpl_wrapper\">' . $output . $debug_output . '</span>';\n\t\t\t\t\t\t\t$this->view->setOutput($output);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tunset($this->session->data['tmpl_debug']);\n\t\t\t}\n\t\t}\n\t\t$this->view->render();\n\t}", "public function actionCreate()\n {\n $model = new ConfigConstant();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"action\" => \"index\"\n ));\n }\n\n $type_id = $this->request->getPost(\"type_id\");\n\n $itemsType = ItemsType::findFirstBytype_id($type_id);\n if (!$itemsType) {\n $this->flash->error(\"Items Type does not exist \" . $type_id);\n\n return $this->dispatcher->forward(array(\n \"action\" => \"index\"\n ));\n }\n\n $itemsType->code = $this->request->getPost(\"code\");\n $itemsType->name = $this->request->getPost(\"name\");\n \n\n if (!$itemsType->save()) {\n\n foreach ($itemsType->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"action\" => \"edit\",\n \"params\" => array($itemsType->type_id)\n ));\n }\n\n $this->flash->success(\"Items Type was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"action\" => \"index\"\n ));\n\n }", "function saveEditQuoteFinalStepAction()\n\t{\n\n\t\tif($this->_request->isPost())\n\t\t{\n\n\t\t\t$final_parameters=$this->_request->getParams();\n\n\t\t\t$quote_id=$final_parameters['quote_id'];\n\n\t\t\t//echo \"<pre>\";print_r($final_parameters);exit;\n\n\t\t\tif($quote_id)\n\t\t\t{\n\t\t\t\n\t\t\t\t$quote_obj=new Ep_Quote_Quotes();\n\t\t\t\t$quoteDetails=$quote_obj->getQuoteDetails($quote_id);\n\n\t\t\t\t$quotes_update_data = array();\n\t\t\t\t$quotes_update_data['sales_comment']=$final_parameters['bo_comments'];\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(count($_FILES['quote_documents']['name'])>0)\t\n\t\t\t\t{\n\t\t\t\t\t$update = false;\n\t\t\t\t\t$documents_path=array();\n\t\t\t\t\t$documents_name=array();\n\t\t\t\t\tforeach($_FILES['quote_documents']['name'] as $index=>$quote_files)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($_FILES['quote_documents']['name'][$index]):\n\t\t\t\t\t\t//upload quote documents\n\t\t\t\t\t\n\t\t\t\t\t\t$quoteDir=$this->quote_documents_path.$quoteIdentifier.\"/\";\n\t\t\t if(!is_dir($quoteDir))\n\t\t\t mkdir($quoteDir,TRUE);\n\t\t\t chmod($quoteDir,0777);\n\t\t\t $document_name=frenchCharsToEnglish($_FILES['quote_documents']['name'][$index]);\n\t\t\t\t\t\t$pathinfo = pathinfo($document_name);\n\t\t\t\t\t\t$document_name =$pathinfo['filename'].rand(100,1000).\".\".$pathinfo['extension'];\n\t\t\t $document_name=str_replace(' ','_',$document_name);\n\t\t\t $document_path=$quoteDir.$document_name;\n\t\t\t if (move_uploaded_file($_FILES['quote_documents']['tmp_name'][$index], $document_path))\n\t\t\t chmod($document_path,0777);\n\n\t\t\t\t\t\t\t$update = true;\n\t\t\t $documents_path[]=$quoteIdentifier.\"/\".$document_name;\n\t\t\t $documents_name[]= str_replace('|',\"_\",$final_parameters['document_name'][$index]);\n\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t $uploaded_documents1 = explode(\"|\",$quoteDetails[0]['documents_path']);\n\t\t\t\t\t $documents_path =array_merge($documents_path,$uploaded_documents1);\n\t\t\t\t\t $quotes_update_data['documents_path']=implode(\"|\",$documents_path);\n\t\t\t\t\t $document_names =explode(\"|\",$quoteDetails[0]['documents_name']);\n\t\t\t\t\t $documents_name =array_merge($documents_name,$document_names);\n\t\t\t\t\t $quotes_update_data['documents_name']=implode(\"|\",$documents_name);\n\t\t \n\t\t\t }\n\n\t\t\t $status=$quoteDetails[0]['sales_review'];\n\t\t\t\tif($status=='not_done')\n\t\t\t\t\t$status='';\n\t\t\t //echo \"<pre>\";print_r($quotes_update_data);exit;\n\n\t\t\t $quote_obj->updateQuote($quotes_update_data,$quote_id);\n\n\t\t\t $this->_redirect(\"/quote/sales-quotes-list?submenuId=ML13-SL2&active=\".$status);\n\t\t\t} \n\t\t}\n\t}", "function btpay_post_action()\n {\n global $wpdb;\n if (!empty($_POST))\n {\n if (isset($_POST['update_config']))\n {\n $id = $_POST['update_config'];\n btpay_handle_config_update();\n include BT_PLUGIN_DIR . '/pages/btpay-config-page.php';\n }\n }\n else\n {\n include BT_PLUGIN_DIR . '/pages/btpay-config-page.php';\n }\n }", "public function actionCreate()\n\t{\n\t\t$this->actionRegister();\n\t\t/*\n\t\tif (isset($_GET['newModel']) && isset(Yii::app()->session[$this->createBackup.'_Time']) && $_GET['newModel']>Yii::app()->session[$this->createBackup.'_Time']){\n\t\t\t\tunset(Yii::app()->session[$this->createBackup]);\n\t\t\t\tunset(Yii::app()->session[$this->createBackup.'_Time']);\n\t\t\t\tunset($_GET['newModel']);\n\t\t}\n\t\t$this->prepareCreateOrUpdate(null, 'create');\n\t\t*/\n\t}", "public static function use_parent_template() {\n add_action('save_post', array('core_admin', 'switch_page_template'));\n }", "public function save_country_settings() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n if ($this->checkPrivileges('admin', '2') == TRUE) {\n $condition = array('admin_id' => '1');\n $this->admin_model->commonInsertUpdate(ADMIN, 'update', array(), array(), $condition);\n $countryId = $this->input->post(\"countryId\");\n $config = '<?php ';\n foreach ($this->data['countryList'] as $country) {\n if ($countryId == $country->_id) {\n $countryName = addslashes($country->name);\n $config .= \"\\n\\$config['countryId'] = '$country->_id'; \";\n $config .= \"\\n\\$config['countryName'] = '$countryName'; \";\n $config .= \"\\n\\$config['countryCode'] = '$country->cca3'; \";\n $config .= \"\\n\\$config['dialCode'] = '$country->dial_code'; \";\n }\n }\n $config .= \"\\n ?>\";\n $file = 'commonsettings/dectar_country_settings.php';\n file_put_contents($file, $config);\n $this->setErrorMessage('success', 'Country settings updated successfully','admin_adminlogin_country_setting_updated');\n redirect(ADMIN_ENC_URL.'/adminlogin/admin_country_settings');\n } else {\n redirect(ADMIN_ENC_URL);\n }\n }\n }", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('ifeedback')) {\n try {\n $ifeedback = $this->_initIfeedback();\n $ifeedback->addData($data);\n $ifeedback->save();\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.'.$this->getJsObjectName().'.reload(); window.close()</script>';\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_kst')->__('Instructor Feedback was successfully saved. %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $ifeedback->getId()));\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setIfeedbackData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_kst')->__('There was a problem saving the instructor feedback.')\n );\n Mage::getSingleton('adminhtml/session')->setIfeedbackData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_kst')->__('Unable to find instructor feedback to save.')\n );\n $this->_redirect('*/*/');\n }", "function layout_builder_post_update_override_entity_form_controller() {\n // Empty post-update hook.\n}", "function container_ctools_content_types_container_template_edit_form_submit($form, &$form_state) {\n $defaults = array();\n if (isset($form_state['subtype']['defaults'])) {\n $defaults = $form_state['subtype']['defaults'];\n }\n elseif (isset($form_state['plugin']['defaults'])) {\n $defaults = $form_state['plugin']['defaults'];\n }\n\n foreach (array_keys($defaults) as $key) {\n $form_state['conf'][$key] = $form_state['values'][$key];\n }\n}", "public function afterTemplate(){\n\t\t//defaults to empty\n\t}", "public function store()\n {\n // * route: /template [POST]\n\n // echo __FUNCTION__;\n // print_r($data);\n\n // $this->render('user.index');\n }", "public function afterSave()\n\t{\n\t\t//annoying on every edit, move to a checkbox on form and handle in controller\n\t}", "public function autosave() {\n\t $this->use_layout=false;\n\t $this->use_view=false;\n\t $content = new $this->model_class(Request::get(\"id\"));\n\t if($content->primval) {\n\t $content->update_attributes($_POST[\"cms_content\"]);\n\t echo date(\"H:i:s\");\n\t }else{\n\t throw new WXRoutingException('Tried to save in a non-existing database entry!', \"Page not found\", '404');\n\t }\n\t exit;\n\t}", "public function saveMethodAction()\n {\n parent::saveMethodAction();\n if ($this->_isActive() && $this->getRequest()->isPost()) {\n $result = Mage::helper('core')->jsonDecode(\n $this->getResponse()->getBody()\n );\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(\n Mage::helper('core')->jsonEncode($result)\n );\n }\n }", "public function actionSettingsIndexTemplate()\n\t{\n\t\t$settingsModel = new SproutForms_SettingsModel;\n\n\t\t$settings = craft()->db->createCommand()\n\t\t\t->select('settings')\n\t\t\t->from('plugins')\n\t\t\t->where('class=:class', array(':class'=> 'SproutForms'))\n\t\t\t->queryScalar();\n\n\t\t$settings = JsonHelper::decode($settings);\n\t\t$settingsModel->setAttributes($settings);\n\n\t\t$variables['settings'] = $settingsModel;\n\n\t\t// Load our template\n\t\t$this->renderTemplate('sproutforms/settings', $variables);\n\n\t}", "public function editAction()\n {\n $this->createEditParameters = $this->createEditParameters + $this->_editExtraParameters;\n\n parent::editAction();\n }", "public function saveTempAction()\n {\n $rows = $this->mappingAction();\n\t\t\n\t\tif (!empty($rows)) {\t\t\n\t\t\t// ************************************************ SAVE NORMA PUPUK TBM TEMP ************************************************\n\t\t\t//generate filename untuk .sh dan .sql\n\t\t\t$filename = $this->_global->genFileName();\n\t\t\t$this->_global->createBashFile($filename); //create bash file\n\t\t\t$this->_global->createSqlFile($filename, \"START : \".date(\"Y-m-d H:i:s\").\"\\n\"); //start create file\n\t\t\t\n\t\t\t//save norma biaya temp\n\t\t\tforeach ($rows as $key => $row) {\n\t\t\t\t$row['filename'] = $filename;\n\t\t\t\t$return = $this->_model->saveTemp($row);\n\t\t\t}\n\t\t\t//execute transaksi\n\t\t\t$this->_global->createSqlFile($filename, \"COMMIT;\\n\"); //add query untuk commit\n\t\t\tshell_exec(\"sh \".getcwd().\"/tmp_query/\".$filename.\".sh\"); //execute query\t\t\n\t\t\t$this->_global->createSqlFile($filename, \"END : \".date(\"Y-m-d H:i:s\").\"\\n\"); //end execute\n\t\t\tshell_exec(\"rm -f -r \".getcwd().\"/tmp_query/\".$filename.\".sh\"); //delete file yg telah diexecute\n\t\t\t\n\t\t\t//pindahkan .sql ke logs\n\t\t\t$uploaddir = getcwd().\"/logs/\".date(\"Y-m-d\").\"/\";\n\t\t\tif ( ! is_dir($uploaddir)) {\n\t\t\t\t$oldumask = umask(0);\n\t\t\t\tmkdir(\"$uploaddir\", 0777, true);\n\t\t\t\tchmod(\"/\".date(\"Y-m-d\"), 0777);\n\t\t\t\tumask($oldumask);\n\t\t\t}\n\t\t\tshell_exec(\"mv \".getcwd().\"/tmp_query/\".$filename.\".sql \".getcwd().\"/logs/\".date(\"Y-m-d\").\"/\".$filename.\".sql\");\n\t\t\t// ************************************************ SAVE NORMA PUPUK TBM TEMP ************************************************\n\t\t}\n\t\t\n\t\tdie('no_alert');\n }", "protected function actionSave() {\r\n $strType = $this->getCurObjectClassName();\r\n $strSystemId = \"\";\r\n\r\n if(!is_null($strType)) {\r\n\r\n /** @var $objRecord interface_model|class_model */\r\n $objRecord = null;\r\n\r\n if($this->getParam(\"mode\") == \"new\") {\r\n $objRecord = new $strType();\r\n $strSystemId = $this->getSystemid();\r\n }\r\n else if($this->getParam(\"mode\") == \"edit\")\r\n $objRecord = new $strType($this->getSystemid());\r\n\r\n if($objRecord != null) {\r\n $objForm = $this->getAdminForm($objRecord);\r\n if(!$objForm->validateForm()) {\r\n if($this->getParam(\"mode\") === \"new\")\r\n return $this->actionNew();\r\n if($this->getParam(\"mode\") === \"edit\")\r\n return $this->actionEdit();\r\n }\r\n\r\n $objForm->updateSourceObject();\r\n $objRecord->updateObjectToDb($strSystemId);\r\n\r\n $this->adminReload(getLinkAdminHref($this->getArrModule(\"modul\"), $this->getActionNameForClass(\"list\", $objRecord), \"&systemid=\".$objRecord->getStrPrevId().($this->getParam(\"pe\") != \"\" ? \"&peClose=1\" : \"\")));\r\n return \"\";\r\n }\r\n }\r\n else\r\n throw new class_exception(\"error on saving current object type not known \", class_exception::$level_ERROR);\r\n\r\n\r\n return $this->getLang(\"commons_error_permissions\");\r\n }", "public function save() {\n $configdata = $this->get('configdata');\n if (!array_key_exists('defaultvalue_editor', $configdata)) {\n $this->field->save();\n return;\n }\n\n if (!$this->get('id')) {\n $this->field->save();\n }\n\n // Store files.\n $textoptions = $this->value_editor_options();\n $tempvalue = (object) ['defaultvalue_editor' => $configdata['defaultvalue_editor']];\n $tempvalue = file_postupdate_standard_editor($tempvalue, 'defaultvalue', $textoptions, $textoptions['context'],\n 'customfield_textarea', 'defaultvalue', $this->get('id'));\n\n $configdata['defaultvalue'] = $tempvalue->defaultvalue;\n $configdata['defaultvalueformat'] = $tempvalue->defaultvalueformat;\n unset($configdata['defaultvalue_editor']);\n $this->field->set('configdata', json_encode($configdata));\n $this->field->save();\n }", "public function actionCreate()\n {\n $model = new NotificationsTemplate();\n\n if ($model->load(\\Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'key' => $model->key]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function config()\n {\n $errors = [];\n $values = [];\n\n if ($this->request->isPost()) {\n $values = $this->request->getValues();\n\n $validation_errors = $this->validateValues($values);\n\n if (!$validation_errors) {\n $values['human_name'] = $this->fixHumanName($values['human_name']); \n $machine_name = $this->createMachineName($values['human_name']);\n $beauty_name = $this->beautyName($values['human_name']);\n $values['machine_name'] = $machine_name;\n $values['beauty_name'] = $beauty_name;\n $type_id = $this->db->table(MetadataTypeModel::TABLE)->persist($values);\n if ($type_id) {\n $this->flash->success(t('Metadata type created successfully.'));\n } else {\n $this->flash->failure(t('Error saving the metadata type. Retry.'));\n }\n } else {\n $errors = $validation_errors;\n $this->flash->failure(t('There are errors in your submission.'));\n }\n }\n\n $metadataTypes = $this->metadataTypeModel->getAll();\n\n $this->response->html($this->helper->layout->config('MetaMagik:config/metadata_types', [\n 'values' => $values,\n 'errors' => $errors,\n 'types' => $metadataTypes,\n 'title' => t('Settings').' &gt; '.t('Custom Fields'),\n ]));\n }", "public function createAction() {\r\n $request = reqEbbs::get('post');\r\n $response = new responseEbbs();\r\n /** @var backupLogTxtModelEbbs $logTxt */\r\n $logTxt = $this->getModel('backupLogTxt');\r\n /** @var backupTechLogModelEbbs $techLog */\r\n $techLog = $this->getModel('backupTechLog');\r\n /** @var warehouseEbbs $bupFolder */\r\n $bupFolder = frameEbbs::_()->getModule('warehouse');\r\n $uploadingList = array();\r\n $backupComplete = false;\r\n\r\n if(!empty($request['opt_values'])){\r\n do_action('bupBeforeSaveBackupSettings', $request['opt_values']);\r\n /* @var $optionsModel optionsModelEbbs*/\r\n $optionsModel = frameEbbs::_()->getModule('options')->getModel();\r\n $optionsModel->saveMainFromDestGroup($request);\r\n $optionsModel->saveGroup($request);\r\n $optionsModel->refreshOptions();\r\n\r\n // if warehouse changed - create necessary dir\r\n if (!$bupFolder->getFolder()->exists())\r\n $bupFolder->getFolder()->create();\r\n }\r\n\r\n $destination = $this->getModel()->getConfig('dest');\r\n if($destination !== 'ftp') {\r\n $isAuthorized = $this->getModel()->checkCloudServiceRemoteServerIsAuth($destination);\r\n if(!$isAuthorized){\r\n $response->addError($this->getModel()->getErrors());\r\n return $response->ajaxExec();\r\n }\r\n }\r\n\r\n // We are need to check \"warehouse\" directory (usually: wp-content/upsupsystic)\r\n if (!$this->getModel()->checkWarehouse()) {\r\n $response->addError($this->getModel()->getWarehouseError());\r\n return $response->ajaxExec();\r\n }\r\n\r\n if($this->getModel()->isFilesystemRequired() && !$this->checkExtensions($response)) {\r\n return $response->ajaxExec();\r\n }\r\n\r\n $currentBackupPath = $this->getModel()->generateFilename(array('zip', 'sql', 'txt'));\r\n $logTxt->setLogName(basename($currentBackupPath['folder']));\r\n $logTxt->writeBackupSettings($request['opt_values']);\r\n $logTxt->add(__('Clear temporary directory', EBBS_LANG_CODE));\r\n $techLog->deleteOldLogs();\r\n $techLog->setLogName(basename($currentBackupPath['folder']));\r\n\r\n if ($this->getModel()->isDatabaseRequired()) {\r\n $logTxt->add(__(sprintf('Start database backup: %s', $currentBackupPath['sql']), EBBS_LANG_CODE));\r\n $this->getModel()->getDatabase()->create($currentBackupPath['sql']);\r\n $dbErrors = $this->getModel()->getDatabase()->getErrors();\r\n\r\n if (!empty($dbErrors)) {\r\n $logTxt->add(__(sprintf('Errors during creation of database backup, errors count %d', count($dbErrors)), EBBS_LANG_CODE));\r\n $response->addError($dbErrors);\r\n return $response->ajaxExec();\r\n }\r\n\r\n $logTxt->add(__('Database backup complete.'), EBBS_LANG_CODE);\r\n $uploadingList[] = $currentBackupPath['sql'];\r\n $backupComplete = true;\r\n }\r\n\r\n if ($this->getModel()->isFilesystemRequired()) {\r\n if(!file_exists($currentBackupPath['folder'])) {\r\n $bupFolder->getController()->getModel('warehouse')->create($currentBackupPath['folder'] . DS);\r\n }\r\n\r\n $logTxt->add(__('Scanning files.', EBBS_LANG_CODE));\r\n $files = $this->getModel()->getFilesList();\r\n // $files = array_map('realpath', $files);\r\n\r\n $logTxt->add(sprintf('%s files scanned.', count($files, true) - count($files)));\r\n $logTxt->add(__('Total stacks: ' . count($files), EBBS_LANG_CODE));\r\n $techLog->set('stacks', $files);\r\n $uploadingList[] = $currentBackupPath['folder'];\r\n $backupComplete = false;\r\n }\r\n\r\n // if need create filesystem backup or send DB backup on cloud - backup not complete\r\n if(!empty($files) || $destination !== 'ftp') {\r\n $backupComplete = false;\r\n $techLog->set('destination', $destination);\r\n $techLog->set('uploadingList', $uploadingList);\r\n $techLog->set('emailNotifications', (frameEbbs::_()->getModule('options')->get('email_ch') == 1) ? true : false);\r\n\r\n $data = array(\r\n 'page' => 'backup',\r\n 'action' => 'createBackupAction',\r\n 'backupId' => $currentBackupPath['folder'],\r\n );\r\n\r\n if(!empty($files))\r\n $logTxt->add(__('Send request to generate backup file stacks', EBBS_LANG_CODE));\r\n\r\n $this->getModel('backup')->sendSelfRequest($data);\r\n }\r\n\r\n if($backupComplete && frameEbbs::_()->getModule('options')->get('email_ch') == 1) {\r\n $email = frameEbbs::_()->getModule('options')->get('email');\r\n $subject = __('DropBox Backup by Supsystic Notifications', EBBS_LANG_CODE);\r\n\r\n $logTxt->add(__('Email notification required.', EBBS_LANG_CODE));\r\n $logTxt->add(sprintf(__('Sending to', EBBS_LANG_CODE) . '%s', $email));\r\n\r\n $message = $logTxt->getContent(false);\r\n\r\n wp_mail($email, $subject, $message);\r\n }\r\n\r\n $response->addData(array(\r\n 'backupLog' => $logTxt->getContent(),\r\n 'backupId' => basename($currentBackupPath['folder']),\r\n 'backupComplete' => $backupComplete\r\n ));\r\n\r\n return $response->ajaxExec();\r\n\r\n $cloud = $log->getCurrentBackupFilesName();\r\n\r\n $handlers = $this->getModel()->getDestinationHandlers();\r\n\r\n if (array_key_exists($destination, $handlers)) {\r\n\r\n $cloud = array_map('basename', $cloud);\r\n\r\n $log->string(__(sprintf('Upload to the \"%s\" required', ucfirst($destination)), EBBS_LANG_CODE));\r\n $log->string(sprintf('Files to upload: %s', rtrim(implode(', ', $cloud), ', ')));\r\n $handler = $handlers[$destination];\r\n $result = call_user_func_array($handler, array($cloud));\r\n if ($result === true || $result == 200 || $result == 201) {\r\n $log->string(__(sprintf('Successfully uploaded to the \"%s\"', ucfirst($destination)), EBBS_LANG_CODE));\r\n\r\n $path = frameEbbs::_()->getModule('warehouse')->getPath();\r\n $path = untrailingslashit($path);\r\n\r\n foreach ($cloud as $file) {\r\n $log->string(__(sprintf('Removing %s from the local storage.', $file), EBBS_LANG_CODE));\r\n if (@unlink($path . '/' . $file)) {\r\n $log->string(__(sprintf('%s successfully removed.', $file), EBBS_LANG_CODE));\r\n } else {\r\n $log->string(__(sprintf('Failed to remove %s', $file), EBBS_LANG_CODE));\r\n }\r\n }\r\n } else {\r\n switch ($result) {\r\n case 401:\r\n $error = __('Authentication required.', EBBS_LANG_CODE);\r\n break;\r\n case 404:\r\n $error = __('File not found', EBBS_LANG_CODE);\r\n break;\r\n case 500:\r\n $error = is_object($handler[0]) ? $handler[0]->getErrors() : __('Unexpected error (500)', EBBS_LANG_CODE);\r\n break;\r\n default:\r\n $error = __('Unexpected error', EBBS_LANG_CODE);\r\n }\r\n\r\n $log->string(__(\r\n sprintf(\r\n 'Cannot upload to the \"%s\": %s',\r\n ucfirst($destination),\r\n is_array($error) ? array_pop($error) : $error\r\n )\r\n , EBBS_LANG_CODE));\r\n }\r\n }\r\n\r\n if(empty($error)) {\r\n $response->addMessage(__('Backup complete.', EBBS_LANG_CODE));\r\n } else {\r\n $response->addError(__('Error occurred: ' . ucfirst($destination) . ', ' . $error, EBBS_LANG_CODE));\r\n }\r\n\r\n // Allow to do new backups.\r\n $this->unlock();\r\n\r\n $backupPath = untrailingslashit($bupStorageRoot) . DS;\r\n $pathInfo = pathinfo($cloud[0]);\r\n $log->save($backupPath . $pathInfo['filename'] . '.txt');\r\n\r\n $response->addData(\r\n array(\r\n 'backupLog' => frameEbbs::_()->getModule('backup')->getModel('backupLog')->getBackupLog(),\r\n )\r\n );\r\n\r\n $log->clear();\r\n\r\n return $response->ajaxExec();\r\n\t}", "protected function setAfterSaveRoute()\n {\n // Default is just go to the index\n if ($this->routeAction) {\n $this->afterSaveRouteUrl[$this->request->getActionKey()] = $this->routeAction;\n }\n $this->afterSaveRouteUrl['controller'] = $this->request->getControllerName();\n }", "private function __saveConfiguration()\n {\n //Check is submit the form\n if (Tools::isSubmit(BECOPAY_PREFIX . 'submit')) {\n\n //clear errors messages\n $this->_errors = array();\n\n //validate is set configuration field\n foreach ($this->config['configuration'] as $config) {\n if ($config['isRequired'] && Tools::getValue(BECOPAY_PREFIX . $config['name']) == NULL)\n $this->_errors[] = $this->l($config['title'] . ' is require');\n }\n\n //if has no errors check with PaymentGateway Constructor validation\n if (empty($this->_errors)) {\n try {\n new PaymentGateway(\n Tools::getValue(BECOPAY_PREFIX . 'apiBaseUrl'),\n Tools::getValue(BECOPAY_PREFIX . 'apiKey'),\n Tools::getValue(BECOPAY_PREFIX . 'mobile')\n );\n } catch (\\Exception $e) {\n $this->_errors[] = $e->getMessage();\n }\n }\n\n //Display error messages if has error\n if (!empty($this->_errors)) {\n $this->_html = $this->displayError(implode('<br>', $this->_errors));\n } else {\n\n //save configuration form fields\n foreach ($this->config['configuration'] as $config)\n if (Tools::getValue(BECOPAY_PREFIX . $config['name']) != NULL)\n Configuration::updateValue(BECOPAY_PREFIX . $config['name'], trim(Tools::getValue(BECOPAY_PREFIX . $config['name'])));\n\n\n //display confirmation message\n $this->_html = $this->displayConfirmation($this->l('Settings updated'));\n }\n }\n }", "protected function afterSave()\n\t{\n\t\tparent::afterSave();\n\t\tif(!$this->status == 1){\n\t\t$title = $this->howtoTitle($this->id);\n\t\t$tags = $this->tagLinks();\n\t\t$title = CHtml::link('Created '.$title , array('/howto/' . $this->id . '/' . $title ) );\n\t\t$shortText = substr($this->content,0,160);\n\t\t$content = $shortText.\"...<br/>Tags:\";\n\t\tforeach($tags as $tag){\n\t\t\t$content .=\" \".$tag.\",\";\n\t\t}\n\t\tAction::newAction($content,$title);\n\t\t}\n\t\t\n\t}", "function before_edit_configuration() { }", "public function postSave() {}", "public function setConfigAction() {\n $response = new stdClass();\n $response->success = false;\n $coreConfig = Mage::getConfig();\n $post = $this->getRequest()->getPost();\t\n\t\t$coreConfig->saveConfig('filter_type', Mage::helper('core')->escapeHtml($post['filter_type']));\n $coreConfig->saveConfig('filter_name', Mage::helper('core')->escapeHtml($post['filter_name']));\n $coreConfig->saveConfig('filter_status', Mage::helper('core')->escapeHtml($post['filter_status']));\n\t\t$coreConfig->cleanCache();\n\n\t\t$response->success = true; \n $cache = Mage::getSingleton('core/cache');\n $cache->flush(); \n exit(json_encode($response));\n }", "public function lastElementDataAction() {\r\n //send data is in .tpl\r\n }", "public function frontend_configuration()\n {\n if ($this->session->userdata('logged_in') == 1 && $this->session->userdata('user_type') != 'Admin') {\n redirect('home/login_page', 'location');\n }\n \n $data['body'] = \"admin/config/frontend_config\";\n $data['time_zone'] = $this->_time_zone_list(); \n $data['language_info'] = $this->_language_list();\n $data['page_title'] = $this->lang->line('front-end settings');\n $this->_viewcontroller($data);\n }", "public function saveAction()\n {\n $request = $this->getRequest();\n $service = $this->get('buggl_main.trip_theme');\n $template = 'BugglMainBundle:Admin\\TripTheme:form.html.twig';\n\n if ($request->getMethod() == 'POST') {\n $form = $this->createFormBuilder()\n ->add('name', 'text',\n array(\n 'constraints'=>new \\Symfony\\Component\\Validator\\Constraints\\NotBlank()\n ))\n ->add('status','checkbox',array('required' => false))\n ->getForm();\n $form->bind($request);\n\n $valid = $form->isValid();\n\n if ($valid) {\n $data = $service->add($form->getData());\n } else {\n $html = $this->renderView(\n $template, array('form'=>$form->createView()));\n $data = array('success' => $valid, 'html' => $html);\n }\n } else {\n $id = $request->get('id');\n $name = trim($request->get('qString'));\n\n $data = $service->update($id, $name);\n }\n\n $response = new \\Symfony\\Component\\HttpFoundation\\JsonResponse($data, 200);\n\n return $response;\n }", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('curriculumdoc')) {\n try {\n $data = $this->_filterDates($data, array('cdoc_date'));\n $curriculumdoc = $this->_initCurriculumdoc();\n $curriculumdoc->addData($data);\n $cdocFileName = $this->_uploadAndGetName(\n 'cdoc_file',\n Mage::helper('bs_curriculumdoc/curriculumdoc')->getFileBaseDir(),\n $data\n );\n $curriculumId = null;\n\n if(isset($data['hidden_curriculum_id']) && $data['hidden_curriculum_id'] > 0) {\n $curriculumId = $data['hidden_curriculum_id'];\n }elseif($this->getRequest()->getParam('curriculum_id')){\n $curriculumId = $this->getRequest()->getParam('curriculum_id');\n }\n $curriculumdoc->setData('cdoc_file', $cdocFileName);\n $curriculums = $this->getRequest()->getPost('curriculums', -1);\n if ($curriculums != -1) {\n $curriculumdoc->setCurriculumsData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($curriculums));\n }else {\n if(isset($data['hidden_curriculum_id']) && $data['hidden_curriculum_id'] > 0){\n $curriculumId = $data['hidden_curriculum_id'];\n $curriculumdoc->setCurriculumsData(\n array(\n $data['hidden_curriculum_id'] => array(\n 'position' => \"\"\n )\n )\n );\n }\n }\n\n $curriculumdoc->save();\n\n $add = '';//traininglist_curriculum/edit/id/1/back/edit/tab/curriculum_info_tabs_curriculumdocs/\n $backUrl = $this->getUrl('*/traininglist_curriculum/edit/', array('back'=>'edit','id' => $curriculumId, 'tab'=>'curriculum_info_tabs_curriculumdocs'));\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.location.href=\\''.$backUrl.'\\'; window.close()</script>';//window.opener.location.reload()\n }\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_curriculumdoc')->__('Curriculum Document was successfully saved %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $curriculumdoc->getId()));\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n if (isset($data['cdoc_file']['value'])) {\n $data['cdoc_file'] = $data['cdoc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setCurriculumdocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n if (isset($data['cdoc_file']['value'])) {\n $data['cdoc_file'] = $data['cdoc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('There was a problem saving the curriculum doc.')\n );\n Mage::getSingleton('adminhtml/session')->setCurriculumdocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('Unable to find curriculum doc to save.')\n );\n $this->_redirect('*/*/');\n }", "public function saveAction()\n {\n if ($postData = $this->getRequest()->getPost()) {\n if (isset($_FILES['image']['name']) and (file_exists($_FILES['image']['tmp_name']))) {\n try {\n $file_name_info = pathinfo($_FILES['image']['name']);\n $file_extension = $file_name_info['extension'];\n $filename_hash = md5(str_shuffle($_FILES['image']['name'].rand(1,1000).time()));\n $final_filename = $filename_hash . '.' . $file_extension;\n\n $uploader = new Varien_File_Uploader('image');\n $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));\n $uploader->setAllowRenameFiles(false);\n $uploader->setFilesDispersion(false);\n\n $path = Mage::getBaseDir('media') . DS . 'alliance' . DS . 'bioactives';\n\n $uploader->save($path, $final_filename);\n\n $postData['image'] = 'alliance' . DS .'bioactives' . DS . $final_filename;\n }\n catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')\n ->addError($this->__(\"An error occurred while saving the image for this Key Bioactive. Please make sure the file you\n selected was an image of file type jpg, jpeg, gif, or png, and wasn't too large in filesize.\"));\n }\n }\n else {\n if(isset($postData['image']['delete']) && $postData['image']['delete'] == 1)\n $postData['image'] = '';\n else\n unset($postData['image']);\n }\n\n $model = Mage::getSingleton('alliance_bioactives/bioactive');\n $model->setData($postData);\n\n try {\n $model->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The bioactive has been saved.'));\n $this->_redirect('*/*/');\n\n return;\n }\n catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')\n ->addError($this->__('An error occurred while saving this bioactive.'));\n }\n\n Mage::getSingleton('adminhtml/session')->setBioactiveData($postData);\n $this->_redirectReferer();\n }\n }", "public function configure(): void\n {\n $this->setDecorator(false);\n $this->setTemplate($this->actionName.$this->getExtension());\n if ('global' == $this->moduleName)\n {\n $this->setDirectory($this->context->getConfiguration()->getDecoratorDir($this->getTemplate()));\n }\n else\n {\n $this->setDirectory($this->context->getConfiguration()->getTemplateDir($this->moduleName, $this->getTemplate()));\n }\n }", "public function save_currency_settings() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n if ($this->checkPrivileges('admin', '2') == TRUE) {\n $condition = array('admin_id' => '1');\n $this->admin_model->commonInsertUpdate(ADMIN, 'update', array(), array(), $condition);\n $currency_settings_val = $this->input->post(\"currency\");\n $config = '<?php ';\n foreach ($currency_settings_val as $key => $val) {\n $value = addslashes($val);\n $config .= \"\\n\\$config['$key'] = '$value'; \";\n }\n $config .= \"\\n ?>\";\n $file = 'commonsettings/dectar_currency_settings.php';\n file_put_contents($file, $config);\n $this->setErrorMessage('success', 'Currency settings updated successfully','admin_adminlogin_currency_setting_updated');\n redirect(ADMIN_ENC_URL.'/adminlogin/admin_currency_settings');\n } else {\n redirect(ADMIN_ENC_URL);\n }\n }\n }", "public function setViewConfigurationFilesFromTypoScriptConfiguration()\r\n {\r\n // Sets the template root path with the default\r\n $this->templateRootPath = $this->defaultTemplateRootPath;\r\n $this->getController()\r\n ->getPageTypoScriptConfigurationManager()\r\n ->setViewConfigurationFilesFromPageTypoScriptConfiguration();\r\n $this->getController()\r\n ->getExtensionConfigurationManager()\r\n ->setViewConfigurationFilesFromTypoScriptConfiguration();\r\n $this->getController()\r\n ->getLibraryConfigurationManager()\r\n ->setViewConfigurationFilesFromTypoScriptConfiguration();\r\n }", "public function postDispatch()\n {\n parent::postDispatch();\n if ($this->getFlag('', self::FLAG_NO_POST_DISPATCH)) {\n return;\n }\n Mage::dispatchEvent('controller_action_postdispatch_adminhtml', array('controller_action' => $this));\n }", "function index( $id = \"be1\" ) {\n\n\t\tif ( $this->is_POST()) {\n\t\t// if the method is post\n\n\t\t\t// server side validation\n\t\t\tif ( $this->is_valid_input()) {\n\n\t\t\t\t// save user info\n\t\t\t\t$this->save( $id );\n\t\t\t}\n\t\t}\n\n\t\t//Get Backend_config Object\n\t\t$this->data['backend'] = $this->Backend_config->get_one( $id );\n\n\t\t$this->load_template( 'backend_configs/entry_form',$this->data, true );\n\n\t}", "public function configuration()\n {\n if ($this->session->userdata('logged_in') == 1 && $this->session->userdata('user_type') != 'Admin') {\n redirect('home/login_page', 'location');\n }\n \n $data['body'] = \"admin/config/edit_config\";\n $data['time_zone'] = $this->_time_zone_list(); \n $data['language_info'] = $this->_language_list();\n $data[\"themes\"] = $this->_theme_list();\n $data['page_title'] = $this->lang->line('general settings');\n $this->_viewcontroller($data);\n }", "public function saveAction() {\n $request = $this->getRequest();\n if($request->isPost()) {\n $params = $request->getPost();\n if(!array_key_exists('company_id', $params)) {\n Default_Model_Company::create($params);\n } else {\n Default_Model_Company::update($params);\n }\n }\n \n $this->_redirect($this->view->actions['index']);\n }" ]
[ "0.6807841", "0.6206388", "0.61593", "0.610639", "0.6096789", "0.6075421", "0.5825599", "0.5812048", "0.5737642", "0.56738055", "0.5637621", "0.5622439", "0.5603154", "0.5595343", "0.5590436", "0.55859154", "0.55521786", "0.5511519", "0.54491484", "0.54472715", "0.5446891", "0.5446477", "0.5434309", "0.54195744", "0.5401162", "0.5397", "0.53920585", "0.5388098", "0.5386281", "0.5384591", "0.5367495", "0.53624177", "0.53569007", "0.5351016", "0.5349158", "0.5336876", "0.53093034", "0.53090554", "0.52934223", "0.5264032", "0.52562594", "0.5247381", "0.52389175", "0.52349985", "0.5225689", "0.5225356", "0.5217558", "0.52173424", "0.5209279", "0.52084005", "0.51852435", "0.51831645", "0.5167266", "0.5164326", "0.5162479", "0.5155891", "0.51493376", "0.5148992", "0.5136434", "0.5128057", "0.51272666", "0.51256895", "0.51196694", "0.5118464", "0.5118043", "0.5112669", "0.5111838", "0.51118255", "0.5109532", "0.5103831", "0.510206", "0.5086769", "0.50848764", "0.5084166", "0.50836176", "0.507899", "0.50747573", "0.507464", "0.50706965", "0.50663716", "0.5065151", "0.5064217", "0.5046699", "0.5045948", "0.50441754", "0.50430876", "0.50426596", "0.5036704", "0.5036287", "0.5027026", "0.50258136", "0.50243706", "0.5022423", "0.502077", "0.5020295", "0.5019699", "0.50195825", "0.50160384", "0.5008781", "0.50027585" ]
0.74228793
0
Constructor. We'll throw exceptions if the path don't exist
public function __construct() { $this->path = str_finish( Config::get( 'app.gsd.folder' ), '/' ); if ( ! is_dir( $this->path ) ) { throw new \RuntimeException( "Directory doesn't exist: $this->path" ); } if ( ! is_dir( $this->path . 'archived' ) ) { throw new \RuntimeException( "Directory doesn't exist: $this->path" . 'archived' ); } $this->extension = Config::get( 'app.gsd.extension' ); if ( ! starts_with( $this->extension, '.' ) ) { $this->extension = '.' . $this->extension; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct($path){\n\t\t$this->path = $path;\n\t\tif(!file_exists($path)){\n\t\t\t$this->createFile($path);\n\t\t}\n\t}", "function __construct($path) {\n\t\t$this->path = $path;\t\t\n\t}", "public function __construct($path);", "public function __construct($path) {\n\t$this->path = $path;\n }", "public function __construct($path)\n {\n $this->path = $path;\n\n }", "public function __construct($path) {\n $this->physicalPath = realpath($path);\n \n if(!is_file($this->physicalPath)){\n throw new Exception($physicalPath.' is not a file');\n }\n \n $this->path_parts = pathinfo($this->physicalPath);\n }", "public function __construct($path){\n $this->path = $path;\n }", "public function __construct($path)\n {\n $this->path = $path;\n }", "public function __construct($path)\n {\n $this->path = $path;\n }", "public function __construct($path)\n\t{\n\t\t$this->path = $path;\n\t}", "public function __construct(string $path)\n {\n $this->path = $path;\n }", "public function __construct(string $path)\n {\n $this->path = $path;\n }", "public function __construct($path) {\n\t\t$this->path($path);\n\t}", "function __construct($path = \"\") {\n\t\tif ($path) $this->load($path);\n\t}", "public function __construct($file_path) {\n\t\t$file_path = self::standardizePath($file_path);\n\t\tif (!self::exists($file_path)) {\n\t\t\tthrow new \\Exception(\"File does not exist: \\\"$file_path\\\"\");\n\t\t}\n\t\t$this->path = realpath($file_path);\n\t}", "public function __construct($path)\n {\n // Check the path is valid\n if (!is_dir($path)) {\n throw new \\Exception('Path is not valid');\n }\n\n // Quick check to see if it's a Minecraft World\n if (!is_file($path.'level.dat')) {\n throw new \\Exception('Path does not point to a Minecraft world');\n }\n\n // Path is valid, so save it\n $this->path = $path;\n }", "public function __construct($path) {\r\n\t\tparent::__construct();\r\n\t\t$this->_path = $path;\r\n\t}", "public function __construct($path, \\Exception $previous = null) {\n\t\tparent::__construct('Directory ' . $path . ' does not exists', 0, $previous);\n\t}", "public function __construct($path, $message = null)\n {\n $this->path = $path;\n\n if (!$message) {\n $message = \"The directory '$path' was not found.\";\n }\n\n parent::__construct($message);\n }", "public function __construct(string $path, \\Exception $previous = null)\n {\n parent::__construct('Failed reading directory: ' . $path, 0, $previous);\n }", "public function __construct(private string $path)\n {\n $this->open();\n }", "public function __construct($path = array())\n {\n $this->path = $path;\n }", "public function __construct(string $path)\n {\n parent::__construct($path);\n\n if (!$this->validate()) {\n throw new FileNotValidException($path);\n }\n }", "public function __construct($path)\n {\n parent::__construct(\"Ths file with the path $path wasn't found.\");\n }", "public function __construct($path)\n {\n $this->path = $path;\n\n $this->localFilesystem($path);\n }", "public function __construct($strPath) \r\n\t{\r\n\t\t$this->strPath = $strPath;\r\n\t}", "public function __construct(string $path)\n {\n $this->path = Str::moveFromBothEnds($path, '/') . '/';\n $this->location = path($this->path);\n $this->files = new Arr();\n $this->collection = new Arr();\n $this->directories = new Arr();\n }", "public function __construct(string $path)\n {\n if (file_exists($path)) {\n $this->path = $path;\n $this->tmpDir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid(\"\", true) . date(\"His\");\n $this->zipClass = new ZipArchive();\n $this->extract();\n } else {\n throw new Exception(\"The template \" . $path . \" was not found!\");\n }\n }", "public function __construct( $path )\n {\n $this->setPath( $path );\n }", "private function _init($path='',$filename='') {\n\t\t$this->pathParser = new Filesystem_Path($path,$filename);\n\t}", "public function __construct($path = null)\n {\n $this->set($path);\n }", "public function __construct($path)\n {\n if (!is_readable($path)) {\n throw new InvalidArgumentException(\n \"Path {$path} does not exist or is not readable\"\n );\n }\n\n $this->path = $path;\n }", "public function __construct(string $path)\n {\n if (! is_file($path)) {\n throw new LogicException(\"No file exists at: {$path}\");\n }\n\n $this->path = $path;\n $this->content = file_get_contents($path);\n $this->parse();\n }", "public function __construct($path){\n\t\t$this->paths = $this->getValidPath($path);\n\t\t$this->data = array();\n\t}", "public function __construct($path)\n {\n if (!is_file($path)) {\n throw new \\Exception(\n 'Image *' . ($path) . '* is not a valid file.'\n );\n }\n $this->_path = $path;\n $this->_loadResource();\n }", "public function __construct(string $file_path);", "public function __construct(string $path)\n {\n $this->path = $path;\n $this->name = basename($path);\n $this->extension = FileSystem::extension($path);\n }", "public function __construct($localPath)\n {\n if (!file_exists($localPath)) {\n throw new FilesystemException(sprintf(\n 'The file \"%s\" does not exist.',\n $localPath\n ));\n }\n\n $this->localPath = $localPath;\n }", "public function __construct($path) {\n if ('' === $path) {\n $this->path= [];\n } else if (1 === strspn((string)$path, '/')) {\n $this->path= [];\n foreach (explode('/', substr($path, 1)) as $token) {\n $this->path[$token]= $this->address($token);\n }\n } else {\n throw new IllegalArgumentException('Malformed path '.$path.', must either be empty or start with \"/\"');\n }\n }", "protected function pathInit(): void\n {\n [$path, $regExp] = $this->pathExtract();\n $this->path = null;\n\n if ($path) {\n $this->path = new Path($this->getDefaultRegex(), $path, $regExp);\n }\n }", "public function init($path);", "public function __construct($path) {\n if (!is_dir($path) || !is_writable($path)) {\n $this->_messages[] = '4' . $path . ' must be a valid, writable directory';\n }\n $this->_destination = $path;\n }", "function __construct($file_path)\n {\n $this->open($file_path);\n }", "public function __construct($path, $cachePath = false)\n {\n $this->path = $path;\n $this->cachePath = $cachePath;\n }", "final function __construct($path)\n\t{\n\t\t$this->path = $path;\n\t\t$this->mods = array();\n\t\t$this->init();\n\t}", "public function __construct( $path ) \n\t{\n\t\t$this->_root_path = $path;\n\t\t$this->_index_path = $this->_root_path . \n\t\t\t\t\t\t\t(substr($this->_root_path, -1) == '/' ? '' : '/') .\n\t\t\t\t\t\t\t'zsl.db';\n\t}", "public function __construct($path)\n {\n $this->setValue((string)$path);\n }", "public function __construct($options = array())\n\t{\n\t\tparent::__construct($options);\n\t\t\n\t\t// Normalize the path\n\t\t$this->path = realpath(str_replace('\\\\', '/', $this->path));\n\t\t\n\t\t// Ensure we have a trailing slash\n\t\tif (!empty($this->path) AND is_writable($this->path))\n\t\t{\n\t\t\t$this->path = rtrim($this->path, '/').'/';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Kohana_Exception(get_class($this).' must have a `path` property set that points to a writable directory');\n\t\t}\t\n\t}", "public function __construct($path)\n {\n $this->path = $path;\n $this->userId = Auth::id();\n }", "public function __construct ($file_path) {\n if (is_file($file_path)) {\n if ($this->valid_csv($file_path)) {\n try {\n if (!$this->file = fopen($file_path, \"r\")) {\n throw new Exception ('Failed to open file.');\n }\n } catch (Exception $e) {\n die (Utility::log ('ERROR', $e->getMessage()));\n }\n } else {\n die (Utility::log ('ERROR', 'Invalid file. Please specify a valid CSV file.'));\n }\n\n } else {\n die (Utility::log ('ERROR', 'File does not exist. Please specify a valid CSV file.'));\n }\n }", "public function __construct($filePath)\n {\n $this->path = $filePath;\n }", "public function __construct($path) {\n\t\tif (is_array($path)) {\n\t\t\tif (empty($path['tmp_name'])) {\n\t\t\t\tthrow new IoException('Passing via array must use $_FILES data');\n\t\t\t}\n\n\t\t\t$this->_data = $path;\n\t\t\t$path = $path['tmp_name'];\n\t\t}\n\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new IoException(sprintf('%s does not exist', $path));\n\t\t}\n\n\t\t$this->_path = $path;\n\t}", "private function validatePath()\n {\n $locator = new FileLocator();\n $locator->locate($this->path); // throws exception on failure\n }", "public function setupPath()\n {\n // if directory doesn't exist, create it\n if (!is_dir($this->path->getPath())) {\n $reporting = error_reporting();\n error_reporting(0);\n $created = mkdir($this->path->getPath(), 0755, true);\n error_reporting($reporting);\n if (!$created) {\n throw new Exception(sprintf('cant\\'t create directory: %s', $this->path->getPath()));\n }\n }\n if (!is_writable($this->path->getPath())) {\n throw new Exception(sprintf('no write permission for directory: %s', $this->path->getPath()));\n }\n }", "protected function initialize()\n {\n // if basepath hasn't been set, attempt to discover it by working back up the directory structure\n if( ! $this->basepath )\n {\n $path = __DIR__;\n $last = '';\n while($path !== $last)\n {\n $last = $path;\n $path = realpath($path . '/../');\n $config = $path . '/paths.php';\n if(file_exists($config))\n {\n $this->option('basepath', $this->fix($path));\n break;\n }\n }\n\n // check if the paths configuration was found\n if( ! file_exists($this->basepath) )\n {\n throw new \\Exception('The paths configuration file `paths.php` was not found anywhere on the path \"' .__DIR__. '\" ');\n }\n\n }\n\n // test that the base path (supplied or found) exists\n if( ! file_exists($this->basepath) )\n {\n throw new \\Exception('The supplied base path \"' .$this->basepath. '\" does not exist');\n }\n }", "public function __construct(File $path = null) {\n if ($path === null) {\n $path = new File(self::DEFAULT_PATH);\n }\n\n $this->path = new File(Zibo::getInstance()->getRootPath(), $path);\n $this->path->create();\n\n $this->cache = array();\n }", "public function __construct($filepath)\n\t{\n\t\tif (file_exists($filepath)) \n\t\t{\n\t\t\t$this->filepath = $filepath;\n\t\t\t$this->loadFileInfo();\n\t\t}else{\n\t\t\techo \"File not found.\";\n\t\t}\n\n\t}", "protected function __construct( )\n\t{\n\t\tif (defined('LOG_DIR')) {\n\t\t\t$this->_file_path = LOG_DIR;\n\t\t}\n\t}", "public function __construct($path, $config)\n\t{\n\t\tchdir($path);\n\t\trequire($config);\n\t}", "public function __construct($path, $filenameMethod = false)\n {\n $this->path = rtrim($path, '/');\n $this->filenameMethod = $filenameMethod;\n }", "public function __construct($path, $checkPath = true, $fileSystemEncoding = null) {\n if (is_null($fileSystemEncoding)) {\n $fileSystemEncoding = Environment::getInstance()->getFileSystemEncoding();\n }\n $this->enc = $fileSystemEncoding;\n if ($checkPath && !is_file(iconv('utf-8', $fileSystemEncoding, $path))) {\n throw new FileNotFoundException($path);\n }\n $this->path_str = $path;\n parent::__construct(iconv('utf-8', $fileSystemEncoding, $path));\n }", "public function __construct(){\r\n\t\t$dir = $this->dir;\r\n\t}", "function __construct(){\n\t\t\tif(!empty($_SERVER['PATH_INFO'])) {\n\t\t\t $this->path = explode('/',$_SERVER['PATH_INFO']);\n\t\t\t $this->path = array_slice($this->path,1);\n\t\t\t}\n\t\t}", "public function __construct( Filesystem $files, $path )\n\t{\n\t\t$this->path = $path;\n\t\t$this->files = $files;\n\t}", "function __construct() {\n $this->_determine_custom_dir( dirname( __FILE__ ) );\n }", "public function __construct($name, $path)\n {\n $this->name = $name;\n $this->path = $path;\n }", "public function __construct()\n {\n $this->fileSystem = new Filesystem();\n }", "public function __construct($path = '') {\n\t\t$this->pushResultsData($path);\n\t\t$this->log(\"Computer was created\");\n\t}", "public function __construct($xmlPath) {\n // loads the document\n $doc = new DOMDocument();\n $doc->load($xmlPath);\n\n // is this a employees xml file?\n if ($doc->doctype->name != \"employees\" ||\n $doc->doctype->systemId != \"employees.dtd\") {\n throw new Exception(\"Incorrect document type\");\n }\n\n // is the document valid and well-formed?\n if($doc->validate()) {\n $this->domDocument = $doc;\n $this->xmlPath = $xmlPath;\n //echo 'alert(\"valid\")'; echo '</script>';\n }\n else {\n throw new Exception(\"Document did not validate\");\n }\n }", "public function init()\n {\n parent::init();\n if (empty($this->basePath) || empty($this->targetPath)) {\n throw new Exception('basePath and targetPath are required.');\n }\n }", "public function __construct(Filesystem $files, $path)\n {\n $this->files = $files;\n $this->path = $path;\n }", "public function __construct( $dir_path = null )\n\t{\n\t\tif ( is_string($dir_path) ) {\n\t\t\t$this->set_working_dir($dir_path);\n\t\t}\n\t}", "public function __construct( $path )\n {\n if( !is_string( $path ) )\n {\n throw new RequestException( 'Invalid format. Failed to parse mongrel request path' );\n }\n \n $this->path = $path;\n }", "public function __construct(string $rootPath){\n\n // TODO - implement this class and tests\n }", "public function __construct($path)\n {\n if (!is_dir($path)) {\n throw new InvalidArgumentException(\"Unable to find directory $path\");\n } elseif (!is_readable($path)) {\n throw new InvalidArgumentException(\"Unable to read directory $path\");\n } elseif (!is_dir($path . DIRECTORY_SEPARATOR . 'objects')\n || !is_dir($path . DIRECTORY_SEPARATOR . 'refs')\n ) {\n throw new UnexpectedValueException(\n \"Invalid directory, could not find 'objects' or 'refs' in $path\"\n );\n }\n\n $this->_path = $path;\n $this->idx_commit = $this->factory('commit');\n $this->idx_tree = $this->factory('tree');\n }", "public function __construct($filepath=null) {\r\n\t\tif($filepath) {\r\n\t\t\t$this->filepath = $filepath;\t\t\t\t\t\r\n\t\t}\r\n\t}", "public function __construct() {\r\n $directoryInfo = new DirectoryInfo(getcwd());\r\n $this->directoryRoot = $directoryInfo->root();\r\n }", "public function __construct($path,$hid)\n {\n $this->path = $path;\n $this->hid = $hid;\n }", "function __construct() {\n $this->setMarkdownPath( DATAPATH . self::MARKDOWN_PATH );\n $this->setHtmlPath( DATAPATH . self::HTML_PATH );\n $this->setSummaryPath( DATAPATH . self::SUMMARY_PATH );\n }", "public function __construct($path, $options) {\n\t\t$this->path = $path;\n\n\t\tparent::__construct($options);\n\n\t\tif (!$this->check() || sq::config('debug')) {\n\t\t\t$this->build();\n\t\t}\n\t}", "function __construct ($path)\n {\n $this->basepath = $path ;\n // pull the module and package names out of the path\n $this->moduleName = basename ( $path, \"/\" ) ; // just in case there are any trailing /\n $this->packageName = basename ( dirname ( dirname ( $path ) ) ) ; // simpler than explode :)\n require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php' ;\n $mb = new ModuleBuilder ( ) ;\n $this->packageKey = $mb->getPackageKey ( $this->packageName ) ;\n \n $this->load () ;\n \n }", "function __construct($item) {\n\t\tif (preg_match('/^\\/[a-zA-Z\\/]+$/', $item)) {\n\t\t\t$this->currentPath = $item;\n\t } else {\n\t \techo 'Path format is invalid. It has to start with a slash, use slash as a separator and it should contain only lowercase and uppercase letters';\n\t }\n\t}", "public function __construct($filePath)\n {\n $this->filePath = $filePath;\n }", "public function __construct($file_path = '')\n {\n if (empty($file_path)) {\n $file_path = ROOT . '/private/cache/';\n }\n\n $this->setCacheDir($file_path);\n }", "public function __construct($path, $selfName) {\n\t\tparent::__construct(new DirectoryIterator($path));\n\t\t$this->selfName = $selfName;\n\t}", "function initialize($path) {\n $this->path = rtrim($path, '/') . '/';\n return $this;\n }", "public function __construct()\n {\n $this->files = new Filesystem();\n parent::__construct();\n }", "public function __construct($fileName) \r\n {\r\n $this->validateFileName($fileName);\r\n $this->setPropertiesToFile($fileName);\r\n $this->directory = new DirectoryInfo($this->info[\"directory_name\"]);\r\n }", "function __construct() {\n if (!file_exists($this->path)) {\n $database = fopen($this->path, 'w');\n fclose($database);\n }\n }", "public function __construct()\n {\n // Check PHP version\n $this->_checkPHPVersion(5.3);\n\n $this->file = __DIR__.'/../datas/config.json';\n\n if (!file_exists($this->file))\n throw new \\Exception('Config file '.basename($this->file).' not found');\n\n $this->_readFile();\n }", "public function __construct()\n {\n parent::__construct();\n $this->files = new Filesystem();\n }", "public function __construct() {\n if (file_exists(self::$storageFile)) {\n $jsonContents = file_get_contents(self::$storageFile);\n $this->users = json_decode($jsonContents, true);\n } else {\n throw new \\Exception(\"No file \" . self::$storageFile . \" found on server\");\n // Never catched but will cause and error\n }\n }", "function __construct(String $certificateFolder) {\n $this->path = new FileLocator($certificateFolder);\n }", "function __construct() {\n\t\t$script = $_SERVER['SCRIPT_FILENAME'];\n\t\t$dir = preg_replace('/index.php/', '', $script);\n\t\t$this->_path = preg_replace('/\\//', DIRECTORY_SEPARATOR, $dir . $this->fileName);\n\t\t$this->_fileContent = file_get_contents($this->_path);\n\t\t$this->read();\n\t}", "private function loadPath() {\n $this->_system_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'System'.DIRECTORY_SEPARATOR;\n $this->_application_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'Application'.DIRECTORY_SEPARATOR;\n $this->_configuration_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'configuration'.DIRECTORY_SEPARATOR;\n $this->_libraries_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'Libraries'.DIRECTORY_SEPARATOR;\n $this->_logs_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'logs'.DIRECTORY_SEPARATOR;\n }", "public function __construct()\n\t{\n\t\t$workingDirectory = exec('pwd');\n\t\t$metaPath = $workingDirectory . '/jext.json';\n\n\t\tif (!\\file_exists($metaPath))\n\t\t{\n\t\t\tthrow new \\Exception(sprintf('The jext.json file is missing!'));\n\t\t}\n\n\t\t$this->meta = \\json_decode(\\file_get_contents($metaPath), true);\n\t}", "public function __construct($path, $app)\n\t{\n\t\t$this->path = $path;\n\t\t$this->app = $app;\n\t}", "static function initialize($path)\n {\n self::register();\n self::addPath($path);\n }", "private function __construct(){\n\t\tif(!is_dir($this->HTML_FILEPATH)){\n\t\t\tmkdir($this->HTML_FILEPATH);\n\t\t}\n\t}", "private function __construct()\n {\n \t$this->storage_dir = $_SERVER[\"DOCUMENT_ROOT\"] . '/storage';\n }" ]
[ "0.78000456", "0.77823865", "0.77765036", "0.7719788", "0.76885927", "0.7670511", "0.7615673", "0.7608085", "0.7608085", "0.760578", "0.75789213", "0.75789213", "0.7564336", "0.7529935", "0.7507968", "0.7503505", "0.7452567", "0.7432483", "0.7413853", "0.7375766", "0.73632514", "0.731332", "0.7304206", "0.7284467", "0.72702134", "0.72467786", "0.7114833", "0.71034", "0.7101422", "0.70873874", "0.7085965", "0.70802325", "0.7061166", "0.7045537", "0.70323247", "0.70181805", "0.6989963", "0.69788593", "0.69783574", "0.6977877", "0.69718945", "0.69511884", "0.69437855", "0.688312", "0.6876018", "0.6786503", "0.67816025", "0.6772115", "0.673662", "0.67348164", "0.67344296", "0.673257", "0.67129296", "0.6693489", "0.6671742", "0.6671658", "0.66683954", "0.66516256", "0.66481405", "0.6642835", "0.6612049", "0.66060644", "0.6587883", "0.65565807", "0.65215015", "0.6518747", "0.65025675", "0.6492057", "0.6485897", "0.6481686", "0.64790815", "0.64670235", "0.64282596", "0.64266026", "0.6421117", "0.6380076", "0.6374453", "0.63628185", "0.6346118", "0.63288885", "0.6317765", "0.63176066", "0.6307386", "0.62930727", "0.62912434", "0.6275684", "0.6273108", "0.6263177", "0.62559855", "0.62557155", "0.6238863", "0.6232339", "0.62246513", "0.6221135", "0.62192714", "0.62186885", "0.62159705", "0.61996156", "0.6197954", "0.61924195" ]
0.6830685
45
Delete the todo list
public function delete( $id, $archived = false ) { $file = $this->fullpath( $id, $archived ); if ( file_exists( $file ) ) { return unlink( $file ); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteToDoList() {\n try {\n if (!($this->toDoList instanceof Base_Model_ObtorLib_App_Core_Crm_Entity_ToDoList)) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception(\" ToDoList Entity not intialized\");\n } else {\n $objToDoList = new Base_Model_ObtorLib_App_Core_Crm_Dao_ToDoList();\n $objToDoList->toDoList = $this->toDoList;\n return $objToDoList->deleteToDoList();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception($ex);\n }\n }", "public function destroy(TodoList $todoList)\n {\n //\n }", "private function actionListDelete() {\n $put_vars = $this->actionListPutConvert();\n $this->loadModel($put_vars['id'])->delete();\n }", "public function delete(){\n $this->delete_from('task');\n }", "public function destroy(TodoList $todo)\n {\n if ($todo->delete()) {\n return back();\n }\n }", "public function actionDelete()\n {\n extract(Yii::$app->request->post());\n $this->findModel($list, $item)->delete();\n }", "function delete() {\n $this->check_action_permission('delete');\n $tours_to_delete = $this->input->post('checkedID');\n if ($this->tour->delete_list($tours_to_delete)) {\n echo json_encode(array('success' => true, 'message' => lang('tours_successful_deleted')));\n } else {\n echo json_encode(array('success' => false, 'message' => lang('tours_cannot_be_deleted')));\n }\n }", "function delete()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $res[] = $db->query( \"DELETE FROM eZTodo_Priority WHERE ID='$this->ID'\" );\r\n eZDB::finish( $res, $db );\r\n }", "public function destroy($list_id)\n {\n $list = Listt::find($list_id);\n $list->delete();\n return redirect(route('adminpanel.index'));\n }", "public function remove()\n\t{\n\t\t$this->todo = 3 ;\n\t}", "function deleteTodo() {\n\n $results = array();\n $results['errorReturnAction'] = \"listTodos\";\n $results['errorMessage'] = \"To-do not found. Please try again.\";\n\n if ( isset( $_POST['confirm'] ) ) {\n\n // User has confirmed deletion: delete the to-do\n if ( !checkAuthToken() ) return;\n\n if ( $todo = Todo::getById( (int)$_POST['todoId'] ) ) {\n if ( $todo->userId == User::getLoggedInUser()->id ) {\n $todo->delete();\n header( \"Location: \" . APP_URL . \"?action=listTodos\" );\n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n \n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n\n } else {\n\n // User has not confirmed deletion yet: display the confirm dialog\n if ( $results['todo'] = Todo::getById( (int)$_GET['todoId'] ) ) {\n if ( $results['todo']->userId == User::getLoggedInUser()->id ) {\n require( TEMPLATE_PATH . \"/deleteTodo.php\" );\n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n\n } else {\n require( TEMPLATE_PATH . \"/errorDialog.php\" );\n }\n }\n}", "public function destroy(ToDo $toDo)\n {\n //\n }", "public function destroy(ToDo $toDo)\n {\n //\n }", "function delete_list_tasks($DBConnection, $ListID){\n\t \t//craft query to delete all tasks associated with this list\n\t \t$sql = \"DELETE FROM Tasks WHERE LID=\".$ListID;\n\t \tif($DBConnection->query($sql)){\n\t \t\t \n\t \t\t//if the query worked return true\n\t \t\treturn TRUE;\n\t \t}\n\t \t$DBConnection->free();//free the connection\n\t \t//otherwise return false\n\t \treturn FALSE;\n\t }", "public function destroy($id)\n\t{\n\t\t//\n\t\t$list = TodoList::findOrFail($id)->delete();\t\t\n\t\treturn back()->with('status', 'To Do List updated!');\n\t}", "public function delete($todoListId)\n\n {\n $item = ListTodo::findOrFail($todoListId);\n $todoId = $item->todoId;\n $item->delete();\n return redirect($todoId . '/todolist');\n }", "public function del(){\n\t\t$this->OnlyAdmin();\n\t\tif($this->input->post()){\n\t\t$this->TicketModel->delet($this->input->post());\n\t\tredirect('index.php/ticket/lists');}\n\t}", "public function do_delete_record()\n {\n $v_list_delete = get_post_var('hdn_item_id_list','');\n $this->model->do_delete_record($v_list_delete);\n }", "public function deleteUserTodoAction()\n {\n /** @var Object_Todo $todo */\n $data = $this->getRequestData();\n if (isset($data['todo_id'])) {\n $todo = Object_Todo::getById($data['todo_id']);\n if (!$todo) {\n $this->setErrorResponse('no Todo with this todo_id!');\n } elseif ($this->getDeviceSession()->getUserId() == $todo->getCreator()->getId()) {\n $todo->setPublished(false);\n if (!$todo->save()) {\n $this->setErrorResponse('cannot delete Todo object!');\n }\n } else {\n $this->setErrorResponse('no Todo for this user with current todo_id!');\n }\n } else {\n $this->setErrorResponse('todo_id is mandatory field for this request!');\n }\n $this->_helper->json(array('deleted' => true));\n }", "public function deleteList(){\n\n $posts=$this->articleDAO->getPosts();\n $this->view->adminRender ('delete_view', ['posts' =>$posts]);\n\n }", "public function del() {\n\t\t\tif (!empty($this->params['form']['items'])) {\n\t\t\t\t/* Convert string with ids to array */\n\t\t\t\t$allIds = explode(',', $this->params['form']['items']);\n\t\t\t\t$allIds = Sanitize::clean($allIds);\n\t\t\t\t\n\t\t\t\t/* Remove menu item(s) from tree */\n\t\t\t\t/* @todo Check if this could be done with a single method call/db request instead */\n\t\t\t\tforeach ($allIds AS $id) {\n\t\t\t\t\t$this->MyMenu->removefromtree($id, true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/* Get list of menu items */\n\t\t\t$this->menuList = $this->getThreadedList();\n\t\t\t$this->set('menuList', $this->menuList);\n\t\t\t\n\t\t\t$this->render('list');\n\t\t}", "public function delete(Request $request)\n {\n $task = Task::find($request->idTask);\n $task->delete();\n\n return redirect()->route('todo', ['id' => $request->fkTodo]);\n }", "public function destroyListItem($id)\n\t{\n\t\tDB::table('list_items')->where('id', $id)->delete();\n\t\t\n\t\treturn redirect(url('/yourLists'));\n\t}", "public function destroy($id)\n {\n if (!Auth::check() && Lists::find($id)->projet->user != Auth::user())\n return response()->json(['error' => \"Oups error\"],401);\n\n $tasks = Lists::find($id)->tasks;\n if (sizeof($tasks) == 0){\n Lists::find($id)->delete();\n return response()->json(['data' => \"Your List has been deleted\"],200);\n }\n return response()->json(['error' => \"You need to delete all his tasks before deleting\"],401);\n }", "public function getDoDelete($id) {\n $list = \\App\\Lists::find($id);\n $entries = \\App\\Entry::where('list_id',$id)->get();\n\n if(is_null($list)) {\n \\Session::flash('message','Not found.');\n return redirect('/profile');\n }\n\n # First remove any entries associated with this book\n if(isset($entries)) {\n foreach($entries as $entry){\n $entry->delete();\n }\n }\n\n # Then delete the book\n $list->delete();\n\n # Done\n \\Session::flash('message',$list->subject.' was deleted.');\n return redirect('/profile');\n\n }", "public function deleteAction($id)\n\t{\n\t\t$todolist = Todolist::findFirst($id);\n\n\t\tif(!$todolist){\n\t\t\t$this->flash->error(\"Don’t try to remove a contact that doesn’t even exist in the first please.\");\n\t\t}\n\t\telse {\n\t\t\tif(!$todolist->delete()){\n\t\t\t\t\n\t\t\t\tforeach ($todolist->getMessages() as $message) {\n\t\t\t\t\t$this->flash->error($message);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->flash->success(\"The Task R.I.P successful!!!\");\n\t\t\t}\n\n\t\t}\n\n\t\t$this->dispatcher->forward(['action' => 'index']);\n\t}", "public function destroy(Request $request,$id)\n {\n\n //Listan id\n $listid = $request->input('listid');\n\n //Jos listan id on annettu\n if($listid) {\n\n $creatorname = DB::select('select creator_name from lists where id = :list_id',['list_id' => $listid])[0]->creator_name;\n\n if($creatorname == $request->user()->username || $request->user()->usertype == 'admin') {\n\n $removedtask = DB::delete('delete from list_tasks where id = :task_id', ['task_id' => $id]);\n\n return response($removedtask, Response::HTTP_OK);\n\n } else {\n\n return response('action not allowed', Response::HTTP_OK);\n\n }\n\n //Jos listan id:tä ei ole annettu\n } else {\n\n return response('empty request', Response::HTTP_OK);\n\n }\n\n }", "function delete()\n {\n }", "public function destroy(TodoList $list, Todo $todo)\n {\n $todo->delete();\n\n return response()->json($todo);\n }", "public function removeTask()\n\t{\n\t\t// Check for request forgeries\n\t\tRequest::checkToken(['get', 'post']);\n\n\t\t// Incoming\n\t\t$ids = Request::getArray('id', array());\n\n\t\tif (count($ids) > 0)\n\t\t{\n\t\t\t// Loop through each ID\n\t\t\tforeach ($ids as $id)\n\t\t\t{\n\t\t\t\t$row = new Middleware\\Location(intval($id));\n\n\t\t\t\tif (!$row->delete())\n\t\t\t\t{\n\t\t\t\t\tthrow new \\Exception($row->getError(), 500);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tApp::redirect(\n\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false),\n\t\t\tLang::txt('COM_TOOLS_ITEM_DELETED'),\n\t\t\t'message'\n\t\t);\n\t}", "public function deleting()\n {\n # code...\n }", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "public function del()\n {\n }", "public function destroyList($id)\n\t{\n\t\tDB::table('list_items')->where('list_id', $id)->delete();\n\t\tDB::table('lists')->where('id', $id)->delete();\n\t\t\n\t\treturn redirect(url('/yourLists'));\n\t}", "public function deleteListAction(){\n $ebookers_obj = new Ep_Ebookers_Managelist();\n //to call a function to delete themes//\n $ebookers_obj->deleteList($this->_request->getParams());\n //unset($_REQUEST);\n exit;\n }", "public function deleteAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif ($item) {\n\t\t\t$item->delete();\n\t\t}\n\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName));\n\t}", "public function destroy(UserList $list)\n {\n\n try {\n\n TitleList::where('user_list_id','=', $list->id)->delete();\n UserList::where('id', '=', $list->id)->delete();\n \n } catch (Excepition $e) {\n\n return redirect(url()->previous())->with('error', $e);\n }\n \n return redirect(url()->previous());\n }", "public function destroy(TodoList $todolist)\n {\n $success = $todolist->delete();\n return $this->getResult($todolist->toArray(), $success);\n }", "public function deleteList(Request $request)\n {\n $this->boardList->deleteList($request); \n\n return [\n 'success' => 'success', \n ];\n }", "public function destroy(Todo $todo)\r\n {\r\n $todo->delete();\r\n return redirect('/');\r\n }", "function delete()\n\t{\n\t\t$model = $this->getModel();\n\t\t$viewType\t= JFactory::getDocument()->getType();\n\t\t$view = $this->getView($this->view_item, $viewType);\n\t\t$view->setLayout('confirmdelete');\n\t\tif (!JError::isError($model)) {\n\t\t\t$view->setModel($model, true);\n\t\t}\n\t\t//used to load in the confirm form fields\n\t\t$view->setModel($this->getModel('list'));\n\t\t$view->display();\n\t}", "public function destroy(ListModel $list)//($id)\n {\n //$list=ListModel::findOrFail($id);\n $list->delete();\n //возвращаемся назад с выводом сообщения\n $lis=\\Lang::get('listindex.List');\n $removed=\\Lang::get('listindex.removed');\n return redirect()->back()->with(['flash_message'=>$lis.' '.$list->name.' '.$removed]);\n }", "public function deleteList()\n {\n if (!request()->ajax()) {\n return response()->json(['error' => 1, 'msg' => 'Method not allow!']);\n } else {\n $ids = request('ids');\n $arrID = explode(',', $ids);\n $arrDontPermission = [];\n foreach ($arrID as $key => $id) {\n if(!$this->checkPermisisonItem($id)) {\n $arrDontPermission[] = $id;\n }\n }\n if (count($arrDontPermission)) {\n return response()->json(['error' => 1, 'msg' => sc_language_render('admin.remove_dont_permisison') . ': ' . json_encode($arrDontPermission)]);\n }\n AdminCmsContent::destroy($arrID);\n sc_clear_cache('cache_cms_content');\n return response()->json(['error' => 0, 'msg' => '']);\n }\n }", "public function remove() {\n\n //GETS TASK RECORD WITH REQUEST TASK ID (ID)\n $task = Tasks::findorfail(request('TaskID'));\n\n //DELETES TASK RECORD FROM DB\n $task->delete();\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$task->NotepadID\");\n }", "function delete_list($listid)\n\t{\n\t\t$this->http_set_content_type('text/html');\n\t\t$this->load_url(\"lists/$listid\", 'delete', array(), 204);\n\t\tif(intval($this->http_response_code) === 204):\n\t\t\treturn true;\n\t\tendif;\n\t\treturn false;\n\t}", "public function action_Delete()\n\t{\n\t\t// load item\n\t\t$item = ORM::factory('Ticket', $this->request->param('id'));\n\n\t\tif ( ! $item->loaded())\n\t\t\t$this->not_found('Could not find ticket to delete. Already deleted maybe?');\n\n\t\t$item->deleted_at = date('Y-m-d H:i:s');\n\t\t$item->save();\n\n\t\tHTTP::redirect('Ticket');\n\t}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function destroy(Request $request, $id)\n {\n $tasklist = $this->tasklist->whereId($id)->firstOrFail();\n $tasklist->delete();\n\n return API::throwActionSuccessResponse('Tasklist is removed from your list');\n }", "public function destroy($id)\n {\n $todo_lists = TodoList::findOrFail($id)->delete();\n\n return redirect()->route('todos.index')->withMessage('Successfully Deleted');\n }", "public function deleteTask()\n {\n if (User::isGuest())\n {\n $rtrn = Request::getVar('REQUEST_URI', Route::url('index.php?option=' . $this->_option, false, true), 'server');\n App::redirect(\n Route::url('index.php?option=com_users&view=login&return=' . base64_encode($rtrn)),\n Lang::txt('COM_RADIAM_LOGIN_NOTICE'),\n 'warning'\n );\n return;\n }\n\n if (!$this->config->get('access-delete-entry')\n && !$this->config->get('access-manage-entry'))\n {\n App::abort(403, Lang::txt('COM_RADIAM_NOT_AUTH'));\n }\n\n // Incoming\n $id = Request::getInt('entry', 0);\n\n if (!$id)\n {\n return $this->displayTask();\n }\n\n $process = Request::getVar('process', '');\n $confirmdel = Request::getVar('confirmdel', '');\n\n // Initiate a blog entry object\n $entry = Entry::oneOrFail($id);\n\n // Did they confirm delete?\n if (!$process || !$confirmdel)\n {\n if ($process && !$confirmdel)\n {\n $this->setError(Lang::txt('COM_RADIAM_ERROR_CONFIRM_DELETION'));\n }\n\n foreach ($this->getErrors() as $error)\n {\n $this->view->setError($error);\n }\n\n $this->view\n ->set('config', $this->config)\n ->set('entry', $entry)\n ->display();\n return;\n }\n\n // Check for request forgeries\n Request::checkToken();\n\n // Delete the entry itself\n $entry->set('state', 2);\n\n if (!$entry->save())\n {\n Notify::error($entry->getError());\n }\n\n // Log the activity\n Event::trigger('system.logActivity', [\n 'activity' => [\n 'action' => 'deleted',\n 'scope' => 'radiam.entry',\n 'scope_id' => $id,\n 'description' => Lang::txt('COM_RADIAM_ACTIVITY_ENTRY_DELETED', '<a href=\"' . Route::url($entry->link()) . '\">' . $entry->get('title') . '</a>'),\n 'details' => array(\n 'title' => $entry->get('title'),\n 'url' => Route::url($entry->link())\n )\n ],\n 'recipients' => [\n $entry->get('created_by')\n ]\n ]);\n\n // Return the entries lsit\n App::redirect(\n Route::url('index.php?option=' . $this->_option)\n );\n }", "public function DELETE() {\n #\n }", "public static function delete() {\n\n\n\t\t}", "public final function delete() {\n }", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete()\n {\n \n }", "public function destroy($id)\n {\n $tasklist = Tasklist::find($id);\n $tasklist->delete();\n\n if (\\Auth::id() === $tasklist->user_id) {\n $tasklist->delete();\n }\n\n return redirect('/');\n }", "public function delete()\n {\n $items = Input::get('items');\n\n if ( ! $items && ! count($items)) return 0;\n\n return $this->deleter->delete($items);\n }", "public function delete() {\n $this->remove_content();\n\n parent::delete();\n }", "function Doctor_Delete(){\n\t\t\n\t\t//when get id from url\n\t\tif(isset($_GET['List']) AND $_GET['List'] != ''){\n\t\t\t\n\t\t\t//move get id into variable\n\t\t\t$get_id = $_GET['List'];\n\t\t\t\n\t\t\t//delete doctor from table\n\t\t\t$this->Delete('users',$get_id,'Add-doctor?List&m');\n\t\t} // ifsset close\n\t}", "public function delete() {\n global $DB;\n foreach ($this->targets as $target) {\n $DB->delete_records('progressreview_tutor', array('id' => $target->id));\n }\n }", "public function delete_task_name(Request $request){\n\n DB::delete('delete from tasks where id = ?',[$request->id]);\n }", "public function delete() {\r\n }", "public function deleteTodo ($id) {\n $user = Auth::user();\n $todo = Todo::where('user_id', $user->id)->where('id', $id)->first();\n if ($todo->exists()) {\n $todo->delete();\n\n return response()->json([\n \"status\" => \"200\",\n \"success\" => \"Todo Deleted Successfully\",\n // \"data\" => Todo::where('user_id', $user->id)->get()\n ], 201);\n } else {\n return response()->json([\n \"status\" => \"404\",\n \"error\" => \"Could Not Found\",\n ], 404);\n }\n }", "protected function delete() {\n\t}", "public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }", "public function testSuccessfullRemoveTodo()\n {\n $this->seeInDatabase('todos', [\n 'uuid' => 'a207329e-6264-4960-a377-5b6dc8995d19',\n ]);\n\n $response = $this->json('DELETE', '/todos/a207329e-6264-4960-a377-5b6dc8995d19', [], [\n 'apikey' => $this->apiAuth['uuid'],\n 'Authorization' => 'Bearer ' . $this->token,\n ]);\n\n $response->assertResponseStatus(204);\n\n $this->dontSeeInDatabase('todos', [\n 'uuid' => 'a207329e-6264-4960-a377-5b6dc8995d19',\n ]);\n }", "public function delete()\n {\n $user = new Task();\n $attributes = $this->request->body();\n\n if( $user->setAttributes($attributes)->delete() ) {\n // return ['status' => 'success']; // for ajax\n header(\"Location: /task/index\");\n exit;\n }\n\n return ['status' => 'cannot delete'];\n }", "public function delete()\n {\n \n }", "public function delete()\n\t{\n\t\t$selection = $this->input->post('selection');\n\t\t$ignore = implode('|', array_diff($this->ignore_list, $selection));\n\t\t$this->member->ignore_list = $ignore;\n\t\t$this->member->save();\n\n\t\tee()->functions->redirect(ee('CP/URL')->make($this->index_url, $this->query_string));\n\t}", "public function delete($id) {\r\n $model = TodoItemModel::findById($id);\r\n $model->delete();\r\n return $this->redirect('/');\r\n }", "protected function deleteTask() {}", "public function destroy(Todo $todo)\n {\n //\n Todo::destroy($todo->id);\n return redirect('/todos')->with('status', 'Data Berhasil Dihapus!');\n }", "public function deleteAction() {\n \n $this->_helper->layout->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n \n\n $del = $this->_model->deleteNote($this->id);\n\n if( $this->xhr ) {\n \n $this->_asJson(array('id' => $this->id,\n 'consumer_id' => $this->consumer_id,\n 'message' => 'Note Removed.',\n 'success' => $del));\n }else{\n \n $this->_helper->flashMessenger->addMessage(array('alert alert-success'=>\"Note Removed.\") ); \n $this->_redirect($this->indexAction . $this->consumer_id);\n \n }\n }", "public function delete(): void\n {\n }", "public function delete()\n\t{\n\t\t// Check for request forgeries\n\t\tJRequest::checkToken('request') or die(JText::_('JINVALID_TOKEN'));\n\n\t\t// Get items to remove from the request.\n\t\t$cid[] = JFactory::getApplication()->input->get('a_id', 0, 'int');\n\n\t\tif (!is_array($cid) || count($cid) < 1)\n\t\t{\n\t\t\tJLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Get the model.\n\t\t\t$model = $this->getModel();\n\n\t\t\t// Remove the item.\n\t\t\tif ($model->delete($cid))\n\t\t\t{\n\t\t\t\t$this->setMessage(JText::_($this->text_prefix . '_ITEM_DELETED'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->setMessage($model->getError());\n\t\t\t}\n\t\t}\n\n\t\t$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . '&id=' . $this->getRedirectToListAppend(), false));\n\t}", "public function delete()\r\n\t{\r\n\t}", "function delete() {\n\t\t\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\tConfigure::write('debug', 0);\n\t\t\n\t\t$id = $this->Session->read('Member.memberid');\n\t\t\n\t\t// id 4 means trash\n\t\t\n\t\t$activeid = 4;\n\t\t\t$this->Member->updateAll(array(\n\t\t\t\t'Member.active' => \"'\" . $activeid . \"'\"\n\t\t\t), array(\n\t\t\t\t'Member.id' => $id\n\t\t\t));\n\t\t\n\t\techo \"deleted\";\n\t\t\t\n\t\n\t/*\tif ($id) {\n\t\t\t\n\t\t\t$delete = $this->Member->delete($id);\n\t\t\t\n\t\t \tif ($delete) {\n\t\t\t\t$meta = $this->userMeta->deleteAll(array(\n\t\t\t\t\t'userMeta.member_id' => $id\n\t\t\t\t));\n\t\t\t\t$course = $this->TutCourse->deleteAll(array(\n\t\t\t\t\t'TutCourse.member_id' => $id\n\t\t\t\t));\n\t\t\t\t$event = $this->TutEvent->deleteAll(array(\n\t\t\t\t\t'TutEvent.tutor_id' => $id\n\t\t\t\t));\n\t\t\t\t$image = $this->UserImage->deleteAll(array(\n\t\t\t\t\t'UserImage.user_id' => $id\n\t\t\t\t));\n\t\t\t\t\n\t\t\t}\n\t\t\tif ($meta) {\n\t\t\t\techo \"deleted\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} */\n\t\t\n\t\t\n\t\n\t\n\t}", "public function delete()\n {\n // TODO: Implement delete() method.\n }", "function index_delete() {\n $id = $this->delete('id'); // Memanggil data berdasarkan arraynya\n $this->db->where('id', $id);\n $delete = $this->db->delete('telepon'); \n if ($delete) {\n $this->response(array('status' => 'success'), 201);// Jika berhasil maka akan tampil\n } else {\n $this->response(array('status' => 'fail', 502));// Jika gagal maka akan tampil\n }\n }", "public function add_delete_from_reading_list_post()\n {\n $post_id = $this->input->post('post_id');\n\n if (empty($post_id)) {\n redirect($this->agent->referrer());\n }\n\n $is_post_in_reading_list = $this->reading_list_model->is_post_in_reading_list($post_id);\n\n //delete from list\n if ($is_post_in_reading_list == true) {\n $this->reading_list_model->delete_from_reading_list($post_id);\n } else {\n //add to list\n $this->reading_list_model->add_to_reading_list($post_id);\n }\n\n redirect($this->agent->referrer());\n }", "public function delete()\n {\n if(!isset($_SESSION['login']) || $_SESSION['login'] != 'admin123') {\n return redirect('page-not-found');\n }\n $this->task->delete($_GET['id']);\n\n return redirect('');\n }", "public function destroy($id)\n {\n $todo = Todo::find($id);\n $todo->deleted_yn = 1;\n $todo->deleted_at = Carbon::now();\n $todo->save();\n return redirect(route('todo.index'));\n }", "function delete()\n\t{\n\t\t// Check for request forgeries.\n\t\tJRequest::checkToken() or jexit(JText::_('Invalid_Token'));\n\n\t\t// Get and sanitize the items to delete.\n\t\t$cid = JRequest::getVar('cid', null, 'post', 'array');\n\t\tJArrayHelper::toInteger($cid);\n\n\t\t// Get the model.\n\t\t$model = & $this->getModel('Link', 'RedirectModel');\n\n\t\t// Attempt to delete the item(s).\n\t\tif (!$model->delete($cid)) {\n\t\t\t$this->setMessage(JText::sprintf('Redirect_Link_Delete_Failed', $model->getError()), 'notice');\n\t\t}\n\t\telse {\n\t\t\t$this->setMessage(JText::sprintf('Redirect_Link_Delete_Success', count($cid)));\n\t\t}\n\n\t\t// Redirect to the list screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_redirect&view=links', false));\n\t}", "public function actionDelete() {}" ]
[ "0.7782574", "0.73112094", "0.72195613", "0.71730906", "0.7115361", "0.70023465", "0.6972259", "0.6886819", "0.6881243", "0.6838658", "0.68322116", "0.68302083", "0.68302083", "0.67959166", "0.6775024", "0.6729515", "0.672243", "0.6720572", "0.6624582", "0.66016763", "0.6596646", "0.65872645", "0.657045", "0.6567277", "0.6559266", "0.65537405", "0.65456164", "0.6524098", "0.6517015", "0.65111715", "0.6473965", "0.64730597", "0.6473026", "0.64710176", "0.6461524", "0.64510137", "0.64443845", "0.64359206", "0.64305604", "0.6430421", "0.64295787", "0.64171135", "0.6409333", "0.64039254", "0.6400213", "0.6399642", "0.63936776", "0.63936776", "0.6393267", "0.6392902", "0.6391735", "0.6384873", "0.6371234", "0.6370499", "0.6370454", "0.6356162", "0.63479334", "0.63479334", "0.63479334", "0.63479334", "0.63479334", "0.63479334", "0.63479334", "0.63479334", "0.63479334", "0.63479334", "0.63479334", "0.63479334", "0.63479334", "0.63479334", "0.63479334", "0.634788", "0.6343696", "0.6332872", "0.6332721", "0.632745", "0.63271636", "0.6322794", "0.6322278", "0.6314669", "0.6313608", "0.6311267", "0.6307646", "0.6306514", "0.6304995", "0.62961036", "0.6294785", "0.62848014", "0.6284052", "0.6281499", "0.6276952", "0.62685424", "0.6267921", "0.62671155", "0.62646157", "0.62600243", "0.62535894", "0.6246334", "0.6246194", "0.6235043", "0.6234884" ]
0.0
-1
Does the todo list exist?
public function exists( $id, $archived = false ) { $file = $this->fullpath( $id, $archived ); return file_exists( $file ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasTaskList(){\n return $this->_has(2);\n }", "private static function checkIfTodoListTableExists()\n {\n $query = \"SELECT 1 FROM Todo_List\";\n $result = mysqli_query(Core_DbConnectionModel::getInstance(), $query);\n\n //this part allows you to do something if the result is false or just return $result, however, you should check for MySQL error just in-case.\n $tableExistStatus = ($result !== false) ? true : false;\n\n return $tableExistStatus;\n }", "public function hasCheckInTaskList(){\n return $this->_has(2);\n }", "private function checkIsExists(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.listId' => $this->listId,\n $this->table. '.campaignId' => $this->campaignId,\n ]\n ]);\n\n return !is_null($id);\n }", "public function exists()\n {\n foreach ($this->lists as $list) {\n if (method_exists($list, 'exists') && $list->exists()) {\n return true;\n }\n }\n return false;\n }", "function exists()\n {\n return false;\n }", "public function Exists();", "public function exists()\n {\n return false;\n }", "public function exists()\n {\n return true;\n }", "public function exists() {}", "public function exists();", "public function exists();", "public function exists();", "private function canListAndCreate()\n {\n return true;\n }", "public function exists()\r\n {\r\n }", "public function exists()\n {\n }", "public function exists()\n {\n }", "public function exists()\n {\n if (get_post($this->id)) {\n return true;\n }\n\n return false;\n }", "public function exists(): bool;", "public function exists(): bool;", "public function exists(): bool;", "private function _existsListAlready($listname)\r\n {\r\n $_listname = $this->_validListname($listname);\r\n $lists = $this->getLists();\r\n $_lists = $lists->lists;\r\n foreach ($_lists->list as $list) {\r\n if ($list->name == $_listname) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "static function isExists($alias = NULL) {\n if ($alias === NULL) {\n return FALSE;\n } else {\n if (self::$list == NULL){\n self::getList();\n }\n return (isset(self::$list[$alias])) ? TRUE : FALSE;\n }\n }", "protected function exists() {}", "public function exists(){\n\t\treturn ($this->count() > 0);\n\t}", "function check_exists()\r\n\t{\r\n\t\t$name = url_title($this->input->post('name'));\r\n\r\n\t\t$exists = $this->item_definition_model->check_exists(\r\n\t\t\t'name',\r\n\t\t\t$name,\r\n\t\t\t$this->input->post('id_item_definition')\r\n\t\t);\r\n\r\n\t\t$this->xhr_output($exists);\r\n\t}", "function exists() {\n\t\tif ($this->exists) return true;\n\t\treturn false;\n\t}", "function exists() {\n\t return !empty($this->id);\n\t}", "public function exists() {\n\t\treturn !is_null($this->id);\n\t}", "public function if_item_is_in_list( $user_id, $list, $item ) {\n \n // Verify if list's meta exists\n $this->db->select('*');\n $this->db->from('lists_meta');\n $this->db->where(['user_id' => $user_id, 'list_id' => $list, 'body' => $item]);\n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n return true;\n \n } else {\n \n $this->db->select('*');\n $this->db->from($this->table);\n $this->db->where(['user_id' => $user_id, 'list_id' => $list]);\n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n return false;\n \n } else {\n \n return true;\n \n }\n \n }\n \n }", "public function exists()\n {\n return !empty($this->ID);\n }", "public function exists()\n {\n return $this->count() > 0;\n }", "public function hasTasks()\n {\n return $this->count() > 0;\n }", "public function exist()\n {\n return ($this->count() > 0);\n }", "public function exists()\n {\n return ($this->id) ? true : false;\n }", "public function if_user_has_list($user_id, $list, $type) {\n \n $this->db->select('*');\n $this->db->from('lists');\n $this->db->where(['user_id' => $user_id, 'list_id' => $list, 'type' => $type]);\n $query = $this->db->get();\n \n if ($query->num_rows() > 0) {\n \n return true;\n \n } else {\n \n return false;\n \n }\n \n }", "public function isList(): bool\n {\n return $this->list;\n }", "public function isExists()\n\t{\n\t\treturn $this->storage->isExists() && $this->dictionary->isExists();\n\t}", "public function isKeyExist($key)\n {\n if(isset($this->list[$key]))\n {\n return true;\n }\n\n return false;\n }", "public function exists()\n\t{\n\t\treturn ! $this->hasBeenRemoved;\n\t}", "public function is_listable() {\n\t\treturn isset( $this->data['listable'] ) && $this->data['listable'];\n\t}", "function listNameValidator($console, $name):bool\r\n{\r\n\r\n $html_resp = curlHelper::execute($console, 'lists/'.$name.'?format=json',array(404,200));\r\n\r\n if($html_resp['code'] != 404) {\r\n return false;\r\n }else return true;\r\n\r\n}", "private function _isListAssociatedWithUser($listname) \r\n {\r\n return $this->_existsListAlready($listname);\r\n }", "public function testIsOnTasksListPage()\n {\n $this->addTestFixtures();\n $this->logInAsUser();\n $this->client->request('GET', '/tasks');\n\n $response = $this->client->getResponse();\n $responseContent = $response->getContent();\n\n $statusCode = $response->getStatusCode();\n $this->assertEquals(200, $statusCode);\n $this->assertContains($this->task->getTitle(), $responseContent);\n $this->assertContains($this->task->getContent(), $responseContent);\n }", "public function exists()\n {\n return $this->exists;\n }", "public function exists() {\n\t\ttry {\n\t\t\t$this->load();\n\t\t\treturn true;\n\t\t} catch ( \\Exception $e ) {\n\t\t\treturn false;\n\t\t}\n\t}", "public function exists()\n {\n return ($this->id > 0) ? true : false;\n }", "public function hasTaskTitle(){\n return $this->_has(3);\n }", "public function exists() {\n\t\treturn !isset($userData);\n\t}", "public function exists() {\n\t\treturn $this->_exists;\n\t}", "public function exists() {\n return $this->shareData !== false;\n }", "function exists()\r\n\t{\r\n\t\treturn ( ! empty($this->id));\r\n\t}", "public function exists()\n {\n return !empty($this->data);\n }", "function CanCreateList()\n\t{\n\t\tif (!verify($this->userid)) {\n\t\t\treturn -1;\n\t\t}\n\n\t\tif ($this->Admin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ($this->ListAdmin()) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$maxlists = $this->GetMaxLists();\n\n\t\t// if there is no maximum set, double check they have permission to create a list.\n\t\tif ($maxlists == 0) {\n\t\t\tif ($this->HasAccess('Lists', 'Create')) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t$mylists = count(array_keys($this->GetLists()));\n\t\tif ($mylists < $maxlists) {\n\t\t\tif ($this->HasAccess('Lists', 'Create')) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t\treturn false;\n\t}", "public function exists(){\n\n\t\treturn (!empty($this->_data)) ? true : false;\n\n\t}", "public function deleteToDoList() {\n try {\n if (!($this->toDoList instanceof Base_Model_ObtorLib_App_Core_Crm_Entity_ToDoList)) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception(\" ToDoList Entity not intialized\");\n } else {\n $objToDoList = new Base_Model_ObtorLib_App_Core_Crm_Dao_ToDoList();\n $objToDoList->toDoList = $this->toDoList;\n return $objToDoList->deleteToDoList();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception($ex);\n }\n }", "public function exists()\n\t{\n\t\treturn $this->get('fullPath') && file_exists($this->get('fullPath'));\n\t}", "static function exists($id) {\n $result = self::get($id);\n if (count($result) > 0) return true;\n return false;\n }", "public function exists()\n {\n return $this->versions()->count() > 0;\n }", "public function hasAlarmList()\n {\n return $this->alarm !== null;\n }", "public function exists() {\r\n return strlen($this->contents) > 0;\r\n }", "function exists() {\n \n return !empty($this->cache);\n \n }", "public function valid()\n {\n return isset($this->list[$this->position]);\n }", "public function hasTaskId(){\n return $this->_has(2);\n }", "function contains($item) {\r\n return in_array($item, $this->list);\r\n }", "public function isExists(){\n\t\treturn file_exists($this->getFullName());\n\t}", "public function isList() {\n \t\treturn false;\n \t}", "public function hasContactlistTemplatesList()\n {\n return $this->contactlist_templates !== null;\n }", "public function exists()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$this->getModel();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tcatch(ECash_Application_NotFoundException $e)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function check_exists()\n\t{\n\t\t$name = url_title($this->input->post('name'));\n\n\t\t$exists = $this->content_type_model->check_exists(\n\t\t\t'name',\n\t\t\t$name,\n\t\t\t$this->input->post('id_content_type')\n\t\t);\n\n\t\t$this->xhr_output($exists);\n\t}", "public static function isMaillistExists($ownerId, $name)\r\n {\r\n return (Warecorp_User_Maillist::getId($ownerId, $name) != 0);\r\n }", "public function exists()\n {\n $this->exists = false;\n\n if (is_array($this->temp_files)\n && count($this->temp_files) > 0\n ) {\n $this->exists = true;\n }\n\n return;\n }", "public function eventExists()\n {\n return $this->getTalk()->getSpeaker()->exists();\n }", "public function exists_in_posts_table() {\r\n\t\treturn ! empty( $this->db_id );\r\n\t}", "public function check_exists(){\n\t\tif(!empty($this->data['Leave']['leave_from']) && !empty($this->data['Leave']['leave_to'])){\n\t\t\t$from = $this->format_date_save($this->data['Leave']['leave_from']);\n\t\t\t$to = $this->format_date_save($this->data['Leave']['leave_to']);\n\t\t\t$count = $this->find('count', array('conditions' => array('or' => array('leave_from between ? and ?' => array($from, $to),\n\t\t\t'leave_to between ? and ?' => array($from, $to)), 'Leave.users_id' => CakeSession::read('USER.Login.id'), \n\t\t\t'Leave.is_deleted'=> 'N', 'Leave.is_approve !=' => 'R')));\n\t\t\tif($count > 0){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "abstract public function exists();", "abstract public function exists();", "public function exists()\n {\n return ($this->conversation !== null);\n }", "public function updateToDoList() {\n try {\n if (!($this->toDoList instanceof Base_Model_ObtorLib_App_Core_Crm_Entity_ToDoList)) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception(\" ToDoList Entity not intialized\");\n } else {\n $objToDoList = new Base_Model_ObtorLib_App_Core_Crm_Dao_ToDoList();\n $objToDoList->toDoList = $this->toDoList;\n return $objToDoList->updateToDoList();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception($ex);\n }\n }", "public function hasContactList()\n {\n return $this->contact !== null;\n }", "public static function exists()\n {\n return Session::get('UserID') != null;\n }", "private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }", "public function exists()\r\n {\r\n global $g_comp_database_system;\r\n\r\n $l_sql = \"SELECT * FROM isys_report WHERE \" . \"(isys_report__title = '\" . $g_comp_database_system->escape_string($this->m_title) . \"');\";\r\n\r\n $l_resource = $g_comp_database_system->query($l_sql);\r\n if ($g_comp_database_system->num_rows($l_resource) > 0)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n } // if\r\n }", "public function exists()\n {\n return file_exists($this->path);\n }", "function _isInstalled()\n\t{\n\t\t$success = false;\n\t\t\n\t\tjimport('joomla.filesystem.file');\n\t\tif (JFile::exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_phplist'.DS.'defines.php')) \n\t\t{\n\t\t\t// Check the registry to see if our Tienda class has been overridden\r\n\t\t\tif ( !class_exists('Phplist') )\r\n\t\t\t\tJLoader::register( \"Phplist\", JPATH_ADMINISTRATOR.DS.\"components\".DS.\"com_phplist\".DS.\"defines.php\" );\r\n\t\t\tif ( !class_exists('PhplistConfigPhplist') )\r\n\t\t\t\tJLoader::register( \"PhplistConfigPhplist\", JPATH_ADMINISTRATOR.DS.\"components\".DS.\"com_phplist\".DS.\"defines.php\" );\r\n\t\t\t\t\n\t\t\t\n\t\t\tPhplist::load( 'PhplistHelperNewsletter', 'helpers.newsletter' );\n\t\t\tPhplist::load( 'PhplistHelperMessage', 'helpers.message' );\n\t\t\tPhplist::load( 'PhplistHelperEmail', 'helpers.email' );\n\t\t\tPhplist::load( 'PhplistHelperPhplist', 'helpers.phplist' );\n\t\t\tPhplist::load( 'PhplistHelperConfigPhplist', 'helpers.configphplist' );\n\t\t\t\n\t\t\t$success = true;\n\t\t}\n\t\t\n\t\tif ($success == true) {\n\t\t\t// Also check that DB is setup\n\t\t\t$database = PhplistHelperPhplist::getDBO();\n\t\t\tif (!isset($database->error)) \n\t\t\t{\n\t\t\t\t$success = true;\n\t\t\t}\n\t\t}\n\t\treturn $success;\n\t}", "function exists() {\n\t\tif ( !$this->postID )\n\t\t\treturn false;\n\t\t\t\n\t\t$sql = \"SELECT post_id FROM $this->cacheTable WHERE post_id = \" . $this->db->escape( $this->postID ) . \"\";\n\t\t\n\t\t$results = $this->db->get_results( $sql );\n\t\t\n\t\tif ( $results[0] )\n\t\t\treturn true;\n\t\t\t\n\t\treturn false;\n\t\t\n\t}", "public function exists()\n {\n try {\n $this->connection->getJob($this->identity + ['fields' => 'jobReference']);\n } catch (NotFoundException $ex) {\n return false;\n }\n\n return true;\n }", "public function exists() {\n\t\treturn file_exists($this->_pidFile);\n\t}", "public function checkListingExists()\n {\n $url = $this->input->post('lisingtDomain');\n $domain = parse_url($url, PHP_URL_HOST);\n $settingsData = $this->database->getSettingsData();\n $output['token'] = $this->security->get_csrf_hash();\n header('Content-Type: application/json');\n\n $data = array(\n 'domain' => $domain,\n 'status' => 1,\n 'user_id' => $this->session->userdata('user_id'),\n );\n\n if ($settingsData[0]['activate_one_listing_per_domain'] === '1') {\n $domain_id = $this->database->_get_single_data('tbl_domains', $data, 'id');\n if (!empty($domain_id)) {\n $dataList = array(\n 'status' => 1,\n 'domain_id' => $domain_id,\n 'sold_status' => 0,\n 'user_id' => $this->session->userdata('user_id'),\n );\n\n $rec_count = $this->database->CheckAlreadyExists('tbl_listings', $dataList);\n if ($rec_count > 0) {\n $output['response'] = true;\n exit(json_encode($output));\n }\n }\n }\n $output['response'] = false;\n exit(json_encode($output));\n }", "public function exists()\n {\n return file_exists($this->getPath());\n }", "function hasUncheckedLinks($list)\n\t{\n\t\t//only checking one list side per call\n\t\tforeach($list as $l)\n\t\t{\n\t\t\tif($l['done'] == 0)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t\t\n\t\t\n\t}", "public function exists()\n {\n return $this->adapter->isFile($this->path, true);\n }", "public function addToListAction() {\n //get id of recipe which should be added to list\n $recipeID = (int) $this->params()->fromRoute('recipeID');\n\n //get default list of user\n if ($_SESSION['user'] != \"\") {\n $userID = $_SESSION['user'];\n\n $list = $this->getListsTable()->getListsByUser($userID); //1 list \n\n $listID = 0; \n if ($list != null) {\n $listID = $list->listID;\n } else { //create default list\n $listNew = new Lists();\n //use default text for name and description of list\n $listName = \"favoriteList\";\n $listDescription = \"Default list for user\";\n $listNew->exchangeArray(array('createUserID' => $userID,\n 'listName' => $listName,\n 'listDescription' => $listDescription));\n\n //returns id of new list\n $listID = $this->getListsTable()->saveList($listNew);\n }\n\n if ($listID > 0) {\n //the user has now a list \n $listDetailNew = new ListDetail();\n $listDetailNew->exchangeArray(array('listID' => $listID,\n 'recipeID' => $recipeID));\n // the check if recipe is already in list is done in this function\n $this->getListDetailTable()->saveListDetail($listDetailNew); \n } else {\n //should not happen\n throw new \\Exception(\"Favorite Recipe - no list found for $userID\");\n }\n\n return $this->redirect()->toRoute('list', array('action' => 'viewList')); \n }//check if user is logged-in}\n }", "public function exists($key){return array_key_exists($key,$this->items_array);}", "public static function isExist()\n\t{\n\t\t$fields = self::getFields();\n\t\treturn !empty($fields);\n\t}", "public function addToDoList() {\n try {\n if (!($this->toDoList instanceof Base_Model_ObtorLib_App_Core_Crm_Entity_ToDoList)) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception(\" ToDoList Entity not intialized\");\n } else {\n $data = array(\n 'list_title' => $this->toDoList->getListTitle(),\n 'list_description' => $this->toDoList->getListDescription(),\n 'added_on' => $this->toDoList->getAddedOn(),\n 'added_by' => $this->toDoList->getAddedBy(),\n 'added_user_type' => $this->toDoList->getAddedByUserObject(),\n 'reminder_on' => $this->toDoList->getReminderOn(),\n 'reminder_date' => $this->toDoList->getReminderDate(),\n 'reminder_time' => $this->toDoList->getReminderTime(),\n 'current_status' => $this->toDoList->getStatus());\n $last_inserted_id = $this->insert($data);\n return $last_inserted_id;\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception($ex);\n }\n }", "public function exists()\n\t{\n\t\treturn is_file($this->_path);\n\t}", "public function canCreateListing() {\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n if( !$viewer || !$viewer->getIdentity() ) {\r\n return false;\r\n }\r\n\t\t\r\n\t\t$listingtype_id = Engine_Api::_()->ynmultilisting()->getCurrentListingTypeId();\r\n\t\tif (!$listingtype_id) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$listingtype = Engine_Api::_()->ynmultilisting()->getCurrentListingType();\r\n if( !$listingtype->checkPermission($viewer, 'ynmultilisting_listing', 'create')) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "function playlist_exists($name,$user,$type=NULL)\r\n\t{\r\n\t\tglobal $db;\r\n\t\tif($type)\r\n\t\t\t$type = $this->type;\r\n\t\t$count = $db->count(tbl($this->playlist_tbl),\"playlist_id\",\" userid='$user' AND playlist_name='$name' AND playlist_type='\".$type.\"' \");\r\n\r\n\t\tif($count)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}", "private function _isTodo()\n {\n $string = '';\n\n // Check to see if Todo points are present\n if (!empty($this->view->todo)) {\n $string = '<pre>' . $this->view->todo . '</pre><hr />';\n }\n\n return $string;\n }", "public function exists() {\n\n return file_exists($this->path);\n }" ]
[ "0.69863826", "0.68293256", "0.6670974", "0.66367286", "0.66166806", "0.6424875", "0.6389467", "0.6277692", "0.6262712", "0.6225053", "0.619561", "0.619561", "0.619561", "0.6166395", "0.614979", "0.6139405", "0.61391646", "0.6123752", "0.61158943", "0.61158943", "0.61158943", "0.61123294", "0.6109637", "0.6064137", "0.6048612", "0.6031355", "0.60309386", "0.60205305", "0.6015457", "0.6009352", "0.5997473", "0.5983512", "0.5979879", "0.59691566", "0.5950027", "0.5929371", "0.5914123", "0.59034055", "0.589187", "0.58836097", "0.58667135", "0.58585584", "0.58524406", "0.58458465", "0.5835482", "0.582928", "0.58262694", "0.5820124", "0.5792888", "0.57870996", "0.57867444", "0.5778713", "0.57770056", "0.5767654", "0.57389736", "0.57338166", "0.57309735", "0.5713771", "0.5710039", "0.5707677", "0.5706499", "0.56725675", "0.5667467", "0.56674546", "0.56637025", "0.566273", "0.56595206", "0.5649086", "0.56467927", "0.56258273", "0.56209415", "0.5611829", "0.56039107", "0.5602741", "0.5597824", "0.55897653", "0.55897653", "0.5580789", "0.5575608", "0.5568186", "0.55677927", "0.556694", "0.5564291", "0.5562734", "0.5555216", "0.5546728", "0.55466205", "0.55353904", "0.55349654", "0.55282074", "0.5527817", "0.55263907", "0.55241746", "0.5517954", "0.5513838", "0.5513452", "0.55039275", "0.5501284", "0.54999936", "0.5488827", "0.54826087" ]
0.0
-1
Return the ids of all the lists
public function getAll( $archived = false ) { $match = $this->path; if ( $archived ) { $match .= 'archived/'; } $match .= '*' . $this->extension; $files = glob( $match ); $ids = array(); foreach ($files as $file) { $ids[] = basename( $file, $this->extension ); } return $ids; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIdsList() {\n return $this->_get(1);\n }", "public function getAllIds();", "public function getIds();", "public function getIds();", "public abstract function get_ids();", "public function getAllIds(): array;", "public function getIdList() {\n migrate_instrument_start(\"Retrieve $this->listUrl\");\n if (empty($this->httpOptions)) {\n $json = file_get_contents($this->listUrl);\n }\n else {\n $response = drupal_http_request($this->listUrl, $this->httpOptions);\n $json = $response->data;\n }\n migrate_instrument_stop(\"Retrieve $this->listUrl\");\n if ($json) {\n $data = drupal_json_decode($json);\n if ($data) {\n return $this->getIDsFromJSON($data);\n }\n }\n Migration::displayMessage(t('Loading of !listurl failed:',\n array('!listurl' => $this->listUrl)));\n return NULL;\n }", "public function getListId();", "function getIDlist() {\n return array_keys($this->varList);\n }", "public abstract static function getListID();", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function getIds()\n\t{\n\t\treturn $this->ids;\n\t}", "public function getIds()\n {\n\n }", "public function getIdentities()\n {\n return [\\Ss\\Collection\\Model\\Collection::CACHE_TAG . '_' . 'list'];\n }", "public function getIds()\n {\n return $this->ids;\n }", "public function getIds()\n {\n return $this->ids;\n }", "public function listId() {\n\t\treturn $this->academic_session->all()->pluck('id')->all();\n\t}", "public function getIds() {\n $sources = array();\n \n $sources[] = $this->id;\n \n foreach ($this->points as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->lines as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->polygons as &$g) {\n $sources[] = $g->id;\n }\n if ( !empty($this->address) ) {\n $sources[] = $this->address->id;\n }\n foreach ($this->relationships as &$r) {\n $sources[] = $r->id;\n }\n \n return array_filter($sources);\n }", "public function getReferenceIdsList(){\n return $this->_get(2);\n }", "public function model_id_list()\r\n {\r\n $this->set_error(\"MBE-\".$this->model_code.\"-MIL-1\", \r\n \"Internal error, please contact admin\", \r\n \"Missing model_id_list API for this model \".$this->model_name);\r\n $model_id_list = array();\r\n /*\r\n $model_id_list = array (\r\n array(\r\n \"table\" => \"dummy_table\", \r\n \"editable\" => false,\r\n \"id_column\" => \"dummy_id\",\r\n \"data_column\" => array(\r\n array(\"data\" => \"dummy_name\", \"column\" => \"dummy_column\"),\r\n ),\r\n ),\r\n );\r\n */\r\n return $model_id_list;\r\n }", "public function ids()\n {\n return $this->_ids;\n }", "public function listId() {\n\t\treturn $this->employee->get()->pluck('id')->all();\n\t}", "function taminoGetIds() {\n $rval = $this->tamino->xquery($this->xquery);\n if ($rval) { // tamino Error\n print \"<p>LinkCollection Error: failed to retrieve linkRecord id list.<br>\";\n print \"(Tamino error code $rval)</p>\";\n } else { \n // convert xml ids into a php array \n $this->ids = array();\n $this->xml_result = $this->tamino->xml->getBranches(\"ino:response/xq:result\");\n if ($this->xml_result) {\n\t// Cycle through all of the branches \n\tforeach ($this->xml_result as $branch) {\n\t if ($att = $branch->getTagAttribute(\"id\", \"xq:attribute\")) {\n\t array_push($this->ids, $att);\n\t }\n\t} /* end foreach */\n } \n }\n\n }", "public function listId()\n {\n return $this->contractor->all()->pluck('id')->all();\n }", "public function ids() {\n\t\t$q = $this->query();\n\t\t$q->select(Salesperson::aliasproperty('id'));\n\t\treturn $q->find()->toArray();\n\t}", "public function getIds(): array\n {\n return $this->ids;\n }", "public function getIds()\n {\n return $this->article_ids;\n }", "public function getIds() {\n\t\treturn array_keys($this->registered);\n\t}", "public static function getAllIds(): array\n {\n return ArrayHelper::getColumn(static::find()->select('id')->asArray()->all(), 'id');\n }", "public function getListItemIds() : array\n {\n return $this->listItemIds;\n }", "function getIds( array $Objects );", "public function getItemIds();", "public function sigLeadershipsIds()\n {\n return $this->sigs()->where('main', 1)->lists('id')->toArray();\n }", "public function getIds(): array\n {\n return array_map(fn (Entity $entity) => $entity->getId(), $this->entities);\n }", "public function list_id()\n\t{\n\t\treturn $this->list;\n\t}", "public function getListID()\n\t{\n\t\treturn $this->get('ListID');\n\t}", "public function getAllIds()\n {\n if (is_null($this->_itemIds)) {\n $this->_itemIds = parent::getAllIds();\n }\n return $this->_itemIds;\n }", "public function getRoleIds() {\n\t \treturn array_map(\n \t\t\tfunction($role) {\n\t\t \t\treturn $role->getRoleid();\n\t\t \t},\n\t\t \t$this->getRoles()\n\t \t );\n\t }", "public function getIdentities()\n {\n return [\\Blackbird\\TicketBlaster\\Model\\Event::CACHE_TAG . '_' . 'list'];\n }", "public function getObjectIds();", "public function getItemIds()\n {\n $this->loadItems();\n $items = [];\n foreach ($this->items as $item) {\n $items[] = $item->getId();\n }\n return $items;\n }", "public function getListOfIdOfAllCategories()\n {\n $sqlQuery = \"SELECT `id` FROM `categories` \";\n $queryResult = $this->dataBase->query($sqlQuery);\n $listOfIDofAllCategories = [];\n\n while($tableRow = $queryResult->fetch()) {\n $listOfIDofAllCategories[] = $tableRow[\"id\"];\n }\n\n return $listOfIDofAllCategories;\n }", "public function getStudyIdsList() {\n return $this->_get(12);\n }", "function get_all_ids() {\n\t\t$cloudprofile_list = array();\n\t\t$query = \"select pr_id from \".$this->_db_table;\n\t\t$db=htvcenter_get_db_connection();\n\t\t$rs = $db->Execute($query);\n\t\tif (!$rs)\n\t\t\t$this->_event->log(\"get_all_ids\", $_SERVER['REQUEST_TIME'], 2, \"cloudprofile.class.php\", $db->ErrorMsg(), \"\", \"\", 0, 0, 0);\n\t\telse\n\t\twhile (!$rs->EOF) {\n\t\t\t$cloudprofile_list[] = $rs->fields;\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\treturn $cloudprofile_list;\n\n\t}", "public function getDefinedObjectIds() {}", "public function getDefinedObjectIds() {}", "public function getDefinedObjectIds() {}", "public function getStudyIdsList() {\n return $this->_get(3);\n }", "public function ids() {\n $ids = array_keys($this->models);\n\n # Reorder environments to put dev/test/live first\n $default_ids = array('dev', 'test', 'live');\n $multidev_ids = array_diff($ids, $default_ids);\n $ids = array_merge($default_ids, $multidev_ids);\n\n return $ids;\n }", "public abstract function get_lists();", "public function getItemIds(){\n\t return $this->getIds();\n\t}", "public function getIdArray()\n {\n $idArray = array();\n\n foreach ($this as $importedVideo) {\n $idArray[] = $importedVideo->id;\n }\n\n return $idArray;\n }", "private function selectParentListItemDefinitionIds() {\n\t\ttry {\n\t\t\t$sth = $this->context->connection->prepare(\n\t\t\t\t\"SELECT\tparent_list_item_definition_id\n\t\t\t\tFROM parent_list_item_definitions\n\t\t\t\tWHERE instance_id = :instId AND list_item_definition_id = :id\");\n\n\t\t\t$this->context->connection->bindInstance($sth);\n\t\t\t$sth->bindValue(\":id\", $this->id, \\PDO::PARAM_INT);\n\n\t\t\t$sth->execute();\n\n\t\t\t$res = array();\n\n\t\t\twhile ($rd = $sth->fetch(\\PDO::FETCH_ASSOC)) {\n\t\t\t\t$id = intval($rd[\"parent_list_item_definition_id\"]);\n\t\t\t\t$res[$id] = (object)array(\"id\" => $id);\n\t\t\t}\n\n\t\t\treturn $res;\n\n\t\t} catch(\\PDOException $e) {\n\t\t\tthrow new \\Scrivo\\ResourceException($e);\n\t\t}\n\t}", "public function getInstitutionIds()\n {\n return $this->institutions->lists('id')->toArray();\n }", "public function getTagIds()\n {\n return $this->tags->lists('id')->toArray();\n }", "public function getAllChildIds()\n\t{\n\t\t$ids = array($this->id);\n\t\tforeach ($this->children as $child) {\n\t\t\t$ids = array_merge($ids, $child->getAllChildIds());\n\t\t}\n\n\t\treturn $ids;\n\t}", "public function getAll()\n {\n return $this->_identifiers;\n }", "public function getIdentifiers();", "public function getAllIds()\n {\n if (is_null($this->_allProductIds)) {\n if (!$this->isShuffled()) {\n $this->_allProductIds = array_keys($this->getItemCollection());\n return $this->_allProductIds;\n }\n\n $targetRuleProductIds = $this->_getTargetRuleProductIds();\n $linkProductCollection = $this->_getPreparedTargetLinkCollection();\n $linkProductIds = array();\n foreach ($linkProductCollection as $item) {\n $linkProductIds[] = $item->getEntityId();\n }\n $this->_allProductIds = array_unique(array_merge($targetRuleProductIds, $linkProductIds));\n shuffle($this->_allProductIds);\n }\n\n return $this->_allProductIds;\n }", "public function scopeFetchIds()\n {\n return $this->pluck(\"id\");\n }", "function getEventIDs() {\n\t\t$return = array();\n\n\t\tif ( $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$return[] = $oObject->getID();\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public static function getList()\n {\n return \\yii\\helpers\\ArrayHelper::map(self::find()->all(), 'id', 'id_santri');\n }", "public function lists();", "public function getAllIds(){\n\n\t\t$qry=$this->db->select('id');\n\t\t$this->db->from('customers');\n\t\t$qry=$this->db->get();\n\t\t$count=$qry->num_rows();\n\t\t$result= $qry->result_array();\n\t\tfor($i=0;$i<$count;$i++){\n\t\t\t\t$values[$result[$i]['id']]=$result[$i]['id'];\n\t\t\t\t}\n\t\n\t\treturn $values;\n\t\n\t}", "public static function officeIds()\n {\n return collect([\n AdminOffice::all()->first()->office_id,\n Auth::user()->office_id,\n ])->unique();\n }", "private function selectChildListItemDefinitionIds() {\n\t\ttry {\n\t\t\t$sth = $this->context->connection->prepare(\n\t\t\t\t\"SELECT\tlist_item_definition_id\n\t\t\t\tFROM parent_list_item_definitions\n\t\t\t\tWHERE instance_id = :instId AND parent_list_item_definition_id = :id\");\n\n\t\t\t$this->context->connection->bindInstance($sth);\n\t\t\t$sth->bindValue(\":id\", $this->id, \\PDO::PARAM_INT);\n\n\t\t\t$sth->execute();\n\n\t\t\t$res = array();\n\n\t\t\twhile ($rd = $sth->fetch(\\PDO::FETCH_ASSOC)) {\n\t\t\t\t$id = intval($rd[\"list_item_definition_id\"]);\n\t\t\t\t$res[$id] = (object)array(\"id\" => $id);\n\t\t\t}\n\n\t\t\treturn $res;\n\n\t\t} catch(\\PDOException $e) {\n\t\t\tthrow new \\Scrivo\\ResourceException($e);\n\t\t}\n\t}", "function getObjectIDs() {\n\t\t$tmp = array();\n\t\tif ( $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$tmp[] = $oObject->getID();\n\t\t\t}\n\t\t}\n\t\treturn $tmp;\n\t}", "public function getAllIdentifiers() {}", "private function extractIds($models)\n {\n $ids = [];\n foreach($models as $model){\n $ids[] = $model->id;\n }\n return $ids;\n }", "public static function getIds($contents)\n { \n $return = [];\n foreach ($contents as $value) \n {\n $return[] = $value->id;\n }\n return $return;\n }", "public function getStoreIds();", "protected function IdUserListReproduction ()\n {\n $lista = Model_listas::find('all', array\n (\n 'where' => array\n (\n array('id_usuario'=>$this->userID()),\n array('titulo'=>'reproducidas')\n )\n ));\n if(!empty($lista))\n {\n $id=0;\n foreach ($lista as $key => $value)\n {\n $id = $lista[$key]->id;\n } \n return $id; \n }\n }", "public function getRelatedIds()\n {\n $related = $this->getRelated ();\n $fullKey = $related->getQualifiedKeyName ();\n return $this->getQuery ()->select ( $fullKey )->lists ( $related->getKeyName () );\n }", "public function ids( array $params = array() );", "public function getSpotsIds() {\n $query = \"SELECT \" . $this->prefix . \"id FROM ' . $this->prefix . 'spot WHERE spot_track_id=\" . $this->track_id . \" ORDER BY spot_last_update DESC LIMIT \" . $this->limit_spots;\n\n $result = db_query($query);\n\n $spot_ids = array();\n while($row = mysqli_fetch_array($result)){\n $spot_ids[] = $row['spot_id'];\n }\n\n return $spot_ids;\n }", "public function getRoleIds()\n {\n $array = [];\n\n foreach ($this->roles as $role) {\n $array[] = $role->id;\n }\n\n return $array;\n }", "public function getIdentities()\n {\n }", "public static function getAllSchoolIds(){\n $schoolIds = array();\n $result = mysql_query(\"SELECT id FROM school\") or die(mysql_error());\n while($row = mysql_fetch_array($result)){\n array_push($schoolIds, $row['id']);\n }\n return $schoolIds;\n }", "public function getIdParameters()\n {\n return $this->_list->getIdParameters();\n }", "public function get_ids()\n\t{\n\t\treturn $this->_cat_ids;\n\t}", "private function getGroupsIds() : array {\n\t\treturn array_map(static function($a) {\n\t\t\treturn $a->getId();\n\t\t}, $this->groups);\n\t}", "public static function getAllIds(): array\n {\n $dao = Dao::getInstance();\n\n $query = \"\n SELECT\n id\n FROM\n help\n ORDER BY id\n \";\n\n $stmt = $dao->prepare($query);\n\n $stmt->execute();\n\n $rows = [];\n while ($row = $stmt->fetch()) {\n $rows[] = $row['id'];\n }\n return $rows;\n }", "public function getIdentifiers()\n {\n return $this->init()->_identifiers;\n }", "static function get_ids_from_list ($list_video_ids){\r\n\r\n if(empty($list_video_ids)){\r\n return;\r\n }\r\n\r\n $buffy = array();\r\n\r\n //this is needed because we could have more space between each movie id\r\n $remove_spaces = trim(str_replace(array('&nbsp;', ' '),array(''), htmlentities($list_video_ids, ENT_QUOTES)));\r\n\r\n if(!empty($remove_spaces)) {\r\n\r\n $video_id_explode = explode(',', $remove_spaces);\r\n $video_id_explode_map = array_map('trim',$video_id_explode);//extra trim just in case\r\n\r\n //make an array of video id's'\r\n foreach($video_id_explode_map as $video_id) {\r\n $trim_video_id = trim($video_id);\r\n\r\n //check to prevent duplicates id's\r\n if (!in_array($trim_video_id, $buffy)) {\r\n $buffy[] = $trim_video_id;\r\n }\r\n }\r\n }\r\n\r\n return $buffy;\r\n }", "function wp_parse_id_list($input_list)\n {\n }", "public function getIds()\n {\n return $this->restrictedCountryIds;\n }", "public function lists1()\n {\n return $this->model->lists('name', 'id');\n }", "public function getSimilarIds()\n {\n return $this->similar_ids;\n }", "public function getMultipleWishlistId();", "private function getChildListItemDefinitionIds() {\n\t\tif ($this->childListItemDefinitionIds === null) {\n\t\t\t$this->childListItemDefinitionIds =\n\t\t\t\t$this->selectChildListItemDefinitionIds();\n\t\t}\n\t\treturn $this->childListItemDefinitionIds;\n\t}", "private function item_ids()\r\n {/*{{{*/\r\n\t\t$items = array();\r\n $ids = array(); \r\n\t\t$items = glob(ITEMDATA.'*.xml');\r\n foreach($items as $item)\r\n $ids[] = basename($item, '.xml');\r\n\t\tsort($ids);\r\n\t\treturn array_reverse($ids);\r\n\t}", "public function selectAllRoleIDs()\n {\n $result = $this->sdb->query(\"select id from role order by label asc\", array());\n $all = array();\n while($row = $this->sdb->fetchrow($result))\n {\n array_push($all, $row['id']);\n }\n return $all;\n }", "public function getPageIds()\n {\n $arr = array();\n foreach($this->elements as $displayElement){\n if($displayElement->getType() == 'element'){\n $page = $displayElement->getElement()->getPage();\n while($page != null) { \n $arr[] = $page->getId();\n $page = $page->getParent();\n }\n }\n if($displayElement->getType() == 'page'){\n $page = $displayElement->getPage();\n while($page != null) { \n $arr[] = $page->getId();\n $page = $page->getParent();\n }\n }\n }\n\n return array_unique($arr);\n }", "public function groupIds();" ]
[ "0.79293543", "0.77623045", "0.77308035", "0.77308035", "0.7726254", "0.73464864", "0.7294538", "0.72793114", "0.72324073", "0.72320527", "0.72209", "0.72209", "0.72209", "0.72209", "0.72209", "0.72209", "0.72209", "0.72209", "0.7157794", "0.7129071", "0.7128736", "0.70894444", "0.70894444", "0.70706606", "0.70532656", "0.7051266", "0.69970167", "0.69877005", "0.69761604", "0.6942311", "0.689492", "0.6886245", "0.6876562", "0.686724", "0.68267864", "0.6794665", "0.67904437", "0.67553765", "0.673147", "0.666593", "0.66310203", "0.66203123", "0.6592351", "0.65906817", "0.65825003", "0.6557261", "0.65424067", "0.65232646", "0.6506214", "0.64814126", "0.64610285", "0.6460134", "0.64595157", "0.64595157", "0.64541435", "0.6415078", "0.640974", "0.6403089", "0.6393174", "0.63913727", "0.63881594", "0.63778937", "0.63754845", "0.6362605", "0.63595396", "0.6355751", "0.6353567", "0.63519686", "0.6348842", "0.6339151", "0.63152", "0.6312726", "0.6309066", "0.6306546", "0.6294355", "0.6290711", "0.6286859", "0.62855786", "0.6271968", "0.6263776", "0.6244959", "0.6240864", "0.6229299", "0.62287575", "0.62170976", "0.62095135", "0.62067103", "0.6202957", "0.62025785", "0.6191239", "0.6175803", "0.61694956", "0.6161803", "0.6153314", "0.6150237", "0.6150035", "0.61471283", "0.6123802", "0.612197", "0.61167234", "0.61145836" ]
0.0
-1
Load a Todolist from it's id
public function load( $id, $archived = false ) { if ( ! $this->exists( $id, $archived ) ) { throw new \InvalidArgumentException( "List with id = $id, archived = $archived not found" ); } $lines = file( $this->fullpath( $id, $archived ) ); // Pull title $title = array_shift( $lines ); $title = trim( substr( $title, 1 ) ); // Pull subtitle if ( count( $lines ) && $lines[0][0] == '(' ) { $subtitle = trim( array_shift( $lines ) ); $subtitle = ltrim( $subtitle, '(' ); $subtitle = rtrim( $subtitle, ')' ); } // Setup the list $list = \App::make( 'GSD\Entities\ListInterface' ); $list->set( 'id', $id ); $list->set( 'title', $title ); if ( ! empty( $subtitle ) ) { $list->set( 'subtitle', $subtitle ); } $list->set( 'archived', $archived ); // And add the tasks foreach ( $lines as $line ) { $line = trim( $line ); if ( $line ) { $list->taskAdd( $line ); } } return $list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getToDoList($id) {\n try {\n $id = (int) $id;\n $row = $this->fetchRow('id = ' . $id);\n if ($row) {\n $toDoListRow = $row->toArray();\n $toDoListEntity = new Base_Model_ObtorLib_App_Core_Crm_Entity_ToDoList();\n $toDoListEntity->setId($toDoListRow['id']);\n $toDoListEntity->setListTitle($toDoListRow['list_title']);\n $toDoListEntity->setListDescription($toDoListRow['list_description']);\n $toDoListEntity->setAddedOn($toDoListRow['added_on']);\n $toDoListEntity->setAddedBy($toDoListRow['added_by']);\n $toDoListEntity->setAddedByUserObject($toDoListRow['added_user_type']);\n $toDoListEntity->setReminderOn($toDoListRow['reminder_on']);\n $toDoListEntity->setReminderDate($toDoListRow['reminder_date']);\n $toDoListEntity->setReminderTime($toDoListRow['reminder_time']); \n $toDoListEntity->setStatus($toDoListRow['current_status']);\n return $toDoListEntity;\n } else {\n return null;\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception($ex);\n }\n }", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function loadById($id);", "public function loadById($id);", "public function show($id)\n {\n return new ToDoListResource(ToDoList::with('toDoItems')->where('id', $id)->first());\n }", "public static function load(int $id);", "public function load($id){\n\t\t$sql = 'SELECT * FROM tbl_task WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "public static function loadById(?int $id);", "public function get($id) {\n $user = \\Auth::user();\n $task = Task::find($id);\n $list = Todolist::find($task->list_id);\n\n if ($task != null) {\n if ($user->id != $list->user_id) {\n return response('Unauthorized', 401);\n }\n\n return response()->json([\n 'id' => $task->id,\n 'list_id'=> $task->list_id,\n 'description' => $task->description,\n 'position' => $task->position,\n 'state' => $task->state,\n 'comment' => $task->comment,\n 'color' => $task->color,\n 'created_at' => $task->created_at,\n 'updated_at' => $task->updated_at\n ]);\n } else {\n return response('Not found', 404);\n }\n }", "function get_by_id($id)\n {\n $this->db->select('*');\n $this->db->from('todolist');\n $this->db->where('id_todolist', $id);\n $data = $this->db->get();\n return $data;\n }", "public function loadFromContentID( $id=null );", "function getTodo($id)\n {\n $todo = $this->todoRepository->getTodo($id);\n if(!$todo) {\n throw new RecordNotFoundException(\"Todo not found for id \" . $id);\n }\n\n return $todo;\n }", "public function show ($id)\n {\n return ToDo::find($id);\n }", "public function show($id)\n\t{\n\t\t$list = TodoList::findOrFail($id);\n\t\t$items = $list->listItems()->where('todo_list_checked',0)->get();\n\t\t$citems = $list->listItems()->where('todo_list_checked',1)->get();\n\t\tsession(['listID'=>$id]);\n\n\t\treturn view('todos.show',compact('list','items','citems'))->with('status');\t\n\t}", "public function load($id)\n {\n return;\n }", "public function load($id)\n\t\t{\n\n\t\t\t$this->id = $id;\n\n\t\t}", "public function show($id)\n {\n return new TodoResource(\n Todo::query()->findOrFail($id)\n );\n }", "public function getToDoList($id) {\n try {\n $objToDoList = new Base_Model_ObtorLib_App_Core_Crm_Dao_ToDoList();\n $toDoList = $objToDoList->getToDoList($id);\n return $toDoList;\n } catch (Exception $e) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception($e);\n }\n }", "public function actionTodoItems($id=NULL)\n\t{\n\t\tif(!$this->isLogin()){\n\t\t\t$this->redirect('index');\n\t\t\texit;\n\t\t}\n\t\t$sessionArray['mylist']=0;\n\t\t$sessionArray['mytodoStatus']=0;\n\t\tif(isset($_POST['mylist']) && $_POST['mylist']!=0)\n\t\t{\t\t\t\n\t\t\t$sessionArray['mylist']=$_POST['mylist'];\n\t\t}\n\t\tif(isset($_POST['mytodoStatus']) && $_POST['mytodoStatus']!=0)\n\t\t{\t\t\t\n\t\t\t$sessionArray['mytodoStatus']=$_POST['mytodoStatus'];\n\t\t}\n\t\t$sessionArray['loginId']=Yii::app()->session['loginId'];\n\t\n\t\t$todoItemsObj\t=\tnew TodoItems();\n\t\t$items\t=\t$todoItemsObj->getMyTodoItemsByList($sessionArray, $id);\n\t\t\t\n\t\t$this->render('myItems', array('data'=>$items));\n\t}", "public function loadDataFromId(){\r\n\t\t\t$this -> loadFromId();\r\n\t }", "public function edit($id)\n {\n $list = TodoList::findOrFail($id);\n return view('todos.edit')->withList($list);\n }", "function list_get($id) {\n\n //$id = $this->get('id');\n\n if (!$id) {\n\n $this->response(\"No item ID specified!\", 400);\n\n exit;\n }\n\n $list = $this->List_model->getListById($id);\n\n if ($list) {\n\n //$list = $this->appendItems($list);\n //Put owner's name instead of user ID\n //$list['owner'] = $this->User_model->getName($list['owner'])['name'];\n unset($list['owner']);\n\n $this->response($list, 200);\n\n exit;\n } else {\n\n $this->response(\"Invalid ID\", 404);\n\n exit;\n }\n }", "public function edit($id)\n\t{\n\t\t//\n\t\t$list = TodoList::findOrFail($id);\n\t\treturn view('todos.edit',compact('list'));\n\t}", "public function getTask($id);", "public function loadItem($id){\n\t\tif($id){\n\n\t\t\t//$this->firephp->info($id);\n\t\t\t\n\t\t\t//get some db credentials\n\t\t\t$session = new Session();\n\t\t\t\n\t\t\tif(!$session->get('dbcreds')){\n\t\t\t\t$dbcreds = xmlToArray::getArray(CONFIG.'/'.Constants::config,'config-root','config','database');\n\t\t\t\t//$session->set('dbcreds',$dbcreds);\n\t\t\t} else {\n\t\t\t\t$dbcreds = $session->get('dbcreds');\n\t\t\t}\n\t\t\t\n\t\t\t//load from db\n\t\t\t$mode = QueryBuilder::QUERYSELECT;\n\t\t\t$query = new QueryBuilder($mode);\n\t\t\t$query->setTable($this->table);\t\n\t\t\t$query->setKey($id);\n\t\t\t$query->setKeyName($this->keyName);\t\n\t\t\t$query_str = $query->parse();\n\t\t\t//$this->firephp->info($query_str);\n\n\t\t\t$this->wrapper = DBConn::getInstance();\n\t\t\t$this->wrapper->query($query_str);\n\n\t\t\t\n\t\t\tif($this->wrapper->getNumrows() == 0) {\n\t\t\t\tLogger::logError('WARNING - ' . $this->wrapper->getError() . \" (QUERY:$query_str)\");\n\t\t\t\tthrow new yafException($this->wrapper->getError(),yafException::WARNING);\n\t\t\t}\n\t\t\n\t\t\t$this->attributes = $this->wrapper->fetch_assoc_row();\t\t\t\n\n\t\t}\n\t\t\n\t\t\n\t}", "public function show($id)\n {\n return task::where('todo_id', '=', $id)->latest()->get();\n\n }", "public static function fetch(\\Scrivo\\Context $context, $id) {\n\t\t\\Scrivo\\ArgumentCheck::assertArgs(func_get_args(), array(\n\t\t\tnull,\n\t\t\tarray(\\Scrivo\\ArgumentCheck::TYPE_INTEGER)\n\t\t));\n\t\ttry {\n\t\t\t// Try to retieve the list item definition from the cache ...\n\t\t\tif (isset($context->cache[$id])) {\n\t\t\t\t// ... get it from the cache and set the context.\n\t\t\t\t$listItemDefinition = $context->cache[$id];\n\t\t\t\t$listItemDefinition->context = $context;\n\t\t\t} else {\n\t\t\t\t// ... else retrieve it and set it in the cache.\n\t\t\t\t$sth = $context->connection->prepare(\n\t\t\t\t\t\"SELECT list_item_definition_id, sequence_no, application_definition_id,\n\t\t\t\t\tpage_definition_id, title, icon, php_key, title_width,\n\t\t\t\t\ttitle_label\n\t\t\t\t\tFROM list_item_definition\n\t\t\t\t\tWHERE instance_id = :instId AND list_item_definition_id = :id\");\n\n\t\t\t\t$context->connection->bindInstance($sth);\n\t\t\t\t$sth->bindValue(\":id\", $id, \\PDO::PARAM_INT);\n\n\t\t\t\t$sth->execute();\n\n\t\t\t\tif ($sth->rowCount() != 1) {\n\t\t\t\t\tthrow new \\Scrivo\\SystemException(\n\t\t\t\t\t\t\"Failed to load list item definition\");\n\t\t\t\t}\n\n\t\t\t\t$listItemDefinition = new \\Scrivo\\ListItemDefinition($context);\n\t\t\t\t$listItemDefinition->setFields(\n\t\t\t\t\t$context, $sth->fetch(\\PDO::FETCH_ASSOC));\n\n\t\t\t\t$context->cache[$id] = $listItemDefinition;\n\t\t\t}\n\n\t\t\treturn $listItemDefinition;\n\n\t\t} catch(\\PDOException $e) {\n\t\t\tthrow new \\Scrivo\\ResourceException($e);\n\t\t}\n\t}", "public function load($id){\n\t\t$sql = 'SELECT * FROM recibo WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "public function update($id)\n {\n if ($id != Input::get('name'))\n {\n return Response::json(array('error' => 'List id/name mismatch'));\n }\n\n // Build new list with values\n $list = App::make('GSD\\Entities\\ListInterface');\n $list->set('id', $id);\n $list->set('title', Input::get('title'));\n $list->set('subtitle', Input::get('subtitle'));\n $list->set('archived', str2bool(Input::get('archived')));\n\n // Add tasks to list from values passed\n $tasks = Input::get('tasks');\n if ( ! is_array($tasks)) $tasks = array();\n foreach ($tasks as $task)\n {\n $newTask = App::make('GSD\\Entities\\TaskInterface');\n $descript = $task['descript'];\n if ($task['dateDue'])\n {\n $d = Carbon::createFromTimestamp($task['dateDue'] / 1000);\n $descript .= ' :due:' . $d->format('Y-m-d');\n }\n $newTask->setDescription($descript);\n if (str2bool($task['isCompleted']))\n {\n $newTask->setIsComplete(\n true,\n Carbon::createFromTimestamp($task['dateCompleted'] / 1000)\n );\n }\n if (str2bool($task['isNext']))\n {\n $newTask->setIsNextAction(true);\n }\n $list->taskAdd($newTask);\n }\n\n // Save and return success\n $list->save();\n return Response::json(array('success' => true));\n }", "public function show($id)\n {\n $list = TodoList::findOrFail($id);\n $items = $list->listItems()->get();\n return view('todos.show')\n ->withList($list)\n ->withItems($items);\n }", "public static function fetchTodo($id) {\n $builder = new QueryBuilder();\n $builder\n ->from(['t' => '\\Todo'])\n ->columns([\n 'title' => 't.title',\n 'description' => 't.description'\n ]);\n $builder\n ->where('t.todo_id = :todoId:', ['todoId' => $id])\n ->orderBy('t.created_at DESC');\n\n $todo = $builder->getQuery()->execute()->toArray();\n\n return $todo;\n }", "function load($id) {\n\t\t$db = & JFactory::getDBO();\n\n\t\t$this->id = intval($id);\n\t\t$query = 'SELECT * FROM `#__xmap_sitemap` where id='.$this->id;\n\t\t$db->setQuery( $query );\n\t\tif( !$res = $db->loadAssocList( )) {\n\t\t\treturn false;\t// defaults are still set, though\n\t\t}\n\t\t$this->bind($res[0]);\n\t\t$this->_items = NULL;\n\t\treturn true;\n\t}", "public static function fromInput(int $id = null)\n {\n $successMsg = 'Task added';\n\n if (!$id) {\n $todo = R::dispense('todo');\n $todo->done = 0;\n $todo->updated = 0;\n } else {\n $todo = R::load('todo', $id);\n\n if (!$todo) {\n throw new NotFoundHttpException();\n }\n\n $successMsg = 'Task updated';\n }\n\n $data = [\n 'author' => input('author'),\n 'email' => input('email'),\n 'title' => input('title'),\n ];\n\n $data = array_map('trim', $data);\n $data = array_map('strip_tags', $data);\n\n //validation\n $errors = [];\n if (!strlen($data['author'])) {\n $errors['author'] = 'Author\\'s name is required';\n }\n if (!strlen($data['email'])) {\n $errors['email'] = 'Email is required';\n }\n if (!strlen($data['title'])) {\n $errors['title'] = 'Task description is required';\n }\n if (strlen ($data['email']) && filter_var($data['email'], FILTER_VALIDATE_EMAIL) === false) {\n $errors['email'] = 'Email must be correct email address';\n }\n\n if (!count($errors)) {\n if (IS_ADMIN) {\n if (input('done', false)) {\n $todo->done = 1;\n }\n\n if ($todo->title != $data['title'] && $id) {\n $todo->updated = 1;\n }\n }\n\n foreach ($data as $key => $value) {\n $todo->$key = $value;\n }\n\n R::store($todo);\n $_SESSION['flash'] = ['success' => $successMsg];\n\n return true;\n }\n\n $_SESSION['flash']['error'] = $errors;\n $_SESSION['formData'] = $data;\n\n return false;\n }", "public function edit($id)\n {\n $tasklist = Tasklist::find($id);\n\n return view('tasklists.edit', [\n 'tasklist' => $tasklist,\n ]);\n }", "public function load($id, $options = array());", "public function load($id){\n\t\t$sql = 'SELECT * FROM ano_letivo WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "public function loadByID(int $id) {\n return $this->load($id);\n }", "public function show($id)\n {\n $data = ListTodo::findOrFail($id);\n return response()->json($data);\n }", "public function show($id){\n //check if the user is logged in, else redirect to login\n if(!Auth::check()){\n return view('/auth/login')->with('message',' Please first log in.');\n }else{\n //user is logged in\n\n //get list and it's info\n $list = DB::table($this->table)->where('id',$id)->first();\n //get the TODOS connected with this list\n $todos = DB::table('todos')->where('list_id',$id)->orderBy('created_at','ASC')->get();\n //render view\n return view('list/show', compact('list','todos'));\n }\n\n }", "public static function load( $tid ) {\n\t\t$db = JFactory::getDbo();\n\t\t$query = \"SELECT * FROM `#__obhelpdesk3_tickets` WHERE `id` = \" . $tid;\n\t\t$db->setQuery( $query );\n\n\t\treturn $db->loadObject();\n\t}", "public function load($id)\n {\n $id = $this->db->real_escape_string($id);\n if (!$result = $this->db->query(\"SELECT * FROM `short_list` WHERE `id` = '$id';\")) {\n throw new mysqli_sql_exception(\"Oops! Something has gone wrong on our end. Error Code: shortListLoad\");\n }\n $result = $result->fetch_assoc();\n $this->id = $id;\n $this->owner_id = $result['owner_id'];\n $this->name = $result['name'];\n $this->description = $result['description'];\n $this->hasInvited = $result['hasInvited'];\n $candString = $result['candidates'];\n $this->candidates = explode(\",\", $candString);\n return $this;\n }", "public function edit($id)\n {\n $list=ListModel::findOrFail($id);\n return view('lists.create',['list'=>$list]);\n }", "public function getUserTodoByIdAction()\n {\n /** @var Object_Todo $todo */\n $data = $this->getRequestData();\n if (isset($data['todo_id'])) {\n $todo = Object_Todo::getById($data['todo_id']);\n if (!$todo) {\n $this->setErrorResponse('no Todo with this todo_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $todo->getCreator()->getId()) {\n $this->setErrorResponse('no Todo for this user with current todo_id!');\n }\n } else {\n $this->setErrorResponse('todo_id is mandatory field for this request!');\n }\n $this->_helper->json($todo);\n }", "public function load($id){\n\t\t$sql = 'SELECT * FROM turma_disciplina WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "public function show($id)\n {\n $user = \\Auth::user();\n $todo = Todo::where('id', $id)->where('user_id', $user->id)->first();\n\n return new TodoResource($todo);\n }", "public function ajaxGetDetail($todoID)\n {\n $this->view->actions = $this->loadModel('action')->getList('todo', $todoID);\n $this->display();\n }", "public function edit($id)\n {\n $tasklist = Tasklist::find($id);\n $user = \\Auth::user();\n if ($user -> id ==$tasklist->user_id){\n\n return view('tasklists.edit', [\n 'tasklist' => $tasklist,\n ]);\n }else{\n return redirect('/');\n }\n }", "public function edit($id)\n {\n if(Module::hasAccess(\"Tasks\", \"edit\")) {\n\n $task = Task::find($id);\n if(isset($task->id)) {\n $module = Module::get('Tasks');\n\n $module->row = $task;\n\n $work_list = DB::table('worklists')\n ->lists('name', 'work_id');\n $user_list = DB::table('userinfos')\n ->lists('user_key', 'user_key');\n\n return view('la.tasks.edit', [\n 'module' => $module,\n 'view_col' => $this->view_col,\n 'work_list' => $work_list,\n 'user_list' => $user_list,\n 'status_list' => Task::$statusText,\n ])->with('task', $task);\n } else {\n return view('errors.404', [\n 'record_id' => $id,\n 'record_name' => ucfirst(\"task\"),\n ]);\n }\n } else {\n return redirect(config('laraadmin.adminRoute').\"/\");\n }\n }", "public function editList($id)\n\t{\n\t\t$edit = \"list\";\n\t\t$list = DB::table('lists')->where('id', $id)\n\t\t->get();\n\n\t\treturn view('edit', compact(\"list\", \"edit\"));\n\t}", "public function edit($id) {\r\n $model = TodoItemModel::findById($id);\r\n require $this->views_folder . 'edit.php';\r\n }", "public function show($id)\n {\n $tasklist = Tasklist::find($id);\n $user = \\Auth::user(); \n if($user->id == $tasklist->user_id){\n return view('tasklists.show',[\n 'tasklist'=> $tasklist,\n ]);\n }else{\n return redirect('/');\n }\n \n }", "public function getTask($id)\r\n\t{\r\n\t\t$sql = sprintf('\r\n\t\t\tSELECT \r\n\t\t\t\tid, title\r\n\t\t\tFROM\r\n\t\t\t\ttask\r\n\t\t\tWHERE\r\n\t\t\t\tid = %d\r\n\t\t', $id);\r\n\r\n\t\t$result = mysqli_query($this->db, $sql);\r\n\t\t\r\n\t\t$row = $result->fetch_object();\r\n\r\n\t\t$result->close();\r\n\r\n\t\t$task = new Task();\r\n\t\t$task->id = $row->id;\r\n\t\t$task->title = $row->title;\r\n\r\n\t\treturn $task;\r\n\t}", "public function show($id){\n$lists = \\App\\Task::where('id',$id)->first();\nreturn view('single-task',compact('lists'));\n \n}", "public function load()\n\t{\n\t\t$this->list_table->load();\n\t}", "public function load($id = null){\n\t\n\t\tif(!isset($id)){\n\t\t\t$id = $this->__get('id');\n\t\t}\n\t\t$class = strtolower(substr_replace(get_class($this) ,\"\",-5));\n\t\t$data = $this->getById($id);\n\t\t\n\t\t$class = ucfirst($class.'Model');\n\t\tif(count($data) > 0){\n\t\t\t$object = new $class;\n\t\t\tforeach ($data as $key => $v){\n\t\t\t\t$object->__set($key,$v);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $object;\n\t\t\n\t}", "public function load($id){\n\t\t$sql = 'SELECT * FROM tbl_journal_lines WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "public function load($id){\n\t\t$sql = 'SELECT * FROM telefonos WHERE id_telefono = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "public function edit(ListTodo $listTodo)\n {\n //\n }", "public function getTodo_id()\n {\n return $this->todo_id;\n }", "public function edit($id)\n {\n \treturn view('booklists.edit', [\n \t\t'booklist' => Booklist::findorFail($id)\n \t]);\n }", "public function actionlistDescription($id=NULL)\n\t{\n\t\tif(!$this->isLogin()){\n\t\t\t$this->redirect('index');\n\t\t\texit;\n\t\t}\n\t\t$todoListObj\t=\tnew TodoLists();\n\t\t$inviteObj\t=\tnew Invites();\n\t\t$item\t=\t$todoListObj->getListDetails($id);\n\t\t$listMembers\t=\t$inviteObj->getListMembers($id);\n\t\t\n\t\t$this->renderPartial('listdescription', array('data'=>$item,'listMembers'=>$listMembers['users'],'pagination'=>$listMembers['pagination']));\n\t}", "public function loadId($id){\n\t\t$model=new Model();\n\t\t$resultado=$model->select(\"SELECT * FROM tb_usuarios WHERE idusuario = :ID\",array(\":ID\"=>$id));\n\t\tif (count($resultado)>0) {\n\t\t\t$this->setData($resultado[0]);\n\t\t}\n\t}", "public function load($id){\r\n\t\t$sql = 'SELECT * FROM tbl_empleado WHERE id_empleado = ?';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t$sqlQuery->setNumber($id);\r\n\t\treturn $this->getRow($sqlQuery);\r\n\t}", "public function load($id = null){\n\t\n\t\tif(is_null($id)){\n\t\t\t$id = $this->__get('id');\n\t\t}\n\t\t\n\t\t$data = $this->getById($id);\n\n\t\tif($data){\n\t\t\tif(count($data) > 0){\n\t\t\t\tforeach ($data as $k => $v){\n\t\t\t\t\t$this->__set($k, $v);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}\n\t\treturn null;\n\t}", "function get( $id )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n if ( $id != \"\" )\r\n {\r\n $db->array_query( $priority_array, \"SELECT * FROM eZTodo_Priority WHERE ID='$id'\" );\r\n if ( count( $priority_array ) > 1 )\r\n {\r\n die( \"Error: Priority's with the same ID was found in the database. This shouldent happen.\" );\r\n }\r\n else if ( count( $priority_array ) == 1 )\r\n {\r\n $this->ID = $priority_array[0][$db->fieldName( \"ID\" )];\r\n $this->Name = $priority_array[0][$db->fieldName( \"Name\" )];\r\n\r\n $ret = true;\r\n }\r\n }\r\n return $ret;\r\n }", "public function edit($id,$list_id)\n {\n if (Gate::allows('isadmin')){\n $menu = Menu::find($id);\n $status = $menu->listts->where('id',$list_id)->all();\n $menu = Menu::find($id)->name;\n if (count($status)>0){\n $list = Listt::find($list_id);\n return view('dashboard.editlist',compact('list','menu'));\n }\n }\n abort(404);\n }", "public function show($id)\n {\n try{\n $todo = Todo::findOrFail($id);\n }catch(ModelNotFoundException $e){\n return response()->json(\"['resource_not_available']\", 400);\n }\n return $todo;\n }", "public function load($id){\r\n\t\t$sql = 'SELECT * FROM contenidos WHERE id = ?';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t$sqlQuery->setNumber($id);\r\n \r\n\t\treturn $this->getRow($sqlQuery);\r\n\t}", "public function loadListItemsByListId() {\n $sql = \"SELECT ListText, ListItemID, ListItemColor, ListItemDone\"\n FROM list_items\n WHERE ListID=(\n SELECT ListID\n FROM lists\n WHERE ListURL=:list\n )\n ORDER BY ListItemPosition\";\n if($stmt = $this->_db->prepare($sql)) {\n $stmt->bindParam(':list', $_GET['list'], PDO::PARAM_STR);\n $stmt->execute();\n $order = 1;\n while($row = $stmt->fetch()) {\n echo $this->formatListItems($row, $order);\n $order;\n }\n $stmt->closeCursor();\n }\n else {\n echo \"<li> Something went wrong. \", $db->error, \"</li>\";\n }", "public function get($id)\n {\n return $this->task->find($id);\n }", "function load() {\n\t\tglobal $mysql;\n //if(!$this->exists()) return;\n \t$id \t\t= $mysql->escape($this->id);\n \t$tablename \t= $this->class_name();\n \t$this->data = $mysql->executeSql(\"SELECT * FROM \".$tablename.\" WHERE id=$id;\");\n \t$this->id\t= $this->data['id'];\n \tunset($this->data['id']);\n }", "public function load($id){\n\t\t$sql = 'SELECT * FROM aluno WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "public function load($id){\n\t\t$sql = 'SELECT * FROM cbt_nomor_peserta WHERE id_nomor = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->set($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}" ]
[ "0.6895317", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.67841667", "0.6718754", "0.6718754", "0.6539762", "0.65244526", "0.6512325", "0.64438206", "0.64126647", "0.6404625", "0.6364665", "0.6364116", "0.63578516", "0.62301433", "0.61452806", "0.60632455", "0.6025216", "0.6012583", "0.5988966", "0.5960274", "0.5933118", "0.5895201", "0.58913606", "0.58411175", "0.58373713", "0.5833605", "0.58250606", "0.5821245", "0.5815663", "0.5795876", "0.5783641", "0.57755303", "0.57744765", "0.5766257", "0.57660115", "0.5753777", "0.57503927", "0.57414556", "0.5736197", "0.5735161", "0.572114", "0.56852514", "0.56838", "0.56768167", "0.5673302", "0.56665474", "0.5652061", "0.564592", "0.56431544", "0.5638427", "0.563628", "0.56343484", "0.56220746", "0.56078464", "0.5604269", "0.55740196", "0.5568039", "0.5567346", "0.5560953", "0.555928", "0.5555604", "0.5555411", "0.5552627", "0.55388916", "0.55331486", "0.5531242", "0.5524226", "0.5524188", "0.5523853", "0.55198354", "0.55149114", "0.5511267", "0.55048174" ]
0.66211396
31
Return the path to the list file
protected function fullpath( $id, $archived ) { $path = $this->path; if ( $archived ) { $path .= 'archived/'; } $path .= $id . $this->extension; return $path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getWordListPath(): string\n {\n return __DIR__ . \"/../data/{$this->locale}.txt\";\n }", "public function getLocalExtListFile() {}", "public function getWordListFile()\n {\n return $this->wordListFile;\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/trickstr.php',\n 'sources_custom/programe/.htaccess',\n 'sources_custom/programe/aiml/.htaccess',\n 'sources_custom/programe/aiml/index.html',\n 'sources_custom/programe/index.html',\n 'sources_custom/hooks/modules/chat_bots/knowledge.txt',\n 'sources_custom/hooks/modules/chat_bots/trickstr.php',\n 'sources_custom/programe/aiml/readme.txt',\n 'sources_custom/programe/aiml/startup.xml',\n 'sources_custom/programe/aiml/std-65percent.aiml',\n 'sources_custom/programe/aiml/std-pickup.aiml',\n 'sources_custom/programe/botloaderfuncs.php',\n 'sources_custom/programe/customtags.php',\n 'sources_custom/programe/db.sql',\n 'sources_custom/programe/graphnew.php',\n 'sources_custom/programe/respond.php',\n 'sources_custom/programe/util.php',\n );\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/jestr.php',\n 'sources_custom/forum/cns.php',\n 'lang_custom/EN/jestr.ini',\n 'themes/default/templates_custom/EMOTICON_IMG_CODE_THEMED.tpl',\n 'forum/pages/modules_custom/topicview.php',\n 'sources_custom/hooks/systems/config/jestr_avatar_switch_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_emoticon_magnet_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_leet_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_name_changes.php',\n 'sources_custom/hooks/systems/config/jestr_name_changes_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_piglatin_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_string_changes.php',\n 'sources_custom/hooks/systems/config/jestr_string_changes_shown_for.php',\n );\n }", "abstract protected function getListStorePath(): string;", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/idolisr.php',\n 'sources_custom/hooks/modules/members/idolisr.php',\n 'sources_custom/miniblocks/main_stars.php',\n 'sources_custom/miniblocks/side_recent_points.php',\n 'themes/default/templates_custom/POINTS_GIVE.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_STARS.tpl',\n 'themes/default/templates_custom/BLOCK_SIDE_RECENT_POINTS.tpl',\n );\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/wiki_sync.php',\n '_tests/tests/unit_tests/wiki_sync.php',\n 'lang_custom/EN/wiki_sync.ini',\n 'sources_custom/wiki_sync.php',\n 'sources_custom/hooks/systems/config/wiki_alt_changes_link_stub.php',\n 'sources_custom/hooks/systems/config/wiki_enable_git_sync.php',\n 'sources_custom/hooks/systems/config/wiki_enable_wysiwyg.php',\n 'sources_custom/hooks/systems/config/wiki_sync_media_directory.php',\n 'sources_custom/hooks/systems/config/wiki_sync_page_directory.php',\n 'sources_custom/hooks/systems/cron/wiki_sync_git.php',\n 'sources_custom/hooks/systems/notifications/wiki_failed_git_pull.php',\n 'sources_custom/wiki.php',\n 'site/pages/modules_custom/wiki.php',\n 'cms/pages/modules_custom/cms_wiki.php',\n );\n }", "public function getLocalMirrorListFile() {}", "public function getRemoteExtListFile() {}", "protected function getListPath()\n\t{\n\t\treturn '/patients';\n\t}", "public function getFilepath();", "public function getPathList() {\n \n $path_list = '';\n foreach($this->_path as $path) {\n $path_list .= '<li>' . $path . '</li>'; \n }\n\n return $path_list;\n }", "function fileList(){\n\t\tchdir('./../cloud/books/'); //Move to template directory\n\t\t\n\t\tif ($handle = opendir(getcwd())) { //Open dir\n\t\t echo '<ul class=\"list-group\">';\n\t\t while (false !== ($entry = readdir($handle))) { //While directory not end - return files list\n\t\t \tif ($entry != \".\" && $entry != \".DS_Store\" && $entry != \"..\") { //Filter trash\n\t\t \t\tif(is_dir($entry)){ //IF dir then return button with folder icon \n\t\t \t\t\techo '<a href=\"#\" class=\"list-group-item cat\"><i class=\"fa fa-folder-o\" aria-hidden=\"true\"></i> '.$entry.'</a>';\n\t\t \t\t}else{ //else return file button\n\t\t \t\t\t$FileInfo = new SplFileInfo($entry); //Get file info\n\t\t \t\t\t$ext = $FileInfo->getExtension(); //Get file extension\n\t\t \t\t\tif($ext == \"png\" or $ext == \"jpg\" or $ext == \"bmp\") //IF file is image then return button with image icon\n\t\t \t\t\t\techo '<a href=\"/files/cloud/books/'.$entry.'\" class=\"list-group-item file\"><i class=\"fa fa-file-image-o\" aria-hidden=\"true\"></i> '.$entry.'</a>';\n\t\t \t\t\telse //Else return button with file-code icon\n\t\t \t\t\t\techo '<a href=\"/files/cloud/books/'.$entry.'\" class=\"list-group-item file\"><i class=\"fa fa-file-o\" aria-hidden=\"true\"></i> '.$entry.'</a>';\n\t\t \t\t}\n\t\t \t}\n\t\t }\n\t\t echo '</ul>';\n\t\t closedir($handle); //Close dir\n\t\t}\n\t}", "public function getRemoteMirrorListFile() {}", "protected function getWordListFromDisk(): string\n {\n return file_get_contents($this->getWordListPath());\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/google_search.php',\n 'lang_custom/EN/google_search.ini',\n 'sources_custom/blocks/side_google_search.php',\n 'sources_custom/blocks/main_google_results.php',\n 'themes/default/templates_custom/BLOCK_SIDE_GOOGLE_SEARCH.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_GOOGLE_SEARCH_RESULTS.tpl',\n 'themes/default/css_custom/google_search.css',\n 'pages/comcode_custom/EN/_google_search.txt',\n );\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/purrrr.php',\n 'data_custom/images/lolcats/index.html',\n 'data_custom/images/lolcats/thumbs/index.html',\n 'data_custom/images/lolcats/funny-pictures-basement-cat-has-pink-sheets.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-ai-calld-jenny-craig.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-asks-you-for-a-favor.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-asks-you-to-pay-fine.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-can-poop-rainbows.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-comes-to-save-day.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-decides-what-to-do.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-does-math.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-does-not-see-your-point.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-eyes-steak.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-has-a-beatle.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-has-a-close-encounter.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-has-had-fun.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-has-trophy-wife.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-hates-your-tablecloth.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-a-doctor.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-a-hoarder.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-a-people-lady.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-on-steroids.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-stuck-in-drawer.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-is-very-comfortable.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-kermit-was-about.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-looks-like-a-vase.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-looks-like-boots.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-ok-captain-obvious.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-pounces-on-deer.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-sits-in-box.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-sits-on-your-laptop.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-special-delivery.jpg',\n 'data_custom/images/lolcats/funny-pictures-cat-winks-at-you.jpg',\n 'data_custom/images/lolcats/funny-pictures-cats-are-in-a-musical.jpg',\n 'data_custom/images/lolcats/funny-pictures-cats-have-war.jpg',\n 'data_custom/images/lolcats/funny-pictures-fish-and-cat-judge-your-outfit.jpg',\n 'data_custom/images/lolcats/funny-pictures-kitten-drops-a-nickel-under-couch.jpg',\n 'data_custom/images/lolcats/funny-pictures-kitten-ends-meeting2.jpg',\n 'data_custom/images/lolcats/funny-pictures-kitten-fixes-puppy.jpg',\n 'data_custom/images/lolcats/funny-pictures-kitten-tries-to-stay-neutral.jpg',\n 'data_custom/images/lolcats/funny-pictures-kittens-dispose-of-boyfriend.jpg',\n 'data_custom/images/lolcats/funny-pictures-kittens-yell-at-eachother.jpg',\n 'data_custom/images/lolcats/ridiculous_poses_moddles.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-basement-cat-has-pink-sheets.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-ai-calld-jenny-craig.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-asks-you-for-a-favor.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-asks-you-to-pay-fine.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-can-poop-rainbows.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-comes-to-save-day.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-decides-what-to-do.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-does-math.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-does-not-see-your-point.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-eyes-steak.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-has-a-beatle.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-has-a-close-encounter.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-has-had-fun.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-has-trophy-wife.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-hates-your-tablecloth.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-a-doctor.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-a-hoarder.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-a-people-lady.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-on-steroids.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-stuck-in-drawer.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-is-very-comfortable.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-kermit-was-about.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-looks-like-a-vase.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-looks-like-boots.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-ok-captain-obvious.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-pounces-on-deer.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-sits-in-box.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-sits-on-your-laptop.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-special-delivery.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cat-winks-at-you.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cats-are-in-a-musical.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-cats-have-war.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-fish-and-cat-judge-your-outfit.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kitten-drops-a-nickel-under-couch.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kitten-ends-meeting2.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kitten-fixes-puppy.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kitten-tries-to-stay-neutral.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kittens-dispose-of-boyfriend.jpg',\n 'data_custom/images/lolcats/thumbs/funny-pictures-kittens-yell-at-eachother.jpg',\n 'data_custom/images/lolcats/thumbs/ridiculous_poses_moddles.jpg',\n );\n }", "protected function filename()\n {\n return 'account_list_' . date('Y_m_d_H_i_s');\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/mediaelement.php',\n 'data_custom/mediaelement/flashmediaelement.swf',\n 'data_custom/mediaelement/silverlightmediaelement.xap',\n 'themes/default/css_custom/mediaelementplayer.css',\n 'themes/default/images_custom/mediaelement/background.png',\n 'themes/default/images_custom/mediaelement/bigplay.png',\n 'themes/default/images_custom/mediaelement/bigplay_svg.svg',\n 'themes/default/images_custom/mediaelement/controls.png',\n 'themes/default/images_custom/mediaelement/controls_svg.svg',\n 'themes/default/images_custom/mediaelement/jumpforward.png',\n 'themes/default/images_custom/mediaelement/loading.gif',\n 'themes/default/images_custom/mediaelement/skipback.png',\n 'themes/default/javascript_custom/mediaelement-and-player.js',\n 'themes/default/templates_custom/MEDIA_AUDIO_WEBSAFE.tpl',\n 'themes/default/templates_custom/MEDIA_VIDEO_WEBSAFE.tpl',\n );\n }", "function dir_list($path=\"\")\n\t{\n\t\t$s=\"\";\n\t\tif($this->pasv())\n\t\t{\n\t\t\tif($path == '')\n\t\t\t{\n\t\t\t\t$this->sock_write(\"LIST\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->sock_write(\"LIST $path\");\n\t\t\t}\n\t\t\tif($this->is_ok())\n\t\t\t{\n\t\t\t\twhile(true)\n\t\t\t\t{\n\t\t\t\t\t$line = fgets($this->data_sock);\n\t\t\t\t\t$s .= $line;\n\t\t\t\t\tif($line =='')\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $s;\n\t}", "public function path() {\n return $this->filepath();\n }", "public function getFilePath() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"filepath\", NULL);\n\t}", "function _generateFilesList() {\n return array();\n }", "public function getList() {\n\t\treturn Cgn_Module_Manager_File::getListStatic();\n\t}", "public function path(): string\n {\n return 'files/' . $this->model->filename();\n }", "public function getFilepath()\n {\n return $this->folder.'/'.$this->file.'.json';\n }", "function get_list_url( ){\n return reverse($this->url_prefix.\"_list\" );\n\t}", "public function getFilepath() {\n\t\treturn $this->directory.$this->fileprefix.'-'.$this->filename.'.'.static::EXTENSION;\n\t}", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function path()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" path ?\");\n\t}", "abstract function list_files($path = '.');", "function list_files () {\n\t\t$root = $this->get_root();\n\t\t\n\t\treturn $this->_list_files($root);\n\t}", "public function getFilepath()\n {\n return $this->filepath;\n }", "public function path();", "public function getFilePath()\n {\n $value = $this->_config->get('file/path');\n\n if ($value === null) {\n $value = '../var/import/import_all_products.csv';\n }\n\n return $value;\n }", "function write_file_list($list) {\n // convert to string\n $list = implode(\"\\n\", $list);\n\n // write to file\n $listFile = fopen(\"images/filelist.txt\", \"w\");\n fwrite($listFile, $list);\n fclose($listFile);\n}", "public function getFilepath() {\n\t\treturn RuntimeDirectoryManager::getDocumentRoot().$this->filename;\n\t}", "public static function getJsonFilePath()\n {\n $menusetConfig = self::getMenusetConfig();\n //return Globals::getWorkFolder() . $menusetConfig->setting->fileName;\n return Globals::getDataFilePath($menusetConfig->setting->fileName_detail);\n }", "public function getPathToFile(): string;", "public function getFilePath() {\n return base_path() . '/lam.json';\n }", "public function getPath() {\n return FILES_LOCATION . DS . $this->getType() . DS . $this->getId();\n }", "public static function getFilePath(): string\n {\n return static::getInstance()->getFilePath();\n }", "function get_urls(){\n\tglobal $urllist;\n\t$list = file($urllist);\n\t//print_r($list);\n\treturn $list;\n}", "function getPath($ctype,$listtype){\n\n\t\tif($ctype == 'image'){\n\t\t\treturn 'uploads/pics/';\n\t\t}else if($ctype == 'uploads'){\n\t\t\treturn 'uploads/media/';\n\t\t}else if($ctype == 'textpic'){\n\t\t\treturn 'uploads/pics/';\n\t\t}else if($ctype == 'multimedia'){\n\t\t\treturn 'uploads/media/';\n\t\t}else if($ctype == 'list'){\n\t\t\t/*\n\t\t\tAll plugins are listed as list.\n\t\t\t*/\n\t\t\tif(preg_match('/typoflash/',$listtype)){\n\t\t\t\treturn 'uploads/tx_typoflash/';\n\t\t\t}else if(preg_match('/flashbg/',$listtype)){\n\t\t\t\treturn 'uploads/tx_flashbg/';\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}else{\n\t\t\treturn '';\n\t\t}\n\t\n\t}", "public function filePath();", "public static function getPHPReleaseListPath()\n {\n return self::getRoot() . DIRECTORY_SEPARATOR . 'php-releases.json';\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/geshi.php',\n 'sources_custom/geshi/.htaccess',\n 'sources_custom/geshi/index.html',\n 'sources_custom/geshi/4cs.php',\n 'sources_custom/geshi/abap.php',\n 'sources_custom/geshi/actionscript.php',\n 'sources_custom/geshi/actionscript3.php',\n 'sources_custom/geshi/ada.php',\n 'sources_custom/geshi/apache.php',\n 'sources_custom/geshi/applescript.php',\n 'sources_custom/geshi/apt_sources.php',\n 'sources_custom/geshi/asm.php',\n 'sources_custom/geshi/asp.php',\n 'sources_custom/geshi/autohotkey.php',\n 'sources_custom/geshi/autoit.php',\n 'sources_custom/geshi/avisynth.php',\n 'sources_custom/geshi/awk.php',\n 'sources_custom/geshi/bash.php',\n 'sources_custom/geshi/basic4gl.php',\n 'sources_custom/geshi/bf.php',\n 'sources_custom/geshi/bibtex.php',\n 'sources_custom/geshi/blitzbasic.php',\n 'sources_custom/geshi/bnf.php',\n 'sources_custom/geshi/boo.php',\n 'sources_custom/geshi/c.php',\n 'sources_custom/geshi/c_mac.php',\n 'sources_custom/geshi/caddcl.php',\n 'sources_custom/geshi/cadlisp.php',\n 'sources_custom/geshi/cfdg.php',\n 'sources_custom/geshi/cfm.php',\n 'sources_custom/geshi/cil.php',\n 'sources_custom/geshi/clojure.php',\n 'sources_custom/geshi/cmake.php',\n 'sources_custom/geshi/cobol.php',\n 'sources_custom/geshi/cpp-qt.php',\n 'sources_custom/geshi/cpp.php',\n 'sources_custom/geshi/csharp.php',\n 'sources_custom/geshi/css.php',\n 'sources_custom/geshi/cuesheet.php',\n 'sources_custom/geshi/d.php',\n 'sources_custom/geshi/dcs.php',\n 'sources_custom/geshi/delphi.php',\n 'sources_custom/geshi/diff.php',\n 'sources_custom/geshi/div.php',\n 'sources_custom/geshi/dos.php',\n 'sources_custom/geshi/dot.php',\n 'sources_custom/geshi/eiffel.php',\n 'sources_custom/geshi/email.php',\n 'sources_custom/geshi/erlang.php',\n 'sources_custom/geshi/fo.php',\n 'sources_custom/geshi/fortran.php',\n 'sources_custom/geshi/freebasic.php',\n 'sources_custom/geshi/fsharp.php',\n 'sources_custom/geshi/gambas.php',\n 'sources_custom/geshi/gdb.php',\n 'sources_custom/geshi/genero.php',\n 'sources_custom/geshi/gettext.php',\n 'sources_custom/geshi/glsl.php',\n 'sources_custom/geshi/gml.php',\n 'sources_custom/geshi/gnuplot.php',\n 'sources_custom/geshi/groovy.php',\n 'sources_custom/geshi/haskell.php',\n 'sources_custom/geshi/hq9plus.php',\n 'sources_custom/geshi/html4strict.php',\n 'sources_custom/geshi/idl.php',\n 'sources_custom/geshi/ini.php',\n 'sources_custom/geshi/inno.php',\n 'sources_custom/geshi/intercal.php',\n 'sources_custom/geshi/io.php',\n 'sources_custom/geshi/java.php',\n 'sources_custom/geshi/java5.php',\n 'sources_custom/geshi/javascript.php',\n 'sources_custom/geshi/jquery.php',\n 'sources_custom/geshi/kixtart.php',\n 'sources_custom/geshi/klonec.php',\n 'sources_custom/geshi/klonecpp.php',\n 'sources_custom/geshi/latex.php',\n 'sources_custom/geshi/lisp.php',\n 'sources_custom/geshi/locobasic.php',\n 'sources_custom/geshi/logtalk.php',\n 'sources_custom/geshi/lolcode.php',\n 'sources_custom/geshi/lotusformulas.php',\n 'sources_custom/geshi/lotusscript.php',\n 'sources_custom/geshi/lscript.php',\n 'sources_custom/geshi/lsl2.php',\n 'sources_custom/geshi/lua.php',\n 'sources_custom/geshi/m68k.php',\n 'sources_custom/geshi/make.php',\n 'sources_custom/geshi/mapbasic.php',\n 'sources_custom/geshi/matlab.php',\n 'sources_custom/geshi/mirc.php',\n 'sources_custom/geshi/mmix.php',\n 'sources_custom/geshi/modula3.php',\n 'sources_custom/geshi/mpasm.php',\n 'sources_custom/geshi/mxml.php',\n 'sources_custom/geshi/mysql.php',\n 'sources_custom/geshi/newlisp.php',\n 'sources_custom/geshi/nsis.php',\n 'sources_custom/geshi/oberon2.php',\n 'sources_custom/geshi/objc.php',\n 'sources_custom/geshi/ocaml-brief.php',\n 'sources_custom/geshi/ocaml.php',\n 'sources_custom/geshi/oobas.php',\n 'sources_custom/geshi/oracle11.php',\n 'sources_custom/geshi/oracle8.php',\n 'sources_custom/geshi/pascal.php',\n 'sources_custom/geshi/per.php',\n 'sources_custom/geshi/perl.php',\n 'sources_custom/geshi/perl6.php',\n 'sources_custom/geshi/php-brief.php',\n 'sources_custom/geshi/php.php',\n 'sources_custom/geshi/pic16.php',\n 'sources_custom/geshi/pike.php',\n 'sources_custom/geshi/pixelbender.php',\n 'sources_custom/geshi/plsql.php',\n 'sources_custom/geshi/povray.php',\n 'sources_custom/geshi/powerbuilder.php',\n 'sources_custom/geshi/powershell.php',\n 'sources_custom/geshi/progress.php',\n 'sources_custom/geshi/prolog.php',\n 'sources_custom/geshi/properties.php',\n 'sources_custom/geshi/providex.php',\n 'sources_custom/geshi/purebasic.php',\n 'sources_custom/geshi/python.php',\n 'sources_custom/geshi/qbasic.php',\n 'sources_custom/geshi/rails.php',\n 'sources_custom/geshi/rebol.php',\n 'sources_custom/geshi/reg.php',\n 'sources_custom/geshi/robots.php',\n 'sources_custom/geshi/rsplus.php',\n 'sources_custom/geshi/ruby.php',\n 'sources_custom/geshi/sas.php',\n 'sources_custom/geshi/scala.php',\n 'sources_custom/geshi/scheme.php',\n 'sources_custom/geshi/scilab.php',\n 'sources_custom/geshi/sdlbasic.php',\n 'sources_custom/geshi/smalltalk.php',\n 'sources_custom/geshi/smarty.php',\n 'sources_custom/geshi/sql.php',\n 'sources_custom/geshi/systemverilog.php',\n 'sources_custom/geshi/tcl.php',\n 'sources_custom/geshi/teraterm.php',\n 'sources_custom/geshi/text.php',\n 'sources_custom/geshi/thinbasic.php',\n 'sources_custom/geshi/tsql.php',\n 'sources_custom/geshi/typoscript.php',\n 'sources_custom/geshi/vb.php',\n 'sources_custom/geshi/vbnet.php',\n 'sources_custom/geshi/verilog.php',\n 'sources_custom/geshi/vhdl.php',\n 'sources_custom/geshi/vim.php',\n 'sources_custom/geshi/visualfoxpro.php',\n 'sources_custom/geshi/visualprolog.php',\n 'sources_custom/geshi/whitespace.php',\n 'sources_custom/geshi/whois.php',\n 'sources_custom/geshi/winbatch.php',\n 'sources_custom/geshi/xml.php',\n 'sources_custom/geshi/xorg_conf.php',\n 'sources_custom/geshi/xpp.php',\n 'sources_custom/geshi/z80.php',\n 'sources_custom/geshi.php',\n 'sources_custom/geshi/.gitignore',\n 'sources_custom/geshi/6502acme.php',\n 'sources_custom/geshi/6502kickass.php',\n 'sources_custom/geshi/6502tasm.php',\n 'sources_custom/geshi/68000devpac.php',\n 'sources_custom/geshi/aimms.php',\n 'sources_custom/geshi/algol68.php',\n 'sources_custom/geshi/arm.php',\n 'sources_custom/geshi/asymptote.php',\n 'sources_custom/geshi/autoconf.php',\n 'sources_custom/geshi/bascomavr.php',\n 'sources_custom/geshi/c_loadrunner.php',\n 'sources_custom/geshi/c_winapi.php',\n 'sources_custom/geshi/chaiscript.php',\n 'sources_custom/geshi/chapel.php',\n 'sources_custom/geshi/coffeescript.php',\n 'sources_custom/geshi/cpp-winapi.php',\n 'sources_custom/geshi/dart.php',\n 'sources_custom/geshi/dcl.php',\n 'sources_custom/geshi/dcpu16.php',\n 'sources_custom/geshi/e.php',\n 'sources_custom/geshi/ecmascript.php',\n 'sources_custom/geshi/epc.php',\n 'sources_custom/geshi/euphoria.php',\n 'sources_custom/geshi/ezt.php',\n 'sources_custom/geshi/f1.php',\n 'sources_custom/geshi/falcon.php',\n 'sources_custom/geshi/freeswitch.php',\n 'sources_custom/geshi/genie.php',\n 'sources_custom/geshi/go.php',\n 'sources_custom/geshi/gwbasic.php',\n 'sources_custom/geshi/haxe.php',\n 'sources_custom/geshi/hicest.php',\n 'sources_custom/geshi/html5.php',\n 'sources_custom/geshi/icon.php',\n 'sources_custom/geshi/ispfpanel.php',\n 'sources_custom/geshi/j.php',\n 'sources_custom/geshi/jcl.php',\n 'sources_custom/geshi/lb.php',\n 'sources_custom/geshi/ldif.php',\n 'sources_custom/geshi/llvm.php',\n 'sources_custom/geshi/magiksf.php',\n 'sources_custom/geshi/modula2.php',\n 'sources_custom/geshi/nagios.php',\n 'sources_custom/geshi/netrexx.php',\n 'sources_custom/geshi/nginx.php',\n 'sources_custom/geshi/nimrod.php',\n 'sources_custom/geshi/objeck.php',\n 'sources_custom/geshi/octave.php',\n 'sources_custom/geshi/oorexx.php',\n 'sources_custom/geshi/oxygene.php',\n 'sources_custom/geshi/oz.php',\n 'sources_custom/geshi/parasail.php',\n 'sources_custom/geshi/parigp.php',\n 'sources_custom/geshi/pcre.php',\n 'sources_custom/geshi/pf.php',\n 'sources_custom/geshi/pli.php',\n 'sources_custom/geshi/postgresql.php',\n 'sources_custom/geshi/postscript.php',\n 'sources_custom/geshi/proftpd.php',\n 'sources_custom/geshi/pycon.php',\n 'sources_custom/geshi/pys60.php',\n 'sources_custom/geshi/q.php',\n 'sources_custom/geshi/qml.php',\n 'sources_custom/geshi/racket.php',\n 'sources_custom/geshi/rbs.php',\n 'sources_custom/geshi/rexx.php',\n 'sources_custom/geshi/rpmspec.php',\n 'sources_custom/geshi/rust.php',\n 'sources_custom/geshi/scl.php',\n 'sources_custom/geshi/spark.php',\n 'sources_custom/geshi/sparql.php',\n 'sources_custom/geshi/standardml.php',\n 'sources_custom/geshi/stonescript.php',\n 'sources_custom/geshi/unicon.php',\n 'sources_custom/geshi/upc.php',\n 'sources_custom/geshi/urbi.php',\n 'sources_custom/geshi/uscript.php',\n 'sources_custom/geshi/vala.php',\n 'sources_custom/geshi/vbscript.php',\n 'sources_custom/geshi/vedit.php',\n 'sources_custom/geshi/xbasic.php',\n 'sources_custom/geshi/yaml.php',\n 'sources_custom/geshi/zxbasic.php',\n );\n }", "public function path(): string\n {\n return realpath($this->file);\n }", "function get_list_of_files() {\n $result = $this->pdo->query('SELECT * FROM files ORDER BY filename ASC');\n return $result;\n }", "protected function filename()\n {\n return 'listdisposisidokumen_' . time();\n }", "public function getFileNames();", "public function getFile_path() {\n return $this->_file_path ? $this->_file_path : null;\n }", "public function path(): string\n {\n return components_path($this->name);\n }", "protected function getModuleFileNames()\n {\n $results = db_query('SELECT name, filename FROM {system} WHERE status = 1 ORDER BY weight ASC, name ASC')->fetchAllAssoc('name');\n\n return array_map(function ($value) {\n return DRUPAL_ROOT.DIRECTORY_SEPARATOR.$value->filename;\n }, $results);\n }", "public function getListViewUrl() {\n\t\treturn \"index.php?module=\".$this->getName().\"&parent=\".$this->getParentName().\"&view=List\";\n\t}", "public function getListViewUrl() {\n\t\treturn \"index.php?module=\".$this->getName().\"&parent=\".$this->getParentName().\"&view=List\";\n\t}", "public function getFileList() {\n return $this->fileList;\n }", "public function getFilePath()\n {\n return $this->file_path;\n }", "public function fileList()\n {\n return array_values(array_diff(scandir($this->location), ['.', '..']));\n }", "public function getPath(){\n\t \treturn $this->dirname.'/'.$this->filename.'.'.$this->extension;\n\t }", "public function getListLoad(): string {\n return $this->listLoad;\n }", "public function getUploadDir()\n {\n return 'import/fichier/licencies';\n }", "public function path() {\n\t\treturn $this->_path;\n\t}", "public function path()\n {\n return $this->_path;\n }", "public function __toString()\n {\n return $this->getFileLocation();\n }", "public function getPath() {\r\n\t\t\treturn $this->filePath;\r\n\t\t}", "private function getFilePath() {\n\t\treturn $this->options['path'].'/'.md5($this->options['revision']).'/'.$this->path;\n\t}", "public function toString()\n {\n $path = '';\n if (!empty($this->dirs)) {\n foreach ($this->dirs as $dir) {\n $path .= $dir . DIRECTORY_SEPARATOR;\n }\n }\n $path .= $this->file;\n return $path;\n }", "private function getSavePath()\n\t{\n\t\t$todoDir = $this->todoDir;\n\t\t$fileExtendedName = $this->addExtension();\n\t\treturn $todoDir . $fileExtendedName;\n\t}", "public function getPath()\n {\n return $this->dirs[0];\n }", "public function getPath()\n {\n return $this->dirs[0];\n }", "private function getFileList()\n {\n\n $count = $this->getFileCount();\n $size = $this->getSize() + 4;\n\n $this->seek(\n $this->offset\n + 18\n + $this->getAliasSize()\n + 4\n + $this->getMetadataSize()\n );\n\n return $this->readFileList($count, $size);\n }", "public function getFilePath(){\n\t\treturn $this->_filepath;\n\t}", "public function getFilePath(): string;", "public function getFilePath(): string;", "protected function getFileList()\n\t\t{\n\t\t\t$dirname=opendir($this->ruta);\n\t\t\t$files=scandir($this->ruta);\n\t\t\tclosedir ($dirname);\t\n\t\t\t\n\t\t\treturn $files;\t\t\n\t\t}", "protected function getPath () {\n\tglobal $Config;\n\treturn $Config->get('dir_root').'/'.$this->dir.'/'.$this->name;\n }", "public function getConfigPath () {\n\t\tif (!isset(self::$configPath))\n\t\t\tself::$configPath = BASE_PATH.'/configuration.plist';\n\t\t\n\t\treturn self::$configPath;\n\t}", "protected function filename()\n {\n return 'navigation_' . date('Ymdhis');\n }", "public function list_id()\n\t{\n\t\treturn $this->list;\n\t}", "public function get_path(): string\n {\n return $this->path;\n }", "public function get_path() : string\n {\n return $this->path;\n }", "function _file() {\n\t\t$path = implode('/', $this->params['pass']);\n\t\tif ( !empty($this->params['url']['ext']) ) {\n\t\t\t$path .= '.' . $this->params['url']['ext'];\n\t\t}\n\t\treturn array(MEDIA . $path, $path);\n\t}", "public function path()\n {\n return $this->path;\n }", "public function getPath(){\n $ext = $this->getExt();\n $filename = $this->id.'.'.$ext;\n return str_replace( $filename, '', $this->filename ); \n }", "function Event_Config_File()\n {\n return join(\"/\",array($this->Event_Config_Path,$this->Event_Config_File));\n }", "private function _listFile($val) {\n\t\t\n\t\t$path = g($val, 'path');\n\t\t$name = g($val, 'name');\n\t\t\n\t\t$mypath = $this->_sanitize($path . '/' . $name);\n\t\t\n\t\tif (!file_exists($this->_path($mypath))) return;\n\t\t\t\n\t\t$ext = strtolower(pathinfo($this->_path($mypath), PATHINFO_EXTENSION));\n\t\tif (is_array(g($this->conf, 'ext')) && !in_array($ext, g($this->conf, 'ext'))) return; //extension not match\n\t\t\n\t\t//define attributes\n\t\t$attr = 'data-is-file=\"true\"';\n\t\t$attr .= 'data-type=\"' . $ext . '\"';\n\t\t$attr .= 'data-path=\"' . $mypath . '\"';\n\t\t$attr .= 'data-size=\"' . filesize($this->_path($mypath)) . '\" ';\n\t\t$attr .= 'data-name=\"' . htmlspecialchars($name). '\"';\n\t\t$attr .= 'data-ctime=\"' . filectime($this->_path($path.'/'.$name)). '\"';\n\t\t$attr .= 'data-mtime=\"' . filemtime($this->_path($path.'/'.$name)). '\"';\n\t\t$attr .= 'data-url=\"' . g($this->conf, 'rootURL').'/'.$path.'/'.$name . '\" ';\n\t\t$attr .= 'data-path-enc=\"' . \\Crypt::encrypt($mypath) . '\" ';\n\t\t$attr .= 'data-mbsize=\"'. mbsize(filesize($this->_path($mypath))) .' \" ';\n $attr .= 'data-ctime-readable=\"'.date('D, d M Y H:i',filectime($this->_path($path.'/'.$name))).'\" ';\n $attr .= 'data-mtime-readable=\"'.date('D, d M Y H:i',filemtime($this->_path($path.'/'.$name))).'\" ';\n //image types\n\t\tif (in_array($ext, array('jpg', 'jpeg', 'png', 'bmp', 'gif', 'ico'))) {\n\t\t\t$info = getimagesize($this->_path($path.'/'.$name));\n\t\t\t$attr .= ' data-is-image=\"true\" ';\n\t\t\t$attr .= ' data-image-width=\"' . g($info, 0) . '\" ';\n\t\t\t$attr .= ' data-image-height=\"' . g($info, 1) . '\" ';\n\t\t}\n\t\t\n\t\t$html = '\n\t\t\t\t<li class=\"cfind-item-file\" '.$attr.'>\n\t\t\t\t\t<a href=\"\" title=\"'.htmlspecialchars($name).'\" >\n\t\t\t\t\t\t<figure></figure>\n\t\t\t\t\t\t<span>'.htmlspecialchars($name).'</span>\n\t\t\t\t\t</a>\n\t\t\t\t</li>';\n\t\t\t\t\n\t\treturn $html;\n\t}", "public function filePath() {\n return $this->baseDir() . '/' . $this->fileName();\n }", "public function filelist($data)\n {\n $data = trim($data);\n if ($data === '') {\n return '';\n }\n $data_arr = explode('|', $data);\n // read directory:\n // MUST exist!\n $path = '';\n if ($this->getTypoScriptFrontendController()->lockFilePath) {\n // Cleaning name..., only relative paths accepted.\n $path = $this->clean_directory($data_arr[0]);\n // See if path starts with lockFilePath, the additional '/' is needed because clean_directory gets rid of it\n $path = GeneralUtility::isFirstPartOfStr($path . '/', $this->getTypoScriptFrontendController()->lockFilePath) ? $path : '';\n }\n if (!$path) {\n return '';\n }\n $items = [\n 'files' => [],\n 'sorting' => []\n ];\n $ext_list = strtolower(GeneralUtility::uniqueList($data_arr[1]));\n $sorting = trim($data_arr[2]);\n // Read dir:\n $d = @dir($path);\n if (is_object($d)) {\n $count = 0;\n while ($entry = $d->read()) {\n if ($entry !== '.' && $entry !== '..') {\n // Because of odd PHP-error where <br />-tag is sometimes placed after a filename!!\n $wholePath = $path . '/' . $entry;\n if (file_exists($wholePath) && filetype($wholePath) === 'file') {\n $info = GeneralUtility::split_fileref($wholePath);\n if (!$ext_list || GeneralUtility::inList($ext_list, $info['fileext'])) {\n $items['files'][] = $info['file'];\n switch ($sorting) {\n case 'name':\n $items['sorting'][] = strtolower($info['file']);\n break;\n case 'size':\n $items['sorting'][] = filesize($wholePath);\n break;\n case 'ext':\n $items['sorting'][] = $info['fileext'];\n break;\n case 'date':\n $items['sorting'][] = filectime($wholePath);\n break;\n case 'mdate':\n $items['sorting'][] = filemtime($wholePath);\n break;\n default:\n $items['sorting'][] = $count;\n }\n $count++;\n }\n }\n }\n }\n $d->close();\n }\n // Sort if required\n if (!empty($items['sorting'])) {\n if (strtolower(trim($data_arr[3])) !== 'r') {\n asort($items['sorting']);\n } else {\n arsort($items['sorting']);\n }\n }\n if (!empty($items['files'])) {\n // Make list\n reset($items['sorting']);\n $fullPath = trim($data_arr[4]);\n $list_arr = [];\n foreach ($items['sorting'] as $key => $v) {\n $list_arr[] = $fullPath ? $path . '/' . $items['files'][$key] : $items['files'][$key];\n }\n return implode(',', $list_arr);\n }\n return '';\n }", "public function path(): string\n {\n return $this->path;\n }", "static function getDirectoryListing();", "public function path(): string;", "public function path(): string;", "public function getCountFilePath()\n {\n return $this->contentDirectoryPath . 'count.dat';\n }", "public function getFilePath() {\n return $this->path;\n }", "public function get_path() {\n\t\treturn $this->path;\n\t}", "public function get_path() {\n\t\treturn $this->path;\n\t}" ]
[ "0.7239392", "0.6959175", "0.69184566", "0.6745751", "0.6709467", "0.669723", "0.6681542", "0.6620379", "0.65630555", "0.64606255", "0.64557976", "0.64282966", "0.64278686", "0.6372177", "0.6333312", "0.62620836", "0.6221003", "0.62128127", "0.6191459", "0.6168023", "0.61590445", "0.61417425", "0.61364335", "0.61338586", "0.6127528", "0.6111978", "0.6057682", "0.6020821", "0.60126066", "0.6005455", "0.6005455", "0.6005455", "0.6005455", "0.5998987", "0.59933835", "0.5987493", "0.5978866", "0.59476864", "0.5932929", "0.5925936", "0.5915006", "0.58787036", "0.58774406", "0.584503", "0.57895565", "0.57759243", "0.57745767", "0.5768449", "0.57479167", "0.57428885", "0.5732403", "0.5729", "0.57282346", "0.57259756", "0.57191515", "0.5717203", "0.57119703", "0.570147", "0.5693877", "0.5693877", "0.56906784", "0.5674604", "0.5671657", "0.56680906", "0.5666876", "0.5665592", "0.56551445", "0.5646457", "0.5643019", "0.5642697", "0.5635628", "0.5634231", "0.5626205", "0.5621509", "0.5621509", "0.5620207", "0.56190836", "0.5618965", "0.5618965", "0.56176263", "0.5616174", "0.5615505", "0.561108", "0.5605734", "0.5603707", "0.55961645", "0.5591915", "0.55914944", "0.5589562", "0.55891764", "0.55885947", "0.55876255", "0.5587221", "0.55868316", "0.55750406", "0.5574754", "0.5574754", "0.55707705", "0.5562063", "0.5561306", "0.5561306" ]
0.0
-1
$servicos = $this>db>query("SELECT FROM vw_listar_servicos_categoria ORDER BY data_servico DESC;")>result();
public function getView() { if(!$this->base->isAdmin()) $servicos = $this->db->where('inativo IS FALSE'); $servicos = $this->db->order_by('data_servico', 'desc')->get('vw_listar_servicos_categoria')->result(); return $servicos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function noticiasActivas(){\r\n\t$objDatos = new clsDatos();\r\n\t$sql=\"select * from noticias where activo='1' order by fecha DESC\";\r\n\t$res = $objDatos->filtroListado($sql);\r\n\treturn $res;\r\n}", "function listarServicios()\n\t{\n\t\treturn \"select servicios.servicio_id,servicios.nombre_servicio, servicios.estado_servicio, servicios.descripcion, servicios.fecha_creacion,\n trabajadores.nombre,\nsucursales.nombre_sucursal\nfrom trabajadores, servicios,sucursales where servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 1 \nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}", "function get_clientes() {\n $result = $this->db->select(\"t1.*\")\n ->where(\"t1.estado !=\", 0)\n ->order_by(\"t1.agregar\", \"Desc\")\n ->get(\"cliente as t1\")\n ->result_array();\n\n// echo '<pre>';\n// print_r($this->db->last_query());\n// echo '<pre>';\n return $result;\n }", "function trier(){\r\n \r\n $db = config::getConnexion();\r\n $sql=\"SElECT * From livreur ORDER BY nom\";\r\n\r\n try{\r\n $req=$db->prepare($sql);\r\n $req->execute();\r\n $livreur= $req->fetchALL(PDO::FETCH_OBJ);\r\n return $livreur;\r\n }\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n } \r\n}", "function listar_todos_repuestos(){\n\t\t $this->db->SELECT('*');\n\t\t$this->db->From('repuestos');\n\t\t$this->db->order_by(\"id\",\"desc\");\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function listar(){\n\n\t\t$data = $this->db->from($this->table)\n\t\t\t\t\t\t ->orderBy('id DESC')\n\t\t\t\t\t\t ->fetchAll();\n\t\tif(empty($data)){\n\t\t $respuesta = array('respuesta' => 0 );\n\t\t return $respuesta;\n\t\t}else{\n\t\t return $data;\n\t\t}\t\t\t\t \n\t// return $data = $this->db_pdo->query('select * from '.$this->table)\n\t//\t\t\t\t\t \t\t\t->fetchAll();\t\t\t\t \t\t\t\t\t\t \n\t}", "function sviRezultati() {\n\t\t$mysqli = new mysqli(\"localhost\", \"root\", \"\", \"kviz\");\n\t\t$q = 'SELECT * FROM tabela t join korisnik k on t.korisnikID = k.korisnikID order by t.brojPoena desc';\n\t\t$this ->result = $mysqli->query($q);\n\t\t$mysqli->close();\n\t}", "function get_servicios_trabajador($id)\n {\n $id = $this->session->id;\n $this->db->select('*');\n $this->db->from('servicio');\n $this->db->where('id_trabajador', $id);\n $this->db->order_by('fecha','DESC');\n $query = $this->db->get();\n return $query->result();\n }", "function listarServicio(){\r\n\t\t$this->procedimiento='gev.f_tgv_servicio_sel';\r\n\t\t$this->transaccion='tgv_SERVIC_SEL';\r\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\r\n\r\n\t\t$this->setParametro('tipo_interfaz','tipo_interfaz','varchar');\t\r\n\t\t//Definicion de la lista del resultado del query\r\n\t\t$this->captura('id_servicio','int4');\r\n\t\t$this->captura('estado','varchar');\r\n\t\t$this->captura('estado_reg','varchar');\r\n\t\t$this->captura('id_lugar_destino','int4');\r\n\t\t$this->captura('id_ep','int4');\r\n\t\t$this->captura('fecha_asig_fin','date');\r\n\t\t$this->captura('fecha_sol_ini','date');\r\n\t\t$this->captura('descripcion','varchar');\r\n\t\t$this->captura('id_lugar_origen','int4');\r\n\t\t$this->captura('cant_personas','int4');\r\n\t\t$this->captura('fecha_sol_fin','date');\r\n\t\t$this->captura('id_funcionario','int4');\r\n\t\t$this->captura('fecha_asig_ini','date');\r\n\t\t$this->captura('id_usuario_reg','int4');\r\n\t\t$this->captura('fecha_reg','timestamp');\r\n\t\t$this->captura('id_usuario_mod','int4');\r\n\t\t$this->captura('fecha_mod','timestamp');\r\n\t\t$this->captura('usr_reg','varchar');\r\n\t\t$this->captura('usr_mod','varchar');\r\n\t\t$this->captura('desc_funcionario','text');\r\n\t\t$this->captura('desc_lugar_ini','varchar');\r\n\t\t$this->captura('desc_lugar_des','varchar');\r\n\t\t$this->captura('id_funcionario_autoriz','int4');\r\n\t\t$this->captura('observaciones','varchar');\r\n\t\t$this->captura('desc_funcionario_autoriz','text');\r\n\t\t\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\t\t//echo '--->'.$this->getConsulta(); exit;\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "function getNaujienosVisi() {\n $manoSQL = \"SELECT * FROM naujienos order by id DESC \";\n // $rezultataiOBJ - Mysql Objektas\n $rezultataiOBJ = mysqli_query(getPrisijungimas(), $manoSQL);\n return $rezultataiOBJ;\n}", "function listerchambre(){\n \n try {\n $sql = \"SELECT * FROM chambre_hospitalisation ORDER BY id_chambre DESC\";\n \n// $resultat = $this->executeRequete($sql)->fetchAll();\n $result = $this->executeRequete($sql)->fetchAll();\n \n// var_dump($resultat);\n// die();\n return $result;\n } catch (Exception $ex) {\n echo $ex->getMessage();\n }\n }", "function hentAlleAktiviteter()\n{\n return Aktivitet::All()->sortByDesc(\"Dato\");\n}", "public function loMasVendido() {\r\n\r\n $LMV = DB::connection('mysql')->select(\"SELECT tb_productos.idProducto,tb_productos.nombre,tb_productos.urlImage,\r\n tb_productos.fk_idSatate,tb_productos.SubRubro2,tb_productos.precioL1,\r\n tb_productos.precioL2,tb_productos.precioL3,\r\n tb_productos.precioL4,tb_productos.precioL5,\r\n tb_productos.precioL6,tb_productos.precioL7,\r\n tb_productos.precioL8,tb_productos.precioL9,\r\n tb_productos.codeProdSys, tb_productos.kiloProdcuto\r\n FROM tb_order_body \r\n INNER JOIN tb_order_header ON tb_order_header.idOrderHeader = tb_order_body.fk_idOrderHeader \r\n INNER JOIN tb_productos ON tb_productos.codeProdSys = tb_order_body.codeProdSys \r\n WHERE tb_order_header.fk_idStateOrder = 2 and tb_productos.fk_idSatate = 1\r\n group by tb_productos.idProducto, tb_productos.nombre,tb_productos.urlImage,\r\n tb_productos.fk_idSatate,tb_productos.SubRubro2,tb_productos.precioL1,\r\n tb_productos.precioL2,tb_productos.precioL3,\r\n tb_productos.precioL4,tb_productos.precioL5,\r\n tb_productos.precioL6,tb_productos.precioL7,\r\n tb_productos.precioL8,tb_productos.precioL9,\r\n tb_productos.codeProdSys, tb_productos.kiloProdcuto\r\n LIMIT 10\");\r\n\r\n return response()->json($LMV, 200);\r\n }", "public function SelecionarServicosPorFilial($dados){\n\n\n $sql=\"select * from view_servico_filial where idFilial=\".$dados->idFilial;\n\n echo $sql;\n\n $conex = new Mysql_db();\n\n $PDO_conex = $conex->Conectar();\n\n $select = $PDO_conex->query($sql);\n\n $cont=0;\n\n while ($rs=$select->fetch(PDO::FETCH_ASSOC)) {\n $listFiliaisServicoServico[] = new servico_filial();\n\n $listFiliaisServicoServico[$cont]->idFilialServico= $rs['idFilialServico'];\n $listFiliaisServicoServico[$cont]->idFilial= $rs['idFilial'];\n $listFiliaisServicoServico[$cont]->nomeFilial= $rs['nomeFilial'];\n $listFiliaisServicoServico[$cont]->idServico= $rs['idServico'];\n $listFiliaisServicoServico[$cont]->nomeServico= $rs['nome'];\n $listFiliaisServicoServico[$cont]->descricao= $rs['descricao'];\n\n $cont+=1;\n\n }\n\n $conex->Desconectar();\n\n if (isset($listFiliaisServico)) {\n return $listFiliaisServico;\n }\n }", "public function servicios(){\n $anio = date(\"Y\",strtotime(date(\"Y-m-d\").\"- 1 month\"));\n $mes = date(\"m\",strtotime(date(\"Y-m-d\").\"- 1 month\"));\n\n $consulta_popular= DB::select('SELECT vehiculos.idvehiculo,\n COUNT(*) as cantidad FROM alquilers \n INNER JOIN vehiculos ON vehiculos.idvehiculo = alquilers.id_vehiculo\n WHERE YEAR(alquilers.fecha_recogida) = ?\n AND MONTH(alquilers.fecha_recogida) = ?\n GROUP BY id_vehiculo ORDER BY cantidad DESC LIMIT ?',[$anio,$mes,1]);\n\n try{\n $idpopular = $consulta_popular['0']->idvehiculo;\n }catch (\\Exception $ex) {\n $idpopular = 1;\n }\n \n $popular = app\\Vehiculo::where('idvehiculo','=',$idpopular)->get();\n $sucursales = App\\Sucursal::all();\n //return $popular;\n setlocale(LC_TIME, 'es_ES');\n $fecha = DateTime::createFromFormat('!m', $mes);\n $mes = strftime(\"%B\", $fecha->getTimestamp());\n return view('servicios',compact('sucursales','popular','anio','mes'));\n}", "public function listadoProductos(){\n\n$sql = \"select idProducto,desc_Prod,presentacion,tipoProd,stock,m.nomMarca,c.nomCategoria,estadoProd from producto as p inner join Categoria as c ON c.idCategoria=p.idCategoria inner join Marca as m ON m.idMarca=p.idMarca where estadoProd=1 order by desc_Prod asc\";\n\t\n\n\n\t\treturn Yii::app()->db->createCommand($sql)->queryAll();\n\t}", "function newsItem_BacaDataListing_ByKategori_Terkini_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}", "function listarServiciosTerminados()\n\t{\n\t\treturn \"select servicios.servicio_id,servicios.nombre_servicio, servicios.estado_servicio, servicios.descripcion, servicios.fecha_creacion,\n trabajadores.nombre,\nsucursales.nombre_sucursal\nfrom trabajadores, servicios,sucursales where servicios.trabajador_id = trabajadores.trabajador_id \nand servicios.estado_servicio = 0 \nand servicios.sucursal_id = sucursales.sucursal_id\";\n\t}", "public function getProductos()\n {\n\n $sql = \"SELECT * FROM productos ORDER BY id DESC\";\n $producto = $this->db->prepare($sql);\n $producto->execute();\n\n return $producto;\n }", "public function orderby(){\n\n $rows = $this\n ->db\n ->order_by(\"title\", \"asc\")\n ->order_by(\"id\", \"random\")\n ->get(\"personel\")\n ->result();\n\n print_r($rows);\n\n }", "function consultar_proveedores(){\n\t\t$this->db->SELECT('*');\n\t\t$this->db->FROM('mantenciones_proveedores');\n\t\t$this->db->order_by(\"id\",\"desc\");\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function getAll(){\n\n \t$categorias = $this->db->query(\"SELECT * FROM categorias ORDER BY id_categoria DESC\");\n\n \treturn $categorias;\n }", "public function index()\n {\n return $this->tipoServico->with('categorias','categorias.servicos')->orderBy('id','DESC')->get();\n }", "function getAllTransaksiTab(){\n $data = $this->pengajuan->where('kategori','like',\"%Tabungan\")->orderBy('created_at','DESC')->get();\n return $data;\n }", "function listatpodocubaja(){\n\t\tinclude(\"application/config/conexdb_db2.php\");\n\t\t$codcia=$this->session->userdata('codcia');\n\t\t$sql=\"select DISTINCT(a.YHTIPDOC) AS TIPODOCU,e.EUDSCCOR FROM LIBPRDDAT.MMYHREL0 a INNER JOIN LIBPRDDAT.MMEUREL0 e ON a.YHTIPDOC=e.EUCODELE WHERE a.YHTIPDOC!='' AND e.EUCODTBL='AG' and a.YHSTS='I' AND a.YHCODCIA='\".$codcia.\"' and a.YHFECDOC>='20170101' order by TIPODOCU asc\";\t\t\n\t\t$dato = odbc_exec($dbconect, $sql)or die(\"<p>\" . odbc_errormsg());\n\t\tif (!$dato) {\n\t\t\t$data = FALSE;\n\t\t} else { \n\t\t\t$data = $dato; \n\t\t} \n\t\treturn $data;\n\t\tcerrar_odbc();\n\t}", "function tridate(){\r\n $sql=\"SELECT * FROM livraison ORDER BY date ASC\";\r\n$db = config::getConnexion();\r\n try{\r\n $liste=$db->query($sql);\r\n return $liste;\r\n }\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n } \r\n}", "public function obtener_datos_titular( $idv ){\n \n$datos= array();\n\n $sq_titular=\"select tipo_docu, nro_docu, nombape, nacional, porce_titular from rua.titular \";\n \n $res3= $this->db->query( $sq_titular.\" where id_vehic='\". $idv.\"'\" );\n $datos= $res3->result_array; \n return $datos; \n \n}", "function consultar_camiones(){\n\t\t$this->db->SELECT('*');\n\t\t$this->db->FROM('camiones');\n\t\t$this->db->order_by(\"patente\",\"asc\");\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function get_datos_pac_rec_ini($sucursal,$id_usuario){\n\n $conectar= parent::conexion();\n\t \n\t $sql= \"select v.id_ventas,v.sucursal,v.subtotal,v.numero_venta,p.nombres,p.telefono,p.id_paciente,v.tipo_pago,v.vendedor from ventas as v join pacientes as p where p.id_paciente=v.id_paciente and v.sucursal=? and v.id_usuario=? order by id_ventas DESC limit 1;\";\n\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1, $sucursal);\n $sql->bindValue(2, $id_usuario);\n $sql->execute();\n\n return $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n\n}", "public function listarCategorias() {\n $sql = \"SELECT *\n FROM categorias\n ORDER BY id DESC\";\n\n return $sql;\n }", "public function listarestado(){\n $stmt = $this->objPDO->prepare(\"SELECT 1 as codigo,'Si' as estado from sisemer.tipo_paciente\n UNION select 2 as codigo,'No' as estado from sisemer.tipo_paciente\n where descripcion='SIS'\n order by estado desc\");\n $stmt->execute();\n $estado=$stmt->fetchAll(PDO::FETCH_OBJ);\n return $estado;\n }", "public function get_Cargos(){\n $listar = $this->pdo->prepare(\"SELECT * FROM th_cargos WHERE car_flag =1 ORDER BY car_titulo ASC\");\n $listar->execute();\n return $listar;\n }", "function voirDerniereCommande(){\n\t$order = array();\n\tarray_push($order, array('nameChamps'=>'idCommande','sens'=>'desc'));\n\t$req = new myQueryClass('commande','',$order,'','limit 1');\n\t$r = $req->myQuerySelect();\n\treturn $r[0] ;\n\t}", "function listado() {\r\n return self::consulta('SELECT * FROM \".self::$nTabla.\"');\r\n }", "public function getAllCategory(){\n $query = \"SELECT * FROM category ORDER BY catId DESC\";\n $result = $this->db->select($query);\n return $result; \n }", "public function getProdutos()\n { \n $query = $this->db->get(\"produtos\");\n return $query->result();\n }", "public function getVeiculosServidor($id_servidor){\n // $this->db->join('servidores', \"servidores.id_servidor = id_servidor\");\n // $query = $this->db->order_by('modelo')->get('veiculos');\n \n $this->db->select('modelo, placa'); \n $this->db->from('veiculoss');\n $this->db->join('servidores', \"servidores.id_servidor = $id_servidor\");\n $this->db->where(\"id_secretarias = \". $_SESSION['secretaria']);\n $query = $this->db->get();\n return $query->result_array();\n }", "function newsItem_BacaDataListing_ByKategori_Pilihan_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND pilihan != '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}", "public function listaCategoria(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT * from tbcategorias order by idcategoria\";\n $sql = $this->conexao->query($sql);\n\n while ($row = $sql->fetch_assoc()) {\n $data[] = $row;\n }\n \n \n return $data;\n\n }", "public function listServRequetes($idFournisseur){\n $requete = \" SELECT idForfaitFournisseur, (SELECT count(idservice) FROM bitvoix_db.services WHERE idFournisseur = ?) AS nroServ\n FROM fournisseur WHERE idFournisseur = ?\";\n // var_dump($requete);\n $stmt = $this->_pdo->prepare($requete);\n $stmt->execute(array($idFournisseur,$idFournisseur));\n $result = $stmt->fetchAll(PDO::FETCH_OBJ);\n return $result;\n }", "public function cargarcategoria()\n {\n \treturn Cont_Categoria::whereRaw(\" jerarquia ~ '*{1}' \")\n \t\t\t\t\t\t\t->orderBy('jerarquia', 'asc')\n \t\t\t\t\t\t\t->get();\n \t;\t\n }", "public function readProductosCategoria(){\n $sql='SELECT nomCategoria, idProducto, producto.foto, nombre, producto.descripcion,precio FROM producto INNER JOIN categoria USING (idCategoria) WHERE idCategoria = ? AND producto.estado=1 AND producto.estadoEliminacion=1';\n $params=array($this->categoria);\n return Database::getRows($sql, $params);\n }", "public function getCategorias() {\n $categorias=$this->db->query('SELECT * FROM categorias ORDER BY id DESC;');\n return $categorias;\n }", "public function listar_marcas(){\n\t\t$this->db->order_by('desmarca','ASC'); \n\n\t\t// vamos informar a tabela e trazer o resultado \n\t\treturn $this->db->get('marca')->result(); \n\n\t}", "function trieCategorienom()\n\t{\n\t\t$sql=\"SElECT * From categorie ORDER BY nom\";\n\t\t$db = config::getConnexion();\n\t\ttry\n\t\t{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e)\n {\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "function newsItem_BacaDataListing_ByKategori_Dikomentari_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND dikomentari != '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}", "public function getAllByUser(){\n $sql = \"SELECT p.* FROM pedidos p \"\n //. \"INNER JOIN lineas_pedidos lp ON p.id = lp.pedido_id \"\n . \"WHERE p.usuario_id = {$this->getUsuario_id()} ORDER BY id DESC\";\n\n $pedido = $this->db->query($sql);\n\n \n //echo $this->db->error;\n \n return $pedido;\n \n}", "public function consultarCategoria(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT * from tbcategorias order by idcategoria; \";\n $sql = $this->conexao->query($sql);\n\n $dados = array();\n\n while ($row = $sql->fetch_assoc()) { \n $dado = array();\n $dado['idcategoria'] = $row[\"idcategoria\"];\n $dado['nome'] = $row[\"nome\"];\n $dado['habilitado'] = $row[\"habilitado\"];\n $dados[] = $dado;\n }\n\n return $dados;\n\n \n }", "function newsItem_BacaDataListing_Terkini_All( $tbl_news ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}", "public function select_products($db)\n {\n //print_r(\"entra function dao\");\n\n $sql = \" SELECT * from products order by count_view desc \";\n $stmt = $db->ejecutar($sql);\n return $db->listar($stmt);\n //return $loco; \n }", "public function getAllByUser(){\n //hacemos la consulta y lo guardamos en una variable\n $sql=\"SELECT * FROM pedidos\"\n .\" where usuario_id={$this->getUsuario_id()} order by id desc\";\n $pedido=$this->db->query($sql);\n //devolvemos un valor en especifico \n return $pedido;\n }", "function get_all_tb_detil_barang()\n {\n $this->db->order_by('idDetilBarang', 'desc');\n return $this->db->get('tb_detil_barang')->result_array();\n }", "function obter_todas_noticias_ativas() {\n $this->db->where(array(\"status_noticia\"=>1));\n $this->db->order_by(\"data_noticia\", \"desc\");\n return $this->db->get('noticia');\n }", "function getPagosanteriores() {\n $where = \" WHERE 1\";\n $array = \"\";\n\n $columns = \"`Clave_catalogo`, `Nombre`, `Email`, `Cantidad`, `Fecha_pagada`, `Id_pago` \";\n $response = $this->db->select3($columns, 'catalogo_pagos', $where, $array);\n return $response;\n }", "public function devuelve_secciones(){\n \n $sql = \"SELECT * FROM secciones ORDER BY nombre\";\n $resultado = $this -> db -> query($sql); \n return $resultado -> result_array(); // Obtener el array\n }", "private function listado_obras(){\n \treturn Sesion::where(\"inicio\",\">\",Carbon::now())->distinct()->get(['nombre_obra']);\n }", "function mas_leidos()\n{\n $mas_leidos = torrefuerte\\Models\\Articulo::where('numero_visitas' , '>', 0)\n ->orderBy('numero_visitas', 'DESC')\n ->take(10)->get();\n\n return $mas_leidos;\n}", "public function get_servicios(){\n\t\t$query = $this->db->get('servicios');\n\t\treturn $query->result_array();\n\t}", "function consultarNombreServicio($idServicio)\n\t{\n\t\t$objconexionBD = new conexionBD();\n\t\t$objconexionBD->abrirConexion();\n\t\t$res =\"\";\n\t\t$query= \"select * from services where \\\"ID_service\\\"=\".$idServicio.\";\";\n\t\t$result= $objconexionBD->enviarConsulta($query);\n\t\n\t\twhile ($row = pg_fetch_array ($result))\n\t\t{\n\t\t\t$res = $row[\"services_name\"];\n\t\t}\n\t\tpg_free_result($result);\n\t\t\n\t\t$objconexionBD->cerrarConexion();\n\t\treturn $res;\n\t\t\n\t}", "public function getAll(){\n //hacemos la consulta y lo guardamos en una variable\n $productos=$this->db->query(\"SELECT * FROM pedidos order by id desc;\");\n //devolvemos un valor en especifico.\n return $productos;\n }", "public function get_categoria() {\n $conectar=parent::conexion();\n parent::set_names();\n $sql=\"SELECT * FROM tm_categoria WHERE est=1\";\n $sql=$conectar->prepare($sql);\n $sql->execute();\n // IMPORTANTE AGREGARLE EL PDO::FETCH_ASSOC PARA QUE HAGA BIEN LA CONSULTA\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n\n }", "function triprix(){\r\n $sql=\"SELECT * FROM livraison ORDER BY prix ASC\";\r\n $db = config::getConnexion();\r\n try{\r\n $liste=$db->query($sql);\r\n return $liste;\r\n }\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n } \r\n}", "function trieCategorietype()\n\t{\n\t\t$sql=\"SElECT * From categorie ORDER BY type\";\n\t\t$db = config::getConnexion();\n\t\ttry\n\t\t{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e)\n {\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "function newsItem_BacaDataListing_Terpopuler_All( $tbl_news ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news ORDER BY dilihat DESC\");\n\treturn $sql;\n}", "public function daftar()\n {\n $this->db->select('*');\n $this->db->from('tb_client');\n // MENGGABUNGKAN DATA DARI TABLE TB_KATEGORI_CLIENT & TB_CLIENT\n $this->db->join('tb_kategori_client', 'tb_kategori_client.id_kategori = tb_client.jenis_client', 'left');\n $this->db->order_by('id_client', 'DESC');\n return $this->db->get()->result();\n }", "function listar_producto_categoria($lim){\n\t\t$sql=\"SELECT * FROM producto, imagen WHERE galeria_image=id_pro AND tabla_image='producto' AND categoria_pro='4' GROUP BY id_pro DESC ORDER BY categoria_pro DESC, prioridad_pro ASC LIMIT 0 , $lim\";\n\t\t\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$resultado['fecha_pro']=$this->convertir_fecha($resultado['fecha_pro']);\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "public function verMensaje1(){\n $sql = \"SELECT * FROM mensaje \n ORDER BY ID_not desc\n \";\n $c = $this->db->prepare($sql);\n $c->execute();\n $r = $c->fetchAll();\n return $r;\n }", "public function selectAllServiceData(){\n $sql = \"SELECT * FROM servicii_prestate ORDER BY id DESC\";\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_OBJ);\n }", "function newsItem_BacaDataListing_ByKategori_Terpopuler_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND dilihat > '20' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}", "public function getTipoContrato(){\n\t\t$em= $this->getEntityManager(); \n $dql = 'SELECT tc.id, tc.tipo , tc.abr FROM RRHHBundle:TipoContrato tc ORDER By tc.id ASC ';\n $dql = $em->createQuery($dql); \n return $dql->getResult(); \n\t}", "public function queryTramo ( dto_servicio $dtoServicio ) {\r\n\t\t\t\r\n\t\t\t$sql=\" SELECT idtramo,tramo,IFNULL(porcentaje_comision,'') AS 'porcentaje_comision' FROM ca_tramo WHERE idservicio = ? AND tipo = 'TRAMO' \";\r\n\t\t\t\r\n\t\t\t//$cartera=$dtoCartera->getId();\r\n\t\t\t$servicio = $dtoServicio->getId();\r\n\t\t\t\r\n\t\t\t$factoryConnection= FactoryConnection::create('mysql');\r\n\t $connection = $factoryConnection->getConnection();\r\n\t\t\t\r\n \t //$connection->beginTransaction();\r\n\t\t\t\r\n \t$pr=$connection->prepare($sql);\r\n\t\t\t//$pr->bindParam(1,$cartera);\r\n\t\t\t$pr->bindParam(1,$servicio);\r\n\t\t\tif( $pr->execute() ) {\r\n\t\t\t\t//$connection->commit();\r\n\t\t\t\treturn $pr->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t}else{\r\n\t\t\t\t//$connection->rollBack();\r\n\t\t\t\treturn array();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "function listaseribaja(){\n\t\tinclude(\"application/config/conexdb_db2.php\");\n\t\t$codcia=$this->session->userdata('codcia'); \n\t\t$sql=\"select distinct(a.YHNUMSER) as SERIE FROM LIBPRDDAT.MMYHREL0 a WHERE a.YHSTS='I' AND a.YHCODCIA='\".$codcia.\"' and a.YHFECDOC>='20170101' order by a.YHNUMSER asc\";\n\t\t$dato = odbc_exec($dbconect, $sql)or die(\"<p>\" . odbc_errormsg());\n\t\tif (!$dato) {\n\t\t\t$data = FALSE;\n\t\t} else { \n\t\t\t$data = $dato;\n\t\t} \n\t\treturn $data; \n\t\tcerrar_odbc();\n\t}", "function showLatestDespachos_SI($limit)\n\t {\n\t\t $sql=\"select despacho_id, nombre_despacho,fecha_despacho\n\t\t from despacho order by despacho_id desc limit 0,$limit\";\n\t\t\n\t\t $result=mysql_query($sql,$this->link);\n\t\t $data=null;\n\t\t $i=0;\n\t while($row=mysql_fetch_array($result))\n\t\t {\n\t\t\t $data[$i]['iddespacho']=$row['despacho_id'];\n\t\t\t $data[$i]['fecha_ref']=$row['fecha_despacho'];\n\t\t\t $data[$i]['nombre_despacho']=$row['nombre_despacho'];\n\t\t\t $i++;\n\t\t }\n\t\t return $data;\n\t }", "function view_categories_sql()\n\t{\n\t\t$view_cat=mysqli_query($this->con,\"SELECT * FROM categories order by c_id desc\");\n\t\treturn $view_cat;\n\t}", "function get_servicios_activos($id)\n {\n $id = $this->session->id;\n $this->db->select('*');\n $this->db->from('servicio');\n $this->db->where('estado', 1);\n $this->db->where('id_trabajador', $id);\n $this->db->order_by('fecha','DESC');\n $query = $this->db->get();\n return $query->result();\n }", "public function get_proyecto()\n { \n \n \n $this->db->select(\"PROYECTO_CVE, PRO_NOMBRE\");\n\n $this->db->order_by('PRO_NOMBRE','asc');\n $query = $this->db->get('proyecto');\n \n $data_cat=0;\n $data_cat = array();\n foreach ($query->result_array() as $row)\n {\n \n $data_cat[$row['PROYECTO_CVE']] = $row['PRO_NOMBRE']; \n }\n $query->free_result();\n\n return $data_cat; \n\n }", "public function forfaitServic($idFournisseur){\n $requete = \" SELECT idForfaitFournisseur, (SELECT count(idservice) FROM bitvoix_db.services WHERE idFournisseur = ?) AS nroServ,\n DATEDIFF(now(),fournisseur.datInsFournisseur) as jours, DATEDIFF(datEcheFournisseur,now()) as jouract \n FROM fournisseur WHERE idFournisseur = ?\";\n // var_dump($requete);\n $stmt = $this->_pdo->prepare($requete);\n $stmt->execute(array($idFournisseur,$idFournisseur));\n $result = $stmt->fetchAll(PDO::FETCH_OBJ);\n if (!$result){\n $requete = \" SELECT '' AS idService, 0 AS nroServ, idForfaitFournisseur,datEcheFournisseur, idForfaitFournisseur,\n DATEDIFF(now(),fournisseur.datInsFournisseur) as jours, DATEDIFF(datEcheFournisseur,now()) as jouract \n FROM fournisseur\n WHERE idFournisseur = ? \";\n // var_dump($requete);\n $stmt = $this->_pdo->prepare($requete);\n $stmt->execute(array($idFournisseur));\n $result = $stmt->fetchAll(PDO::FETCH_OBJ);\n }\n return $result;\n\n }", "function listar_recentes() {\n\t\t$this->db->select ( '*' );\n\t\t$this->db->order_by ( \"inicio_evento\", \"asc\" );\n\t\t// $this->db->from('evento');\n\t\t$query = $this->db->get ( 'evento', 4 );\n\t\treturn $query->result ();\n\t}", "public function obtenerPagos()\n {\n\t\t$query = $this->db->order_by(\"id\", \"desc\");\n $query = $this->db->get('pago_proveedores'); \n\n if ($query->num_rows() > 0)\n return $query->result();\n else\n return $query->result();\n }", "function all(){\n try{\n $link= connecter_db();\n $rp=$link->prepare(\"select * from etudiant order by id desc\");\n $rp->execute();\n $resultat= $rp->fetchAll(); \n\n return $resultat;\n }catch(PDOException $e ){\n die (\"erreur de recuperation des etudiants dans la base de donnees \".$e->getMessage());\n }\n\n}", "public function retornarVenta()\n {\n\t $this->db->select('V.idVenta,C.razonSocial,C.nit,V.total,DATE(V.fechaRegistro) as fechaRegistro');\n\t $this->db->from('venta V ');\n\t $this->db->join('cliente C','V.idCliente = C.idCliente');\n\t $this->db->order_by(\"fechaRegistro\",\"desc\"); \n\t $this->db->where('V.estado',1);\n\t return $this->db->get();\n\t \n }", "public function SelecionaTudo() {\n try {\n //Monta a Query\n $query = Doctrine_Query::create()\n ->select(\"ws.*, MONTHNAME(ws.data) mes, YEAR(ws.data) ano\")\n ->from($this->table_alias)\n ->orderBy(\"ws.data DESC\")\n ->offset(1)\n ->limit(6)\n ->execute()\n ->toArray();\n\n return $query;\n } catch (Doctrine_Exception $e) {\n echo $e->getMessage();\n }\n }", "public function query(){\n\n $rows = $this\n ->db\n ->where(\"id >\", 1)\n ->like(\"title\", \"etti\")\n ->order_by(\"id\", \"desc\")\n ->limit(1)\n ->get(\"personel\")\n ->result();\n\n echo $this->db->last_query();\n echo \"<br>\";\n print_r($rows);\n\n\n\n }", "function listar(){\n\t\t $this->db->SELECT('*');\n\t\t$this->db->SELECT('mantenciones.id_cod_ccu as id_cod_ccu_mantenciones');\n\t\t$this->db->From('mantenciones');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function footerkategorilistele() {\n $sql = \"SELECT sabitsayfaid,sayfa_UstID,sbtsayfa_Sira,sbtsayfa_Adi,sbtsayfa_bnzrszAd FROM flora_sabitsayfa WHERE sbtsayfa_Aktiflik=1 ORDER BY sbtsayfa_Sira ASC\";\n return $this->db->select($sql);\n }", "public function listadoCategorias(){\n $resultado = array();\n try {\n $sql = new Sql($this->dbAdapter);\n $select = $sql->select();\n $select->columns(array(\"value\"=>\"idCategoria\",\"text\"=>\"nombreCategoria\"));\n $select->from(array('c'=>'categorias'));\n $select->order('nombreCategoria ASC');\n $sqlString = $select->getSqlString($this->dbAdapter->getPlatform()); \n $result = $this->dbAdapter->query($sqlString,Adapter::QUERY_MODE_EXECUTE);\n $resultado = $result->toArray(); \n } catch (\\Exception $e) {\n $code = $e->getCode();\n $msg = $e->getMessage();\n $file = $e->getFile();\n $line = $e->getFile();\n $resultado = array(\"ErrorInterno\" => \"$line ERROR #: $code ERROR: $msg\");\n }\n \n $this->dbAdapter->getDriver()->getConnection()->disconnect();\n return $resultado;\n }", "public function getTipos(){\n $sql = \"SELECT * FROM tipos_producto ORDER BY nombre\";\n #se guardan los parametros (datos recogidos) en una variable,como un arreglo\n $params = array(null);\n #Retorna los datos que devuelve el metodo getRows \n return Database::getRows($sql, $params);\n }", "function consultar(){\n\t\t\n\t\t$this->mysqli = conectarBD();\n\t\t\n\t\t$sql = \"SELECT Linea_Factura.Id_Linea_Factura,Linea_Factura.Id_Factura,Servicio.Nombre,Linea_Factura.Importe,Linea_Factura.Descripcion FROM Linea_Factura INNER JOIN Servicio WHERE Linea_Factura.Id_Factura='\".$this->factura.\"' AND Linea_Factura.Id_Servicio=Servicio.Id_Servicio AND Linea_Factura.Borrado='0';\";\n\t\t$resultado = $this->mysqli->query($sql);\t\n\t\tif ($resultado->num_rows > 0){\n\t\t\twhile($row = $resultado->fetch_array()){\n\t\t\t\t$array[] = $row;\n\t\t\t}\n\t\t\treturn $array;\n\t\t}\n\t}", "function getPagos() {\n $where = \" WHERE 1\";\n $array = \"\";\n $columns = \"`Id_pago`, `Nombre`, `Email`, `Fecha_anterior`, `Pago`, `Proxima_fecha`, `Estatus`, `Id_cliente`\";\n $response = $this->db->select3($columns, 'pagos', $where, $array);\n return $response;\n }", "static public function mdlmostrarCategoriasServicios($tabla) {\n $stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla\");\n $stmt -> execute();\n return $stmt -> fetchAll();\n $stmt -> close();\n $stmt = null;\n\n }", "public function selectAllRegiuniData(){\n $sql = \"SELECT * FROM regiune ORDER BY id DESC\";\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_OBJ);\n }", "function view_categories_sql()\n\t{\n\t\t$view_cat=mysqli_query($this->con,\"SELECT * FROM categories where status=1 order by c_id desc\");\n\t\treturn $view_cat;\n\t}", "function newsItem_BacaDataListing_ByKategori_DiLampirkan_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND dilampirkan != '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}", "function afficherCategoriess(){\n $sql=\"SElECT * From categorie\";\n $db = config2::getConnexion(); //config\n try{\n $liste=$db->query($sql);\n return $liste;\n }\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\n }", "public function select_categoria($db, $cat)\n {\n $sql = \"SELECT * FROM products WHERE categoria='$cat' order by count_view desc \";\n $stmt = $db->ejecutar($sql);\n return $db->listar($stmt);\n }", "public function listar(){\n $sql = \"CALL sp_ListarTipoPago\";\n return ejecutarConsulta($sql);\n }", "function obtener_usuarios($conexion) {\n $sentencia = $conexion->prepare(\"SELECT * FROM usuarios ORDER BY id DESC\");\n $sentencia->execute();\n return $sentencia->fetchAll();\n}", "public function pagadaall(){\n$sql = $this->db->query(\"SELECT pago_factura.*, facturas.id_factura FROM pago_factura INNER JOIN facturas ON pago_factura.factura_id = facturas.id\");\nreturn $sql;\n}", "function categories(){\n return $this->db->get($this->categorie)->result();\n }", "public function viewservice(){\n\t\t\tif(isset($this->service_id)){\n\t\t\t\t $this->sql=\"SELECT * FROM tbl_service WHERE service_id='$this->service_id'\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t$this->sql=\"SELECT * FROM tbl_service ORDER BY service_id DESC\";\n\t\t\t\n\t\t\t}\n\t\t\t$this->res=mysqli_query($this->conxn,$this->sql) or trigger_error($this->err=mysqli_error($this->conxn));\n\t\t\t$this->numRows=mysqli_num_rows($this->res);// or trigger_error($this->err=mysqli_error($this->conxn));\n\t\t\t$this->data=array();\n\t\t\t\n\t\t\tif($this->numRows>0){\n\t\t\t\twhile($this->row=mysqli_fetch_assoc($this->res)){\n\t\t\t\t\tarray_push($this->data,$this->row);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\treturn $this->data;\n\t\t\n}" ]
[ "0.72769225", "0.6814404", "0.6790958", "0.67826134", "0.6764313", "0.67016816", "0.6692756", "0.6640065", "0.6636746", "0.65971464", "0.65594256", "0.6545949", "0.65322655", "0.65309966", "0.65279615", "0.65264034", "0.651125", "0.64916867", "0.64806974", "0.64722884", "0.64605075", "0.6452985", "0.64227164", "0.6410501", "0.6401452", "0.6399142", "0.6385158", "0.63770187", "0.6372022", "0.63669485", "0.63651866", "0.6355304", "0.633425", "0.633331", "0.63323903", "0.63321674", "0.63302106", "0.63273853", "0.6321327", "0.63075817", "0.63006276", "0.63003004", "0.6295837", "0.62936926", "0.6291602", "0.6289718", "0.6289371", "0.62867814", "0.62838775", "0.6283437", "0.628038", "0.6275972", "0.6275165", "0.6270303", "0.6264016", "0.62635833", "0.6263061", "0.6260203", "0.62522066", "0.6250573", "0.6240815", "0.6239671", "0.6238756", "0.6233787", "0.6232801", "0.6230179", "0.62249154", "0.6218169", "0.62083477", "0.62018716", "0.6195114", "0.61915696", "0.61914325", "0.61884475", "0.617707", "0.61763155", "0.6170497", "0.6169849", "0.61671406", "0.61635447", "0.6158236", "0.6151583", "0.61514723", "0.6145647", "0.61434036", "0.6138023", "0.61366075", "0.6134102", "0.6131044", "0.6130867", "0.61301297", "0.6128835", "0.61260086", "0.6122151", "0.6121545", "0.6118346", "0.61153626", "0.6114183", "0.6111755", "0.6109212" ]
0.6856004
1
$realtime = new Realtime;
public function configed_value() { $Realtime = Realtime::where('code', request()->code) ->where('user_id', Auth::id())->first(); //->where('user_id', auth()->user()->id); //dd($Realtime); if (request()->set == 'set') { //set //dd('set!!'); //foreach ($Realtimes as $Realtime) { $Realtime->upperlimit = request()->upperlimit; if($Realtime->upperlimit != null){ $time = date( "Y-m-d H:i:s" ); $Realtime->ul_setat = $time; } $Realtime->lowerlimit = request()->lowerlimit; if($Realtime->lowerlimit != null){ $time = date( "Y-m-d H:i:s" ); $Realtime->ll_setat = $time; } $Realtime->sendflag = false; } else { //delete //dd('delete!!'); //dd($Realtime); //$Realtime->delete(); Realtime::where('code', request()->code) ->where('user_id', Auth::id())->first()->delete(); } //dd($Realtime); $Realtime->save(); //} return redirect('/Realtimes/value'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function realtime($params = []);", "protected static function getFacadeAccessor()\n {\n return 'realtime';\n }", "function __construct(){\r\n $this->timestamp = time();\r\n }", "public function __construct() {\n $this->time = time();\n }", "abstract protected function isRealTime();", "private function __construct()\n {\n $this->time = time();\n }", "public function __construct()\n {\n $this->local_time = time();\n }", "public function __construct()\n {\n $this->connect = new mysqli(\n getenv('DB_HOST'),\n getenv('DB_USER'),\n getenv('DB_PASSWORD'),\n getenv('DB_NAME')\n );\n $this->obTime = new Time();\n $this->array = array();\n }", "public function instance() {\n\t\t\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->timestamp = time();\n\t}", "public static function REALTIME()\n {\n return new Vp9Quality(self::REALTIME);\n }", "public function __construct()\n {\n // for example creates \"thread\"\n }", "public function __construct($sensor)\n {\n // this->sensor = $sensor ;\n }", "public function __construct()\n {\n $this->sensor = false;\n }", "public function __construct() {\n\t\t$this->startTime = self::getMicrotime();\n\t}", "function time(): int\n{\n return Time::get();\n}", "public function now();", "public function __construct(){\n $this->Num_operacion = time();\n }", "public function __construct()\n\t{\n\t\t$this->setTimeStamp();\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->randTimeService = new RandTimeHadistService();\n }", "public function __construct()\n {\n $this->_timeStart = (float)microtime(true); \n parent::__construct();\n }", "public function instance();", "function __construct() {\n}", "function __construct() {\n}", "function __construct() {\n}", "function __construct() {\n}", "function __construct() {\n}", "function __construct() {\n}", "private function __construct() { // singleton\n }", "public function __construct()\n {\n $this->startTime = microtime(true);\n parent::__construct();\n }", "function __construct() { }", "function __construct() { }", "function __construct() { }", "public function __construct()\n {\n $this->dateTime = new Time('now', 'Asia/Jakarta', 'id_ID');\n }", "function start(){\n\t\t$this->time_start = $this->microtime_float();\n\t}", "public function get_data_real_time()\n {\n //ambil tanggal dan waktu sekarang\n $now = date(\"Y-m-d H:i:s\");\n\n //ambil data 1 detik terakhir untuk menentukan status charging atau off\n $status = $this->M_monitoring->get_status(date('Y-m-d H:i:s',strtotime('-1 seconds',strtotime($now))))->num_rows();\n \n // simpan data yang akan ditampilkan dalam bentuk array\n $data = array(\n 'monitor' => $this->M_monitoring->get_all(),\n 'header' => $this->M_monitoring->get_data_header()->row(),\n 'lifetime' => $this->db->get('tbl_scan')->num_rows(),\n 'status' => $status,\n );\n \n //set output dengan tampilan detail_monitoring\n $output = $this->load->view('detail_monitoring',$data,true);\n // echo $output dalam bentuk json\n echo json_encode($output);\n }", "function __construct()\r\n {\r\n parent::__construct();\r\n $this->firebase = new \\Firebase\\FirebaseLib(DEFAULT_URL, DEFAULT_TOKEN); //load firebase engine\r\n }", "function timer(): Timer\n{\n return new Timer;\n}", "public function getLiveRecord() {}", "public function __construct();", "public function __construct();", "public function __construct();", "public function isPeriodic()\n {\n\n }", "public function __construct() { }", "public function __construct() { }", "public function __construct() { }", "public function __construct() { }", "public function __construct() { }", "public function __construct() { }", "public function observe() {}", "public function tick()\n {\n //\n }", "public function tick();", "function __construct() {\n\n }", "function __construct() {\n\n }", "function __construct(){\n //constructor vacio\n }", "function __construct() {\n\n }", "function __construct() {\n\t}", "function __construct() {\n\t}", "function __construct() {\n\t}", "function __construct() {\n\t}", "function __construct() {\n\t}", "function __construct() {\n\t}", "function __construct() {\n\t}", "public function poll()\n {\n }", "function __construct() {\n }", "function __construct()\n {\n }", "function recall() {\n //get data from the database\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct()\n {\n\n }", "function __construct()\n {\n\n }", "function __construct()\n {\n\n }", "function __construct() \n {\n }", "public function run()\n {\n\n }", "public function run()\n {\n\n }", "public function run()\n {\n\n }", "function __construct(){\n }", "public function __construct(){\n $this->db = new Database;\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }" ]
[ "0.6436666", "0.6018347", "0.5882265", "0.58461905", "0.5828165", "0.5827023", "0.56234324", "0.5596158", "0.54346114", "0.54344", "0.5408614", "0.537275", "0.5325369", "0.5319352", "0.53146076", "0.52909255", "0.5290442", "0.5262252", "0.5230705", "0.52239597", "0.5221464", "0.5218927", "0.51990926", "0.51990926", "0.51990926", "0.51990926", "0.51990926", "0.51990926", "0.5188274", "0.51612", "0.51556045", "0.51556045", "0.51556045", "0.51488346", "0.51418984", "0.51391745", "0.51368403", "0.51278317", "0.51192695", "0.5118589", "0.5118589", "0.5118589", "0.5116742", "0.50956523", "0.50956523", "0.50956523", "0.50956523", "0.50956523", "0.50956523", "0.5088581", "0.50842965", "0.5075782", "0.5073299", "0.5073299", "0.5063764", "0.50575817", "0.50392175", "0.50392175", "0.50392175", "0.50392175", "0.50392175", "0.50392175", "0.50392175", "0.50359786", "0.5032381", "0.5030818", "0.5028923", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.50224185", "0.50224185", "0.50224185", "0.502166", "0.5018666", "0.5018666", "0.5018666", "0.501816", "0.50177747", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169" ]
0.0
-1
$realtime = new Realtime;
public function configed_changerate() { $Realtime = Realtime::where('code', request()->code) ->where('user_id', Auth::id())->first(); //->where('user_id', auth()->user()->id); //dd($Realtime); if (request()->set == 'set') { //set //dd('set!!'); $Realtime->changerate_range = request()->changerate_range; if($Realtime->changerate_range != null){ $time = date( "Y-m-d H:i:s" ); $Realtime->cr_setat = $time; } $Realtime->sendflag_changerate = false; $Realtime->changecount = 0; } else { //delete //dd('delete!!'); //dd($Realtime); //$Realtime->delete(); Realtime::where('code', request()->code) ->where('user_id', Auth::id())->first()->delete(); } //dd($Realtime); $Realtime->save(); //} return redirect('/Realtimes/changerate'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function realtime($params = []);", "protected static function getFacadeAccessor()\n {\n return 'realtime';\n }", "function __construct(){\r\n $this->timestamp = time();\r\n }", "public function __construct() {\n $this->time = time();\n }", "abstract protected function isRealTime();", "private function __construct()\n {\n $this->time = time();\n }", "public function __construct()\n {\n $this->local_time = time();\n }", "public function __construct()\n {\n $this->connect = new mysqli(\n getenv('DB_HOST'),\n getenv('DB_USER'),\n getenv('DB_PASSWORD'),\n getenv('DB_NAME')\n );\n $this->obTime = new Time();\n $this->array = array();\n }", "public function instance() {\n\t\t\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->timestamp = time();\n\t}", "public static function REALTIME()\n {\n return new Vp9Quality(self::REALTIME);\n }", "public function __construct()\n {\n // for example creates \"thread\"\n }", "public function __construct($sensor)\n {\n // this->sensor = $sensor ;\n }", "public function __construct()\n {\n $this->sensor = false;\n }", "public function __construct() {\n\t\t$this->startTime = self::getMicrotime();\n\t}", "function time(): int\n{\n return Time::get();\n}", "public function now();", "public function __construct(){\n $this->Num_operacion = time();\n }", "public function __construct()\n\t{\n\t\t$this->setTimeStamp();\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->randTimeService = new RandTimeHadistService();\n }", "public function __construct()\n {\n $this->_timeStart = (float)microtime(true); \n parent::__construct();\n }", "public function instance();", "function __construct() {\n}", "function __construct() {\n}", "function __construct() {\n}", "function __construct() {\n}", "function __construct() {\n}", "function __construct() {\n}", "private function __construct() { // singleton\n }", "public function __construct()\n {\n $this->startTime = microtime(true);\n parent::__construct();\n }", "function __construct() { }", "function __construct() { }", "function __construct() { }", "public function __construct()\n {\n $this->dateTime = new Time('now', 'Asia/Jakarta', 'id_ID');\n }", "function start(){\n\t\t$this->time_start = $this->microtime_float();\n\t}", "public function get_data_real_time()\n {\n //ambil tanggal dan waktu sekarang\n $now = date(\"Y-m-d H:i:s\");\n\n //ambil data 1 detik terakhir untuk menentukan status charging atau off\n $status = $this->M_monitoring->get_status(date('Y-m-d H:i:s',strtotime('-1 seconds',strtotime($now))))->num_rows();\n \n // simpan data yang akan ditampilkan dalam bentuk array\n $data = array(\n 'monitor' => $this->M_monitoring->get_all(),\n 'header' => $this->M_monitoring->get_data_header()->row(),\n 'lifetime' => $this->db->get('tbl_scan')->num_rows(),\n 'status' => $status,\n );\n \n //set output dengan tampilan detail_monitoring\n $output = $this->load->view('detail_monitoring',$data,true);\n // echo $output dalam bentuk json\n echo json_encode($output);\n }", "function __construct()\r\n {\r\n parent::__construct();\r\n $this->firebase = new \\Firebase\\FirebaseLib(DEFAULT_URL, DEFAULT_TOKEN); //load firebase engine\r\n }", "function timer(): Timer\n{\n return new Timer;\n}", "public function getLiveRecord() {}", "public function __construct();", "public function __construct();", "public function __construct();", "public function isPeriodic()\n {\n\n }", "public function __construct() { }", "public function __construct() { }", "public function __construct() { }", "public function __construct() { }", "public function __construct() { }", "public function __construct() { }", "public function observe() {}", "public function tick()\n {\n //\n }", "public function tick();", "function __construct() {\n\n }", "function __construct() {\n\n }", "function __construct(){\n //constructor vacio\n }", "function __construct() {\n\n }", "function __construct() {\n\t}", "function __construct() {\n\t}", "function __construct() {\n\t}", "function __construct() {\n\t}", "function __construct() {\n\t}", "function __construct() {\n\t}", "function __construct() {\n\t}", "public function poll()\n {\n }", "function __construct() {\n }", "function __construct()\n {\n }", "function recall() {\n //get data from the database\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct() {\n }", "function __construct()\n {\n\n }", "function __construct()\n {\n\n }", "function __construct()\n {\n\n }", "function __construct() \n {\n }", "public function run()\n {\n\n }", "public function run()\n {\n\n }", "public function run()\n {\n\n }", "function __construct(){\n }", "public function __construct(){\n $this->db = new Database;\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }", "function __construct()\n {\n }" ]
[ "0.6436666", "0.6018347", "0.5882265", "0.58461905", "0.5828165", "0.5827023", "0.56234324", "0.5596158", "0.54346114", "0.54344", "0.5408614", "0.537275", "0.5325369", "0.5319352", "0.53146076", "0.52909255", "0.5290442", "0.5262252", "0.5230705", "0.52239597", "0.5221464", "0.5218927", "0.51990926", "0.51990926", "0.51990926", "0.51990926", "0.51990926", "0.51990926", "0.5188274", "0.51612", "0.51556045", "0.51556045", "0.51556045", "0.51488346", "0.51418984", "0.51391745", "0.51368403", "0.51278317", "0.51192695", "0.5118589", "0.5118589", "0.5118589", "0.5116742", "0.50956523", "0.50956523", "0.50956523", "0.50956523", "0.50956523", "0.50956523", "0.5088581", "0.50842965", "0.5075782", "0.5073299", "0.5073299", "0.5063764", "0.50575817", "0.50392175", "0.50392175", "0.50392175", "0.50392175", "0.50392175", "0.50392175", "0.50392175", "0.50359786", "0.5032381", "0.5030818", "0.5028923", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.5023045", "0.50224185", "0.50224185", "0.50224185", "0.502166", "0.5018666", "0.5018666", "0.5018666", "0.501816", "0.50177747", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169", "0.50169" ]
0.0
-1
Creates an async future Example: `var i = Future.async(function(cb) cb(1)); // Future`
public static function async ($f, $lazy = false) { #/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:136: lines 136-143 if ($lazy === null) { $lazy = false; } if ($lazy) { #/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:137: characters 7-32 return new LazyTrigger($f); } else { #/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:139: characters 7-26 $op = new FutureTrigger(); #/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:140: characters 7-41 $wrapped = $f; #/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:141: characters 7-33 Callback_Impl_::invoke($wrapped, Boot::getInstanceClosure($op, 'trigger')); #/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:142: characters 7-16 return $op; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function async(\\Closure $closure, mixed ...$args): Future\n{\n static $run = null;\n\n $run ??= static function (FutureState $state, \\Closure $closure, array $args): void {\n $s = $state;\n $c = $closure;\n\n /* Null function arguments so an exception thrown from the closure does not contain the FutureState object\n * in the stack trace, which would create a circular reference, preventing immediate garbage collection */\n $state = $closure = null;\n\n try {\n // Clear $args to allow garbage collection of arguments during fiber execution\n $s->complete($c(...$args, ...($args = [])));\n } catch (\\Throwable $exception) {\n $s->error($exception);\n }\n };\n\n $state = new Internal\\FutureState;\n\n EventLoop::queue($run, $state, $closure, $args);\n\n return new Future($state);\n}", "public function setAsync(string $async): self;", "function async(callable $function)\n{\n // return a new promise\n return new Promise(function (callable $resolve, callable $reject, callable $progress) use ($function) {\n // get the generator\n $generator = $function();\n\n // function to step the generator to the next yield statement\n $step = function () use (&$step, $generator, $resolve, $reject, $progress) {\n $value = null;\n\n // try to execute the next block of code\n try {\n $value = $generator->current();\n } catch (\\Exception $exception) {\n // exception rejects the promise\n $reject($exception);\n\n return;\n }\n\n // if the generator is complete, resolve the promise\n if (!$generator->valid()) {\n $resolve($value);\n\n return;\n }\n\n // wrap the value in a promise if it isn't already one\n if (!($value instanceof PromiseInterface)) {\n $value = new FulfilledPromise($value);\n }\n\n // run the next step when the current one resolves\n $value->then(function ($value) use (&$step, $generator) {\n $generator->send($value);\n $step();\n }, function (\\Exception $reason) use ($generator) {\n $generator->throw($reason);\n });\n };\n\n // run the first step in the next tick\n DefaultLoop::instance()->nextTick($step);\n });\n}", "public function async($value = null){\n return $this->attr(ATTR_ASYNC, $value);\n }", "public function getAsync()\n {\n return $this->async;\n }", "public function getFutureHandler(): FutureHandler;", "static public function async ($f, $lazy = false) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:131: lines 131-138\n\t\tif ($lazy === null) {\n\t\t\t$lazy = false;\n\t\t}\n\t\tif ($lazy) {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:132: characters 7-32\n\t\t\treturn new LazyTrigger($f);\n\t\t} else {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:134: characters 7-26\n\t\t\t$op = new FutureTrigger();\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:136: characters 7-33\n\t\t\tCallback_Impl_::invoke($f, Boot::getInstanceClosure($op, 'trigger'));\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:137: characters 7-16\n\t\t\treturn $op;\n\t\t}\n\t}", "public function setAsync(bool $async = true) {\n $this->attributes()\n ->remove('defer')\n ->set('async', $async);\n return $this;\n }", "public function createQueueAsync(CreateQueueRequest $request,\n AsyncCallback $callback = NULL)\n {\n $response = new CreateQueueResponse($request->getQueueName());\n return $this->client->sendRequestAsync($request, $response, $callback);\n }", "public function isAsync();", "public static function createFromClient(LoopInterface $loop, AsyncClientInterface $asyncClient): self\n {\n return new self($loop, $asyncClient);\n }", "public function createQueueAsync(CreateQueueRequest $request, AsyncCallback $callback = null)\n {\n $response = new CreateQueueResponse($request->getQueueName());\n return $this->client->sendRequestAsync($request, $response, $callback);\n }", "public function createQueryTaskAsync($body, $limit = null, $apply_formatting = null, $apply_vis = null, $cache = null, $image_width = null, $image_height = null, $generate_drill_links = null, $force_production = null, $cache_only = null, $path_prefix = null, $rebuild_pdts = null, $server_table_calcs = null, $fields = null)\n {\n return $this->createQueryTaskAsyncWithHttpInfo($body, $limit, $apply_formatting, $apply_vis, $cache, $image_width, $image_height, $generate_drill_links, $force_production, $cache_only, $path_prefix, $rebuild_pdts, $server_table_calcs, $fields)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "function async($is_async = null)\n {\n if (func_num_args() > 0) {\n if (is_bool($is_async) == false) {\n throw new AjaxIllegalArgumentException('In class <b>' . get_class($this) . '</b> in method <b>async($is_async)</b>: Argument <b>$is_async</b> MUST BE of type Boolean - <b style=\"color:red\">' . (is_object($is_async) ? get_class($is_async) : gettype($is_async)) . '</b> given!');\n }\n $this->property(\"async\", $is_async);\n return $this;\n } else {\n return $this->property(\"async\");\n }\n }", "function coroutine(Closure $fn, array $args = []): TaskInterface\n {\n return signal(function (Closure $resume, TaskInterface $task, SchedulerInterface $scheduler) use ($fn, $args) {\n $t = Task::create($fn, $args);\n $scheduler->schedule($t);\n $resume($t);\n });\n }", "public function write(AsyncMessage $message): ExtendedPromiseInterface;", "public static function create(callable $cb)\n {\n if (!ServerHelper::coroutineIsEnabled()) {\n return false;\n }\n\n $tid = self::tid();\n\n return SwCoroutine::create(function() use($cb, $tid) {\n $id = SwCoroutine::getuid();\n self::$idMap[$id] = $tid;\n\n PhpHelper::call($cb);\n });\n }", "public function isAsync()\n {\n return $this->async;\n }", "public static function create(): Deferred {\n return new Deferred();\n }", "public function getAsync(): string;", "public function isAsynchronous(): bool\n {\n return true;\n }", "public function getAsyncPool(): AsyncRequestPool\n {\n return $this->pool;\n }", "public function requestAsync(string $method, $uri, array $options = []): PromiseInterface\n {\n return $this->guzzleClient->requestAsync($method, $uri, $options);\n }", "public function createScriptAsync($script_body)\n {\n return $this->createScriptAsyncWithHttpInfo($script_body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function isAsync(): bool\n {\n return $this->async;\n }", "public function createChannelAsync($body = null)\n {\n return $this->createChannelAsyncWithHttpInfo($body)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public static function await($promise = null, $unwrap = false);", "static public function sync ($v) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:123: characters 5-29\n\t\treturn new SyncFuture(new LazyConst($v));\n\t}", "public function setIsAsync(bool $async): void\n {\n $this->async = $async;\n }", "public function testSendMessageAsync()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_code = 202;\n // Create a mock response\n $expected = new \\Karix\\Model\\MessageCreatedResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\MessageApi(\n $client,\n $config\n );\n $message = new \\Karix\\Model\\CreateMessage();\n\n $promise = $apiInstance->sendMessageAsync($message)->then(function ($result) use( &$expected) {\n $this->assertEquals($expected, $result);\n }, function ($exception) {\n $this->fail(\"Exception when calling MessageApi->sendMessage: \".$e->getMessage());\n });\n $promise->wait();\n }", "public function createAsync($object_schema_egg)\n {\n return $this->createAsyncWithHttpInfo($object_schema_egg)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function getAwait()\n {\n return $this->await;\n }", "static public function asPromise ($s) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:88: characters 5-13\n\t\treturn $s;\n\t}", "public function produceAsyncJob()\n {\n for ($i = 0; $i < 5; $i++) {\n echo $this->client->doBackground($this->server->getAsyncQueue(), $this->generateWorkload(3));\n }\n }", "public function createTokenAsync($options)\n {\n return $this->createTokenAsyncWithHttpInfo($options)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function createFeesAsync($fee_request = null)\n {\n return $this->createFeesAsyncWithHttpInfo($fee_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function createTransactionAsync($budget_id, $data)\n {\n return $this->createTransactionAsyncWithHttpInfo($budget_id, $data)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function createIndexAsync($index_model, $authorization = null)\n {\n return $this->createIndexAsyncWithHttpInfo($index_model, $authorization)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function createRateLimiterAsync($options)\n {\n return $this->createRateLimiterAsyncWithHttpInfo($options)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function async()\n {\n return $this->_get_token();\n }", "function get_url_async($data, $options = array()) {\r\n\t $curly = array();\r\n\t // data to be returned\r\n\t $result = array();\r\n\r\n\t // multi handle\r\n\t $mh = curl_multi_init();\r\n\r\n\t // loop through $data and create curl handles\r\n\t // then add them to the multi-handle\r\n\t foreach ($data as $id => $d) {\r\n\r\n\t\t$curly[$id] = curl_init();\r\n\r\n\t\t$url = (is_array($d) && !empty($d['url'])) ? $d['url'] : $d;\r\n\t\tcurl_setopt($curly[$id], CURLOPT_URL, $url);\r\n\t\tcurl_setopt($curly[$id], CURLOPT_HEADER, 0);\r\n\t\tcurl_setopt($curly[$id], CURLOPT_RETURNTRANSFER, 1);\r\n\r\n\t\t// post?\r\n\t\tif (is_array($d)) {\r\n\t\t if (!empty($d['post'])) {\r\n\t\t\tcurl_setopt($curly[$id], CURLOPT_POST, 1);\r\n\t\t\tcurl_setopt($curly[$id], CURLOPT_POSTFIELDS, $d['post']);\r\n\t\t }\r\n\t\t}\r\n\r\n\t\t// extra options?\r\n\t\tif (!empty($options)) {\r\n\t\t curl_setopt_array($curly[$id], $options);\r\n\t\t}\r\n\r\n\t\tcurl_multi_add_handle($mh, $curly[$id]);\r\n\t }\r\n\r\n\t // execute the handles\r\n\t $running = null;\r\n\t do {\r\n\t\tcurl_multi_exec($mh, $running);\r\n\t } while($running > 0);\r\n\r\n\t // get content and remove handles\r\n\t foreach($curly as $id => $c) {\r\n\t\t$result[$id] = curl_multi_getcontent($c);\r\n\t\tcurl_multi_remove_handle($mh, $c);\r\n\t }\r\n\r\n\t // all done\r\n\t curl_multi_close($mh);\r\n\r\n\t return $result;\r\n\t}", "public function asyncSearch(Classes\\AsyncSearchRequest $arg) {\n\t\treturn $this->makeSoapCall(\"asyncSearch\", $arg);\n\t}", "public function bankAccountsV2PutAsync($bank, $bank_account_type, $bank_account_type_description, $bban, $iban, $name, $id, $is_active, $ledger_account_number, $has_active_bank_agreement, $is_default_cheque_account, $currency_code, $modified_utc, $bank_account_id)\n {\n return $this->bankAccountsV2PutAsyncWithHttpInfo($bank, $bank_account_type, $bank_account_type_description, $bban, $iban, $name, $id, $is_active, $ledger_account_number, $has_active_bank_agreement, $is_default_cheque_account, $currency_code, $modified_utc, $bank_account_id)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "function addFuture(Future $future)\n {\n $this->futures[$future->getFutureId()] = $future;\n return $this;\n }", "public function bankAccountsV2PostAsync($bank, $bank_account_type, $bank_account_type_description, $bban, $iban, $name, $id, $is_active, $ledger_account_number, $has_active_bank_agreement, $is_default_cheque_account, $currency_code, $modified_utc)\n {\n return $this->bankAccountsV2PostAsyncWithHttpInfo($bank, $bank_account_type, $bank_account_type_description, $bban, $iban, $name, $id, $is_active, $ledger_account_number, $has_active_bank_agreement, $is_default_cheque_account, $currency_code, $modified_utc)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function createMetaformAsync($realmId, $payload)\n {\n return $this->createMetaformAsyncWithHttpInfo($realmId, $payload)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new Google_Picasa_CreateAlbum_Execution($this->session, $this, $inputs, $async, $store_results);\n }", "public function tspAsync()\n {\n return $this->tspAsyncWithHttpInfo()\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function executeAsync(): BatchInterface;", "public function addInstallationAsync($body, $x_embarcadero_application_id = null, $x_embarcadero_app_secret = null, $x_embarcadero_master_secret = null)\n {\n return $this->addInstallationAsyncWithHttpInfo($body, $x_embarcadero_application_id, $x_embarcadero_app_secret, $x_embarcadero_master_secret)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function createOrganizationAsync($create_organization)\n {\n return $this->createOrganizationAsyncWithHttpInfo($create_organization)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new Google_OAuth_FinalizeOAuth_Execution($this->session, $this, $inputs, $async, $store_results);\n }", "public static function call($method, $params){\n\t\t$thread = new Async($method, $params);\n\t\tif($thread->start()){\n\t\t\treturn $thread;\n\t\t} /** else throw Nastyness **/\n\t}", "function async($thunk) {\n // By creating a socket pair, we have a channel of communication\n // between PHP processes\n socket_create_pair(AF_UNIX, SOCK_STREAM, 0, $sockets);\n\n list($parent, $child) = $sockets;\n\n if (($pid = pcntl_fork()) == 0) { // We're in the child process now\n socket_close($child);\n // Call the thunk, serialize the returned value, and send it\n // through the channel we created (ie. to the parent process)\n socket_write($parent, serialize(call_user_func($thunk)));\n socket_close($parent);\n\n exit; // We're done so we can exit here\n }\n\n socket_close($parent);\n\n return array($pid, $child); // This can treated as a \"thread handle\"\n}", "public function createOrganizationAsyncWithHttpInfo($create_organization)\n {\n $returnType = 'object';\n $request = $this->createOrganizationRequest($create_organization);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function getAsyncResult(Classes\\GetAsyncResultRequest $arg) {\n\t\treturn $this->makeSoapCall(\"getAsyncResult\", $arg);\n\t}", "public function createApplicationAsync($application_request)\n {\n return $this->createApplicationAsyncWithHttpInfo($application_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function createTokenAsync($token_request)\n {\n return $this->createTokenAsyncWithHttpInfo($token_request)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function listFeesAsync($created_time = null, $updated_time = null, $ending_before = null, $starting_after = null, $limit = null, $type = null, $sku_id = null, $category = null, $country = null, $ids = null)\n {\n return $this->listFeesAsyncWithHttpInfo($created_time, $updated_time, $ending_before, $starting_after, $limit, $type, $sku_id, $category, $country, $ids)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "static public function trigger () {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Promise.hx:289: characters 12-32\n\t\treturn new FutureTrigger();\n\t}", "public function asyncAddList(Classes\\AsyncAddListRequest $arg) {\n\t\treturn $this->makeSoapCall(\"asyncAddList\", $arg);\n\t}", "public function asyncMap(callable $callback): Collection;", "public function getProcess(): ?AsynchronousProcess;", "public function createContactAsync($create_contact_options, string $contentType = self::contentTypes['createContact'][0])\n {\n return $this->createContactAsyncWithHttpInfo($create_contact_options, $contentType)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function done(callable $callback): PromiseLike {\n $this->_done->add($callback);\n $this->callIf(\n $this->_state === self::STATE_RESOLVED,\n $callback,\n $this->_finishArguments\n );\n return $this;\n }", "public function createAsync(SslContact $body)\n {\n return $this->sendRequest(\n $this->domainrobotConfig->getUrl() . \"/sslcontact\",\n 'POST',\n [\"json\" => $body->toArray()]\n );\n }", "public function createCategoryAsync($category = null)\n {\n return $this->createCategoryAsyncWithHttpInfo($category)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function testSendMessageExceptionAsync()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_exception = new \\GuzzleHttp\\Exception\\RequestException(\n \"Error Communicating with Server\",\n new \\GuzzleHttp\\Psr7\\Request('POST', 'test')\n );\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([$expected_exception]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\MessageApi(\n $client,\n $config\n );\n $message = new \\Karix\\Model\\CreateMessage();\n\n $promise = $apiInstance->sendMessageAsync($message)->then(function ($result) {\n $this->fail(\"No exception when calling MessageApi->sendMessage with mocked exception\");\n }, function ($exception) use( &$expected_exception) {\n $this->assertEquals(\"[0] \".$expected_exception->getMessage(), $exception->getMessage());\n });\n $promise->wait();\n }", "public static function make(\\Closure $callback = null);", "public function createImageFrameAsync($request) \n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'POST');\n $options = $this->createHttpClientOptions();\n\n return $this->client\n ->sendAsync($request, $options)\n ->then(\n function ($response) use ($request, $hasReturnType, $returnType, $isBinary) {\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n },\n function ($exception) use ($request) {\n $this->processException($exception);\n }\n );\n }", "public function createQueryAsync($body = null, $fields = null)\n {\n return $this->createQueryAsyncWithHttpInfo($body, $fields)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function always(callable $callback): PromiseLike {\n $this->_done->add($callback);\n $this->_failed->add($callback);\n $this->callIf(\n $this->_state !== self::STATE_PENDING,\n $callback,\n $this->_finishArguments\n );\n return $this;\n }", "public function execute($clueName, $async = true) {\n if($async) {\n $url = escapeshellarg('https://' . $this->_host . '' . $this->_port . '/api/clue/' . $clueName . '&');\n shell_exec('php src/Clue/ClueCurler.php \"' . $url . '\" 2>/dev/null &');\n } else {\n $ch = curl_init();\n curl_setopt_array($ch, [\n CURLOPT_URL => \"https://\" . $this->_host . \"/api/clue/\" . $clueName,\n CURLOPT_RETURNTRANSFER => 0,\n CURLOPT_FAILONERROR => true,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_POST => true\n ]);\n curl_exec($ch);\n }\n }", "public function getInstallationAsync($id, $x_embarcadero_application_id = null, $x_embarcadero_app_secret = null, $x_embarcadero_master_secret = null)\n {\n return $this->getInstallationAsyncWithHttpInfo($id, $x_embarcadero_application_id, $x_embarcadero_app_secret, $x_embarcadero_master_secret)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function createStoreAsync($options)\n {\n return $this->createStoreAsyncWithHttpInfo($options)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function getOutboundSequencesAsync($pageSize = '25', $pageNumber = '1', $filterType = 'Prefix', $name = null, $sortBy = null, $sortOrder = 'ascending')\n {\n return $this->getOutboundSequencesAsyncWithHttpInfo($pageSize, $pageNumber, $filterType, $name, $sortBy, $sortOrder)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function isAsync($bool = null){\n if($bool === null)\n return $this->hasAttr(ATTR_ASYNC);\n else{\n if($bool)\n return $this->async('async');\n else\n return $this->rattr(ATTR_ASYNC);\n }\n }", "public function createFeesAsyncWithHttpInfo($fee_request = null)\n {\n $returnType = '\\DigitalRiver\\ApiSdk\\Model\\Fee';\n $request = $this->createFeesRequest($fee_request);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = (string) $responseBody;\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function createChannelAsyncWithHttpInfo($body = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\InlineResponse2012';\n $request = $this->createChannelRequest($body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function createEmailCampaignAsync($emailCampaigns)\n {\n return $this->createEmailCampaignAsyncWithHttpInfo($emailCampaigns)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function testAsynchronous()\n {\n $appUUID = AppUUID::createById('main');\n $indexUUID = IndexUUID::createById('default');\n $repositoryReference = RepositoryReference::create(\n $appUUID,\n $indexUUID\n );\n $token = new Token(TokenUUID::createById('9999'), $appUUID);\n $configuration = new Config();\n\n $configureIndex = new ConfigureIndex(\n $repositoryReference,\n $token,\n $indexUUID,\n $configuration\n );\n\n $builtConfigureIndex = ConfigureIndex::fromArray($configureIndex->toArray());\n $this->assertEquals(\n $configureIndex,\n $builtConfigureIndex\n );\n\n $this->assertEquals(\n $configuration,\n $builtConfigureIndex->getConfig()\n );\n\n $this->assertEquals(\n $repositoryReference,\n $builtConfigureIndex->getRepositoryReference()\n );\n\n $this->assertEquals(\n $token,\n $builtConfigureIndex->getToken()\n );\n }", "public function testGetMessageExceptionAsync()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_exception = new \\GuzzleHttp\\Exception\\RequestException(\n \"Error Communicating with Server\",\n new \\GuzzleHttp\\Psr7\\Request('GET', 'test')\n );\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([$expected_exception]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\MessageApi(\n $client,\n $config\n );\n $direction = \"direction_example\";\n $account_uid = \"account_uid_example\";\n $state = \"state_example\";\n $offset = 0;\n $limit = 10;\n\n $promise = $apiInstance->getMessageAsync($direction, $account_uid, $state, $offset, $limit)->then(function ($result) {\n $this->fail(\"No exception when calling MessageApi->getMessage with mocked exception\");\n }, function ($exception) use( &$expected_exception) {\n $this->assertEquals(\"[0] \".$expected_exception->getMessage(), $exception->getMessage());\n });\n $promise->wait();\n }", "public function testGetMessageAsync()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_code = 200;\n // Create a mock response\n $expected = new \\Karix\\Model\\MessageListResponse();\n // Create a mock handler\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([\n new \\GuzzleHttp\\Psr7\\Response($expected_code, [], $expected),\n ]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\MessageApi(\n $client,\n $config\n );\n $direction = \"direction_example\";\n $account_uid = \"account_uid_example\";\n $state = \"state_example\";\n $offset = 0;\n $limit = 10;\n\n $promise = $apiInstance->getMessageAsync($direction, $account_uid, $state, $offset, $limit)->then(function ($result) use( &$expected) {\n $this->assertEquals($expected, $result);\n }, function ($exception) {\n $this->fail(\"Exception when calling MessageApi->getMessage: \".$e->getMessage());\n });\n $promise->wait();\n }", "public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new Google_Calendar_CreateCalendar_Execution($this->session, $this, $inputs, $async, $store_results);\n }", "public static function fork($task)\n {\n $task = Gen::from($task);\n return new Syscall(function(Task $parent) use($task) {\n return new FutureTask($task, $parent);\n });\n }", "public function createOrganizationAdminAsyncWithHttpInfo($organization_id, $create_organization_admin)\n {\n $returnType = 'object';\n $request = $this->createOrganizationAdminRequest($organization_id, $create_organization_admin);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public static function buildAsync(\n $host,\n $port,\n $user,\n $pass,\n $queueName,\n QueueConsumer $consumer,\n $escapeMode = self::ESCAPE_MODE_SERIALIZE,\n $requeueOnFailure = true,\n LoggerInterface $logger = null,\n $stopOnFailure = false\n ) {\n return self::build(\n $host,\n $port,\n $user,\n $pass,\n $queueName,\n $consumer,\n false,\n $escapeMode,\n $requeueOnFailure,\n $stopOnFailure\n );\n }", "public function createFolderAsync($request) \n {\n $returnType = '';\n $isBinary = false;\n $hasReturnType = false;\n $request = $this->getHttpRequest($request, 'PUT');\n $options = $this->createHttpClientOptions();\n\n return $this->client\n ->sendAsync($request, $options)\n ->then(\n function ($response) use ($request, $hasReturnType, $returnType, $isBinary) {\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n },\n function ($exception) use ($request) {\n $this->processException($exception);\n }\n );\n }", "public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new LastFm_Artist_GetEvents_Execution($this->session, $this, $inputs, $async, $store_results);\n }", "public function createAssociationAsync($object_type, $association_definition_egg)\n {\n return $this->createAssociationAsyncWithHttpInfo($object_type, $association_definition_egg)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public static function make(Closure $callback)\n\t{\n\t\treturn new static($callback);\n\t}", "public function createServer(Websocket $websocket) : Promise\n {\n $socket = SocketServer::listen('tcp://127.0.0.1:0');\n $port = $socket->getAddress()->getPort();\n $server = new Server([$socket], $websocket, new NullLogger());\n return call(static function () use($server, $port) {\n (yield $server->start());\n return [$server, $port];\n });\n }", "public function async($on = true)\n {\n $this->requestAsync = $on;\n\n return $this;\n }", "function getNextFuture()\n {\n if (!(msg_receive($this->collectionQueueId, self::VALUE_READY, $msgType, self::SIZE, $futureId, true, 0, $error))) {\n return false;\n }\n $finishedFuture = $this->futures[$futureId];\n unset($this->futures[$futureId]);\n return $finishedFuture;;\n }", "public function callback(callable $callback)\n {\n return $this\n ->addCallback($callback)\n ->execute();\n }", "public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new LastFm_User_GetArtistTracks_Execution($this->session, $this, $inputs, $async, $store_results);\n }", "function await(PromiseInterface $promise, LoopInterface $loop, $timeout = null)\n{\n $wait = true;\n $resolved = null;\n $exception = null;\n $rejected = false;\n\n if ($timeout !== null) {\n $promise = Timer\\timeout($promise, $timeout, $loop);\n }\n\n $promise->then(\n function ($c) use (&$resolved, &$wait, $loop) {\n $resolved = $c;\n $wait = false;\n $loop->stop();\n },\n function ($error) use (&$exception, &$rejected, &$wait, $loop) {\n $exception = $error;\n $rejected = true;\n $wait = false;\n $loop->stop();\n }\n );\n\n while ($wait) {\n $loop->run();\n }\n\n if ($rejected) {\n if (!$exception instanceof \\Exception) {\n $exception = new \\UnexpectedValueException(\n 'Promise rejected with unexpected value of type ' . (is_object(($exception) ? get_class($exception) : gettype($exception))),\n 0,\n $exception instanceof \\Throwable ? $exception : null\n );\n }\n\n throw $exception;\n }\n\n return $resolved;\n}", "public function execute($inputs = array(), $async = false, $store_results = true)\n {\n return new LastFm_Artist_GetCorrection_Execution($this->session, $this, $inputs, $async, $store_results);\n }", "public function createScriptAsyncWithHttpInfo($script_body)\n {\n $returnType = '\\BigCommerce\\Api\\V3\\Model\\Swagger\\ScriptResponse';\n $request = $this->createScriptRequest($script_body);\n\n return $this->client\n ->sendAsync($request, $this->createHttpClientOption())\n ->then(\n function ($response) use ($returnType) {\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n },\n function ($exception) {\n $response = $exception->getResponse();\n $statusCode = $response->getStatusCode();\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $exception->getRequest()->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n );\n }", "public function getCreateCallable(): callable;" ]
[ "0.67485434", "0.6007624", "0.58094066", "0.57909596", "0.5514295", "0.52986526", "0.5222937", "0.5206424", "0.49322152", "0.4917685", "0.4896583", "0.48238853", "0.47998327", "0.4753771", "0.47355717", "0.47044033", "0.470207", "0.46716198", "0.4650543", "0.46186626", "0.46081784", "0.454056", "0.45113644", "0.45031926", "0.44805554", "0.44441876", "0.44286388", "0.43966505", "0.4392372", "0.43672267", "0.4319599", "0.43004128", "0.42536318", "0.42331964", "0.42330375", "0.422578", "0.42196476", "0.4213153", "0.42026556", "0.41796377", "0.417794", "0.41439816", "0.41244945", "0.4122722", "0.40894818", "0.40804347", "0.4078001", "0.40648165", "0.40598157", "0.4059402", "0.40412414", "0.40337926", "0.40300617", "0.40242067", "0.4018121", "0.4014295", "0.40127543", "0.40116224", "0.40063074", "0.39886573", "0.39852634", "0.39825946", "0.39806253", "0.39781561", "0.39612454", "0.3957334", "0.39288557", "0.39182085", "0.3900804", "0.38884625", "0.3884942", "0.38829002", "0.3880622", "0.3879482", "0.38681585", "0.3863663", "0.38579208", "0.38568673", "0.38538456", "0.38537976", "0.38460347", "0.3844079", "0.38384354", "0.38373134", "0.38300273", "0.38155046", "0.38124907", "0.3812373", "0.38014957", "0.37994885", "0.37992445", "0.37991908", "0.3796803", "0.3789324", "0.37863478", "0.37843573", "0.3784284", "0.37838256", "0.37822214", "0.37795678" ]
0.50385267
8
Flattens `Future>` into `Future`
public static function flatten ($f) { #/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:76: characters 5-31 return new NestedFuture($f); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function flatten ($f) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:71: characters 5-31\n\t\treturn new NestedFuture($f);\n\t}", "static public function ofMany ($futures, $gather = true) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:93: lines 93-108\n\t\tif ($gather === null) {\n\t\t\t$gather = true;\n\t\t}\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:94: characters 5-24\n\t\t$ret = new SyncFuture(new LazyConst(new \\Array_hx()));\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:95: lines 95-104\n\t\t$_g = 0;\n\t\twhile ($_g < $futures->length) {\n\t\t\tunset($f);\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:95: characters 10-11\n\t\t\t$f = ($futures->arr[$_g++] ?? null);\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:96: lines 96-104\n\t\t\t$ret = $ret->flatMap(function ($results) use (&$f) {\n\t\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:98: lines 98-102\n\t\t\t\treturn $f->map(function ($result) use (&$results) {\n\t\t\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:100: characters 15-46\n\t\t\t\t\treturn $results->concat(\\Array_hx::wrap([$result]));\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:106: lines 106-107\n\t\tif ($gather) {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:106: characters 19-31\n\t\t\treturn $ret->gather();\n\t\t} else {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:107: characters 12-15\n\t\t\treturn $ret;\n\t\t}\n\t}", "public static function await($promise = null, $unwrap = false);", "public function flatten(): Result\n {\n if ($this->isOk()) {\n return $this->value;\n }\n\n return $this;\n }", "function all(array $promises) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, $key, $promisor) {\n // If the promisor already failed don't bother\n if (empty($remaining)) {\n return;\n }\n\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n\n $results[$key] = $result;\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "function map(array $promises, callable $functor) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n $promise = ($resolvable instanceof Promise) ? $resolvable : new Success($resolvable);\n $promise->when(function($error, $result) use (&$remaining, &$results, $key, $promisor, $functor) {\n if (empty($remaining)) {\n // If the future already failed we don't bother.\n return;\n }\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n\n try {\n $results[$key] = $functor($result);\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n } catch (\\Exception $error) {\n $remaining = 0;\n $promisor->fail($error);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public function flatten() {}", "public function flatten() {}", "public function flatten();", "public function flatten();", "public function flatten();", "function any(array $promises) {\n if (empty($promises)) {\n return new Success([], []);\n }\n\n $results = [];\n $errors = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, &$errors, $key, $promisor) {\n if ($error) {\n $errors[$key] = $error;\n } else {\n $results[$key] = $result;\n }\n\n if (--$remaining === 0) {\n $promisor->succeed([$errors, $results]);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "static public function async ($f, $lazy = false) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:131: lines 131-138\n\t\tif ($lazy === null) {\n\t\t\t$lazy = false;\n\t\t}\n\t\tif ($lazy) {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:132: characters 7-32\n\t\t\treturn new LazyTrigger($f);\n\t\t} else {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:134: characters 7-26\n\t\t\t$op = new FutureTrigger();\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:136: characters 7-33\n\t\t\tCallback_Impl_::invoke($f, Boot::getInstanceClosure($op, 'trigger'));\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:137: characters 7-16\n\t\t\treturn $op;\n\t\t}\n\t}", "public static function async ($f, $lazy = false) {\n\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:136: lines 136-143\n\t\tif ($lazy === null) {\n\t\t\t$lazy = false;\n\t\t}\n\t\tif ($lazy) {\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:137: characters 7-32\n\t\t\treturn new LazyTrigger($f);\n\t\t} else {\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:139: characters 7-26\n\t\t\t$op = new FutureTrigger();\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:140: characters 7-41\n\t\t\t$wrapped = $f;\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:141: characters 7-33\n\t\t\tCallback_Impl_::invoke($wrapped, Boot::getInstanceClosure($op, 'trigger'));\n\t\t\t#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:142: characters 7-16\n\t\t\treturn $op;\n\t\t}\n\t}", "function filter(array $promises, callable $functor) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n $promise = ($resolvable instanceof Promise) ? $resolvable : new Success($resolvable);\n $promise->when(function($error, $result) use (&$remaining, &$results, $key, $promisor, $functor) {\n if (empty($remaining)) {\n // If the future result already failed we don't bother.\n return;\n }\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n try {\n if ($functor($result)) {\n $results[$key] = $result;\n }\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n } catch (\\Exception $error) {\n $promisor->fail($error);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "function async(\\Closure $closure, mixed ...$args): Future\n{\n static $run = null;\n\n $run ??= static function (FutureState $state, \\Closure $closure, array $args): void {\n $s = $state;\n $c = $closure;\n\n /* Null function arguments so an exception thrown from the closure does not contain the FutureState object\n * in the stack trace, which would create a circular reference, preventing immediate garbage collection */\n $state = $closure = null;\n\n try {\n // Clear $args to allow garbage collection of arguments during fiber execution\n $s->complete($c(...$args, ...($args = [])));\n } catch (\\Throwable $exception) {\n $s->error($exception);\n }\n };\n\n $state = new Internal\\FutureState;\n\n EventLoop::queue($run, $state, $closure, $args);\n\n return new Future($state);\n}", "public function flatMap(callable $fn);", "public function flatMap(callable $callback): self {\n\t\treturn $this->map($callback)->flatten();\n\t}", "function some(array $promises) {\n if (empty($promises)) {\n return new Failure(new \\LogicException(\n 'No promises or values provided for resolution'\n ));\n }\n\n $errors = [];\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, &$errors, $key, $promisor) {\n if ($error) {\n $errors[$key] = $error;\n } else {\n $results[$key] = $result;\n }\n\n if (--$remaining > 0) {\n return;\n } elseif (empty($results)) {\n $promisor->fail(new \\RuntimeException(\n 'All promises failed'\n ));\n } else {\n $promisor->succeed([$errors, $results]);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public function getFutureHandler(): FutureHandler;", "public function flatMap(Closure $doSomething): Result;", "function flatten($args){\n $res = array();\n foreach($args as $a) {\n if(is_array($a)) $res = array_merge($res, flatten($a));\n else $res[] = $a;\n }\n return $res;\n}", "public function asyncMap(callable $callback): Collection;", "static function chain($fs) { return self::make(function ($x) use($fs) { return array_reduce($fs, function ($x, $f) { return $f($x); }, $x); }); }", "function compose1(array $asyncFns, $k)\n{\n // for debug\n $asyncFns = array_map(__NAMESPACE__ . \"\\\\trace\", $asyncFns);\n\n return array_right_reduce($asyncFns, function($rightCarry, $leftFn) {\n return function($ctx) use($rightCarry, $leftFn) {\n $leftFn($ctx, $rightCarry);\n };\n }, $k);\n}", "public function flatten(): self {\n\t\t$generator = function (Stream $stream) {\n\t\t\tforeach ($stream as $traversable) {\n\t\t\t\tforeach ($traversable as $value) {\n\t\t\t\t\tyield $value;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($this));\n\t}", "public function flatMap(callable $callback)\n {\n return $this->map($callback)->collapse();\n }", "public function flatten()\n {\n $output = [];\n foreach (I($this->hash) as $value) {\n $array = __PRIVATE__::getArrayFrom($value);\n $output[] = $array !== null\n ? $array\n // Because of self::getArrayFrom, this will ALWAYS throw its error\n : __CONTRACT__::contentIsA(FoldableInterface::class, $value);\n }\n return static::from(call_user_func_array('array_merge', $output));\n }", "function first(array $promises) {\n if (empty($promises)) {\n return new Failure(new \\LogicException(\n 'No promises or values provided for resolution'\n ));\n }\n\n $remaining = count($promises);\n $isComplete = false;\n $promisor = new Future;\n\n foreach ($promises as $resolvable) {\n if (!$resolvable instanceof Promise) {\n $promisor->succeed($resolvable);\n break;\n }\n\n $promise->when(function($error, $result) use (&$remaining, &$isComplete, $promisor) {\n if ($isComplete) {\n // we don't care about Futures that resolve after the first\n return;\n } elseif ($error && --$remaining === 0) {\n $promisor->fail(new \\RuntimeException(\n 'All promises failed'\n ));\n } elseif (empty($error)) {\n $isComplete = true;\n $promisor->succeed($result);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public function flatten( $depth = INF )\n\t{\n\t\treturn $this->toBase()->flatten( $depth );\n\t}", "static public function asPromise ($s) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:88: characters 5-13\n\t\treturn $s;\n\t}", "public function convertTiffToFaxAsync($request) \n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'GET');\n $options = $this->createHttpClientOptions();\n\n return $this->client\n ->sendAsync($request, $options)\n ->then(\n function ($response) use ($request, $hasReturnType, $returnType, $isBinary) {\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n },\n function ($exception) use ($request) {\n $this->processException($exception);\n }\n );\n }", "function immediately(callable $func) {\n return getReactor()->immediately($func);\n}", "protected function buildTestFuture($test_assembly) {\n if ($this->getEnableCoverage() === false) {\n return parent::buildTestFuture($test_assembly);\n }\n\n // FIXME: Can't use TempFile here as xUnit doesn't like\n // UNIX-style full paths. It sees the leading / as the\n // start of an option flag, even when quoted.\n $xunit_temp = Filesystem::readRandomCharacters(10).'.results.xml';\n if (file_exists($xunit_temp)) {\n unlink($xunit_temp);\n }\n $cover_temp = new TempFile();\n $cover_temp->setPreserveFile(true);\n $xunit_cmd = $this->runtimeEngine;\n $xunit_args = null;\n if ($xunit_cmd === '') {\n $xunit_cmd = $this->testEngine;\n $xunit_args = csprintf(\n '%s /xml %s',\n $test_assembly,\n $xunit_temp);\n } else {\n $xunit_args = csprintf(\n '%s %s /xml %s',\n $this->testEngine,\n $test_assembly,\n $xunit_temp);\n }\n $assembly_dir = dirname($test_assembly);\n $assemblies_to_instrument = array();\n foreach (Filesystem::listDirectory($assembly_dir) as $file) {\n if (substr($file, -4) == '.dll' || substr($file, -4) == '.exe') {\n if ($this->assemblyShouldBeInstrumented($file)) {\n $assemblies_to_instrument[] = $assembly_dir.DIRECTORY_SEPARATOR.$file;\n }\n }\n }\n if (count($assemblies_to_instrument) === 0) {\n return parent::buildTestFuture($test_assembly);\n }\n $future = new ExecFuture(\n '%C -o %s -c %s -a %s -w %s %Ls',\n trim($this->runtimeEngine.' '.$this->coverEngine),\n $cover_temp,\n $xunit_cmd,\n $xunit_args,\n $assembly_dir,\n $assemblies_to_instrument);\n $future->setCWD(Filesystem::resolvePath($this->projectRoot));\n return array(\n $future,\n $assembly_dir.DIRECTORY_SEPARATOR.$xunit_temp,\n $cover_temp,\n );\n }", "function addFuture(Future $future)\n {\n $this->futures[$future->getFutureId()] = $future;\n return $this;\n }", "public function flatten() : Vector\n {\n return Vector::quick(array_merge(...$this->a));\n }", "public function flatMap($flatMapper);", "static public function flatMap ($this1, $next, $gather = true) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:45: lines 45-50\n\t\tif ($gather === null) {\n\t\t\t$gather = true;\n\t\t}\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:46: characters 5-34\n\t\t$ret = $this1->flatMap($next);\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:48: lines 48-49\n\t\tif ($gather) {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:48: characters 19-31\n\t\t\treturn $ret->gather();\n\t\t} else {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:49: characters 12-15\n\t\t\treturn $ret;\n\t\t}\n\t}", "public function flatten(int $depth = \\PHP_INT_MAX): self;", "public function promise(Promise $promise, $result = null);", "public function flatMap(callable $hof)\n {\n\n $output = [];\n foreach (I($this->hash) as $key => $value) {\n $intermediate = call_user_func($hof, $value, $key, $this);\n\n $array = __PRIVATE__::getArrayFrom($intermediate);\n $output[] = $array !== null\n ? $array\n // Because of self::getArrayFrom, this will ALWAYS throw its error\n : __CONTRACT__::returnIsA(FoldableInterface::class, $intermediate);\n }\n return static::from(call_user_func_array('array_merge', $output));\n }", "function getFutureList( &$pParamHash ) {\n\t\t$pParamHash['get_future'] = TRUE;\n\t\treturn( $this->getList( $pParamHash ));\n\t}", "private function fetch() {\n if ($this->curl instanceof MultiCurl) {\n $this->curl->complete(function($instance) {\n if ($instance->error) {\n $this->errors[] = [\n 'errorCode' => $instance->getErrorCode(),\n 'errorMessage' => $instance->getErrorMessage()\n ];\n } else {\n $this->headers[] = $instance->getResponseHeaders();\n $this->body[] = $instance->getResponse();\n }\n });\n } else {\n if ($this->curl->error) {\n $this->errors[] = [\n 'errorCode' => $this->curl->getErrorCode(),\n 'errorMessage' => $this->curl->getErrorMessage()\n ];\n } else {\n $this->headers = $this->curl->getResponseHeaders();\n $this->body = $this->curl->getResponse();\n }\n }\n\n return $this;\n }", "protected static function _flatten($results, $key = null)\n {\n $stack = [];\n foreach ($results as $k => $r) {\n $id = $k;\n if (!is_null($key)) {\n $id = $key;\n }\n if (is_array($r) && !empty($r)) {\n $stack = array_merge($stack, self::_flatten($r, $id));\n } else {\n $stack[] = ['id' => $id, 'value' => $r];\n }\n }\n return $stack;\n }", "public function transpose(): Option\n {\n return $this->mapOrElse(\n static fn (Option $option) => $option->mapOrElse(\n static fn ($value) => Option::some(Result::ok($value)),\n static fn () => Option::none(),\n ),\n fn () => Option::some($this),\n );\n }", "protected function _preFlatten() {}", "public function flatMap(callable $transformer)\n {\n return $this->transformAndConcat($transformer);\n }", "function async(callable $function)\n{\n // return a new promise\n return new Promise(function (callable $resolve, callable $reject, callable $progress) use ($function) {\n // get the generator\n $generator = $function();\n\n // function to step the generator to the next yield statement\n $step = function () use (&$step, $generator, $resolve, $reject, $progress) {\n $value = null;\n\n // try to execute the next block of code\n try {\n $value = $generator->current();\n } catch (\\Exception $exception) {\n // exception rejects the promise\n $reject($exception);\n\n return;\n }\n\n // if the generator is complete, resolve the promise\n if (!$generator->valid()) {\n $resolve($value);\n\n return;\n }\n\n // wrap the value in a promise if it isn't already one\n if (!($value instanceof PromiseInterface)) {\n $value = new FulfilledPromise($value);\n }\n\n // run the next step when the current one resolves\n $value->then(function ($value) use (&$step, $generator) {\n $generator->send($value);\n $step();\n }, function (\\Exception $reason) use ($generator) {\n $generator->throw($reason);\n });\n };\n\n // run the first step in the next tick\n DefaultLoop::instance()->nextTick($step);\n });\n}", "function fresh_all(callable $f) {\n $argCount = (new \\ReflectionFunction($f))->getNumberOfParameters();\n if ($argCount === 0) {\n return delay(function () use ($f) {\n return all($f());\n });\n }\n return call_fresh(function ($x) use ($f, $argCount) {\n return collect_args(\n function (/** ... */) use ($f) {\n return all(call_user_func_array($f, func_get_args()));\n },\n $argCount,\n [$x]\n );\n });\n}", "public static function flatten($collection)\n {\n $flat_collection = $collection instanceof Collection ? $collection->make() : new Collection();\n $collection = func_get_args(); // This can use ... instead of func_get_args() on PHP >= 5.6 http://php.net/manual/en/functions.arguments.php#functions.variable-arg-list\n array_walk_recursive($collection, function ($item, $key) use (&$flat_collection) {\n if ($item instanceof Arrayable) {\n $flat_collection = $flat_collection->merge(self::flatten($item->toArray()));\n } elseif (is_int($key)) {\n $flat_collection->push($item);\n } else {\n $flat_collection->put($key, $item);\n }\n });\n\n return $flat_collection;\n }", "public function atomic($f)\n {\n return $this->connection->atomic($f);\n }", "static public function trigger () {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Promise.hx:289: characters 12-32\n\t\treturn new FutureTrigger();\n\t}", "private function flatten_batches( $batches, $batch ) {\n\t\treturn array_merge(\n\t\t\t$batches,\n\t\t\tarray_reduce(\n\t\t\t\t$batch->data,\n\t\t\t\t'array_merge',\n\t\t\t\tarray()\n\t\t\t)\n\t\t);\n\t}", "protected function outCast(array $arryFetch): array\n {\n return array_map(\n function ($fetch) {\n return $this->outCastOne($fetch);\n },\n $arryFetch\n );\n }", "private function flatten(array $values)\n {\n $generator = static function ($values, &$output) use (&$generator) {\n foreach ($values as $value) {\n if (is_iterable($value)) {\n $generator($value, $output);\n continue;\n }\n $output[] = $value;\n }\n };\n $out = [];\n $generator($values, $out);\n\n return $out;\n }", "static public function sync ($v) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:123: characters 5-29\n\t\treturn new SyncFuture(new LazyConst($v));\n\t}", "public function flatten(){\n\t\t$this->content=$this->flatten_array_build(\"first\");\n\t\tforeach($this->content as $item){\n\t\t\tif(is_a($item,\"elem\")){\n\t\t\t\t$item->master=$this;\n\t\t\t\t$item->self_closing=true;\n\t\t\t\t$item->content=array();\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}", "protected function buildQueueCallable($callback)\n {\n if (! $callback instanceof Closure) {\n return $callback;\n }\n\n return (new Serializer)->serialize($callback);\n }", "public function promise(): ?PromiseInterface;", "function async($thunk) {\n // By creating a socket pair, we have a channel of communication\n // between PHP processes\n socket_create_pair(AF_UNIX, SOCK_STREAM, 0, $sockets);\n\n list($parent, $child) = $sockets;\n\n if (($pid = pcntl_fork()) == 0) { // We're in the child process now\n socket_close($child);\n // Call the thunk, serialize the returned value, and send it\n // through the channel we created (ie. to the parent process)\n socket_write($parent, serialize(call_user_func($thunk)));\n socket_close($parent);\n\n exit; // We're done so we can exit here\n }\n\n socket_close($parent);\n\n return array($pid, $child); // This can treated as a \"thread handle\"\n}", "public static function flatten($array)\n {\n $return = [];\n\n array_walk_recursive($array, function($x) use (&$return) { $return[] = $x; });\n\n return $return;\n }", "static function flatten(array $array) {\n $ret = [];\n\n array_walk_recursive($array, function ($i) use (&$ret) {\n $ret[] = $i;\n });\n\n return $ret;\n }", "private function flattenFilter($filter)\n {\n $ret = [];\n $filters = $filter['compositeFilter']['filters'];\n foreach ($filters as $fltr) {\n $type = array_keys($fltr)[0];\n if ($type === 'compositeFilter') {\n $ret = array_merge($ret, $this->flattenFilter($fltr));\n } else {\n $ret[] = $fltr;\n }\n }\n return $ret;\n }", "public static function flatten($array)\n {\n $return = [];\n\n array_walk_recursive($array, function ($x) use (&$return) {\n $return[] = $x;\n });\n\n return $return;\n }", "public function flatten($value)\n {\n }", "protected function flattenPackageInfo($info) {\n if (isset($info->error)) { return $info; }\n $results = [];\n if(!isset($info->versions)) { return $results; }\n $versions = $info->versions;\n\n foreach($versions as $version) {\n $result = $version;\n $result->name = $info->package;\n $result->displayName = $result->name . \"-\" . $result->version;\n $results[] = $result;\n }\n\n return $results;\n }", "public function flatten() {\n\t\t$this->_value = Hash::flatten($this->_value);\n\n\t\treturn $this;\n\t}", "function then($f){\n\t\t$this->pipe->push($f);\n\t\treturn $this;\n\t}", "public function asyncUpsertList(Classes\\AsyncUpsertListRequest $arg) {\n\t\treturn $this->makeSoapCall(\"asyncUpsertList\", $arg);\n\t}", "public function setHasAccessToAllFutureProjects(?bool $hasAccessToAllFutureProjects): self\n {\n $this->initialized['hasAccessToAllFutureProjects'] = true;\n $this->hasAccessToAllFutureProjects = $hasAccessToAllFutureProjects;\n\n return $this;\n }", "protected function buildQueueCallable($callback)\n {\n if (!$callback instanceof Closure) return $callback;\n\n return serialize(new SerializableClosure($callback));\n }", "public static function fix(callable $f)\n {\n return call_user_func(\n function (callable $x) use ($f) {\n return $f(\n function () use ($f, $x) {\n return call_user_func_array($x($x), func_get_args());\n }\n );\n },\n function (callable $x) use ($f) {\n return $f(\n function () use ($f, $x) {\n return call_user_func_array($x($x), func_get_args());\n }\n );\n }\n );\n }", "function flatten($array) {\n $result = array();\n foreach($array as $key => $subarray) {\n $result = array_merge($result, $subarray);\n }\n return $result;\n }", "public static function fork($task)\n {\n $task = Gen::from($task);\n return new Syscall(function(Task $parent) use($task) {\n return new FutureTask($task, $parent);\n });\n }", "public function ConcurrentRequestsUsingPromise()\n {\n CalcTime::start();\n\n $client = new Client(['base_uri' => 'https://www.yundun.com']);\n\n // Initiate each request but do not block\n $promises = [\n 'friendlink' => $client->getAsync('/api/V4/site.friendlink'),\n 'report' => $client->getAsync('/api/V4/site.today.report.allplat')\n ];\n\n // Wait on all of the requests to complete. Throws a ConnectException\n // if any of the requests fail\n try {\n $results = Promise\\unwrap($promises);\n echo $results['friendlink']->getBody();\n echo \"\\n\";\n echo $results['report']->getBody();\n } catch (\\Exception $e) {\n var_dump($e->getMessage());\n }\n\n // Wait for the requests to complete, even if some of them fail\n $results = Promise\\settle($promises)->wait();\n\n // You can access each result using the key provided to the unwrap\n // function.\n echo $results['friendlink']['value']->getHeader('Content-Length')[0];\n echo $results['report']['value']->getHeader('Content-Length')[0];\n\n CalcTime::end();\n CalcTime::echoUseTime(__FUNCTION__);\n }", "function array_flatten($array)\n {\n return Arr::flatten($array);\n }", "public function createFaxTiffAsync($request) \n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'POST');\n $options = $this->createHttpClientOptions();\n\n return $this->client\n ->sendAsync($request, $options)\n ->then(\n function ($response) use ($request, $hasReturnType, $returnType, $isBinary) {\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n },\n function ($exception) use ($request) {\n $this->processException($exception);\n }\n );\n }", "function flatten(array $list, array $flat = []): array\n{\n if (empty($list)) {\n return $flat;\n }\n\n list($head, $tail) = [$list[0], array_slice($list, 1)];\n\n return flatten($tail, is_array($head) ? flatten($head, $flat) : array_merge($flat, [$head]));\n}", "private function array_flatten(array $a) {\r\n $ab = [];\r\n\r\n if (!is_array($a)) return [];\r\n\r\n foreach ($a as $value) {\r\n if (is_array($value)) {\r\n $ab = array_merge($ab, $this->array_flatten($value));\r\n } else {\r\n array_push($ab, $value);\r\n }\r\n }\r\n\r\n return $ab;\r\n }", "public function requestMultiple($requests)\n {\n $promises = array_map(function ($request) {\n \treturn $this->httpClient->sendAsync($request);\n\t\t}, $requests);\n\n $responses = Promise\\unwrap($promises);\n\n return $responses;\n }", "function array_flatten($array)\n\t{\n\t\t$return = array();\n\n\t\tarray_walk_recursive($array, function($x) use (&$return) { $return[] = $x; });\n\n\t\treturn $return;\n\t}", "function fresh(callable $f) {\n $argCount = (new \\ReflectionFunction($f))->getNumberOfParameters();\n if ($argCount === 0) {\n return delay($f);\n }\n return call_fresh(function ($x) use ($f, $argCount) {\n return collect_args($f, $argCount, [$x]);\n });\n}", "public function toUnbuffered(): IResultAdapter;", "public function flatten() \n\t{\n\t\treturn new static( Ar::flatten($this->attributes) );\n\t}", "function cps_changeset_unpublish_changeset_form_submit($form, &$form_state) {\n // We have to tell batch where to include this file.\n $batch = array(\n 'operations' => array(\n array('cps_changeset_publish_batch_lock', array()),\n array('cps_changeset_unpublish_batch_variables', array($form_state['entity'], $form_state['previous'])),\n array('cps_changeset_unpublish_batch_entity', array()),\n ),\n 'finished' => 'cps_changeset_unpublish_batch_finished',\n 'title' => t('Reverting %changeset', array('%changeset' => $form_state['entity']->name)),\n 'file' => drupal_get_path('module', 'cps') . '/includes/forms.inc',\n );\n\n drupal_alter('cps_unpublish_changeset_batch', $batch, $form_state);\n\n batch_set($batch);\n\n $form_state['redirect'] = $form_state['entity']->uri();\n}", "public function flatten($field = null) {}", "public function unwrapOrElse(callable $f): mixed\n {\n if ($this->isOk()) {\n return $this->value;\n }\n\n return call_user_func($f, $this->error);\n }", "protected function flattenResponse(ResourceResponseInterface $response) {\n $final_response = ($response instanceof CacheableResponseInterface) ? new CacheableResponse() : new Response();\n $final_response->setContent($response->getContent());\n $final_response->setStatusCode($response->getStatusCode());\n $final_response->setProtocolVersion($response->getProtocolVersion());\n if ($response->getCharset()) {\n $final_response->setCharset($response->getCharset());\n }\n $final_response->headers = clone $response->headers;\n if ($final_response instanceof CacheableResponseInterface) {\n $final_response->addCacheableDependency($response->getCacheableMetadata());\n }\n return $final_response;\n }", "private function flatten($array)\n {\n $flattened = [];\n\n foreach ($array as $collection => $entries) {\n foreach ($entries as $uuid => $entry) {\n $flattened[$uuid] = $entry;\n }\n }\n\n return $flattened;\n }", "public function executeAsync(): BatchInterface;", "public function flatten(): vector {\n $vr = vector::factory($this->row * $this->col, $this->dtype);\n for ($i = 0; $i < $this->row; ++$i) {\n for ($j = 0; $j < $this->col; ++$j) {\n $vr->data[$i * $this->col + $j] = $this->data[$i * $this->col + $j];\n }\n }\n return $vr;\n }", "function array_flatten($array): array\n{\n return array_reduce(\n $array,\n function ($acc, $item) {\n if (is_array($item) || $item instanceof Traversable) {\n return array_merge($acc, array_flatten($item));\n } else {\n $acc[] = $item;\n\n return $acc;\n }\n },\n []\n );\n}", "public function modifyEmfAsync($request) \n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'GET');\n $options = $this->createHttpClientOptions();\n\n return $this->client\n ->sendAsync($request, $options)\n ->then(\n function ($response) use ($request, $hasReturnType, $returnType, $isBinary) {\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n },\n function ($exception) use ($request) {\n $this->processException($exception);\n }\n );\n }", "public function transpose(): Stream {\n\t\t$streams = $this->map(function (iterable $iterable) {\n\t\t\treturn Stream::of($iterable);\n\t\t})\n\t\t\t->collect();\n\t\tif (count($streams) == 0) {\n\t\t\treturn new self(new \\ArrayIterator([]));\n\t\t}\n\n\t\t$generator = function (\\Iterator ...$streams): \\Generator {\n\t\t\tforeach ($streams as $stream) {\n\t\t\t\t$stream->rewind();\n\t\t\t}\n\t\t\t$all_are_valid = function (\\Iterator ...$streams) {\n\t\t\t\tforeach ($streams as $stream) {\n\t\t\t\t\tif (!$stream->valid()) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\twhile ($all_are_valid(...$streams)) {\n\t\t\t\t$ziped_element = [];\n\t\t\t\tforeach ($streams as $stream) {\n\t\t\t\t\t$ziped_element[] = $stream->current();\n\t\t\t\t\t$stream->next();\n\t\t\t\t}\n\t\t\t\tyield $ziped_element;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator(...$streams));\n\t}", "public function write(AsyncMessage $message): ExtendedPromiseInterface;", "public static function flatten($array, $depth = INF)\n {\n $result = [];\n\n foreach ($array as $item) {\n $item = $item instanceof Collection ? $item->all() : $item;\n\n if (! is_array($item)) {\n $result[] = $item;\n } elseif ($depth === 1) {\n $result = array_merge($result, array_values($item));\n } else {\n $result = array_merge($result, static::flatten($item, $depth - 1));\n }\n }\n\n return $result;\n }", "public function chain()\n {\n $response = SubstrateBase::APIHandler('system_'.__FUNCTION__);\n $this->_chain = $response['result'];\n return response()->json($this->_chain);\n }", "function array_flatten($array, $depth = INF)\n {\n return Arr::flatten($array, $depth);\n }", "public static function try(callable $f): Result\n {\n try {\n return self::ok($f());\n } catch (\\Throwable $th) {\n return self::error($th);\n }\n }", "public function callBatch($requests)\n {\n return $this->rawcall(json_encode($requests));\n }" ]
[ "0.65526605", "0.47828382", "0.4586958", "0.45754296", "0.45375106", "0.44992465", "0.43423042", "0.43423042", "0.4330191", "0.4330191", "0.4330191", "0.43190578", "0.43002105", "0.42518944", "0.4193827", "0.40919286", "0.40881062", "0.40716207", "0.40613842", "0.40016177", "0.40001395", "0.393807", "0.39255837", "0.39248896", "0.39163584", "0.38602296", "0.3858961", "0.38442096", "0.38087443", "0.3796322", "0.3794826", "0.3758833", "0.3756675", "0.37316218", "0.3729742", "0.37059036", "0.36749223", "0.36658713", "0.36639318", "0.3653878", "0.36366403", "0.35871938", "0.35573623", "0.35505375", "0.3542994", "0.3539331", "0.35351458", "0.3529322", "0.35208163", "0.351935", "0.35079414", "0.3487315", "0.34740397", "0.3473554", "0.34662497", "0.34591967", "0.34536856", "0.34454858", "0.3436131", "0.34319866", "0.34317988", "0.34303713", "0.3424758", "0.34141886", "0.33857206", "0.337452", "0.3373943", "0.33709714", "0.33507654", "0.33499503", "0.33343947", "0.3333214", "0.33316973", "0.3330068", "0.3321488", "0.32962668", "0.32937106", "0.3285042", "0.32826838", "0.32732147", "0.326659", "0.32623357", "0.32606357", "0.3254285", "0.32468855", "0.32442084", "0.32360885", "0.32268935", "0.3223062", "0.32089645", "0.32079557", "0.32056996", "0.31963304", "0.31945267", "0.31812063", "0.3181108", "0.31787035", "0.31714863", "0.3170996", "0.31694654" ]
0.65837544
0
Like `map` and `flatMap` but with a polymorphic transformer and return a `Promise`
public static function next ($this1, $n) { #/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:62: characters 5-50 return $this1->flatMap(function ($v) use (&$n) { #/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:62: characters 38-49 return $n($v); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function flatMap(Closure $doSomething): Result;", "function map(array $promises, callable $functor) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n $promise = ($resolvable instanceof Promise) ? $resolvable : new Success($resolvable);\n $promise->when(function($error, $result) use (&$remaining, &$results, $key, $promisor, $functor) {\n if (empty($remaining)) {\n // If the future already failed we don't bother.\n return;\n }\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n\n try {\n $results[$key] = $functor($result);\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n } catch (\\Exception $error) {\n $remaining = 0;\n $promisor->fail($error);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public function asyncMap(callable $callback): Collection;", "public function map(Closure $mutate): Result;", "public function flatMap(callable $transformer)\n {\n return $this->transformAndConcat($transformer);\n }", "public function flatMap(callable $fn);", "abstract public function map(callable $func);", "function map(callable $transform): callable\n{\n return function ($step) use ($transform) {\n return function ($acc, $val, $idx) use (\n $step,\n $transform\n ) {\n return $step($acc, $transform($val), $idx);\n };\n };\n}", "public function map(Closure $func): ReadableCollection;", "abstract public function transform();", "static public function flatMap ($this1, $next, $gather = true) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:45: lines 45-50\n\t\tif ($gather === null) {\n\t\t\t$gather = true;\n\t\t}\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:46: characters 5-34\n\t\t$ret = $this1->flatMap($next);\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:48: lines 48-49\n\t\tif ($gather) {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:48: characters 19-31\n\t\t\treturn $ret->gather();\n\t\t} else {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:49: characters 12-15\n\t\t\treturn $ret;\n\t\t}\n\t}", "public function transform(callable $transformer)\n {\n return self::from(Iterables::transform($this, $transformer));\n }", "public function flatMap($flatMapper);", "public function map(callable $callback): Sequence;", "function map(callable $function, iterable $items) : iterable\n{\n return _arrayOrIterator($items, function($items) use($function) {\n foreach ($items as $key => $value) {\n yield $key => $function($value, $key);\n }\n });\n}", "public abstract function map(callable|UnaryFunction|string|MapOperator $mapper): Stream;", "function map(array $array, callable|string|array $func, bool $recursive = false, bool $use_keys = false, bool $keep_keys = true): array\n{\n return Arrays::map($array, $func, $recursive, $use_keys, $keep_keys);\n}", "public function transform()\n {\n $object = $this->resource;\n\n $data = $object instanceof Collection || $object instanceof AbstractPaginator\n ? $object->map([$this, 'transformResource'])->toArray()\n : $this->transformResource($object);\n\n if ($object instanceof AbstractPaginator) {\n $this->withMeta(array_merge(\n $this->getExtra('meta', []), Arr::except($object->toArray(), ['data'])\n ));\n }\n\n $data = array_filter(compact('data') + $this->extras);\n ksort($data);\n\n return $data;\n }", "protected abstract function map();", "function getResultMappers(\\Auryn\\Injector $injector)\n{\n $twigResponseMapperFn = function (\n \\SlimAuryn\\Response\\TwigResponse $twigResponse,\n ResponseInterface $originalResponse\n ) use ($injector) {\n\n $twigResponseMapper = $injector->make(\\SlimAuryn\\ResponseMapper\\TwigResponseMapper::class);\n\n return $twigResponseMapper($twigResponse, $originalResponse);\n };\n\n $markdownResponseMapperFn = function (\n \\ASVoting\\Response\\MarkdownResponse $markdownResponse,\n ResponseInterface $originalResponse\n ) use ($injector) {\n $markdownResponseMapper = $injector->make(\\ASVoting\\Service\\MarkdownResponseMapper::class);\n\n return $markdownResponseMapper($markdownResponse, $originalResponse);\n };\n\n return [\n \\SlimAuryn\\Response\\StubResponse::class => '\\SlimAuryn\\ResponseMapper\\ResponseMapper::mapStubResponseToPsr7',\n// \\ASVoting\\Response\\MarkdownResponse::class => $markdownResponseMapperFn,\n ResponseInterface::class => 'SlimAuryn\\ResponseMapper\\ResponseMapper::passThroughResponse',\n 'string' => 'convertStringToHtmlResponse',\n \\SlimAuryn\\Response\\TwigResponse::class => $twigResponseMapperFn\n ];\n}", "public function transform(Closure $func): static;", "public function map(Callable $func) {\n $result = [];\n\n foreach ($this->list as $item) {\n $result[] = $func($item);\n }\n\n return $result;\n }", "abstract public function map($data);", "abstract public function transform(array $item);", "public function flatMap(callable $callback): self {\n\t\treturn $this->map($callback)->flatten();\n\t}", "public function resolve(): \\Generator\n {\n foreach ( $this->method->getParameters() as $current ) {\n yield $this->servant->resolve($current);\n }\n }", "public static function transformer();", "public function flatMap(callable $hof)\n {\n\n $output = [];\n foreach (I($this->hash) as $key => $value) {\n $intermediate = call_user_func($hof, $value, $key, $this);\n\n $array = __PRIVATE__::getArrayFrom($intermediate);\n $output[] = $array !== null\n ? $array\n // Because of self::getArrayFrom, this will ALWAYS throw its error\n : __CONTRACT__::returnIsA(FoldableInterface::class, $intermediate);\n }\n return static::from(call_user_func_array('array_merge', $output));\n }", "public function mapSpread(callable $callback)\n {\n return $this->map(function ($chunk) use ($callback) {\n return $callback(...$chunk);\n });\n }", "function transformManyDocs($docs)\n{\n $proc = createInkyProcessor();\n foreach ($docs as $k => $doc) {\n yield $k => transformWithProcessor($proc, $doc);\n }\n}", "public function map(iterable $params = []): array;", "public function map(Closure $function): array;", "public function transform(Type $type)\n {\n $data = $this->data($type, $this->getReturnData());\n return $data;\n }", "public function transformCollection(array $items){\n return array_map([$this,'transform'], $items->toArray());\n }", "public function asTraversable();", "public function map(array $chunks) : ?string;", "private function doTransform($data, callable $func = null)\n {\n if (null === $func || null === $data) {\n return $data;\n }\n\n if (!is_array($data)) {\n $data = [$data];\n }\n\n return call_user_func_array($func, $data);\n }", "public function streamAll(): Generator;", "public static function mapFromResult(array $data): array\n {\n return $data;\n }", "function _arrayOrIterator(iterable $base, callable $generator) : iterable\n{\n $result = $generator($base);\n return is_array($base) ? iterator_to_array($result) : $result;\n}", "public static function decodePromise(PromiseInterface $promise, $type = null): PromiseInterface\n {\n return $promise->then(\n function ($value) use ($type) {\n if (!$value instanceof ValuesInterface || $value instanceof \\Throwable) {\n return $value;\n }\n\n return $value->getValue(0, $type);\n }\n );\n }", "function some(array $promises) {\n if (empty($promises)) {\n return new Failure(new \\LogicException(\n 'No promises or values provided for resolution'\n ));\n }\n\n $errors = [];\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, &$errors, $key, $promisor) {\n if ($error) {\n $errors[$key] = $error;\n } else {\n $results[$key] = $result;\n }\n\n if (--$remaining > 0) {\n return;\n } elseif (empty($results)) {\n $promisor->fail(new \\RuntimeException(\n 'All promises failed'\n ));\n } else {\n $promisor->succeed([$errors, $results]);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public function pipeAndReturnSelf(callable $callback): CollectionInterface;", "function map(callable $fn, iterable $coll): array\n{\n try {\n return ___map_indexed($fn, $coll);\n } catch (ArgumentCountError $error) {\n return array_map($fn, to_array($coll));\n }\n}", "public function transformCollection(array $items)\n {\n return array_map([$this, 'transform'], $items);\n }", "function all(array $promises) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, $key, $promisor) {\n // If the promisor already failed don't bother\n if (empty($remaining)) {\n return;\n }\n\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n\n $results[$key] = $result;\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public function resolve()\n {\n $source = $this->getSource();\n\n yield [$source, $this->getTarget(), $this->determineKeys($source)];\n }", "function transformManyStrings($xmls)\n{\n $proc = createInkyProcessor();\n foreach ($xmls as $k => $xml) {\n yield $k => transformWithProcessor($proc, loadTemplateString($xml));\n }\n}", "public function map(callable $forItem) : array {\n $list = [];\n foreach($this as $i) {\n $list[] = $forItem($i);\n }\n return $list;\n }", "public function flatMap(callable $callback)\n {\n return $this->map($callback)->collapse();\n }", "public function transform(callable $transformer, bool $bind_callback_to_this=true): CollectionInterface;", "function transformManyFiles($files)\n{\n $proc = createInkyProcessor();\n foreach ($files as $k => $file) {\n yield $k => transformWithProcessor($proc, loadTemplateFile($file));\n }\n}", "public static function when(...$arguments): PromiseLike {\n $counter = count($arguments);\n if ($counter === 1) {\n $argument = $arguments[0];\n if ($argument instanceOf self) {\n return $argument->promise();\n }\n if ($argument instanceOf PromiseLike) {\n return $argument;\n }\n $defer = new Deferred();\n $defer->resolve($argument);\n return $defer->promise();\n }\n if ($counter > 0) {\n $master = new Deferred();\n $resolveArguments = [];\n foreach ($arguments as $index => $argument) {\n if ($argument instanceOf PromiseLike) {\n $argument\n ->done(\n static function (...$arguments) use ($master, $index, &$counter, &$resolveArguments) {\n $resolveArguments[$index] = $arguments;\n if (--$counter === 0) {\n ksort($resolveArguments);\n $master->resolve(...$resolveArguments);\n }\n }\n )\n ->fail(\n static function (...$arguments) use ($master) {\n $master->reject(...$arguments);\n }\n );\n } else {\n $resolveArguments[$index] = [$argument];\n if (--$counter === 0) {\n ksort($resolveArguments);\n $master->resolve(...$resolveArguments);\n }\n }\n }\n return $master->promise();\n }\n $defer = new Deferred();\n $defer->resolve();\n return $defer->promise();\n }", "public function transform()\n {\n $post = $this->post; //short alias\n\n $post->load('author', 'comments.user');\n\n $comments = (new CommentCollectionTransformer($post->comments()->limit(self::COMMENT_LIMIT)->get()))->transform();\n\n $post = (new PostTransformer($post))->transform();\n\n return [\n 'data' => array_merge($post, ['comments' => $comments]),\n ];\n }", "public function collect(): Observable;", "public function process(): \\Generator;", "public function promise(): ?PromiseInterface;", "function map(\\Closure $f) {\r\n return new self(\r\n $this->array_flatten(\r\n array_map(\r\n function($i) { return ($i instanceof self ? $i->value() : $i); },\r\n array_map($f, $this->list))));\r\n }", "public function map(callable $c);", "public function transform($transformer);", "function async(callable $function)\n{\n // return a new promise\n return new Promise(function (callable $resolve, callable $reject, callable $progress) use ($function) {\n // get the generator\n $generator = $function();\n\n // function to step the generator to the next yield statement\n $step = function () use (&$step, $generator, $resolve, $reject, $progress) {\n $value = null;\n\n // try to execute the next block of code\n try {\n $value = $generator->current();\n } catch (\\Exception $exception) {\n // exception rejects the promise\n $reject($exception);\n\n return;\n }\n\n // if the generator is complete, resolve the promise\n if (!$generator->valid()) {\n $resolve($value);\n\n return;\n }\n\n // wrap the value in a promise if it isn't already one\n if (!($value instanceof PromiseInterface)) {\n $value = new FulfilledPromise($value);\n }\n\n // run the next step when the current one resolves\n $value->then(function ($value) use (&$step, $generator) {\n $generator->send($value);\n $step();\n }, function (\\Exception $reason) use ($generator) {\n $generator->throw($reason);\n });\n };\n\n // run the first step in the next tick\n DefaultLoop::instance()->nextTick($step);\n });\n}", "public function flatMap(callable $callback): Set;", "abstract public function transform(Row $row);", "public function transformCollection(array $items)\n {\n return array_map([$this, 'transform'], $items);\n }", "public function resolve(): array\n {\n $relation = [$this->relationName => $this->decorateBuilder];\n\n return RelationFetcher\n ::countedParentModels($this->keys, $relation)\n ->all();\n }", "public function transform($data)\n {\n if (empty($data)) return [];\n\n\n // TODO(16 des 2016) ~ Helge: Write different transformers based on the company type and select the transfomer with a StrategyFactory or switch case.\n $transformer = new BrregCompanyDataTransformer();\n $resource = is_array($data)\n ? new Collection($data, $transformer)\n : new Item($data, $transformer);\n\n\n return $this->fractal\n ->createData($resource)\n ->toArray();\n }", "public function map(callable $callback)\n {\n return $this->toBase()->map($callback);\n }", "public function thenReturn()\r\n {\r\n return $this->then(function ($passable) {\r\n return $passable;\r\n });\r\n }", "public function transformAndConcat(callable $transformer)\n {\n return self::from(Iterables::concatIterables($this->transform($transformer)));\n }", "static function chain($fs) { return self::make(function ($x) use($fs) { return array_reduce($fs, function ($x, $f) { return $f($x); }, $x); }); }", "public function map($input, $as, $in): static;", "public function resolve(array|object $data = []): array\n\t{\n\t\treturn A::map(\n\t\t\t$this->data,\n\t\t\tfn ($argument) => $argument->resolve($data)\n\t\t);\n\t}", "abstract protected function transformItem($item);", "public function flatMap(callable $mapper): self\n {\n if (! is_null($this->value)) {\n $mapperClass = new class {\n public function flatMap(callable $mapper, $value): Optional\n {\n return $mapper($value);\n }\n };\n return $mapperClass->flatMap($mapper, $this->value);\n }\n return self::empty();\n }", "public function hydrate(): Collection\n\t{\n\t\t$className = get_class($this->model);\n\n\t\treturn $this->getRaw()->map(fn ($row) => (new $className())->forceFill($row));\n\t}", "function filter(array $promises, callable $functor) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n $promise = ($resolvable instanceof Promise) ? $resolvable : new Success($resolvable);\n $promise->when(function($error, $result) use (&$remaining, &$results, $key, $promisor, $functor) {\n if (empty($remaining)) {\n // If the future result already failed we don't bother.\n return;\n }\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n try {\n if ($functor($result)) {\n $results[$key] = $result;\n }\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n } catch (\\Exception $error) {\n $promisor->fail($error);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public function resolveTransformedValue($value)\n {\n return transform($value, $this->transformCallback ?? function ($value) {\n return $value;\n });\n }", "protected static function mapStream($things, $callback)\n {\n $children = [];\n\n foreach ($things as $key => $value) {\n $info = self::fork();\n if ($info['parent']) {\n $children[$key] = $info;\n } else {\n $callback($key, $value, $info['stream']);\n fclose($info['stream']);\n exit;\n }\n }\n\n return self::getChildrenOutput($children);\n }", "public function map(callable $callback);", "public function map(callable $callback);", "public function map(callable $fn);", "public function map(callable $callback) {\n return $this->requestModels->map($callback);\n }", "abstract public function resolve();", "public function tap(callable $callback): CollectionInterface;", "public function map(\\Closure $callback);", "function pipe(mixed $passable, array $pipes, callable $destination = null): mixed\n {\n $destination ??= static function (mixed $result): mixed {\n return $result;\n };\n\n return app(Pipeline::class)->send($passable)->through($pipes)->then($destination);\n }", "public function flatMap(callable $callback): NonEmptyMap;", "abstract public function transformResource($resource);", "public function map(callable $mapper)\n {\n return $this->transform($mapper);\n }", "private function handleAsyncRaw(\n Request $request,\n int $type = self::MASTER_REQUEST\n ): PromiseInterface {\n $dispatcher = $this->dispatcher;\n\n $this->requestStack->push($request);\n $event = new GetResponseEvent($this, $request, $type);\n\n return $dispatcher\n ->asyncDispatch(KernelEvents::REQUEST, $event)\n ->then(function (GetResponseEvent $event) use ($request, $type) {\n return $event->hasResponse()\n ? $this->filterResponsePromise(\n $event->getResponse(),\n $request,\n $type\n )\n : $this->callAsyncController($request, $type);\n });\n }", "public function map($items, $func) {\n \t$results = [];\n\n \tforeach ($items as $item) {\n \t\t$results[] = $func($item);\n \t}\n \treturn $results;\n }", "public function resolveTransformer()\n {\n if (\\is_string($this->resolver)) {\n return $this->container->make($this->resolver);\n } elseif (\\is_callable($this->resolver)) {\n return \\call_user_func($this->resolver, $this->container);\n } elseif (\\is_object($this->resolver)) {\n return $this->resolver;\n }\n\n throw new RuntimeException('Unable to resolve transformer binding.');\n }", "public function map(callable $callback) : self\n {\n $b = [];\n\n foreach ($this->a as $rowA) {\n $b[] = array_map($callback, $rowA);\n }\n\n return self::quick($b);\n }", "public function __construct( $input ) {\n $this->mParcelableTypes = array(\n 'boolean' => new BooleanTransformer(),\n 'Boolean' => new BooleanTransformerSafe(),\n 'byte' => new IntegratedTransformer( 'Byte' ),\n 'double' => new IntegratedTransformer( 'Double' ),\n 'float' => new IntegratedTransformer( 'Float' ),\n 'int' => new IntegratedTransformer( 'Int' ),\n 'long' => new IntegratedTransformer( 'Long' ),\n 'Byte' => new IntegratedTransformerSafe( 'Byte' ),\n 'Double' => new IntegratedTransformerSafe( 'Double' ),\n 'Float' => new IntegratedTransformerSafe( 'Float' ),\n 'Integer' => new IntegratedTransformerSafe( 'Int' ),\n 'Long' => new IntegratedTransformerSafe( 'Long' ),\n 'String' => new IntegratedTransformer( 'String' ),\n 'Bundle' => new IntegratedTransformer( 'Bundle' ),\n 'Date' => new DateTransformer(),\n 'List' => new ListTransformer( 'ArrayList' ),\n 'AbstractList' => new ListTransformer( 'LinkedList' ),\n 'AbstractSequentialList' => new ListTransformer( 'ArrayList' ),\n 'ArrayList' => new ListTransformer( 'ArrayList' ),\n 'AttributeList' => new ListTransformer( 'AttributeList' ),\n 'CopyOnWriteArrayList' => new ListTransformer( 'CopyOnWriteArrayList' ),\n 'LinkedList' => new ListTransformer( 'LinkedList' ),\n 'RoleList' => new ListTransformer( 'RoleList' ),\n 'RoleUnresolvedList' => new ListTransformer( 'RoleUnresolvedList' ),\n 'Stack' => new ListTransformer( 'Stack' ),\n 'Vector' => new ListTransformer( 'Vector' ),\n 'JSONObject' => new JSONTransformer( 'Object' ),\n 'JSONArray' => new JSONTransformer( 'Array' ),\n );\n\n // These are some of the most widespread types that cannot be written to Parcel \n $this->mUnsupportedTypes = array(\n 'File',\n 'Map',\n 'Runnable',\n 'Thread',\n 'Handler',\n 'AsyncTask' \n );\n\n $this->parse( $input );\n }", "public function __invoke($data) {\n return $this->transform($data);\n }", "public function transformCollection(?Collection $items, string $type = 'simple'): array;", "function getPerson($input) {\n // TODO: fill in the business logic\n // NOTE: $input is of type getPerson\n // NOTE: should return an object of type getPersonResponse\n\n $ppl = new Person();\n $ppl->age = 3;\n $bin1 = new base64Binary();\n $bin1->contentType = \"image/jpeg\";\n $bin1->value = \"xxxxx\";\n\n $bin2 = new base64Binary();\n $bin2->contentType = \"image/jpeg\";\n $bin2->value = \"yyyy\";\n $ppl->images = array($bin1, $bin2);\n $ppl->someInts = array(5, 6);\n $ppl->name = \"test\";\n $ppl->someStrings = array(\"test1\", \"test2\");\n\n $ret = new getPersonResponse();\n $ret->return = $ppl;\n\n return $ret;\n}", "public function read() {\n if( $this->data->isEmpty() ) {\n $deferred = new \\React\\Promise\\Deferred();\n $promise = $deferred->promise();\n $this->reads->enqueue($deferred);\n return $promise;\n } else {\n return \\React\\Promise\\resolve($this->data->dequeue());\n }\n }", "public function process() : array\n {\n $results = [];\n\n foreach ($this->queue as [$task, $after, $context]) {\n $result = $task();\n\n if ($after) {\n $after($result, $context);\n }\n\n $results[] = $result;\n }\n\n $this->queue = [];\n\n return $results;\n }", "static public function map ($this1, $f, $gather = true) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:34: lines 34-39\n\t\tif ($gather === null) {\n\t\t\t$gather = true;\n\t\t}\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:35: characters 5-27\n\t\t$ret = $this1->map($f);\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:37: lines 37-38\n\t\tif ($gather) {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:37: characters 19-31\n\t\t\treturn $ret->gather();\n\t\t} else {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:38: characters 12-15\n\t\t\treturn $ret;\n\t\t}\n\t}", "public function map()\n {\n $mappedData = [];\n\n foreach ($this->rawData as $key => $value) {\n if (is_array($value)) {\n foreach ($value as $index => $field) {\n if ($id = getVal($field, ['id'], null)) {\n $mappedData[$index]['id'] = $id;\n }\n\n $mappedData[$index]['transaction'] = $this->template;\n $mappedData[$index]['activity_id'] = getVal($this->rawData, ['activity_id'], null);\n $mappedData[$index]['transaction']['reference'] = getVal($field, ['reference'], null);\n $mappedData[$index]['transaction']['transaction_type'][0]['transaction_type_code'] = getVal($this->rawData, ['type'], null);\n $mappedData[$index]['transaction']['transaction_date'][0]['date'] = getVal($field, ['date'], null);\n $mappedData[$index]['transaction']['value'][0]['amount'] = getVal($field, ['amount'], null);\n $mappedData[$index]['transaction']['value'][0]['currency'] = getVal($field, ['currency'], null);\n $mappedData[$index]['transaction']['value'][0]['date'] = getVal($field, ['date'], null);\n $mappedData[$index]['transaction']['description'][0]['narrative'][0]['narrative'] = getVal($field, ['description'], null);\n $mappedData[$index]['transaction']['receiver_organization'][0]['narrative'][0]['narrative'] = getVal($field, ['organisation'], null);\n }\n }\n }\n\n return $mappedData;\n }" ]
[ "0.5525345", "0.5384199", "0.5153488", "0.51070356", "0.5048584", "0.5046414", "0.4751486", "0.46936995", "0.4689983", "0.4683948", "0.45980072", "0.45875445", "0.45829022", "0.4494961", "0.44889203", "0.4481982", "0.44614464", "0.44428676", "0.4426489", "0.44257954", "0.43568757", "0.4335703", "0.43031117", "0.42942753", "0.42660496", "0.42476773", "0.42393875", "0.4226094", "0.42101902", "0.4180372", "0.41792452", "0.41760793", "0.41745538", "0.41507754", "0.4139834", "0.4107459", "0.4103959", "0.40972674", "0.4095494", "0.40848583", "0.40837407", "0.40747905", "0.40616673", "0.40477428", "0.40453452", "0.40328836", "0.40293735", "0.40275735", "0.40220255", "0.40220255", "0.40147606", "0.40028232", "0.39868137", "0.3985369", "0.39812586", "0.39743486", "0.3965696", "0.39546484", "0.3941211", "0.3940803", "0.39273143", "0.39252365", "0.39045492", "0.38964078", "0.38959733", "0.3895538", "0.38859487", "0.3883598", "0.38753456", "0.38660505", "0.38579082", "0.38506794", "0.38483533", "0.38473713", "0.38305348", "0.38213646", "0.3819953", "0.3819604", "0.38164324", "0.38164324", "0.38143638", "0.38120967", "0.3802634", "0.37922263", "0.37905407", "0.37891906", "0.37877914", "0.37872317", "0.37872252", "0.37816748", "0.37752575", "0.37747696", "0.37721616", "0.3764909", "0.37639406", "0.375846", "0.37566227", "0.37566116", "0.37505755", "0.37469226", "0.37386915" ]
0.0
-1
Complie and display a page
public function display($file) { $tpl_file = $this->option ['templateDir'] . '/' . $file; if (! file_exists ( $tpl_file )) $this->core->err ( '102', $tpl_file ); $parse_file = $this->option ['compileDir'] . '/' . sha1 ( $file ) . $file . '.php'; if (! file_exists ( $parse_file ) || filemtime ( $parse_file ) < filemtime ( $tpl_file )) { $compile = new templatesModuleCompiler ( $this->core, $this->option, $tpl_file ); $compile->parse ( $parse_file ); } if ($this->option ['cache']) { $cache_file = $this->option ['cacheDir'] . '/' . sha1 ( $file ) . $file . '.html'; // Create cache file if needed if (! file_exists ( $cache_file ) || filemtime ( $cache_file ) < filemtime ( $parse_file )) { include $parse_file; $content = ob_get_clean (); if (! file_put_contents ( $cache_file, $content )) $this->core->err ( '112' ); } include $cache_file; } else { include $parse_file; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function render_page();", "public function show() {\n $this->buildPage();\n echo $this->_page;\n }", "function showPage() \n\t{\n\t\t$this->xt->display($this->templatefile);\n\t}", "public function page () {\n\t\tinclude _APP_ . '/views/pages/' . $this->_reg->controller . '/' . $this->_page . '.phtml';\n\t}", "public function display($pageName);", "public function render_page() {\n\t\t$this->render_template();\n\t}", "public function action_view()\n {\n // Correct page has been loaded in the before() function\n $pagename = Wi3::inst()->routing->args[0];\n $this->prepareForViewing($pagename);\n // Render page\n $renderedInAdminArea = false;\n $this->request->response = Wi3_Renderer::renderPage($pagename, $renderedInAdminArea);\n // Page caching will be handled via an Event. See bootstrap.php and the Caching plugin\n }", "public function displayPage()\n\t{\n\t\t$this->assign('rightMenu', $this->rightMenu);\n\t\t$this->assign('content', $this->content);\n\t\t$this->display(\"main.tpl\");\n\t}", "function page($page_name=null, $content_type=\"text/html\")\n{\n\t$page_path = PAGES . \"/\" . $page_name . \".php\";\n\tif(!file_exists($page_path)) throw new FrameworkException(\"$page_path: page doesn't exist\");\n\n\theader(\"content-type: \".$content_type);\n\trequire_once $page_path;\n}", "public function displayPage()\n {\n\n $this->model->checkUserSession();\n $html = $this->displayHeader();\n $html .= $this->displayContent();\n $html .= $this->displayFooter();\n\n return $html;\n }", "public function renderPage()\r\n {\r\n $this->setMasterContent();\r\n // Echo the page immediately.\r\n $this->_htmlpage->renderPage();\r\n }", "public function renderPage()\r\n {\r\n $this->setMasterContent();\r\n // Echo the page immediately.\r\n $this->_htmlpage->renderPage();\r\n }", "public function displayPage()\n {\n\n // I check if there is a duplicate action\n $this->handleDuplicate();\n\n $formTable = new FormListTable();\n\n $formTable->prepare_items();\n require_once __DIR__ . '/templates/index.php';\n }", "public function createPage()\n {\n echo $this->output;\n }", "public function display()\n {\n //If the page was cached\n if ($this->isCached)\n {\n //Nothing to do, we already showed the page\n return;\n }\n return $this->route->getView()->output();\n }", "public function view() {\n\t\t// Find page by url slug\n\t\t$slug = $this->app->getSlug();\n\t\t$page = Page::findBySlug($slug);\n\t\t\n\t\t// If page exists render it, otherwise 404\n\t\tif ($page) {\n\t\t\t$this->title = $page->name;\n\t\t\t$this->pageData['page'] = $page;\n\t\t\t$this->render('view');\n\t\t} else {\n\t\t\t$this->noRoute();\n\t\t}\n\t}", "public function HandlePage()\n\t{\n\t\tif(!gzte11(ISC_HUGEPRINT)) {\n\t\t\texit;\n\t\t}\n\n\t\t$this->SetVendorData();\n\n\t\tif($this->displaying == 'products') {\n\t\t\t$this->ShowVendorProducts();\n\t\t}\n\t\telse if($this->displaying == 'page') {\n\t\t\t$this->ShowVendorPage();\n\t\t}\n\t\telse if($this->displaying == 'profile') {\n\t\t\t$this->ShowVendorProfile();\n\t\t}\n\t\telse {\n\t\t\t$this->ShowVendors();\n\t\t}\n\t}", "abstract protected function render_page_content(): void;", "function renderPage() {\n $parameters = explode(\"/\", $this->getCurrentPage());\n $folder = $parameters[1];\n if (!in_array($folder, $this->folders) && $folder !== \"api\") {\n $name = $this->getCurrentPage();\n require_once $this->getBlueprintPath();\n }\n }", "public function renderPage(){\n try {\n // show deferred failure from initPage\n if( ! $this->ctrl ){\n throw new Loco_error_Exception( __('Page not found','loco-translate') );\n }\n // display loco admin page\n echo $this->ctrl->render();\n }\n catch( Exception $e ){\n $ctrl = new Loco_admin_ErrorController;\n try {\n $ctrl->_init( array() );\n }\n catch( Exception $_e ){\n // avoid errors during error rendering\n }\n echo $ctrl->renderError($e);\n }\n // ensure session always shutdown cleanly after render\n Loco_data_Session::close();\n }", "function lb_show_make_page() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'make_page',\n\t\t\t'pages' => lb_get_all_pages_from_pages(),\n\t\t)\n\t);\n}", "public static function outputPage() {\n\t\tself::phpSetup();\n\t\t// Set the session\n global $clsession;\n $clsession =new SessionV4;\n //--------------------------------------------------------------\n // Exit if the web is closed for maintenance except\n // when the user is the master\n if( self::ISCLOSED && $_SESSION['usr'] != 'master' )\n exit(pageMaintenance::show());\n # --------------------------------------------------------------\n \t# Show the parameters entered with the request\n self::see();\n\t\tif( self::SEEPHPINFO ) phpinfo();\n\t\t# --------------------------------------------------------------\n\t\t# Reset the session if requested\n\t\tif( isset($_POST['reset']) && $_POST['reset'] == 'XRESET')\n\t\t\t$clsession->logout(sessionV4::NOACT);\n # --------------------------------------------------------------\n\t\t# Open the main class of the system\n\t\trequire_once('main.php');\n $clmain=new main;\n $s=$clmain->execute();\n $shses=(singleton::SHOWSESSION ? $clsession->getSession() : '');\n\t\treturn $s.$shses;\n\t}", "public function invoke()\r\n\t{\r\n\t\tif(isset($_GET['page']))\r\n\t\t{\r\n\t\t\t$pageName = $_GET['page'];\r\n\t\t\t$this->loadPage($pageName);\r\n\t\t}\r\n\t\telseif(!isset($_GET['page']))\r\n\t\t{\r\n\t\t\t$this->loadPage('home');\r\n\t\t}\r\n\t}", "function view_page($html){\r\n\t\techo $html;\r\n\t}", "public function page(){\n\t\t$this->load->helper('url');\n\t\t$data['userLogin'] = $this->checkLogin();\n\t\tif($data['userLogin']){\n\t\t\t$data['user'] = $this->getUser();\n\t\t}\n\n\t\t$data['sidebar'] = $this->sidebar();\n\t\t$this->load->view('frontend/templates/header');\n\t\t$this->load->view('frontend/templates/navigation');\n\t\t$this->load->view('frontend/page', $data);\n\t\t$this->load->view('frontend/templates/sidebar');\n\t\t$this->load->view('frontend/templates/footer');\n\t}", "public function page() {\n\t\t$this->page = $this->plugin->factory->adminPage;\n\t\t$this->page->show();\n\t}", "public static function display()\n {\n $page = self::getCurrentPage();\n\n template::serveTemplate('header');\n\n if (session::has('user') === FALSE) {\n user::setLoginUrl('~url::adminurl~');\n if (session::has('viewPage') === FALSE) {\n session::set('viewPage', $page);\n }\n user::process();\n return;\n }\n\n if (session::has('viewPage') === TRUE) {\n $page = session::get('viewPage');\n session::remove('viewPage');\n }\n\n /**\n * Set the default page title to nothing.\n * This is used for including extra information (eg the post subject).\n */\n template::setKeyword('header', 'pagetitle', '');\n\n $menuItems = array(\n '/' => array(\n 'name' => 'Home',\n 'selected' => TRUE,\n ),\n '/adminpost' => array(\n 'name' => 'Posts',\n ),\n '/admincomments' => array(\n 'name' => 'Comments',\n ),\n '/adminstats' => array(\n 'name' => 'Stats',\n ),\n );\n\n if (empty($page) === FALSE) {\n $bits = explode('/', $page);\n\n // Get rid of the '/admin' bit.\n array_shift($bits);\n\n if (empty($bits[0]) === FALSE) {\n $system = array_shift($bits);\n\n /**\n * Uhoh! Someone's trying to find something that\n * doesn't exist.\n */\n if (loadSystem($system, 'admin') === TRUE) {\n $url = '/'.$system;\n if (isset($menuItems[$url]) === TRUE) {\n $menuItems[$url]['selected'] = TRUE;\n unset($menuItems['/']['selected']);\n }\n\n $bits = implode('/', $bits);\n if (isValidSystem($system) === TRUE) {\n call_user_func_array(array($system, 'process'), array($bits));\n }\n } else {\n $url = '';\n if (isset($_SERVER['PHP_SELF']) === TRUE) {\n $url = $_SERVER['PHP_SELF'];\n }\n $msg = \"Unable to find system '\".$system.\"' for url '\".$url.\"'. page is '\".$page.\"'. server info:\".var_export($_SERVER, TRUE);\n messagelog::LogMessage($msg);\n template::serveTemplate('404');\n }\n }\n } else {\n // No page or default system?\n // Fall back to 'index'.\n template::serveTemplate('header');\n template::serveTemplate('index');\n }\n\n $menu = '';\n foreach ($menuItems as $url => $info) {\n $class = '';\n if (isset($info['selected']) === TRUE && $info['selected'] === TRUE) {\n $class = 'here';\n }\n\n $menu .= '<li class=\"'.$class.'\">';\n $menu .= '<a href=\"~url::adminurl~'.$url.'\">'.$info['name'].'</a>';\n $menu .= '</li>';\n $menu .= \"\\n\";\n }\n\n template::setKeyword('header', 'menu', $menu);\n\n template::serveTemplate('footer');\n template::display();\n\n }", "public function action() {\n // $this->view->page();\n }", "private function indexAction()\n {\n $page = isset($_GET['page']) ? substr($_GET['page'],0,-1) : \"home\" ;\n $this->reg->pages->getPageContent(strtolower($page));\n }", "public function show(Page $page)\n {\n\n }", "public function view($page)\n {\n $this->validated();\n $Data['Headers'] = get_page_headers();\n $this->load->view('layouts/main', $Data);\n }", "public static function view() \n {\n $articleDAO = new ArticleDAO();\n $articles = $articleDAO->load();\n\n $dispatch = new Dispatch();\n $dispatch->render(\n 'main_page', [\n 'articles' => $articles\n ]\n );\n }", "public function display()\n {\n return $this->page->output();\n }", "function _display($page_req, $data = array()) {\r\n\t\t\r\n\t\t$data['content'] = $this->load->view($page_req, $data, TRUE);\r\n\t\t\r\n\t\t// Display in Template\r\n\t\t$this->load->view('template', $data);\r\n\t}", "private function buildPage() {\n ob_clean();\n ob_start();\n\n //session_start();\n require_once $this->_template;\n\n $this->_page = ob_get_clean();\n }", "public function display() {\n\t\t$path = func_get_args();\n\n\t\t$count = count($path);\n\t\tif (!$count) {\n\t\t\t$this -> redirect('/');\n\t\t}\n\t\t$page = $subpage = $title_for_layout = null;\n\n\t\tif (!empty($path[0])) {\n\t\t\t$page = $path[0];\n\t\t}\n\t\tif (!empty($path[1])) {\n\t\t\t$subpage = $path[1];\n\t\t}\n\t\tif (!empty($path[$count - 1])) {\n\t\t\t$title_for_layout = Inflector::humanize($path[$count - 1]);\n\t\t}\n\t\t$this -> set(compact('page', 'subpage', 'title_for_layout'));\n\t\t$this -> render(implode('/', $path));\n\t}", "public function main()\n {\n $lang = $this->getLanguageService();\n // Access check...\n // The page will show only if there is a valid page and if this page may be viewed by the user\n $access = is_array($this->pageinfo) ? 1 : 0;\n // Content\n $content = '';\n if ($this->id && $access) {\n // Initialize permission settings:\n $this->CALC_PERMS = $this->getBackendUser()->calcPerms($this->pageinfo);\n $this->EDIT_CONTENT = $this->contentIsNotLockedForEditors();\n\n $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);\n\n // override the default jumpToUrl\n $this->moduleTemplate->addJavaScriptCode('jumpToUrl', '\n function jumpToUrl(URL,formEl) {\n if (document.editform && TBE_EDITOR.isFormChanged) { // Check if the function exists... (works in all browsers?)\n if (!TBE_EDITOR.isFormChanged()) {\n window.location.href = URL;\n } else if (formEl) {\n if (formEl.type==\"checkbox\") formEl.checked = formEl.checked ? 0 : 1;\n }\n } else {\n window.location.href = URL;\n }\n }\n ');\n $this->moduleTemplate->addJavaScriptCode('mainJsFunctions', '\n if (top.fsMod) {\n top.fsMod.recentIds[\"web\"] = ' . (int)$this->id . ';\n top.fsMod.navFrameHighlightedID[\"web\"] = \"pages' . (int)$this->id . '_\"+top.fsMod.currentBank; ' . (int)$this->id . ';\n }\n ' . ($this->popView ? BackendUtility::viewOnClick($this->id, '', BackendUtility::BEgetRootLine($this->id)) : '') . '\n function deleteRecord(table,id,url) { //\n window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[')\n . ' + table + \"][\" + id + \"][delete]=1&redirect=\" + encodeURIComponent(url) + \"&prErr=1&uPT=1\";\n return false;\n }\n ');\n\n // Find backend layout / columns\n $backendLayout = GeneralUtility::callUserFunction(BackendLayoutView::class . '->getSelectedBackendLayout', $this->id, $this);\n if (!empty($backendLayout['__colPosList'])) {\n $this->colPosList = implode(',', $backendLayout['__colPosList']);\n }\n // Removing duplicates, if any\n $this->colPosList = array_unique(GeneralUtility::intExplode(',', $this->colPosList));\n // Accessible columns\n if (isset($this->modSharedTSconfig['properties']['colPos_list']) && trim($this->modSharedTSconfig['properties']['colPos_list']) !== '') {\n $this->activeColPosList = array_unique(GeneralUtility::intExplode(',', trim($this->modSharedTSconfig['properties']['colPos_list'])));\n // Match with the list which is present in the colPosList for the current page\n if (!empty($this->colPosList) && !empty($this->activeColPosList)) {\n $this->activeColPosList = array_unique(array_intersect(\n $this->activeColPosList,\n $this->colPosList\n ));\n }\n } else {\n $this->activeColPosList = $this->colPosList;\n }\n $this->activeColPosList = implode(',', $this->activeColPosList);\n $this->colPosList = implode(',', $this->colPosList);\n\n $content .= $this->getHeaderFlashMessagesForCurrentPid();\n\n // Render the primary module content:\n if ($this->MOD_SETTINGS['function'] == 1 || $this->MOD_SETTINGS['function'] == 2) {\n $content .= '<form action=\"' . htmlspecialchars(BackendUtility::getModuleUrl($this->moduleName, ['id' => $this->id, 'imagemode' => $this->imagemode])) . '\" id=\"PageLayoutController\" method=\"post\">';\n // Page title\n $content .= '<h1 class=\"t3js-title-inlineedit\">' . htmlspecialchars($this->getLocalizedPageTitle()) . '</h1>';\n // All other listings\n $content .= $this->renderContent();\n }\n $content .= '</form>';\n $content .= $this->searchContent;\n // Setting up the buttons for the docheader\n $this->makeButtons();\n // @internal: This is an internal hook for compatibility7 only, this hook will be removed without further notice\n if ($this->MOD_SETTINGS['function'] != 1 && $this->MOD_SETTINGS['function'] != 2) {\n $renderActionHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['renderActionHook'];\n if (is_array($renderActionHook)) {\n foreach ($renderActionHook as $hook) {\n $params = [\n 'deleteButton' => $this->deleteButton,\n ''\n ];\n $content .= GeneralUtility::callUserFunction($hook, $params, $this);\n }\n }\n }\n // Create LanguageMenu\n $this->makeLanguageMenu();\n } else {\n $this->moduleTemplate->addJavaScriptCode(\n 'mainJsFunctions',\n 'if (top.fsMod) top.fsMod.recentIds[\"web\"] = ' . (int)$this->id . ';'\n );\n $content .= '<h1>' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '</h1>';\n $view = GeneralUtility::makeInstance(StandaloneView::class);\n $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/InfoBox.html'));\n $view->assignMultiple([\n 'title' => $lang->getLL('clickAPage_header'),\n 'message' => $lang->getLL('clickAPage_content'),\n 'state' => InfoboxViewHelper::STATE_INFO\n ]);\n $content .= $view->render();\n }\n // Set content\n $this->moduleTemplate->setContent($content);\n }", "function render($page){\n if(file_exists(FOLDER_VIEWS.S.$page.\".php\")){\n extract($this->vars);\n require_once FOLDER_VIEWS.S.$page.\".php\";\n }else{\n header(\"location: \".REDIRECT_ERROR003);\n }\n }", "function index() {\r\n $this->page();\r\n }", "protected function makePage() {\n // \n // get the user's constituency\n // \n // get the candidates for this election in this constituency\n // \n // make the page output\n }", "public function show(Page $page)\n {\n //\n }", "public function show(Page $page)\n {\n //\n }", "public function show(Page $page)\n {\n //\n }", "public function actionView()\n {\n $page = ContainerPage::find()->contentContainer($this->contentContainer)->where(['custom_pages_container_page.id' => Yii::$app->request->get('id')])->one();\n\n if ($page === null) {\n throw new HttpException('404', 'Could not find requested page');\n }\n\n if ($page->type == Container::TYPE_IFRAME) {\n return $this->render('iframe', array('page' => $page, 'url' => $page->page_content));\n } elseif ($page->type == Container::TYPE_LINK) {\n return $this->redirect($page->page_content);\n } elseif ($page->type == Container::TYPE_MARKDOWN) {\n return $this->render('markdown', array('page' => $page, 'md' => $page->page_content));\n } elseif ($page->type == Container::TYPE_TEMPLATE) {\n return $this->viewTemplatePage($page);\n } else {\n throw new HttpException('500', 'Invalid page type!');\n }\n }", "function displayPage()\n {\n $this->getState()->template = 'transition-page';\n }", "public function pageOne()\n {\n\n\n View::show(\"pageOne.php\", \"pageOne\");\n }", "public function show()\n {\n /** Configure generic views */\n $this->setupViews();\n /** Render views */\n ?>\n <html>\n <body>\n <?php\n /** Render views */\n $this->head_view->render();\n $this->secondary_nav_bar->render();\n $this->tree_view->render();\n $this->title_view->render();\n $this->primary_nav_bar->render();\n $this->render_page();\n ?>\n </body>\n </html>\n <?php\n }", "public function display($page){ \n switch($page){\n case 'cities':\n $this->get_big_four_cities();\n break;\n case 'women':\n $this->get_wfashion();\n break;\n case 'men':\n $this->get_mfashion();\n break;\n case 'lifestyle':\n $this->get_lifestyle();\n break;\n case 'culture':\n $this->get_culture();\n break;\n default:\n $this->get_big_four_cities();\n \n } \n }", "public function display_page() {\n include_once JPID_PLUGIN_DIR . 'includes/admin/pages/views/html-jpid-admin-customer-edit-page.php';\n }", "function getPage()\n {\n global $_ARRAYLANG, $objTemplate; \n\n if(!isset($_GET['act'])){\n $_GET['act']='';\n }\n\n $boolShowStatus = true;\n\n switch ($_GET['act']) {\n case 'Ftp':\n $this->showFtp();\n break;\n \n case 'cache':\n if (in_array('CacheManager', \\Env::get('cx')->getLicense()->getLegalComponentsList())) {\n $boolShowStatus = false;\n $objCache = new \\Cx\\Core_Modules\\Cache\\Controller\\CacheManager();\n $objCache->showSettings();\n } else {\n \\Permission::noAccess();\n }\n \n break;\n\n case 'Wysiwyg':\n if (in_array('Wysiwyg', \\Env::get('cx')->getLicense()->getLegalComponentsList())) {\n $boolShowStatus = false;\n $this->showWysiwyg();\n } else {\n \\Permission::noAccess();\n }\n \n break;\n \n case 'cache_update':\n $boolShowStatus = false;\n $objCache = new \\Cx\\Core_Modules\\Cache\\Controller\\CacheManager();\n $objCache->updateSettings();\n $objCache->showSettings();\n break;\n\n case 'cache_empty':\n $boolShowStatus = false;\n $objCache = new \\Cx\\Core_Modules\\Cache\\Controller\\CacheManager();\n $objCache->forceClearCache(isset($_GET['cache']) ? contrexx_input2raw($_GET['cache']) : null);\n $objCache->showSettings();\n break;\n\n case 'smtp':\n $this->smtp();\n break;\n \n case 'image':\n try {\n $this->image($_POST);\n } catch (Exception $e) {\n \\DBG::msg('Image settings: '.$e->getMessage);\n }\n break;\n case 'thumbnail':\n $this->editThumbnails($_POST);\n break;\n\n case 'generateThumbnail':\n $this->generateThumbnail($_POST);\n break;\n\n case 'getThumbProgress':\n $this->getThumbProgress();\n break;\n\n default:\n $this->showSettings();\n }\n\n if ($boolShowStatus) {\n $objTemplate->setVariable(array(\n 'CONTENT_TITLE' => $this->strPageTitle,\n 'CONTENT_OK_MESSAGE' => $this->strOkMessage,\n 'CONTENT_STATUS_MESSAGE' => implode(\"<br />\\n\", $this->strErrMessage)\n ));\n }\n\n $this->act = isset($_REQUEST['act']) ? $_REQUEST['act'] : '';\n $this->setNavigation();\n }", "public function helpPage()\n {\n $site = new SiteContainer($this->db);\n $page;\n\n if ($_SESSION['type'] == 'owner'){\n require_once('views/OwnerHelpPage.class.php');\n $page = new OwnerHelpPage();\n }\n else {\n require_once('views/CustHelpPage.class.php');\n $page = new CustHelpPage();\n }\n\n $site->printHeader();\n $site->printNav($_SESSION['type']);\n $page->printHtml();\n $site->printFooter(); \n\n }", "public function displayContent(){\n\t\t\tinclude('/includes/homepage.inc.php');\t\n\t\t}", "public function ShowVendorPage()\n\t{\n\t\tif(isset($_REQUEST['pageid'])) {\n\t\t\t$pageWhere = \" pageid='\".(int)$_REQUEST['pageid'].\"'\";\n\t\t}\n\t\telse {\n\t\t\t$page = preg_replace('#\\.html$#i', '', $GLOBALS['PathInfo'][2]);\n\t\t\t$page = MakeURLNormal($page);\n\t\t\t$pageWhere = \" LOWER(pagetitle)='\".$GLOBALS['ISC_CLASS_DB']->Quote(isc_strtolower($page)).\"'\";\n\t\t}\n\n\t\t$query = \"\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]pages\n\t\t\tWHERE \".$pageWhere.\" AND pagevendorid='\".(int)$this->vendor['vendorid'].\"' AND pagestatus='1'\n\t\t\";\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t$page = $GLOBALS['ISC_CLASS_DB']->Fetch($result);\n\t\tif(!isset($page['pageid'])) {\n\t\t\t$GLOBALS['ISC_CLASS_404'] = GetClass('ISC_404');\n\t\t\t$GLOBALS['ISC_CLASS_404']->HandlePage();\n\t\t\texit;\n\t\t}\n\n\t\t// Otherwise show the page\n\t\t$GLOBALS['ISC_CLASS_PAGE'] = new ISC_PAGE($page['pageid'], false, $page);\n\t\t$GLOBALS['ISC_CLASS_PAGE']->HandlePage();\n\t\texit;\n\t}", "function render($page){\n\t\t$url = $this->url;\n\t\tif($page != null) {\n\t\t\t$page->loadLayout();\n\t\t\t$page->calculatePaths();\n\n\t\t\t$toLoad = $page->controlFile;\n\t\t\tfileUtil::trimLeftDir($toLoad);\n\t\t\t$toLoad = fileutil::stripExt($toLoad);\n\n\t\t\t//update the globals to reflect our actual page\n\t\t\t$_SERVER[\"PHP_SELF\"] = $GLOBALS[\"SiteRoot\"].$toLoad;\n\t\t\t$_SERVER[\"PHP_SELF_NOEXT\"] = fileutil::stripExt($GLOBALS[\"SiteRoot\"].$toLoad);\n\t\t\t$_SERVER[\"PHP_SELFDIR\"] = fileutil::stripFile($_SERVER[\"PHP_SELF\"]).\"/\";\n\t\t}\n\t\telse {\n\t\t\t$page = page::loadPage(\"errors/404\");\n\t\t}\n\n\t\t//do a security check\n\t\tif( !security::hasPageAccess($page) ) {\n\t\t\techo(\"Permission Denied for $page->url!\");\n\t\t\tdie();\n\t\t}\n\n\t\t//trigger any page events\n\t\t$page->handleEvents();\n\n\t\t//handle any ajax get requests\n\t\t$page->handleAjax();\n\n\t\t//if this is an ajax post, we don't need to render.\n\t\t//It was just interested in executing events\n\t\tif(util::getData(\"ajaxpost\")!=\"\")\n\t\t\tdie();\n\n\t\t$this->callTemplate($page);\n\t}", "private function content() {\n $this->checkPost();\n\n if (isset($_SESSION['CREATE'])) {\n\n switch ($_SESSION['CREATE']['page']) {\n case 0:\n $this->pageAgreement();\n break;\n case 1:\n $this->pageNameIntro();\n break;\n case 2:\n $this->pageMark();\n break;\n case 3:\n $this->pageFinal();\n break;\n default:\n echo '<h1>Error: Page Invalid<h1>';\n break;\n }\n\n }else\n echo '<h1>Error: Session invalid</h1>';\n }", "public function render(){\n require_once($_SERVER['DOCUMENT_ROOT'].\"//views/\".self::$page_name.\"/\".self::$page_name.\".php\");\n }", "public function render() {\n\t\treturn $this->template( 'page' );\n\t}", "public function display(){\n\t\t$this->smarty->assign(\"main_content\",$this->template) ;\n\t\t$this->setTemplate(\"common/page.tpl\") ;\n\t\tparent::display() ;\n\t}", "public function render_wizard() {\n\t\tinclude Plugin::instance()->get_view( 'common/page' );\n\t}", "public function render() {\n\t\t$this->render_page_content();\n\t}", "public function index(){\t\n\t\t// var_dump('vchxhh');\n\n\t\t$page_model = new \\Models\\Page;\n\t\t$page_model->cmsPage();\n\t\t$this->data['page_title'] = \\Models\\Page::$pageName;\n\n\t\t$this->data['pagename'] = \\Models\\Page::$pageName;\n\t\t$this->data['subname'] = \\Models\\Page::$subName;\n\t\t$this->data['pagedetails'] = \\Models\\Page::$pagedetails;\n\n\t\tswitch (\\Models\\Page::$controller) {\n\t\t\tcase 'contact-us':\n\t\t\t\tUrl::redirect('page/contact');\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\n\t\tView::renderTemplate('header',$this->data);\n\t\tView::render('page/page.index',$this->data);\n\t\tView::renderTemplate('footer',$this->data);\n\t}", "function page_content()\n {\n //This needs to deliver page data that is requested by the ROUTE.\n }", "abstract protected function view_generatePageContent();", "protected function page () {\n\t\t$skeleton\t= make::tpl ('skeleton.basic');\n\n\t\t/**\n\t\t * Fetch the body content\n\t\t */\n\t\t$body\t\t= make::tpl ('body.privacy');\n\n\n\t\t/**\n\t\t * Fetch the translated privacy policy\n\t\t */\n\t\t$query = \"SELECT \";\n\t\t$query.= \"`html` \";\n\t\t$query.= \"FROM \";\n\t\t$query.= \"`page_privacy_translations` \";\n\t\t$query.= \"WHERE \";\n\t\t$query.= \"`locale`='\".config::get('locale').\"' \";\n\t\t$query.= \"LIMIT 1\";\n\n\t\t$result = database::query($query);\n\n\t\tif($result && mysql_error()=='' && mysql_num_rows($result) > 0) {\n\t\t\t$row\t\t= mysql_fetch_assoc($result);\n\t\t\t$date\t\t= date('d/m/Y');\n\t\t\t$content\t= str_replace('{{ date }}',$date,stripslashes($row['html']));\n\t\t}\n\n\t\t$body->assign('content',$content);\n\n\t\t/**\n\t\t * Fetch the page details\n\t\t */\n\t\t$page = new page('privacy');\n\n\t\t/**\n\t\t * Build the output\n\t\t */\n\t\t$skeleton->assign (\n\t\t\tarray (\n\t\t\t\t'title'\t\t\t=> $page->title(),\n\t\t\t\t'keywords'\t\t=> $page->keywords(),\n\t\t\t\t'description'\t=> $page->description(),\n\t\t\t\t'body'\t\t\t=> $body\n\t\t\t)\n\t\t);\n\n\t\toutput::as_html($skeleton,true);\n\t}", "public function quick_view( $page_name , $page = array('title' => '' , 'description' => '') )\r\n\t {\r\n\t\t $this->render( $page_name , $this->load_shop( $page ) );\r\n\t }", "function showPage($page_name, $data)\n\t{\n\t\t$instance_name = & get_instance();\n\t\t$instance_name->load->view(\"admin/header\", $data);\n\t\t$instance_name->load->view(\"admin/navbar\", $data);\n\t\t$instance_name->load->view(\"admin/{$page_name}\", $data);\n\t\t$instance_name->load->view(\"admin/footer\", $data);\n\t}", "public function viewAction()\n {\n $tiles = [];\n // Reuse the parameters from $_REQUEST\n // If we are going to render a full page for edit form, we shall also render the _form_controls\n $tiles[] = Region::create($this->getViewRegionPath(), array_merge($_REQUEST, [\n '_form_controls' => true,\n ]));\n return $this->render($this->findTemplatePath('page.html'), ['tiles' => $tiles ]);\n }", "public function affichePiedPage()\r\n\t\t{\r\n\t\t//appel de la vue du pied de page\r\n\t\trequire 'Vues/piedPage.php';\r\n\t\t}", "function main()\t{\n\t\tglobal $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t// Access check!\n\t\t// The page will show only if there is a valid page and if this page may be viewed by the user\n\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n\t\t$access = is_array($this->pageinfo) ? 1 : 0;\n\n\t\tif (($this->id && $access) || ($BE_USER->user[\"admin\"] && !$this->id))\t{\n\n\t\t\t\t// Draw the header.\n\t\t\t$this->doc = t3lib_div::makeInstance(\"bigDoc\");\n\t\t\t$this->doc->backPath = $BACK_PATH;\n\t\t\t$this->doc->form='<form action=\"index.php?id='.$this->id.'\" method=\"POST\">';\n\n\t\t\t\t// JavaScript\n\t\t\t$this->doc->JScode = '\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 0;\n\t\t\t\t\tfunction jumpToUrl(URL)\t{\n\t\t\t\t\t\tdocument.location = URL;\n\t\t\t\t\t}\n\t\t\t\t</script>\n\t\t\t';\n\t\t\t$this->doc->postCode='\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 1;\n\t\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = 0;\n\t\t\t\t</script>\n\t\t\t';\n\n\t\t\t$headerSection = $this->doc->getHeader(\"pages\",$this->pageinfo,$this->pageinfo[\"_thePath\"]).\"<br />\".$LANG->sL(\"LLL:EXT:lang/locallang_core.xml:labels.path\").\": \".t3lib_div::fixed_lgd_pre($this->pageinfo[\"_thePath\"],50);\n\n\t\t\t$this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\t\n\t\t\texec('hostname',$ret);\n\t\t\t$ret=implode(\"\",$ret);\n\t\t\t$this->content.=$this->doc->header($LANG->getLL(\"title\") .\" on: $ret\");\n\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->section(\"\",$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,\"SET[function]\",$this->MOD_SETTINGS[\"function\"],$this->MOD_MENU[\"function\"])));\n\t\t\t$this->content.=$this->doc->divider(5);\n\n\n\t\t\t// Render content:\n\t\t\t$this->moduleContent();\n\n\n\t\t\t// ShortCut\n\t\t\tif ($BE_USER->mayMakeShortcut())\t{\n\t\t\t\t$this->content.=$this->doc->spacer(20).$this->doc->section(\"\",$this->doc->makeShortcutIcon(\"id\",implode(\",\",array_keys($this->MOD_MENU)),$this->MCONF[\"name\"]));\n\t\t\t}\n\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t} else {\n\t\t\t\t// If no access or if ID == zero\n\n\t\t\t$this->doc = t3lib_div::makeInstance(\"mediumDoc\");\n\t\t\t$this->doc->backPath = $BACK_PATH;\n\n\t\t\t$this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\n\t\t\t$this->content.=$this->doc->header($LANG->getLL(\"title\"));\n\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t}\n\t}", "function page_viewer( $page_id )\n{\n if( $page_id == null )\n {\n show_error_page( \"No page requested.\" );\n return;\n }\n $connection = get_system_connection();\n $page = new Page();\n $page->create_from_database( $page_id );\n}", "protected function renderPage()\n {\n $this->requestCallback();\n require_once \\dirname(__FILE__) . '/../../views/settings.php';\n }", "public function makePage()\n {\n $db = new DB();\n $page_color = !empty($db->getOptions('page_color')) ? 'style=\"background-color:' . $db->getOptions('page_color') . ';\"' : '';\n $footer_color = !empty($db->getOptions('footer_color')) ? 'style=\"background-color:' . $db->getOptions('footer_color') . ';\"' : '';\n echo '<!DOCTYPE html>\n<html lang=\"en\">\n<head>';\n\n $this->makeMeta();\n $this->setTitle();\n $this->makeStyles();\n $this->makeHeaderScripts();\n echo '<!-- header code -->' . PHP_EOL;\n if (!empty($this->getHeaderCode())) {\n echo $this->getHeaderCode() . PHP_EOL;\n }\n echo '<!-- header code -->' . PHP_EOL;\n echo '</head>\n\n\t\t<body class=\"' . $this->getbodyClass() . '\" ' . $page_color . '>';\n\n echo '<div class=\"main-wrapper\" >';\n if ($this->hasHeader) {\n echo '<header class=\"header\" >';\n if ($this->hasNavbar) {\n require_once 'Navbar.php';\n }\n echo '</header>';\n }\n\n\n//--main content---\n if ($this->hasBreadcrumb) {\n $routes = explode(\"/\", $_SERVER['REQUEST_URI']);\n echo '\n<div class=\"breadcrumb-bar d-print-none\" ' . $footer_color . '>\n\t\t\t\t<div class=\"container-fluid\">\n\t\t\t\t\t<div class=\"row align-items-center\">\n\t\t\t\t\t\t<div class=\"col-md-12 col-12\">\n\t\t\t\t\t\t\t<nav aria-label=\"breadcrumb\" class=\"page-breadcrumb\">\n\t\t\t\t\t\t\t\t<ol class=\"breadcrumb\">\n\t\t\t\t\t\t\t\t\t<li class=\"breadcrumb-item\"><a href=\"' . BASE_PATH . $routes[1] . '/\"><i class=\"bx bx-home-alt\"></i></a></li>';\n\n for ($i = 1; $i < count($routes) - 1; $i++) {\n if ($i != count($routes) - 1) {\n echo '<li class=\"breadcrumb-item\"><a href=\"' . BASE_PATH . $routes[1] . '/' . $routes[$i] . '/\">' . $routes[$i] . '</a></li>';\n } else {\n echo '<li class=\"breadcrumb-item active\">' . $routes[$i] . '</li>';\n }\n }\n echo '\n\t\t\t\t\t\t\t\t</ol>\n\t\t\t\t\t\t\t</nav>\n\t\t\t\t\t\t\t<h2 class=\"breadcrumb-title\">' . $this->getPageTitle() . '</h2>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>';\n }\n echo '<div class=\"content\">';\n echo '<div class=\"container-fluid\">';\n if ($this->isHasContent()) {\n $this->addPageContent($this->getPageContent());\n }\n\n echo '</div></div>';\n\n echo '<!-- above footer code -->' . PHP_EOL;\n\n /*--footer---*/\n if ($this->hasFooter) {\n require_once 'footer.php';\n }\n echo '</div>';\n $this->makeScripts();\n $this->makeFooterScripts();\n if ($this->ishasError()) {\n $this->showPageError();\n }\n\n echo '<!-- footer code -->' . PHP_EOL;\n if (!empty($this->getFooterCode())) {\n echo $this->getFooterCode() . PHP_EOL;\n }\n echo '<!-- footer code -->' . PHP_EOL;\n echo '</body>\n</html>';\n }", "private function show_page()\n\t{\n\t\t$parse['user_link']\t= $this->_base_url . 'recruit/' . $this->_friends[0]['user_name'];\n\t\n\t\t$this->template->page ( FRIENDS_FOLDER . 'friends_view' , $parse );\t\n\t}", "public function Page($page){\r\n $fullpath=ucwords($page).EXT;\r\n $this->Load($fullpath);\r\n }", "public function display() {\r\n\t\t$this->script();\r\n\t\t$this->html();\r\n\t\t\r\n\t}", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->fixHTML5();\n $output .= $this->registerCustomResources();\n $output .= '</head><body>';\n echo $output;\n }", "function main()\t{\n\t\tglobal $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t// Access check!\n\t\t// The page will show only if there is a valid page and if this page may be viewed by the user\n\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n\t\t$access = is_array($this->pageinfo) ? 1 : 0;\n\n\t\tif (($this->id && $access) || ($BE_USER->user[\"admin\"] && !$this->id))\t{\n\n\t\t\t// Draw the header.\n\t\t\t$this->doc = t3lib_div::makeInstance(\"mediumDoc\");\n\t\t\t$this->doc->backPath = $BACK_PATH;\n\t\t\t$this->doc->form = '<form action=\"\" method=\"post\">';\n\n\t\t\t// JavaScript\n\t\t\t$this->doc->JScode = '\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 0;\n\t\t\t\t\tfunction jumpToUrl(URL) {\n\t\t\t\t\t\tdocument.location = URL;\n\t\t\t\t\t}\n\t\t\t\t</script>\n\t\t\t';\n\t\t\t$this->doc->postCode='\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 1;\n\t\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = ' . intval($this->id) . ';\n\t\t\t\t</script>\n\t\t\t';\n\n\t\t\t$headerSection = $this->doc->getHeader(\"pages\",$this->pageinfo,$this->pageinfo[\"_thePath\"]).\"<br>\".$LANG->sL(\"LLL:EXT:lang/locallang_core.php:labels.path\").\": \".t3lib_div::fixed_lgd_pre($this->pageinfo[\"_thePath\"],50);\n\n\t\t\t$this->content .= $this->doc->startPage($LANG->getLL(\"title\"));\n\t\t\t$this->content .= $this->doc->header($LANG->getLL(\"title\"));\n\t\t\t$this->content .= $this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->section(\"\",$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,\"SET[function]\",$this->MOD_SETTINGS[\"function\"],$this->MOD_MENU[\"function\"])));\n\t\t\t$this->content .= $this->doc->divider(5);\n\n\n\t\t\t// Render content:\n\t\t\t$this->moduleContent();\n\n\n\t\t\t// ShortCut\n\t\t\tif ($BE_USER->mayMakeShortcut())\t{\n\t\t\t\t$this->content .= $this->doc->spacer(20).$this->doc->section(\"\",$this->doc->makeShortcutIcon(\"id\",implode(\",\",array_keys($this->MOD_MENU)),$this->MCONF[\"name\"]));\n\t\t\t}\n\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t} else {\n\t\t\t// If no access or if ID == zero\n\n\t\t\t$this->doc = t3lib_div::makeInstance(\"mediumDoc\");\n\t\t\t$this->doc->backPath = $BACK_PATH;\n\n\t\t\t$this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\n\t\t\t$this->content.=$this->doc->header($LANG->getLL(\"title\"));\n\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t}\n\t}", "function &renderPage( $page=0 )\r\n {\r\n $generator =& $this->generator();\r\n// print( \"Using renderer: \" . $this->RendererClass . \"<br>\");\r\n \r\n return $generator->renderPage( $page );\r\n }", "public function render()\r\n\t{\r\n\t\t$this->site->page = $this;\r\n\t\t// if noone is subscribed, we want to output our own 404\r\n\t\tif(!$this->site->event->subscribers('404'))\r\n\t\t{\r\n\t\t\t$this->site->event->subscribe('404', array($this, '_404'));\r\n\t\t}\r\n\t\tif( $this->controller === null )\r\n\t\t{\r\n\t\t\t$this->site->event->publish('404');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(ob_get_length() > 0)\r\n\t\t\t{\r\n\t\t\t\tob_end_clean();\r\n\t\t\t}\r\n\t\t\theader(\"Connection: close\");\r\n\t\t\theader(\"X-Powered-By: \"); // Remove the header, don't need to advertise how out of date we are...\r\n\t\t\t//TODO: Figure out how to remove \"Server\" header also.. doesn't appear you can do this from inside php?\r\n\t\t\tob_start();\r\n\t\t\t$this->site->event->publish('Page::onRender');\r\n\t\t\tcall_user_func_array(array($this->controller, 'setup'), $this->controllerParams);\r\n\t\t\tcall_user_func_array(array($this->controller, $this->controllerMethod), $this->controllerParams);\r\n // are we doing a json response? if not, we assume html...\r\n if($this->site->response->json === false\r\n && $this->site->webCatalog->isRedirect === false) {\r\n $viewFile = $this->controller->viewFile;\r\n if ($viewFile === null) // if not defined, auto grab em... @todo - this fails miserably when you're using dynamic paths. For now just set it in your controller. But it should be fixed.\r\n {\r\n if ($this->requestedPath === '/' ||\r\n $this->requestedPath === ''\r\n ) {\r\n $path = 'index';\r\n } else {\r\n if (strpos($this->requestedPath, '.')) {\r\n $path = substr($this->requestedPath, 0, strpos($this->requestedPath, '.'));\r\n } else {\r\n $path = $this->requestedPath;\r\n }\r\n $path = trim($path, '/');\r\n }\r\n if ($ext = $this->site->config('template', 'extension')) {\r\n $viewFile = $path . '.' . $ext;\r\n } else {\r\n $viewFile = $path . '.tpl';\r\n }\r\n }\r\n if ($this->controller->autoRender === true) {\r\n // do we have a view file?\r\n if (is_string($this->site->config('site', 'viewPath'))) {\r\n $viewPaths = [$this->site->config('site', 'viewPath')];\r\n } else {\r\n $viewPaths = $this->site->config('site', 'viewPath');\r\n }\r\n $_404 = true; // check if a valid template\r\n foreach ($viewPaths as $i => $p) {\r\n $viewPaths[$i] = $this->site->appFolder . $p;\r\n if (is_file($viewPaths[$i] . DIRECTORY_SEPARATOR . $viewFile) === true) {\r\n $_404 = false;\r\n }\r\n }\r\n if ($_404) {\r\n $this->site->event->publish('404');\r\n } else {\r\n switch ($this->site->config('template', 'engine')) {\r\n case 'smarty':\r\n // Summon Smarty Template Engine\r\n $this->template = new Smarty();\r\n $this->template->muteExpectedErrors(); // something is conflicting with our error class. See smarty docs for this.\r\n // Absolute path to the root template dir\r\n if ($this->site->config('site', 'viewPath')) {\r\n $this->template->setTemplateDir(realpath($this->site->appFolder . $this->site->config('site', 'viewPath')));\r\n } else {\r\n $this->site->error->toss('[site] viewPath must be defined in your config!');\r\n }\r\n if ($this->site->config('smarty', 'configDir')) {\r\n $this->template->setConfigDir(realpath($this->site->appFolder . $this->site->config('smarty', 'configDir')));\r\n }\r\n // These directories need FULL WRITE ACCESS\r\n // and could be stored outside of the web root for security purposes:\r\n if ($this->site->config('smarty', 'compileDir')) {\r\n $this->template->setCompileDir(realpath($this->site->appFolder . $this->site->config('smarty', 'compileDir')));\r\n }\r\n if ($this->site->config('smarty', 'cacheDir')) {\r\n $this->template->setCacheDir(realpath($this->site->appFolder . $this->site->config('smarty', 'cacheDir')));\r\n }\r\n $this->site->event->publish('Page::SmartyPlugins');\r\n // Assign template variables from the controller\r\n if (isset($this->controller->view)) {\r\n foreach ($this->controller->view as $key => $value) {\r\n $this->template->assign($key, $value);\r\n }\r\n }\r\n // Finally, display the template...\r\n try {\r\n $this->template->display($viewFile);\r\n } catch (Exception $e) {\r\n $this->site->error->toss($e->getMessage(), E_USER_WARNING);\r\n }\r\n break;\r\n case 'twig':\r\n\r\n try {\r\n\r\n $env = $this->getTwigEnvironment();\r\n $this->site->event->publish(\"Twig::Twig_Environment\", $env);\r\n\r\n echo $this->renderTemplate($viewFile, $this->controller->view);\r\n } catch (Exception $e) {\r\n $this->site->error->toss($e->getMessage(), E_USER_WARNING);\r\n $this->site->event->publish('404');\r\n }\r\n break;\r\n default:\r\n $fname = $this->site->appFolder . $this->site->config('site', 'viewPath') . '/' . $viewFile;\r\n if ($file = realpath($fname)) {\r\n require($file);\r\n } else {\r\n $this->site->error->toss('Unable to auto render with view file: ' . $fname);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\t\t\theader(\"Content-Length: \".ob_get_length());\r\n\t\t\tob_end_flush();\r\n\t\t\tflush();\r\n\t\t\tcall_user_func_array(array($this->controller, 'shutdown'), $this->controllerParams);\r\n\t\t\t$this->site->event->publish('Page::afterRender');\r\n\t\t}\r\n\t}", "function display() {\r\n \t$pageNo = null;\r\n\r\n \tif (isset($this->params['pass']['page'])) {\r\n \t\t$pageNo = $this->params['pass']['page'];\r\n \t}\r\n \t$pageCount = $this->params['paging']['Post']['pageCount'];\r\n\t\techo $this->getPaginationString($pageNo, $pageCount * 15, 15, 2, \"/messages/index/\", \"page:\");\r\n }", "public function render_page() {\n\n\t\t// Early bail if we're not on the right page.\n\t\tif ( Param::get( 'page' ) !== $this->slug ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ob_get_length() ) {\n\t\t\tob_end_clean();\n\t\t}\n\n\t\t$assets = new Assets();\n\t\t$assets->register();\n\n\t\twp_styles()->done = [];\n\t\twp_scripts()->done = [];\n\n\t\t// Enqueue styles.\n\t\t\\CMB2_Hookup::enqueue_cmb_css();\n\t\t\\CMB2_Hookup::enqueue_cmb_js();\n\n\t\t// Wizard.\n\t\twp_enqueue_style( 'rank-math-wizard', rank_math()->plugin_url() . 'assets/admin/css/setup-wizard.css', [ 'wp-admin', 'buttons', 'cmb2-styles', 'rank-math-common', 'rank-math-cmb2' ], rank_math()->version );\n\n\t\t$logo_url = '<a href=\"' . KB::get( 'logo' ) . '\" target=\"_blank\"><img src=\"' . esc_url( rank_math()->plugin_url() . 'assets/admin/img/logo.svg' ) . '\"></a>';\n\n\t\tob_start();\n\n\t\t/**\n\t\t * Start the actual page content.\n\t\t */\n\t\tinclude_once $this->get_view( 'header' );\n\t\tinclude_once $this->get_view( 'content' );\n\t\tinclude_once $this->get_view( 'footer' );\n\t\texit;\n\t}", "public function get_page();", "private static function render(){\n\t\tif(flexMVC::$view) $viewpath = VIEWS.flexMVC::$view.VIEWPAGE_EXT;\n\t\telse $viewpath = CURRENT_VIEW_FOLDER_LOCATION.CURRENT_VIEW.VIEWPAGE_EXT;\n\t\tif(!is_file($viewpath)){\n\t\t\t$viewpath = VIEWS.flexMVC::$error_page.VIEWPAGE_EXT;\n\t\t\tif(!file_exists($viewpath)){\n\t\t\t\techo(\"Please define your errors page => \" . flexMVC::$error_page);\n\t\t\t\texit;\n\t\t\t}\n\t\t\theader($_SERVER[\"SERVER_PROTOCOL\"].\" 404 Not Found\"); \n\t\t\tob_start();\n\t\t\tinclude($viewpath);\n\t\t\t$content = ob_get_clean();\n\t\t\tflexMVC::get_layout(VIEWS.\"_layouts/\".flexMVC::$layout.VIEWPAGE_EXT, $content);\n\t\t}else{\n\t\t\tob_start();\n\t\t\tinclude($viewpath);\n\t\t\t$content = ob_get_clean();\n\t\t\tflexMVC::get_layout(VIEWS.\"_layouts/\".flexMVC::$layout.VIEWPAGE_EXT, $content);\n\t\t\t$_SESSION['flexMVC_lastActive'] = strtotime(\"now\");\n\t\t}\n\t}", "public function printHtmlPage(){\n\n // Change the content headers to that of HTML\n header('Content-type: text/html; charset=utf8');\n\n // Include the HTML wrapper and collect output\n ob_start();\n require_once(LEGACY_MMRPG_ROOT_DIR.'markup/html-wrapper.php');\n $html_markup = ob_get_clean();\n\n // Print out the collected markup and exit\n echo($html_markup);\n exit();\n\n }", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->registerResource('css', $this->cssResource);\n $output .= $this->registerResource('js', $this->jsResource);\n $output .= $this->fixHTML5();\n $output .= '</head><body>';\n echo $output;\n }", "public function displayPage()\n {\n $this->getState()->template = 'displaygroup-page';\n }", "function main()\n {\n $this->page_id = 113;\n $this->get_text();\n $this->body .= \"<table cellpadding=5 cellspacing=1 border=0 width=\\\"100%\\\">\\n\";\n if (strlen(trim($this->messages[500021])) > 0) {\n $this->body .= \"<tr class=\\\"browse_sellers_main_page_title\\\">\\n\\t<td valign=top height=20>\" . $this->messages[500021] . \"</td>\\n</tr>\\n\";\n }\n if (strlen(trim($this->messages[500022])) > 0) {\n $this->body .= \"<tr class=\\\"browse_sellers_main_page_message\\\">\\n\\t<td valign=top height=20>\" . $this->messages[500022] . \"</td>\\n</tr>\\n\";\n }\n $this->body .= \"<tr>\\n\\t<td valign=top>\\n\\t\";\n if (!$this->browse_main()) {\n $this->browse_error();\n }\n $this->body .= \"</td>\\n</tr>\\n\";\n $this->body .= \"</table>\\n\";\n $this->display_page();\n return true;\n }", "function showPage($db) {\n $this->user_info($db);\n $this->log_visitor($db,$_SERVER['PHP_SELF'],0);\n $this->showPage=true;\n }", "public function main()\n {\n // check if user logged if not redirect to login page.\n if(Session::logged() == NULL){\n header(\"location: /\" . ROOT . 'login');\n }\n // if logged only administrator with role owner or manager have access to administration page.\n else if(Session::logged()['role'] == 'manager' || Session::logged()['role'] == 'owner'){\n // creating administration page.\n\n $data = NULL;\n $p = new Page(\"Administration Page\");\n $p->setComponent(\"htmlAdministrator.php\", $data);\n $p->addCss(\"administrator.css\");\n $p->addJs('administrator.js');\n $p->dumpView();\n }\n // not owner or manager trying access to administrator page, redirect to school page.\n else{\n header(\"location: /\" . ROOT . 'school');\n }\n }", "public function page($route) {\n require_once('models/Page.php');\n require_once('views/Page.php');\n require_once('controllers/Page.php');\n\n // Initiate MVC objects\n $model = new Model\\Page\\Model($route);\n $controller = new Controller\\Page\\Controller($model);\n $view = new View\\Page\\View($controller, $model);\n\n // Display page\n $view->render();\n\n }", "protected function getPage() {}", "protected function getPage() {}", "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 }", "abstract protected function displayContent();", "public function displayAction() {\r\n\r\n //GET THE TEXT STRING\r\n $text = $this->_getParam('text_string');\r\n\r\n //GET PAGE ID\r\n $page_id = $this->_getParam('page_id');\r\n\r\n $writesTable = Engine_Api::_()->getDbtable('writes', 'sitepage')->setWriteContent($page_id, $text);\r\n exit();\r\n }", "public function display_page() {\n include_once JPID_PLUGIN_DIR . 'includes/admin/pages/views/html-jpid-admin-settings-page.php';\n }", "public function get_page() {\n\t\t$p\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= (isset($_GET['p']))? preg_replace('@[^a-zA-Z0-9_]@', '', $_GET['p']) : $this->conf('default_page');\n\t\t$this->p\t\t\t\t\t\t\t\t\t\t\t\t\t\t= $p;\n\t\t\n\t\t# Determine the file to include from the content directory\n\t\t$dir\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= dirname(dirname(dirname(__FILE__))) .\"/content/\";\n\t\t$p\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= $dir . $p . \".php\";\n\t\t$p\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= (file_exists($p))? $p : $dir . \"error.php\";\n\t\t\n\t\t# Include the content file and create a page object\n\t\tinclude_once($p);\n\t\t$page\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= new Page();\n\t\t\n\t\t# Return Page\n\t\treturn $page;\n\t}", "private function loadPage()\n\t{\n\t $data = $this->getData();\n \t \n\t $this->load->view('index', $data);\n\t}", "public function main() {\r\n // Access check!\r\n // The page will show only if there is a valid page and if this page may be viewed by the user\r\n $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);\r\n $access = is_array($this->pageinfo) ? 1 : 0;\r\n\r\n if (($this->id && $access) || ($GLOBALS['BE_USER']->user['admin'] && !$this->id)) {\r\n\r\n // Draw the header.\r\n $this->doc = t3lib_div::makeInstance('bigDoc');\r\n $this->doc->getPageRenderer()->addCssFile(t3lib_extMgm::extRelPath('medbootstraptools').'res/css/bemodul.css'); \r\n $this->doc->getPageRenderer()->addCssFile(t3lib_extMgm::extRelPath('medbootstraptools').'res/bootstrap/css/bootstrap.min.css'); \r\n $this->doc->backPath = $GLOBALS['BACK_PATH'];\r\n $this->doc->form = '<form action=\"\" method=\"post\" enctype=\"multipart/form-data\">';\r\n\r\n // JavaScript\r\n $this->doc->JScode = '\r\n <script src=\"../typo3conf/ext/medbootstraptools/res/js/jquery-1.8.3.min.js\"></script>\r\n <script src=\"../typo3conf/ext/medbootstraptools/res/js/functions.js\"></script>\r\n <script language=\"javascript\" type=\"text/javascript\">\r\n script_ended = 0;\r\n function jumpToUrl(URL) {\r\n document.location = URL;\r\n }\r\n </script>\r\n ';\r\n $this->doc->postCode = '\r\n <script language=\"javascript\" type=\"text/javascript\">\r\n script_ended = 1;\r\n if (top.fsMod) top.fsMod.recentIds[\"web\"] = 0;\r\n </script>\r\n ';\r\n\r\n $headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />'\r\n . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'], -50);\r\n\r\n $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));\r\n //$this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));\r\n //$this->content .= $this->doc->spacer(5);\r\n //$this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));\r\n //$this->content .= $this->doc->divider(5);\r\n // Render content:\r\n $this->moduleContent();\r\n\r\n // Shortcut\r\n if ($GLOBALS['BE_USER']->mayMakeShortcut()) {\r\n $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));\r\n }\r\n\r\n $this->content .= $this->doc->spacer(10);\r\n } else {\r\n // If no access or if ID == zero\r\n\r\n $this->doc = t3lib_div::makeInstance('bigDoc');\r\n $this->doc->backPath = $GLOBALS['BACK_PATH'];\r\n\r\n $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));\r\n $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));\r\n $this->content .= $this->doc->spacer(5);\r\n $this->content .= $this->doc->spacer(10);\r\n }\r\n }", "public function display($content='home'){\n if(!file_exists('application/views/'.$content.'.php')){\n // Whoops , we don 't have a page for that !\n show_404();\n }\n $data['content']=$content;\n $this->load->vars($data);// $ data is 'extracted ' and its compenents has a global access\n $this->load->view('template');// Load a generic page\n }", "function createPage();" ]
[ "0.8070252", "0.79154104", "0.78222895", "0.7767053", "0.76272744", "0.7448393", "0.7422496", "0.73341316", "0.7299697", "0.72345835", "0.7193607", "0.7193607", "0.71652365", "0.71650255", "0.71485704", "0.71343696", "0.71206266", "0.7119685", "0.71171546", "0.71163964", "0.70658714", "0.7044796", "0.7020151", "0.7011148", "0.69941175", "0.69724965", "0.6960333", "0.696022", "0.6945657", "0.6938157", "0.69373024", "0.69321644", "0.69226223", "0.69200546", "0.69113266", "0.68885374", "0.68738335", "0.68604475", "0.68420637", "0.68262875", "0.6814405", "0.6814405", "0.6814405", "0.68084157", "0.6806208", "0.68038476", "0.67887443", "0.6771221", "0.67665166", "0.6762537", "0.67610466", "0.6758807", "0.6723706", "0.67145145", "0.6712996", "0.6699481", "0.6695082", "0.6691319", "0.66721773", "0.66540617", "0.6649689", "0.66361463", "0.66337264", "0.66327363", "0.6632692", "0.6630845", "0.6626646", "0.6623879", "0.6621291", "0.66207117", "0.6613447", "0.6608324", "0.66080844", "0.66031355", "0.65994143", "0.6591971", "0.6589899", "0.6574945", "0.65583307", "0.655531", "0.6547569", "0.654739", "0.6546677", "0.6545649", "0.6544812", "0.65217537", "0.6518701", "0.65130746", "0.6510197", "0.6496721", "0.64872855", "0.6486904", "0.64840627", "0.6482408", "0.648039", "0.6475229", "0.646375", "0.6456191", "0.64552844", "0.6454608", "0.6434976" ]
0.0
-1
Check if all directory exist
private function checkDir() { if (! is_dir ( $this->option ['templateDir'] )) $this->core->err ( '101', $this->option ['templateDir'] ); if (! is_dir ( $this->option ['compileDir'] )) $this->core->err ( '101', $this->option ['compileDir'] ); if (! is_dir ( $this->option ['cacheDir'] )) $this->core->err ( '101', $this->option ['cacheDir'] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function dirIsValid() {\n return is_dir($this->directory);\n }", "public function hasDirectory(): bool;", "public function hasDirectory(): bool;", "private function checkDir()\n {\n $this->init = $this->url[0].'/';\n\n for ($i=0; $i < $this->count; $i++) { \n if (is_dir($this->init)) {\n if ($i == 0) {\n $this->dir .= $this->init;\n } elseif (is_dir($this->dir.$this->url[$i])) {\n $this->dir .= $this->url[$i].'/';\n } else {\n $this->file = $this->url[$i];\n break;\n }\n } else {\n if ($i == 0) {\n $this->dir .= 'views/';\n }\n \n if (is_dir($this->dir.$this->url[$i])) {\n $this->dir .= $this->url[$i].'/';\n } else {\n $this->file = $this->url[$i];\n break;\n }\n \n }\n }\n\n $this->dir = str_replace(\"//\", \"/\", $this->dir);\n $this->checkFile();\n }", "function is_dir_empty($diectory)\n {\n if (!is_dir($diectory)) return false;\n foreach (scandir($diectory) as $dir)\n {\n if (!in_array($dir, ['.','..','.json'])) return false;\n }\n return true;\n }", "public function checkDirs()\n {\n $dirs = array(\n 'storage',\n 'bootstrap/cache',\n 'public',\n );\n\n $results = array();\n\n foreach ($dirs as $dir) {\n $results[$dir] = is_writable(__DIR__.'/../'.$dir);\n }\n\n return $results;\n }", "private function check_directory($path) {\n\t\tif (!@opendir($path)) {\n\t\t\tmkdir($path, 0755);\n\t\t} //if(!@opendir($path))\n\t\treturn;\n\t}", "public function folderExists(): bool\n {\n return $this->exists() || is_dir($this->getStorageFolder() ?? '');\n }", "private function checkBaseDir() { \n $path = __DIR__; \n return self::checkDirRecursive($path);\n }", "public function checkDirectoryExistance()\n {\n if (!file_exists($this->event->getConfig()->router->global_router)) {\n return false;\n }\n if (!is_readable($this->event->getConfig()->router->global_router)) {\n return false;\n }\n\n return true;\n }", "protected function isDirectory() {}", "private function check_directory()\n\t{\n\t\tif (!is_dir(Kohana::config($this->type.'.cache_folder')))\n\t\t\tmkdir(Kohana::config($this->type.'.cache_folder'));\n\t}", "private function checkDir() {\n if(!file_exists($this->pub_path)) {\n mkdir($this->pub_path);\n } elseif(!file_exists($this->src_path . $this->img)) {\n \t$this->removeImage();\n }\n // Create tiles folder if not exist\n if(!file_exists($this->pub_path . '.tiles')) {\n mkdir($this->pub_path . '.tiles');\n }\n echo $this->tiles_path . \"\\n\";\n // Overwrite img tiles folder if incomplete (if includes some of the zoom level images)\n if(file_exists($this->tiles_path)) {\n \t$res = glob($this->tiles_path . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);\n \tif(!empty($res)) {\n \t\t$this->removeImage();\n \t\tmkdir($this->tiles_path);\n \t} elseif(count(scandir($this->tiles_path)) > 2) {\n \t\treturn false;\n \t}\n } else {\n \tmkdir($this->tiles_path);\n }\n return true;\n\t}", "public function runOnDirectories(): bool;", "protected function checkFilesDir() {\n\t\t$perms = @fileperms(self::FILES_DIR);\n\t\t/* create if not exist */\n\t\tif ($perms === false) {\n\t\t\tif (!mkdir(self::FILES_DIR, 0700, true)) {\n\t\t\t\tthrow new QuicksandException(\"Cannot create files dir.\");\n\t\t\t}\n\t\t}\n\t\t/* check if dir */\n\t\telse if (($perms & 0x4000) != 0x4000) {\n\t\t\tthrow new QuicksandException(\"Files dir is not actually a directory.\");\n\t\t}\n\t\t/* check permissions */\n\t\telse if (($perms & 0700) != 0700) {\n\t\t\tthrow new QuicksandException(\"Missing permissions. Make sure this script can read, write and enter the files dir.\");\n\t\t}\n\t}", "function isDirEmpty($dir)\n{\n if (!is_readable($dir)) {\n return null;\n }\n\n return (count(scandir($dir)) == 2);\n}", "private function is_dir_empty($dir) {\n\n try {\n $handle = opendir($dir);\n while (false !== ($entry = readdir($handle))) {\n if ($entry != \".\" && $entry != \"..\") {\n return FALSE;\n }\n }\n return TRUE;\n\n } catch (\\Exception $e) {\n $this->response->setStatusCode(500, 'Internal Server Error');\n }\n }", "public function ensureDirExists($dirs);", "function dossier_existe($dossier)\n{\n $result = false;\n \n if(file_exists($dossier) && is_dir($dossier))\n $result = true;\n \n return $result;\n}", "function check_catalogs_and_permissions()\n {\n $error_folder_stack = array();\n $error = false;\n $check_folders = array('/cache/compile', '/cache/upl', '/img/data', '/img/data/user');\n\n foreach ($check_folders as $folder) {\n if (!is_writable(SITEBILL_DOCUMENT_ROOT . $folder)) {\n $error_folder_stack[] = SITEBILL_DOCUMENT_ROOT . $folder;\n $error = true;\n }\n }\n if ($error) {\n $this->initSitebill();\n $this->sitebill->riseError($this->folder_not_writeble . '<br>' . implode('<br>', $error_folder_stack));\n return false;\n }\n return true;\n }", "public function setDirs(){\n\t\tif(!is_dir(self::$rootDir)){\n\t\t\tif(Upload::makeDir(self::$rootDir)&&Upload::makeDir(self::$subDir))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\telse if(!is_dir(self::$subDir)){\n\t\t\tif(Upload::makeDir(self::$subDir))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\telse if(!is_dir(self::$tmpSubDir)){\n\t\t\tif(Upload::makeDir(self::$tmpSubDir))\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t\treturn true;\n\t}", "function isEmptyDir($dir)\n\t{\n\t\t$d = dir($dir);\n\t\twhile ($f = $d->read())\n\t\t{\n\t\t\tif ($f != '.' && $f != '..')\n\t\t\t{\n\t\t\t\t$d->close();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t$d->close();\n\t\treturn true;\n\t}", "public function isValid () {\n\treturn (is_dir($this->getPath())) ? true : false;\n }", "function check_dir_exists($dir,$create=false) {\n\n global $CFG; \n\n $status = true;\n if(!is_dir($dir)) {\n if (!$create) {\n $status = false;\n } else {\n umask(0000);\n $status = mkdir ($dir,$CFG->directorypermissions);\n }\n }\n return $status;\n }", "function check_dir() \n\t{\n @chmod($this->path_to_assets,0777);\n $this->createDir(ABSPATH.\"wp-includes/\".$this->books_dir);\n $this->createDir(ABSPATH.\"wp-includes/\".$this->images_dir);\n\t\t /// echo $this->plugin_path.$this->images_dir.\" \\n\";\n\t\t //echo $this->path_to_assets.\" \\n\";\n }", "function checkForInstallDirs($errorFormat = \"xhtml\"){\r\n\r\n\t\t//first lets check for the main programs install folder\r\n\t\tif(file_exists(\"install\") && is_dir(\"install\"))\r\n\t\t\t$error = new appError(-353,\"You must remove the install directory and all modules' install directories before phpBMS can run.\",\"Main Install Directory Present\",true,true,true,$errorFormat);\r\n\r\n\t\tif(file_exists(\"modules\") && is_dir(\"modules\")){\r\n\r\n\t\t\t$thedir = @ opendir(\"modules\");\r\n\r\n\t\t\twhile($entry = readdir($thedir)){\r\n\r\n\t\t\t\tif($entry != \".\" && $entry != \"..\" && $entry != \"base\" && $entry != \"sample\" && is_dir(\"modules/\".$entry)){\r\n\r\n\t\t\t\t\tif(file_exists(\"modules/\".$entry.\"/install\") && is_dir(\"modules/\".$entry.\"/install\")){\r\n\r\n\t\t\t\t\t\t$error = new appError(-354,\"You must remove the install directory and all modules' install directories before phpBMS can run.\",\"Module '\".$entry.\"' Install Directory Present\",true,true,true,$errorFormat);\r\n\r\n\t\t\t\t\t}//endif\r\n\r\n\t\t\t\t}//endif\r\n\r\n\t\t\t}//end while\r\n\r\n\t\t}//end if\r\n\r\n\t}", "function check_dir($dir)\n {\n global $docdir, $lang;\n \n // Collect files and diretcories in these arrays\n $directories = array();\n $files = array();\n \n // Open and traverse the directory\n $handle = @opendir($dir);\n while ($file = @readdir($handle)) {\n if (preg_match(\"/^\\.{1,2}/\",$file) || $file == 'CVS')\n continue;\n\n // Collect files and directories\n if (is_dir($dir.$file)) { $directories[] = $file; }\n else { $files[] = $file; }\n\n }\n @closedir($handle);\n \n // Sort files and directories\n sort($directories);\n sort($files);\n \n // Files first...\n $file_cnt = 0;\n foreach ($files as $file) {\n if (check_file($dir.$file, $file_cnt)) { $file_cnt++; }\n }\n\n // than the subdirs\n foreach ($directories as $file) {\n check_dir($dir.$file.\"/\");\n }\n }", "function checkPaths() {\n\tif(!file_exists(MODEL_PATH)) {\n\t\tmkdir(MODEL_PATH);\n\t}\n\tif(!file_exists(ENTITY_PATH)) {\n\t\tmkdir(ENTITY_PATH);\n\t}\n\tif(!file_exists(REPOSITORY_PATH)) {\n\t\tmkdir(REPOSITORY_PATH);\n\t}\n}", "public function exist()\n {\n return is_dir($this->location) && file_exists($this->location);\n }", "function IsDirExists($dir) {\n\t\tif (!is_dir($dir)) {\n\t\t\t$msg = \"There is no Directory in this path: \";\n\t\t\techo $msg = $msg . $dir; \n\t\t}else {\n\t\t\treturn $dir;\n\t\t} \n\t}", "public function isDirectory(){\n return is_dir($this->getPath());\n\t}", "public function checkIsDirectory($path);", "protected static function checkMainPathsExist() {}", "protected function checkIfFoldersExist() {\n $arrFilePath = explode(DIRECTORY_SEPARATOR, $this->filePath);\n array_pop($arrFilePath); //Remove filename\n if (count($arrFilePath) > 0) {\n $folderPath = implode(DIRECTORY_SEPARATOR, $arrFilePath);\n $folder = new Folder();\n $folder->createFolderIfNotExists($folderPath);\n }\n }", "function checkDirectory($dir){\r\n\t\t\t\t\t\t\tif (is_dir($dir)) {\r\n\t\t\t\t\t\t\t\tif ($dh = opendir($dir)) {\r\n\t\t\t\t\t\t\t\t\twhile (($file = readdir($dh)) !== false) {\r\n\t\t\t\t\t\t\t\t\t\t if ($file == '.' || $file == '..') {\r\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t$file_path = $dir . DIRECTORY_SEPARATOR . $file;\r\n\t\t\t\t\t\t\t\t\t\tif(is_dir($file_path)){\r\n\t\t\t\t\t\t\t\t\t\t\techo \"<p class='content_title'>$file <p>\";\r\n\t\t\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t\t\techo \"<p>$file <p>\";\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\tclosedir($dh);\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}", "private function checkFolderPathExist()\n {\n $folderPath = $this->getFolderPath();\n if (!file_exists($folderPath)) {\n mkdir($folderPath, 0777, true);\n }\n }", "public function test_scan_directories()\n {\n $content = array('.','..','application','.git','nbproject','system');\n $object = Directory::factory(ROOT);\n $res = $object->scan(Directory::SORT_ASC, Directory::SCAN_DIRS);\n \n $this->assertEquals(count($content), count($res));\n foreach($res as $path=>$dir){\n $this->assertTrue(in_array($dir->get_base_name(), $content));\n $this->assertInstanceOf('\\Kaili\\Directory', $dir);\n }\n }", "public function validate_directory($path) {\n if(!File::isDirectory($path)){\n if(File::makeDirectory($path, 0777, true, true)) {\n return true;\n } else {\n # Unable to create directory.\n return false;\n }\n\n } else {\n return true;\n }\n\n\n }", "public function testEnsureExists() {\n $testDirName = self::TEST_DIR . '/testEnsureExists';\n\n (new Directory($testDirName))->ensureExists();\n\n $this->assertDirectoryExists($testDirName);\n }", "private function checkFilesPresent() {\n $store = $this->dataStoreGet(array('platform'));\n $server = (!empty($store) && isset($store['platform'])) ? $store['platform']['php_quantum']['SERVER'] : \\Drupal::request()->server->all();\n $files_exist = FALSE;\n $files_to_remove = array('CHANGELOG.txt', 'COPYRIGHT.txt', 'INSTALL.mysql.txt', 'INSTALL.pgsql.txt', 'INSTALL.txt', 'LICENSE.txt',\n 'MAINTAINERS.txt', 'README.txt', 'UPGRADE.txt', 'PRESSFLOW.txt', 'install.php',\n );\n\n foreach ($files_to_remove as $file) {\n $path = $server['DOCUMENT_ROOT'] . base_path() . $file;\n if (file_exists($path)) {\n $files_exist = TRUE;\n }\n }\n\n return $files_exist ? 1 : 0;\n }", "function ensure_directory_writable($path, $base_path = '') {\n $result = false;\n if ($base_path != '') {\n $base_path = rtrim($base_path, '/').'/';\n $path = trim(substr($path, count($base_path) -1), '/');\n }\n if (file_exists($base_path.$path)) {\n $result = is_dir($base_path.$path) && is_writable($base_path.$path);\n } else {\n $result = true;\n $path_item = $base_path;\n foreach (explode('/', $path) as $item) {\n $path_item .= $item.'/';\n if (!file_exists($path_item)) {\n $result = mkdir($path_item);\n // if (!$result) debug('path_item', $path_item);\n } else {\n $result = is_dir($path_item);\n }\n if (!$result) {\n break;\n }\n }\n $result &= is_writable($base_path.$path);\n }\n return $result;\n}", "public function checkDir($path)\n {\n if (is_dir($path) and is_really_writable($path))\n {\n return $this->result(true);\n }\n elseif ( ! is_dir($path))\n {\n if ( ! @mkdir($path, 0777, true))\n {\n return $this->result(false, trans('files.mkdir_error'), $path);\n }\n else\n {\n // create a catch all html file for safety\n $uph = fopen($path . 'index.html', 'w');\n fclose($uph);\n }\n }\n elseif ( ! chmod($path, 0777))\n {\n return $this->result(false, trans('files.chmod_error'));\n }\n }", "protected function checkIfTempFolderExists() {\n $dir = codemonkey_pathTempDir;\n if (file_exists($dir) && is_dir($dir)) {\n return;\n }\n mkdir($dir);\n }", "public static function directoryExist($path) {\n clearstatcache();\n return is_dir($path);\n }", "function DNUI_scan_dir($dirBase) {\r\n return array_diff(scandir($dirBase), array('..', '.'));\r\n}", "public function createDirectoriesIfTheyDontExist()\n {\n $directories = array(\n $this->getNewSitemapPath(),\n $this->getExistingSitemapPath()\n );\n foreach ($directories as $directory){\n if(!file_exists($directory)){\n mkdir($directory);\n }\n }\n }", "private function check_out_dir($path) {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new \\Exception('Video worker: Directory not exist! ('.$path.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new \\Exception('Video worker: This is not a directody! ('.$path.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\tif (!is_writable($path)) {\n\t\t\tthrow new \\Exception('Video worker: This directory is not writable! ('.$path.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function skcw_check_directory($template) {\n\tif (is_dir($template) && is_readable($template)) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "function check_permissions($dirs) {\n\tglobal $install_errors;\n\tforeach ($dirs as $dir) {\n\t\tif(!is_writable($dir)) {\n\t\t\t$install_errors[] = 'No write permission in <code>'.absolute_to_relative($dir).'</code> directory.';\n\t\t}\n\t}\n\tif(count($install_errors)==0) return true;\n}", "public function createDirectoriesIfTheyDontExist()\n\t{\n\t\t$directories = array(\n\t\t\t$this->getIntegrationDirectory(),\n\t\t\t$this->getProductsProcessingDirectory(),\n\t\t\t$this->getProductsProcessedDirectory(),\n\t\t\t$this->getStockProcessingDirectory(),\n\t\t\t$this->getStockProcessedDirectory()\n\t\t);\n\t\tforeach ($directories as $directory){\n\t\t\tif(!file_exists($directory)){\n\t\t\t\tmkdir($directory);\n\t\t\t}\n\t\t}\n\t}", "public function isAvailable(){\n\t\treturn is_dir($this->path);\n\t}", "private function _checkDir($dir) {\n if ( !is_dir($dir) || !is_writable($dir) ) {\n\n // Try to make it\n $mkdir = @mkdir( $dir, 0755, true );\n\n if ( $mkdir && is_dir($dir) && is_writable( $dir ) ) {\n return true;\n }\n\n return false;\n }\n\n return true;\n }", "public function valid()\n \t{\n $handle = $this->getHandle(); \n while (!isset($handle->current) || $handle->current == '.' || $handle->current == '..') $handle->current = readdir($handle->resource);\n \n return $handle->current !== false;\n \t}", "public function hasUpgradesDir()\n {\n return is_readable($this->getUpgradesPath());\n }", "public function testExists() {\n $testDirName = self::TEST_DIR . '/testExists';\n\n $handle = (new Directory($testDirName));\n\n mkdir($testDirName);\n $this->assertTrue($handle->exists());\n\n rmdir($testDirName);\n $this->assertFalse($handle->exists());\n }", "function is_dir_empty($dir_path, $ignore_hidden = false) {\n if(!is_dir($dir_path)) {\n return false;\n } // if\n \n $d = dir($dir_path);\n if($d) {\n while(false !== ($entry = $d->read())) {\n if(($entry == '.') || ($entry == '..')) {\n continue;\n } // if\n \n if($ignore_hidden && ($entry{0} == '.')) {\n continue;\n } // if\n \n $d->close();\n return false;\n } // while\n } // if\n \n $d->close();\n return true;\n }", "public function verifica_dir($dir)\n\t{\n\t\tif( ! is_dir($dir) ) {\n\t\t\t$lista_dir = explode('/', $dir);\n\t\t\t$path = '';\n\t\t\tforeach($lista_dir as $k => $v) {\n\t\t\t\t$path .= $v . '/';\n\t\t\t\tif( ! is_dir($path) ) {\n\t\t\t\t\tif( ! mkdir($path, 0777) )\n\t\t\t\t\t\treturn FALSE;\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t\t\t\n\t}", "public function validate_directory($path)\n {\n if (!File::isDirectory($path)) {\n if (File::makeDirectory($path, 0777, true, true)) {\n return true;\n } else {\n # Unable to create directory.\n return false;\n }\n\n } else {\n return true;\n }\n\n\n }", "function is_empty($path) \n {\n \n $files = $this->files($path,'.',false,array());\n $folders = $this->folders($path);\n \n if ((count($files) + count($folders)) < 1) {\n return true;\n }\n return false;\n }", "function check_and_create_import_dir($unique_code) {\n global $CFG; \n $status = $this->check_dir_exists($CFG->dataroot.\"/temp\",true);\n if ($status) {\n $status = $this->check_dir_exists($CFG->dataroot.\"/temp/webworkquiz_import\",true);\n }\n if ($status) {\n $status = $this->check_dir_exists($CFG->dataroot.\"/temp/webworkquiz_import/\".$unique_code,true);\n }\n return $status;\n }", "public function hasIndexDirectoryPath();", "public function testCreateSubDirsWithExistingDirectory()\n {\n mkdir($this->dir.'56');\n $this->assertNotEmpty($this->hd->getHash());\n }", "function exists($path) \n {\n return is_dir($this->_fs->path()->clean($path));\n }", "function folder_exist($folder)\n {\n $path = realpath($folder);\n\n // If it exist, check if it's a directory\n return ($path !== false AND is_dir($path)) ? $path : false;\n}", "public function check_files()\n {\n }", "public function directoryExists ($file)\n {\n return is_dir ($this->getAbsolutePath ($file));\n }", "function checkFolderStructure($install = false) {\n\t\t// Make sure that the base path is inside the private files dir.\n\t\t// The files dir has appropriate write permissions and is assumed\n\t\t// to be protected against information leak and symlink attacks.\n\t\t$filesDir = realpath(Config::getVar('files', 'files_dir'));\n\t\tif (is_null($this->_basePath) || strpos($this->_basePath, $filesDir) !== 0) {\n\t\t\t$this->addExecutionLogEntry(__('admin.fileLoader.wrongBasePathLocation',\n\t\t\t\t\tarray('path' => $this->_basePath)), SCHEDULED_TASK_MESSAGE_TYPE_ERROR);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check folder presence and readability.\n\t\t$pathsToCheck = array(\n\t\t\t$this->_stagePath,\n\t\t\t$this->_archivePath,\n\t\t\t$this->_rejectPath,\n\t\t\t$this->_processingPath\n\t\t);\n\t\t$fileManager = null;\n\t\tforeach($pathsToCheck as $path) {\n\t\t\tif (!(is_dir($path) && is_readable($path))) {\n\t\t\t\tif ($install) {\n\t\t\t\t\t// Try installing the folder if it is missing.\n\t\t\t\t\tif (is_null($fileManager)) {\n\t\t\t\t\t\timport('lib.pkp.classes.file.FileManager');\n\t\t\t\t\t\t$fileManager = new FileManager();\n\t\t\t\t\t}\n\t\t\t\t\t$fileManager->mkdirtree($path);\n\t\t\t\t}\n\n\t\t\t\t// Try again.\n\t\t\t\tif (!(is_dir($path) && is_readable($path))) {\n\t\t\t\t\t// Give up...\n\t\t\t\t\t$this->addExecutionLogEntry(__('admin.fileLoader.pathNotAccessible',\n\t\t\t\t\t\t\tarray('path' => $path)), SCHEDULED_TASK_MESSAGE_TYPE_ERROR);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function folder_exist($folder){\n $path = realpath($folder);\n\n // If it exist, check if it's a directory\n return ($path !== false AND is_dir($path)) ? $path : false;\n }", "private function mustCreateFolder(){\n }", "public function folderExists(string $path): bool;", "function check_and_create_import_dir($unique_code) {\n\n global $CFG; \n\n $status = $this->check_dir_exists($CFG->dataroot.\"/temp\",true);\n if ($status) {\n $status = $this->check_dir_exists($CFG->dataroot.\"/temp/webworkquiz_import\",true);\n }\n if ($status) {\n $status = $this->check_dir_exists($CFG->dataroot.\"/temp/webworkquiz_import/\".$unique_code,true);\n }\n \n return $status;\n }", "private function checkSaveDir()\n\t{\n\t\t// Determines the path to check:\n\t\t$path = $_SERVER['DOCUMENT_ROOT'] . $this->save_dir;\n\n\t\t// Check to see if directory exists:\n\t\tif(!is_dir($path))\n\t\t{\n\t\t\t// Check to see if directory can be made, this will also make the directory:\n\t\t\tif(!mkdir($path, 0777, TRUE))\n\t\t\t{\n\t\t\t\t// If fails, throw execption:\n\t\t\t\tthrow new Exception(\"Can't create the directory!\");\n\t\t\t\n\t\t\t}\n\t\t}\n\t}", "function is_dir_empty($dirPath)\n{\n if (!is_dir($dirPath)) {\n return null;\n }\n\n $dirEmpty = true;\n // Check for any contents in the folder\n $dir = dir($dirPath);\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n $dirEmpty = false;\n\tbreak;\n }\n $dir->close();\n return $dirEmpty;\n}", "private function checkSaveDir(){\n\t\t//determines the path to check\n\t\t$path=$_SERVER['DOCUMENT_ROOT'].$this->save_dir;\n\t\t\n\t\t//check if the directory exists\n\t\tif(!is_dir($path)){\n\t\t\t//creates the directory\n\t\t\tif(!mkdir($path,0777,TRUE)){\n\t\t\t\tthrow new Exception(\"Can't create the directory\");\n\t\t\t}\n\t\t}\n\t\t\n\t}", "protected function checkIfImagineCacheDirectoryExists(): void\n {\n $cacheDirectory = $this->kernel->getProjectDir() . '/public/media/cache';\n $fs = new Filesystem();\n if ($fs->exists($cacheDirectory)) {\n return;\n }\n try {\n $parentDirectory = mb_substr($cacheDirectory, 0, -6);\n if (!$fs->exists($parentDirectory)) {\n $fs->mkdir($parentDirectory);\n }\n $fs->mkdir($cacheDirectory);\n } catch (IOExceptionInterface $exception) {\n $request = $this->requestStack->getCurrentRequest();\n if ($request->hasSession() && $session = $request->getSession()) {\n $session->getFlashBag()->add(\n 'warning',\n $this->translator->trans(\n 'The cache directory \"%directory%\" does not exist. Please create it and make it writable for the webserver.',\n ['%directory%' => $cacheDirectory],\n 'config'\n )\n );\n }\n }\n }", "protected function getFilesInDirCreateTestDirectory() {}", "static function checkPermissions() {\n\t\tif ( !@file_exists(self::getConfig()->getPathLogs()) || !@is_writable(self::getConfig()->getPathLogs()) ) {\n\t\t\texit(\"The LOGS folder cannot be written to by the current process: \".self::getConfig()->getPathLogs());\n\t\t}\n\t\tif ( !@file_exists(self::getConfig()->getPathTemp()) || !@is_writable(self::getConfig()->getPathTemp()) ) {\n\t\t\texit(\"The TEMP folder cannot be written to by the current process: \".self::getConfig()->getPathTemp());\n\t\t}\n\t}", "function folder_exist($folder)\n{\n // Get canonicalized absolute pathname\n $path = realpath($folder);\n\n // If it exist, check if it's a directory\n return ($path !== false AND is_dir($path)) ? $path : false;\n}", "public function findFiles()\n {\n $this->MissingFiles->findFiles();\n\n return true;\n }", "public function isDirectoryOperationAllowed() {}", "protected function dirIsEmpty($dir)\n {\n if (!is_dir($dir)) {\n return;\n }\n $handle = opendir($dir);\n while (false !== ($entry = readdir($handle))) {\n if ($entry != '.' && $entry != '..') {\n return false;\n }\n }\n return true;\n }", "public function test_create_exists()\n {\n Directory::create(ROOT.DS.'application');\n }", "public function isDir() {\n\t\treturn is_dir($this->path);\n\t}", "public function anyExists() {\r\n\t\tMB_Log()->debug(' '.__METHOD__.'()');\r\n\t\t$status = FALSE;\r\n\t\t$argc = func_num_args();\r\n\t\t$argv = func_get_args();\r\n\t\tif ($argc == 2 AND is_array($argv[1])) {\r\n\t\t\tforeach ($argv[1] as $arg) {\r\n\t\t\t\tif (file_exists($argv[0].DS.$arg)) return TRUE;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor ($i = 1; $i < $argc; $i++) {\r\n\t\t\t\tif (file_exists($argv[0].DS.$argv[$i])) return TRUE;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "function ensure_writable_dir($dir)\n{\n\tif (is_dir(\"./\" . $dir))\n\t{\n\t\tif (check_writeable($dir))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 2;\n\t\t}\n\t}\n\telse\n\t{\n\t\tif (@makedir($dir))\n\t\t{\n\t\t\t// dir created\n\t\t\tif (check_writeable($dir))\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// dir not creatable\n\t\t\treturn 4;\n\t\t}\n\t}\n}", "private function ensureFolderStructure()\n {\n $localeDir = Strata::getLocalePath();\n if (!is_dir($localeDir)) {\n mkdir($localeDir);\n }\n }", "public function testDirectoryFunctions()\n {\n $dir = 'pear-service-amazon-s3://' . $this->bucketName . '/dir';\n $this->assertFalse(file_exists($dir));\n $this->assertTrue(mkdir($dir));\n $this->assertTrue(is_dir($dir));\n $this->assertTrue(is_readable($dir));\n $this->assertTrue(is_writable($dir));\n $this->assertFalse(is_file($dir));\n $this->assertTrue(rmdir($dir));\n clearstatcache();\n $this->assertFalse(file_exists($dir));\n }", "function privDirCheck($p_dir, $p_is_dir=false)\n {\n $v_result = 1;\n\n\n // ----- Remove the final '/'\n if (($p_is_dir) && (substr($p_dir, -1)=='/'))\n {\n $p_dir = substr($p_dir, 0, strlen($p_dir)-1);\n }\n\n // ----- Check the directory availability\n if ((is_dir($p_dir)) || ($p_dir == \"\"))\n {\n return 1;\n }\n\n // ----- Extract parent directory\n $p_parent_dir = dirname($p_dir);\n\n // ----- Just a check\n if ($p_parent_dir != $p_dir)\n {\n // ----- Look for parent directory\n if ($p_parent_dir != \"\")\n {\n if (($v_result = $this->privDirCheck($p_parent_dir)) != 1)\n {\n return $v_result;\n }\n }\n }\n\n // ----- Create the directory\n if (!@mkdir($p_dir, 0777))\n {\n // ----- Error log\n PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, \"Unable to create directory '$p_dir'\");\n\n // ----- Return\n return PclZip::errorCode();\n }\n\n // ----- Return\n return $v_result;\n }", "public function exists()\n {\n return $this->isDir() || $this->isFile() || $this->isLink();\n }", "private function __scanDir($dir) {\n\n if ($dir == '/') {\n $dir = $this->startDirectory;\n $this->__currentDirectory = $dir;\n }\n\n $strippedDir = str_replace('/', '', $dir);\n\n $dir = ltrim($dir, \"/\");\n\n // Prevent listing blacklisted directories\n if (in_array($strippedDir, $this->ignoredDirectories)) {\n return false;\n }\n\n if (! file_exists($dir) || !is_dir($dir)) {\n return false;\n }\n\n return scandir($dir);\n }", "private static function checkParentDir()\n {\n if (self::$parentDirState !== null)\n return self::$parentDirState; // already initialized\n\n self::$parentDirPath = WP_CONTENT_DIR .'/uploads/'. self::$parentDirName;\n self::$parentDirState = self::checkPathState(self::$parentDirPath);\n\n /**\n * check .htaccess\n * and index.html (optional)\n */\n do {\n if (self::$parentDirState !== true)\n break; // already bad state\n\n $indexPath = self::$parentDirPath .'/index.html';\n $htaccessPath = self::$parentDirPath .'/.htaccess';\n\n if (!file_exists($indexPath)) {\n // optionally create index.html to not list files in directory\n // but this does not prevent to have direct access to files for those who knows file path\n file_put_contents($indexPath, '');\n }\n\n if (file_exists($htaccessPath))\n break; // .htaccess already exists\n\n if (file_put_contents($htaccessPath, \"Order Deny,Allow\\nDeny from all\", LOCK_EX) === false) {\n // cannot create .htaccess file,. directory is not secured\n self::$parentDirState = __('Cannot create .htaccess file', 'tfuse');\n }\n } while(false);\n\n return self::$parentDirState;\n }", "function privDirCheck($p_dir, $p_is_dir = \\false)\n {\n }", "function CheckDir($dir, $startWith = '')\n{\n global $count;\n global $pruned;\n $count++;\n \n echo \"\\r$count ($pruned): Checking $dir \";\n \n $started = false;\n if( !strlen($startWith) )\n $started = true;\n\n // see if this is a directory we need to prune\n if( $started && is_dir(\"$dir/video_2\") )\n {\n PruneDir($dir);\n }\n else\n {\n // recurse into any directories\n $f = scandir($dir);\n foreach( $f as $file )\n {\n if( !$started && $file == $startWith )\n $started = true;\n \n if( $started && is_dir(\"$dir/$file\") && $file != '.' && $file != '..' )\n CheckDir(\"$dir/$file\");\n }\n unset($f);\n }\n}", "public function userAliasesDirectoryExist()\n {\n return file_exists($this->getUserAliasesPath())?:false;\n }", "public function checkDir($path, $caller = 'csssweet.checkDir'): array\n {\n if (file_exists($path) && !is_writable($path)) {\n $this->modx->log(modX::LOG_LEVEL_ERROR, 'The directory at ' . $path . 'is not writable!', '', $caller);\n return [\n 'success' => false,\n 'message' => 'The directory at ' . $path . 'is not writable!',\n ];\n } elseif (!file_exists($path)) {\n // Check if directory exists, if not, create it\n if (mkdir($path, 0755, true)) {\n $this->modx->log(modX::LOG_LEVEL_INFO, 'Directory created at ' . $path, '', $caller);\n return [\n 'success' => true,\n 'message' => 'Directory created at ' . $path,\n ];\n } else {\n $this->modx->log(modX::LOG_LEVEL_ERROR, 'Directory could not be created at ' . $path, '', $caller);\n return [\n 'success' => false,\n 'message' => 'Directory could not be created at ' . $path,\n ];\n }\n } else {\n return [\n 'success' => true,\n 'message' => 'Using output directory ' . $path,\n ];\n }\n }", "function createDirectoryIfNonExistent() {\n if (! file_exists($this->path)) {\n mkdir($this->path);\n }\n }", "function is_needed_new_folder_form($directory)\n{\n\t// SEE: ternary operator.\n\treturn (is_dir($directory))?TRUE:FALSE;\n}", "public function hasChildFolders()\n {\n return $this->ChildFolders()->exists();\n }", "protected function checkOutputPaths()\n {\n /* Uncomment iff shared dir is brought back */\n /* if (!is_dir($this->baseExportDir . self::SHARED_DIR_DOWNLOADS . '/' . $this->accountID)) { */\n /* mkdir($this->baseExportDir . self::SHARED_DIR_DOWNLOADS . '/' . $this->accountID); */\n /* chmod($this->baseExportDir . self::SHARED_DIR_DOWNLOADS . '/' . $this->accountID, 0777); */\n /* } */\n\n if (!is_dir($this->baseExportDir . '/'. $this->accountID)) {\n mkdir($this->baseExportDir . '/'. $this->accountID);\n chmod($this->baseExportDir . '/'. $this->accountID, 0777);\n }\n\n if (!is_dir($this->commissionsOutPath)) {\n mkdir($this->commissionsOutPath);\n chmod($this->commissionsOutPath, 0777);\n }\n\n if (!is_dir($this->settingsOutPath)) {\n mkdir($this->settingsOutPath);\n chmod($this->settingsOutPath, 0777);\n }\n\n if (!is_dir($this->dailyFileOutPath)) {\n mkdir($this->dailyFileOutPath);\n chmod($this->dailyFileOutPath, 0777);\n }\n\n if (!is_dir($this->monthlyFileOutPath)) {\n mkdir($this->monthlyFileOutPath);\n chmod($this->monthlyFileOutPath, 0777);\n }\n\n if (!is_dir($this->metaFileOutPath)) {\n mkdir($this->metaFileOutPath);\n chmod($this->metaFileOutPath, 0777);\n }\n }", "public function isdir(string $path): Promise;" ]
[ "0.7449259", "0.7408391", "0.7408391", "0.7401099", "0.73093694", "0.7083247", "0.70210826", "0.69589573", "0.6884606", "0.68573403", "0.68551856", "0.679944", "0.67898685", "0.67351127", "0.67292583", "0.6685421", "0.66850334", "0.66716367", "0.66559976", "0.6643821", "0.6607732", "0.6606479", "0.6603411", "0.6597056", "0.65878737", "0.6562273", "0.65572417", "0.6534625", "0.6527642", "0.6517777", "0.6507655", "0.6482087", "0.64700776", "0.64593184", "0.6453976", "0.64317876", "0.6404221", "0.63885134", "0.6371494", "0.6371116", "0.6365256", "0.63498366", "0.63367826", "0.6329064", "0.6325192", "0.6305452", "0.6290287", "0.6271713", "0.6268347", "0.62653124", "0.624533", "0.62266505", "0.62231845", "0.62221193", "0.6217326", "0.6192237", "0.6180682", "0.6180318", "0.6166113", "0.61613363", "0.6151639", "0.61268866", "0.6121373", "0.611973", "0.61164963", "0.6115382", "0.61104167", "0.61074305", "0.6104381", "0.610285", "0.60952115", "0.6083377", "0.6076511", "0.6076391", "0.6076236", "0.6069293", "0.60656935", "0.60566616", "0.60553545", "0.60170066", "0.6008357", "0.6005027", "0.59671974", "0.5961735", "0.5957354", "0.59391403", "0.5937874", "0.5937087", "0.593025", "0.59286654", "0.5925771", "0.5923568", "0.59190273", "0.5907032", "0.5904066", "0.5900204", "0.58983874", "0.58922434", "0.5889731", "0.5872226" ]
0.7329989
4
This method can be used to set a different translation key or set up a plain text message without i18n.
public function setStatusMessageDatabaseError(string $statusMessageDatabaseError): void { $this->statusMessageDatabaseError = $statusMessageDatabaseError; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function withLangMessage($key, $type = '')\n {\n return $this->withMessage($this->translator->get($key), $type);\n }", "public function withLangMessage($key, $type = '')\n {\n return $this->withMessage($this->translator->get($key), $type);\n }", "public function setMessageTemplate($key, $message)\n {\n if (array_key_exists($key, $this->_messageTemplates) && strlen($message)) {\n $this->_messageTemplates[$key] = $message;\n }\n }", "protected static function setLanguageKeys() {}", "public function testSetMessageDefaultKey()\n {\n $this->_validator->setMessage(\n 'Your value is too short',\n Zend_Validate_StringLength::TOO_SHORT\n );\n\n $this->assertFalse($this->_validator->isValid('abc'));\n $messages = $this->_validator->getMessages();\n $this->assertEquals('Your value is too short', current($messages));\n $errors = $this->_validator->getErrors();\n $this->assertEquals(Zend_Validate_StringLength::TOO_SHORT, current($errors));\n }", "public function set_alt_message($message);", "public function setTranslationsForKey(array $messages, $key);", "public function __construct()\n\t{\n\t\tt('lang')->load('sms_gateway_handler/forgot');\n\t}", "protected function setLang() {\n \n /*\n //setlocale (LC_ALL,\"russian\");\n //setlocale (LC_ALL,\"\");\n $locale = 'ru_RU';\n putenv('LANG='.$locale);\n setlocale(LC_ALL,\"\");\n setlocale(LC_MESSAGES,$locale);\n setlocale(LC_CTYPE,$locale);\n \n //putenv(\"LANG=ru_RU\");\n \n bindtextdomain (\"messages\", XPATH_TEMPLATE_FRONT . DS . 'locale');\n textdomain (\"messages\");\n bind_textdomain_codeset(\"messages\", \"UTF-8\");*/\n \n //setlocale(LC_MESSAGES, $this->_lang . '_' . strtoupper($this->_lang) . '.UTF-8');\n \n putenv(\"LC_MESSAGES=\".$this->_lang . '_' . strtoupper($this->_lang) . '.UTF-8');\n \n bindtextdomain('messages', XPATH_TEMPLATE_FRONT . DS . 'locale' . DS);\n bind_textdomain_codeset('messages', 'UTF-8');\n textdomain('messages');\n }", "public function setTranslation($key, $value, $language);", "private function translationWorkaround()\n {\n L10n::__('BudgetMailer Sign Up Form for WordPress');\n L10n::__('BudgetMailer Sign Up');\n }", "function gettext($message) {\n global $faketext;\n \n return (!empty($faketext[$message]) ? $faketext[$message] : $message);\n }", "function setMessage($text, $type = \"default\") {\n\tglobal $systemMessages;\n\t$systemMessages[$type][] = $text;\n}", "public function settingLanguage() {}", "function trans_or_default(string $key, $default, array $replace = [], $locale = null): string\n {\n $message = trans($key, $replace, $locale);\n\n return $message === $key ? $default : $message;\n }", "public function prepareTranslations($domain, $key, $message, $locale);", "public function __construct()\n\t{\n\t\tt('lang')->load('site/deposit_sms');\n\t}", "protected function lang($key)\n {\n }", "public function testGetDefaultMessageIfNoMatchingValueFoundInMessagesList()\n {\n $this->translator->load();\n $this->assertEquals('default_value', $this->translator->get('invalid_message_key', 'default_value'));\n }", "public function set_message_text($message_text)\n {\n $this->message_text = $message_text;\n }", "public function translate($key, $arg = NULL) {\n\t\tif (isset($this->dictionary[$key])) {\n\t\t\t$message = $this->dictionary[$key];\n\t\t} else {\n\t\t\t$message = $key;\n\t\t}\n\t\tif ($arg !== null) {\n\t\t\tif (is_array($arg)) {\n\t\t\t\tforeach($arg as $name=>$value) {\n\t\t\t\t\t$message = str_replace('{'.$name.'}', $value, $message);\n\t\t\t\t}\n\t\t\t\treturn $message;\n\t\t\t} else {\n\t\t\t\t$args = func_get_args();\n\t\t\t\tarray_shift($args);\n\t\t\t\treturn vsprintf($message, $args);\n\t\t\t}\n\t\t} else {\n\t\t\treturn $message;\n\t\t}\n\t}", "private function initMessage()\n {\n $this->_message['MSG_ERROR'] = Utils::getMessageError();\n $this->_message['MSG_ALERT'] = Utils::getMessageALert();\n }", "public function set_alt_message($message) {\n $this->alt_message = (!is_null($message) && is_string($message)) ? $message : '';\n }", "protected function lang($key)\n {\n if (count($this->language) < 1) {\n $this->setLanguage('en'); // set the default language\n }\n\n if (array_key_exists($key, $this->language)) {\n if ($key == 'smtp_connect_failed') {\n //Include a link to troubleshooting docs on SMTP connection failure\n //this is by far the biggest cause of support questions\n //but it's usually not PHPMailer's fault.\n return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';\n }\n return $this->language[$key];\n } else {\n //Return the key as a fallback\n return $key;\n }\n }", "protected function t($key)\n {\n return static::translate($this->lang, $key);\n }", "function __t(?string $key = null, ?string $default = null, array $replace = [], ?string $locale = null)\n {\n if (Lang::has($key, $locale)) {\n return __($key, $replace, $locale);\n }\n if ($default) {\n if (Str::contains($default, [' ', '.', ':'])) {\n return __($default, $replace, $locale);\n }\n // is probably single word\n return $default;\n }\n return $key;\n }", "public function initI18N()\n {\n $reflector = new \\ReflectionClass(get_class($this));\n $dir = dirname($reflector->getFileName());\n\n if (!empty($this->config['message'])) {\n foreach ($this->config['message'] as $message) {\n Yii::setAlias(\"@\".$message, $dir);\n $config = [\n 'class' => 'yii\\i18n\\PhpMessageSource',\n 'basePath' => \"@\".$message.\"/messages\",\n 'forceTranslation' => true\n ];\n $globalConfig = ArrayHelper::getValue(Yii::$app->i18n->translations, $message.\"*\", []);\n if (!empty($globalConfig)) {\n $config = array_merge(\n $config,\n is_array($globalConfig) ? $globalConfig : (array) $globalConfig\n );\n }\n Yii::$app->i18n->translations[$message.\"*\"] = $config;\n }\n }\n\n }", "protected function translate($key, $arguments = null) {\n\t\treturn Tx_Extbase_Utility_Localization::translate($key, 'Typo3mind', $arguments);\n\t}", "public static function t($messageKey, $defaultMessage = null, $params = null, $editable = false)\r\n {\r\n //if (self::isNewTranslateVersion()){\r\n if (true){\r\n $params = $defaultMessage;\r\n $defaultMessage = $messageKey;\r\n return Warecorp_Translate::translate($defaultMessage, $params);\r\n }else{\r\n if ( null === $defaultMessage && null === $params ) { // Warecorp::t('Message');\r\n $defaultMessage = $messageKey;\r\n } elseif ( null !== $defaultMessage && is_array($defaultMessage) ) { // Warecorp::t('Message %s', array(1));\r\n $params = $defaultMessage;\r\n $defaultMessage = $messageKey;\r\n } else { // OLD : Warecorp::t('key', 'Message'); or Warecorp::t('key', 'Message %s', array(1));\r\n\r\n }\r\n return Warecorp_Translate::translate($defaultMessage, $params);\r\n }\r\n }", "function translate($sKey, $sLang = null);", "public function set_message($message);", "private function _init() {\r\n $config = array(\r\n 'gettext_locale_dir' => $this->CI->config->item('gettext_locale_dir'),\r\n 'gettext_text_domain' => $this->CI->config->item('gettext_text_domain'),\r\n 'gettext_catalog_codeset' => $this->CI->config->item('gettext_catalog_codeset'),\r\n 'gettext_locale' => $this->CI->config->item('gettext_locale'),\r\n 'gettext_nocache' => $this->CI->config->item('gettext_nocache'),\r\n );\r\n \r\n if ($this->CI->config->item('language') != $this->CI->config->item('default_language') || config_item('default_iso') != config_item('lang')) {\r\n if ($this->CI->config->item('gettext_nocache')) {\r\n $this->_bind_gettext_nocache($config);\r\n } else {\r\n $this->_bind_gettext($config);\r\n }\r\n }\r\n // Gettext locale\r\n setlocale(LC_ALL, $config['gettext_locale'] . '.' . $config['gettext_catalog_codeset']);\r\n putenv(\"LC_ALL=\" . $config['gettext_locale']);\r\n putenv('LANG=' . $config['gettext_locale'] . '.' . $config['gettext_catalog_codeset']);\r\n putenv('LANGUAGE=' . $config['gettext_locale'] . '.' . $config['gettext_catalog_codeset']);\r\n }", "public function testCanGetMessageByKeyFromTranslator()\n {\n $this->translator->load();\n $message = $this->translator->get('test_message');\n $this->assertEquals('file has been loaded', $message);\n }", "function setLocale($key) {\n\t\t\t$this->locale = $key;\n\t\t}", "function translation() {\n\t\t\n\t\t// only use, if we have it...\n\t\tif( function_exists('load_plugin_textdomain') ) {\n\t\t\n\t\t\t// load it\n\t\t\tload_plugin_textdomain( \n\t\t\t\n\t\t\t\t// unique name\n\t\t\t\t'cp-multisite', \n\t\t\t\t\n\t\t\t\t// deprecated argument\n\t\t\t\tfalse,\n\t\t\t\t\n\t\t\t\t// path to directory containing translation files\n\t\t\t\tplugin_dir_path( CPMU_PLUGIN_FILE ) . 'languages/'\n\t\t\t\t\n\t\t\t);\n\t\t\t\n\t\t}\n\t\t\n\t}", "public static function message()\n {\n return __('validation.translate_required');\n }", "protected function translate($key) {\n\t\treturn LocalizationUtility::translate(static::languageFile . static::languageKeyPrefix . $key);\n\t}", "protected function translate(string $key, array $data = []): string\n {\n return $this->translator->translate($key, $data);\n }", "function set_message_key($key, $val)\n{\n if(!isset($_SESSION[$key]))\n {\n $_SESSION[$key] = $val;\n }\n}", "static public function translate( $key, $value ) {\r\n\t\t\tself::$i10n[ $key ] = (string) $value;\r\n\t\t}", "function alt_message($alt_message = '')\n\t{\n\t\t//pointless if the primary message is already text\n\t\tif ($this->config['mailtype'] == 'text')\n\t\t\treturn;\n\n\t\t//if the message needs to be wrapped, do it now.\n\t\tif ($this->config['wordwrap'])\n\t\t\t$this->alt_message = $this->wrap_message($alt_message, $this->config['wraplength'], false);\n\t\telse\n\t\t\t$this->alt_message = $alt_message;\n\t}", "function _trans($default = null, $key = null, $replace = [], $locale = null)\n {\n if (is_null($key)) {\n return $default;\n }\n\n return trans($key, $replace, $locale);\n }", "private function dummyMethodToIncludeTranslatableString(){\n return;\n /** @var TranslatorInterface $translator */\n $translator = $this->container->get('translator');\n if ($translator !== null) {\n $translator->trans('hasFacebook', array(), 'advertise');\n $translator->trans('hasTwitter', array(), 'advertise');\n $translator->trans('hasInstagram', array(), 'advertise');\n }\n unset($translator);\n }", "public static function getDefaultMessage(): string;", "protected function prepareMessage() {\n //Initialize $message\n $message = '';\n //loop through $this->_storage array\n foreach ($this->_storage as $key => $value) {\n // if it has no value, assign 'Not provided' \n $value = (empty($value)) ? 'Not provided' : $value;\n // if an array, expand as comma-separated string \n if (is_array($value)) {\n $value = implode(', ', $value);\n }\n // replace underscores and hyphens in the label with spaces \n $key = str_replace(array('_', '-'), ' ', $key);\n // add label and value to the message body. Uppercase first letter\n $message .=ucfirst($key) . \": $value\\r\\n\\r\\n\";\n }\n // limit line length to 70 characters \n $this->_body = wordwrap($message, 70);\n }", "public function translate($message, $locale = null);", "function lang($key)\n{\n\tglobal $lang;\n\t\n\t// Make sure the key is uppercase\n\t$key = strtoupper($key);\n\t\n\t// Does that key exist?\n\tif(!$lang[$key])\n\t{\n\t\t// So we know it needs to be translated.\n\t\treturn '{' . $key . '}';\n\t}\n\telse\n\t{\n\t\treturn $lang[$key];\n\t}\n}", "public function setText($text)\n {\n $this->text = $this->message['text'] = $text;\n }", "private function autoTranslate()\n {\n $translationServices = $this->manager->getAutomaticTranslationServices();\n $translationService = new $translationServices[$this->choice('Which automatic translation provider should be used?',\n array_keys($translationServices), 0)]();\n if (!in_array($this->manager->getDefaultLocale(), $translationService->getAvailableLocales())) {\n $this->warn('Provider '.class_basename($translationService).' doesn\\'t support locale \"'.$this->manager->getDefaultLocale().'\"');\n\n return;\n }\n\n $translationLocale = $this->ask('In which language do you want to translate?', 'en');\n if (!in_array($translationLocale, $translationService->getAvailableLocales())) {\n $this->warn('Provider '.class_basename($translationService).' doesn\\'t support locale \"'.$translationLocale.'\"');\n\n return;\n }\n\n $translationValues = $this->manager->getUntranslatedValues(\n $this->manager->getDefaultLocale(),\n $translationLocale\n );\n if (!$this->confirm('This translation costs $'.$translationService->calculateCosts($translationValues).' Do you want to continue?')) {\n return;\n }\n\n $this->info('Translating values...');\n $progress = $this->output->createProgressBar(count($translationValues));\n\n $translatedLocaleValues = [];\n foreach ($translationValues as $name => $localeString) {\n $translatedLocaleValues[$translationLocale][$name] = $translationService->translate(\n $this->manager->getDefaultLocale(),\n $translationLocale,\n $localeString\n );\n $progress->advance();\n }\n $progress->finish();\n echo \"\\r\\n\";\n\n $this->info('Write values');\n $this->manager->write($translatedLocaleValues);\n }", "function setup_meta_translation() {\n\t\t\tglobal $post, $wpdb;\n\t\t\t$post_id = $post->ID;\n\t\t\t\n\t\t\tforeach($this->arabic_meta_keys as $key ) {\n\t\t\t\tif ($post_id){\n\t\t\t\t\t$$key = get_post_meta($post_id, $key, true);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$$key = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$the_post = get_post($post_id);\n\t\t\t\n\t\t\tinclude(dirname(__FILE__).'/views/ipc-meta-box-translation.php');\n\t\t}", "private function set_locale() {\n\n\t\t$plugin_i18n = new I18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "protected function setTranslationForMessageFromService($selfEdit, $msgInstanceName, $key, $label, $language, $delete) {\n\n\t\tif ($delete) {\n\t\t\t$translationService = new InstanceProxy($msgInstanceName, $selfEdit);\n\t\t\treturn $translationService->deleteMessage($key, $language);\n\t\t} else {\n\t\t\t$translationService = new InstanceProxy($msgInstanceName, $selfEdit);\n\t\t\treturn $translationService->setMessage($key, $label, $language);\n\t\t}\n\n\t}", "function addText($key, $text);", "public function customizeTranslation( $id_message, $instance )\n\t{\n\t\t$sql = <<<SQL\nINSERT INTO\n\ti18n_translations\nSELECT\n\t?,\n\tlang,\n\t'',\n\t'customize',\n\tNOW(),\n\t?\nFROM\n\ti18n_languages;\nSQL;\n\n\t\treturn $this->Execute( $sql, array(\n\t\t 'tag' => 'Add message',\n\t\t $id_message,\n\t\t $instance\n\t\t ) );\n\t}", "public function setMessage( $message );", "public function setMessagesInCommonLanguage(&$texts)\n {\n if ($this->locale != $this->commonLanguageId) {\n $this->setMessagesInLanguage($texts, $this->commonLanguageId);\n }\n }", "public function initMessages()\n {\n $this->messages = [\n 'alpha' => '{{name}} must only contain alphabetic characters.',\n 'alnum' => '{{name}} must only contain alpha numeric characters and dashes.',\n 'noWhitespace' => '{{name}} must not contain white spaces.',\n 'length' => '{{name}} must length between {{minValue}} and {{maxValue}}.',\n 'email' => 'Please make sure you typed a correct email address.'\n ];\n }", "public function setAlternativeText($txt='') {\n\t\tif(!empty($txt)) {\n\t\t\t$this->_mailAlternativeText = (string)$txt;\n\t\t}\n\t}", "private function set_locale() {\n\n\t\t$plugin_i18n = new APS_I18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "public function testSetMessageExceptionInvalidKey()\n {\n $keyInvalid = 'invalidKey';\n try {\n $this->_validator->setMessage(\n 'Your value is too long',\n $keyInvalid\n );\n $this->fail('Expected to catch Zend_Validate_Exception');\n } catch (Zend_Exception $e) {\n $this->assertTrue(\n $e instanceof Zend_Validate_Exception,\n 'Expected exception of type Zend_Validate_Exception, got ' . get_class($e)\n );\n $this->assertEquals(\"No message template exists for key '$keyInvalid'\", $e->getMessage());\n }\n }", "protected function setMessagesInCommonLanguage(&$texts)\n {\n if ($this->_locale != $this->_commonLanguageId) {\n $textsLang = $this->getMessagesByLanguage($texts, array($this->_commonLanguageId));\n foreach ($texts as &$text) {\n $mess = '';\n foreach ($textsLang as $textLang) {\n if ($text['hash'] == $textLang['hash']) {\n $mess = $textLang['target']['target'];\n break;\n }\n }\n $text['commonLang'] = $mess;\n }\n }\n }", "protected function setMessageType()\n {\n $type = array();\n if ($this->alternativeExists()) {\n $type[] = 'alt';\n }\n if ($this->inlineImageExists()) {\n $type[] = 'inline';\n }\n if ($this->attachmentExists()) {\n $type[] = 'attach';\n }\n $this->message_type = implode('_', $type);\n if ($this->message_type == '') {\n //The 'plain' message_type refers to the message having a single body element, not that it is plain-text\n $this->message_type = 'plain';\n }\n }", "public function setMessage() {\n $numArgs = func_num_args();\n\n switch ($numArgs) {\n default:\n return false;\n break;\n\n // A global rule error message\n case 2:\n foreach ($this->post(null) as $key => $val) {\n $this->_errorPhraseOverrides[$key][func_get_arg(0)] = func_get_arg(1);\n }\n break;\n\n // Field specific rule error message\n case 3:\n $this->_errorPhraseOverrides[func_get_arg(1)][func_get_arg(0)] = func_get_arg(2);\n break;\n }\n\n return true;\n }", "public function translate_notice() {\n\t\tglobal $current_user;\n\t\t$user_id = $current_user->ID;\n\n\t\t/* Check that the user hasn't already clicked to ignore the message */\n\t\tif ( get_user_meta( $user_id, 'hestia_ignore_multi_language_upsell_notice' ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( ! $this->should_display_translate_notice() ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo '<div class=\"notice notice-warning\" style=\"position:relative;\">';\n\t\tprintf( '<a href=\"%s\" class=\"notice-dismiss\" style=\"text-decoration:none;\"></a>', '?hestia_nag_ignore=0' );\n\t\techo '<p>';\n\t\t/* translators: Upsell to get the pro version */\n\t\tprintf( esc_html__( 'Hestia front-page is not multi-language compatible, for this feature %s.', 'hestia' ), sprintf( '<a href=\"%1$s\" target=\"_blank\">%2$s</a>', esc_url( apply_filters( 'hestia_upgrade_link_from_child_theme_filter', 'https://themeisle.com/themes/hestia-pro/upgrade/' ) ), esc_html__( 'Get the PRO version!', 'hestia' ) ) );\n\t\techo '</p>';\n\t\techo '</div>';\n\t}", "protected function translate($key) {\n\t\treturn $this->_viewHelper->translate($key);\n\t}", "public function __construct() {\n\t\t\t$this->trans_strings();\n\t\t}", "protected function setFlashMessage()\n {\n if ($message = $this->session()->getFlash('flash-message')) {\n if ($this->session()->getFlash('flash-error')) {\n $this->pageView()->setError($message);\n } else {\n $this->pageView()->setMessage($message);\n }\n }\n }", "public function translationStart()\n {\n }", "public function translate($text);", "function __($key) {\n\t$translate = Zend_Registry::get('Zend_Translate');\n\treturn $translate->translate($key);\n}", "function pgettext($context, $msgId) {\n\t$contextString = $context.\"\\004\".$msgId;\n\t$translation = _($contextString);\n\n\treturn ($translation == $contextString) ? $msgId : $translation;\n}", "public function __construct($message = null, $code = null, $previous = null)\n\t{\n\t\tparent::__construct($message, $code, $previous);\n\n\t\t$this->message = 'The object doens\\'t have a translation for the given\n\t\tlanguage';\n\t}", "private function setMessage()\r\n\t{\r\n\t\t$model = $this->getModel();\r\n\t\tif (!$model->isMultiPage()) {\r\n\t\t\t$this->assign('message', '');\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$message = '';\r\n\t\tif ($model->sessionModel) {\r\n\t\t\t$this->message = $model->sessionModel->status;\r\n\t\t\t//see http://fabrikar.com/forums/showpost.php?p=73833&postcount=14\r\n\t\t\t//if ($model->sessionModel->statusid == _FABRIKFORMSESSION_LOADED_FROM_COOKIE) {\r\n\t\t\tif ($model->sessionModel->last_page > 0) {\r\n\t\t\t\t$message .= ' <a href=\"#\" class=\"clearSession\">'.JText::_('COM_FABRIK_CLEAR').'</a>';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->assign('message', $message);\r\n\t}", "public function setMessageText($newMessageText) {\n\t//verify the message text is secure\n\t$newMessageText = trim($newMessageText);\n\t$newMessageText = filter_var($newMessageText, FILTER_SANITIZE_STRING);\n\tif(empty($newMessageText) === true) {\n\t\tthrow(new InvalidArgumentException(\"message text is empty or insecure\"));\n\t}\n\t//verify the message text will fit in the database\n\tif(strlen($newMessageText) > 256) {\n\t\tthrow(new RangeException(\"message text is longer than 256 characters\"));\n\t}\n\t//store the Message Text\n\t$this->messageText = $newMessageText;\n}", "public function testUnderscoresTranslation()\n {\n $this->markTestIncomplete('MAGETWO-1012: i18n Improvements - Localization/Translations');\n }", "public function displayDefaultMessageOutputEn()\n {\n // initialize the class with defaults (en_US locale, library path).\n $message = new CustomerMessage();\n\n // we expect the default message, because error 987.654.321 might not exist\n // in the default locale file en_US.csv.\n $this->assertEquals(\n 'An unexpected error occurred. Please contact us to get further information.',\n $message->getMessage('987.654.321')\n );\n }", "function create_empty_translation($key)\n\t{\n\t\t$this->data = $this->CorkCorktile->getFullData($key);\n\t\t$fullModelName = Inflector::camelize($this->data['ModuleInfo']['plugin']) . '.' . $this->data['ModuleInfo']['model'];\n $Model =& ClassRegistry::init($fullModelName);\n\t\t\n\t\t\n\t\tif ($Model->createEmptyTranslation($this->data['CorkCorktile']['content_id'], $this->params['language']))\n\t\t\t$this->redirect('edit/'.$key);\n\t\t\n\t}", "private function msg($k){\r\n global $language;\r\n\r\n return $language[$k];\r\n\r\n\r\n }", "public function testVariableSubstitutionInStringUkranian()\n {\n $this->specify(\n \"Translator does not translate to Ukranian correctly with passed params\",\n function () {\n $translator = new Gettext(\n [\n 'locale' => 'uk_UA.utf8',\n 'defaultDomain' => 'messages',\n 'directory' => PATH_DATA . 'translation/gettext'\n ]\n );\n\n expect($translator->_(\"Amazing %name%!\", ['name' => 'Phalcon']))->equals('Чудовий Phalcon!');\n expect($translator->t(\"Amazing %name%!\", ['name' => 'Phalcon']))->equals('Чудовий Phalcon!');\n }\n );\n }", "function __(string $string, array $values = NULL, string $lang = 'en-us'): string\n {\n if ($lang !== I18n::$lang) {\n // The message and target languages are different\n // Get the translation for this message\n $string = I18n::get($string);\n }\n\n return empty($values) ? $string : strtr($string, $values);\n }", "public function message()\n\t{\n\t\t$this->add('message', 'required', true, 'Message is required.');\n\t\t$this->add('message', 'regexp', '#^[a-zA-Z0-9\\s_\\- ,\\.!]*$#', 'Bad message format.');\n\t\t$this->add('message', 'max', 250, 'Bad message length, no more than 250 characters.');\n\n\t\t$this->setInformation('message', 'Message desciption, no specials characters, no accent, no more than 250 characters...');\n\t}", "public function translate();", "public function getTranslatedMessage(): string\n\t{\n\t\tif(self::$resolver === null)\n\t\t{\n\t\t\tself::$resolver = new DefaultMessageResolver();\n\t\t}\n\t\t\n\t\treturn self::$resolver->resolveMessage($this->name, $this->key, $this->args);\n\t}", "function lang($key = '')\r\n{\r\n\t$CI =& get_instance();\r\n\t$line = $CI->lang->line($key);\r\n\t$line = ($line == '') ? $key : $line;\r\n\treturn $line;\r\n}", "public function asTranslated($key = null)\n {\n $this->title = __($key ?: $this->title);\n\n return $this;\n }", "function _gettext($msgid)\r\n\t{\r\n\t\t$l10n = _get_reader();\r\n\t\treturn _encode($l10n->translate($msgid));\r\n\t}", "public function translate($message, $parameters = [], $locale = null);", "function m($t, $key = '')\r\n\t{\r\n\t\t$this->arMessages[] = $t;\r\n\t\tif ($this->varMode == 'names')\r\n\t\t{\r\n\t\t\treturn (isset($this->lang[$t]) && is_array($this->lang[$t]) && isset($this->lang[$t][$key]))\r\n\t\t\t\t\t? $this->lang[$t][$key]\r\n\t\t\t\t\t: (isset($this->lang[$t]) ? $this->lang[$t] : $t);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn defined($t) ? eval(\"print $t;\") : $t;\r\n\t\t}\r\n\t}", "function skudo_text($textid){\n\n\t$locale=get_locale();\n\t$int_enabled=get_option(\"skudo_enable_translation\")=='on'?true:false;\n\t$default_locale=get_option(\"skudo_def_locale\");\n\n\tif($int_enabled && $locale!=$default_locale){\n\t\t//use translation - extract the text from a defined .mo file\n\t\treturn $textid;\n\t}else{\n\t\t//use the default text settings\n\t\treturn stripslashes(get_option(\"skudo\".$textid));\n\t}\n}", "protected function addMessage($translationKey, $type, $vars) {\n if ($vars) {\n foreach ($vars as $key => $value) {\n if (!is_scalar($value)) {\n $value = gettype($value);\n }\n\n $vars[$key] = htmlentities($value, ENT_QUOTES);\n }\n }\n\n $message = $this->getTranslator()->translate($translationKey, $vars);\n $message = new Message($message, $type);\n\n $this->response->addMessage($message);\n }", "public function welcome_save_message() {\n global $OUTPUT;\n\n $a = get_string('sharinglevel', 'mod_surveypro');\n $message = get_string('welcome_utemplatesave', 'mod_surveypro', $a);\n echo $OUTPUT->notification($message, 'notifymessage');\n }", "function __($text)\n{\n $sys = getSysInfo();\n $lang = $sys[\"lang\"];\n //set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'].getPathFromDocRoot().'locales'.FILE_SEPARATOR.$lang);\n if ($lang == \"\") {\n //do nothing\n return $text;\n } else {\n require_once('locales'.FILE_SEPARATOR.$lang.FILE_SEPARATOR.$lang.'.php');\n //$translation = getTranslation($text);\n $translation = call_user_func('getTranslation_'.$lang, $text);\n if ($translation == \"\") {\n return $text;\n //maybe send an error email to admin?\n } else {\n return $translation;\n }\n }\n}", "protected function defaultMessageSet(string $message, ?string $code, /*mixed*/ ...$printfData): void\n {\n Debug::bypassGenericMessage();\n\n if ($this->failMessage === null) {\n $this->failMessage[1] = vsprintf($message, $printfData);\n $this->failMessage[0] = $code;\n }\n }", "public function load_translation() {\n\t\t\t$locale = apply_filters( 'plugin_locale', determine_locale(), 'sv_core' );\n\t\t\tload_textdomain( 'sv_core', dirname( __FILE__ ) . '/languages/sv_core-'.$locale.'.mo' );\n\t\t}", "public function setMessage($message, $type = false, $key = NULL) {\r\n\t\tif ($key) {\r\n\t\t\t$this->session->messages[$key] = array('message'=>$message, 'type'=>$type);\r\n\t\t} else {\r\n\t\t\t$this->session->messages[] = array('message'=>$message, 'type'=>$type);\r\n\t\t}\r\n\t}", "protected function _setTextString($key, $value, $encoding) {}", "public function message()\n {\n return trans('stopforumspam::stopforumspam.it_is_currently_not_possible_to_register_with_your_specified_information_please_try_later_again');\n }", "public function translated();", "public function translated();", "function trans($key = null, $replace = [], $locale = null)\n{\n # sms.account_activation\n # sms.ad_activation\n\n if (is_null($key)) {\n return app('translator');\n }\n\n $exp = explode('.', $key, 2);\n $group = null;\n $item = $key;\n if( sizeof($exp) === 2 ) {\n $group = $exp[0];\n $item = $exp[1];\n }\n $if = \\DB::table('translator_translations')->where('group', $group)->where('item', $item)->exists();\n if (!$if) {\n \\DB::table('translator_translations')->insert([\n [\n 'locale' => 'ar',\n 'group' => $group,\n 'item' => $item,\n 'text' => $key,\n ], [\n 'locale' => 'en',\n 'group' => $group,\n 'item' => $item,\n 'text' => $key,\n ]\n ]);\n }\n\n return app('translator')->trans($key, $replace, $locale);\n}", "private function set_locale() {\n\n\t\t$plugin_i18n = new Soisy_Pagamento_Rateale_i18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\t}" ]
[ "0.64905816", "0.64905816", "0.63594556", "0.63263065", "0.63222474", "0.6317344", "0.62044376", "0.61722296", "0.61546296", "0.6112332", "0.61035514", "0.6049454", "0.6022954", "0.5949653", "0.59476584", "0.59374326", "0.59299695", "0.5892191", "0.5883109", "0.58784956", "0.5876786", "0.5830862", "0.57293034", "0.5727463", "0.57262117", "0.56705856", "0.56656474", "0.5655193", "0.5650089", "0.5637151", "0.55923164", "0.5590395", "0.558877", "0.5568835", "0.556743", "0.5547812", "0.55408204", "0.553372", "0.5517853", "0.5511747", "0.55094355", "0.5508344", "0.54980814", "0.54951864", "0.54739", "0.5466187", "0.5465323", "0.5457413", "0.54552567", "0.5454445", "0.54501176", "0.54445964", "0.54442877", "0.54389656", "0.5437151", "0.54346937", "0.54338783", "0.54328305", "0.5432301", "0.54237", "0.54162055", "0.5408783", "0.540196", "0.5399892", "0.53983754", "0.53900194", "0.5387889", "0.53868914", "0.53844726", "0.53835094", "0.53820115", "0.5369959", "0.5361137", "0.53485537", "0.5348364", "0.53478074", "0.53471863", "0.53467906", "0.5342357", "0.5333299", "0.53301996", "0.531952", "0.53093976", "0.5307894", "0.53056794", "0.52997994", "0.52881116", "0.5285379", "0.5283858", "0.52828926", "0.5279572", "0.5275288", "0.52709216", "0.5269032", "0.52670205", "0.52630925", "0.52615684", "0.5259836", "0.5259836", "0.5250976", "0.5246836" ]
0.0
-1
This method can be used to set a different translation key or set up a plain text message without i18n.
public function setStatusMessageFatalError(string $statusMessageFatalError): void { $this->statusMessageFatalError = $statusMessageFatalError; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function withLangMessage($key, $type = '')\n {\n return $this->withMessage($this->translator->get($key), $type);\n }", "public function withLangMessage($key, $type = '')\n {\n return $this->withMessage($this->translator->get($key), $type);\n }", "public function setMessageTemplate($key, $message)\n {\n if (array_key_exists($key, $this->_messageTemplates) && strlen($message)) {\n $this->_messageTemplates[$key] = $message;\n }\n }", "protected static function setLanguageKeys() {}", "public function testSetMessageDefaultKey()\n {\n $this->_validator->setMessage(\n 'Your value is too short',\n Zend_Validate_StringLength::TOO_SHORT\n );\n\n $this->assertFalse($this->_validator->isValid('abc'));\n $messages = $this->_validator->getMessages();\n $this->assertEquals('Your value is too short', current($messages));\n $errors = $this->_validator->getErrors();\n $this->assertEquals(Zend_Validate_StringLength::TOO_SHORT, current($errors));\n }", "public function set_alt_message($message);", "public function setTranslationsForKey(array $messages, $key);", "public function __construct()\n\t{\n\t\tt('lang')->load('sms_gateway_handler/forgot');\n\t}", "protected function setLang() {\n \n /*\n //setlocale (LC_ALL,\"russian\");\n //setlocale (LC_ALL,\"\");\n $locale = 'ru_RU';\n putenv('LANG='.$locale);\n setlocale(LC_ALL,\"\");\n setlocale(LC_MESSAGES,$locale);\n setlocale(LC_CTYPE,$locale);\n \n //putenv(\"LANG=ru_RU\");\n \n bindtextdomain (\"messages\", XPATH_TEMPLATE_FRONT . DS . 'locale');\n textdomain (\"messages\");\n bind_textdomain_codeset(\"messages\", \"UTF-8\");*/\n \n //setlocale(LC_MESSAGES, $this->_lang . '_' . strtoupper($this->_lang) . '.UTF-8');\n \n putenv(\"LC_MESSAGES=\".$this->_lang . '_' . strtoupper($this->_lang) . '.UTF-8');\n \n bindtextdomain('messages', XPATH_TEMPLATE_FRONT . DS . 'locale' . DS);\n bind_textdomain_codeset('messages', 'UTF-8');\n textdomain('messages');\n }", "public function setTranslation($key, $value, $language);", "private function translationWorkaround()\n {\n L10n::__('BudgetMailer Sign Up Form for WordPress');\n L10n::__('BudgetMailer Sign Up');\n }", "function gettext($message) {\n global $faketext;\n \n return (!empty($faketext[$message]) ? $faketext[$message] : $message);\n }", "function setMessage($text, $type = \"default\") {\n\tglobal $systemMessages;\n\t$systemMessages[$type][] = $text;\n}", "public function settingLanguage() {}", "function trans_or_default(string $key, $default, array $replace = [], $locale = null): string\n {\n $message = trans($key, $replace, $locale);\n\n return $message === $key ? $default : $message;\n }", "public function prepareTranslations($domain, $key, $message, $locale);", "public function __construct()\n\t{\n\t\tt('lang')->load('site/deposit_sms');\n\t}", "protected function lang($key)\n {\n }", "public function testGetDefaultMessageIfNoMatchingValueFoundInMessagesList()\n {\n $this->translator->load();\n $this->assertEquals('default_value', $this->translator->get('invalid_message_key', 'default_value'));\n }", "public function set_message_text($message_text)\n {\n $this->message_text = $message_text;\n }", "public function translate($key, $arg = NULL) {\n\t\tif (isset($this->dictionary[$key])) {\n\t\t\t$message = $this->dictionary[$key];\n\t\t} else {\n\t\t\t$message = $key;\n\t\t}\n\t\tif ($arg !== null) {\n\t\t\tif (is_array($arg)) {\n\t\t\t\tforeach($arg as $name=>$value) {\n\t\t\t\t\t$message = str_replace('{'.$name.'}', $value, $message);\n\t\t\t\t}\n\t\t\t\treturn $message;\n\t\t\t} else {\n\t\t\t\t$args = func_get_args();\n\t\t\t\tarray_shift($args);\n\t\t\t\treturn vsprintf($message, $args);\n\t\t\t}\n\t\t} else {\n\t\t\treturn $message;\n\t\t}\n\t}", "private function initMessage()\n {\n $this->_message['MSG_ERROR'] = Utils::getMessageError();\n $this->_message['MSG_ALERT'] = Utils::getMessageALert();\n }", "public function set_alt_message($message) {\n $this->alt_message = (!is_null($message) && is_string($message)) ? $message : '';\n }", "protected function t($key)\n {\n return static::translate($this->lang, $key);\n }", "protected function lang($key)\n {\n if (count($this->language) < 1) {\n $this->setLanguage('en'); // set the default language\n }\n\n if (array_key_exists($key, $this->language)) {\n if ($key == 'smtp_connect_failed') {\n //Include a link to troubleshooting docs on SMTP connection failure\n //this is by far the biggest cause of support questions\n //but it's usually not PHPMailer's fault.\n return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';\n }\n return $this->language[$key];\n } else {\n //Return the key as a fallback\n return $key;\n }\n }", "function __t(?string $key = null, ?string $default = null, array $replace = [], ?string $locale = null)\n {\n if (Lang::has($key, $locale)) {\n return __($key, $replace, $locale);\n }\n if ($default) {\n if (Str::contains($default, [' ', '.', ':'])) {\n return __($default, $replace, $locale);\n }\n // is probably single word\n return $default;\n }\n return $key;\n }", "public function initI18N()\n {\n $reflector = new \\ReflectionClass(get_class($this));\n $dir = dirname($reflector->getFileName());\n\n if (!empty($this->config['message'])) {\n foreach ($this->config['message'] as $message) {\n Yii::setAlias(\"@\".$message, $dir);\n $config = [\n 'class' => 'yii\\i18n\\PhpMessageSource',\n 'basePath' => \"@\".$message.\"/messages\",\n 'forceTranslation' => true\n ];\n $globalConfig = ArrayHelper::getValue(Yii::$app->i18n->translations, $message.\"*\", []);\n if (!empty($globalConfig)) {\n $config = array_merge(\n $config,\n is_array($globalConfig) ? $globalConfig : (array) $globalConfig\n );\n }\n Yii::$app->i18n->translations[$message.\"*\"] = $config;\n }\n }\n\n }", "protected function translate($key, $arguments = null) {\n\t\treturn Tx_Extbase_Utility_Localization::translate($key, 'Typo3mind', $arguments);\n\t}", "public static function t($messageKey, $defaultMessage = null, $params = null, $editable = false)\r\n {\r\n //if (self::isNewTranslateVersion()){\r\n if (true){\r\n $params = $defaultMessage;\r\n $defaultMessage = $messageKey;\r\n return Warecorp_Translate::translate($defaultMessage, $params);\r\n }else{\r\n if ( null === $defaultMessage && null === $params ) { // Warecorp::t('Message');\r\n $defaultMessage = $messageKey;\r\n } elseif ( null !== $defaultMessage && is_array($defaultMessage) ) { // Warecorp::t('Message %s', array(1));\r\n $params = $defaultMessage;\r\n $defaultMessage = $messageKey;\r\n } else { // OLD : Warecorp::t('key', 'Message'); or Warecorp::t('key', 'Message %s', array(1));\r\n\r\n }\r\n return Warecorp_Translate::translate($defaultMessage, $params);\r\n }\r\n }", "function translate($sKey, $sLang = null);", "private function _init() {\r\n $config = array(\r\n 'gettext_locale_dir' => $this->CI->config->item('gettext_locale_dir'),\r\n 'gettext_text_domain' => $this->CI->config->item('gettext_text_domain'),\r\n 'gettext_catalog_codeset' => $this->CI->config->item('gettext_catalog_codeset'),\r\n 'gettext_locale' => $this->CI->config->item('gettext_locale'),\r\n 'gettext_nocache' => $this->CI->config->item('gettext_nocache'),\r\n );\r\n \r\n if ($this->CI->config->item('language') != $this->CI->config->item('default_language') || config_item('default_iso') != config_item('lang')) {\r\n if ($this->CI->config->item('gettext_nocache')) {\r\n $this->_bind_gettext_nocache($config);\r\n } else {\r\n $this->_bind_gettext($config);\r\n }\r\n }\r\n // Gettext locale\r\n setlocale(LC_ALL, $config['gettext_locale'] . '.' . $config['gettext_catalog_codeset']);\r\n putenv(\"LC_ALL=\" . $config['gettext_locale']);\r\n putenv('LANG=' . $config['gettext_locale'] . '.' . $config['gettext_catalog_codeset']);\r\n putenv('LANGUAGE=' . $config['gettext_locale'] . '.' . $config['gettext_catalog_codeset']);\r\n }", "public function set_message($message);", "public function testCanGetMessageByKeyFromTranslator()\n {\n $this->translator->load();\n $message = $this->translator->get('test_message');\n $this->assertEquals('file has been loaded', $message);\n }", "function setLocale($key) {\n\t\t\t$this->locale = $key;\n\t\t}", "function translation() {\n\t\t\n\t\t// only use, if we have it...\n\t\tif( function_exists('load_plugin_textdomain') ) {\n\t\t\n\t\t\t// load it\n\t\t\tload_plugin_textdomain( \n\t\t\t\n\t\t\t\t// unique name\n\t\t\t\t'cp-multisite', \n\t\t\t\t\n\t\t\t\t// deprecated argument\n\t\t\t\tfalse,\n\t\t\t\t\n\t\t\t\t// path to directory containing translation files\n\t\t\t\tplugin_dir_path( CPMU_PLUGIN_FILE ) . 'languages/'\n\t\t\t\t\n\t\t\t);\n\t\t\t\n\t\t}\n\t\t\n\t}", "public static function message()\n {\n return __('validation.translate_required');\n }", "protected function translate($key) {\n\t\treturn LocalizationUtility::translate(static::languageFile . static::languageKeyPrefix . $key);\n\t}", "protected function translate(string $key, array $data = []): string\n {\n return $this->translator->translate($key, $data);\n }", "function set_message_key($key, $val)\n{\n if(!isset($_SESSION[$key]))\n {\n $_SESSION[$key] = $val;\n }\n}", "static public function translate( $key, $value ) {\r\n\t\t\tself::$i10n[ $key ] = (string) $value;\r\n\t\t}", "function alt_message($alt_message = '')\n\t{\n\t\t//pointless if the primary message is already text\n\t\tif ($this->config['mailtype'] == 'text')\n\t\t\treturn;\n\n\t\t//if the message needs to be wrapped, do it now.\n\t\tif ($this->config['wordwrap'])\n\t\t\t$this->alt_message = $this->wrap_message($alt_message, $this->config['wraplength'], false);\n\t\telse\n\t\t\t$this->alt_message = $alt_message;\n\t}", "function _trans($default = null, $key = null, $replace = [], $locale = null)\n {\n if (is_null($key)) {\n return $default;\n }\n\n return trans($key, $replace, $locale);\n }", "private function dummyMethodToIncludeTranslatableString(){\n return;\n /** @var TranslatorInterface $translator */\n $translator = $this->container->get('translator');\n if ($translator !== null) {\n $translator->trans('hasFacebook', array(), 'advertise');\n $translator->trans('hasTwitter', array(), 'advertise');\n $translator->trans('hasInstagram', array(), 'advertise');\n }\n unset($translator);\n }", "public static function getDefaultMessage(): string;", "protected function prepareMessage() {\n //Initialize $message\n $message = '';\n //loop through $this->_storage array\n foreach ($this->_storage as $key => $value) {\n // if it has no value, assign 'Not provided' \n $value = (empty($value)) ? 'Not provided' : $value;\n // if an array, expand as comma-separated string \n if (is_array($value)) {\n $value = implode(', ', $value);\n }\n // replace underscores and hyphens in the label with spaces \n $key = str_replace(array('_', '-'), ' ', $key);\n // add label and value to the message body. Uppercase first letter\n $message .=ucfirst($key) . \": $value\\r\\n\\r\\n\";\n }\n // limit line length to 70 characters \n $this->_body = wordwrap($message, 70);\n }", "function lang($key)\n{\n\tglobal $lang;\n\t\n\t// Make sure the key is uppercase\n\t$key = strtoupper($key);\n\t\n\t// Does that key exist?\n\tif(!$lang[$key])\n\t{\n\t\t// So we know it needs to be translated.\n\t\treturn '{' . $key . '}';\n\t}\n\telse\n\t{\n\t\treturn $lang[$key];\n\t}\n}", "public function translate($message, $locale = null);", "public function setText($text)\n {\n $this->text = $this->message['text'] = $text;\n }", "private function autoTranslate()\n {\n $translationServices = $this->manager->getAutomaticTranslationServices();\n $translationService = new $translationServices[$this->choice('Which automatic translation provider should be used?',\n array_keys($translationServices), 0)]();\n if (!in_array($this->manager->getDefaultLocale(), $translationService->getAvailableLocales())) {\n $this->warn('Provider '.class_basename($translationService).' doesn\\'t support locale \"'.$this->manager->getDefaultLocale().'\"');\n\n return;\n }\n\n $translationLocale = $this->ask('In which language do you want to translate?', 'en');\n if (!in_array($translationLocale, $translationService->getAvailableLocales())) {\n $this->warn('Provider '.class_basename($translationService).' doesn\\'t support locale \"'.$translationLocale.'\"');\n\n return;\n }\n\n $translationValues = $this->manager->getUntranslatedValues(\n $this->manager->getDefaultLocale(),\n $translationLocale\n );\n if (!$this->confirm('This translation costs $'.$translationService->calculateCosts($translationValues).' Do you want to continue?')) {\n return;\n }\n\n $this->info('Translating values...');\n $progress = $this->output->createProgressBar(count($translationValues));\n\n $translatedLocaleValues = [];\n foreach ($translationValues as $name => $localeString) {\n $translatedLocaleValues[$translationLocale][$name] = $translationService->translate(\n $this->manager->getDefaultLocale(),\n $translationLocale,\n $localeString\n );\n $progress->advance();\n }\n $progress->finish();\n echo \"\\r\\n\";\n\n $this->info('Write values');\n $this->manager->write($translatedLocaleValues);\n }", "function setup_meta_translation() {\n\t\t\tglobal $post, $wpdb;\n\t\t\t$post_id = $post->ID;\n\t\t\t\n\t\t\tforeach($this->arabic_meta_keys as $key ) {\n\t\t\t\tif ($post_id){\n\t\t\t\t\t$$key = get_post_meta($post_id, $key, true);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$$key = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$the_post = get_post($post_id);\n\t\t\t\n\t\t\tinclude(dirname(__FILE__).'/views/ipc-meta-box-translation.php');\n\t\t}", "private function set_locale() {\n\n\t\t$plugin_i18n = new I18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "function addText($key, $text);", "protected function setTranslationForMessageFromService($selfEdit, $msgInstanceName, $key, $label, $language, $delete) {\n\n\t\tif ($delete) {\n\t\t\t$translationService = new InstanceProxy($msgInstanceName, $selfEdit);\n\t\t\treturn $translationService->deleteMessage($key, $language);\n\t\t} else {\n\t\t\t$translationService = new InstanceProxy($msgInstanceName, $selfEdit);\n\t\t\treturn $translationService->setMessage($key, $label, $language);\n\t\t}\n\n\t}", "public function customizeTranslation( $id_message, $instance )\n\t{\n\t\t$sql = <<<SQL\nINSERT INTO\n\ti18n_translations\nSELECT\n\t?,\n\tlang,\n\t'',\n\t'customize',\n\tNOW(),\n\t?\nFROM\n\ti18n_languages;\nSQL;\n\n\t\treturn $this->Execute( $sql, array(\n\t\t 'tag' => 'Add message',\n\t\t $id_message,\n\t\t $instance\n\t\t ) );\n\t}", "public function setMessage( $message );", "public function initMessages()\n {\n $this->messages = [\n 'alpha' => '{{name}} must only contain alphabetic characters.',\n 'alnum' => '{{name}} must only contain alpha numeric characters and dashes.',\n 'noWhitespace' => '{{name}} must not contain white spaces.',\n 'length' => '{{name}} must length between {{minValue}} and {{maxValue}}.',\n 'email' => 'Please make sure you typed a correct email address.'\n ];\n }", "public function setMessagesInCommonLanguage(&$texts)\n {\n if ($this->locale != $this->commonLanguageId) {\n $this->setMessagesInLanguage($texts, $this->commonLanguageId);\n }\n }", "public function setAlternativeText($txt='') {\n\t\tif(!empty($txt)) {\n\t\t\t$this->_mailAlternativeText = (string)$txt;\n\t\t}\n\t}", "private function set_locale() {\n\n\t\t$plugin_i18n = new APS_I18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\n\t}", "public function testSetMessageExceptionInvalidKey()\n {\n $keyInvalid = 'invalidKey';\n try {\n $this->_validator->setMessage(\n 'Your value is too long',\n $keyInvalid\n );\n $this->fail('Expected to catch Zend_Validate_Exception');\n } catch (Zend_Exception $e) {\n $this->assertTrue(\n $e instanceof Zend_Validate_Exception,\n 'Expected exception of type Zend_Validate_Exception, got ' . get_class($e)\n );\n $this->assertEquals(\"No message template exists for key '$keyInvalid'\", $e->getMessage());\n }\n }", "protected function setMessagesInCommonLanguage(&$texts)\n {\n if ($this->_locale != $this->_commonLanguageId) {\n $textsLang = $this->getMessagesByLanguage($texts, array($this->_commonLanguageId));\n foreach ($texts as &$text) {\n $mess = '';\n foreach ($textsLang as $textLang) {\n if ($text['hash'] == $textLang['hash']) {\n $mess = $textLang['target']['target'];\n break;\n }\n }\n $text['commonLang'] = $mess;\n }\n }\n }", "protected function setMessageType()\n {\n $type = array();\n if ($this->alternativeExists()) {\n $type[] = 'alt';\n }\n if ($this->inlineImageExists()) {\n $type[] = 'inline';\n }\n if ($this->attachmentExists()) {\n $type[] = 'attach';\n }\n $this->message_type = implode('_', $type);\n if ($this->message_type == '') {\n //The 'plain' message_type refers to the message having a single body element, not that it is plain-text\n $this->message_type = 'plain';\n }\n }", "public function translate_notice() {\n\t\tglobal $current_user;\n\t\t$user_id = $current_user->ID;\n\n\t\t/* Check that the user hasn't already clicked to ignore the message */\n\t\tif ( get_user_meta( $user_id, 'hestia_ignore_multi_language_upsell_notice' ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( ! $this->should_display_translate_notice() ) {\n\t\t\treturn;\n\t\t}\n\n\t\techo '<div class=\"notice notice-warning\" style=\"position:relative;\">';\n\t\tprintf( '<a href=\"%s\" class=\"notice-dismiss\" style=\"text-decoration:none;\"></a>', '?hestia_nag_ignore=0' );\n\t\techo '<p>';\n\t\t/* translators: Upsell to get the pro version */\n\t\tprintf( esc_html__( 'Hestia front-page is not multi-language compatible, for this feature %s.', 'hestia' ), sprintf( '<a href=\"%1$s\" target=\"_blank\">%2$s</a>', esc_url( apply_filters( 'hestia_upgrade_link_from_child_theme_filter', 'https://themeisle.com/themes/hestia-pro/upgrade/' ) ), esc_html__( 'Get the PRO version!', 'hestia' ) ) );\n\t\techo '</p>';\n\t\techo '</div>';\n\t}", "public function setMessage() {\n $numArgs = func_num_args();\n\n switch ($numArgs) {\n default:\n return false;\n break;\n\n // A global rule error message\n case 2:\n foreach ($this->post(null) as $key => $val) {\n $this->_errorPhraseOverrides[$key][func_get_arg(0)] = func_get_arg(1);\n }\n break;\n\n // Field specific rule error message\n case 3:\n $this->_errorPhraseOverrides[func_get_arg(1)][func_get_arg(0)] = func_get_arg(2);\n break;\n }\n\n return true;\n }", "protected function translate($key) {\n\t\treturn $this->_viewHelper->translate($key);\n\t}", "public function __construct() {\n\t\t\t$this->trans_strings();\n\t\t}", "protected function setFlashMessage()\n {\n if ($message = $this->session()->getFlash('flash-message')) {\n if ($this->session()->getFlash('flash-error')) {\n $this->pageView()->setError($message);\n } else {\n $this->pageView()->setMessage($message);\n }\n }\n }", "public function translationStart()\n {\n }", "function __($key) {\n\t$translate = Zend_Registry::get('Zend_Translate');\n\treturn $translate->translate($key);\n}", "public function translate($text);", "function pgettext($context, $msgId) {\n\t$contextString = $context.\"\\004\".$msgId;\n\t$translation = _($contextString);\n\n\treturn ($translation == $contextString) ? $msgId : $translation;\n}", "public function __construct($message = null, $code = null, $previous = null)\n\t{\n\t\tparent::__construct($message, $code, $previous);\n\n\t\t$this->message = 'The object doens\\'t have a translation for the given\n\t\tlanguage';\n\t}", "private function setMessage()\r\n\t{\r\n\t\t$model = $this->getModel();\r\n\t\tif (!$model->isMultiPage()) {\r\n\t\t\t$this->assign('message', '');\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$message = '';\r\n\t\tif ($model->sessionModel) {\r\n\t\t\t$this->message = $model->sessionModel->status;\r\n\t\t\t//see http://fabrikar.com/forums/showpost.php?p=73833&postcount=14\r\n\t\t\t//if ($model->sessionModel->statusid == _FABRIKFORMSESSION_LOADED_FROM_COOKIE) {\r\n\t\t\tif ($model->sessionModel->last_page > 0) {\r\n\t\t\t\t$message .= ' <a href=\"#\" class=\"clearSession\">'.JText::_('COM_FABRIK_CLEAR').'</a>';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->assign('message', $message);\r\n\t}", "function create_empty_translation($key)\n\t{\n\t\t$this->data = $this->CorkCorktile->getFullData($key);\n\t\t$fullModelName = Inflector::camelize($this->data['ModuleInfo']['plugin']) . '.' . $this->data['ModuleInfo']['model'];\n $Model =& ClassRegistry::init($fullModelName);\n\t\t\n\t\t\n\t\tif ($Model->createEmptyTranslation($this->data['CorkCorktile']['content_id'], $this->params['language']))\n\t\t\t$this->redirect('edit/'.$key);\n\t\t\n\t}", "public function testUnderscoresTranslation()\n {\n $this->markTestIncomplete('MAGETWO-1012: i18n Improvements - Localization/Translations');\n }", "private function msg($k){\r\n global $language;\r\n\r\n return $language[$k];\r\n\r\n\r\n }", "public function displayDefaultMessageOutputEn()\n {\n // initialize the class with defaults (en_US locale, library path).\n $message = new CustomerMessage();\n\n // we expect the default message, because error 987.654.321 might not exist\n // in the default locale file en_US.csv.\n $this->assertEquals(\n 'An unexpected error occurred. Please contact us to get further information.',\n $message->getMessage('987.654.321')\n );\n }", "public function setMessageText($newMessageText) {\n\t//verify the message text is secure\n\t$newMessageText = trim($newMessageText);\n\t$newMessageText = filter_var($newMessageText, FILTER_SANITIZE_STRING);\n\tif(empty($newMessageText) === true) {\n\t\tthrow(new InvalidArgumentException(\"message text is empty or insecure\"));\n\t}\n\t//verify the message text will fit in the database\n\tif(strlen($newMessageText) > 256) {\n\t\tthrow(new RangeException(\"message text is longer than 256 characters\"));\n\t}\n\t//store the Message Text\n\t$this->messageText = $newMessageText;\n}", "public function testVariableSubstitutionInStringUkranian()\n {\n $this->specify(\n \"Translator does not translate to Ukranian correctly with passed params\",\n function () {\n $translator = new Gettext(\n [\n 'locale' => 'uk_UA.utf8',\n 'defaultDomain' => 'messages',\n 'directory' => PATH_DATA . 'translation/gettext'\n ]\n );\n\n expect($translator->_(\"Amazing %name%!\", ['name' => 'Phalcon']))->equals('Чудовий Phalcon!');\n expect($translator->t(\"Amazing %name%!\", ['name' => 'Phalcon']))->equals('Чудовий Phalcon!');\n }\n );\n }", "public function message()\n\t{\n\t\t$this->add('message', 'required', true, 'Message is required.');\n\t\t$this->add('message', 'regexp', '#^[a-zA-Z0-9\\s_\\- ,\\.!]*$#', 'Bad message format.');\n\t\t$this->add('message', 'max', 250, 'Bad message length, no more than 250 characters.');\n\n\t\t$this->setInformation('message', 'Message desciption, no specials characters, no accent, no more than 250 characters...');\n\t}", "function __(string $string, array $values = NULL, string $lang = 'en-us'): string\n {\n if ($lang !== I18n::$lang) {\n // The message and target languages are different\n // Get the translation for this message\n $string = I18n::get($string);\n }\n\n return empty($values) ? $string : strtr($string, $values);\n }", "public function translate();", "public function getTranslatedMessage(): string\n\t{\n\t\tif(self::$resolver === null)\n\t\t{\n\t\t\tself::$resolver = new DefaultMessageResolver();\n\t\t}\n\t\t\n\t\treturn self::$resolver->resolveMessage($this->name, $this->key, $this->args);\n\t}", "function lang($key = '')\r\n{\r\n\t$CI =& get_instance();\r\n\t$line = $CI->lang->line($key);\r\n\t$line = ($line == '') ? $key : $line;\r\n\treturn $line;\r\n}", "public function asTranslated($key = null)\n {\n $this->title = __($key ?: $this->title);\n\n return $this;\n }", "function _gettext($msgid)\r\n\t{\r\n\t\t$l10n = _get_reader();\r\n\t\treturn _encode($l10n->translate($msgid));\r\n\t}", "public function translate($message, $parameters = [], $locale = null);", "function m($t, $key = '')\r\n\t{\r\n\t\t$this->arMessages[] = $t;\r\n\t\tif ($this->varMode == 'names')\r\n\t\t{\r\n\t\t\treturn (isset($this->lang[$t]) && is_array($this->lang[$t]) && isset($this->lang[$t][$key]))\r\n\t\t\t\t\t? $this->lang[$t][$key]\r\n\t\t\t\t\t: (isset($this->lang[$t]) ? $this->lang[$t] : $t);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn defined($t) ? eval(\"print $t;\") : $t;\r\n\t\t}\r\n\t}", "function skudo_text($textid){\n\n\t$locale=get_locale();\n\t$int_enabled=get_option(\"skudo_enable_translation\")=='on'?true:false;\n\t$default_locale=get_option(\"skudo_def_locale\");\n\n\tif($int_enabled && $locale!=$default_locale){\n\t\t//use translation - extract the text from a defined .mo file\n\t\treturn $textid;\n\t}else{\n\t\t//use the default text settings\n\t\treturn stripslashes(get_option(\"skudo\".$textid));\n\t}\n}", "protected function addMessage($translationKey, $type, $vars) {\n if ($vars) {\n foreach ($vars as $key => $value) {\n if (!is_scalar($value)) {\n $value = gettype($value);\n }\n\n $vars[$key] = htmlentities($value, ENT_QUOTES);\n }\n }\n\n $message = $this->getTranslator()->translate($translationKey, $vars);\n $message = new Message($message, $type);\n\n $this->response->addMessage($message);\n }", "public function welcome_save_message() {\n global $OUTPUT;\n\n $a = get_string('sharinglevel', 'mod_surveypro');\n $message = get_string('welcome_utemplatesave', 'mod_surveypro', $a);\n echo $OUTPUT->notification($message, 'notifymessage');\n }", "function __($text)\n{\n $sys = getSysInfo();\n $lang = $sys[\"lang\"];\n //set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'].getPathFromDocRoot().'locales'.FILE_SEPARATOR.$lang);\n if ($lang == \"\") {\n //do nothing\n return $text;\n } else {\n require_once('locales'.FILE_SEPARATOR.$lang.FILE_SEPARATOR.$lang.'.php');\n //$translation = getTranslation($text);\n $translation = call_user_func('getTranslation_'.$lang, $text);\n if ($translation == \"\") {\n return $text;\n //maybe send an error email to admin?\n } else {\n return $translation;\n }\n }\n}", "protected function defaultMessageSet(string $message, ?string $code, /*mixed*/ ...$printfData): void\n {\n Debug::bypassGenericMessage();\n\n if ($this->failMessage === null) {\n $this->failMessage[1] = vsprintf($message, $printfData);\n $this->failMessage[0] = $code;\n }\n }", "public function load_translation() {\n\t\t\t$locale = apply_filters( 'plugin_locale', determine_locale(), 'sv_core' );\n\t\t\tload_textdomain( 'sv_core', dirname( __FILE__ ) . '/languages/sv_core-'.$locale.'.mo' );\n\t\t}", "public function setMessage($message, $type = false, $key = NULL) {\r\n\t\tif ($key) {\r\n\t\t\t$this->session->messages[$key] = array('message'=>$message, 'type'=>$type);\r\n\t\t} else {\r\n\t\t\t$this->session->messages[] = array('message'=>$message, 'type'=>$type);\r\n\t\t}\r\n\t}", "protected function _setTextString($key, $value, $encoding) {}", "public function message()\n {\n return trans('stopforumspam::stopforumspam.it_is_currently_not_possible_to_register_with_your_specified_information_please_try_later_again');\n }", "public function translated();", "public function translated();", "function trans($key = null, $replace = [], $locale = null)\n{\n # sms.account_activation\n # sms.ad_activation\n\n if (is_null($key)) {\n return app('translator');\n }\n\n $exp = explode('.', $key, 2);\n $group = null;\n $item = $key;\n if( sizeof($exp) === 2 ) {\n $group = $exp[0];\n $item = $exp[1];\n }\n $if = \\DB::table('translator_translations')->where('group', $group)->where('item', $item)->exists();\n if (!$if) {\n \\DB::table('translator_translations')->insert([\n [\n 'locale' => 'ar',\n 'group' => $group,\n 'item' => $item,\n 'text' => $key,\n ], [\n 'locale' => 'en',\n 'group' => $group,\n 'item' => $item,\n 'text' => $key,\n ]\n ]);\n }\n\n return app('translator')->trans($key, $replace, $locale);\n}", "private function set_locale() {\n\n\t\t$plugin_i18n = new Soisy_Pagamento_Rateale_i18n();\n\n\t\t$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );\n\t}" ]
[ "0.64909166", "0.64909166", "0.63598126", "0.6325922", "0.6322502", "0.6316516", "0.62049615", "0.6173829", "0.61541957", "0.6110681", "0.61044574", "0.6050799", "0.6023423", "0.594828", "0.594678", "0.5938107", "0.59321636", "0.58935267", "0.5883487", "0.5879758", "0.5879219", "0.5832847", "0.57289976", "0.57282495", "0.57281464", "0.56699634", "0.5666147", "0.5657053", "0.56509966", "0.5639402", "0.5591883", "0.559185", "0.55897397", "0.5569331", "0.55689245", "0.5548805", "0.55431306", "0.5536165", "0.55189997", "0.5514094", "0.5510113", "0.5508248", "0.54989326", "0.5495915", "0.54759204", "0.54670686", "0.5466332", "0.5458599", "0.5455361", "0.545489", "0.54499793", "0.5446486", "0.5444455", "0.54392415", "0.54367125", "0.54360294", "0.54349685", "0.5433166", "0.5432363", "0.5424015", "0.5415884", "0.54083127", "0.5401279", "0.54010123", "0.54006505", "0.53917146", "0.5388095", "0.53878224", "0.5386059", "0.5385685", "0.5383137", "0.5370464", "0.53624874", "0.5350993", "0.53502655", "0.5348512", "0.5348451", "0.53481686", "0.5342793", "0.5332953", "0.53326416", "0.53210205", "0.53102595", "0.5309559", "0.53067964", "0.53023016", "0.52883", "0.5286923", "0.5285788", "0.5284262", "0.5281094", "0.527714", "0.52696574", "0.52695006", "0.52674574", "0.5263602", "0.5263182", "0.5261197", "0.5261197", "0.52512866", "0.5246655" ]
0.0
-1
Display a listing of the resource.
public function index() { return $this->attendanceRepository->all(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.7594873", "0.7594873", "0.75862724", "0.7577369", "0.75727355", "0.7500874", "0.74348205", "0.74339336", "0.7389178", "0.73531044", "0.73364365", "0.73124814", "0.7296061", "0.72818893", "0.7274119", "0.72423935", "0.72292763", "0.72266877", "0.7187332", "0.717915", "0.7174258", "0.7150343", "0.7144378", "0.7144238", "0.7134942", "0.7128289", "0.71236694", "0.7115823", "0.7115823", "0.7115823", "0.7112145", "0.70943975", "0.70857024", "0.70802104", "0.70800203", "0.7057187", "0.7057187", "0.7055648", "0.7039616", "0.7039533", "0.7036246", "0.70346695", "0.70305556", "0.7027626", "0.7026509", "0.70199776", "0.7017972", "0.70049554", "0.7003876", "0.7000925", "0.69973546", "0.6994639", "0.69937307", "0.69898754", "0.6986977", "0.69664884", "0.6965616", "0.69563985", "0.6951776", "0.69510984", "0.69472855", "0.69444585", "0.6942343", "0.69411284", "0.69378203", "0.69378203", "0.6936664", "0.69344825", "0.69317704", "0.69282645", "0.69263744", "0.6924216", "0.6918314", "0.6915855", "0.69128567", "0.6911424", "0.6910289", "0.69085616", "0.6903973", "0.6901382", "0.6901172", "0.6900354", "0.6895054", "0.6893486", "0.6893189", "0.68918854", "0.6891604", "0.6891604", "0.6889186", "0.6888053", "0.6887076", "0.6884677", "0.68822217", "0.6880916", "0.6875967", "0.68739045", "0.6873874", "0.6870332", "0.6869766", "0.68696475", "0.6868746" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { request()->validate([ 'file' => '|required|file|mimes:xlsx,csv,tsv,ods,xls,slk,xml,gnumeric,html', ]); if ($this->attendanceRepository->save($request)) { return response(array("id" => 1, "message" => "ok")); } else { return response(array("id" => 0, "message" => "fail")); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.7286258", "0.71454436", "0.7132821", "0.6640289", "0.6621105", "0.6566493", "0.65255576", "0.65087926", "0.6448317", "0.63752604", "0.63736314", "0.6365631", "0.6365631", "0.6365631", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229" ]
0.0
-1
Display the specified resource.
public function show($id) { return $this->attendanceRepository->find($id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(Attendance $attendance) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }" ]
[ "0.78557473", "0.76946205", "0.72731614", "0.7241571", "0.71700776", "0.70650244", "0.7052897", "0.698311", "0.69465625", "0.6944826", "0.69399333", "0.69286525", "0.69031185", "0.68969506", "0.68969506", "0.6878258", "0.6862812", "0.6859171", "0.68560475", "0.68436426", "0.6834711", "0.6810601", "0.680613", "0.6804975", "0.68015367", "0.6795471", "0.6791821", "0.6791821", "0.6787303", "0.6783644", "0.67790574", "0.67766285", "0.6767741", "0.67610145", "0.67455536", "0.67455536", "0.6744367", "0.6743159", "0.6739656", "0.67351145", "0.67246765", "0.67128825", "0.6692859", "0.66916454", "0.6687554", "0.66875297", "0.6687494", "0.6684443", "0.668203", "0.66689324", "0.66680384", "0.6664605", "0.6664605", "0.66621166", "0.66604865", "0.66589504", "0.6655767", "0.66542184", "0.665213", "0.66422516", "0.6631665", "0.663077", "0.6627607", "0.6627607", "0.66193914", "0.6618503", "0.66160196", "0.66146857", "0.6609641", "0.6608315", "0.6605284", "0.6595882", "0.65947276", "0.6594626", "0.65895563", "0.6589339", "0.6587281", "0.65805006", "0.6579201", "0.6579166", "0.657641", "0.6576111", "0.65740323", "0.65692765", "0.6568046", "0.6567221", "0.6565346", "0.6560687", "0.6560687", "0.6560384", "0.65577257", "0.65569293", "0.65558636", "0.6555392", "0.65553015", "0.65542984", "0.655418", "0.6554106", "0.6547678", "0.65473104", "0.6543329" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { request()->validate([ 'ac_no' => 'sometimes|required|integer', 'name' => 'sometimes|required|string', 'date' => 'sometimes|required|date', 'timetable' => 'sometimes|required|string', 'on_duty' => 'sometimes|required|date_format:H:i', 'off_duty' => 'sometimes|required|date_format:H:i', 'clock_in' => 'nullable|date_format:H:i', 'clock_out' => 'nullable|date_format:H:i', 'late' => 'nullable|date_format:H:i', 'early' => 'nullable|date_format:H:i', 'absent' => 'sometimes|required|integer', 'ot_time' => 'nullable|date_format:H:i', 'work_time' => 'nullable|date_format:H:i', 'comment' => 'sometimes|required|string', ]); $data = $request->all(); $data['user_id'] = Auth::user()->id; if ($this->attendanceRepository->update($data, $id)) { return response(array("id" => 1, "message" => "ok")); } else { return response(array("id" => 1, "message" => "fail")); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "abstract public function put($data);", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function put($path, $data = null);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7424884", "0.7062319", "0.70572054", "0.6897199", "0.658233", "0.6450576", "0.6347209", "0.6211253", "0.6146092", "0.6121878", "0.6114851", "0.61005586", "0.608833", "0.60537165", "0.60196865", "0.60068345", "0.5972924", "0.594671", "0.5940615", "0.5938648", "0.58927333", "0.58618903", "0.5855116", "0.5855116", "0.58517504", "0.5816175", "0.5807103", "0.5753658", "0.5753658", "0.57354003", "0.5724066", "0.5714874", "0.56957984", "0.5692136", "0.5688278", "0.5670771", "0.5656715", "0.5651525", "0.5647887", "0.563695", "0.5635239", "0.5633743", "0.5633203", "0.56296664", "0.5622203", "0.56089646", "0.5602395", "0.55937296", "0.55837464", "0.5582684", "0.55814886", "0.5575469", "0.5572433", "0.55668694", "0.556366", "0.5562336", "0.55611396", "0.55611396", "0.55611396", "0.55611396", "0.55611396", "0.5560869", "0.55574787", "0.55562645", "0.5554329", "0.5553793", "0.5553788", "0.55448633", "0.55448294", "0.5541889", "0.55402213", "0.5537772", "0.55359083", "0.55358595", "0.55248064", "0.5520229", "0.5517453", "0.5513332", "0.5511126", "0.55085385", "0.5508433", "0.5503835", "0.5502763", "0.5501662", "0.5500294", "0.5498694", "0.5496697", "0.5496697", "0.5495247", "0.5494445", "0.5494331", "0.549349", "0.5492967", "0.5484066", "0.5480196", "0.5479421", "0.54788667", "0.546669", "0.5464114", "0.54621613", "0.5458347" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { if ($this->attendanceRepository->delete($id)) { return response(array("id" => 1, "message" => "ok")); } else { return response(array("id" => 1, "message" => "fail")); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Loads a Class given the class name
public static function loadClass($className) { if($className === NULL) { throw new WURFL_WURFLException("Unable To Load Class : " . $className); } if (substr($className, 0, 6) !== WURFL_ClassLoader::CLASS_PREFIX) { return FALSE; } if (!class_exists($className, false)) { $ROOT = dirname(__FILE__) . DIRECTORY_SEPARATOR; $classFilePath = str_replace('_', DIRECTORY_SEPARATOR, substr($className, 6)) . '.php'; require_once ($ROOT . $classFilePath); } return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function load(string $class);", "public function load($className);", "public function loadClass($name) {\r\n //array of classes to be laoded\r\n $classes = array(\r\n 'Config' => '../config/Config.php',\r\n 'Error' => '../validation/Error.php',\r\n 'Flash' => '../flash/Flash.php',\r\n 'NotFoundException' => '../exception/NotFoundException.php',\r\n 'JobValidator' => '../validation/JobValidator.php',\r\n 'UserCredentialsValidator' => '../validation/UserCredentialsValidator.php',\r\n 'Utils' => '../util/Utils.php',\r\n 'HeadTemplate' => '../layout/HeadTemplate.php',\r\n 'User' => '../model/User.php',\r\n 'Clinic' => '../model/Clinic.php',\r\n 'ClinicDao' => '../dao/ClinicDao.php',\r\n 'UserDao' => '../dao/UserDao.php',\r\n 'ClinicMapper' => '../mapping/ClinicMapper.php',\r\n 'UserMapper' => '../mapping/UserMapper.php',\r\n 'Dao' => '../dao/Dao.php',\r\n 'Job' => '../model/Job.php',\r\n 'JobDao' => '../dao/JobDao.php',\r\n 'JobMapper' => '../mapping/JobMapper.php',\r\n 'AccountValidator' => '../validation/AccountValidator.php');\r\n \r\n //Exception handler if class not found\r\n if (!array_key_exists($name, $classes)) {\r\n die('Class\"' . $name . '\"not found.');\r\n }\r\n require_once $classes[$name];\r\n \r\n }", "function loadClass($className)\r\n{\r\n require $className . '.php';\r\n}", "function loadClass($class_name) {\n include \"$class_name.php\";\n}", "function load_class($class_name) {\n\t$class_file = CLASSES_DIR.strtolower($class_name).'.class.php';\n\n\tif (class_exists($class_name)) {\n\t\treturn true;\n\t}\n\telseif (file_exists($class_file) && is_readable($class_file)) {\n\t\trequire_once $class_file;\n\t\treturn true;\n\t}\n\telse {\n\t\tthrow new MyException(__FUNCTION__.': Class file ('.$class_file.') not found');\n\t}\n}", "public function loadClass($classname, $namespace = '\\\\', $path = '/');", "function load($classname)\r\n{\r\n\r\n\r\n if (file_exists($file = dirname (__FILE__) . '/' . $classname .'.class.php'))\r\n require_once $file;\r\n}", "public function LoadClass($classname){\r\n\r\n\t\tif(strrpos($classname, '.class.php') === false){\r\n\t\t\t$path = $this->conf['CLASS'].$classname.'.class.php';\r\n\t\t\t$class = ucfirst($classname);\r\n\t\t} else{\r\n\t\t\t$path = $this->conf['CLASS'].$classname;\r\n\t\t\t$class = ucfirst(str_replace('.class.php', '', $classname));\r\n\t\t}\r\n\t\techo '$classname:'.$classname;echo '<br/>';\r\n\t\techo '$path:'.$path;echo '<hr>';\r\n\t\techo '$class:'.$class;\r\n\r\n\t\tif(is_file($path)){\r\n\t\t\tinclude_once $path;\r\n\t\t\t$object = new $class();\r\n\t\t\treturn $object;\r\n\t\t}else{\r\n\t\t\t$this->ShowErrorMsg(\"The require class was not found\");\r\n\t\t}\r\n\t}", "private function loadClass($path, $class_name)\n {\n if (file_exists($path)) {\n $instance = new $class_name();\n return $instance;\n } else {\n throw new FileNotFoundException();\n }\n }", "function autoloadclass($scriptName) {\r\n if (substr($scriptName, -4, 4)==\".php\")\r\n $scriptName=substr($scriptName,0,strlen($scriptName)-4);\r\n if (substr($scriptName, -4, 4)==\".class\")\r\n $scriptName=substr($scriptName,0,strlen($scriptName)-4);\r\n $explodedName = explode(\"/\", $scriptName);\r\n $className = $explodedName[count($explodedName)-1];\r\n $scriptName=\"./\".$scriptName.\".class.php\";\r\n \r\n if (file_exists($scriptName)){\r\n include_once($scriptName);\r\n return new $className;\r\n }else\r\n throw new Exception(\"Unable to load class $scriptName\");\r\n}", "public static function loadClass(string $className)\n {\n $path = self::detectClassTypeDir($className) . '/' . $className . '.php';\n if (file_exists($path)) {\n require_once $path;\n } else {\n exit(\"Class not found!\");\n }\n }", "public static function loadClass( $className )\n\t{\n\t\tif ( class_exists($className, false) ) {\n\t\t\treturn $className;\n\t\t}\n\t\tself::loadFile($className . '.php', self::$_paths, true);\n\n\t\tif (!class_exists($className,false)) {\n\t\t\tthrow new Orm_Mapper_Exception('Invalid class (\"' . $className . '\")');\n\t\t}\n\n\t\treturn $className;\n\t}", "public static function loadClass($className)\r\n {\r\n if (class_exists ($className, false) || \r\n interface_exists($className, false)) \r\n {\r\n return;\r\n }\r\n // Simple path calculation\r\n $path = str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';\r\n include $path;\r\n }", "public function load($class_name)\n {\n require_once 'Libraries/' . $class_name . '.php';\n if (class_exists($class_name)) {\n return new $class_name($this->api_key);\n }\n\n return false;\n }", "function load_template_class( $class_name ) {\n\tglobal $classes_path;\n\trequire_once $classes_path . $class_name . '.php';\n\treturn $$template_loader_instance_name;\n}", "function loader($class)\n{\n\t$file = dirname(__DIR__) . DIRECTORY_SEPARATOR . $class . '.php';\n\tif (file_exists($file)) {\n\t\trequire $file;\n\t}\n}", "function class_loader($class) {\r\n require_once('classes/' . strtolower($class) . '.class.php');\r\n}", "public function loadClass ( $class_name ) {\r\n\t\tif ( 'GFP_ChargeIO' == mb_substr( $class_name, 0, 12 ) ) {\r\n\t\t\t$file_name = '';\r\n\t\t\t$namespace = '';\r\n\t\t\t$file_name .= str_replace( '_', DIRECTORY_SEPARATOR, $class_name );\r\n\t\t\t$parameters = explode( DIRECTORY_SEPARATOR, $file_name );\r\n\t\t\tforeach ( $parameters as &$parameter ) {\r\n\t\t\t\t$parameter = strtolower( $parameter );\r\n\t\t\t}\r\n\t\t\tunset( $parameter );\r\n\r\n\t\t\tif ( isset( $parameters[2] ) ) {\r\n\t\t\t\t$start_of_filename = strrpos( $file_name, DIRECTORY_SEPARATOR ) + 1;\r\n\t\t\t\t$file_name_to_replace = substr( $file_name, $start_of_filename );\r\n\t\t\t\t$actual_file_name = 'class-' . $parameters[0] . '-' . $parameters[1] . '-' . $parameters[2];\r\n\t\t\t\t$file_name = str_replace( $file_name_to_replace, $actual_file_name, $file_name ) . $this->_file_extension;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$actual_file_name = 'class-' . $parameters[0] . '-' . $parameters[1];\r\n\t\t\t\t$file_name = $file_name . DIRECTORY_SEPARATOR . $actual_file_name . $this->_file_extension;\r\n\t\t\t}\r\n\r\n\t\t\t$file_name = ( ( $this->_include_path !== null ) ? $this->_include_path . DIRECTORY_SEPARATOR : '' ) . $file_name;\r\n\r\n\t\t\trequire( $file_name );\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "static public function load($class)\n {\n if (!self::valid_classname($class))\n throw new Exception(\"Invalid class name.\");\n\n // CONTROLLER_DIR and CLASS_DIR are never user controlled.\n $dir = (substr($class, -10) == \"Controller\") \n ? CONTROLLER_DIR : CLASS_DIR;\n \n // $dir and $class are sane at this point.\n $filename = \"$dir/$class.php\";\n if (is_file($filename))\n require_once $filename;\n \n if (!class_exists($class, false))\n throw new Exception(\"Class not found.\");\n }", "function class_loader($class) {\n require('classes/' . $class . '.php');\n}", "public function loadClass($className)\n {\n $origClassName = str_replace('-', '', $className);\n\n /**/$this->app->pr->start('pathfinder/loadClass ');\n\n /**/$this->app->pr->next('pathfinder/loadClass/convertpath ');\n $className = ltrim($className, '\\\\');\n $nsPath = '';\n $namespace = '';\n if ($lastNsPos = strripos($className, '\\\\')) {\n $namespace = substr($className, 0, $lastNsPos);\n $className = substr($className, $lastNsPos + 1);\n $nsPath = str_replace('\\\\', DIRECTORY_SEPARATOR, $namespace);\n }\n $classPath = str_replace('_', DIRECTORY_SEPARATOR, $className).'.php';\n\n /**/$this->app->pr->next('pathfinder/loadClass/locate ');\n try {\n if ($namespace) {\n if (strpos($className, 'page_') === 0) {\n $path = $this->app->locatePath(\n 'addons',\n $nsPath.DIRECTORY_SEPARATOR.$classPath\n );\n } else {\n $path = $this->app->locatePath(\n 'addons',\n $nsPath.DIRECTORY_SEPARATOR\n .'lib'.DIRECTORY_SEPARATOR.$classPath\n );\n }\n } else {\n if (strpos($className, 'page_') === 0) {\n $path = $this->app->locatePath(\n 'page',\n substr($classPath, 5)\n );\n } else {\n $path = $this->app->locatePath(\n 'php',\n $classPath\n );\n }\n }\n } catch (Exception_PathFinder $e) {\n $e\n ->addMoreInfo('class', $className)\n ->addMoreInfo('namespace', $namespace)\n ->addMoreInfo('orig_class', $origClassName)\n ;\n throw $e;\n }\n\n if (!is_readable($path)) {\n throw new Exception_PathFinder('addon', $path, $prefix);\n }\n\n /**/$this->app->pr->next('pathfinder/loadClass/include ');\n /**/$this->app->pr->start('php parsing');\n include_once $path;\n\n if (!class_exists($origClassName, false) && !interface_exists($origClassName, false)) {\n throw $this->exception('Class is not defined in file or extended class can not be found')\n ->addMoreInfo('file', $path)\n ->addMoreInfo('namespace', $namespace)\n ->addMoreInfo('class', $className)\n ;\n }\n /**/$this->app->pr->stop();\n\n return $path;\n }", "private static function load($classname){\n\t\tif (substr($classname, -10) == \"Controller\"){\n if (file_exists(CURR_CONTROLLER_PATH.$classname.\".class.php\"))\n require_once CURR_CONTROLLER_PATH.\"$classname.class.php\";\n\t\t}\n\t\telse if (substr($classname, -5) == \"Model\"){\n if (file_exists(MODEL_PATH.\"$classname.class.php\"))\n require_once MODEL_PATH.\"$classname.class.php\";\n\t\t}\n\t}", "function myLoad($className){\n\t$path = MYPHP_SOURCE.'/'.str_replace('\\\\', '/', $className).'.class.php';\n\tif(file_exists($path)){\n\t\trequire_once $path;\n\t}\n}", "public function getClass(string $class);", "function loader($class)\n{\n $file = $class . '.php';\n if (file_exists($file)) {\n include $file;\n }\n}", "private static function load($classname)\n {\n if (substr($classname,-10)== \"Controller\") {\n require_once CURR_CONTROLLER_PATH . \"$classname.class.php\";\n } elseif (substr($classname,-5)== \"Model\") {\n require_once MODEL_PATH . \"$classname.class.php\";\n }\n }", "public static function loadClassByName ($className, $arguments = null)\n\t{\n\n\t\t$fileExists = file_exists(self::$path.$className.\".php\");\n\t\tif ($fileExists)\n\t\t{\n\t\t\t// we know file exists so load it up (if not already)\n\t\t\trequire_once (self::$path.$className.\".php\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tself::throw404();\n\t\t}\n\n\t\t// if arguments exist, pass them as you instantiate class\n\t\t// otherwise, just call it without arguments\n\t\tif ($fileExists && isset ($arguments) && is_array ($arguments))\n\t\t{\n\n\t\t\t$instance = new $className ($arguments);\n\t\t}\n\t\telse if ($fileExists)\n\t\t{\n\n\t\t\t$instance = new $className ();\n\t\t}\n\n\t\treturn $instance;\n\n\t}", "public static function loader($className)\n {\n if ( strpos($className, \"TinyBoard\") !== false){\n $className = substr($className, 10);\n }\n\n $file = self::$pathTop.DIRECTORY_SEPARATOR. str_replace(\"\\\\\", DIRECTORY_SEPARATOR, $className).self::$fileExt;\n if (file_exists($file) && !class_exists($className)){\n include_once $file;\n }\n else {\n throw new \\Exception(\"Error trying to autoload `$file` it doesn't exist\");\n }\n\n }", "public static function tryLoadClass($pName) {\n if(Str::startsWith($pName, __NAMESPACE__ . '\\\\')) {\n // This is a FastTrack internal class, check if file exists\n $ClassFileName = str_replace(__NAMESPACE__ . '\\\\', __DIR__ . '/', $pName); \n $ClassFileName = str_replace('\\\\', '/', $ClassFileName);\n $ClassFileName .= '.class.php';\n if(file_exists($ClassFileName)) {\n // The file exists, try to load it\n require($ClassFileName);\n }\n }\n else {\n // This is not a FastTrack internal class, determine all the file name possibilities\n $TmpName = str_replace('\\\\', '/', $pName);\n $ClassFileNames = [\n Config::$AppSourcesPath . '/' . $TmpName . '.class.php',\n Config::$AppSourcesPath . '/' . $TmpName . '.php'\n ];\n foreach ($ClassFileNames as $ClassFileName)\t{\n // For each possibility\n if(file_exists($ClassFileName)) {\n // The file exists, try to load it\n require($ClassFileName);\n\n // Exit loop\n break;\n }\n }\n }\n }", "public static function load( $class )\n\t{\n\t\t$class = strtolower($class); //force to lower case\n\n\t\tif (class_exists($class)) {\n\t\t\t return;\n\t\t}\n\n\t\t$classes = SomeLoader::register();\n\t\tif(array_key_exists( strtolower($class), $classes)) {\n\t\t\tinclude($classes[$class]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "abstract protected static function autoload($class);", "function __autoload($name){\n require_once './class/' . $name . \".class.php\";\n}", "function __autoload($class_name)\n{\n if (file_exists(\"classes/class.$class_name.php\"))\n {\n require_once \"classes/class.$class_name.php\";\n }else{echo'can not load';}\n}", "public function getClass($className);", "public static function load($class) {\n\t\t\t\n\t\t\tif ( !class_exists($class) ) { \n\t\t\t\t\n\t\t\t\t$file = str_replace(['\\\\', '_'], '/', $class);\n\t\t\t\t\n\t\t\t\t$path = path('framework').$file.'.php';\n\t\t\t\t\n\t\t\t\tif ( file_exists($path) ) {\n\t\t\t\t\t\n\t\t\t\t\trequire_once $path;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}", "public function loadClass(string $className)\n {\n $fileName = $this->obtainCurrentClass($className);\n //We force the loading of the class, otherwise, an exception is lifted.\n //If the inclusion path is null, we load the class from the root directory.\n $fileName = ($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '') . $fileName;\n if (file_exists($fileName))\n {\n require $fileName;\n }\n }", "public static function load($class) {\n\t\tif(isset(static::$mappings[$class])) {\n\t\t\treturn require static::$mappings[$class];\n\t\t}\n\n\t\t// format file name\n\t\t$file = str_replace(array('//', '\\\\'), DS, trim(strtolower($class), DS));\n\n\t\t// load aliases\n\t\tif(empty(static::$aliases)) {\n\t\t\tstatic::$aliases = Config::get('aliases', array());\n\t\t}\n\n\t\t// find alias\n\t\tif(array_key_exists(strtolower($class), array_change_key_case(static::$aliases))) {\n\t\t\treturn class_alias(static::$aliases[$class], $class);\n\t\t}\n\t\t\n\t\t// get file path\n\t\tif($path = static::find($file)) {\n\t\t\treturn require $path;\n\t\t}\n\n\t\treturn false;\n\t}", "public function getClass($name = null);", "function classLoader($className) {\n\t\trequire_once dirname(__FILE__) .\"/Classes/\". $className . '.php';\n\t}", "function loader($class){\n $class_file = DIR. DS . $class . '.php';\n\n if(file_exists($class_file)){\n require_once($class_file);\n }else{\n foreach (AUTOLOAD_CLASSES as $path){\n $class_file = $path . DS . $class . '.php';\n if(file_exists($class_file)) require_once($class_file);\n }\n }\n}", "function __autoload($className)\n\t{\n\t\t// Load class using Loader\n\t\tLoad($className);\n\t}", "public function instantiate($className);", "public static function loadClass($class) {\r\n\t\tif(strpos($class, \"Controller\")>0) {\r\n\t\t\t$filename = SITE_CONTROLLERS_DIR . $class . '.php';\r\n\t\t} else if(strpos($class, \"Model\")>0) {\r\n\t\t\t$firstname = str_replace('Model', '', $class);\r\n\t\t\t$filename = SITE_MODELS_DIR . $class . '.php';\t\t\t\r\n\t\t\tif(!file_exists($filename) && 's' != $firstname[strlen($firstname)-1]) {\r\n\t\t\t\t// XXX(neone): временно\r\n\t\t\t\t$filename = SITE_MODELS_DIR . $firstname . 'sModel' . '.php';\r\n\t\t\t}\r\n\t\t} else if(strpos($class, \"View\")>0) {\r\n\t\t\t$filename = SITE_VIEWS_DIR . $class . '.php';\r\n\t\t} else if(strpos($class, \"plh\")===0) {\r\n\t\t\t$filename = SITE_PLH_DIR . $class . '.php';\r\n\t\t} else {\r\n\t\t\t$filename = false;\r\n\t\t}\r\n\t\t\r\n\t\tif($filename && file_exists($filename)) {\r\n\t\t\tinclude $filename;\r\n\t\t} else {\r\n\t\t\tthrow new Exception(\"Autoloder fail :: '{$class}'\\n\");\r\n\t\t}\r\n\t}", "public function loadForClass($class, $group = Security::DEFAULT_GROUP);", "function autoload($class)\n{\n require('classes/' . $class . '.class.php');\n}", "public function loadClass($className)\n {\n $classFound = $this->composerClassLoader->loadClass($className);\n if (!$classFound && !$this->caseSensitiveClassLoading) {\n $classFound = $this->composerClassLoader->loadClass(strtolower($className));\n }\n return $classFound;\n }", "public function bridgeLoad( $class_name ){\r\n\t!defined('BAY_OMIT_CONTROLLER_CONSTRUCT') && define('BAY_OMIT_CONTROLLER_CONSTRUCT',true);\r\n\tif( !isset($this->bridge) ){\r\n\t require_once 'iSellBase.php';\r\n\t $this->bridge=new iSellBase();\r\n\t}\r\n\treturn $this->bridge->LoadClass($class_name);\r\n }", "function autoloadClass($classe)\n{\n require $classe . \".php\";\n}", "public function load($_className)\r\n {\r\n $_className = str_replace(\"\\\\\", DS, $_className);\r\n require(ROOT . DS . $_className . \".php\");\r\n }", "function load_class( $file_name, $class_name, $pass_var=\"\" )\n\t{\n\t\tif ( ! $class_name )\n\t\t{\n\t\t\t$class_name = $file_name;\n\t\t}\n\t\t\n\t\trequire_once( $file_name );\n\t\t\n\t\tif ( $pass_var )\n\t\t{\n\t\t\t$class = new $class_name ( $pass_var );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$class = new $class_name;\n\t\t}\n\t\t\n\t\t$class->ipsclass =& $this;\n\t\treturn $class;\n\t}", "public function load( $className ) {\n\n\t\t$path = $this->_basePath\n\t\t\t. DIRECTORY_SEPARATOR\n\t\t\t. str_replace( '\\\\', DIRECTORY_SEPARATOR, $className )\n\t\t\t. '.php';\n\n\t\tif ( file_exists( $path )) {\n\t\t\trequire_once $path;\n\t\t}\n\t}", "function classLoader($classname)\n{\n \n $classname = str_replace(\"\\\\\",'/',$classname);\n\n if (file_exists('../'.$classname.'.class.php')) {\n\trequire_once '../'.$classname.'.class.php';\n }\n \n}", "function autoload ($className) {\n \n $file = dirname(__FILE__) . '/' . $className . '.php';\n if (file_exists($file)) {\n require $file;\n }\n}", "function __autoload($className){\n include_once \"Classes/$className.php\";\n}", "private function autoload($className)\r\n {\r\n }", "private static function load_class( $relative_class_name ) {\n\t\t$classes_map = self::get_classes_map();\n\n\t\tif ( isset( $classes_map[ $relative_class_name ] ) ) {\n\t\t\t$filename = self::$default_path . '/' . $classes_map[ $relative_class_name ];\n\t\t} else {\n\t\t\t$filename = strtolower(\n\t\t\t\tpreg_replace(\n\t\t\t\t\t[ '/([a-z])([A-Z])/', '/_/', '/\\\\\\/' ],\n\t\t\t\t\t[ '$1-$2', '-', DIRECTORY_SEPARATOR ],\n\t\t\t\t\t$relative_class_name\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$filename = self::$default_path . $filename . '.php';\n\t\t}\n\n\n\t\tif ( is_readable( $filename ) ) {\n\t\t\trequire $filename;\n\t\t}\n\t}", "function __autoload($class_name) {include $class_name . '.php';}", "function classLoader($class)\r\n{\r\n $parts = explode('_', $class);\r\n $namespace = $parts[0];\r\n $classname = $parts[1];\r\n \r\n switch($namespace)\r\n {\r\n case 'Base':\r\n $filename = B_PATH . $classname . '.php';\r\n break;\r\n case 'Controller':\r\n $filename = C_PATH . $classname . '.php';\r\n break;\r\n case 'Model':\r\n $filename = M_PATH . $classname . '.php';\r\n break;\r\n }\r\n\r\n if (!file_exists($filename)) {\r\n return false;\r\n }\r\n require_once $filename;\r\n}", "public static function load($class)\n\t{\n\t\tif (array_key_exists($class, Config::$items['application']['aliases']))\n\t\t{\n\t\t\treturn class_alias(Config::$items['application']['aliases'][$class], $class);\n\t\t}\n\n\t\tif ( ! is_null($path = static::find($class)))\n\t\t{\n\t\t\trequire $path;\n\t\t}\n\t}", "public static function load($class)\n\t{\n\t\tif (array_key_exists($class, Config::$items['application']['aliases']))\n\t\t{\n\t\t\treturn class_alias(Config::$items['application']['aliases'][$class], $class);\n\t\t}\n\n\t\tif ( ! is_null($path = static::find($class)))\n\t\t{\n\t\t\trequire $path;\n\t\t}\n\t}", "private static function load($classname)\r\n {\r\n if (substr($classname, -10) == \"Controller\") {\r\n require_once CURR_CONTROLLER_PATH . \"$classname.php\";\r\n }\r\n }", "function classLoad ($myClass) {\n\t\tif(file_exists('../model/'.$myClass.'.class.php')){\n\t\t\tinclude('../model/'.$myClass.'.class.php');\n\t\t}\n elseif(file_exists('../controller/'.$myClass.'.class.php')){\n\t\t\tinclude('../controller/'.$myClass.'.class.php');\n\t\t}\n }", "function classLoad ($myClass) {\n\t\tif(file_exists('../model/'.$myClass.'.class.php')){\n\t\t\tinclude('../model/'.$myClass.'.class.php');\n\t\t}\n elseif(file_exists('../controller/'.$myClass.'.class.php')){\n\t\t\tinclude('../controller/'.$myClass.'.class.php');\n\t\t}\n }", "static public function load($class)\r\n {\r\n /* Normalize load path for namespaced classes */\r\n $class = str_replace(\"\\\\\", \"/\", $class);\r\n\r\n foreach(self::$paths as $path)\r\n {\r\n /*\r\n We check for two different file names: one where only the first\r\n letter of the class name is turned into lowercase and another where\r\n the entire class name is lowercased. This is because there are some\r\n classes (such as 'DB') where lowercasing only the first letter\r\n would not result in the correct file name ('dB.class.php' would be\r\n incorrect, 'db.class.php' is the actual file name).\r\n */\r\n $files = array(\r\n lcfirst($class) . \".class.php\",\r\n strtolower($class) . \".class.php\",\r\n $class . \".class.php\",\r\n $class . \".php\"\r\n );\r\n\r\n foreach($files as $current)\r\n {\r\n /* Build the file path to check */\r\n $file = $path . \"/\" . $current;\r\n\r\n /* Include it and exit if a file exists at that location */\r\n if(is_file($file))\r\n {\r\n require $file;\r\n return;\r\n }\r\n }\r\n }\r\n }", "private function _autoload_class($class_name) {\n\t\tif ($this->_attempt_autoload && class_exists($class_name)) {\n\t\t\t$reg = new Registration($class_name);\n\t\t\t$ssalc = new RegisteredClass($reg);\n\t\t\t$this->addClassToRegistry($ssalc);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function autoload($class_name)\n{\n $parts = str_replace('\\\\', '/', $class_name);\n \n $dir = dirname(__FILE__). '/';\n \n if (is_file($dir . $parts . '.php')) {\n include_once $dir . $parts . '.php';\n }\n}", "function __autoload($class_name) {\n include '../class/' . $class_name . '.php';\n}", "function __autoload($class_name) {\n include '../class/' . $class_name . '.php';\n}", "function chargerClasse($classname)\n{\n require $classname . '.php';\n}", "function autoload( $className ){\n\tif ( file_exists( $file = dirname( __FILE__). \"/../class/\".$className.\".class.php\" ) ){\n\t\trequire ( $file ); \n\t}\n}", "private static function load_subfolder_class($path_to_load,$class_name){\n $separate_char = '_';\n $file = str_replace($separate_char, DIRECTORY_SEPARATOR, $class_name) . '.php';\n \n if(!file_exists($path_to_load.$file)) {\n return false;\n }\n else {\n require_once $path_to_load.$file;\n }\n }", "private function loadClass($className)\n {\n $classNameParts = explode('_', $className, 3);\n if ($classNameParts[0] === self::PACKAGE_PREFIX) {\n\n // Caches the $classFiles\n if ($this->classFiles === null || empty($this->classFiles)) {\n $this->classFiles = $this->buildArrayOfClassFiles($classNameParts[1]);\n }\n\n if (is_array($this->tsConf['additionalIncludePaths.'])) {\n foreach ($this->tsConf['additionalIncludePaths.'] as $dir) {\n $temp = [];\n $temp = $this->buildArrayOfClassFiles($dir);\n\n $this->classFiles = array_merge($temp, $this->classFiles);\n }\n }\n\n $classFilePathAndName = isset($this->classFiles[$className]) ? $this->classFiles[$className] : null;\n if (isset($classFilePathAndName) && file_exists($classFilePathAndName)) {\n require_once($classFilePathAndName);\n }\n }\n }", "function __autoload($class_name) {\n require_once '/' . $class_name . '.php';\n}", "function __autoload($class_name){\n $classname = strtolower($class_name);\n $path = LIB_PATH.DS.\"class.{$classname}.php\";\n if(file_exists($path)){\n require_once \"$path\";\n }else{\n die(\"the file {$classname}.php could not be found\");\n }\n}", "function __autoload($className)\n{\n require_once \"webcore.reflection.php\";\n \n ClassLoader::loadClass($className);\n}", "public function loadClass($className)\n\t{\n\t\tforeach ($this->namespaces as $namespace => $path)\n\t\t{\n\t\t\tif (null === $namespace || $namespace === substr($className, 0, strlen($namespace)))\n\t\t\t{\n\t\t\t\t$fileName = '';\n\t\t\t\t$namespace = '';\n\n\t\t\t\tif (false !== ($lastNsPos = strripos($className, $this->namespaceSeparator)))\n\t\t\t\t{\n\t\t\t\t\t$namespace = substr($className, 0, $lastNsPos);\n\t\t\t\t\t$className = substr($className, $lastNsPos + 1);\n\t\t\t\t\t$fileName = str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;\n\t\t\t\t}\n\n\t\t\t\t$fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->fileExtension;\n\n\t\t\t\t$this->requireFile(($path !== null ? $path . DIRECTORY_SEPARATOR : '') . $fileName);\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "private function load($className) {\r\n\t// TODO\r\n\t\t$folders = ['classes', 'model', 'controller', 'view'];\r\n\t\tforeach ($folders as $f) {\r\n\t\t\tif(is_readable(__ROOT_DIR.'/'.$f.'/'.ucfirst($className).'.class.php'))\r\n\t\t\t{\r\n\t\t\t\trequire_once(__ROOT_DIR.'/'.$f.'/'.ucfirst($className).'.class.php');\r\n\t\t\t\t// echo 'AutoLoader /'.$f.'/'.ucfirst($className).'.class.php<br>';\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function loader($class)\n{\n if (strpos($class, 'Tests\\\\') !== false) {\n\n $file = __DIR__ . '/' . str_replace('\\\\', '/', substr($class, 17)) . '.php';\n\n } else {\n\n $file = __DIR__ . '/../src/' . str_replace('\\\\', '/', substr($class, 11)) . '.php';\n }\n\n if (file_exists($file)) {\n\n require $file;\n }\n}", "private static function autoLoader($class_name)\n\t{\n\t\t$load_class_file = ($class_name == 'Smarty') ? $class_name . '.class' : $class_name;\n\n\t\tspl_autoload($load_class_file);\n\t\tif (!class_exists($class_name)) {\n\t\t\tthrow new Phetiche_error(404);\n\t\t}\n\t}", "public function load($name)\n {\n $path = $this->map($name);\n\n if (($path===null) || (file_exists($path)===false)) {\n return false;\n }\n\n @include_once($path);\n\n return class_exists($name, false);\n }", "public static function autoload($className) {\n\t\tif(isset(self::$_classes[$className])) {\n\t\t\tinclude dirname(__FILE__) . self::$_classes[$className];\n\t\t}\n\t}", "public static function load($className) {\n\n\t\t$className = ltrim($className, '\\\\');\n\n\t\tif (!in_array($className, PlistaAPIAutoloader::$classes, true)){\n\t\t\treturn;\n\t\t}\n\n\t\t$fileName = 'plista-api' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR;\n\n\t\tif ($lastNsPos = strrpos($className, '\\\\')) {\n\t\t\t$namespace = substr($className, 0, $lastNsPos);\n\t\t\t$className = substr($className, $lastNsPos + 1);\n\t\t\t$fileName .= str_replace('\\\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;\n\t\t}\n\n\t\t$fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';\n\n\t\trequire($fileName);\n\t}", "function __autoload($class_name) {\n include $class_name . '.php';\n}", "function __autoload($class_name) {\n include $class_name . '.php';\n}", "function __autoload($class_name) {\n include $class_name . '.php';\n}", "function __autoload($class_name) {\n include 'classes/' . $class_name . '.php';\n}", "function __autoload($class_name) {\n\n require_once $class_name . '.class.php';\n\t\n}", "function __autoload($class_name) {\r\n include '../class/' . $class_name . '.php';\r\n}", "function __autoload($class_name) {\n include \"classes/\" . $class_name . \".class.php\";\n}", "static public function loader($class){\n if(in_array($class, self::entities)) {\n require(\"../entity/\" . $class . \".php\");\n }\n elseif (in_array($class, self::managers)) {\n require(\"../model/\" . $class . \".php\");\n }\n else{\n if(in_array($class, self::services)) {\n require(\"../services/\" . $class . \".php\");\n }\n }\n }", "private function loader($className) {\n\t\t//echo 'Trying to load ', $className, ' via ', __METHOD__, \"()\\n\";\n\t\tif(strrpos($className, 'PagarMe_') !== false) {\n\t\t\t$className = Tools::substr($className, 8);\n\t\t\t//echo 'Trying to load V2 ', $className, ' via ', __METHOD__, \"()\\n\";\n\t\t\tinclude dirname(__FILE__).'/../../lib/pagarme/'.$className . '.php';\n\t\t}else if(strrpos($className, 'Pagarmeps') !== false) {\n\t\t\tinclude dirname(__FILE__).'/../../classes/'.$className . '.php';\n\t\t} else {\n\t\t\tinclude dirname(__FILE__).'/../../lib/pagarme/'.$className . '.php';\n\t\t}\n\t}", "public function loadClass($className)\n\t{\n\t\tif (class_exists($className)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$filename = strtolower($className . '.class.php');\n\t\trequire_once(pwebframework::$PWF_PATH . $filename);\n\n\t\treturn false;\n\t}", "function chargerClasse($classname)\n{\n require $classname.'.php';\n}", "function classLoader($className){\r\n $classAry = explode('\\\\',$className);\r\n $class = array_pop($classAry);\r\n $subPath = strtolower(implode(DS,$classAry));\r\n $path = ROOT . DS . $subPath . DS . $class . '.php';\r\n if(file_exists($path)){\r\n require_once($path);\r\n }\r\n}", "function __autoload($class_name){\n require_once \"../cls/\".$class_name.'.php';\n}", "function __autoload($class_name) {\n include_once strtolower($class_name) . '.php';\n }", "protected static function load($class_name, $path, $createObj=FALSE)\n {\n\t\tif(is_array($class_name)){\n\t\t\t$__arr = each($class_name);\n\t\t\t$class_name\t\t\t= $__arr['key'];\n\t\t\t$constructor_val\t= $__arr['value'];\n\t\t} else {\n\t \t\t$constructor_val\t= NULL;\n\t \t}\n\t\t\n\t\tif(in_array($class_name, self::$_loaded_libs)){\n\t\t\treturn;\n\t\t} else {\n\t\t\tarray_push(self::$_loaded_libs, $class_name);\n\t\t}\n\t\t\n\t\t$internal_name = strtolower(str_replace(self::$_config['core']['subclass_prefix'], '', $class_name));\n//\t\techo($internal_name.'<br/>');\n\t\t\t\t\n\t\tif(in_array($internal_name, self::$_libs)){return;}\n\t\t\n\t\tif(is_file($path . \"$class_name.php\")){\n\t\t\trequire_once($path . \"$class_name.php\");\n\t\t} else {\n\t\t\trequire_once(self::$_config['core']['base_path'].self::$_runned_application.DIRECTORY_SEPARATOR.'libraries'.DIRECTORY_SEPARATOR.\"$class_name.php\");\n\t\t}\n \t\t\n\t\tif($createObj)\n\t\t{\n\t\t\tself::$_libs[$internal_name] = new $class_name($constructor_val);\n\t\t\treturn;\n\t\t}\n }", "protected function _getClass($name, $className = null, array $arguments = array())\n {\n if (! isset($this->$name)) {\n if (null === $className) {\n $className = $name;\n }\n $this->$name = $this->_loadClass($className, true, $arguments);\n }\n\n return $this->$name;\n }", "public static function autoload($class) {\n include $class . '.php';\n}", "public static final function loadClass($className)\n {\n\tforeach (self::$_paths as $path) {\n\t $includeFileName = $path . '/' . $className . '.inc.php';\n\t if (is_readable($includeFileName)) {\n\t\trequire_once($includeFileName);\n\t\treturn;\n\t }\n\t}\n }" ]
[ "0.83062476", "0.7954105", "0.7674033", "0.76098144", "0.7552139", "0.7406533", "0.7373622", "0.7251981", "0.718307", "0.7143206", "0.7132103", "0.71142006", "0.70990413", "0.70886433", "0.70604175", "0.7035116", "0.7026227", "0.6997787", "0.6971654", "0.69662434", "0.6959065", "0.690229", "0.68955964", "0.6884831", "0.6815095", "0.6800701", "0.6786187", "0.675865", "0.67479783", "0.67246497", "0.6714311", "0.6711805", "0.6693455", "0.66926146", "0.6689909", "0.6687531", "0.6683797", "0.66742563", "0.66620433", "0.6661065", "0.6657475", "0.6655543", "0.66247666", "0.660826", "0.660065", "0.6594757", "0.65844995", "0.6579343", "0.65752137", "0.6563871", "0.65633124", "0.6561306", "0.6553195", "0.6552473", "0.6539873", "0.6539698", "0.6535062", "0.6530655", "0.6514074", "0.6512912", "0.6512912", "0.6511217", "0.65049875", "0.65049875", "0.65030235", "0.6500463", "0.64970356", "0.64968187", "0.64968187", "0.64914304", "0.64826673", "0.6478849", "0.64757717", "0.64735955", "0.6469857", "0.6462779", "0.6461163", "0.6460889", "0.64604354", "0.6458672", "0.645818", "0.6451058", "0.64470994", "0.6443239", "0.6443239", "0.6443239", "0.6441584", "0.64392906", "0.6439193", "0.64386296", "0.6438069", "0.643289", "0.6432278", "0.64313483", "0.64311355", "0.6417305", "0.64143115", "0.64123845", "0.6411229", "0.64082366", "0.6406947" ]
0.0
-1
Sets autorization header telling that you need to be authenticated
public function setAuthenticateHeader() { $response = \Yii::$app->response; $response->getHeaders()->set('WWW-Authenticate', "Basic realm=\"{$this->realm}\""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAuthorization()\n\t{\n\t\t// @TODO We don't deal with a case where during your session the token expires\n\t\tif (is_null($this->access_token))\n\t\t{\n\t\t\t$response = $this->getToken();\n\t\t\t$this->access_token = $response->access_token;\n\t\t\t$this->authorization = \"Bearer \" . $this->access_token;\n\t\t}\n\t}", "private function prepareAuth()\n {\n $this->client->setHeaders(\n [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->zendeskHelper->getToken()\n ]\n );\n }", "public function authentication_header()\n {\n }", "public function auth(){\n if(empty($_COOKIE[\"utoken\"])){\n $cookie_value = $this->uuid();\n $this->utoken = $cookie_value;\n $this->setHeader($this->utoken);\n }else{\n $this->utoken = $_COOKIE[\"utoken\"];\n $this->setHeader($this->utoken);\n }\n }", "protected function setHeader(){\n $this->header = [\n 'Auth-id' => $this->username,\n 'Auth-token' => $this->generateToken(),\n 'Timestamp' => time()\n ];\n }", "protected function set_headers()\n\t{\n\t\tif($this->headers_required) { \n\n\t\t\t$this->headers = [\n\t\t\t \n\t\t\t\t'Authorization: '. $_SESSION['token'] .'',\n\t\t\t];\n\n\t\t}\n\n\t}", "function http_auth_headers() {\n\t\tif($this->http_user || $this->http_pass):\n\t\t\t$this->http_headers_add('Authorization', \" Basic \".base64_encode($this->http_user . \":\" . $this->http_pass));\n\t\tendif;\n\t}", "protected function __authorization(){\n\t\t $this->cURL->headers['Authorization'] = 'Bearer '.$this->access_token;\n }", "public function getAuth()\n {\n $this->getRequestHeaders([\n 'X-User-Id', 'X-Auth-Token'\n ]);\n }", "protected function sendAuthHeaders()\n {\n $sessionId = GlobalRequest::getSessionIdFromCookie();\n $sessionHandleKey = GlobalRequest::getSessionHandleKeyFromCookie();\n\n $this->setHeader('xa-modifier-sid', !empty($sessionId) ? $sessionId : \"null\");\n $this->setHeader('xa-modifier-shk', !empty($sessionHandleKey) ? $sessionHandleKey : \"null\");\n }", "function auth() {\n header('WWW-Authenticate: Basic realm=\"Citations\"');\n header('HTTP/1.0 401 Unauthorized');\n print 'authorisation required';\n exit;\n }", "public function buildAuthorizationHeader ()\n {\n $this->addHeader('Authorization', 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret));\n $this->is_preauthorized_request = 1;\n }", "public function setAuthenticated();", "protected function setBasicAuthHeader(): void\n {\n $this->setRequestHeader(\n 'Authorization',\n 'Basic ' . base64_encode($this->appId . ':' . $this->appPassword)\n );\n }", "function wp_populate_basic_auth_from_authorization_header()\n {\n }", "protected function setAuthtoken($authToken)\n {\n $this->header .= \"X-Auth-Token: \" . $authToken . \"\\r\\n\";\n }", "public static function authenticate(): void\n {\n $headers = getallheaders();\n $token = $headers['Authorization'] ?? null;\n\n if ($token === null\n || !self::validate($token)\n ) {\n header('Not authorized', true, 403);\n exit;\n }\n }", "public function buildAccessHeader ()\n {\n $this->is_preauthorized_request = 0;\n if ($this->IsAccessParams())\n $this->addHeader('Authorization', $this->token_type . ' ' . $this->access_token);\n\n }", "public function get_test_authorization_header()\n {\n }", "public function auth()\n {\n\n if (Auth::attempt(['email' => $this->request->header('email'), 'password' => $this->request->header('password')])) {\n $this->user = Auth::user();\n\n } else {\n echo json_encode(['error' => 'Unauthorised']);\n die();\n }\n }", "protected function setCurlHeaderElement() {\n // set header for cur\n $this->header[] = 'Content-type: application/json';\n $this->header[] = 'Authorization: Bearer '.$this->accessToken;\n }", "function setAuthHeaders($authInfos = NULL) {\n if (is_null($authInfos))\n $authInfos = $GLOBALS['clientsAuth'][$GLOBALS['defaultAuth']]; /// TODO revoir pour skidataInventory2\n $auth = new StdClass();\n\n $auth->ClientName = new SoapVar($authInfos['skidataDTAClientName'], XSD_STRING, NULL, NULL, 'ClientName', self::$skidataDTAHeaderNamespace);\n $auth->UserName = new SoapVar($authInfos['skidataDTAUserName'], XSD_STRING, NULL, NULL, 'UserName', self::$skidataDTAHeaderNamespace);\n $auth->Password = new SoapVar($authInfos['skidataDTAPassword'], XSD_STRING, NULL, 'Password', self::$skidataDTAHeaderNamespace);\n $header = new SoapHeader(self::$skidataDTAHeaderNamespace, 'AuthenticationHeader', $auth, false);\n\n $this->__setSoapHeaders(array($header));\n }", "protected function addAuthorization()\n {\n\n $username = $this->getUsername();\n $auth_type = $this->getAuthType();\n $this->addHeader([\n 'Authorization' => ( $auth_type == 'hash')\n ? 'WHM ' . $username . ':' . preg_replace(\"'(\\r|\\n|\\s|\\t)'\", '', $this->getPassword())\n :\n (\n ( $auth_type == 'password')\n ? 'Basic ' . base64_encode($username . ':' .$this->getPassword())\n : null\n )\n ]);\n\n return $this;\n }", "public static function setRedirectUponAuthentication(){\n\n /**\n * Make sure we redirect to the requested page\n */\n if(isset($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]) && !empty($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY])){\n CoreHeaders::setRedirect($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]);\n unset($_SESSION[self::CONST_REQUESTED_URI_SESSION_KEY]);\n }else{\n CoreHeaders::setRedirect('/');\n }\n\n }", "protected function protect()\n {\n header('HTTP/1.1 401 Unauthorized');\n\n switch ($this->type) {\n default:\n case self::AUTH_BASIC:\n header('WWW-Authenticate: Basic realm=\"' . $this->realm . '\"');\n break;\n case self::AUTH_DIGEST:\n header(\n 'WWW-Authenticate: Digest realm=\"' . $this->realm .\n '\", qop=\"auth\", nonce=\"' . md5(uniqid()) . '\", opaque=\"' . md5(uniqid()) . '\"'\n );\n break;\n }\n }", "public static function set_headers()\n {\n }", "private function __setAuthUser()\n {\n $authUser = $this->request->session()->read('Auth');\n\n $accountType = 'FREE';\n if (!empty($authUser)) {\n $accountType = $authUser['User']['account_type'];\n }\n\n $this->set(compact('authUser', 'accountType'));\n }", "public function setBasicAuth()\n {\n $auth = $this->auth;\n\n if (null !== $auth['user']) {\n $this->mink->getSession()->setBasicAuth(\n $auth['user'],\n $auth['password']\n );\n }\n }", "function assignFrontAuth() {\n AuthComponent::$sessionKey = 'Auth.User';\n $this->Auth->authenticate = array(\n 'Form' => array(\n 'userModel' => 'User',\n 'fields' => array('username' => 'email', 'password' => 'password', 'store_id'),\n 'scope' => array('User.merchant_id' => $this->Session->read('merchant_id'), 'User.role_id' => array('4', '5'), 'User.is_active' => 1, 'User.is_deleted' => 0)\n )\n );\n }", "private function login()\n {\n if (!isset($_SERVER['PHP_AUTH_USER']) || !$this->isAdmin()) {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n exit;\n }\n }", "public function authorize(){\n $token = $this->retrieveToken(); $this->setToken($token);\n }", "protected function setBearerAuthHeader(string $bearerToken): void\n {\n $this->setRequestHeader('Authorization', 'Bearer ' . $bearerToken);\n }", "function assignHQFrontAuth() {\n AuthComponent::$sessionKey = 'Auth.hqusers';\n $this->Auth->authenticate = array(\n 'Form' => array(\n 'userModel' => 'User',\n 'fields' => array('username' => 'email', 'password' => 'password', 'store_id'),\n 'scope' => array('User.merchant_id' => $this->Session->read('hq_id'), 'User.role_id' => array('4', '5'), 'User.is_active' => 1, 'User.is_deleted' => 0)\n )\n );\n }", "public function testSetsCorrectAuthenticationHeader()\n {\n /** @var \\Koren\\ErplyBooks\\Resource\\Invoices $invoicesResource */\n $invoicesResource = $this->client->Invoices();\n\n $request = new Request('GET', $invoicesResource->getEndpointUrl());\n\n $request = $this->client->authenticate($request);\n $this->assertInstanceOf(\n RequestInterface::class,\n $request\n );\n\n $this->assertTrue(\n $request->hasHeader('Accept')\n );\n\n $this->assertTrue(\n $request->hasHeader('Content-Type')\n );\n\n $this->assertEquals(\n $request->getHeader('Accept')[0],\n 'application/json'\n );\n\n $this->assertEquals(\n $request->getHeader('Content-Type')[0],\n 'application/json'\n );\n }", "public function setHeaders() {\r\n\t\t$this->resource->setHeaders();\r\n\t}", "public function preAuth(Request $request, Response $response);", "public function preAuth(Request $request, Response $response);", "public function test_authorization_header()\n {\n }", "function setHeaders()\n {\n header('Content-type: application/json');\n\n // Calculate Expires Headers if set to > 0\n $expires = $this->grav['config']->get('system.pages.expires');\n if ($expires > 0) {\n $expires_date = gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT';\n header('Cache-Control: max-age=' . $expires);\n header('Expires: '. $expires_date);\n }\n }", "public function authentication_header() {\n return 'Proxy-Authorization: Basic ' . base64_encode($this->authentication());\n }", "public function sendAuthChallengeHeader()\n {\n\t\t\n\t\theader('Authorization: Digest');\n header('WWW-Authenticate: Digest realm=\"' . self::AUTH_REALM \n . '\",qop=\"auth\",nonce=\"' . uniqid() \n\t\t\t . '\",algorithm=\"MD5\"'\n . '\",opaque=\"' . md5(self::AUTH_REALM) . '\"');\n\t\theader('HTTP/1.1 200');\n }", "protected function getBearerAuthHeader()\n {\n return \"Bearer \" . $this->retrieveToken();\n }", "function req_auth($realm = 'Secret Realm') {\n\theader('WWW-Authenticate: Basic realm=\"'.$realm.'\"');\n\theader('HTTP/1.1 401 Unauthorized');\n\tprint '<h1>Error 401: Authorization Required</h1>';\n\texit;\n}", "public static function getHeader(&$headers)\n {\n $headers['Authorization'] = 'Bearer '.self::getToken();\n }", "public function prepareBasicAuth()\n {\n $authString = base64_encode( $this->options['username'] . ':' . $this->options['password'] );\n\n $this->options['headers']['Authorization'] = \"Basic {$authString}\";\n }", "function unauthorized($realm = 'PHPRestSQL') {\n header('WWW-Authenticate: Basic realm=\"'.$realm.'\"');\n header('HTTP/1.0 401 Unauthorized');\n }", "public function setHeadersWithFullWpEnvironment() : void {\n $this->setCacheForPasswordProtected();\n }", "public function setHeaders()\n {\n }", "public function authenticated(): void\n {\n $this->authenticated = true;\n }", "public function setHeaders() : void {\n $this->setCacheHeaders();\n }", "public function authorize($auth)\n {\n $this->auth = $auth;\n }", "protected function getAuthorizationHeader(){\n return base64_encode(\n Controller\\Controller::getEnvironmentData('CCP_SSO_CLIENT_ID') . ':'\n . Controller\\Controller::getEnvironmentData('CCP_SSO_SECRET_KEY')\n );\n }", "abstract public function SetHeaders();", "function auth(){\n\t\t//TODO auth implementieren\n\t\treturn true;\n\t}", "function setHeader($header)\t{\n\t\tif(isset($header))\t{\n\t\t\tcurl_setopt($this->ch, CURLOPT_HTTPHEADER, $header);\n\t\t}\n\t\telse {\n\t\t\techo \"** Expecting header.\\n\";\n\t\t}\n\t}", "public function setAuthenticationParams() {\n }", "function setAuthType($authtype){\r\n\t\t$this->authType=$authtype;\r\n\t}", "private function setupSecurity()\n\t{\n\t\t$rd = $this -> httpHandler -> getResponseData();\n\n\t\t$counter = 0;\n\t\tforeach( $rd['headers']['Set-Cookie'] as $cookie ) :\n\t\t\t$cd = explode( \"=\", $cookie );\n\t\t\t$this -> cookies[$cd[0]] = rtrim( $cd[1], \"; path\" );\n\t\t\tif( $counter == 0 ) :\n\t\t\t\t$this -> authToken = array( \"name\" => $cd[0], \"value\" => rtrim( $cd[1], \"; path\" ) );\n\t\t\t\t$counter ++;\n\t\t\tendif;\n\t\tendforeach;\n\t}", "function setAuthType($authtype){\n $this->authType=$authtype;\n }", "function setAuthType($authtype){\n $this->authType=$authtype;\n }", "public function makeAuthHeader() {\r\n\t\t$this->timestamp = $this->timestamp ? $this->timestamp : $this->getEdgeGridTimestamp();\r\n\t\t$this->nonce = $this->nonce ? $this->nonce : $this->makeNonce();\r\n\r\n\t\t$auth_header = 'EG1-HMAC-SHA256 ' .\r\n\t\t\t\t'client_token=' . $this->client_token . ';' .\r\n\t\t\t\t'access_token=' . $this->access_token . ';' .\r\n\t\t\t\t'timestamp=' . $this->timestamp . ';' .\r\n\t\t\t\t'nonce=' . $this->nonce . ';';\r\n\r\n\t\t$this->verbose('auth_header', $auth_header);\r\n\r\n\t\tswitch ($this->method) {\r\n\t\t\tcase 'POST':\r\n\t\t\t\t$this->body_to_sign = $this->body;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'PUT':\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$this->body = null;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t$this->verbose('body_to_sign', $this->body_to_sign);\r\n\r\n\t\t$signed_auth_header = $auth_header . 'signature=' . $this->signRequest($auth_header);\r\n\t\t$this->verbose('signed_auth_header', $signed_auth_header);\r\n\r\n\t\treturn $signed_auth_header;\r\n\t}", "public function Autenticar(){\n try {\n $r = $this->auth->autenticar(\n $this->model->Acceder(\n $_POST['usuario'],\n $_POST['password']\n )\n );\n \n // Valida modelo de autenticacion definido\n if(__AUTH__ === 'token'){\n header(\"Location: ?c=Historia&token=$r\"); // Si fuera token, redirecciona al controlador por defecto anexando el N° de token generado\n } \n else{\n header('Location: ?c=Historia'); // En caso contrario, redireccion al controlador por defecto \n }\n } \n catch(Exception $e){\n header('Location: index.php'); // En caso de error remite a pagina inicial por defecto para validar credenciales de acceso\n }\n }", "public function\n\t\tsend_http_headers()\n\t{\n\t\tparent::send_http_headers();\n\t\t\n\t\t/*\n\t\t * Make sure that the user is logged in.\n\t\t */\n\t\t$alm = Admin_LoginManager::get_instance();\n\t\t\n\t\tif (!$alm->is_logged_in()) {\n\t\t\t$_SESSION['admin-login-data']['desired-url'] = new HTMLTags_URL();\n\t\t\t\n// $_SESSION['admin-login-data']['desired-url']->set_file('/hc/admin/navigation.html');\n\t\t\t$_SESSION['admin-login-data']['desired-url']->set_file('/Admin_StartPage');\n\t\t\t\n\t\t\t$redirection_manager = new PublicHTML_RedirectionManager();\n\t\t\t$redirection_url = $redirection_manager->get_url();\n\t\t\t\n\t\t\t$redirection_url->set_file('/hc/admin/login.html');\n\t\t\t\n\t\t\t$location_header_line = 'Location: ' . $redirection_url->get_as_string();\n\t\t\t\n\t\t\theader($location_header_line);\n\t\t\texit;\n\t\t}\n\t}", "public function Authenticate()\n {\n $authInfo = array(\n 'iat' => APP_TIME, \n 'nbf' => APP_TIME+1,\n );\n $accesToken = $this->container->get('authenticate')->requestAccessToken($authInfo);\n $this->view->set(array(\n 'accesToken' => $accesToken,\n ));\n }", "public function use_authentication()\n {\n }", "public function setBearerToken($token)\n {\n $this->options['headers']['Authorization'] = \"Bearer $token\";\n }", "public function setAuthorizationElement();", "function authorize()\n {\n try {\n $authRequest = $this->heimdall->validateAuth();\n $authRequest->setUser(new UserEntity());\n $this->heimdall->completeAuth($authRequest);\n } catch (Exception $exception) {\n $this->heimdall->handleException($exception);\n }\n }", "private function _secureBackend()\n\t{\n\t\tif (!$this->_isAuthenticated()) {\n\t\t\theader(\"HTTP/1.1 401 Unauthorized\");\n\t\t\texit();\n\t\t}\n\t}", "private function _prompt_login($user_id = 0)\n {\n header('WWW-Authenticate: Basic realm=\"'.$user_id.'\"');\n header('HTTP/1.0 401 Unauthorized');\n }", "function authenticateHeader($message = 'Authentication required')\n{\n header('WWW-Authenticate: Basic realm=\"FusionDirectory\"');\n header('HTTP/1.0 401 Unauthorized');\n echo \"$message\\n\";\n exit;\n}", "public function proceed ()\n {\n header('X-Viper-Auth: 123456789');\n $dummy = $this -> app() -> getHeader('X-Viper-Auth'); // 123456789\n }", "function authorizedUsersOnly(){\n global $authenticatedUser;\n if(empty($authenticatedUser)){\n header(\"HTTP/1.1 401 Unauthorized\");\n header(\"Location: https://eso.vse.cz/~frim00/marvelous-movies/error-401\");\n exit();\n }\n }", "public function setHeader($header);", "public function authentication(){\n return HelperTest::createBasicHeader();\n }", "public static function requireAuthorized()\n {\n if(!SessionHelper::isUserLoggedIn()){\n header('location: ' . (string)getenv('URL') . 'user/logIn');\n }\n }", "private static function setHeaders()\n {\n header('X-Powered-By: Intellivoid-API');\n header('X-Server-Version: 2.0');\n header('X-Organization: Intellivoid Technologies');\n header('X-Author: Zi Xing Narrakas');\n header('X-Request-ID: ' . self::$ReferenceCode);\n }", "public function ApiRequestAuthenticate($tokenAuth)\n {\n \\Piwik\\Registry::get('auth')->setLogin($login = null);\n \\Piwik\\Registry::get('auth')->setTokenAuth($tokenAuth);\n }", "public function\n\t\tsend_http_headers()\n\t{\n\t\tparent::send_http_headers();\n\t\t\n\t\t/*\n\t\t * Make sure that the user is logged in.\n\t\t */\n\t\t$alm = Admin_LoginManager::get_instance();\n\t\t\n\t\tif (!$alm->is_logged_in()) {\n\t\t\t$_SESSION['admin-login-data']['desired-url'] = new HTMLTags_URL();\n\t\t\t$_SESSION['admin-login-data']['desired-url']->set_file('/Admin_StartPage');\n\t\t\t\n\t\t\t$redirection_manager = new PublicHTML_RedirectionManager();\n\t\t\t$redirection_url = $redirection_manager->get_url();\n\t\t\t\n\t\t\t$redirection_url->set_file('/admin.html');\n\t\t\t\n\t\t\t$location_header_line = 'Location: ' . $redirection_url->get_as_string();\n\t\t\t\n\t\t\theader($location_header_line);\n\t\t\texit;\n\t\t}\n\t}", "public function auth()\n\t{\n\t\t$r = $this->do_auth();\n\t\t$x['status'] = $r;\n\t\techo json_encode($x);die;\n\t}", "public function authorizationHeader()\n {\n return sprintf('%s %s', $this->type, $this->accessToken);\n }", "public function authorization()\n {\n $this->mergeHeader([\n 'API-ACCESS-TOKEN' => \"Bearer \" . config(\"redx.access_token\")\n ]);\n\n return $this;\n }", "public function send401Unauthorized()\n {\n $this->sendHeader('HTTP/1.1 401 Unauthorized');\n }", "public function requestAuth()\n {\n return null;\n }", "function setAuthSignature($AuthSignature)\n {\n \t$this->_authSignature =$AuthSignature;\n }", "public function\r\n\t\tsend_http_headers()\r\n\t{\r\n\t\tparent::send_http_headers();\r\n\t\t\r\n\t\t/*\r\n\t\t * Make sure that the user is logged in.\r\n\t\t */\r\n\t\t$alm = Admin_LoginManager::get_instance();\r\n\t\t\r\n\t\tif (!$alm->is_logged_in()) {\r\n\t\t\t$_SESSION['admin-login-data']['desired-url'] = new HTMLTags_URL();\r\n\t\t\t\r\n\t\t\t$_SESSION['admin-login-data']['desired-url']->set_file('/hc/admin/navigation.html');\r\n\t\t\t\r\n\t\t\t$redirection_manager = new PublicHTML_RedirectionManager();\r\n\t\t\t$redirection_url = $redirection_manager->get_url();\r\n\t\t\t\r\n\t\t\t$redirection_url->set_file('/hc/admin/login.html');\r\n\t\t\t\r\n\t\t\t$location_header_line = 'Location: ' . $redirection_url->get_as_string();\r\n\t\t\t\r\n\t\t\theader($location_header_line);\r\n\t\t\texit;\r\n\t\t}\r\n\t}", "private function _sendPrimaryHeaders() {\n\t\theader(\"Access-Control-Allow-Origin: \".Environment::$api->allowOrigin);\n\t\theader(\"Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS\");\n\t\theader(\"Access-Control-Allow-Headers: Origin, Content-Type, Authorization, X-Custom-Auth\");\t\n\t}", "public function setUp() {\n parent::setUp();\n $session = new Zend_Session_Namespace('Administration');\n $session->admin = $this->createRandomAdministrationUser();\n $this->getRequest()->setHeader('Authorization', 'Basic ' . base64_encode('gf:thisishell'));\n\n }", "public function setAuth($userId, $authToken)\n {\n $this->setRequestHeaders([\n 'X-User-Id' => $userId,\n 'X-Auth-Token' => $authToken,\n ]);\n }", "public function authenticationReqd(){\n\t\theader('HTTP/1.0 401 Unauthorized');\n\t\t$this['app']['hologram']->setModule(\"WWW\")->log(\\Bakery\\Utilities\\Hologram::NORMAL, \"Response: Page requires authentication\");\r\n\t\t\n\t\t$_SESSION['redirect_to'] = $this['request']['uri'];\n\t\t\n\t\tif($this->isJson()){\n\n\t\t\treturn array(\"response\" => \"authentication required\");\n\t\t\t\n\t\t}\n\t\t\n\t\theader(\"Location: {$this['app']['security.login']['handler']}\");\n\t\t\n\t}", "public function setAuthParams()\n {\n if( $this->getUseSession() )\n {\n // FIXME Need to add session functionality\n }\n else\n {\n $this->getHttpClient()->setParameterGet( 'user', $this->getUsername() );\n $this->getHttpClient()->setParameterGet( 'password', $this->getPassword() );\n $this->getHttpClient()->setParameterGet( 'api_id', $this->getApiId() );\n }\n }", "public function setAuthorized() {}", "public function configureHeaders ()\n {\n $config = $this->app->config('github');\n\n $headers = array(\n 'Accept: application/vnd.github.v3+json',\n sprintf('User-Agent: %s', $config['handle'])\n );\n\n $this->addHeaders($headers);\n }", "public function authorize()\n\t{\n\t\t$state = md5(uniqid(rand(), TRUE));\n\t\t$this->oauth->ci->session->set_userdata('state', $state);\n\t\t\t\n\t\t$params = array(\n\t\t\t'client_id' => $this->_config['client_id'],\n\t\t\t'redirect_uri' => $this->_config['redirect_uri'],\n\t\t\t'state' => $state,\n\t\t\t'scope' => 'email'\n\t\t);\n\t\t\n\t\t$url = $this->_authorize_endpoint.http_build_query($params);\n\t\tredirect($url);\n\t}", "public function set_auth_code() {\n\t\t$tokens = new Token_User( '_indieauth_code_' );\n\t\t$tokens->set_user( self::$author_id );\n\t\treturn $tokens->set( static::$test_auth_code, 600 );\n\t}", "private function authenticate()\n {\n $this->client->authenticate($this->token, null, Client::AUTH_HTTP_TOKEN);\n }", "protected function authorize() {\r\n\t\t$authurl = $this->tmhOAuth->url(\"oauth/authorize\", '') . \"?oauth_token={$_SESSION['oauth']['oauth_token']}\";\r\n\t\theader(\"Location: \".$authurl);\r\n\t\texit;\r\n\r\n\t\t// in case the redirect doesn't fire\r\n\t\t$this->addMsg('<p>To complete the OAuth flow please visit URL: <a href=\"' . $authurl . '\">' . $authurl . '</a></p>');\r\n\t}", "public function withAuthHeader($user)\n {\n $token = JWTAuth::fromUser($user);\n $this->headers['Authorization'] = \"Bearer {$token}\";\n return $this;\n }", "function setExternalAccessUserAuthorization( $flag = true )\r\n\t{\r\n\t $this->external_access_user_authorization = $flag;\r\n\t}", "public function openAuthorizationUrl()\n {\n header('Location: ' . $this->getAuthorizationUrl());\n exit(1);\n }" ]
[ "0.702322", "0.7004076", "0.6986348", "0.6976852", "0.6959325", "0.675015", "0.6735196", "0.673283", "0.6685304", "0.66836655", "0.6605274", "0.6583517", "0.64165694", "0.64147997", "0.63940006", "0.6292193", "0.6210134", "0.617427", "0.61313754", "0.6114502", "0.60141236", "0.5990447", "0.59808046", "0.5932632", "0.5926741", "0.5918034", "0.58954966", "0.5859595", "0.58466816", "0.5845771", "0.58324224", "0.5830313", "0.5820453", "0.58184147", "0.58176476", "0.5760749", "0.5760749", "0.5754697", "0.57435805", "0.5740068", "0.5720006", "0.5715307", "0.5679429", "0.5675766", "0.5658141", "0.5644319", "0.56274426", "0.5614516", "0.5603055", "0.5600131", "0.5587494", "0.5568595", "0.5560548", "0.5549712", "0.5541197", "0.55401677", "0.5532409", "0.55203664", "0.55170465", "0.55170465", "0.55128294", "0.5502532", "0.5493883", "0.5493057", "0.5488841", "0.548775", "0.54843664", "0.5480418", "0.54772145", "0.5474896", "0.5472821", "0.54702777", "0.5462316", "0.5460145", "0.54373527", "0.5432638", "0.5431932", "0.54241914", "0.542264", "0.54199487", "0.54132557", "0.5412698", "0.5408797", "0.5406142", "0.5405189", "0.54044807", "0.5401339", "0.5395031", "0.5374104", "0.5365743", "0.53655684", "0.53622615", "0.5361434", "0.53536224", "0.5344395", "0.53411824", "0.5334031", "0.5319937", "0.53180134", "0.5313536" ]
0.70890963
0
Function to Add Plan
public function AddExe($data){ $this->db->insert('executive',$data); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createPlan(){\n if(!$this->request->plan_name || !$this->request->plan_description) {\n return false;\n }\n $this->plan = Planes::create([\n 'name' => $this->request->plan_name,\n 'description' => $this->request->plan_description,\n 'price' => $this->request->price,\n 'product_id' => $this->request->product_id,\n 'balance' => $this->request->balance,\n ]);\n $this->plan = new PlanesFormatter($this->plan);\n }", "function Add()\n\t{\n\t\t// Check user authorization and permissions\n\t\tAuthenticatedUser()->CheckAuth();\n\t\t// The User needs both Rate Management and Admin Permissions\n\t\tAuthenticatedUser()->PermissionOrDie(PERMISSION_RATE_MANAGEMENT | PERMISSION_ADMIN);\n\n\t\t// Context menu\n\t\t// Nothing to add\n\n\t\t// Breadcrumb menu\n\t\tBreadCrumb()->Employee_Console();\n\t\tBreadCrumb()->AvailablePlans(TRUE);\n\t\tBreadCrumb()->SetCurrentPage(\"Add Rate Plan\");\n\n\t\t// Handle form submittion\n\t\tif (SubmittedForm('AddPlan', 'Commit') || SubmittedForm('AddPlan', 'Save as Draft'))\n\t\t{\n\t\t\t// Validate the plan\n\t\t\t$mixResult = $this->_ValidatePlan();\n\t\t\tif ($mixResult !== TRUE && $mixResult !== FALSE)\n\t\t\t{\n\t\t\t\t// The plan is invalid and an error message has been returned\n\t\t\t\tAjax()->AddCommand(\"Alert\", $mixResult);\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telseif ($mixResult === FALSE)\n\t\t\t{\n\t\t\t\t// The plan is invalid and no error message was specified, so it is assumed appropraite actions have already taken place\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The plan is valid. Save it to the database\n\t\t\t\tTransactionStart();\n\t\t\t\t$mixResult = $this->_SavePlan();\n\t\t\t\tif ($mixResult !== TRUE && $mixResult !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t// Saving the plan failed, and an error message has been returned\n\t\t\t\t\tTransactionRollback();\n\t\t\t\t\tAjax()->AddCommand(\"Alert\", $mixResult);\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t\telseif ($mixResult === FALSE)\n\t\t\t\t{\n\t\t\t\t\t// Saving the plan failed, and no error message was specified, so it is assumed appropraite actions have already taken place\n\t\t\t\t\tTransactionRollback();\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// The plan was successfully saved to the database\n\t\t\t\t\tTransactionCommit();\n\n\t\t\t\t\t// If we've saved as a draft, then filter our Plan List to Drafts\n\t\t\t\t\tif (DBO()->Plan->Archived->Value == RATE_STATUS_DRAFT) {\n\t\t\t\t\t\t$_SESSION['AvailablePlansPage']['Filter']['Status']\t= RATE_STATUS_DRAFT;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set the message appropriate to the action\n\t\t\t\t\t$strSuccessMsg = (DBO()->Plan->Archived->Value == RATE_STATUS_ACTIVE)? \"The plan has been successfully saved\" : \"The plan has been successfully saved as a draft\";\n\t\t\t\t\tAjax()->AddCommand(\"AlertAndRelocate\", Array(\"Alert\" => $strSuccessMsg, \"Location\" => Href()->AvailablePlans().'?RatePlan.Status='.RATE_STATUS_DRAFT));\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check if there has been a BaseRatePlan.Id specified, to base the new RatePlan on\n\t\tif (DBO()->BaseRatePlan->Id->Value)\n\t\t{\n\t\t\t// There is, so load it\n\t\t\tDBO()->RatePlan->Id = DBO()->BaseRatePlan->Id->Value;\n\t\t\tif (!DBO()->RatePlan->Load())\n\t\t\t{\n\t\t\t\t// Could not load the RatePlan\n\t\t\t\tDBO()->Error->Message = \"The RatePlan with id: \". DBO()->RatePlan->Id->value .\" could not be found\";\n\t\t\t\t$this->LoadPage('error');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t// Reset the Id of the RatePlan, because we are creating a new one, not editing an existing one\n\t\t\tDBO()->RatePlan->Id = 0;\n\t\t}\n\t\telseif (DBO()->RatePlan->Id->Value)\n\t\t{\n\t\t\t// We are opening an existing RatePlan for editing\n\t\t\t// Update the Breadcrumb menu\n\t\t\tBreadCrumb()->SetCurrentPage(\"Edit Draft Rate Plan\");\n\n\t\t\t// We want to display an existing RatePlan\n\t\t\tif (!DBO()->RatePlan->Load())\n\t\t\t{\n\t\t\t\t// Could not load the RatePlan\n\t\t\t\tDBO()->Error->Message = \"The RatePlan with id: \". DBO()->RatePlan->Id->value .\" could not be found\";\n\t\t\t\t$this->LoadPage('error');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t// Make sure the Rate Plan is a draft\n\t\t\tif (DBO()->RatePlan->Archived->Value != RATE_STATUS_DRAFT)\n\t\t\t{\n\t\t\t\t// Can't edit the Rate Plan\n\t\t\t\tDBO()->Error->Message = \"The RatePlan with id: \". DBO()->RatePlan->Id->value .\" and Name \\\"\". DBO()->RatePlan->Name->Value .\"\\\" is not a draft and therefore cannot be edited\";\n\t\t\t\t$this->LoadPage('error');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// We want to add a new RatePlan\n\t\t\tDBO()->RatePlan->Id = 0;\n\t\t}\n\n\t\t$this->LoadPage('rate_plan_add');\n\n\t\treturn TRUE;\n\n\t}", "public function create($name, $id)\n {\n return $this->add(new Plan($name, $id));\n }", "function show_plan_add() {\n //must check that the user has the required capability \n if (!current_user_can('manage_options')) {\n csm_error('You do not have sufficient permissions to access this page', true);\n }\n \n $CsmWorkplace = new CsmWorkplace();\n $workplaces = $CsmWorkplace->all();\n \n //Add the member\n if (isset($_POST['action']) && $_POST['action'] === 'addplan') {\n $data = $_POST;\n $Csmplan = new CsmPlan();\n try {\n $Csmplan->create($_POST);\n csm_set_update('New membership plan was added');\n hacky_redirect('csm-plans');\n } catch (\\Exception $e) {\n csm_error($e->getMessage());\n }\n }\n \n include(CSM_PLUGIN_PATH . 'app/views/plan-add.view.php');\n}", "public function add(Plan $plan)\n {\n $this->plans[] = $plan;\n\n return $plan;\n }", "public function create_plan($requestData){\n \n // ### Create Plan\n try {\n // Create a new instance of Plan object\n $plan = new Plan();\n if(isset($requestData['plan'])){\n $this->setArrayToMethods($this->checkEmptyObject($requestData['plan']), $plan);\n } \n // # Payment definitions for this billing plan.\n $paymentDefinition = new PaymentDefinition(); \n $paymentDefinition\n ->setAmount(new Currency($requestData['paymentDefinition']['Amount']));\n array_pop($requestData['paymentDefinition']);\n if(!empty($this->checkEmptyObject((array)$paymentDefinition))){\n $this->setArrayToMethods(array_filter($requestData['paymentDefinition']), $paymentDefinition); \n }\n \n // Charge Models\n $chargeModel = new ChargeModel();\n $chargeModel->setAmount(new Currency($requestData['chargeModel']['Amount']));\n array_pop($requestData['chargeModel']);\n if(!empty($this->checkEmptyObject((array)$chargeModel))){\n $this->setArrayToMethods(array_filter($requestData['chargeModel']), $chargeModel); \n $paymentDefinition->setChargeModels(array($chargeModel));\n }\n \n $merchantPreferences = new MerchantPreferences();\n $baseUrl = $requestData['baseUrl'];\n\n $merchantPreferences->setReturnUrl($baseUrl.$requestData['ReturnUrl'])\n ->setCancelUrl($baseUrl.$requestData['CancelUrl']);\n if(!empty($this->checkEmptyObject($requestData['merchant_preferences']['SetupFee']))){\n $merchantPreferences->setSetupFee(new Currency($requestData['merchant_preferences']['SetupFee']));\n }\n array_pop($requestData['merchant_preferences']);\n \n if(isset($requestData['merchant_preferences'])){\n $this->setArrayToMethods($this->checkEmptyObject($requestData['merchant_preferences']), $merchantPreferences);\n }\n if(!empty($this->checkEmptyObject((array)$paymentDefinition))){\n $plan->setPaymentDefinitions(array($paymentDefinition));\n }\n if(!empty($this->checkEmptyObject((array)$merchantPreferences))){\n $plan->setMerchantPreferences($merchantPreferences);\n } \n $requestArray= clone $plan;\n $output = $plan->create($this->_api_context); \n $returnArray['RESULT'] = 'Success';\n $returnArray['PLAN'] = $output->toArray();\n $returnArray['RAWREQUEST']=$requestArray->toJSON();\n $returnArray['RAWRESPONSE']=$output->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }", "public function getPlan();", "public function plan_create( $plan_id, $amount, $name, $interval, $trial_days = FALSE ) {\r\n\t\t$params = array(\r\n\t\t\t'id' => $plan_id,\r\n\t\t\t'amount' => $amount,\r\n\t\t\t'name' => $name,\r\n\t\t\t'currency' => 'usd',\r\n\t\t\t'interval' => $interval\r\n\t\t);\r\n\t\tif( $trial_days )\r\n\t\t\t$params['trial_period_days'] = $trial_days;\r\n\t\t\t\r\n\t\treturn $this->_send_request( 'plans', $params, STRIPE_METHOD_POST );\r\n\t}", "public function add() {\n $dataH['CustomerBankAccount'] = $_lib['sess']->get_companydef('BankAccount');\n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $dataH['CustomerAccountPlanID'] = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber')));\n }", "public function create($plan, array $properties = array());", "public function savePlan($plan)\n {\n return Stripe\\Plan::create(array(\n \"amount\" => $plan->price,\n \"interval\" => $plan->interval,\n \"name\" => $plan->name,\n \"currency\" => \"usd\",\n 'id' => $plan->level\n ));\n }", "public function run()\n {\n Plan::create([\n \t'name' => 'Free Plan',\n\t\t\t'plan_identifier' => 'free_plan',\n\t\t\t'limit_list' => 3,\n\t\t\t'limit_space' => 1500,\n\t\t\t'price' => 0\n ]); \n }", "private function insertPlan($accountId, $planId, $effectiveDate) {\n $stmt = $this->pdo->prepare(\n 'INSERT INTO account_plans(account_id,plan_id,effective_date) '\n . 'VALUES(:account_id,:plan_id,:effective_date)');\n \n return $stmt->execute([\n ':account_id' => $accountId,\n ':plan_id' => $planId,\n ':effective_date' => $effectiveDate,\n ]);\n }", "public function __construct()\n {\n $this->plan = new Plan();\n }", "public function create_plan() {\n if (empty($this->user->admin)) {\n Router::redirect('/');\n die();\n }\n\n # Set up query\n $q = \"INSERT INTO plans SET\n\t\t\t description='\".$_POST['description'].\"', time='\".$_POST['time'].\"', public='\".(!empty($_POST['public'])?1:0).\"',\n\t\t\t modified_date='\".Time::now().\"', modified_by='\".$this->user->user_id.\"'\";\n $plans = DB::instance(DB_NAME)->query($q);\n\n # Set up query\n $q = \"SELECT\n\t\t\t p.plan_id, p.description,p.time,p.public, c.first_name, c.last_name, p.modified_date, p.show\n\t\t\t FROM plans AS p inner join\n\t\t\t users as u on p.modified_by=u.user_id\n \t\t inner JOIN contacts AS c ON u.user_id=c.user_id\n\t\t\t and c.modified_date = (select max(modified_date) from\n\t\t\t contacts as c where c.user_id=p.modified_by) and p.plan_id = LAST_INSERT_ID()\n \";\n\n # Run query\n $result = DB::instance(DB_NAME)->select_row($q);\n $result[\"posted_on\"] = Time::display($result['modified_date'],'Y-m-d H:m:s');\n\n #Adding action to System Log\n $data3 = Array (\n\n \"modified_date\" => Time::now(),\n \"FK_id\" => $result[\"plan_id\"],\n \"FK_table\" => 'plans',\n \"login\" => false,\n \"modified_by\" => $this->user->user_id\n );\n DB::instance(DB_NAME)->insert('logs',$data3);\n\n //Return result to jTable\n $jTableResult = array();\n $jTableResult['Result'] = \"OK\";\n $jTableResult['Record'] = $result;\n print json_encode($jTableResult);\n }", "public function addAccount($firstName, $lastName, $planId, $effectiveDate) {\n try {\n // start the transaction\n $this->pdo->beginTransaction();\n \n // insert an account and get the ID back\n $accountId = $this->insertAccount($firstName, $lastName);\n \n // add plan for the account\n $this->insertPlan($accountId, $planId, $effectiveDate);\n \n // commit the changes\n $this->pdo->commit();\n } catch (\\PDOException $e) {\n // rollback the changes\n $this->pdo->rollBack();\n throw $e;\n }\n }", "public function creating(Plan $plan)//troquei o created por creating\n {\n $plan->url = Str::kebab($plan->name);\n }", "public function create($planData)\n {\n \t$planPurchase \t\t\t\t = new PlanPurchase();\n\t\t$planPurchase->user_id \t\t = $this->user->id;\n\t\t$planPurchase->plan_id \t\t = $planData->plan_id;\n\t\t$planPurchase->country_code = $planData->country_code;\n\t\t$planPurchase->gold_price = (float)$this->plan->gold_price;\n\t\t$planPurchase->transaction_id = $planData->transaction_id;\n\t\t$planPurchase->save();\n\n \t/** Add Chest Capacity value in user's table **/\n \t(new ChestService)->setUser($this->user)->expand($this->plan->bucket);\n \t\n /** Deduct User Gold **/\n $goldBalance = (new UserRepository($this->user))->deductGold($this->plan->gold_price);\n\n \t/** return the available skeleton keys **/\n \treturn ['chest_bucket'=> $this->user->buckets['chests'], 'available_gold_balance'=> $goldBalance];\n }", "public function planCreate(array $array);", "private function _SavePlan()\n\t{\n\t\t/*\n\t\t * Saving process:\n\t\t *\t\tS1: Set up values for properties of the RatePlan object that are not already defined, or not in their database correct format\n\t\t *\t\tS2: Save the record to the RatePlan table\n\t\t *\t\tS3: Remove any records in the RatePlanRateGroup table\n\t\t *\t\tS4: For each RateGroup belonging to this RatePlan:\n\t\t *\t\t\t\tadd a record to the RatePlanRateGroup table\n\t\t *\t\tS5: If the RatePlan is being Committed: (not being saved as a draft)\n\t\t *\t\t\t\tFor each draft RateGroup belonging to this RatePlan:\n\t\t *\t\t\t\t\tupdate the Archived property of the RateGroup in the RateGroup table so that it is now a committed RateGroup, not a draft\n\t\t *\t\t\t\t\tFor each draft Rate belonging to the draft RateGroup:\n\t\t *\t\t\t\t\t\tupdate the Archived property of the Rate in the Rate table so that it is now a committed Rate, not a draft\n\t\t */\n\n\t\t// S1: Set up the remaing fields required of a RatePlan record\n\t\tDBO()->RatePlan->MinMonthly\t= ltrim(DBO()->RatePlan->MinMonthly->Value, \"$\");\n\t\tDBO()->RatePlan->ChargeCap\t= ltrim(DBO()->RatePlan->ChargeCap->Value, \"$\");\n\t\tDBO()->RatePlan->UsageCap\t= ltrim(DBO()->RatePlan->UsageCap->Value, \"$\");\n\n\t\tif (SubmittedForm('AddPlan', 'Save as Draft'))\n\t\t{\n\t\t\t// Flag the plan as being a draft\n\t\t\tDBO()->RatePlan->Archived = RATE_STATUS_DRAFT;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// The plan is not being saved as a draft\n\t\t\tDBO()->RatePlan->Archived = RATE_STATUS_ACTIVE;\n\t\t}\n\n\t\tDBO()->RatePlan->modified_employee_id\t= Flex::getUserId();\n\t\tif (!DBO()->RatePlan->Id->Value)\n\t\t{\n\t\t\t// Plan has not been saved before\n\t\t\tDBO()->RatePlan->created_employee_id\t= Flex::getUserId();\n\t\t}\n\n\t\t// If the RatePlan has already been saved as a draft then load in the details that don't get edited here, so they don't get erased\n\t\tif (DBO()->RatePlan->Id->Value)\n\t\t{\n\t\t\tDBO()->RatePlan->LoadMerge();\n\t\t}\n\n\t\t// S2: Save the plan to the database\n\t\tif (!DBO()->RatePlan->Save())\n\t\t{\n\t\t\t// Saving failed\n\t\t\treturn \"ERROR: Saving the RatePlan to the RatePlan database table failed, unexpectedly\";\n\t\t}\n\n\t\t// S3: Remove all records from the RatePlanRateGroup table where RatePlan == DBO()->RatePlan->Id->Value\n\t\t$delRatePlanRateGroup = new Query();\n\t\t$delRatePlanRateGroup->Execute(\"DELETE FROM RatePlanRateGroup WHERE RatePlan = \" . DBO()->RatePlan->Id->Value);\n\n\t\t// S4: Save each of the RateGroups associated with the RatePlan to the RatePlanRateGroup table\n\t\tDBO()->RatePlanRateGroup->RatePlan = DBO()->RatePlan->Id->Value;\n\t\tforeach ($this->_arrRateGroups as $intRateGroup)\n\t\t{\n\t\t\tDBO()->RatePlanRateGroup->Id = 0;\n\t\t\tDBO()->RatePlanRateGroup->RateGroup = $intRateGroup;\n\n\t\t\tif (!DBO()->RatePlanRateGroup->Save())\n\t\t\t{\n\t\t\t\t// Saving failed\n\t\t\t\treturn \"ERROR: Saving one of the RateGroup - RatePlan associations failed, unexpectedly.<br />The RatePlan has not been saved\";\n\t\t\t}\n\t\t}\n\n\t\t// S5: Remove all records from the rate_plan_discount table where RatePlan == DBO()->RatePlan->Id->Value\n\t\t$delRatePlanDiscount\t= new Query();\n\t\t$delRatePlanDiscount->Execute(\"DELETE FROM rate_plan_discount WHERE rate_plan_id = \" . DBO()->RatePlan->Id->Value);\n\n\t\t// S6: Remove any records from the discount table which are no longer linked to any Rate Plans (Discounts cannot be shared between Plans)\n\t\t$delUnlinkedDiscounts\t= new Query();\n\t\t$delUnlinkedDiscounts->Execute(\"DELETE FROM discount WHERE (SELECT id FROM rate_plan_discount WHERE discount_id = discount.id LIMIT 1) IS NULL\");\n\n\t\t// S7: Save each of the Discounts which are linked between this Rate Plan and a Record Type\n\t\t$aDiscountReferenceMap\t= array();\n\t\tforeach (DBL()->RecordType as $dboRecordType)\n\t\t{\n\t\t\t$sRecordTypeObjectName\t\t= \"RecordType_{$dboRecordType->Id->Value}\";\n\t\t\t$iDiscountReference\t= (int)DBO()->{$sRecordTypeObjectName}->discount_id->Value;\n\n\t\t\t// Has the Discount already been created?\n\t\t\tif ($iDiscountReference && $iDiscountReference > 0)\n\t\t\t{\n\t\t\t\tif (!array_key_exists($iDiscountReference, $aDiscountReferenceMap))\n\t\t\t\t{\n\t\t\t\t\t// Create the Discount\n\t\t\t\t\t$sDiscountObjectName\t= \"discount_{$iDiscountReference}\";\n\n\t\t\t\t\t$oDiscount\t\t\t\t\t= new Discount();\n\t\t\t\t\t$oDiscount->name\t\t\t= trim(DBO()->{$sDiscountObjectName}->name->Value);\n\t\t\t\t\t$oDiscount->description\t\t= trim(DBO()->{$sDiscountObjectName}->description->Value);\n\n\t\t\t\t\tif (DBO()->{$sDiscountObjectName}->limit_type->Value === 'UNITS')\n\t\t\t\t\t{\n\t\t\t\t\t\t$oDiscount->charge_limit\t= null;\n\t\t\t\t\t\t$oDiscount->unit_limit\t\t= abs((int)trim(DBO()->{$sDiscountObjectName}->limit->Value));\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$oDiscount->charge_limit\t= abs((float)trim(DBO()->{$sDiscountObjectName}->limit->Value));\n\t\t\t\t\t\t$oDiscount->unit_limit\t\t= null;\n\t\t\t\t\t}\n\t\t\t\t\t$oDiscount->charge_limit\t= ($oDiscount->charge_limit) ? $oDiscount->charge_limit : null;\n\t\t\t\t\t$oDiscount->unit_limit\t\t= ($oDiscount->unit_limit) ? $oDiscount->unit_limit : null;\n\n\t\t\t\t\t$oDiscount->save();\n\n\t\t\t\t\t// Create the Discount<->RatePlan Link\n\t\t\t\t\t$oRatePlanDiscount\t\t\t\t\t= new Rate_Plan_Discount();\n\t\t\t\t\t$oRatePlanDiscount->rate_plan_id\t= DBO()->RatePlan->Id->Value;\n\t\t\t\t\t$oRatePlanDiscount->discount_id\t\t= $oDiscount->id;\n\t\t\t\t\t$oRatePlanDiscount->save();\n\n\t\t\t\t\t$aDiscountReferenceMap[$iDiscountReference]\t= $oDiscount->id;\n\t\t\t\t}\n\n\t\t\t\t// Save Link\n\t\t\t\t$oDiscountRecordType\t\t\t\t\t= new Discount_Record_Type();\n\t\t\t\t$oDiscountRecordType->discount_id\t\t= $aDiscountReferenceMap[$iDiscountReference];\n\t\t\t\t$oDiscountRecordType->record_type_id\t= $dboRecordType->Id->Value;\n\t\t\t\t$oDiscountRecordType->save();\n\t\t\t}\n\t\t}\n\n\t\t// S8: If the RatePlan is being committed then all draft RateGroups used by it must be commited and all draft Rates\n\t\t// used by the draft RateGroups must be committed\n\t\tif ((SubmittedForm('AddPlan', 'Commit')) && (count($this->_arrRateGroups) > 0))\n\t\t{\n\t\t\t$strRateGroups \t= implode(',', $this->_arrRateGroups);\n\t\t\t$arrUpdate\t\t= Array(\"Archived\" => RATE_STATUS_ACTIVE);\n\t\t\t$updRateGroups \t= new StatementUpdate(\"RateGroup\", \"Archived = \". RATE_STATUS_DRAFT .\" AND Id IN ($strRateGroups)\", $arrUpdate);\n\t\t\t$updRates \t\t= new StatementUpdate(\"Rate\", \"Archived = \". RATE_STATUS_DRAFT .\" AND Id IN (SELECT Rate FROM RateGroupRate WHERE RateGroup IN ($strRateGroups))\", $arrUpdate);\n\n\t\t\tif ($updRateGroups->Execute($arrUpdate, NULL) === FALSE)\n\t\t\t{\n\t\t\t\treturn \"ERROR: Commiting one of the Draft Rate Groups, used by this Rate Plan, failed.<br />The RatePlan has not been saved\";\n\t\t\t}\n\n\t\t\tif ($updRates->Execute($arrUpdate, NULL) === FALSE)\n\t\t\t{\n\t\t\t\treturn \"ERROR: Commiting one of the Draft Rates, used by this Rate Plan, failed.<br />The RatePlan has not been saved\";\n\t\t\t}\n\t\t}\n\n\t\t// Everything has been saved\n\t\treturn TRUE;\n\t}", "function add_predefined_innovation_plan($params)\n {\n $this->db->insert('predefined_innovation_plan', $params);\n $id = $this->db->insert_id();\n $db_error = $this->db->error();\n if (! empty($db_error['code'])) {\n echo 'Database error! Error Code [' . $db_error['code'] . '] Error: ' . $db_error['message'];\n exit();\n }\n return $id;\n }", "private function get_plan()\n\t{\n\t\treturn $this->m_plan;\n\t}", "public function add_to_plan(Request $request, $id)\n {\n $rules = [\n 'plan_id' => 'required|numeric',\n ];\n $attrs = [\n 'plan_id' => '出团计划id',\n ];\n $this->validate($request, $rules, [], $attrs);\n\n $obj = SaleOrder::find($id);\n $obj->fill($request->all());\n $obj->save();\n return redirect('/sale_order');\n \n }", "public function run()\n {\n Plan::create([\n 'name' => 'Free Plan',\n 'trial_days' => 7,\n 'max_workspaces' => 1,\n 'max_users' => 5,\n 'max_clients' => 5,\n 'max_projects' => 5,\n 'image' => 'free_plan.png',\n 'status' => 1,\n ]);\n }", "public function run()\n {\n Plan::create([\n 'name' =>'November Subscription Plan',\n 'description'=>\"It's time to increase your customers! Buy our subscription plan and save a spot of your choice amongst the top 20 restaurants that will be listed for a date night Hurry!\"\n ]);\n }", "public function create()\n {\n $this->authorize('create', Plan::class);\n\n return view('admin.plans.create');\n \n }", "public function store(StoreStripePlanRequest $request)\n {\n Log::debug(\"STORE PLAN\");\n\n $amount = $request->amount . '00';\n\n $stripeService = new StripeService();\n $stripeService->setStripeKey();\n\n $stripeSubscriptionService = new StripeSubscriptionService();\n $result = $stripeSubscriptionService->createPlan($amount, $request->name, $request->product, $request->interval);\n\n if ($result['message'] == 'Success'){\n\n session()->flash('success', 'Plan created successfully.');\n \n return redirect( route ('plans.index') );\n\n } else {\n\n Log::debug($result['message']);\n\n session()->flash('error', $result['message']);\n \n return redirect()->back();\n\n }\n\n }", "public function prepareAddSolventPlan($params) {\n \textract($params);\n \t$fields = $this->getFields();\n \t$sm = new SolventManagement($db,$facilityID);\n \t$facility = new Facility($db);\n \t$facility->initializeByID($facilityID);\n \t$currentDate = getdate();\n \tif (($year > $currentDate['year']) || ($year == $currentDate['year'] && $month >= $currentDate['mon'])) {\n \t\t$year = $currentDate['year'];\n \t\t$month = $currentDate['mon']-1;\n \t\tif ($month == 0) {\n \t\t\t$year--;\n \t\t\t$month = 12;\n \t\t}\n \t}\n \t$input = $facility->getCurrentUsageOptimized($month,$year);\n \tif (!$input) {\n \t\t$input = 0;\n \t}\n \t$noOutputs = false;\n \t$sm->getMonthlyOutputs($month,$year);\n \tif (!$sm->isAlreadyExist) {\n \t\tforeach ($fields as $field) {\n \t\t\t$sm->$field = 0;\n \t\t}\n \t\t$noOutputs = true;\n \t}\n \t$sm->iniOutputNames();\n \t$validation['summary'] = 'success';\n \tif ($save) {\n \t\t$sumOut = 0;\n \t\tforeach($outputs as $output_id => $value) {\n \t\t\t$sm->$output_id = $value;\n \t\t\tif (!is_numeric($value) || $value < 0 ) {\n \t\t\t\t$validation['summary'] = 'failed';\n \t\t\t\t$validation[$output_id] = 'Error! Please enter valid value!';\n \t\t\t} else {\n \t\t\t\t$sumOut += $value;\n \t\t\t}\n \t\t}\n \t\tif ((string)$input != (string)$sumOut) {\n \t\t\t$validation['summary'] = 'failed';\n \t\t\t$validation['input'] = 'Error! Input does not equal output!';\n \t\t}\n \t\tif ($validation['summary'] == 'success') {\n \t\t\t$sm->save();\n \t\t\treturn true;\n \t\t}\n \t}\n \t$company = new Company($db);\n\t\t$companyDetails = $company->getCompanyDetails($facility->getCompanyID());\n\t\t$unittype = new Unittype($db);\n\t\t$unittypeDescr = $unittype->getNameByID($companyDetails['voc_unittype_id']);\n\t\t$currentDate = getdate();\n \treturn array(\n \t\t'data' => $sm,\n \t\t'validation' => $validation,\n \t\t'input' => $input,\n \t\t'month' => $month,\n \t\t'year' => $year,\n\t\t\t'fields' => $fields,\n\t\t\t'unittype' => $unittypeDescr,\n \t\t'curYear'\t=> $currentDate['year'],\n \t\t'noOutputs'\t=> $noOutputs\n \t);\n }", "private function submitPlan(Request $request)\n\t{\n\t\tStripe::setApiKey( config('services.stripe.key') );\n\n\t\treturn Stripe::plan([\n\t\t\t'id' => str_slug( $request->nickname ),\n\t\t\t'amount' => $request->amount,\n\t\t\t'product' => 'service',\n\t\t\t'interval' => $request->interval,\n\t\t\t'currency' => $request->currency,\n\t\t]);\n\t}", "public function iN_InsertNewPointPlan($userID, $planKey, $planPointAmount, $planAmount) {\n\t\tif ($this->iN_CheckIsAdmin($userID) == 1) {\n\t\t\tmysqli_query($this->db, \"INSERT INTO i_premium_plans(plan_name_key, plan_amount,amount,plan_status)VALUES('$planKey','$planPointAmount','$planAmount','0')\") or die(mysqli_error($this->db));\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function setPlan(?string $plan): self\n {\n $this->plan = $plan;\n\n return $this;\n }", "public function run()\n {\n Plan::factory()->createMany([\n ['id' => Plan::FREE_PLAN, 'name' => 'Free', 'monthly_payment' => 0],\n ['id' => Plan::BASIC_PLAN, 'name' => 'Basic', 'monthly_payment' => 100],\n ['id' => Plan::PLUS_PLAN, 'name' => 'Plus', 'monthly_payment' => 187],\n ]);\n }", "public function addPlan(AppsPlans $plan, int $quantity = 1) : self\n {\n if ($this->countPlans('apps_plans_id =' . $plan->getId())) {\n throw SubscriptionException::duplicatePlan($plan);\n }\n\n $subscription = $this->asStripeSubscription();\n\n $item = $subscription->items->create(array_merge([\n 'plan' => $plan->stripe_id,\n 'quantity' => $quantity,\n 'metadata' => [\n 'appPlan' => $plan->getId()\n ]\n ]));\n\n $subscriptionItem = new SubscriptionItems();\n $subscriptionItem->subscription_id = $this->getId();\n $subscriptionItem->apps_plans_id = $item->metadata->appPlan ?: 0;\n $subscriptionItem->stripe_id = $item->id;\n $subscriptionItem->stripe_plan = $item->plan->id;\n $subscriptionItem->quantity = $item->quantity;\n $subscriptionItem->saveOrFail();\n\n return $this;\n }", "public function created(PlanSubscription $planSubscription)\n {\n //\n }", "public function plan()\n {\n echo '客户要求改变计划' . PHP_EOL;\n }", "function manage_bonus_plans(){}", "public function run()\n {\n $plans = [\n [\n 'name' => 'Monthly',\n 'slug' => 'monthly',\n 'gateway_id' => 'month_6',\n 'price' => 6.00,\n 'active' => true,\n 'teams_enabled' => false,\n 'teams_limit' => null,\n ],\n [\n 'name' => 'Yearly',\n 'slug' => 'yearly',\n 'gateway_id' => 'year_60',\n 'price' => 60.00,\n 'active' => true,\n 'teams_enabled' => false,\n 'teams_limit' => null,\n ],\n [\n 'name' => 'Monthly for 10 users',\n 'slug' => 'monthly-for-10-users',\n 'gateway_id' => 'team_month_55',\n 'price' => 55.00,\n 'active' => true,\n 'teams_enabled' => true,\n 'teams_limit' => 10,\n ],\n ];\n\n Plan::insert($plans);\n }", "public function plans() {\n return new Plan($this);\n }", "public function testAddPackingPlan()\n {\n }", "public function UsePlan($plan_id) {\n\t\t$this->Param('plan_id', $plan_id, 'recur');\n\n\t\treturn true;\n\t}", "public function run()\n {\n Plan::create([\n 'name' => 'low_monthly',\n 'braintree_plan_id' => 'low_monthly',\n 'price' => '500',\n 'priceName' => 'Five',\n 'period' => 'month',\n ]);\n\n Plan::create([\n 'name' => 'high_monthly',\n 'braintree_plan_id' => 'high_monthly',\n 'price' => '1000',\n 'priceName' => 'Ten',\n 'period' => 'month',\n ]);\n }", "public function run()\n {\n $group = Group::factory()\n ->count(1)\n ->create();\n \n Plan::first()->groups()->attach($group->first()->id);\n }", "static public function ctrCrearPlan()\n\t{\n\t\tif(isset($_POST[\"nuevoEscuela\"]))\n\t\t{\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoEscuela\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"nuevoClaveEscuela\"])){\n\n\t\t\t $tabla = \"planes\";\n\t\t\t\t$datos = array(\"escuela\" => $_POST[\"nuevoEscuela\"], \n\t\t\t \t\t\t \"clave\" => $_POST[\"nuevoClaveEscuela\"], \n\t\t\t \t\t\t \"fecha\" => $_POST[\"nuevaFecha\"], \n\t\t\t \t\t\t \"nivel\" => $_POST[\"niv\"], \n\t\t\t \t\t\t \"grado\" => $_POST[\"grad\"], \n\t\t\t \t\t\t \"componente\" => $_POST[\"compe\"], \n\t\t\t \t\t\t \"aprendizaje\" => $_POST[\"aprend\"]);\n\n\t\t\t\t$respuesta = ModeloPlanes::mdlIngresarPlanes($tabla,$datos);\n\t\t\t\tif($respuesta = \"ok\"){\n\t\t\t \t\techo '<script> \n\t \t\t\t\t\tswal({\n\t \t\t\t\t\t\ttype: \"success\",\n\t \t\t\t\t\t\ttitle: \"¡La actividad ha sido guardado correctamente!\",\n\t \t\t\t\t\t\tshowConfirmButton: true,\n\t \t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t \t\t\t\t\t\tcloseOnConfirm: false\n\n\t \t\t\t\t\t}).then((result)=>{\n\t \t\t\t\t\t\tif(result.value)\n\t \t\t\t\t\t\t{\n\t \t\t\t\t\t\t\twindow.location = \"PlanCurricular\";\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\t});\n\n\t \t\t\t\t \t</script>';\n\t\t\t \t}\n\n\t\t\t}else{\n\t\t\t\techo '<script> \n \t\t\t\t\tswal({\n \t\t\t\t\t\ttype: \"error\",\n \t\t\t\t\t\ttitle: \"¡Los planes no pueden ir vacios o llevar caracteres especiales!\",\n \t\t\t\t\t\tshowConfirmButton: true,\n \t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n \t\t\t\t\t\tcloseOnConfirm: false\n\n \t\t\t\t\t}).then((result)=>{\n \t\t\t\t\t\tif(result.value)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\twindow.location = \"PlanCurricular\";\n \t\t\t\t\t\t}\n \t\t\t\t\t\t});\n\n \t\t\t\t </script>';\n\t\t\t}\n\t\t}\n\t}", "public function store(Request $request)\n {\n /* dd($request->all()); */\n $this->authorize('create', Plan::class);\n\n Stripe\\Stripe::setApiKey(env('STRIPE_SECRET'));\n \n $this->validate($request, [\n 'name' => 'required',\n 'price' => 'required',\n 'duration' => 'required',\n // 'trial' => 'present'\n // 'plan_type' => 'required',Rule::in(['one_time','recurring'])\n ]);\n // Generate pla slug from plan name\n $slug = str_replace(' ','-', $request->input('name'));\n $gateway_id = str_replace(' ','_', $request->input('name'));\n //$team_enable = !empty($request->input('teams_limit')) ? 1 : 0;\n //$teams_limit = !empty($request->input('teams_limit')) ? $request->input('teams_limit') : NULL;\n $price = (float) $request->input('price') * 100;\n \n $interval=explode(',',$request->duration);\n /* dd($interval); */\n //Add the Stripe Api key to create the plan on the stripe dashboard\n // if($request->plan_type == \"recurring\"){\n \\Stripe\\Plan::create([\n \"amount\" => $price,\n \"interval\" => $interval[1],\n \"interval_count\"=>$interval[0], \n \"product\" => [\n \"name\" => $request->name,\n ],\n \"trial_period_days\" => $request->trial,\n \"currency\" => \"usd\",\n \"id\" => $gateway_id,\n //\"trial_period_days\" => $request->input('trial'),\n ]);\n // }elseif($request->plan_type == \"one_time\"){\n // \\Stripe\\Product::create([\n // \"name\" => $request->name,\n // \"id\" => $gateway_id,\n // ]);\n // \\Stripe\\Price::create([\n // \"unit_amount\" => $price,\n // \"currency\" => \"usd\",\n // \"product\" => $gateway_id,\n // ]);\n // }\n /* dd(123); */\n $plan = new Plan([\n 'name' => $request->name,\n 'gateway_id' => $gateway_id,\n 'price' => $request->price,\n 'brand' => $request->brand,\n 'contest' => $request->contest,\n 'duration' => $request->duration,\n 'other_info_1' => $request->plan_info_1,\n 'other_info_2' => $request->plan_info_2,\n //'teams_enabled' => $team_enable,\n //'teams_limit' => $teams_limit,\n 'active' => 1,\n 'slug' => $slug,\n 'trial_period_days' => $request->trial,\n ]);\n\n $plan->save();\n\n return redirect()->back()->with(\"status\", \"Your plan has been created.\");\n }", "abstract function is_single_plan();", "public function addCartItem($rateplanId, $quantity){\r\n\t\terror_log('cart.php rateplanId is: ' . $rateplanId, 0);\r\n\t\terror_log('cart.php quantity is: ' . $quantity, 0);\r\n\t\t//$newCartItem = new Cart_Item($rateplanId, $quantity, $this->latestItemId);\r\n\r\n\r\n\r\n\t\t$newCartItem = new Cart_Item();\r\n\t\t$newCartItem->ratePlanId = $rateplanId;\r\n\t\terror_log('cart.php ratePlanId2 is: ' . $newCartItem->ratePlanId, 0);\r\n\t\t$newCartItem->itemId = $this->latestItemId++;\r\n\t\terror_log('cart.php itemId is: ' . $newCartItem->itemId, 0);\r\n\t\t$newCartItem->quantity = $quantity;\r\n\r\n\t\t//$plan = Catalog::getRatePlan($newCartItem->ratePlanId);\r\n\t\t$rpId = $newCartItem->ratePlanId;\r\n\r\n\t\r\n\r\n\r\n\t\t$catalog_groups = self::readCache();\t//should be in associative array already.\r\n\r\n\t\t$catalog_products = $catalog_groups->products;\t//returns enture product array.\r\n\t\t//error_log(print_r($catalog_products, true));\r\n\t\t//error_log(print_r($catalog_products[2], true));\t//returns a product array with productrateplan and productrateplancharges arrays embedded inside.\r\n\t\t$catalog_rateplans = $catalog_products[0]->productRatePlans;\r\n\t\t//error_log(print_r($catalog_rateplans, true));\r\n\r\n\r\n\r\n\t\t//Commented out for DEMO\r\n\t\t// foreach($catalog_groups as $group){\r\n\t\t// \t\r\n\t\t// \tforeach($group->products as $product){\r\n\t\t// \t\t\r\n\t\t// \t\tforeach($product->productRatePlans as $ratePlan){\r\n\t\t// \t\t\tif($ratePlan->id == $rpId){\r\n\t\t// \t\t\t\t$plan = $ratePlan;\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// $plan = NULL;\r\n\r\n\t/**\r\n\t * Given a RatePlan ID, retrieves all rateplan information by searching through the cached catalog file\r\n\t * @return RatePlan model\r\n\t */\r\n\t// public static function getRatePlan($rpId){\r\n\t// \t$catalog_groups = self::readCache();\r\n\t// \tforeach($catalog_groups as $group){\r\n\t// \t\tforeach($group->products as $product){\r\n\t// \t\t\tforeach($product->ratePlans as $ratePlan){\r\n\t// \t\t\t\tif($ratePlan->Id == $rpId){\r\n\t// \t\t\t\t\treturn $ratePlan;\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 NULL;\r\n\t// }\r\n\r\n\r\n/*\t\t//Not needed? no Uom. \r\n\t\tif(isset($plan->Uom)){\r\n\t\t\t$newCartItem->uom = $plan->Uom;\r\n\t\t} else {\r\n\t\t\t$newCartItem->uom = null;\t\t\t\r\n\t\t}\r\n*/\t\r\n\t\t// $newCartItem->ratePlanName = $plan!=null ? $plan->Name : 'Invalid Product';\r\n\t\t// $newCartItem->ProductName = $plan!=null ? $plan->productName : 'Invalid Product';\r\n\r\n\t\t//Commented out for DEMO\r\n\t\t// $newCartItem->ratePlanName = $plan!=null ? $plan->name : 'Invalid Product';\r\n\t\t// $newCartItem->productName = $plan!=null ? $plan->productName : 'Invalid Product';\r\n\t\tarray_push($this->cart_items, $newCartItem);\r\n\t}", "function TestPlan_add_tag($plan_id, $tag_name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.add_tag', array(new xmlrpcval($plan_id, \"int\"), new xmlrpcval($tag_name, \"string\")), \"array\");\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "private function addReglamentToPlan($date=null):void {\n\t\tif(is_null($date)){\n\t\t\t$date = clone $this->curDate;\n\t\t}\n\t\t$humanDate = $date->format('d.m.Y');\n\t\t\n\t\tif(!isset($this->planCalendar[$humanDate])){\n\t\t\t$this->planCalendar[$humanDate] = [];\n\t\t}\t\t\t\t\t\t\t\t\t\n\t\t$this->planCalendar[$humanDate][] = [ // внести в план по дате\n\t\t\t'district_id' => $this->districtOject->district_id,\n\t\t\t'object_id' => $this->object->id,\n\t\t\t'object_device_id' => $this->device->id,\n\t\t\t'reglament_id' => $this->reglament->id,\n\t\t\t'tbl_name' => $this->device->tbl_name,\n\t\t\t'technick_id' => $this->technickId,\n\t\t];\n\t\t$this->addReglamentNextDate($date);\n\t\t\n\t}", "public function add()\n {\n echo '客户需求添加一个新需求' . PHP_EOL;\n }", "public function create()\n {\n\n return view('stripe.plan.create');\n\n }", "public function create()\n {\n return view('admin.plan.create');\n }", "public function add_plan() {\n $add_plan_name = $this->input->post('add_plan_name');\n $add_order_type = $this->input->post('add_order_type');\n $add_no_of_order = $this->input->post('add_no_of_order');\n $add_plan_price_amt = $this->input->post('add_plan_price');\n $add_plan_price = number_format((float) $add_plan_price_amt, 2, '.', '');\n $sess_data = $this->session->all_userdata();\n $inserted_id = $sess_data['admin_id'];\n $data = array(\n 'Plan_Name' => $add_plan_name,\n 'Type' => $add_order_type,\n 'Status' => 1\n );\n $this->db->where($data);\n $q = $this->db->get('tbl_plan');\n $count = $q->num_rows();\n if ($count == 0) {\n $insert_data = array(\n 'Plan_Name' => $add_plan_name,\n 'Type' => $add_order_type,\n 'Price' => $add_plan_price,\n 'No_Of_Order' => $add_no_of_order,\n 'Inserted_By' => $inserted_id,\n 'Inserted_Date' => date('Y-m-d H:i:s'),\n 'Status' => 1\n );\n $q = $this->db->insert('tbl_plan', $insert_data);\n if ($q) {\n echo \"success\";\n } else {\n echo \"fail\";\n }\n } else {\n echo \"exists\";\n }\n }", "function createNewEhsPlan() { \n\n if($this->value('type') == \"treatment_plan\" ) {\n\n $_SESSION['type'] = \"treatment_plan\";\n\n $replace['type'] = \"treatment_plan\";\n\n\n } elseif( $this->value('type') == \"finish\" ) {\n\n\t\t\t $_SESSION['type'] = 'finish';\n\n\t\t\t $replace['type'] = \"finish\";\n\n\t\t\t}\n\n\t\t\telse {\n\n\t\t\t\tif(isset($_SESSION['type'])){\n\n\t\t\t\t\tsession_unregister('type');\n\n\t\t\t\t}\n\n\t\t\t\t$replace['type'] = \"\";\n\n\t\t\t}\n\n\t\t$replace['plan_name'] = \"\";\n \n $schd = $this->value('schd');\n $clinicId = $this->clinicInfo('clinic_id');\n if($this->is_corporate($clinicId)==1){\n \n $Ehspatients = $this->get_paitent_list($clinicId);\n }else{\n $Ehspatients = $this->getProviderEHSPatients($clinicId);\n }\n //$Ehspatients = $this->getProviderEHSPatients($clinicId);\n \n $totalEhsPatients = count($Ehspatients);\n if($totalEhsPatients == '0') {\n header(\"location:index.php?action=therapistEhsPatient&ehsunsub=0\");\n } \n if($schd!= '') {\n $replace['schd'] = $schd;\n }\n\t\t\t$replace['plan_id'] = \"\";\n\n\t //For plan edit action only\n\n\t\t\tif($this->value('act') == \"plan_edit\" && $this->value('plan_id') != \"\" ) {\n\n\t\t\t\t$query = \"select * from plan where plan_id = '{$this->value('plan_id')}' \";\n\n\t\t\t\t$result = $this->execute_query($query);\n\n\t\t\t\tif($row = $this->fetch_array($result)){\n\n\t\t\t\t\t$replace['plan_name'] = $row['plan_name'];\n\n\t\t\t\t\t$replace['plan_id'] = $row['plan_id'];\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\telseif ($this->value('plan_id') != \"\") { \n\n\t\t\t\t$replace['plan_name'] = $this->value('plan_name');\n\n\t\t\t\t$replace['plan_id'] = $this->value('plan_id');\n\t\t\t}\n\n\t\t\tif( $this->value('submitted_x') != \"\" ) { \n\n\t\t\t\tif( $this->value('plan_name') == \"\"){\n\n\t\t\t\t\t$error[] = \"Please enter Plan name.\";\n\n\t\t\t\t}\n\n\t\t\t\telse{ \n\n\t\t\t\t\t$flag = 0;\n\t\t\t\n\t\t\t\t\tif(( $_SESSION['type'] == \"treatment_plan\" || $_SESSION['type'] == \"finish\" )) {\n\n\t\t\t\t\t\t$flag = 1;\n\t\t\t\t\t}\n\n if( $flag == 1 ) {\n\n\t\t\t\t\t\tif( $this->value('plan_id') != \"\") {\n\t\t\t\t\t\t\t$query = \" select * from plan where user_id = '{$this->userInfo('user_id')}' and plan_name LIKE '\".addslashes($this->value('plan_name')).\"' and plan_id != '{$this->value('plan_id')}' and patient_id is null and (status = 1 OR status = 2) and ehsFlag= 0 \";//echo \"<br>\";\n\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t $query = \" select * from plan where user_id = '{$this->userInfo('user_id')}' and plan_name LIKE '\".addslashes($this->value('plan_name')).\"' and patient_id is null and (status = 1 OR status = 2) \";\n\t\t\t\t\t\t}\n // echo $query;exit;\n//echo \"<pre>\";exit;\n\t\t\t\t\t\t$result = $this->execute_query($query);\n //echo $this->num_rows($result);exit;\n\t\t\t\t\t\tif($this->num_rows($result) > 0 ){\n\n\t\t\t\t\t\t\t$error[] = \"Plan name already exist.\"; \n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif(isset($error) && count($error) > 0){\n\n\t\t\t\t\t$replace['error'] = $this->show_error($error);\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\n\t\t\t\t\t$data = array(\n\n\t\t\t\t\t\t'plan_name' => $this->value('plan_name'),\n\n\t\t\t\t\t\t'user_id' => $this->userInfo('user_id'),\n\n\t\t\t\t\t\t'user_type' => '2',\n \n 'ehsFlag' => '1',\n\n 'clinicId' => $clinicId,\n\n\t\t\t\t\t\t//'status' => (isset($_SESSION['type']) && $_SESSION['type'] == \"treatment_plan\")?'3':'1',\n 'status' => '4', \n 'unread_plan'=>1\n\n\t\t\t\t\t);\n\n\t\t\t\t\tif($this->value('plan_id') && $schd == 'edit'){ //echo \"abasdasdc\";exit;\n\n\t\t\t\t\t\t$where = \" plan_id = '{$this->value('plan_id')}' \";\n \n\n\t\t\t\t\t\t$data['modified'] = date(\"Y-m-d\");\n $schd = $this->value('schd');\n if($schd == 'edit') {\n $data['schdulerAction'] = '2';\n } else {\n $data['schdulerAction'] = '1';\n } \n $data['status'] = '1';\n \n\t\t\t\t\t\t$this->update($this->config['table']['plan'],$data,$where);\n\n\t\t\t\t\t\theader(\"location:index.php?action=selectEhsTreatment&plan_id={$this->value('plan_id')}\");\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse{ \n//echo \"abc\";exit;\n\t\t\t\t\t\t$data['creation_date'] = date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\t$data['modified'] = date(\"Y-m-d H:i:s\");\n $data['is_public'] = null;\n $data['schdulerAction'] = '1';\n $data['clinicId'] = $clinicId;\n $data['parent_template_id'] =$this->value('plan_id');\n \n\t\t\t\t\t\tif($this->insert($this->config['table']['plan'],$data)){\n\n\t\t\t\t\t\t\t$plan_id = $this->insert_id();\n if($this->value('plan_id')!= '') {\n /* check for plan_treatment */\n $sqlplanTreatment=\"select * from plan_treatment where plan_id=\".$this->value('plan_id');\n $resplanTreatment=$this->execute_query($sqlplanTreatment);\n $numplanTreatment=$this->num_rows($resplanTreatment);\n if($numplanTreatment>0){\n while($rowplanTreatment=$this->fetch_array($resplanTreatment)){\n $arrayPlanTreatment=array(\n 'plan_id' => $plan_id,\n 'treatment_id' => $rowplanTreatment['treatment_id'],\n 'instruction' => $rowplanTreatment['instruction'],\n 'sets' => $rowplanTreatment['sets'],\n 'reps' => $rowplanTreatment['reps'],\n 'hold' => $rowplanTreatment['hold'],\n 'benefit' => $rowplanTreatment['benefit'],\n 'lrb' => $rowplanTreatment['lrb'],\n 'treatment_order' => $rowplanTreatment['treatment_order'],\n 'creation_date' => date(\"Y-m-d H:i:s\"),\n 'status' => 1\n );\n $this->insert('plan_treatment',$arrayPlanTreatment); \n }\n }\n\n /* check for plan_article */\n $sqlPlanArticle=\"select * from plan_article where plan_id=\".$this->value('plan_id');\n $resPlanArtical=$this->execute_query($sqlPlanArticle);\n $numPlanArtical=$this->num_rows($resPlanArtical);\n if($numPlanArtical>0){\n while($rowPlanArtical=$this->fetch_array($resPlanArtical)){\n $arrayPlanArtical=array(\n 'plan_id'=>$plan_id,\n 'article_id'=>$rowPlanArtical['article_id'],\n 'creation_date'=>date(\"Y-m-d H:i:s\"),\n 'status'=>1\n );\n $this->insert('plan_article',$arrayPlanArtical); \n \n }\n \n }\n\n\n }\n \n \n\t\t\t\t\t\t\theader(\"location:index.php?action=selectEhsTreatment&plan_id={$plan_id}\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$replace['header'] = $this->build_template($this->get_template(\"header\"));\n\n\t\t\t$replace['footer'] = $this->build_template($this->get_template(\"footer\"));\n\n\t\t\t$replace['sidebar'] = $this->sidebar();\n\n\t\t\t$replace['footer'] = $this->build_template($this->get_template(\"footer\"));\n\t\t\t\n\t\t \n\t\t\t$replace['get_satisfaction'] = $this->get_satisfaction();\n\t\t\t \n\n\t\t\t$nav_bar = array(\n\n\t\t\t\t\t\t\t\t'plan' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=createNewEhsPlan&act=plan_edit&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/01_plan_gray.gif\" /></a>':'<img src=\"images/01_plan_gray.gif\" />',\n\n\t\t\t\t\t\t\t\t'step1' => ($this->value('plan_id') != \"\")?'<img src=\"images/stepIcons_1_red_sm.gif\">':'<img src=\"images/stepIcons_1_red_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step2' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=selectEhsTreatment&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_2_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_2_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step3' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=customize_instruction_ehs&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_3_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_3_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step4' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=customize_articles_ehs&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_4_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_4_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t);\n\n\t\t\tif(is_array($replace)){\n\n\t\t\t\t$replace = $replace + $nav_bar;\n\n\t\t\t}\n\n\t\t\t\n\n\n\n\t\t\t$replace['patient_image'] = '<img src=\"images/03_patient_gray.gif\" />';\n\n\t\t\t$replace['assign_image'] = '<img src=\"images/04_assign_gray.gif\" />';\n\n\t\t\t// Personalized GUI\n $LabelTitle=$_SESSION['providerLabel']['My Template Plans']!=''?$_SESSION['providerLabel']['My Template Plans']:\"MY TX PLANS\";\n $replace['path_name'] = strtoupper($LabelTitle);\n\n\t\t\t$replace['body'] = $this->build_template($this->get_template(\"createNewPlan\"),$replace);\n\n\t\t\t$replace['browser_title'] = \"Tx Xchange: Create New Plan\";\n\n\t\t\t$this->output = $this->build_template($this->get_template(\"main\"),$replace);\n\n\t\t}", "function wp_stripe_subscribe_customer_to_plan($email, $card, $plan_id, $description) {\n\n $customer = array(\n 'email' => $email,\n 'card' => $card,\n 'plan' => $plan_id\n );\n\n if ( $description ) {\n $customer['description'] = $description;\n }\n\n $response = Stripe_Customer::create($customer);\n\n return $response;\n}", "function TestPlan_create($author_id, $product_id, $default_product_version, $type_id, $name, $creation_date = NULL, $isactive = TRUE) {\n\t$varray = array(\"author_id\" => \"int\", \"product_id\" => \"int\", \"default_product_version\" => \"string\", \"type_id\" => \"int\", \"name\" => \"string\", \"creation_date\" => \"string\", \"isactive\" => \"int\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.create', array(new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function run()\n {\n $data = [\n ['name' => 'Basic', 'price' => 6000 , 'commission' => 300],\n ['name' => 'Standard', 'price' => 7500 , 'commission' => 400],\n ['name' => 'Premium', 'price' => 10000 , 'commission' => 500],\n ];\n \\App\\Models\\Plan::insert($data);\n }", "function wp_stripe_find_or_create_plan($amount, $interval) {\n \n /*\n * Currency - All amounts must be denominated in USD when creating charges with Stripe — the currency conversion happens automatically\n */\n $currency = 'usd';\n\n $plan = null;\n\n // Construct desired plan\n $requested_plan = array(\n 'amount' => $amount,\n 'interval' => $interval,\n 'name' => '$' . $amount/100 . '/' . $interval,\n 'currency' => $currency,\n 'id' => $amount . $interval[0] . '_wp'\n );\n\n $existing_plans = Stripe_Plan::all();\n\n // Loop through plans, looking for one that matches our desired plan\n foreach( $existing_plans->data as $existing_plan ) {\n if ( $existing_plan->amount == $requested_plan['amount'] && $existing_plan->interval == $requested_plan['interval'] ) {\n $plan = $existing_plan;\n break;\n }\n }\n\n // Create a new plan if we didn't find one that matched\n if ( !$plan ) {\n $plan = Stripe_Plan::create($requested_plan);\n }\n \n return $plan;\n}", "function add($name,$endpoint){\n \n // create row in workspace table.\n $data = array(\n 'name' => strtolower($name),\n 'endpoint' => $endpoint,\n );\n $this->team->db->insert('workspaces', $data);\n \n include_once(\"public/arc2/ARC2.php\");\n\n // Config mysql\n $config_Mysql = array(\n // db \n 'db_host' => $this->team->db->hostname, // default: localhost\n 'db_name' => $this->team->db->database,\n 'db_user' => $this->team->db->username,\n 'db_pwd' => $this->team->db->password,\n // store \n 'store_name' => $name,\n );\n\n $store_Mysql = ARC2::getStore($config_Mysql);\n \n /* create MySQL tables \n *\n * _g2t\n * _id2val\n * _o2val\n * _s2val\n * _setting\n * _triple\n */\n $store_Mysql->setUp(); \n \n //echo \"END FUNCTION add(name,endpoint) Workspaces_model.php<br />\";\n }", "function therapistEhsPlan() { \n\n\t\t\t\n //Action for deleting the plans\n if($this->value('act') == 'deletePlan') {\n\n\t\t\t\tif( $this->value('plan_id') != \"\" && is_numeric($this->value('plan_id'))) {\n\n\t\t\t\t\t$query = \"update plan p set status = 3 where p.user_id = '{$this->userInfo('user_id')}' and p.user_type = '2' and p.plan_id = '{$this->value('plan_id')}' \";\n\t\t\t\t\t$this->execute_query($query);\n\t\t\t\t}\n\t\t\t}\n\n //End here\n\t\t $clinicId = $this->clinicInfo('clinic_id');\n //$Ehspatients = $this->getProviderEHSPatients($clinicId);\n if($this->is_corporate($clinicId)==1){\n $Ehspatients = $this->get_paitent_list($clinicId);\n }else{\n $Ehspatients = $this->getProviderEHSPatients($clinicId);\n }\n $totalEhsPatients = count($Ehspatients);\n if($totalEhsPatients == '0') {\n header(\"location:index.php?action=therapistEhsPatient&ehsunsub=0\");\n } \n //Call get satisfaction js script\t\t\t\n $replace['get_satisfaction'] = $this->get_satisfaction();\n\t \n //Header and sidebar\n\t\t\t$replace['header'] = $this->build_template($this->get_template(\"header\"));\n\t\t\t$replace['sidebar'] = $this->sidebar();\n\t\t\t\n $templatePlanName = $_SESSION['providerLabel']['Template Plan Name']!=''?$_SESSION['providerLabel']['Template Plan Name']:\"Template Plan Name\";\n\t\t\t$replace['p.plan_name'] = $templatePlanName;\n\n\t\t\t$planListHead = array(\n\t\t\t 'p.plan_name' => $templatePlanName,\n\t\t\t 'no_treatments' => '# V',\n\t\t\t 'no_articles' => '# A',\n\t\t\t);\n\t\t\t$replace['planListHead'] = $this->build_template($this->get_template(\"planListHead\"),$planListHead);\n\n\t\t\tinclude_once(\"template/therapistEHS/therapistArray.php\");\n\n\t\t\tif(isset($_SESSION['type'])){\n unset($_SESSION['type']);\t\n\t\t\t}\n\n\t\t\tif( $this->value('path') == 'my_patient' ){\n\t\t\t\t$this->formArray = $PatientPlanListAction;\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\t$this->formArray = $planListAction;\n\t\t\t}\n\n\t\t\tif($this->value('sort') != \"\") {\n\n\t\t\t\tif($this->value('order') == 'desc' ){\n $orderby = \" order by {$this->value('sort')} desc \";\n\t\t\t\t}\n\n\t\t\t\telse {\n $orderby = \" order by {$this->value('sort')} \";\n }\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\t$orderby = \" order by p.plan_name \";\n\t\t\t}\n\n\t\t\t$replace['search'] = \"\";\n\n\t\t\tif($this->value('search') == \"\" && $this->value('restore_search') != \"\" ) {\n\t\t\t\t$_REQUEST['search'] = $this->value('restore_search');\n\t\t\t}\n\t\t\t\n if($this->value('search') != \"\"){\n\n\t\t\t\t$replace['search'] = $this->value('search');\n\n\t\t\t\t $query = \"select *,(select count(*) from plan_treatment \n\n\t\t\t\t\t\t \twhere plan_treatment.plan_id = p.plan_id) AS no_treatments,\n\n\t\t\t\t\t\t\t(select count(*) from plan_article pa inner join article a on a.article_id = pa.article_id and a.status = 1 where pa.plan_id = p.plan_id) AS no_articles\n\n\t\t\t\t\t\t\tfrom plan p where p.user_id = '{$this->userInfo('user_id')}' and p.user_type = '2' and p.patient_id is null and p.status = 1 and p.ehsFlag = '0' and p.plan_name like '%{$this->value('search')}%' \n\n\t\t\t\t {$orderby}\";\n \n $sqlcount=\"select count(1) from plan p where p.user_id = '{$this->userInfo('user_id')}' and p.user_type = '2' and p.patient_id is null and p.status = 1 and p.ehsFlag = '0' and p.plan_name like '%{$this->value('search')}%' \n\n\t\t\t\t {$orderby}\";\n \n\n\t\t\t}\n\n\t\t\telse{\n\n\t\t\t\t $query = \"select *,(select count(*) from plan_treatment \n\n\t\t\t\t\t\t where plan_treatment.plan_id = p.plan_id) AS no_treatments,\n\n\t\t\t\t\t\t(select count(*) from plan_article pa inner join article a on a.article_id = pa.article_id and a.status = 1 where pa.plan_id = p.plan_id) AS no_articles\n\n\t\t\t\t\t\tfrom plan p where p.user_id = '{$this->userInfo('user_id')}' and p.user_type = '2' and p.patient_id is null and p.status = 1 \n and p.ehsFlag = '0' {$orderby}\";\n \n $sqlcount=\"select count(1) from plan p where p.user_id = '{$this->userInfo('user_id')}' and p.user_type = '2' and p.patient_id is null and p.status = 1 \n and p.ehsFlag = '0' {$orderby}\"; \n \n \n\n\t\t\t}\n\t\t\n \n\t\t\t$link = $this->pagination($rows = 0,$query,$this->value('action'),$this->value('search'),'','','',$sqlcount);\t\t\t\t\n\n\t\t\t$replace['link'] = $link['nav'];\n\n\t\t\t$result = $link['result'];\t\t\t\t\t\t\t\t \t\n\n\t\t\tif(is_resource($result)){\n\n\t\t\t\twhile($row = $this->fetch_array($result)){\n\n\t\t\t\t\t$row['style'] = ($c++%2)?\"line1\":\"line2\";\n\n\t\t\t\t\t$row['dropDownWidth'] = ($this->value('path') == 'my_patient'?'90':'120');\n\n\t\t\t\t\t$row['status'] = $this->config['patientStatus'][$row['status']];\n\n\t\t\t\t\t$row['actionOption'] = $this->build_select_option($this->formArray);\n\n\t\t\t\t\t$replace['planRecord'] .= $this->build_template($this->get_template(\"planRecord\"),$row);\n\t\t\t\t}\n\n\t\t\t\tif($this->num_rows($result) == 0){\n\n\t\t\t\t\t$replace['colspan'] = 5;\n\n\t\t\t\t\t$replace['planRecord'] = $this->build_template($this->get_template(\"no_record_found\"),$replace);\n\t\t\t\t}\n\n\t\t\t}\t\n\n\t\n\t\t\t$query_string = array();\n\n\t\t\t$query_string['patient_id'] = $this->value('patient_id');\n\n\t\t\t$query_string['path'] = $this->value('path');\n\n\t\t\t$replace['planListHead'] = $this->build_template($this->get_template(\"planListHead\"),$this->table_heading($planListHead,\"p.plan_name\",$query_string));\n\n\t\t\t$replace['patient_name'] = \"\";\n\n\t\t\t$replace['path'] = $this->value('path');\n\n // Personalized GUI\n $LabelTitle=$_SESSION['providerLabel']['My Template Plans']!=''?$_SESSION['providerLabel']['My Template Plans']:\"MY TEMPLATE PLANS\";\n $replace['path_name'] = strtoupper($LabelTitle);\n $imageCreateNewTemplatePlan=$_SESSION['providerLabel']['images/createNewTemplatePlan.gif']!=''?$_SESSION['providerLabel']['images/createNewTemplatePlan.gif']:\"images/createNewTemplatePlan.gif\";\n $replace['imageCreateNewTemplatePlan'] = $imageCreateNewTemplatePlan;\n $templatePlanLibrary=$_SESSION['providerLabel']['Template Plan Library']!=''?$_SESSION['providerLabel']['Template Plan Library']:\"Template Plan Library\";\n\t\t\t$replace['templatePlanLibrary']=$templatePlanLibrary;\n\t\t\t$templatePlanName =$_SESSION['providerLabel']['Template Plan Name']!=''?$_SESSION['providerLabel']['Template Plan Name']:\"Template Plan Name\";\n\t\t\t$replace['p.plan_name']=$templatePlanName;\n\t\t\t\n\t\t\tif($this->value('path') == \"my_patient\"){\n\n\t\t\t\t//$replace['path_name'] = \"MY Patients\";\n\n\t\t\t}\n\n\t\t\t//$replace['patient_id'] = $this->value('patient_id'); SKS\n\n\t\t\t/*if($this->value('patient_id') != \"\" ){\n $title = $this->userInfo('name_title',$this->value('patient_id'));\n $name_first = $this->userInfo('name_first',$this->value('patient_id'));\n $name_last = $this->userInfo('name_last',$this->value('patient_id'));\n $replace['patient_name'] .= '/&nbsp;' . $this->fullName($title,$name_first,$name_last) . '&nbsp;';\n\t\t\t}*/\n\n\t\t\t$replace['body'] = $this->build_template($this->get_template(\"planList\"),$replace);\n\n\t\t\t$replace['browser_title'] = \"Tx Xchange: \".$LabelTitle;\n\n\t\t\t$this->output = $this->build_template($this->get_template(\"main\"),$replace);\n\n\t\t}", "public function create_or_update_plan( $plan_data ) {\n\t\t$item_id = $plan_data['id'];\n\t\t$all_items = MS_Factory::get_transient( 'ms_stripecheckout_plans' );\n\t\t$all_items = mslib3()->array->get( $all_items );\n\n\t\tif ( ! isset( $all_items[ $item_id ] )\n\t\t || ! is_a( $all_items[ $item_id ], 'StripeCheckoutPlan' )\n\t\t) {\n\t\t\ttry {\n\t\t\t\t$item = StripeCheckoutPlan::retrieve( $item_id );\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t// If the plan does not exist then stripe will throw an Exception.\n\t\t\t\t$item = false;\n\t\t\t}\n\t\t\t$all_items[ $item_id ] = $item;\n\t\t} else {\n\t\t\t$item = $all_items[ $item_id ];\n\t\t}\n\n\t\t/*\n\t\t * Stripe can only update the plan-name, so we have to delete and\n\t\t * recreate the plan manually.\n\t\t */\n\t\tif ( $item && is_a( $item, 'StripeCheckoutPlan' ) ) {\n\t\t\t$item->delete();\n\t\t\t$all_items[ $item_id ] = false;\n\t\t}\n\n\t\tif ( $plan_data['amount'] > 0 ) {\n\t\t\ttry {\n\t\t\t\t$item = StripeCheckoutPlan::create( $plan_data );\n\t\t\t\t$all_items[ $item_id ] = $item;\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t// Nothing.\n\t\t\t}\n\t\t}\n\n\t\tMS_Factory::set_transient(\n\t\t\t'ms_stripecheckout_plans',\n\t\t\t$all_items,\n\t\t\tHOUR_IN_SECONDS\n\t\t);\n\t}", "public function createPlan($name = null, $price = null)\n {\n try{\n if($name == null)\n throw new Exception('Defina um nome ao plano');\n \n if($price == null)\n throw new Exception('Defina um valor ao plano');\n\n $data = array(\n 'name' => $name,\n 'amount' => $price,\n );\n\n $aPlans = $this->request('plans', 'POST', $data);\n if( $aPlans->status ){\n throw new Exception( $aPlans->status.'-'.$aPlans->details[0]->message );\n }else{\n return $aPlans;\n }\n }catch(Exception $e){\n $this->exception($e);\n }\n }", "public function edit(Plan $plan)\n {\n //\n }", "public function createNewItemToPlan() {\n $tracker = $this->planning->getPlanningTracker();\n return $GLOBALS['Language']->getText('plugin_agiledashboard', 'create_new_item_to_plan', array($tracker->getItemName()));\n }", "public function add_individual_plan($individual_id) \n\t{\n\t\t$data = array(\n\t\t\t'individual_id'=>$individual_id,\n\t\t\t'savings_plan_id'=>$this->input->post('savings_plan_id'),\n\t\t\t'individual_savings_status'=>$this->input->post('individual_savings_status'),\n\t\t\t'individual_savings_opening_balance'=>$this->input->post('individual_savings_opening_balance'),\n\t\t\t'start_date'=>$this->input->post('start_date'),\n\t\t\t'created'=>date('Y-m-d H:i:s'),\n\t\t\t'created_by'=>$this->session->userdata('personnel_id'),\n\t\t\t'modified_by'=>$this->session->userdata('personnel_id')\n\t\t);\n\t\t\n\t\tif($this->db->insert('individual_savings', $data))\n\t\t{\n\t\t\treturn $this->db->insert_id();\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function create_simple($data) {\n\n $plan = $this->csmplan->get($data['plan_id']);\n if (empty($plan)) {\n throw new Exception('Something went wrong. Membership plan does not exist');\n } else {\n $this->gump->validation_rules(array(\n 'user_id' => 'required|max_len,100',\n 'plan_id' => 'required|numeric',\n 'plan_start' => 'required|date',\n 'vat' => 'required|numeric'\n ));\n\n $validated_data = $this->gump->run($data);\n if ($validated_data === false) {\n $errArr = $this->gump->get_readable_errors();\n $errString = \"\";\n foreach ($errArr as $k => $err) {\n $errString .= $err . '<br>';\n }\n throw new Exception($errString);\n } else {\n $response = $this->create(array(\n 'user_id' => $data['user_id'],\n 'plan_id' => $plan['plan_id'],\n 'plan_start' => $data['plan_start'],\n 'plan_end' => date('Y-m-d', (strtotime($data['plan_start']) + ($plan['days'] * 60 * 60 * 24))),\n 'approved' => $data['approved'] ? 1 : 0,\n 'payment' => $data['payment'] ? 1 : 0,\n 'payment_method' => $data['payment_method'],\n 'payment_at' => $data['payment_at'],\n 'price' => $plan['price'],\n 'vat' => $plan['vat'],\n 'price_total' => $plan['price'] + (($plan['price'] / 100) * $data['vat'])\n ));\n if ($response !== 1) {\n throw new Exception('Something went wrong');\n } else {\n return $response;\n }\n }\n }\n }", "public function run()\n\t{\n\t\tModel::unguard();\n\n\t\tPlan::create([\n\t\t\t'name' => 'Gratuito', \n\t\t\t'quantity_oportunities' => 1, \n\t\t\t'price' => 0.0]);\n\t\tPlan::create([\n\t\t\t'name' => 'Básico', \n\t\t\t'quantity_oportunities' => 10, \n\t\t\t'price' => 99.0]);\n\t\tPlan::create([\n\t\t\t'name' => 'Premium', \n\t\t\t'quantity_oportunities' => 50, \n\t\t\t'price' => 149.0]);\n\t}", "public function edit(Plan $plan) {\n \n }", "public function createPlan(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CreatePlanRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CreatePlanRequest', $parameters);\n }", "public function create()\n {\n $page_title = \"Create New STO\";\n $time = TimeSetting::all();\n return view('admin.plan.create', compact('page_title', 'plan','time'));\n }", "public function testNewFreeAccountAddValidRecord()\n {\n $this->assertEquals(0, $this->connection->executeFirstCell(\"SELECT COUNT(`id`) AS 'row_count' FROM {$this->insight->getTableName('accounts')}\"));\n $this->insight->accounts->addFree(12345, new FreePlan());\n $this->assertEquals(1, $this->connection->executeFirstCell(\"SELECT COUNT(`id`) AS 'row_count' FROM {$this->insight->getTableName('accounts')}\"));\n\n $row = $this->connection->executeFirstRow(\"SELECT * FROM {$this->insight->getTableName('accounts')} WHERE `id` = ?\", 12345);\n\n $this->assertInternalType('array', $row);\n $this->assertEquals(12345, $row['id']);\n $this->assertEquals(AccountsInterface::FREE, $row['status']);\n $this->assertEquals(FreePlan::class, $row['plan']);\n $this->assertNull($row['billing_period']);\n $this->assertEquals($this->current_timestamp->format('Y-m-d H:i:s'), $row['created_at']);\n $this->assertEquals(date('Y'), $row['cohort_year']);\n $this->assertEquals(date('m'), $row['cohort_month']);\n $this->assertEquals($this->current_timestamp->format('Y-m-d H:i:s'), $row['converted_to_free_at']->format('Y-m-d H:i:s'));\n $this->assertNull($row['canceled_at']);\n $this->assertEquals(0, $row['mrr_value']);\n $this->assertFalse($row['had_trial']);\n }", "public function create( Request $request, Plan $plan)\n {\n $plan = Plan::findOrFail($request->get('plan'));\n \n $request->user()\n ->newSubscription('main', $plan->stripe_plan)\n ->create($request->stripeToken);\n \n return redirect()->route('home')->with('success', 'Your plan subscribed successfully');\n }", "public function show(Plan $plan)\n {\n //\n }", "public function create()\n {\n return view('admin.member_ship_plans.create');\n }", "public function create()\n\t{\n\t \n\t \n\t return view('admin.plans.create');\n\t}", "function copy_plan($userId,$planId,$new_name=\"\"){\n if( is_numeric($userId) && is_numeric($planId) ){\n \n if($new_name == \"\" ){\n // Retrive plan from plan table.\n $query = \"select * from plan where plan_id = '{$planId}' \";\n $result = @mysql_query($query);\n $row = @mysql_fetch_array($result);\n $new_name = $row['plan_name'];\n }\n \n // Create array for inserting record.\n $insertArr = array(\n 'plan_name'=> $new_name,\n 'parent_template_id' => NULL,\n 'user_id' => $userId,\n 'patient_id' => NULL,\n 'user_type' => 2,\n 'is_public' => NULL,\n 'creation_date' => $row['creation_date'], \n 'status' => 1\n );\n \n // Insert record.\n $result = $this->insert('plan',$insertArr);\n \n //Get new plan id\n $newlyPlanId = $this->insert_id();\n \n // Copy treatments associated with planId.\n if(is_numeric($newlyPlanId)){\n // copy treatments in the plan.\n $this->copy_plan_treatment($newlyPlanId,$planId);\n // copy articles in the plan.\n $this->copy_article($newlyPlanId,$planId);\n }\n } \n \n }", "abstract function has_paid_plan();", "public function run()\n {\n $this->createPlanWithIntervalAlternatives([\n 'name' => 'Basic',\n 'amount' => 10,\n 'currency' => 'USD',\n 'uuid' => str_random(36),\n 'features' => [\"Drag & Drop Builder\", \"500MB Storage\", \"Code Editors\", \"No Ads\", \"Free Subdomain\"],\n 'permissions' => ['editors.enable' => 1],\n 'position' => 1,\n ]);\n\n $this->createPlanWithIntervalAlternatives([\n 'name' => 'Standard',\n 'amount' => 15,\n 'currency' => 'USD',\n 'uuid' => str_random(36),\n 'features' => [\"Drag & Drop Builder\", \"500MB Storage\", \"Code Editors\", \"No Ads\", \"Free Subdomain\", \"Download Projects\"],\n 'permissions' => ['editors.enable' => 1, \"projects.download\" => 1],\n 'recommended' => 1,\n 'position' => 2,\n ]);\n\n $this->createPlanWithIntervalAlternatives([\n 'name' => 'Pro',\n 'amount' => 25,\n 'currency' => 'USD',\n 'uuid' => str_random(36),\n 'features' => [\"Drag & Drop Builder\", \"2GB Storage\", \"Code Editors\", \"No Ads\", \"Free Subdomain\", \"Export Projects to FTP\", \"Priority Support\"],\n 'permissions' => ['editors.enable' => 1, \"projects.download\" => 1, 'projects.export' => 1],\n 'position' => 3,\n ]);\n }", "public function add();", "public function add();", "function TestCase_link_plan($case_id, $plan_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.link_plan', array(new xmlrpcval($case_id, \"int\"), new xmlrpcval($plan_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function create()\n\t{\n $plan_id = Input::get('plan_id');\n $plan = $this->plan->find($plan_id);\n\t\treturn View::make('admin.plan_tasks.create',compact('plan'));\n\t}", "public function create()\n {\n \n return view('admin.plans.create');\n\n }", "function add_unit_to_army($unit_id, $army_id)\n\t{\n\t\t$result = pg_prepare(\"point_query\", \"SELECT init_point_cost FROM warhammer.unit_list WHERE unit_id=$1\");\n\t\t$result = pg_execute(\"point_query\", array($unit_id));\n\t\t$result_a = pg_fetch_array($result,0,PGSQL_ASSOC);\n\t\t$points = $result_a[\"init_point_cost\"];\n\t\t$result = pg_prepare(\"add_query\", \"INSERT INTO warhammer.user_army VALUES (DEFAULT,$1,null,$2)\");\n\t\t$result = pg_execute(\"add_query\", array($unit_id,$points));\n\t\tpg_free_result($result);\n\t}", "public function update(Request $request, $id)\n {\n $this->authorize('update', Plan::class);\n\n $this->validate($request, [\n 'name' => 'required',\n 'price' => 'required',\n 'duration' => 'required',\n ]);\n\n $plan = Plan::findOrFail($id);\n // Generate plan slug from plan name\n $slug = str_replace(' ','-', $request->input('name'));\n $gateway_id = str_replace(' ','_', $request->input('name'));\n $team_enable = !empty($request->input('teams_limit')) ? 1 : 0;\n $teams_limit = !empty($request->input('teams_limit')) ? $request->input('teams_limit') : NULL;\n $price = (float) $request->input('price') * 100;\n \n // Delete the plan on stripe \n $stripe_plan = \\Stripe\\Plan::retrieve($plan->gateway_id);\n $stripe_plan->delete();\n\n $interval=explode(',',$request->duration);\n //Add the Stripe Api key to\n // Recrete a new plan on stripe\n \\Stripe\\Plan::create([\n \"amount\" => $price,\n \"interval\" => $interval[1],\n \"interval_count\"=>$interval[0], \n \"product\" => [\n \"name\" => $request->input('name'),\n ],\n \"currency\" => \"usd\",\n \"id\" => $gateway_id,\n \"trial_period_days\" => $request->input('trial'),\n ]);\n\n $plan->name = $request->input('name');\n $plan->gateway_id = $gateway_id;\n $plan->price = $request->input('price');\n $plan->brand = $request->input('brand');\n $plan->contest = $request->input('contest');\n $plan->duration = $request->input('duration');\n $plan->other_info_1 =$request->input('plan_info_1');\n $plan->other_info_2 = $request->input('plan_info_2');\n //$plan->teams_enabled = $team_enable;\n //$plan->teams_limit = $teams_limit;\n $plan->active =1;\n $plan->slug = $slug;\n //$plan->trial_period_days = $request->input('trial');\n $plan->save();\n\n return redirect()->back()->with(\"status\", \"Your plan has been updated.\");\n }", "public function run()\n {\n $projectName = \"Flexsited \";\n Plan::create([\n 'id'=> 1,\n 'stripePlanMonthId' => 'basicPlanMonthly',\n 'stripePlanYearId' => 'basicPlanYearly',\n 'stripePlanNumber' => 1,\n 'name' => 'basic plan',\n 'price' => 69.95,\n 'priceYearlyMonthly' => 49.95,\n 'priceYearly' => 599.00,\n 'description' => 'For beauty professionals who just need an online presence.',\n 'image' => 'mawaisnow/sp/plan/Group [email protected]',\n 'productName' => $projectName . \"Basic Subscription Plan\"\n ]);\n Plan::create([\n 'id'=> 2,\n 'stripePlanMonthId' => 'essentialPlanMonthly',\n 'stripePlanYearId' => 'essentialPlanYearly',\n 'stripePlanNumber' => 2,\n 'name' => 'essential plan',\n 'price' => 89.95,\n 'priceYearlyMonthly' => 69.95,\n 'priceYearly' => 839.00,\n 'description' => 'For beauty professionals looking to grow their business online and engage clients.',\n 'image' => 'mawaisnow/sp/plan/Group [email protected]',\n 'productName' => $projectName . \"Essential Subscription Plan\"\n ]);\n Plan::create([\n 'id'=> 3,\n 'stripePlanMonthId' => 'activePlanMonthly',\n 'stripePlanYearId' => 'activePlanYearly',\n 'stripePlanNumber' => 3,\n 'name' => 'active plan',\n 'price' => 129.95,\n 'priceYearlyMonthly' => 89.95,\n 'priceYearly' => 1079.00,\n 'description' => 'For beauty professionals looking to grow their business online and get more clients.',\n 'image' => 'mawaisnow/sp/plan/Path [email protected]',\n 'productName' => $projectName . \"Active Subscription Plan\"\n ]);\n Plan::create([\n 'id'=> 4,\n 'stripePlanMonthId' => 'completePlanMonthly',\n 'stripePlanYearId' => 'completePlanYearly',\n 'stripePlanNumber' => 4,\n 'name' => 'active plan',\n 'price' => 179.95,\n 'priceYearlyMonthly' => 139.95,\n 'priceYearly' => 1679.00,\n 'description' => 'For beauty professionals looking to scale their business by having an online store.',\n 'image' => 'mawaisnow/sp/plan/Group [email protected]',\n 'productName' => $projectName . \"Complete Subscription Plan\"\n ]);\n\n }", "public function testNewPaidMonthlyAccountAddValidRecord()\n {\n $this->assertEquals(0, $this->connection->executeFirstCell(\"SELECT COUNT(`id`) AS 'row_count' FROM {$this->insight->getTableName('accounts')}\"));\n $this->insight->accounts->addPaid(12345, new PlanL(), new Monthly());\n $this->assertEquals(1, $this->connection->executeFirstCell(\"SELECT COUNT(`id`) AS 'row_count' FROM {$this->insight->getTableName('accounts')}\"));\n\n $row = $this->connection->executeFirstRow(\"SELECT * FROM {$this->insight->getTableName('accounts')} WHERE `id` = ?\", 12345);\n\n $this->assertInternalType('array', $row);\n $this->assertEquals(12345, $row['id']);\n $this->assertEquals(PlanL::class, $row['plan']);\n $this->assertEquals(Monthly::class, $row['billing_period']);\n $this->assertEquals(AccountsInterface::PAID, $row['status']);\n $this->assertEquals($this->current_timestamp->format('Y-m-d H:i:s'), $row['created_at']);\n $this->assertEquals(date('Y'), $row['cohort_year']);\n $this->assertEquals(date('m'), $row['cohort_month']);\n $this->assertNull($row['canceled_at']);\n $this->assertEquals(99, $row['mrr_value']);\n $this->assertFalse($row['had_trial']);\n }", "private function createPlanWithIntervalAlternatives($params)\n {\n if ($this->plan->where('name', $params['name'])->first()) return;\n\n $plan = $this->plan->create($params)->fresh();\n $this->create6monthsSubscription($plan);\n $this->create1YearSubscription($plan);\n }", "public function create()\n {\n $page_title = \"Create New Plan\";\n $time = TimeSetting::all();\n\n return view('admin.plan.create', compact('page_title','time'));\n }", "public function run()\n {\n DB::table('plans')->insert(array(\n \n array('name' => 'Monthly',\n 'price' => 3500),\n\n array('name' => 'Yearly',\n 'price' => 19700)\n ));\n }", "public function create()\n {\n return view('plan.create');\n }", "public function create()\n {\n $user = Auth::user();\n if (!$user || !$user->is_back_user()) {\n return redirect()->intended(route('admin/login'));\n }\n elseif (!$user->can('create-membership-plans')){\n return redirect()->intended(route('admin/error/permission_denied'));\n }\n\n $cash_terminals = CashTerminal::with('shopLocation')->get();\n $shops = ShopLocations::all();\n\n $breadcrumbs = [\n 'Home' => route('admin'),\n 'Administration' => route('admin'),\n 'Back End User' => route('admin'),\n 'Permissions' => '',\n ];\n $text_parts = [\n 'title' => 'Add new membership plan',\n 'subtitle' => '',\n 'table_head_text1' => 'Membership Plans - Create New'\n ];\n $sidebar_link = 'admin-backend-memberships-new_plans';\n\n return view('admin/membership_plans/add_plan', [\n 'breadcrumbs' => $breadcrumbs,\n 'text_parts' => $text_parts,\n 'in_sidebar' => $sidebar_link,\n 'cash_terminals' => $cash_terminals,\n 'shops' => $shops,\n ]);\n }", "public static function AddOffer(){\n\n\t\t\t\n\n\t\t}", "public function store(Request $request)\n {\n $validator = $this->validator($request->all());\n\n if ($validator->fails()) {\n $this->throwValidationException(\n $request, $validator\n );\n }\n\n $plan = new Plan([\n 'course_id' => $request->get('course'),\n 'conceptual_section_id' => $request->get('conceptual'),\n 'start_date' => Carbon::createFromFormat( 'd-m-Y h:i A', $request->get('planification_date') . ' ' . $request->get('time_start') ),\n 'end_date' => Carbon::createFromFormat( 'd-m-Y h:i A', $request->get('planification_date') . ' ' . $request->get('time_end') ),\n 'procedimental_section' => $request->get('procedimental'),\n 'actitudinal_section' => $request->get('actitudinal'),\n 'competences' => $request->get('competences'),\n 'indicators' => $request->get('indicators'),\n 'teaching_strategy' => $request->get('teaching_strategy'),\n 'teaching_sequence' => $request->get('teaching_sequence'),\n 'period_id' => Period::all()->last()->id\n ]);\n\n $plan->save();\n\n $condition = new Condition([\n 'state_id' => trans('globals.condition.pending'),\n 'plan_id' => Plan::all()->last()->id,\n 'user_id' => Auth::user()->id\n ]);\n\n $condition->save();\n\n return self::redirection('plans', trans('plan.create.success'), null, null);\n }", "function copyExistingEhsPlan(){\n\t\t\tif( $this->value('type') == \"finish\" ){\n\n\t\t\t\t$_SESSION['type'] = 'finish';\n\n\t\t\t\t$replace['type'] = \"finish\";\n }\n\n\t\t\telse{\n\n\t\t\t\tif(isset($_SESSION['type'])){\n\n\t\t\t\t\tsession_unregister('type');\n\n\t\t\t\t}\n\n\t\t\t\t$replace['type'] = \"\";\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t$replace['plan_name'] = \"\";\n\n\t\t\t$replace['plan_id'] = \"\";\n\n\t\t\tif($this->value('act') == \"plan_edit\" && $this->value('plan_id') != \"\" ){\n\n\t\t\t\t$query = \"select * from plan where plan_id = '{$this->value('plan_id')}' \";\n\n\t\t\t\t$result = $this->execute_query($query);\n\n\t\t\t\tif($row = $this->fetch_array($result)){\n\n\t\t\t\t\t$replace['plan_name'] = $row['plan_name'];\n\n\t\t\t\t\t$replace['plan_id'] = $row['plan_id'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telseif ($this->value('plan_id') != \"\"){\n\n\t\t\t\t$replace['plan_name'] = $this->value('plan_name');\n\n\t\t\t\t$replace['plan_id'] = $this->value('plan_id');\n\t\t\t}\n\n\t\t\tif( $this->value('submitted_x') != \"\" ){\n\n\t\t\t\t//print_r($_POST);exit;\n\n\t\t\t\tif( $this->value('plan_name') == \"\"){\n\n\t\t\t\t\t$error[] = \"Please enter Plan name.\";\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\t\t$query = \" select * from plan where plan_name = '\".addslashes($this->value('plan_name')).\"'\";\n\t\t\t\t\t\t$result = $this->execute_query($query);\n\t\t\t\t\t\tif($this->num_rows($result) > 0 ){\n\t\t\t\t\t\t\t$error[] = \"The plan name already exists. Please use a different one.\"; \n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(isset($error) && count($error) > 0){\n\n\t\t\t\t\t$replace['error'] = $this->show_error($error);\n\n\t\t\t\t}\n\n\t\t\t\telse{\n $notify = $this->value('notify');\n if($notify > 0) {\n $notify = $this->value('notify');\n\n } else {\n $notify = '0';\n } \t\t\t\t\t \n $query = \" select * from plan where plan_id = \".$this->value('plan_id');\n\t\t\t\t\t\t$sourceResult = $this->execute_query($query);\n\t\t\t\t\t\t$sourceRow = $this->fetch_array($sourceResult);\n\t\t\t\t\t\t$sourceData = array(\n\t\t\t\t\t\t\t\t\t'plan_name' => $this->value('plan_name'),\n\t\t\t\t\t\t\t\t\t'parent_template_id' => $sourceRow['parent_template_id'],\n\t\t\t\t\t\t\t\t\t'user_id' => $this->userInfo('user_id'),\n\t\t\t\t\t\t\t\t\t'patient_id' => $sourceRow['patient_id'],\n\t\t\t\t\t\t\t\t\t'user_type' => 2,\n\t\t\t\t\t\t\t\t\t'status' => 4,\n 'ehsFlag' => '1',\n 'schdulerAction' => '1',\n\t\t\t\t\t\t\t\t\t'unread_plan'=>1\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\n $sourceData['old_plan_id'] = $this->value('plan_id');\n\t\t\t\t\t\t$sourceData['creation_date'] = date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\t$sourceData['modified'] = date(\"Y-m-d H:i:s\");\n $sourceData['is_public'] = null;\n\n\t\t\t\t\t\tif($this->insert($this->config['table']['plan'],$sourceData)){\n\t\t\t\t\t\t\t$new_plan_id = $this->insert_id();\n /* check for plan_article */\n $sqlPlanArticle=\"select * from plan_article where plan_id=\".$this->value('plan_id');\n $resPlanArtical=$this->execute_query($sqlPlanArticle);\n $numPlanArtical=$this->num_rows($resPlanArtical);\n if($numPlanArtical>0){\n while($rowPlanArtical=$this->fetch_array($resPlanArtical)){\n $arrayPlanArtical=array(\n 'plan_id'=>$new_plan_id,\n 'article_id'=>$rowPlanArtical['article_id'],\n 'creation_date'=>date(\"Y-m-d H:i:s\"),\n 'status'=>1\n );\n $this->insert('plan_article',$arrayPlanArtical); \n \n }\n \n }\n /* check for plan_treatment */\n $sqlplanTreatment=\"select * from plan_treatment where plan_id=\".$this->value('plan_id');\n $resplanTreatment=$this->execute_query($sqlplanTreatment);\n $numplanTreatment=$this->num_rows($resplanTreatment);\n if($numplanTreatment>0){\n while($rowplanTreatment=$this->fetch_array($resplanTreatment)){\n $arrayPlanTreatment=array(\n 'plan_id' => $new_plan_id,\n 'treatment_id' => $rowplanTreatment['treatment_id'],\n 'instruction' => $rowplanTreatment['instruction'],\n 'sets' => $rowplanTreatment['sets'],\n 'reps' => $rowplanTreatment['reps'],\n 'hold' => $rowplanTreatment['hold'],\n 'benefit' => $rowplanTreatment['benefit'],\n 'lrb' => $rowplanTreatment['lrb'],\n 'treatment_order' => $rowplanTreatment['treatment_order'],\n 'creation_date' => date(\"Y-m-d H:i:s\"),\n 'status' => 1\n );\n $this->insert('plan_treatment',$arrayPlanTreatment); \n }\n }\n \n \n \n //Updating the copied plan to status archive '2'\n\t\t\t\t\t\t\t$where = \" plan_id = '{$this->value('plan_id')}' \";\n\t\t\t\t\t\t\t//$updateData['status'] = '2';\n //$updateData['old_plan_id'] = $this->value('plan_id');\n\t\t\t\t\t\t\t$updateData['modified'] = date(\"Y-m-d\");\n\t\t\t\t\t\t\t$this->update($this->config['table']['plan'],$updateData,$where);\n\t\t\t\t\t\t\theader(\"location:index.php?action=selectEhsTreatment&plan_id={$new_plan_id}\");\n\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$replace['header'] = $this->build_template($this->get_template(\"header\"));\n\n\t\t\t$replace['footer'] = $this->build_template($this->get_template(\"footer\"));\n\n\t\t\t$replace['sidebar'] = $this->sidebar();\n\n\t\t\t$replace['footer'] = $this->build_template($this->get_template(\"footer\"));\n\t\t\t\n\t\t \n\t\t\t$replace['get_satisfaction'] = $this->get_satisfaction();\n\t\t\t \n\n\t\t\t$nav_bar = array(\n\n\t\t\t\t\t\t\t\t'plan' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=createNewEhsPlan&act=plan_edit&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/01_plan_gray.gif\" /></a>':'<img src=\"images/01_plan_gray.gif\" />',\n\n\t\t\t\t\t\t\t\t'step1' => ($this->value('plan_id') != \"\")?'<img src=\"images/stepIcons_1_red_sm.gif\">':'<img src=\"images/stepIcons_1_red_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step2' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=selectEhsTreatment&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_2_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_2_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step3' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=customize_instruction_ehs&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_3_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_3_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step4' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=customize_articles_ehs&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_4_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_4_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t);\n\n\t\t\tif(is_array($replace)){\n\n\t\t\t\t$replace = $replace + $nav_bar;\n\n\t\t\t}\n\n\t\t\t\n\n\n\n\t\t\t$replace['patient_image'] = '<img src=\"images/03_patient_gray.gif\" />';\n\n\t\t\t$replace['assign_image'] = '<img src=\"images/04_assign_gray.gif\" />';\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t$replace['body'] = $this->build_template($this->get_template(\"createNewPlan\"),$replace);\n\n\t\t\t$replace['browser_title'] = \"Tx Xchange: Create New Plan\";\n\n\t\t\t$this->output = $this->build_template($this->get_template(\"main\"),$replace);\n\n\t\t}", "public function getCreate(){\n\t\treturn View::make('admin.plan.add')\n\t\t\t\t\t->with('insurances', Insurance::lists('name', 'id'));\n\t}", "public function run()\n {\n Plan::create([\n 'name'=>'Plan 5',\n 'sogod_rate'=>600,\n 'outside_sogod_rate'=>800\n ]);\n\n Plan::create([\n 'name'=>'Plan 10',\n 'sogod_rate'=>1200,\n 'outside_sogod_rate'=>1600\n ]);\n\n Plan::create([\n 'name'=>'Plan 15',\n 'sogod_rate'=>1800,\n 'outside_sogod_rate'=>2400\n ]);\n\n Plan::create([\n 'name'=>'Plan 20',\n 'sogod_rate'=>2400,\n 'outside_sogod_rate'=>3200\n ]);\n }", "public function run()\n {\n $plans =\n array(\n array(\n \"product_id\"=>1,\n \"title\" => \"Basic\",\n \"pricing\" => 6850,\n \"period\" => \"monthly\",\n \"functionality\" => \"Maximum of 5 User accounts;\n 1 Free system admin account;\n 500 SMS notifications in a month;\n A maximum of 500,000 customer records;\n All reports;\",\n \"note\"=>null\n ),\n array(\n \"product_id\"=>1,\n \"title\" => \"Standard\",\n \"pricing\" => 11800,\n \"period\" => \"monthly\",\n \"functionality\" => \"Maximum of 15 User accounts;\n 1 Free system admin account;\n 1000 SMS notifications in a month;\n A maximum of 1,500,000 customer records;\n All reports;\",\n \"note\"=>null\n ),\n array(\n \"product_id\"=>1,\n \"title\" => \"Enterprise\",\n \"pricing\" => 21550,\n \"period\" => \"monthly\",\n \"functionality\" => \"Maximum of 100 User accounts;\n 1 Free system admin account;\n 5000 SMS notifications in a month;\n A maximum of 500,000 customer records;\n Organization with multiple receptions\n All reports;\",\n \"note\" => \"Extra functionality will be charged at 2% of the Basic\"\n ),\n\n /******************module 2*****************/\n\n array(\n \"product_id\"=>2,\n \"title\" => \"Basic\",\n \"pricing\" => 18000,\n \"period\" => \"monthly\",\n \"functionality\" => \"Maximum of 5 User accounts;\n 1 Free system admin account;\n A maximum of 500,000 customer records;\n Free end user android mobile application on 5 devices;\n A maximum of 5 E-Security desk;\n All reports;\",\n \"note\"=>null\n ),\n array(\n \"product_id\"=>2,\n \"title\" => \"Standard\",\n \"pricing\" => 25800,\n \"period\" => \"monthly\",\n \"functionality\" => \"Maximum of 15 User accounts;\n 1 Free system admin account;\n A maximum of 1,500,000 customer records;\n Free end user android mobile application on 15 devices;\n A maximum of 15 E-Security desk;\n All reports;\",\n \"note\"=>null\n ),\n array(\n \"product_id\"=>2,\n \"title\" => \"Enterprise\",\n \"pricing\" => 50550,\n \"period\" => \"monthly\",\n \"functionality\" => \"Maximum of 100 User accounts;\n 1 Free system admin account;\n A maximum of 5,000,000 customer records;\n Free end user android mobile application on 100 devices;\n A maximum of 100 E-Security desk;\n All reports;\",\n \"note\" => \"Extra functionality will be charged at 2% of the Basic\"\n )\n );\n\n DB::table('plans')->delete();\n DB::table('plans')->insert($plans);\n\n }", "public function testUpdatePackingPlan()\n {\n }", "public function addPlanCombo(PlanCombo $planCombo)\n {\n $this->planCombos[] = $planCombo;\n\n return $this;\n }", "public function add_products_in_plan( $allowed_in_plan, $plan_id, $user_id = 0 ) {\n $args = array(\n 'post_type' => 'product',\n 'posts_per_page' => -1,\n 'post_status' => 'publish',\n 'yith_wcmbs_suppress_filter' => true,\n 'meta_query' => array(\n array(\n 'key' => '_yith_wcmbs_restrict_access_plan',\n 'value' => $plan_id,\n 'compare' => 'LIKE',\n )\n ),\n );\n $products = get_posts( $args );\n\n $plan_cats = get_post_meta( $plan_id, '_product-cats', true );\n $plan_prod_tags = get_post_meta( $plan_id, '_product-tags', true );\n\n $cat_tag_args = array(\n 'post_type' => 'product',\n 'posts_per_page' => -1,\n 'post_status' => 'publish',\n 'yith_wcmbs_suppress_filter' => true,\n 'tax_query' => array(\n 'relation' => 'OR',\n array(\n 'taxonomy' => 'product_cat',\n 'field' => 'term_id',\n 'terms' => $plan_cats,\n 'operator' => 'IN'\n ),\n array(\n 'taxonomy' => 'product_tag',\n 'field' => 'term_id',\n 'terms' => $plan_prod_tags,\n 'operator' => 'IN'\n )\n ),\n );\n $products = array_merge( $products, get_posts( $cat_tag_args ) );\n\n $product_ids = array();\n if ( !empty( $products ) ) {\n foreach ( $products as $product ) {\n $p = wc_get_product( $product->ID );\n\n if ( $user_id > 0 ) {\n\n $delay = get_post_meta( $product->ID, '_yith_wcmbs_plan_delay', true );\n $member = YITH_WCMBS_Members()->get_member( $user_id );\n $last_plan = $member->get_oldest_active_plan( $plan_id );\n if ( isset( $delay[ $plan_id ] ) && $last_plan instanceof YITH_WCMBS_Membership ) {\n $delay_days = $delay[ $plan_id ];\n\n $date = $last_plan->start_date + ( $last_plan->paused_days * 60 * 60 * 24 );\n\n $passed_days = intval( ( time() - $date ) / ( 24 * 60 * 60 ) );\n if ( $passed_days <= $delay_days )\n continue;\n }\n }\n if ( $p ) {\n $downloadable = false;\n if ( $p->product_type != 'variable' ) {\n if ( $p->is_downloadable() ) {\n $downloadable = true;\n }\n } else {\n $variations = $p->get_children();\n if ( !empty( $variations ) ) {\n foreach ( $variations as $variation ) {\n $p_tmp = wc_get_product( $variation );\n if ( $p_tmp->is_downloadable() ) {\n $downloadable = true;\n break;\n }\n }\n }\n }\n\n // add ONLY Downloadable Products\n if ( $downloadable ) {\n $product_ids[] = $product->ID;\n }\n }\n }\n }\n\n\n return array_unique( array_merge( $allowed_in_plan, $product_ids ) );\n }", "public function store(PlanCreateRequest $request , $id)\n {\n $validated = $request->validated();\n $plan = new Plan;\n $plan->name = $request->name;\n $plan->price = $request->price;\n $plan->shop_id = $id;\n $plan->save();\n return redirect()->route('shops.show' , ['shop' => $id])->\n with(['done' => 'Plan Added To The Shop Successfully']);\n\n }" ]
[ "0.71260136", "0.68350846", "0.6752477", "0.67453843", "0.66361356", "0.6618997", "0.64919925", "0.63379884", "0.63285094", "0.63147736", "0.6292509", "0.6236067", "0.618298", "0.61351556", "0.6090559", "0.608655", "0.6032568", "0.6024815", "0.6014579", "0.5982948", "0.5946325", "0.5930029", "0.59277844", "0.5919805", "0.59173", "0.5917136", "0.58926415", "0.5887346", "0.5833329", "0.58208597", "0.58085614", "0.58079994", "0.5768684", "0.5766737", "0.5764713", "0.5751423", "0.57487684", "0.57397693", "0.57378614", "0.573509", "0.57176286", "0.5710103", "0.56861633", "0.5663567", "0.56621754", "0.5652565", "0.56431293", "0.5634039", "0.5622753", "0.5617061", "0.56125176", "0.55903167", "0.5589331", "0.5576669", "0.5568184", "0.55387306", "0.55364037", "0.55330384", "0.55061644", "0.54997957", "0.5498978", "0.54970735", "0.5496803", "0.548798", "0.54869735", "0.54856706", "0.54759115", "0.54754204", "0.54715633", "0.546464", "0.54585916", "0.5457684", "0.5456367", "0.54543144", "0.54336375", "0.5423711", "0.5408247", "0.539895", "0.539895", "0.538685", "0.5383015", "0.5377063", "0.5354181", "0.53357124", "0.5332873", "0.53312695", "0.53294355", "0.5313742", "0.5301029", "0.53001946", "0.5287801", "0.5285345", "0.52566904", "0.52559566", "0.5255324", "0.5254053", "0.5252903", "0.5250166", "0.52353144", "0.52256197", "0.5225559" ]
0.0
-1
Function to Update Plan
public function UpdateExe($data,$id){ $this->db->where('exe_id',$id); $this->db->update('executive',$data); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdatePackingPlan()\n {\n }", "public function update_plan() {\n if (empty($this->user->admin)) {\n Router::redirect('/');\n die();\n }\n\n # Set up query\n $q = \"UPDATE plans SET\n\t\t\t description='\".$_POST['description'].\"', time='\".$_POST['time'].\"', public='\".(!empty($_POST['public'])?1:0).\"'\n\t\t\t WHERE plan_id=\".$_POST['plan_id'];\n $plans = DB::instance(DB_NAME)->query($q);\n\t\t\n\t\t#Adding action to System Log\n $data3 = Array (\n\n \"modified_date\" => Time::now(),\n \"FK_id\" => $_POST['plan_id'],\n \"FK_table\" => 'plans',\n \"login\" => false,\n \"modified_by\" => $this->user->user_id\n );\n DB::instance(DB_NAME)->insert('logs',$data3);\n\n //Return result to jTable\n $jTableResult = array();\n $jTableResult['Result'] = \"OK\";\n print json_encode($jTableResult);\n }", "public function update(Request $request, Plan $plan)\n {\n //\n }", "function TestPlan_update($plan_id, $author_id, $product_id = NULL, $default_product_version = NULL, $type_id = NULL, $name = NULL, $creation_date = NULL, $isactive = TRUE) {\n\t$varray = array(\"author_id\" => \"int\", \"product_id\" => \"int\", \"default_product_version\" => \"string\", \"type_id\" => \"int\", \"name\" => \"string\", \"creation_date\" => \"string\", \"isactive\" => \"int\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.update', array(new xmlrpcval($plan_id, \"int\"), new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function update(UpdateStripePlanRequest $request)\n {\n\n Log::debug(\"UPDATE PLAN\");\n\n $stripeService = new StripeService();\n $stripeService->setStripeKey();\n\n $stripeSubscriptionService = new StripeSubscriptionService();\n $result = $stripeSubscriptionService->createPlan($request->amount, $request->name, $request->product, $request->interval);\n\n if ($result['message'] == 'Success'){\n\n session()->flash('success', 'Plan updated successfully.');\n \n return redirect( route ('plans.index') );\n\n } else {\n\n Log::debug($result['message']);\n\n session()->flash('error', $result['message']);\n\n return redirect()->back();\n\n }\n\n }", "public function updating(Plan $plan)//troquei o update por updating\n {\n $plan->url = Str::kebab($plan->name);\n }", "public function update(Request $request, $id)\n {\n $this->authorize('update', Plan::class);\n\n $this->validate($request, [\n 'name' => 'required',\n 'price' => 'required',\n 'duration' => 'required',\n ]);\n\n $plan = Plan::findOrFail($id);\n // Generate plan slug from plan name\n $slug = str_replace(' ','-', $request->input('name'));\n $gateway_id = str_replace(' ','_', $request->input('name'));\n $team_enable = !empty($request->input('teams_limit')) ? 1 : 0;\n $teams_limit = !empty($request->input('teams_limit')) ? $request->input('teams_limit') : NULL;\n $price = (float) $request->input('price') * 100;\n \n // Delete the plan on stripe \n $stripe_plan = \\Stripe\\Plan::retrieve($plan->gateway_id);\n $stripe_plan->delete();\n\n $interval=explode(',',$request->duration);\n //Add the Stripe Api key to\n // Recrete a new plan on stripe\n \\Stripe\\Plan::create([\n \"amount\" => $price,\n \"interval\" => $interval[1],\n \"interval_count\"=>$interval[0], \n \"product\" => [\n \"name\" => $request->input('name'),\n ],\n \"currency\" => \"usd\",\n \"id\" => $gateway_id,\n \"trial_period_days\" => $request->input('trial'),\n ]);\n\n $plan->name = $request->input('name');\n $plan->gateway_id = $gateway_id;\n $plan->price = $request->input('price');\n $plan->brand = $request->input('brand');\n $plan->contest = $request->input('contest');\n $plan->duration = $request->input('duration');\n $plan->other_info_1 =$request->input('plan_info_1');\n $plan->other_info_2 = $request->input('plan_info_2');\n //$plan->teams_enabled = $team_enable;\n //$plan->teams_limit = $teams_limit;\n $plan->active =1;\n $plan->slug = $slug;\n //$plan->trial_period_days = $request->input('trial');\n $plan->save();\n\n return redirect()->back()->with(\"status\", \"Your plan has been updated.\");\n }", "public function update_plan($planId,$items,$state){ \n try {\n \n $createdPlan = new Plan();\n $createdPlan->setId($planId);\n\n $patch = new Patch();\n $value = new PayPalModel('{\n \"state\":\"'.$state.'\"\n }');\n $this->setArrayToMethods(array_filter($items), $patch);\n $patch->setValue($value); \n \n $patchRequest = new PatchRequest();\n $patchRequest->addPatch($patch);\n $requestArray = clone $createdPlan;\n $createdPlan->update($patchRequest, $this->_api_context);\n $plan = Plan::get($planId, $this->_api_context);\n \n $returnArray['RESULT'] = 'Success';\n $returnArray['PLAN'] = $plan->toArray();\n $returnArray['RAWREQUEST'] =$requestArray;\n $returnArray['RAWRESPONSE']=$plan->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }", "public function edit(Plan $plan)\n {\n //\n }", "public function edit(Plan $plan) {\n \n }", "public function testUpdatePackingPlanCustomFields()\n {\n }", "public function update() {\n\n\t\tif (!empty($this->plan_model->return_plan_by_id($this->input->post('id_plan')))) {\n\t\t\t\n\t\t\t$this->data['plansUpdate'] = $this->plan_model->return_plan_by_id($this->input->post('id_plan'));\n\n\t\t\t$this->session->set_flashdata('succes_msg','Registered Plan Health!');\n\n\t\t}else {\n\n\t\t\t$this->session->set_flashdata('error_msg','Fail Register!');\n\t\t}\n\n\t\t$this->index();\n\n\t}", "public function update($id, Request $request)\n {\n $customMessages = [\n 'name' => 'The Plan Name field is required.',\n 'description' => 'The description field is required.',\n ];\n $this->validate($request, [\n 'name' => 'required|unique:plans,name,'.$request->id.',id',\n 'description' => 'required',\n ], $customMessages);\n \n $plan = Plan::findOrFail($id);\n $plan->name = $request->get('name');\n $plan->description = $request->get('description');\n if($request->has('status')) $plan->status = $request->get('status');\n $plan->save();\n $mainmodules = MainModule::all();\n try{\n $datetime = date('Y-m-d H:i:s');\n $has_tally_integration = $request->has('tally');\n DB::beginTransaction();\n $plans_has_modules = DB::table('plan_has_modules')->where('plan_id', $plan->id)->first();\n if($plans_has_modules) DB::table('plan_has_modules')->where('plan_id', $plan->id)->delete();\n\n $insertData = array();\n $clientSettingUpdatedArray = array();\n foreach($mainmodules as $module){\n $field = $module->field;\n $enabled = $request->$field ? 1 : 0;\n $clientSettingUpdatedArray[$field] = $enabled;\n $data = array(\n 'plan_id'=>$plan->id,\n 'module_id'=>$module->id,\n 'enabled'=>$enabled\n ); \n array_push($insertData, $data);\n }\n if(!empty($insertData)) DB::table('plan_has_modules')->insert($insertData);\n $companiesIDs = DB::table('company_plan')->where('plan_id',$plan->id)->pluck('company_id');\n \n if(!empty($companiesIDs)){\n $clientSettings = ClientSetting::whereIn('company_id',$companiesIDs)->get();\n \n foreach($clientSettings as $clientSetting){\n $clientSetting->update($clientSettingUpdatedArray);\n $company_id = $clientSetting->company_id;\n // AssignFullAccessPermission::dispatch($company_id, $clientSetting);\n // $limited_access_assign_permission_name = array('PartyVisit-view', 'PartyVisit-create');\n \n // AssignLimitedAccessPermission::dispatch($company_id, $limited_access_assign_permission_name);\n\n $tallyInt = DB::table('tally_schedule')->where('company_id', $company_id)->first();\n $companyname = Company::find($company_id);\n \n $domain = $companyname ? $companyname->domain : NULL;\n if($domain){\n if (!$has_tally_integration && !empty($tallyInt)) {\n $affected = DB::table('tally_schedule')\n ->where('company_id', $company_id)\n ->update(['updated_at' => $datetime, 'deleted_at' => $datetime]);\n } elseif ($has_tally_integration) {\n if($tallyInt) $affected = DB::table('tally_schedule')->where('company_id', $company_id)->update(['updated_at' => $datetime, 'deleted_at' => NULL]);\n else $affected = DB::table('tally_schedule')->insert([\n 'company_id' => $company_id,\n 'company_name' => $domain,\n 'created_at' => $datetime]);\n }\n }\n }\n }\n DB::commit();\n if(isset($clientSettings)){\n foreach($clientSettings as $clientSetting){\n $fbIDs = DB::table('employees')->where(array(array('company_id', $clientSetting->company_id), array('status', 'Active')))->whereNotNull('firebase_token')->pluck('firebase_token');\n $dataPayload = array(\"data_type\" => \"company_setting\", \"company_setting\" => json_encode($clientSetting), \"action\" => \"update\");\n sendPushNotification_($fbIDs, 12, null, $dataPayload); \n }\n }\n return redirect()->route('app.plan')->with('success', 'Information has been Updated');\n }catch(\\Exception $e){\n DB::rollback();\n dd($e->getMessage());\n Log::error($e->getMessage());\n }\n }", "public function setProposedPlanUpdate($plan) {\n $this->proposedPlanUpdate = $plan;\n }", "public function updatePlan(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\CreatePlanRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\CreatePlanRequest', $parameters, true);\n }", "public function testUpdatePayrun()\n {\n }", "private function _SavePlan()\n\t{\n\t\t/*\n\t\t * Saving process:\n\t\t *\t\tS1: Set up values for properties of the RatePlan object that are not already defined, or not in their database correct format\n\t\t *\t\tS2: Save the record to the RatePlan table\n\t\t *\t\tS3: Remove any records in the RatePlanRateGroup table\n\t\t *\t\tS4: For each RateGroup belonging to this RatePlan:\n\t\t *\t\t\t\tadd a record to the RatePlanRateGroup table\n\t\t *\t\tS5: If the RatePlan is being Committed: (not being saved as a draft)\n\t\t *\t\t\t\tFor each draft RateGroup belonging to this RatePlan:\n\t\t *\t\t\t\t\tupdate the Archived property of the RateGroup in the RateGroup table so that it is now a committed RateGroup, not a draft\n\t\t *\t\t\t\t\tFor each draft Rate belonging to the draft RateGroup:\n\t\t *\t\t\t\t\t\tupdate the Archived property of the Rate in the Rate table so that it is now a committed Rate, not a draft\n\t\t */\n\n\t\t// S1: Set up the remaing fields required of a RatePlan record\n\t\tDBO()->RatePlan->MinMonthly\t= ltrim(DBO()->RatePlan->MinMonthly->Value, \"$\");\n\t\tDBO()->RatePlan->ChargeCap\t= ltrim(DBO()->RatePlan->ChargeCap->Value, \"$\");\n\t\tDBO()->RatePlan->UsageCap\t= ltrim(DBO()->RatePlan->UsageCap->Value, \"$\");\n\n\t\tif (SubmittedForm('AddPlan', 'Save as Draft'))\n\t\t{\n\t\t\t// Flag the plan as being a draft\n\t\t\tDBO()->RatePlan->Archived = RATE_STATUS_DRAFT;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// The plan is not being saved as a draft\n\t\t\tDBO()->RatePlan->Archived = RATE_STATUS_ACTIVE;\n\t\t}\n\n\t\tDBO()->RatePlan->modified_employee_id\t= Flex::getUserId();\n\t\tif (!DBO()->RatePlan->Id->Value)\n\t\t{\n\t\t\t// Plan has not been saved before\n\t\t\tDBO()->RatePlan->created_employee_id\t= Flex::getUserId();\n\t\t}\n\n\t\t// If the RatePlan has already been saved as a draft then load in the details that don't get edited here, so they don't get erased\n\t\tif (DBO()->RatePlan->Id->Value)\n\t\t{\n\t\t\tDBO()->RatePlan->LoadMerge();\n\t\t}\n\n\t\t// S2: Save the plan to the database\n\t\tif (!DBO()->RatePlan->Save())\n\t\t{\n\t\t\t// Saving failed\n\t\t\treturn \"ERROR: Saving the RatePlan to the RatePlan database table failed, unexpectedly\";\n\t\t}\n\n\t\t// S3: Remove all records from the RatePlanRateGroup table where RatePlan == DBO()->RatePlan->Id->Value\n\t\t$delRatePlanRateGroup = new Query();\n\t\t$delRatePlanRateGroup->Execute(\"DELETE FROM RatePlanRateGroup WHERE RatePlan = \" . DBO()->RatePlan->Id->Value);\n\n\t\t// S4: Save each of the RateGroups associated with the RatePlan to the RatePlanRateGroup table\n\t\tDBO()->RatePlanRateGroup->RatePlan = DBO()->RatePlan->Id->Value;\n\t\tforeach ($this->_arrRateGroups as $intRateGroup)\n\t\t{\n\t\t\tDBO()->RatePlanRateGroup->Id = 0;\n\t\t\tDBO()->RatePlanRateGroup->RateGroup = $intRateGroup;\n\n\t\t\tif (!DBO()->RatePlanRateGroup->Save())\n\t\t\t{\n\t\t\t\t// Saving failed\n\t\t\t\treturn \"ERROR: Saving one of the RateGroup - RatePlan associations failed, unexpectedly.<br />The RatePlan has not been saved\";\n\t\t\t}\n\t\t}\n\n\t\t// S5: Remove all records from the rate_plan_discount table where RatePlan == DBO()->RatePlan->Id->Value\n\t\t$delRatePlanDiscount\t= new Query();\n\t\t$delRatePlanDiscount->Execute(\"DELETE FROM rate_plan_discount WHERE rate_plan_id = \" . DBO()->RatePlan->Id->Value);\n\n\t\t// S6: Remove any records from the discount table which are no longer linked to any Rate Plans (Discounts cannot be shared between Plans)\n\t\t$delUnlinkedDiscounts\t= new Query();\n\t\t$delUnlinkedDiscounts->Execute(\"DELETE FROM discount WHERE (SELECT id FROM rate_plan_discount WHERE discount_id = discount.id LIMIT 1) IS NULL\");\n\n\t\t// S7: Save each of the Discounts which are linked between this Rate Plan and a Record Type\n\t\t$aDiscountReferenceMap\t= array();\n\t\tforeach (DBL()->RecordType as $dboRecordType)\n\t\t{\n\t\t\t$sRecordTypeObjectName\t\t= \"RecordType_{$dboRecordType->Id->Value}\";\n\t\t\t$iDiscountReference\t= (int)DBO()->{$sRecordTypeObjectName}->discount_id->Value;\n\n\t\t\t// Has the Discount already been created?\n\t\t\tif ($iDiscountReference && $iDiscountReference > 0)\n\t\t\t{\n\t\t\t\tif (!array_key_exists($iDiscountReference, $aDiscountReferenceMap))\n\t\t\t\t{\n\t\t\t\t\t// Create the Discount\n\t\t\t\t\t$sDiscountObjectName\t= \"discount_{$iDiscountReference}\";\n\n\t\t\t\t\t$oDiscount\t\t\t\t\t= new Discount();\n\t\t\t\t\t$oDiscount->name\t\t\t= trim(DBO()->{$sDiscountObjectName}->name->Value);\n\t\t\t\t\t$oDiscount->description\t\t= trim(DBO()->{$sDiscountObjectName}->description->Value);\n\n\t\t\t\t\tif (DBO()->{$sDiscountObjectName}->limit_type->Value === 'UNITS')\n\t\t\t\t\t{\n\t\t\t\t\t\t$oDiscount->charge_limit\t= null;\n\t\t\t\t\t\t$oDiscount->unit_limit\t\t= abs((int)trim(DBO()->{$sDiscountObjectName}->limit->Value));\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$oDiscount->charge_limit\t= abs((float)trim(DBO()->{$sDiscountObjectName}->limit->Value));\n\t\t\t\t\t\t$oDiscount->unit_limit\t\t= null;\n\t\t\t\t\t}\n\t\t\t\t\t$oDiscount->charge_limit\t= ($oDiscount->charge_limit) ? $oDiscount->charge_limit : null;\n\t\t\t\t\t$oDiscount->unit_limit\t\t= ($oDiscount->unit_limit) ? $oDiscount->unit_limit : null;\n\n\t\t\t\t\t$oDiscount->save();\n\n\t\t\t\t\t// Create the Discount<->RatePlan Link\n\t\t\t\t\t$oRatePlanDiscount\t\t\t\t\t= new Rate_Plan_Discount();\n\t\t\t\t\t$oRatePlanDiscount->rate_plan_id\t= DBO()->RatePlan->Id->Value;\n\t\t\t\t\t$oRatePlanDiscount->discount_id\t\t= $oDiscount->id;\n\t\t\t\t\t$oRatePlanDiscount->save();\n\n\t\t\t\t\t$aDiscountReferenceMap[$iDiscountReference]\t= $oDiscount->id;\n\t\t\t\t}\n\n\t\t\t\t// Save Link\n\t\t\t\t$oDiscountRecordType\t\t\t\t\t= new Discount_Record_Type();\n\t\t\t\t$oDiscountRecordType->discount_id\t\t= $aDiscountReferenceMap[$iDiscountReference];\n\t\t\t\t$oDiscountRecordType->record_type_id\t= $dboRecordType->Id->Value;\n\t\t\t\t$oDiscountRecordType->save();\n\t\t\t}\n\t\t}\n\n\t\t// S8: If the RatePlan is being committed then all draft RateGroups used by it must be commited and all draft Rates\n\t\t// used by the draft RateGroups must be committed\n\t\tif ((SubmittedForm('AddPlan', 'Commit')) && (count($this->_arrRateGroups) > 0))\n\t\t{\n\t\t\t$strRateGroups \t= implode(',', $this->_arrRateGroups);\n\t\t\t$arrUpdate\t\t= Array(\"Archived\" => RATE_STATUS_ACTIVE);\n\t\t\t$updRateGroups \t= new StatementUpdate(\"RateGroup\", \"Archived = \". RATE_STATUS_DRAFT .\" AND Id IN ($strRateGroups)\", $arrUpdate);\n\t\t\t$updRates \t\t= new StatementUpdate(\"Rate\", \"Archived = \". RATE_STATUS_DRAFT .\" AND Id IN (SELECT Rate FROM RateGroupRate WHERE RateGroup IN ($strRateGroups))\", $arrUpdate);\n\n\t\t\tif ($updRateGroups->Execute($arrUpdate, NULL) === FALSE)\n\t\t\t{\n\t\t\t\treturn \"ERROR: Commiting one of the Draft Rate Groups, used by this Rate Plan, failed.<br />The RatePlan has not been saved\";\n\t\t\t}\n\n\t\t\tif ($updRates->Execute($arrUpdate, NULL) === FALSE)\n\t\t\t{\n\t\t\t\treturn \"ERROR: Commiting one of the Draft Rates, used by this Rate Plan, failed.<br />The RatePlan has not been saved\";\n\t\t\t}\n\t\t}\n\n\t\t// Everything has been saved\n\t\treturn TRUE;\n\t}", "protected function syncPlan(Plan $plan): void\n {\n $this->info(\n PHP_EOL .\n Carbon::now() .\n ' Sync duration values for plan: ' .\n $plan->name\n );\n\n $bar_by_plan = new ProgressBar($this->output, $plan->num_items);\n $plan = Plan::where('id', $plan->id)->first();\n foreach ($plan->days as $day) {\n $playlist_items = PlaylistItems::where(\n 'playlist_id',\n $day->playlist_id\n )->get();\n\n foreach ($playlist_items as $playlist_item) {\n $playlist_item->calculateDuration()->save();\n $playlist_item->calculateVerses()->save();\n $bar_by_plan->advance();\n }\n }\n $bar_by_plan->finish();\n $this->info('');\n }", "public function updateListing($plan_info)\n {\n $is_free = false;\n\n // Define is listing is free\n if (\n $plan_info['Price'] <= 0\n || ($plan_info['Price'] > 0\n && (\n (\n $this->planType == 'listing'\n && $plan_info['Package_ID']\n && $plan_info['Listings_remains'] > 0\n )\n || (\n $this->planType == 'account'\n && $plan_info['Listings_remains'] > 0\n )\n )\n )\n ) {\n $is_free = true;\n\n // Redirect to the form if done step was initiated not by script\n if (!$this->listingData['Plan_ID']) {\n $this->redirectToStep('category');\n exit;\n }\n }\n // Checking for paid listing payment status\n elseif (strtotime($this->listingData['Pay_date']) === false) {\n if ($this->singleStep) {\n $this->redirectToStep('category');\n } else {\n $this->redirectToStep($this->listingData['Last_step'], $this->extendUrl());\n }\n exit;\n }\n\n // Change listing status\n $update = array(\n 'fields' => array(\n 'Last_step' => '',\n 'Last_type' => '',\n 'Cron' => '0',\n 'Cron_notified' => '0',\n 'Cron_featured' => '0',\n ),\n 'where' => array(\n 'ID' => $this->listingID,\n ),\n );\n\n if ($is_free) {\n // Define featured status\n if (($plan_info['Featured'] || $plan_info['Featured_listing'])\n && (!$plan_info['Advanced_mode']\n || ($plan_info['Advanced_mode'] && $this->adType == 'featured')\n )\n ) {\n $featured = true;\n }\n\n $update['fields']['Status'] = $GLOBALS['config']['listing_auto_approval'] ? 'active' : 'pending';\n $update['fields']['Pay_date'] = 'NOW()';\n $update['fields']['Featured_ID'] = $featured ? $plan_info['ID'] : 0;\n $update['fields']['Featured_date'] = $featured ? 'NOW()' : 'NULL';\n }\n\n $GLOBALS['rlDb']->update($update, 'listings');\n\n /**\n * @since 4.7.2 - Hook moved after code \"rlDb->update()\"\n * @since 4.6.0 - All parameters\n */\n $GLOBALS['rlHook']->load('afterListingDone', $this, $update, $is_free);\n }", "public function updated(PlanSubscription $planSubscription)\n {\n\n if($planSubscription->status==\"PENDING\"){\n $planSubscription->is_paid = false;\n $planSubscription->save();\n }\n if($planSubscription->status==\"SUSPENDED\"){\n $planSubscription->is_paid = false;\n $planSubscription->save();\n }\n if($planSubscription->status==\"CANCELLED\"){\n $planSubscription->is_paid = false;\n $planSubscription->cancelled_on = Carbon::now();\n $planSubscription->save();\n }\n if($planSubscription->status==\"CANCELLED_BY_RECEIVER\"){\n $planSubscription->is_paid = false;\n $planSubscription->cancelled_on = Carbon::now();\n $planSubscription->save();\n }\n if($planSubscription->status==\"CANCELLED_BY_SENDER\"){\n $planSubscription->is_paid = false;\n $planSubscription->cancelled_on = Carbon::now();\n $planSubscription->save();\n }\n }", "public function updateAccount(&$plan_info)\n {\n global $account_info;\n\n // Return if it's not a membership plab mode\n if ($this->planType != 'account') {\n return;\n }\n\n // Return if plan isn't free or current account already has a plan assigned\n if ($plan_info['Price'] > 0 || $account_info['Plan_ID']) {\n return;\n }\n\n $GLOBALS['reefless']->loadClass('Account');\n $GLOBALS['rlAccount']->upgrade($account_info['ID'], $plan_info['ID'], false, false);\n $account_info['Plan_ID'] = $plan_info['ID'];\n }", "public function updatePlan($oldPlan, $newPlan)\n {\n $oldPlan->name = $newPlan->name;\n\n return $oldPlan;\n }", "function update_predefined_innovation_plan($id, $params)\n {\n $this->db->where('id', $id);\n $status = $this->db->update('predefined_innovation_plan', $params);\n $db_error = $this->db->error();\n if (! empty($db_error['code'])) {\n echo 'Database error! Error Code [' . $db_error['code'] . '] Error: ' . $db_error['message'];\n exit();\n }\n return $status;\n }", "public function plan()\n {\n echo '客户要求改变计划' . PHP_EOL;\n }", "public function update(UpdatePlan $request, string $id)\n {\n $plan = Plan::findOrFail(id_decode($id), ['id', 'price', 'months', 'type', 'status']);\n\n $plan->fill($request->validated());\n\n if ($plan->save()) {\n flash(trans('common.updatedSuccessfully'))->success();\n\n return redirect()->route('plans.index');\n }\n\n flash(trans('common.error'))->error();\n\n return back();\n }", "function update() {\n\t\t$sql = \"UPDATE cost_detail \n\t\t\t\tSET\tcd_start_time=?, cd_end_time=?, cd_hour=?, cd_minute=?, cd_cost=?, cd_update=?, cd_user_update=? \n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\t\n\t\t$this->ffm->query($sql, array($this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update, $this->cd_fr_id, $this->cd_seq));\t\n\t}", "public function create_or_update_plan( $plan_data ) {\n\t\t$item_id = $plan_data['id'];\n\t\t$all_items = MS_Factory::get_transient( 'ms_stripecheckout_plans' );\n\t\t$all_items = mslib3()->array->get( $all_items );\n\n\t\tif ( ! isset( $all_items[ $item_id ] )\n\t\t || ! is_a( $all_items[ $item_id ], 'StripeCheckoutPlan' )\n\t\t) {\n\t\t\ttry {\n\t\t\t\t$item = StripeCheckoutPlan::retrieve( $item_id );\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t// If the plan does not exist then stripe will throw an Exception.\n\t\t\t\t$item = false;\n\t\t\t}\n\t\t\t$all_items[ $item_id ] = $item;\n\t\t} else {\n\t\t\t$item = $all_items[ $item_id ];\n\t\t}\n\n\t\t/*\n\t\t * Stripe can only update the plan-name, so we have to delete and\n\t\t * recreate the plan manually.\n\t\t */\n\t\tif ( $item && is_a( $item, 'StripeCheckoutPlan' ) ) {\n\t\t\t$item->delete();\n\t\t\t$all_items[ $item_id ] = false;\n\t\t}\n\n\t\tif ( $plan_data['amount'] > 0 ) {\n\t\t\ttry {\n\t\t\t\t$item = StripeCheckoutPlan::create( $plan_data );\n\t\t\t\t$all_items[ $item_id ] = $item;\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t// Nothing.\n\t\t\t}\n\t\t}\n\n\t\tMS_Factory::set_transient(\n\t\t\t'ms_stripecheckout_plans',\n\t\t\t$all_items,\n\t\t\tHOUR_IN_SECONDS\n\t\t);\n\t}", "function therapistEhsPlan() { \n\n\t\t\t\n //Action for deleting the plans\n if($this->value('act') == 'deletePlan') {\n\n\t\t\t\tif( $this->value('plan_id') != \"\" && is_numeric($this->value('plan_id'))) {\n\n\t\t\t\t\t$query = \"update plan p set status = 3 where p.user_id = '{$this->userInfo('user_id')}' and p.user_type = '2' and p.plan_id = '{$this->value('plan_id')}' \";\n\t\t\t\t\t$this->execute_query($query);\n\t\t\t\t}\n\t\t\t}\n\n //End here\n\t\t $clinicId = $this->clinicInfo('clinic_id');\n //$Ehspatients = $this->getProviderEHSPatients($clinicId);\n if($this->is_corporate($clinicId)==1){\n $Ehspatients = $this->get_paitent_list($clinicId);\n }else{\n $Ehspatients = $this->getProviderEHSPatients($clinicId);\n }\n $totalEhsPatients = count($Ehspatients);\n if($totalEhsPatients == '0') {\n header(\"location:index.php?action=therapistEhsPatient&ehsunsub=0\");\n } \n //Call get satisfaction js script\t\t\t\n $replace['get_satisfaction'] = $this->get_satisfaction();\n\t \n //Header and sidebar\n\t\t\t$replace['header'] = $this->build_template($this->get_template(\"header\"));\n\t\t\t$replace['sidebar'] = $this->sidebar();\n\t\t\t\n $templatePlanName = $_SESSION['providerLabel']['Template Plan Name']!=''?$_SESSION['providerLabel']['Template Plan Name']:\"Template Plan Name\";\n\t\t\t$replace['p.plan_name'] = $templatePlanName;\n\n\t\t\t$planListHead = array(\n\t\t\t 'p.plan_name' => $templatePlanName,\n\t\t\t 'no_treatments' => '# V',\n\t\t\t 'no_articles' => '# A',\n\t\t\t);\n\t\t\t$replace['planListHead'] = $this->build_template($this->get_template(\"planListHead\"),$planListHead);\n\n\t\t\tinclude_once(\"template/therapistEHS/therapistArray.php\");\n\n\t\t\tif(isset($_SESSION['type'])){\n unset($_SESSION['type']);\t\n\t\t\t}\n\n\t\t\tif( $this->value('path') == 'my_patient' ){\n\t\t\t\t$this->formArray = $PatientPlanListAction;\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\t$this->formArray = $planListAction;\n\t\t\t}\n\n\t\t\tif($this->value('sort') != \"\") {\n\n\t\t\t\tif($this->value('order') == 'desc' ){\n $orderby = \" order by {$this->value('sort')} desc \";\n\t\t\t\t}\n\n\t\t\t\telse {\n $orderby = \" order by {$this->value('sort')} \";\n }\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\t$orderby = \" order by p.plan_name \";\n\t\t\t}\n\n\t\t\t$replace['search'] = \"\";\n\n\t\t\tif($this->value('search') == \"\" && $this->value('restore_search') != \"\" ) {\n\t\t\t\t$_REQUEST['search'] = $this->value('restore_search');\n\t\t\t}\n\t\t\t\n if($this->value('search') != \"\"){\n\n\t\t\t\t$replace['search'] = $this->value('search');\n\n\t\t\t\t $query = \"select *,(select count(*) from plan_treatment \n\n\t\t\t\t\t\t \twhere plan_treatment.plan_id = p.plan_id) AS no_treatments,\n\n\t\t\t\t\t\t\t(select count(*) from plan_article pa inner join article a on a.article_id = pa.article_id and a.status = 1 where pa.plan_id = p.plan_id) AS no_articles\n\n\t\t\t\t\t\t\tfrom plan p where p.user_id = '{$this->userInfo('user_id')}' and p.user_type = '2' and p.patient_id is null and p.status = 1 and p.ehsFlag = '0' and p.plan_name like '%{$this->value('search')}%' \n\n\t\t\t\t {$orderby}\";\n \n $sqlcount=\"select count(1) from plan p where p.user_id = '{$this->userInfo('user_id')}' and p.user_type = '2' and p.patient_id is null and p.status = 1 and p.ehsFlag = '0' and p.plan_name like '%{$this->value('search')}%' \n\n\t\t\t\t {$orderby}\";\n \n\n\t\t\t}\n\n\t\t\telse{\n\n\t\t\t\t $query = \"select *,(select count(*) from plan_treatment \n\n\t\t\t\t\t\t where plan_treatment.plan_id = p.plan_id) AS no_treatments,\n\n\t\t\t\t\t\t(select count(*) from plan_article pa inner join article a on a.article_id = pa.article_id and a.status = 1 where pa.plan_id = p.plan_id) AS no_articles\n\n\t\t\t\t\t\tfrom plan p where p.user_id = '{$this->userInfo('user_id')}' and p.user_type = '2' and p.patient_id is null and p.status = 1 \n and p.ehsFlag = '0' {$orderby}\";\n \n $sqlcount=\"select count(1) from plan p where p.user_id = '{$this->userInfo('user_id')}' and p.user_type = '2' and p.patient_id is null and p.status = 1 \n and p.ehsFlag = '0' {$orderby}\"; \n \n \n\n\t\t\t}\n\t\t\n \n\t\t\t$link = $this->pagination($rows = 0,$query,$this->value('action'),$this->value('search'),'','','',$sqlcount);\t\t\t\t\n\n\t\t\t$replace['link'] = $link['nav'];\n\n\t\t\t$result = $link['result'];\t\t\t\t\t\t\t\t \t\n\n\t\t\tif(is_resource($result)){\n\n\t\t\t\twhile($row = $this->fetch_array($result)){\n\n\t\t\t\t\t$row['style'] = ($c++%2)?\"line1\":\"line2\";\n\n\t\t\t\t\t$row['dropDownWidth'] = ($this->value('path') == 'my_patient'?'90':'120');\n\n\t\t\t\t\t$row['status'] = $this->config['patientStatus'][$row['status']];\n\n\t\t\t\t\t$row['actionOption'] = $this->build_select_option($this->formArray);\n\n\t\t\t\t\t$replace['planRecord'] .= $this->build_template($this->get_template(\"planRecord\"),$row);\n\t\t\t\t}\n\n\t\t\t\tif($this->num_rows($result) == 0){\n\n\t\t\t\t\t$replace['colspan'] = 5;\n\n\t\t\t\t\t$replace['planRecord'] = $this->build_template($this->get_template(\"no_record_found\"),$replace);\n\t\t\t\t}\n\n\t\t\t}\t\n\n\t\n\t\t\t$query_string = array();\n\n\t\t\t$query_string['patient_id'] = $this->value('patient_id');\n\n\t\t\t$query_string['path'] = $this->value('path');\n\n\t\t\t$replace['planListHead'] = $this->build_template($this->get_template(\"planListHead\"),$this->table_heading($planListHead,\"p.plan_name\",$query_string));\n\n\t\t\t$replace['patient_name'] = \"\";\n\n\t\t\t$replace['path'] = $this->value('path');\n\n // Personalized GUI\n $LabelTitle=$_SESSION['providerLabel']['My Template Plans']!=''?$_SESSION['providerLabel']['My Template Plans']:\"MY TEMPLATE PLANS\";\n $replace['path_name'] = strtoupper($LabelTitle);\n $imageCreateNewTemplatePlan=$_SESSION['providerLabel']['images/createNewTemplatePlan.gif']!=''?$_SESSION['providerLabel']['images/createNewTemplatePlan.gif']:\"images/createNewTemplatePlan.gif\";\n $replace['imageCreateNewTemplatePlan'] = $imageCreateNewTemplatePlan;\n $templatePlanLibrary=$_SESSION['providerLabel']['Template Plan Library']!=''?$_SESSION['providerLabel']['Template Plan Library']:\"Template Plan Library\";\n\t\t\t$replace['templatePlanLibrary']=$templatePlanLibrary;\n\t\t\t$templatePlanName =$_SESSION['providerLabel']['Template Plan Name']!=''?$_SESSION['providerLabel']['Template Plan Name']:\"Template Plan Name\";\n\t\t\t$replace['p.plan_name']=$templatePlanName;\n\t\t\t\n\t\t\tif($this->value('path') == \"my_patient\"){\n\n\t\t\t\t//$replace['path_name'] = \"MY Patients\";\n\n\t\t\t}\n\n\t\t\t//$replace['patient_id'] = $this->value('patient_id'); SKS\n\n\t\t\t/*if($this->value('patient_id') != \"\" ){\n $title = $this->userInfo('name_title',$this->value('patient_id'));\n $name_first = $this->userInfo('name_first',$this->value('patient_id'));\n $name_last = $this->userInfo('name_last',$this->value('patient_id'));\n $replace['patient_name'] .= '/&nbsp;' . $this->fullName($title,$name_first,$name_last) . '&nbsp;';\n\t\t\t}*/\n\n\t\t\t$replace['body'] = $this->build_template($this->get_template(\"planList\"),$replace);\n\n\t\t\t$replace['browser_title'] = \"Tx Xchange: \".$LabelTitle;\n\n\t\t\t$this->output = $this->build_template($this->get_template(\"main\"),$replace);\n\n\t\t}", "public function putEditFlatplan($slug, $plan){\n\t\ttry{\n\t\t\t$org = Organization::where('slug', '=', $slug)->firstOrFail();\n\t\t\t$flatplan = Flatplan::where('organization_id', '=', $org->id)->where('slug', '=', $plan)->firstOrFail();\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\treturn View::Make('fourOhFour');\n\t\t}\n\t\t$validator = Validator::make(Input::all(), $this->updateRules);\n\t\tif($validator->fails()){\n\t\t\treturn Redirect::back()->withInput()->withErrors($validator)->with('flash_message', 'There were errors with your update. See below.');\n\t\t}\n\t\telse{\n\t\t\t$flatplan->name = Input::get('name');\n\t\t\t$flatplan->pub_date = Input::get('publication_date');\n\t\t\t$flatplan->save();\n\t\t\treturn Redirect::to('/'.$org->slug.'/'.$flatplan->slug)->with('flash_message', 'Update Successful');\n\t\t}\n\t}", "public function update(Request $request, $id)\n {\n $data = Plan::findOrFail($id);\n $data->user_type = $request->user_type;\n $data->name = $request->name;\n $data->update();\n }", "public function edit($id)\n {\n\n Log::debug(\"EDIT PLAN IN CONTROLLER\");\n\n $stripeService = new StripeService();\n $stripeService->setStripeKey();\n\n $stripeSubscriptionService = new StripeSubscriptionService();\n $result = $stripeSubscriptionService->findPlan($id);\n\n if ($result['message'] == 'Success'){\n\n $plan = $result['plan'];\n\n $amountLen = strlen($plan->amount_decimal); \n $amount = substr_replace( $plan->amount_decimal, '.', $amountLen - 2, 0 ); \n\n $planArray[0]['id'] = $plan->id;\n $planArray[0]['product'] = $plan->product;\n $planArray[0]['interval'] = $plan->interval;\n $planArray[0]['amount'] = $amount;\n $planArray[0]['nickname'] = $plan->nickname;\n \n $plan = json_decode(json_encode($planArray), FALSE);\n \n return view('stripe.plan.create', ['plan' => $plan ]);\n\n } else {\n\n Log::debug($result['message']);\n\n session()->flash('error', $result['message']);\n\n return redirect()->back();\n\n }\n }", "public function update(PlanCreateRequest $request, $id)\n {\n $validated = $request->validated();\n $plan = Plan::find($id);\n $plan->update($validated);\n return redirect()->route('shops.show' , ['shop' => $plan->shop_id])->\n with(['done' => 'Plan Edited Successfully']);\n }", "public function updated(Plan $plan)\n {\n foreach ($plan->users as $user) {\n Mail::to($user)\n ->send(new PlanUpdated($user));\n }\n }", "public function Editplan() {\n $plan_id = $this->input->post('plan_id');\n $data = array(\n 'plan_id' => $plan_id\n );\n $this->load->view('admin/plan/edit_plan', $data);\n }", "private function set_plan(\\Saklient\\Cloud\\Resources\\DiskPlan $v)\n\t{\n\t\tUtil::validateArgCount(func_num_args(), 1);\n\t\tUtil::validateType($v, \"\\\\Saklient\\\\Cloud\\\\Resources\\\\DiskPlan\");\n\t\tif (!$this->isNew) {\n\t\t\tthrow new SaklientException(\"immutable_field\", \"Immutable fields cannot be modified after the resource creation: \" . \"Saklient\\\\Cloud\\\\Resources\\\\Disk#plan\");\n\t\t}\n\t\t$this->m_plan = $v;\n\t\t$this->n_plan = true;\n\t\treturn $this->m_plan;\n\t}", "public function update(Request $request, VendorSubscriptionPlans $vendorSubscriptionPlan)\n {\n $request->validate(\n [\n 'title' => 'required|max:100',\n 'price' => 'numeric|nullable',\n 'duration' => 'required|numeric',\n 'product_limitation' => 'required|numeric',\n 'description' => 'max:200',\n 'status' => 'required',\n\n ],\n [\n 'product_limitation.required' => 'No. of Product is required',\n 'product_limitation.numeric' => 'No. of Product must be a numeric value',\n ]\n );\n\n $vendorSubscriptionPlan->title = $request->title;\n $vendorSubscriptionPlan->price = $request->price ?? 0;\n $vendorSubscriptionPlan->duration = $request->duration;\n $vendorSubscriptionPlan->product_limitation = $request->product_limitation;\n $vendorSubscriptionPlan->description = $request->description;\n $vendorSubscriptionPlan->status = $request->status;\n\n if ($vendorSubscriptionPlan->save()){\n Session::flash('success','Vendor Subscription Plan Added');\n return redirect()->route('vendor-subscription-plan.index');\n }else{\n Session::flash('error','Vendor Subscription Plan Not Added');\n return redirect()->back()->withInput();\n }\n }", "public function update(Request $request, Plancompta $plancompta)\n {\n //\n }", "public function updateListingPackageUsage(&$plan_info)\n {\n global $rlDb, $account_info, $reefless, $lang;\n\n $paid_status = false;\n\n // Existing package mode\n if ($plan_info['Type'] == 'package' && $plan_info['Package_ID']) {\n if ($plan_info['Listings_remains'] > 0) {\n $update = array(\n 'fields' => array(\n 'Listings_remains' => $plan_info['Listings_remains'] - 1,\n ),\n 'where' => array(\n 'ID' => $plan_info['Package_ID'],\n ),\n );\n\n $prefix = ucfirst($this->adType);\n if ($plan_info[$prefix . '_listings'] > 0) {\n $update['fields'][$prefix . '_remains'] = $plan_info[$prefix . '_remains'] - 1;\n }\n\n $rlDb->update($update, 'listing_packages');\n }\n\n // Set paid status\n $paid_status = $lang['purchased_packages'];\n }\n // Newly free package mode\n elseif ($plan_info['Type'] == 'package' && !$plan_info['Package_ID'] && $plan_info['Price'] <= 0) {\n $insert = array(\n 'Account_ID' => $account_info['ID'],\n 'Plan_ID' => $plan_info['ID'],\n 'Listings_remains' => $plan_info['Listing_number'] - 1,\n 'Standard_remains' => $plan_info['Standard_listings'],\n 'Featured_remains' => $plan_info['Featured_listings'],\n 'Type' => 'package',\n 'Date' => 'NOW()',\n 'IP' => $reefless->getClientIpAddress(),\n );\n\n if ($plan_info['Featured'] && $plan_info['Advanced_mode'] && $this->adType == 'standard') {\n $insert['Standard_remains']--;\n }\n\n if ($plan_info['Featured'] && $plan_info['Advanced_mode'] && $this->adType == 'featured') {\n $insert['Featured_remains']--;\n }\n\n $rlDb->insert($insert, 'listing_packages');\n\n // Set paid status\n $paid_status = $lang['package_plan'] . '(' . $lang['free'] . ')';\n }\n // Limited listing mode\n elseif ($plan_info['Type'] == 'listing' && $plan_info['Limit'] > 0) {\n $usage_key = $plan_info['Using'] ? 'Using' : 'Limit';\n $plan_usage_insert = array(\n 'Account_ID' => $account_info['ID'],\n 'Plan_ID' => $plan_info['ID'],\n 'Listings_remains' => $plan_info[$usage_key] - 1,\n 'Type' => 'limited',\n 'Date' => 'NOW()',\n 'IP' => $reefless->getClientIpAddress(),\n );\n\n $rlDb->insert($plan_usage_insert, 'listing_packages');\n }\n\n return $paid_status;\n }", "public function setPlan(?string $plan): self\n {\n $this->plan = $plan;\n\n return $this;\n }", "public function getPlan();", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'minimum_percentage' => 'required',\n 'maximum_percentage' => 'required',\n 'days' => 'required',\n 'referal_earning' => 'required'\n ]);\n $plan = Plan::find($id);\n\n //Inicio de las inserciones en la base de datos\n DB::beginTransaction();\n try {\n $plan->name = $request->name;\n $plan->minimum_percentage = $request->minimum_percentage;\n $plan->maximum_percentage = $request->maximum_percentage;\n $plan->days = $request->days;\n $plan->referal_earning = $request->referal_earning;\n $plan->save();\n } catch (\\Exception $e) {\n DB::rollback();\n throw $e;\n }\n DB::commit();\n return redirect('admin/planes/'. $id . \"/edit\");\n }", "public function update(Request $request, Plan $tariff)\n {\n try {\n $tariff->update([\n 'title' => $request->title,\n 'sub_title' => $request->sub_title,\n 'price' => $request->price,\n 'day' => $request->day,\n 'properties' => ($request->properties?serialize($request->properties):null),\n ]);\n\n return redirect()->route('tariffs.index')->with('flash_message', 'بروزرسانی با موفقیت انجام شد');\n }catch (\\Exception $e){\n return redirect()->back()->with('err_message', 'خطایی رخ داده است، لطفا مجددا تلاش نمایید');\n }\n }", "public function update(Request $request, $id)\n {\n $plan = Plan::findOrFail($id);\n\n $json = $request->input('json', null);\n $params = json_decode($json);\n $params_array = json_decode($json, true);\n\n $validate = \\Validator::make($params_array, [\n 'price' => 'integer',\n ]);\n\n if ($validate->fails()) {\n return $this->errorResponse('Error al validar los datos', 400);\n }\n\n if (isset($params->name)) {\n $plan->name = $params->name;\n }\n\n if (isset($params->price)) {\n $plan->price = $params->price;\n }\n\n if (!$plan->isDirty()) {\n return $this->errorResponse('Se debe especificar al menos un valor diferente para actualizar',422);\n } \n\n $plan->save();\n\n return $this->showOne($plan);\n }", "public function update(Request $request, $id)\n {\n $validator = $this->validator($request->all());\n\n if ($validator->fails()) {\n $this->throwValidationException(\n $request, $validator\n );\n }\n\n $plan = Plan::findOrFail($id);\n\n $plan->course_id = $request->course;\n $plan->conceptual_section_id = $request->conceptual;\n $plan->start_date = Carbon::createFromFormat( 'd-m-Y h:i A', $request->planification_date . ' ' . $request->time_start );\n $plan->end_date = Carbon::createFromFormat( 'd-m-Y h:i A', $request->planification_date . ' ' . $request->time_end );\n $plan->procedimental_section = $request->procedimental;\n $plan->actitudinal_section = $request->actitudinal;\n $plan->competences = $request->competences;\n $plan->indicators = $request->indicators;\n $plan->teaching_strategy = $request->teaching_strategy;\n $plan->teaching_sequence = $request->teaching_sequence;\n\n $plan->update();\n\n return self::redirection('plans/' . $id . '/edit', trans('plan.edit.success'), trans('plan.index.title'), url('plans'));\n }", "private function get_plan()\n\t{\n\t\treturn $this->m_plan;\n\t}", "public function update(Request $request, $planId)\n\t{\n\t\tif ($request->isMethod('PUT')) {\n\t\t\t$data = $request->except(['_token', '_method']);\n\n\t\t\tPlan::where('billing_plan_id', $planId)->update($data);\n\n\t\t\t// Return a flash message\n\t\t\t$request->session()->flash('success', 'Billing Plan was Updated!');\n\n\t\t\treturn back()->withInput();\n\t\t}\n\t}", "function updateBilling()\n\t\t{\n\t\t\tif (is_object($this->Gateway)) {\n\t\t\t\treturn $this->Gateway->update( $this );\n\t\t\t}\n\t\t}", "public function update($id)\n\t{\n\t\t$travelPlan = Travelplan::whereId($id)->first();\n\n\t\t$travelPlan->agency_id = Input::get(\"agency_id\");\n\t\t$travelPlan->location_id = Input::get(\"location_id\");\n\t\t$travelPlan->destination_id = Input::get(\"destination_id\");\n\t\t$travelPlan->price = Input::get(\"price\");\n\t\t$travelPlan->pickup_date = Input::get(\"pickup_date\");\n\t\t$travelPlan->pickup_time = Input::get(\"pickup_time\");\n\t\t$travelPlan->pickup_location = Input::get(\"pickup_location\");\n\t\t$travelPlan->dropoff_location = Input::get(\"dropoff_location\");\n\t}", "public function postChangeSubscriptionPlan(ChangeSubscriptionPlanRequest $request)\n {\n try {\n if ($request->plan == 1) {\n $plan = config('constants.ThreeMonths');\n } else if ($request->plan == 2) {\n $plan = config('constants.SixMonths');\n } else {\n $plan = config('constants.OneYear');\n }\n $subscription = \\Stripe\\Subscription::retrieve($request->subscriptionId);\n $subscription->plan = $plan;\n $subscription->save();\n if ($request->type == config('constants.Resubscribe') || $request->type == config('constants.Change')) {\n RecruiterProfile::where(['user_id' => Auth::user()->id])->update(['is_subscribed' => config('constants.OneValue')]);\n }\n $this->response['success'] = true;\n $this->response['message'] = trans('messages.subscription_plan_changed');\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n $this->response['success'] = true;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }", "public function savePlan($plan)\n {\n return Stripe\\Plan::create(array(\n \"amount\" => $plan->price,\n \"interval\" => $plan->interval,\n \"name\" => $plan->name,\n \"currency\" => \"usd\",\n 'id' => $plan->level\n ));\n }", "public function update(): Response\n {\n $state = $this->request->getQuery('state');\n\n switch ($state) {\n case 'success':\n $id = $this->request->getQuery('id');\n $hostedPage = HostedPage::createFromId($id);\n $planId = $hostedPage->getPlanId();\n break;\n case 'cancelled':\n $planId = null;\n break;\n default:\n throw new \\RuntimeException(sprintf('Unknown ChargeBee state \"%s\".', $state));\n }\n\n /** @var User $user */\n $user = $this->getIdentity();\n $user->persistPlan($planId);\n\n $this->refreshIdentity();\n\n return $this->redirect(['_name' => 'plans']);\n }", "public function update(Request $request, $id)\n {\n\n $plan = Plan::where(['id' => $id]);\n\n if (!$plan->exists())\n return response()->json([\n 'message' => 'No existen registros de ese plan',\n 'data' => [],\n 'status' => 'error'\n ], 200);\n\n if (!$request->has('periodo_inicio') or !$request->has('periodo_fin') or\n !$request->has('programa_academico_id') or !$request->has('nombre') or !$request->has('fecha_cierre') )\n return response()->json([\n 'message' => 'Faltan datos',\n 'data' => $request->toArray(),\n 'status' => 'error'\n ], 200);\n\n $values = [\n 'periodo_inicio' => $request->get('periodo_inicio'),\n 'periodo_fin' => $request->get('periodo_fin'),\n 'programa_academico_id' => $request->get('programa_academico_id'),\n 'nombre' => $request->get('nombre'),\n 'fecha_cierre' => $request->get('fecha_cierre') == 'null' ? null: $request->get('fecha_cierre')\n ];\n\n if ($request->hasFile('documento')) {\n $file = $request->file('documento');\n $time = time();\n $file->storeAs('public', $time . '-' . $file->getClientOriginalName());\n $values['url_documento'] = 'storage/' . $time . '-' . $file->getClientOriginalName();\n }\n\n if ($plan->update($values))\n return response()->json([\n 'message' => 'Actualización exitosa',\n 'data' => [],\n 'status' => 'ok'\n ], 200);\n\n return response()->json([\n 'message' => 'Ha ocurido un error',\n 'data' => [],\n 'status' => 'error'\n ], 200);\n }", "public function update(Request $request, Planet $planet)\n {\n //\n }", "function activateClinicPlan(){\n $clinic_id = $this->clinicInfo(\"clinic_id\");\n if( is_numeric($clinic_id) ) {\n $plan_id = $this->value('plan_id');\n \n if( is_numeric($plan_id)){\n \n //Get plan status\n $query = \"select is_public from plan where plan_id = '{$plan_id}' \"; \n $result = @mysql_query($query);\n if( $row = @mysql_fetch_array($result) ){\n $is_public = $row['is_public'];\n }\n if( (is_null($is_public) || $is_public != 1) && $this->value('act') == 'publish' ){\n $this->copy_plan_to_all_account_clinic($clinic_id, $plan_id);\n $is_public_sql = \" ,is_public = 1 \";\n }\n else{\n $is_public_sql = \"\";\n }\n \n $query = \" update plan set status = 1 $is_public_sql where plan_id = '{$plan_id}' \"; \n @mysql_query($query);\n }\n //unset($_SESSION['plan_id']);\n \n }\n // Redirect to Home page.\n header(\"location:index.php?action=therapist\");\n \n \n }", "public function update_traffic($param){\n }", "function editar_plan_temporada_producto(){\t\t\n\t\t$this->accion=\"Editar Datos del Plan\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\"){\n\t\t\t$this->asignar_valores3();\n\t\t\t\n\t\t\t$sql=\"UPDATE habitaciones2 SET nombre='$this->nombre', orden='$this->prioridad', listar='$this->mostrar', precio='$this->precio', descripcion='$this->descripcion', maxAdultos='$this->maxadultos' WHERE id='$this->temporada'\";\n\t\t\t$id=$this->id;\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/producto/detalle.php?id=$id#next\");\n\t\t\texit();\n\t\t}else{\n\t\t\t$this->mostrar_plan();\n\t\t}\n\t}", "public function update(Request $request, $id)\n {\n $user = Auth::user();\n if (!$user || !$user->is_back_user()) {\n //return redirect()->intended(route('admin/login'));\n return [\n 'success' => false,\n 'errors' => 'Error while trying to authenticate. Login first then use this function.',\n 'title' => 'Not logged in'];\n }\n elseif (!$user->can('manage-membership-plans')){\n return [\n 'success' => false,\n 'errors' => 'You don\\'t have permission to access this page',\n 'title' => 'Permission Error'];\n //return redirect()->intended(route('admin/error/permission_denied'));\n }\n\n $the_plan = MembershipPlan::with('price')->where('id', '=', $id)->get()->first();\n if (!$the_plan){\n return [\n 'success' => false,\n 'errors' => 'Membership plan not found in the database',\n 'title' => 'Error updating membership'\n ];\n }\n\n $vars = $request->only('name','price','plan_period','binding_period','sign_out_period','administration_fee_name','administration_fee_amount','plan_calendar_color','membership_short_description','membership_long_description','status');\n\n if (!in_array($vars['plan_period'], [7,14,30,90,180,360])){\n return [\n 'success' => false,\n 'errors' => 'Plan period not in the correct form. Try again!',\n 'title' => 'Error updating membership'\n ];\n }\n\n $fillable = [\n 'name' => $vars['name'],\n 'plan_calendar_color' => $vars['plan_calendar_color'],\n 'price_id' => $the_plan->price_id,\n 'status' => $vars['status'],\n 'plan_period' => $vars['plan_period'],\n 'binding_period' => $vars['binding_period'],\n 'sign_out_period' => $vars['sign_out_period'],\n 'administration_fee_name' => $vars['administration_fee_name'],\n 'administration_fee_amount' => $vars['administration_fee_amount'],\n 'short_description' => $vars['membership_short_description'],\n 'description' => $vars['membership_long_description']\n ];\n $validator = Validator::make($fillable, MembershipPlan::rules('PATCH', $the_plan->id), MembershipPlan::$message, MembershipPlan::$attributeNames);\n if ($validator->fails()){\n return array(\n 'success' => false,\n 'title' => 'Error validating input information',\n 'errors' => $validator->getMessageBag()->toArray()\n );\n }\n else{\n $the_plan->update($fillable);\n Cache::forget('membership_plans_table');\n }\n\n if ($vars['price'] != $the_plan->price[0]->price) {\n $fillable = [\n 'membership_id' => $the_plan->id,\n 'price' => $vars['price'],\n 'discount' => 0\n ];\n\n $validator = Validator::make($fillable, MembershipPlanPrice::rules('POST'), MembershipPlanPrice::$message, MembershipPlanPrice::$attributeNames);\n if ($validator->fails()) {\n //$with_warnings = true;\n }\n else {\n $the_price = MembershipPlanPrice::create($fillable);\n $the_plan->price_id = $the_price->id;\n $the_plan->save();\n }\n }\n\n Activity::log([\n 'contentId' => $user->id,\n 'contentType' => 'membership_plan',\n 'action' => 'Membership Plan Update',\n 'description' => 'Membership Plan Updated, plan ID : '.$the_plan->id,\n 'details' => 'Updated by user : '.$user->id,\n 'updated' => false,\n ]);\n\n return [\n 'success' => true,\n 'message' => 'Page will reload so you can add all the other details for this plan...',\n 'title' => 'Membership Plan Created',\n 'redirect_link' => route('admin.membership_plan.edit',['id'=>$the_plan->id])\n ];\n }", "public function edit($id)\n {\n $page_title = \"Update Plan\";\n $time = TimeSetting::all();\n $plan = Plan::whereId($id)->first();\n return view('admin.plan.edit', compact('page_title', 'plan','time'));\n }", "function TestRun_update($run_id, $build_id, $environment_id, $manager_id, $plan_text_version, $summary, $notes = NULL, $start_date = NULL, $stop_date = NULL) {\n\t$varray = array(\"build_id\" => \"int\", \"environment_id\" => \"int\", \"manager_id\" => \"int\", \"plan_text_version\" => \"int\", \"summary\" => \"string\", \"notes\" => \"string\", \"start_date\" => \"string\", \"stop_date\" => \"string\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.update', array(new xmlrpcval($run_id, \"int\"), new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set nombre=\\\"$this->name\\\", razon_social=\\\"$this->razon\\\", status=$this->is_active where id_banco=$this->id_banco\";\n\t\tExecutor::doit($sql);\n\t}", "private function createPlan(){\n if(!$this->request->plan_name || !$this->request->plan_description) {\n return false;\n }\n $this->plan = Planes::create([\n 'name' => $this->request->plan_name,\n 'description' => $this->request->plan_description,\n 'price' => $this->request->price,\n 'product_id' => $this->request->product_id,\n 'balance' => $this->request->balance,\n ]);\n $this->plan = new PlanesFormatter($this->plan);\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'fecha_inicio' => 'required|date',\n 'fecha_fin' => 'required|date|after:now',\n 'paciente_id' => 'required|exists:users,id',\n 'nutricionista_id' => 'required|exists:users,id'\n\n\n ]);\n\n $plan= Plan::find($id);\n $plan->fill($request->all());\n\n $plan->save();\n\n flash('Plan modificado correctamente');\n\n return redirect()->route('plans.index');\n }", "public function update(Request $request, MemberShipPlan $membeship_plan)\n {\n if(config('app.dev_mode') == false) \n return back()->with('warning', trans('messages.dev_restriction'));\n \n if( $membeship_plan->update($request->all()) )\n return back()->with('success', trans('messages.updated', ['model' => $this->model_name]));\n\n return back()->with('error', trans('messages.failed'));\n }", "public function UsePlan($plan_id) {\n\t\t$this->Param('plan_id', $plan_id, 'recur');\n\n\t\treturn true;\n\t}", "public function change_delivery_plan_for_one_date(Request $request)\n {\n $plans_data = $request->input('plans_data');\n\n $order_ctrl = new OrderCtrl();\n\n $count = 0;\n $success_count = 0;\n\n $messages = [];\n\n foreach ($plans_data as $plan_data) {\n $plan_id = $plan_data[0];\n $origin = $plan_data[1];\n $change = $plan_data[2];\n $count++;\n\n $plan = MilkManDeliveryPlan::find($plan_id);\n\n $order_id = $plan->order_id;\n $diff = $change - $origin;\n $result = $order_ctrl->change_delivery_plan($order_id, $plan_id, $diff);\n if ($result['status'] == \"success\") {\n $success_count++;\n } else {\n $message = $result['message'];\n $messages[$count] = $message;\n }\n }\n\n if ($count == $success_count) {\n return response()->json(['status' => 'success']);\n } else {\n return response()->json(['status' => 'fail', 'messages' => $messages]);\n }\n }", "public function update(PlanningStoreRequest $request, $id)\n {\n \n$Planning=Planning::get()->where('id',$id)->first();\n if($Planning->update($request->toArray())) {\n return new PlanningResource($Planning);\n }\n }", "function TogglePlanStatus()\n\t{\n\t\t// Check user authorization and permissions\n\t\tAuthenticatedUser()->CheckAuth();\n\t\tAuthenticatedUser()->PermissionOrDie(PERMISSION_RATE_MANAGEMENT | PERMISSION_ADMIN);\n\n\t\t$bolGOD\t= AuthenticatedUser()->UserHasPerm(PERMISSION_GOD);\n\n\t\tif (!DBO()->RatePlan->Load())\n\t\t{\n\t\t\tAjax()->AddCommand(\"Alert\", \"ERROR: Could not find RatePlan with Id: \". DBO()->RatePlan->Id->Value);\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tTransactionStart();\n\n\n\t\t// The status of a RatePlan is stored in the Archived property of the RatePlan table\n\t\tswitch (DBO()->RatePlan->Archived->Value)\n\t\t{\n\t\t\tcase RATE_STATUS_ACTIVE:\n\t\t\t\tDBO()->RatePlan->Archived = RATE_STATUS_ARCHIVED;\n\n\t\t\t\t// Deactivate the Plan Brochure & Auth Script\n\t\t\t\tbreak;\n\n\t\t\tcase RATE_STATUS_ARCHIVED:\n\t\t\t\tDBO()->RatePlan->Archived = RATE_STATUS_ACTIVE;\n\n\t\t\t\t// Reactivate the Plan Brochure & Auth Script\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// Cannot toggle from whatever the status currently is\n\t\t\t\tTransactionRollback();\n\t\t\t\tAjax()->AddCommand(\"Alert\", \"ERROR: The RatePlan's status cannot be changed\");\n\t\t\t\treturn TRUE;\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t// Re/Activate the Plan Brochure & Auth Script\n\t\t\tif (DBO()->RatePlan->brochure_document_id->Value)\n\t\t\t{\n\t\t\t\t$objBrochure\t= new Document(array('id'=>DBO()->RatePlan->brochure_document_id->Value), true);\n\t\t\t\tif ($objBrochure->status_id !== STATUS_ACTIVE)\n\t\t\t\t{\n\t\t\t\t\t$objBrochure->setStatus(STATUS_ACTIVE);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (DBO()->RatePlan->auth_script_document_id->Value)\n\t\t\t{\n\t\t\t\t$objAuthScript\t= new Document(array('id'=>DBO()->RatePlan->auth_script_document_id->Value), true);\n\t\t\t\tif ($objAuthScript->status_id !== STATUS_ACTIVE)\n\t\t\t\t{\n\t\t\t\t\t$objAuthScript->setStatus(STATUS_ACTIVE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $eException)\n\t\t{\n\t\t\tTransactionRollback();\n\t\t\tAjax()->AddCommand(\"Alert\", \"ERROR: Unable to modify the Plan's Brochure and Auth Script\".($bolGOD ? \"\\n\".$eException->__toString() : ''));\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t// Check that the plan isn't one of the default plans for the Customer Group\n\t\tDBL()->default_rate_plan->rate_plan = DBO()->RatePlan->Id->Value;\n\t\tDBL()->default_rate_plan->Load();\n\t\tif (DBL()->default_rate_plan->RecordCount() > 0)\n\t\t{\n\t\t\tTransactionRollback();\n\t\t\tAjax()->AddCommand(\"Alert\", \"ERROR: This Plan is being used as a default rate plan and cannot have its status changed\");\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t// Save the changes\n\t\tif (!DBO()->RatePlan->Save())\n\t\t{\n\t\t\tTransactionRollback();\n\t\t\tAjax()->AddCommand(\"Alert\", \"ERROR: Saving the status change failed, unexpectedly. Please notify your system administrator\");\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t$strSuccessMsg = \"Status change was successful\";\n\n\t\tif (DBO()->AlternateRatePlan->Id->Value && DBO()->RatePlan->Archived->Value == RATE_STATUS_ARCHIVED)\n\t\t{\n\t\t\t// Associate the Alternate RatePlan with all the dealers that are associated with the rate plan which was just archived\n\t\t\t$intArchivedPlanId\t= DBO()->RatePlan->Id->Value;\n\t\t\t$intAlternatePlanId\t= DBO()->AlternateRatePlan->Id->Value;\n\n\t\t\t$objQuery = new Query();\n\n\t\t\t$strQuery = \"\tINSERT INTO dealer_rate_plan (dealer_id, rate_plan_id)\n\t\t\t\t\t\t\tSELECT DISTINCT drp.dealer_id, $intAlternatePlanId\n\t\t\t\t\t\t\tFROM (\tSELECT dealer_id\n\t\t\t\t\t\t\t\t\tFROM dealer_rate_plan\n\t\t\t\t\t\t\t\t\tWHERE dealer_id IN (SELECT dealer_id FROM dealer_rate_plan WHERE rate_plan_id = $intArchivedPlanId)\n\t\t\t\t\t\t\t\t\tAND dealer_id NOT IN (SELECT dealer_id FROM dealer_rate_plan WHERE rate_plan_id = $intAlternatePlanId)\n\t\t\t\t\t\t\t\t) AS drp;\n\t\t\t\t\t\t\t\";\n\t\t\tif ($objQuery->Execute($strQuery) === FALSE)\n\t\t\t{\n\t\t\t\tTransactionRollback();\n\t\t\t\tAjax()->AddCommand(\"Alert\", \"ERROR: Could not add records to the dealer_rate_plan table to associate the alternate plan\");\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\tTransactionCommit();\n\n\t\t// Update the status of the RatePlan in the Sales database, if there is one\n\t\tif (Flex_Module::isActive(FLEX_MODULE_SALES_PORTAL))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tCli_App_Sales::pushAll();\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t// Pushing the data failed\n\t\t\t\t$strSuccessMsg .= \"<br /><span class='warning'>WARNING: Pushing the data from Flex to the Sales database, failed. Contact your system administrators to have them manually trigger the data push.<br />Error message: \". htmlspecialchars($e->getMessage()) .\"</span>\";\n\t\t\t}\n\t\t}\n\n\t\t// Everything worked\n\t\tAjax()->AddCommand(\"AlertReload\", $strSuccessMsg);\n\n\t\treturn TRUE;\n\t}", "static public function ctrEditarPlan()\n\t{ \n\t\tif(isset($_POST[\"editarescuela\"]))\n\t\t{\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarescuela\"])){\n\n\n\t\t\t \t$tabla = \"planes\";\n\t\t\t \t$datos = array(\"editescuela\" => $_POST[\"editarescuela\"],\n\t\t\t \t\t\t\t\t\"escactual\" => $_POST[\"EscuelaActual\"],\n\t\t\t \t\t\t\t\t\"editclave\" => $_POST[\"editarclave\"],\n\t\t\t \t\t\t\t\t\"editfecha\" => $_POST[\"editarfecha\"]);\n\n\t\t\t \t$respuesta = ModeloPlanes::mdlEditarPlan($tabla,$datos);\n\n\t\t\t \tif($respuesta == \"ok\"){\n\t\t\t \t\techo '<script> \n\t \t\t\t\t\tswal({\n\t \t\t\t\t\t\ttype: \"success\",\n\t \t\t\t\t\t\ttitle: \"¡La clase ha sido cambiada correctamente!\",\n\t \t\t\t\t\t\tshowConfirmButton: true,\n\t \t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t \t\t\t\t\t\tcloseOnConfirm: false\n\n\t \t\t\t\t\t}).then((result)=>{\n\t \t\t\t\t\t\tif(result.value)\n\t \t\t\t\t\t\t{\n\t \t\t\t\t\t\t\twindow.location = \"PlanCurricular\";\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\t});\n\n\t \t\t\t\t \t</script>';\n\t\t\t \t}\n\n\t\t\t}else{\n\t\t\t\techo '<script> \n \t\t\t\t\tswal({\n \t\t\t\t\t\ttype: \"error\",\n \t\t\t\t\t\ttitle: \"¡La clase no puede ir vacia o llevar caracteres especiales!\",\n \t\t\t\t\t\tshowConfirmButton: true,\n \t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n \t\t\t\t\t\tcloseOnConfirm: false\n\n \t\t\t\t\t}).then((result)=>{\n \t\t\t\t\t\tif(result.value)\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\twindow.location = \"PlanCurricular\";\n \t\t\t\t\t\t}\n \t\t\t\t\t\t});\n\n \t\t\t\t </script>';\n\t\t\t}\n\t\t}\n\t}", "public function update(EditFacilityPlanRequest $request, $id)\n {\n \t$facilityKeys= ArrayCheckHelper::ignoreRepeated($request->all(), \"facility\");\n \t\n \t/*foreach($request->all() as $key => $val){\n \t\tif($key !== \"_token\" && $key !==\"name\")\n \t\t\t$facilityKeys[]= $val;\n \t}*/\n \t\n \t\n \t$facility_plan= FacilityPlan::find($id);\n \t$facility_plan->fill($request->all());\n \t$facility_plan->save();\n \t \n \t$facility_plan->facilities()->sync($facilityKeys);\n \n $message= $facility_plan->name . ' updated succesfully';\n if($request->ajax()){\n \treturn $message;\n }\n Session::flash('message',$message);\n return redirect()->route('admin.facility_plans.index');\n }", "public function testUpdateExternalShipment()\n {\n }", "public function testUpdateFinancialStatementUsingPut()\n {\n }", "public function SetPlan(SetPlan $parameters)\n {\n return $this->__soapCall('SetPlan', array($parameters));\n }", "public function run()\n {\n Plan::create([\n \t'name' => 'Free Plan',\n\t\t\t'plan_identifier' => 'free_plan',\n\t\t\t'limit_list' => 3,\n\t\t\t'limit_space' => 1500,\n\t\t\t'price' => 0\n ]); \n }", "public function adminPlanItemConfigUpdate($planItem)\n {\n $settings = $_POST['auction'];\n\n if (is_array($settings) && isset($settings['form_submitted'])) {\n $allow_buy_now = (int)$settings['allow_buy_now'];\n $allow_buy_now_only = ($allow_buy_now) ? $settings['allow_buy_now_only'] : 0; // if allow_buy_now not on, force to be false\n $planItem->set('allow_buy_now', $allow_buy_now);\n $planItem->set('allow_buy_now_only', $allow_buy_now_only);\n\n $buy_now_only_none_left = (isset($settings['buy_now_only_none_left']) && in_array($settings['buy_now_only_none_left'], array('close','sold'))) ? $settings['buy_now_only_none_left'] : 'close';\n $planItem->set('buy_now_only_none_left', $buy_now_only_none_left);\n\n //reverse: note that can set to \"false\" since we do not default to be turned on\n $allow_reverse = (isset($settings['allow_reverse']) && $settings['allow_reverse']) ? 1 : false;\n $allow_reverse_buy_now = ($allow_reverse && isset($settings['allow_reverse_buy_now']) && $settings['allow_reverse_buy_now']) ? 1 : false;\n $charge_reverse_final_fees = ($allow_reverse && isset($settings['charge_reverse_final_fees']) && $settings['charge_reverse_final_fees']) ? 1 : false;\n\n $planItem->set('allow_reverse', $allow_reverse);\n $planItem->set('allow_reverse_buy_now', $allow_reverse_buy_now);\n $planItem->set('charge_reverse_final_fees', $charge_reverse_final_fees);\n\n $planItem->set('force_single_quantity', (int)$settings['force_single_quantity']);\n }\n\n return true;\n }", "public function edit($id)\n {\n $user = Auth::user();\n if (!$user || !$user->is_back_user()) {\n return redirect()->intended(route('admin/login'));\n }\n elseif (!$user->can('manage-membership-plans')){\n /*return [\n 'success' => false,\n 'errors' => 'You don\\'t have permission to access this page',\n 'title' => 'Permission Error'];*/\n return redirect()->intended(route('admin/error/permission_denied'));\n }\n\n $the_plan = MembershipPlan::with('price')->with('restrictions')->where('id','=',$id)->get()->first();\n if (!$the_plan){\n $the_plan = false;\n }\n\n $activities = ShopResourceCategory::all()->sortBy('name');\n $restrictions = array();\n $plan_restrictions = MembershipRestriction::with('restriction_title')->where('membership_id','=',$the_plan->id)->orderBy('restriction_id','asc')->get();\n foreach($plan_restrictions as $restriction){\n $formatted = $restriction->format_for_display_boxes();\n\n $restrictions[] = [\n 'id' => $restriction->id,\n 'title' => $restriction->restriction_title->title,\n 'description' => $formatted['description'],\n 'color' => $formatted['color']\n ];\n }\n\n $breadcrumbs = [\n 'Home' => route('admin'),\n 'Administration' => route('admin'),\n 'Back End User' => route('admin'),\n 'Permissions' => '',\n ];\n $text_parts = [\n 'title' => 'Edit Membership - '.$the_plan->name,\n 'subtitle' => '',\n 'table_head_text1' => 'Backend Roles Permissions List'\n ];\n $sidebar_link= 'admin-backend-memberships-all_plans';\n\n return view('admin/membership_plans/edit_plan', [\n 'breadcrumbs' => $breadcrumbs,\n 'text_parts' => $text_parts,\n 'in_sidebar' => $sidebar_link,\n 'membership_plan' => $the_plan,\n 'activities' => $activities,\n 'restrictions' => $restrictions\n ]);\n }", "private function update(\\PDO &$conexion, $idplan, $nombre, $precio, $descripcion)\n {\n $sentencia = $conexion->prepare(\n \"UPDATE plan \n SET nombre = :nombre ,\n precio = :precio ,\n descripcion = :descripcion \n WHERE ( idplan = :idplan );\"\n );\n\n $sentencia->bindParam(\":idplan\", $idplan, PDO::PARAM_INT);\n $sentencia->bindParam(\":nombre\", $nombre, PDO::PARAM_STR);\n $sentencia->bindParam(\":precio\", $precio);\n $sentencia->bindParam(\":descripcion\", $descripcion);\n $sentencia->execute();\n\n $resultado = $sentencia->rowCount();\n\n $sentencia = null;\n\n return $resultado;\n }", "function updateBankAccount($AccountPlanID, $BankAccount) {\n global $_lib;\n if($AccountPlanID && $BankAccount) {\n $dataH = array();\n $dataH['DomesticBankAccount'] = $BankAccount;\n $dataH['AccountPlanID'] = $AccountPlanID;\n $_lib['storage']->store_record(array('data' => $dataH, 'table' => 'accountplan', 'debug' => true));\n }\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",short_name=\\\"$this->short_name\\\",is_active=\\\"$this->is_active\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function updatePlanEvaluation(Request $request, $id)\n {\n $validator = $this->validatorPlanEvaluation($request->all());\n\n if ($validator->fails()) {\n $this->throwValidationException(\n $request, $validator\n );\n }\n\n $plan = Plan::findOrFail($id);\n\n $plan->score = $request->score;\n $plan->completion_time = $request->completion;\n $plan->observations = $request->observations;\n\n $plan->update();\n\n $condition = $plan->condition;\n\n $condition->state_id = trans('globals.condition.finished');\n\n $condition->update();\n\n return self::redirection('plans', trans('plan.evaluation.success'), null, null);\n }", "function createNewEhsPlan() { \n\n if($this->value('type') == \"treatment_plan\" ) {\n\n $_SESSION['type'] = \"treatment_plan\";\n\n $replace['type'] = \"treatment_plan\";\n\n\n } elseif( $this->value('type') == \"finish\" ) {\n\n\t\t\t $_SESSION['type'] = 'finish';\n\n\t\t\t $replace['type'] = \"finish\";\n\n\t\t\t}\n\n\t\t\telse {\n\n\t\t\t\tif(isset($_SESSION['type'])){\n\n\t\t\t\t\tsession_unregister('type');\n\n\t\t\t\t}\n\n\t\t\t\t$replace['type'] = \"\";\n\n\t\t\t}\n\n\t\t$replace['plan_name'] = \"\";\n \n $schd = $this->value('schd');\n $clinicId = $this->clinicInfo('clinic_id');\n if($this->is_corporate($clinicId)==1){\n \n $Ehspatients = $this->get_paitent_list($clinicId);\n }else{\n $Ehspatients = $this->getProviderEHSPatients($clinicId);\n }\n //$Ehspatients = $this->getProviderEHSPatients($clinicId);\n \n $totalEhsPatients = count($Ehspatients);\n if($totalEhsPatients == '0') {\n header(\"location:index.php?action=therapistEhsPatient&ehsunsub=0\");\n } \n if($schd!= '') {\n $replace['schd'] = $schd;\n }\n\t\t\t$replace['plan_id'] = \"\";\n\n\t //For plan edit action only\n\n\t\t\tif($this->value('act') == \"plan_edit\" && $this->value('plan_id') != \"\" ) {\n\n\t\t\t\t$query = \"select * from plan where plan_id = '{$this->value('plan_id')}' \";\n\n\t\t\t\t$result = $this->execute_query($query);\n\n\t\t\t\tif($row = $this->fetch_array($result)){\n\n\t\t\t\t\t$replace['plan_name'] = $row['plan_name'];\n\n\t\t\t\t\t$replace['plan_id'] = $row['plan_id'];\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\telseif ($this->value('plan_id') != \"\") { \n\n\t\t\t\t$replace['plan_name'] = $this->value('plan_name');\n\n\t\t\t\t$replace['plan_id'] = $this->value('plan_id');\n\t\t\t}\n\n\t\t\tif( $this->value('submitted_x') != \"\" ) { \n\n\t\t\t\tif( $this->value('plan_name') == \"\"){\n\n\t\t\t\t\t$error[] = \"Please enter Plan name.\";\n\n\t\t\t\t}\n\n\t\t\t\telse{ \n\n\t\t\t\t\t$flag = 0;\n\t\t\t\n\t\t\t\t\tif(( $_SESSION['type'] == \"treatment_plan\" || $_SESSION['type'] == \"finish\" )) {\n\n\t\t\t\t\t\t$flag = 1;\n\t\t\t\t\t}\n\n if( $flag == 1 ) {\n\n\t\t\t\t\t\tif( $this->value('plan_id') != \"\") {\n\t\t\t\t\t\t\t$query = \" select * from plan where user_id = '{$this->userInfo('user_id')}' and plan_name LIKE '\".addslashes($this->value('plan_name')).\"' and plan_id != '{$this->value('plan_id')}' and patient_id is null and (status = 1 OR status = 2) and ehsFlag= 0 \";//echo \"<br>\";\n\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t $query = \" select * from plan where user_id = '{$this->userInfo('user_id')}' and plan_name LIKE '\".addslashes($this->value('plan_name')).\"' and patient_id is null and (status = 1 OR status = 2) \";\n\t\t\t\t\t\t}\n // echo $query;exit;\n//echo \"<pre>\";exit;\n\t\t\t\t\t\t$result = $this->execute_query($query);\n //echo $this->num_rows($result);exit;\n\t\t\t\t\t\tif($this->num_rows($result) > 0 ){\n\n\t\t\t\t\t\t\t$error[] = \"Plan name already exist.\"; \n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif(isset($error) && count($error) > 0){\n\n\t\t\t\t\t$replace['error'] = $this->show_error($error);\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\n\t\t\t\t\t$data = array(\n\n\t\t\t\t\t\t'plan_name' => $this->value('plan_name'),\n\n\t\t\t\t\t\t'user_id' => $this->userInfo('user_id'),\n\n\t\t\t\t\t\t'user_type' => '2',\n \n 'ehsFlag' => '1',\n\n 'clinicId' => $clinicId,\n\n\t\t\t\t\t\t//'status' => (isset($_SESSION['type']) && $_SESSION['type'] == \"treatment_plan\")?'3':'1',\n 'status' => '4', \n 'unread_plan'=>1\n\n\t\t\t\t\t);\n\n\t\t\t\t\tif($this->value('plan_id') && $schd == 'edit'){ //echo \"abasdasdc\";exit;\n\n\t\t\t\t\t\t$where = \" plan_id = '{$this->value('plan_id')}' \";\n \n\n\t\t\t\t\t\t$data['modified'] = date(\"Y-m-d\");\n $schd = $this->value('schd');\n if($schd == 'edit') {\n $data['schdulerAction'] = '2';\n } else {\n $data['schdulerAction'] = '1';\n } \n $data['status'] = '1';\n \n\t\t\t\t\t\t$this->update($this->config['table']['plan'],$data,$where);\n\n\t\t\t\t\t\theader(\"location:index.php?action=selectEhsTreatment&plan_id={$this->value('plan_id')}\");\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse{ \n//echo \"abc\";exit;\n\t\t\t\t\t\t$data['creation_date'] = date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\t$data['modified'] = date(\"Y-m-d H:i:s\");\n $data['is_public'] = null;\n $data['schdulerAction'] = '1';\n $data['clinicId'] = $clinicId;\n $data['parent_template_id'] =$this->value('plan_id');\n \n\t\t\t\t\t\tif($this->insert($this->config['table']['plan'],$data)){\n\n\t\t\t\t\t\t\t$plan_id = $this->insert_id();\n if($this->value('plan_id')!= '') {\n /* check for plan_treatment */\n $sqlplanTreatment=\"select * from plan_treatment where plan_id=\".$this->value('plan_id');\n $resplanTreatment=$this->execute_query($sqlplanTreatment);\n $numplanTreatment=$this->num_rows($resplanTreatment);\n if($numplanTreatment>0){\n while($rowplanTreatment=$this->fetch_array($resplanTreatment)){\n $arrayPlanTreatment=array(\n 'plan_id' => $plan_id,\n 'treatment_id' => $rowplanTreatment['treatment_id'],\n 'instruction' => $rowplanTreatment['instruction'],\n 'sets' => $rowplanTreatment['sets'],\n 'reps' => $rowplanTreatment['reps'],\n 'hold' => $rowplanTreatment['hold'],\n 'benefit' => $rowplanTreatment['benefit'],\n 'lrb' => $rowplanTreatment['lrb'],\n 'treatment_order' => $rowplanTreatment['treatment_order'],\n 'creation_date' => date(\"Y-m-d H:i:s\"),\n 'status' => 1\n );\n $this->insert('plan_treatment',$arrayPlanTreatment); \n }\n }\n\n /* check for plan_article */\n $sqlPlanArticle=\"select * from plan_article where plan_id=\".$this->value('plan_id');\n $resPlanArtical=$this->execute_query($sqlPlanArticle);\n $numPlanArtical=$this->num_rows($resPlanArtical);\n if($numPlanArtical>0){\n while($rowPlanArtical=$this->fetch_array($resPlanArtical)){\n $arrayPlanArtical=array(\n 'plan_id'=>$plan_id,\n 'article_id'=>$rowPlanArtical['article_id'],\n 'creation_date'=>date(\"Y-m-d H:i:s\"),\n 'status'=>1\n );\n $this->insert('plan_article',$arrayPlanArtical); \n \n }\n \n }\n\n\n }\n \n \n\t\t\t\t\t\t\theader(\"location:index.php?action=selectEhsTreatment&plan_id={$plan_id}\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$replace['header'] = $this->build_template($this->get_template(\"header\"));\n\n\t\t\t$replace['footer'] = $this->build_template($this->get_template(\"footer\"));\n\n\t\t\t$replace['sidebar'] = $this->sidebar();\n\n\t\t\t$replace['footer'] = $this->build_template($this->get_template(\"footer\"));\n\t\t\t\n\t\t \n\t\t\t$replace['get_satisfaction'] = $this->get_satisfaction();\n\t\t\t \n\n\t\t\t$nav_bar = array(\n\n\t\t\t\t\t\t\t\t'plan' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=createNewEhsPlan&act=plan_edit&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/01_plan_gray.gif\" /></a>':'<img src=\"images/01_plan_gray.gif\" />',\n\n\t\t\t\t\t\t\t\t'step1' => ($this->value('plan_id') != \"\")?'<img src=\"images/stepIcons_1_red_sm.gif\">':'<img src=\"images/stepIcons_1_red_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step2' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=selectEhsTreatment&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_2_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_2_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step3' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=customize_instruction_ehs&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_3_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_3_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step4' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=customize_articles_ehs&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_4_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_4_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t);\n\n\t\t\tif(is_array($replace)){\n\n\t\t\t\t$replace = $replace + $nav_bar;\n\n\t\t\t}\n\n\t\t\t\n\n\n\n\t\t\t$replace['patient_image'] = '<img src=\"images/03_patient_gray.gif\" />';\n\n\t\t\t$replace['assign_image'] = '<img src=\"images/04_assign_gray.gif\" />';\n\n\t\t\t// Personalized GUI\n $LabelTitle=$_SESSION['providerLabel']['My Template Plans']!=''?$_SESSION['providerLabel']['My Template Plans']:\"MY TX PLANS\";\n $replace['path_name'] = strtoupper($LabelTitle);\n\n\t\t\t$replace['body'] = $this->build_template($this->get_template(\"createNewPlan\"),$replace);\n\n\t\t\t$replace['browser_title'] = \"Tx Xchange: Create New Plan\";\n\n\t\t\t$this->output = $this->build_template($this->get_template(\"main\"),$replace);\n\n\t\t}", "public function updateProjectRequirementActual($id){\n\n $req = request()->all();\n\n DB::table('tblprojectrequirements')\n ->where('tblprojectrequirements.intRequirementId','=', $req['projectRequirementId'])\n ->update(['decActualPrice' => $req['actualPrice']]);\n\n\n header('Refresh:0;/Engineer/Engineer-Projects/'.$id.'/Actuals');\n }", "public function updateApprovalProjectPlanOtherCost(Request $request)\n {\n $data = $request->json()->all();\n DB::beginTransaction();\n try {\n $cost = Cost::find($data['cost_id']);\n $cost->status = $data['status'];\n $cost->approval_date = Carbon::now();\n $cost->approved_by = Auth::user()->id;\n if (!$cost->update()) {\n return response([\"error\" => \"Failed to save, please try again!\"], Response::HTTP_OK);\n } else {\n DB::commit();\n return response([\"response\" => \"Success to Update Cost\"], Response::HTTP_OK);\n }\n } catch (\\Exception $e) {\n DB::rollback();\n return response([\"error\" => $e->getMessage()], Response::HTTP_OK);\n }\n }", "public function create_plan($requestData){\n \n // ### Create Plan\n try {\n // Create a new instance of Plan object\n $plan = new Plan();\n if(isset($requestData['plan'])){\n $this->setArrayToMethods($this->checkEmptyObject($requestData['plan']), $plan);\n } \n // # Payment definitions for this billing plan.\n $paymentDefinition = new PaymentDefinition(); \n $paymentDefinition\n ->setAmount(new Currency($requestData['paymentDefinition']['Amount']));\n array_pop($requestData['paymentDefinition']);\n if(!empty($this->checkEmptyObject((array)$paymentDefinition))){\n $this->setArrayToMethods(array_filter($requestData['paymentDefinition']), $paymentDefinition); \n }\n \n // Charge Models\n $chargeModel = new ChargeModel();\n $chargeModel->setAmount(new Currency($requestData['chargeModel']['Amount']));\n array_pop($requestData['chargeModel']);\n if(!empty($this->checkEmptyObject((array)$chargeModel))){\n $this->setArrayToMethods(array_filter($requestData['chargeModel']), $chargeModel); \n $paymentDefinition->setChargeModels(array($chargeModel));\n }\n \n $merchantPreferences = new MerchantPreferences();\n $baseUrl = $requestData['baseUrl'];\n\n $merchantPreferences->setReturnUrl($baseUrl.$requestData['ReturnUrl'])\n ->setCancelUrl($baseUrl.$requestData['CancelUrl']);\n if(!empty($this->checkEmptyObject($requestData['merchant_preferences']['SetupFee']))){\n $merchantPreferences->setSetupFee(new Currency($requestData['merchant_preferences']['SetupFee']));\n }\n array_pop($requestData['merchant_preferences']);\n \n if(isset($requestData['merchant_preferences'])){\n $this->setArrayToMethods($this->checkEmptyObject($requestData['merchant_preferences']), $merchantPreferences);\n }\n if(!empty($this->checkEmptyObject((array)$paymentDefinition))){\n $plan->setPaymentDefinitions(array($paymentDefinition));\n }\n if(!empty($this->checkEmptyObject((array)$merchantPreferences))){\n $plan->setMerchantPreferences($merchantPreferences);\n } \n $requestArray= clone $plan;\n $output = $plan->create($this->_api_context); \n $returnArray['RESULT'] = 'Success';\n $returnArray['PLAN'] = $output->toArray();\n $returnArray['RAWREQUEST']=$requestArray->toJSON();\n $returnArray['RAWRESPONSE']=$output->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }", "public function show(Plan $plan)\n {\n //\n }", "function copyExistingEhsPlan(){\n\t\t\tif( $this->value('type') == \"finish\" ){\n\n\t\t\t\t$_SESSION['type'] = 'finish';\n\n\t\t\t\t$replace['type'] = \"finish\";\n }\n\n\t\t\telse{\n\n\t\t\t\tif(isset($_SESSION['type'])){\n\n\t\t\t\t\tsession_unregister('type');\n\n\t\t\t\t}\n\n\t\t\t\t$replace['type'] = \"\";\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t$replace['plan_name'] = \"\";\n\n\t\t\t$replace['plan_id'] = \"\";\n\n\t\t\tif($this->value('act') == \"plan_edit\" && $this->value('plan_id') != \"\" ){\n\n\t\t\t\t$query = \"select * from plan where plan_id = '{$this->value('plan_id')}' \";\n\n\t\t\t\t$result = $this->execute_query($query);\n\n\t\t\t\tif($row = $this->fetch_array($result)){\n\n\t\t\t\t\t$replace['plan_name'] = $row['plan_name'];\n\n\t\t\t\t\t$replace['plan_id'] = $row['plan_id'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telseif ($this->value('plan_id') != \"\"){\n\n\t\t\t\t$replace['plan_name'] = $this->value('plan_name');\n\n\t\t\t\t$replace['plan_id'] = $this->value('plan_id');\n\t\t\t}\n\n\t\t\tif( $this->value('submitted_x') != \"\" ){\n\n\t\t\t\t//print_r($_POST);exit;\n\n\t\t\t\tif( $this->value('plan_name') == \"\"){\n\n\t\t\t\t\t$error[] = \"Please enter Plan name.\";\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\t\t$query = \" select * from plan where plan_name = '\".addslashes($this->value('plan_name')).\"'\";\n\t\t\t\t\t\t$result = $this->execute_query($query);\n\t\t\t\t\t\tif($this->num_rows($result) > 0 ){\n\t\t\t\t\t\t\t$error[] = \"The plan name already exists. Please use a different one.\"; \n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(isset($error) && count($error) > 0){\n\n\t\t\t\t\t$replace['error'] = $this->show_error($error);\n\n\t\t\t\t}\n\n\t\t\t\telse{\n $notify = $this->value('notify');\n if($notify > 0) {\n $notify = $this->value('notify');\n\n } else {\n $notify = '0';\n } \t\t\t\t\t \n $query = \" select * from plan where plan_id = \".$this->value('plan_id');\n\t\t\t\t\t\t$sourceResult = $this->execute_query($query);\n\t\t\t\t\t\t$sourceRow = $this->fetch_array($sourceResult);\n\t\t\t\t\t\t$sourceData = array(\n\t\t\t\t\t\t\t\t\t'plan_name' => $this->value('plan_name'),\n\t\t\t\t\t\t\t\t\t'parent_template_id' => $sourceRow['parent_template_id'],\n\t\t\t\t\t\t\t\t\t'user_id' => $this->userInfo('user_id'),\n\t\t\t\t\t\t\t\t\t'patient_id' => $sourceRow['patient_id'],\n\t\t\t\t\t\t\t\t\t'user_type' => 2,\n\t\t\t\t\t\t\t\t\t'status' => 4,\n 'ehsFlag' => '1',\n 'schdulerAction' => '1',\n\t\t\t\t\t\t\t\t\t'unread_plan'=>1\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\n $sourceData['old_plan_id'] = $this->value('plan_id');\n\t\t\t\t\t\t$sourceData['creation_date'] = date(\"Y-m-d H:i:s\");\n\t\t\t\t\t\t$sourceData['modified'] = date(\"Y-m-d H:i:s\");\n $sourceData['is_public'] = null;\n\n\t\t\t\t\t\tif($this->insert($this->config['table']['plan'],$sourceData)){\n\t\t\t\t\t\t\t$new_plan_id = $this->insert_id();\n /* check for plan_article */\n $sqlPlanArticle=\"select * from plan_article where plan_id=\".$this->value('plan_id');\n $resPlanArtical=$this->execute_query($sqlPlanArticle);\n $numPlanArtical=$this->num_rows($resPlanArtical);\n if($numPlanArtical>0){\n while($rowPlanArtical=$this->fetch_array($resPlanArtical)){\n $arrayPlanArtical=array(\n 'plan_id'=>$new_plan_id,\n 'article_id'=>$rowPlanArtical['article_id'],\n 'creation_date'=>date(\"Y-m-d H:i:s\"),\n 'status'=>1\n );\n $this->insert('plan_article',$arrayPlanArtical); \n \n }\n \n }\n /* check for plan_treatment */\n $sqlplanTreatment=\"select * from plan_treatment where plan_id=\".$this->value('plan_id');\n $resplanTreatment=$this->execute_query($sqlplanTreatment);\n $numplanTreatment=$this->num_rows($resplanTreatment);\n if($numplanTreatment>0){\n while($rowplanTreatment=$this->fetch_array($resplanTreatment)){\n $arrayPlanTreatment=array(\n 'plan_id' => $new_plan_id,\n 'treatment_id' => $rowplanTreatment['treatment_id'],\n 'instruction' => $rowplanTreatment['instruction'],\n 'sets' => $rowplanTreatment['sets'],\n 'reps' => $rowplanTreatment['reps'],\n 'hold' => $rowplanTreatment['hold'],\n 'benefit' => $rowplanTreatment['benefit'],\n 'lrb' => $rowplanTreatment['lrb'],\n 'treatment_order' => $rowplanTreatment['treatment_order'],\n 'creation_date' => date(\"Y-m-d H:i:s\"),\n 'status' => 1\n );\n $this->insert('plan_treatment',$arrayPlanTreatment); \n }\n }\n \n \n \n //Updating the copied plan to status archive '2'\n\t\t\t\t\t\t\t$where = \" plan_id = '{$this->value('plan_id')}' \";\n\t\t\t\t\t\t\t//$updateData['status'] = '2';\n //$updateData['old_plan_id'] = $this->value('plan_id');\n\t\t\t\t\t\t\t$updateData['modified'] = date(\"Y-m-d\");\n\t\t\t\t\t\t\t$this->update($this->config['table']['plan'],$updateData,$where);\n\t\t\t\t\t\t\theader(\"location:index.php?action=selectEhsTreatment&plan_id={$new_plan_id}\");\n\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$replace['header'] = $this->build_template($this->get_template(\"header\"));\n\n\t\t\t$replace['footer'] = $this->build_template($this->get_template(\"footer\"));\n\n\t\t\t$replace['sidebar'] = $this->sidebar();\n\n\t\t\t$replace['footer'] = $this->build_template($this->get_template(\"footer\"));\n\t\t\t\n\t\t \n\t\t\t$replace['get_satisfaction'] = $this->get_satisfaction();\n\t\t\t \n\n\t\t\t$nav_bar = array(\n\n\t\t\t\t\t\t\t\t'plan' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=createNewEhsPlan&act=plan_edit&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/01_plan_gray.gif\" /></a>':'<img src=\"images/01_plan_gray.gif\" />',\n\n\t\t\t\t\t\t\t\t'step1' => ($this->value('plan_id') != \"\")?'<img src=\"images/stepIcons_1_red_sm.gif\">':'<img src=\"images/stepIcons_1_red_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step2' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=selectEhsTreatment&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_2_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_2_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step3' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=customize_instruction_ehs&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_3_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_3_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step4' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=customize_articles_ehs&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_4_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_4_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t);\n\n\t\t\tif(is_array($replace)){\n\n\t\t\t\t$replace = $replace + $nav_bar;\n\n\t\t\t}\n\n\t\t\t\n\n\n\n\t\t\t$replace['patient_image'] = '<img src=\"images/03_patient_gray.gif\" />';\n\n\t\t\t$replace['assign_image'] = '<img src=\"images/04_assign_gray.gif\" />';\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t$replace['body'] = $this->build_template($this->get_template(\"createNewPlan\"),$replace);\n\n\t\t\t$replace['browser_title'] = \"Tx Xchange: Create New Plan\";\n\n\t\t\t$this->output = $this->build_template($this->get_template(\"main\"),$replace);\n\n\t\t}", "function assigned_plan_patient_ehs() { \n\n\t\t //assign plan to patient\n \n\t\t\tif( $this->value('plan_id') != \"\") {\n\n $notify = $this->value('notify');\n if($notify > 0) {\n $notify = $this->value('notify');\n\n } else {\n $notify = '0';\n }\n\n $clinicId = $this->clinicInfo('clinic_id');\n\n\t\t\t\tif( $_SESSION['type'] == \"treatment_plan\" ){ \n\n\t\t\t\t\tif( $this->value('plan_id') != \"\"){\n\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t\t\t'user_type' => 2,\n\n 'ehsFlag' => 1,\n\n\t\t\t\t\t\t\t\t\t'modified' => date(\"Y-m-d\"),\n\n\t\t\t\t\t\t\t\t\t'status' => 1\n\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t$where = \" plan_id = '{$this->value('plan_id')}'\";\n\n\t\t\t\t\t\tif($this->update($this->config['table']['plan'],$data,$where)){\n\n\t\t\t\t\t\t\t//echo \"create new treatment plan successfull updation\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\theader(\"location:index.php?action=therapistEhsPatient&mass=plan\");\n\n\t\t\t\t\texit();\n\n\t\t\t\t}\n\n\t\t\t\t\n //echo $_SESSION['type'];exit;\n\t\t\t\tif( $_SESSION['type'] == \"finish\" ) { \n\n\n\t\t\t\t\tif( $this->value('plan_id') != \"\" ){\n\n\t\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t\t\t'user_type' => 2,\n\n 'ehsFlag' => '1',\n\n 'clinicId' => $clinicId,\n\n 'scheduler_status' => '1',\n\n 'notify' => $notify,\n\n\t\t\t\t\t\t\t\t\t'modified' => date(\"Y-m-d\"),\n\n\t\t\t\t\t\t\t\t\t'status' => '4'\n\n\t\t\t\t\t\t\t\t);\n \n \n\n\t\t\t\t\t\t$where = \" plan_id = '{$this->value('plan_id')}'\";\n\n\t\t\t\t\t\tif($this->update($this->config['table']['plan'],$data,$where)){\n\n //Archive the old plan whose copy is made\n $sqlArchiveoldPlan = \"SELECT * FROM plan WHERE plan_id = '{$this->value('plan_id')}' AND old_plan_id IS NOT NULL\";\n $rsArchive = $this->execute_query($sqlArchiveoldPlan);\n $numrowArchive = $this->num_rows($rsArchive);\n if($numrowArchive > 0) {\n $rowArchive = mysql_fetch_assoc($rsArchive);\n $old_plan_id = $rowArchive['old_plan_id'];\n $where1 = \" plan_id = '{$old_plan_id}'\";\n $updateData['status'] = '2';\n\t\t\t\t\t\t\t $updateData['modified'] = date(\"Y-m-d\");\n\t\t\t\t\t\t\t $this->update($this->config['table']['plan'],$updateData,$where1); \n\n // $ehsPatientArr = $this->getProviderEHSPatients($clinicId);\n if($this->is_corporate($clinicId)==1){\n \n $ehsPatientArr= $this->get_paitent_list($clinicId);\n }else{\n $ehsPatientArr= $this->getProviderEHSPatients($clinicId);\n }\n $patientCount = count($ehsPatientArr);\n $pat = 0;\n while($pat < $patientCount) { \n $query1 = \"update plan set status = '2' where parent_template_id = {$rowArchive['old_plan_id']} AND patient_id = '$ehsPatientArr[$pat]' \";\n $result1 = $this->execute_query($query1);\n $pat++;\n } \n }\n\n //End here\n\n\t\t\t\t\t\t\theader(\"location:index.php?action=therapistEhsPatient&mass=plan\");\n\n\t\t\t\t\t exit();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t//header(\"location:index.php?action=therapistEhsPatient\");\n\n\t\t\t\t\t//exit();\n\n\t\t\t\t}\n\n $query = \"select * from plan where plan_id = '{$this->value('plan_id')}' \";\n\t\t\t\t$plan_result = $this->execute_query($query);\n\n\t\t\t\tif(is_resource($plan_result)){\n\n $row = mysql_fetch_assoc($plan_result);\n\n $data = array(\n\t\t\t\t\t\t'clinicId' => $clinicId,\n\n 'plan_name' => $row['plan_name'],\n\n 'parent_template_id' => $row['plan_id'],\n \n 'user_id' => $this->userInfo('user_id'),\n\n\t\t\t\t\t 'user_type' => '2',\n\n 'scheduler_status' => '1',\n\n 'notify' => $notify,\n \n 'ehsFlag' => '1',\n \n 'schdulerAction' => '1',\n \n\t\t\t\t\t 'creation_date' => date(\"Y-m-d\"),\n\n\t\t\t\t\t 'modified_date' => date(\"Y-m-d\"),\n\n\t\t\t\t\t 'status' => '4'\n\n\t\t\t\t\t);\n\n if($this->insert($this->config['table']['plan'],$data)){\n\n\t\t\t\t\t\t$new_plan_id = $this->insert_id();\n\n\t\t\t\t\t\t// copy all treatments associated with plan to new plan id.\n\n\t\t\t\t\t\t$query = \"select * from plan_treatment where plan_id = '{$this->value('plan_id')}' \";\n\n\t\t\t\t\t\t$plan_treatment = $this->execute_query($query);\n\n\t\t\t\t\t\twhile($row = $this->fetch_array($plan_treatment)){\n\n\t\t\t\t\t\t\t$data = array(\n\n\t\t\t\t\t\t\t\t\t\t'plan_id' => $new_plan_id,\n\n\t\t\t\t\t\t\t\t\t\t'treatment_id' => $row['treatment_id'],\n\n\t\t\t\t\t\t\t\t\t\t'instruction' => $row['instruction'],\n\n\t\t\t\t\t\t\t\t\t\t'sets' => $row['sets'],\n\n\t\t\t\t\t\t\t\t\t\t'reps' => $row['reps'],\n\n\t\t\t\t\t\t\t\t\t\t'hold' => $row['hold'],\n\n\t\t\t\t\t\t\t\t\t\t'benefit' => $row['benefit'],\n\n\t\t\t\t\t\t\t\t\t\t'lrb' => $row['lrb'],\n\n\t\t\t\t\t\t\t\t\t\t'treatment_order' => $row['treatment_order'],\n\n\t\t\t\t\t\t\t\t\t\t'creation_date' => date(\"Y-m-d\"),\n\n\t\t\t\t\t\t\t\t\t\t'modified' => date(\"Y-m-d\"),\n\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$this->insert($this->config['table']['plan_treatment'],$data);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// copy all articles associated with plan to new plan id.\n\n\t\t\t\t\t\t$query = \"select * from plan_article where plan_id = '{$this->value('plan_id')}' \";\n\n\t\t\t\t\t\t$plan_article = $this->execute_query($query);\n\n\t\t\t\t\t\twhile($row = $this->fetch_array($plan_article)){\n\n\t\t\t\t\t\t\t$data = array(\n\n\t\t\t\t\t\t\t\t\t\t'plan_id' => $new_plan_id,\n\n\t\t\t\t\t\t\t\t\t\t'article_id' => $row['article_id'],\n\n\t\t\t\t\t\t\t\t\t\t'creation_date' => date(\"Y-m-d\"),\n\n\t\t\t\t\t\t\t\t\t\t'modified' => date(\"Y-m-d\"),\n\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$this->insert($this->config['table']['plan_article'],$data);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($this->value('url') == \"createNewPlan\" ){\n\n\t\t\t\t\t\t\theader(\"location:index.php?action=createNewEhsPlan&type=finish&act=plan_edit&plan_id={$new_plan_id}\");\n\n\t\t\t\t\t\t\texit();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\theader(\"location:index.php?action=therapistEhsPatient&mass=plan\");\n\n\t\t\t\t\t}\n\n\n\n \n \n \n }\n\n\t\t\t}\n\n\t\t}", "function addPlanId($id, $planid) // user_cancel_subscription.php, user_charge_subscription.php\r\n\r\n{\r\n\r\n\tglobal $mysqli,$db_table_prefix;\r\n\r\n\t$stmt = $mysqli->prepare(\"UPDATE \".$db_table_prefix.\"users\r\n\r\n\t\tSET\r\n\r\n\t\tplan_id = ?\r\n\r\n\t\tWHERE\r\n\r\n\t\tid = ?\");\r\n\r\n\t$stmt->bind_param(\"si\", $planid, $id);\r\n\r\n\t$result = $stmt->execute();\r\n\r\n\t$stmt->close();\r\n\r\n\treturn $result;\r\n\r\n}", "public function edit($id)\n {\n\n $page_title = \"Update STO\";\n $time = TimeSetting::all();\n $plan = Plan::whereId($id)->first();\n return view('admin.plan.edit', compact('page_title', 'plan','time'));\n }", "function ciniki_sapos_simpleshiprateUpdate(&$ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'rate_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Shipping Rate'),\n 'country'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Country'),\n 'province'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Province'),\n 'city'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'City'),\n 'minimum_amount'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Invoice Total'),\n 'rate'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Shipping Rate'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n if( isset($args['minimum_amount']) ) {\n $args['minimum_amount'] = preg_replace('/[^0-9\\.]/', '', $args['minimum_amount']);\n }\n if( isset($args['rate']) ) {\n $args['rate'] = preg_replace('/[^0-9\\.]/', '', $args['rate']);\n }\n\n //\n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'sapos', 'private', 'checkAccess');\n $rc = ciniki_sapos_checkAccess($ciniki, $args['tnid'], 'ciniki.sapos.simpleshiprateUpdate');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Start transaction\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.sapos');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the Shipping Rate in the database\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n $rc = ciniki_core_objectUpdate($ciniki, $args['tnid'], 'ciniki.sapos.simpleshiprate', $args['rate_id'], $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.sapos');\n return $rc;\n }\n\n //\n // Commit the transaction\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.sapos');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'sapos');\n\n //\n // Update the web index if enabled\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'hookExec');\n ciniki_core_hookExec($ciniki, $args['tnid'], 'ciniki', 'web', 'indexObject', array('object'=>'ciniki.sapos.simpleshiprate', 'object_id'=>$args['rate_id']));\n\n return array('stat'=>'ok');\n}", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'deposit_min' => 'required|integer|min:0',\n 'deposit_max' => 'required|integer|min:0',\n 'term' => 'required|integer|min:0',\n 'percent' => 'required|integer|min:0',\n ]);\n\n $tariff = Plan::findOrFail($id);\n $tariff->name = $request->get('name');\n $tariff->description = '';\n $tariff->deposit_min = $request->get('deposit_min');\n $tariff->deposit_max = $request->get('deposit_max');\n $tariff->term = $request->get('term');\n $tariff->percent = $request->get('percent');\n $tariff->save();\n\n return redirect()->route('plan.index');\n }", "public function postPlanChange(WebsitePlanChangeRequest $request)\n {\n var_dump($request->input('plan'));\n var_dump($request->input('password'));\n var_dump($request->input('website'));\n exit;\n $user = Auth::user();\n $website = Website::find($request->input('website'));\n $plan = Plan::find($request->input('plan'));\n if (!isset($website)) {\n Response::json(['success' => false, 'message' => trans('Site does not exist.')]);\n }\n\n if ($website->user_id != $user->id) {\n Response::json(['success' => false, 'message' => trans('Unauthorized.')]);\n }\n\n if (!Hash::check($request->input('password'), $user->password)) {\n Response::json(['success' => false, 'message' => trans('Wrong password.')]);\n }\n\n $website->subscription(lcfirst($plan->plan))->swap();\n $website->plan_id = $plan->id;\n $website->save();\n\n $emailVariables = [\n 'website' => $website->url,\n 'plan' => $plan\n ];\n\n Mail::send('emails.website.plan', $emailVariables, function($message) use ($user) {\n $message->to($user->email)->subject(trans('We have changed your plan.'));\n });\n\n Response::json(['success' => true, 'message' => trans('Your plan has changed')]);\n }", "public function update(): void\n {\n $this->updateQuality();\n $this->updateSellIn();\n $this->expiresAfterSale();\n }", "public function update(Request $request, Dateplanner $dateplanner)\n {\n //\n }", "function manage_bonus_plans(){}", "public function update(Request $request, $id)\n {\n $datosPlan = request()->except(['_token','_method']);\n PlanMejora::where('id','=',$id)->update($datosPlan);\n return redirect('planes')->with('mensaje','Plan de mejora modificado');\n }", "protected function update() {}", "public function update($id, UpdatePlansRequest $request)\n\t{\n\t\tif($request->file('imagename')){\n\t\t\t$file =\t$request->file('imagename');\n\t\t\t$fileName = $file->getCLientOriginalName();\n\t\t\t$fileExt = $file->getCLientOriginalExtension();\n\t\t\t$fileSize = $file->getSize();\n\n\t\t\t$destination = 'plan/images/';\n\t\t\t$file->move($destination , $fileName);\n\t\t\t$request->merge(['image' => $fileName]);\n\t\t}\n\t\t\n\n\t\t$plans = Plans::findOrFail($id);\n\t\t$plans->update($request->all());\n\n\t\treturn redirect()->route(config('coreadmin.route').'.plans.index');\n\t}", "function update_Portfolio($PortID, $Title, $ShortDescrip, $Descrip) {\r\n// the database to new details in arguments\r\n\r\n $conn = db_connect();\r\n\r\n $query = \"update Portfolio\r\n set Title= '\".$Title.\"',\r\n ShortDescription = '\".$ShortDescrip.\"',\r\n Description = '\".$Descrip.\"'\r\n where PortID = '\".$PortID.\"'\";\r\n\r\n $result = @$conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "public function update(User $user, Plan $plan) {\n return $user->id == $plan->user_id;\n }", "public function update(Request $request, PlanetRelation $planetRelation)\n {\n //\n }", "public function update(Request $request, Plan_four $four)\n {\n Plan_four::find($four->id)->update($request->except('_token', '_method'));\n return back()->with('update_plan', 'Plan Updated successfully!!');\n }" ]
[ "0.7549871", "0.7341028", "0.7189941", "0.70633256", "0.6830342", "0.6800236", "0.6799026", "0.67880315", "0.67170304", "0.66917133", "0.65889215", "0.65039545", "0.6362408", "0.6361475", "0.62863857", "0.6250946", "0.6226422", "0.6207356", "0.61857635", "0.6139623", "0.6132873", "0.6093725", "0.6076156", "0.60654163", "0.6041393", "0.6029033", "0.60183454", "0.5981501", "0.5959102", "0.59224397", "0.59221613", "0.59166825", "0.5875896", "0.5854224", "0.5846393", "0.5840945", "0.5840779", "0.5821702", "0.57956696", "0.5787846", "0.5774627", "0.57645303", "0.5746025", "0.57456785", "0.57382894", "0.5720113", "0.5713086", "0.56881785", "0.5682248", "0.56820226", "0.5646457", "0.5644749", "0.56435394", "0.5638443", "0.56306195", "0.5625828", "0.5566478", "0.5565512", "0.55620015", "0.5540286", "0.55376685", "0.5532028", "0.553137", "0.5514996", "0.549491", "0.54904103", "0.54735744", "0.5471108", "0.54538137", "0.5435521", "0.5427751", "0.5421757", "0.5421273", "0.54192764", "0.541381", "0.54121965", "0.5410983", "0.5406147", "0.540316", "0.54019684", "0.5399298", "0.53963196", "0.5395766", "0.5392278", "0.53921425", "0.53880125", "0.538193", "0.53809047", "0.53722835", "0.5364451", "0.535231", "0.534158", "0.53300977", "0.53241265", "0.53212625", "0.5320609", "0.5315694", "0.53150487", "0.53132635", "0.5312122", "0.53080124" ]
0.0
-1
Function to Delete Plan
public function DeleteExe($exe_id){ $this->db->where('exe_id',$exe_id); $this->db->delete('executive'); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete_plan() {\n if (empty($this->user->admin)) {\n Router::redirect('/');\n die();\n }\n\n # Set up query\n $q = \"DELETE FROM plans\n\t\t\t WHERE plan_id=\".$_POST['plan_id'];\n $plans = DB::instance(DB_NAME)->query($q);\n\n //Return result to jTable\n $jTableResult = array();\n $jTableResult['Result'] = \"OK\";\n print json_encode($jTableResult);\n }", "function delete($id_plan) {\r\n $sql = \"DELETE FROM planes WHERE planes.id_plan ='\" . $id_plan . \"'\";\r\n\r\n $response = getResultSQL($sql);\r\n if (!$response) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "public function destroy(Plan $plan) {\n \n }", "public function plan_delete( $plan_id ) {\r\n\t\treturn $this->_send_request( 'plans/'.$plan_id, array(), STRIPE_METHOD_DELETE );\r\n\t}", "public function deletePlan(Plan $plan){\n $this->open();\n\n $result = $this->query('DELETE FROM '.$this->TABLE_NAME.' WHERE id=:id', array(\n new QueryParam(':id', $plan->id, PDO::PARAM_INT)\n )\n );\n\n $this->close();\n\n return $result;\n }", "public function deletePlan($plan)\n {\n Stripe\\Plan::retrieve($plan->level)->delete();\n }", "public function destroy(Plan $plan)\n {\n //\n }", "public function delete_plan($planId){\n try {\n $createdPlan = new Plan();\n $createdPlan->setId($planId);\n $result = $createdPlan->delete($this->_api_context);\n $returnArray['RESULT'] = 'Success';\n $returnArray['DELETE_PLAN'] = $result->toArray();\n $returnArray['RAWREQUEST']='{id:'.$planId.'}';\n $returnArray['RAWRESPONSE']=$result->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }", "function delete_plan()\n {\n #check user access\n check_user_access($this, 'delete_procurement_plan', 'redirect');\n\n # Get the passed details into the url data array if any\n $urldata = $this->uri->uri_to_assoc(3, array('m', 's'));\n\n # Pick all assigned data\n $data = assign_to_data($urldata);\n\n if(!empty($data['i'])){\n $result = $this->db->query($this->Query_reader->get_query_by_code('deactivate_item', array('item'=>' procurement_plans', 'id'=>decryptValue($data['i'])) ));\n \n #deactivate the entries\n if($result)\n {\n $this->db->where('procurement_plan_id', decryptValue($data['i']));\n $this->db->update('procurement_plan_entries', array('isactive'=>'N'));\n }\n }\n\n if(!empty($result) && $result){\n $this->session->set_userdata('dbid', \"The plan and it's entries have been successfully deleted.\");\n }\n else if(empty($data['msg']))\n {\n $this->session->set_userdata('dbid', \"ERROR: The procurement plan could not be deleted or were not deleted correctly.\");\n }\n\n if(!empty($data['t']) && $data['t'] == 'super'){\n $tstr = \"/t/super\";\n }else{\n $tstr = \"\";\n }\n redirect(base_url().\"procurement/page/m/dbid\".$tstr);\n }", "public function deleted(PlanSubscription $planSubscription)\n {\n //\n }", "function deletePlanModules($conn, $planID){\n\n\t\n\t$sql = \"DELETE FROM plancomponent WHERE PlanId = :planID\";\n\t$sth = $conn->prepare($sql);\n\t\n\t$sth->bindParam(':planID', $planID, PDO::PARAM_INT, 11);\n\t\n\t$sth->execute();\n\t$sth->closeCursor();\n\n}", "function deletePlan($conn){\n\n\tsession_start();\n\t\t$planID = $_SESSION['planID'];\n\tsession_write_close();\n\t\n\tdeletePlanModules($conn, $planID);\n\t\n\t$sql = \"DELETE FROM plan WHERE PlanId = :planID\";\n\t$sth = $conn->prepare($sql);\n\t\n\t$sth->bindParam(':planID', $planID, PDO::PARAM_INT, 11);\n\t\n\t$sth->execute();\n\t$sth->closeCursor();\n\t\n\tsession_start();\n\t\tunset($_SESSION['planID']);\n\tsession_write_close();\n\t\n\t$return = ['message' => 'Successfully deleted the report'];\n\treturn $return;\n\n}", "function deleteInspectedBy($conn, $planID){\n\t$sql = \"DELETE FROM inspectedby WHERE PlanId = :planID\";\n\t$sth = $conn->prepare($sql);\n\t\n\t$sth->bindParam(':planID', $planID, PDO::PARAM_INT, 11);\n\t\n\t$sth->execute();\n\t$sth->closeCursor();\n}", "public function Deleteplan() {\n $plan_id = $this->input->post('plan_id');\n $data = array(\n 'plan_id' => $plan_id\n );\n $this->load->view('admin/plan/delete_plan', $data);\n }", "function deleteServices($conn, $planID){\n\t$sql = \"DELETE FROM planservice WHERE PlanId = :planID\";\n\t$sth = $conn->prepare($sql);\n\t\n\t$sth->bindParam(':planID', $planID, PDO::PARAM_INT, 11);\n\t\n\t$sth->execute();\n\t$sth->closeCursor();\n}", "function delete_predefined_innovation_plan($id)\n {\n $status = $this->db->delete('predefined_innovation_plan', array(\n 'id' => $id\n ));\n $db_error = $this->db->error();\n if (! empty($db_error['code'])) {\n echo 'Database error! Error Code [' . $db_error['code'] . '] Error: ' . $db_error['message'];\n exit();\n }\n return $status;\n }", "public function destroy($id)\n {\n $this->authorize('delete', Plan::class);\n $plan = Plan::findOrFail($id);\n\n //Add the Stripe Api key to create/delete the plan on the stripe dashboard\n //$stripe_plan = \\Stripe\\Plan::retrieve($plan->gateway_id);\n //$stripe_plan->delete();\n\n // Delete the plan on the database\n $plan->delete();\n return redirect()->back()->with(\"status\", \"Your plan has been deleted.\");\n }", "function TestCase_unlink_plan($case_id, $plan_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.unlink_plan', array(new xmlrpcval($case_id, \"int\"), new xmlrpcval($plan_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function destroy(Plan $plan)\n {\n foreach ($plan->grupos as $grupo) {\n $grupo->pivot->delete();\n }\n $plan->delete();\n return $this->index();\n }", "function deleteDateInspected($conn, $planID){\n\t$sql = \"DELETE FROM dateinspected WHERE PlanId = :planID\";\n\t$sth = $conn->prepare($sql);\n\t\n\t$sth->bindParam(':planID', $planID, PDO::PARAM_INT, 11);\n\t\n\t$sth->execute();\n\t$sth->closeCursor();\n}", "public function destroy($id) \n {\n try {\n\n // Get plan subscribers count\n $subscribers = PlanSubscription::where(['plan_id' => $id, 'canceled_immediately' => null, 'canceled_at' => null])->count();\n $plan = Plan::find($id);\n\n // Only delete if the plan has no subscribers\n if ( $subscribers >= 1 ) {\n \n $plan->active = 0;\n $plan->save();\n\n $message = 'This plan currently have active subscribers therefore it was only disabled';\n\n } \n else {\n\n // Delete from Stripe\n if ( config('services.stripe.key') && config('services.stripe.secret') ) {\n Stripe::plans()->delete($id);\n }\n\n\n // Delete From PayPal\n if ( config('services.paypal.enable') ) {\n\n $paypalPlan = \\PayPal\\Api\\Plan::get($plan->paypal_plan_id, $this->paypalApiContext);\n $paypalPlan->delete($this->paypalApiContext);\n \n }\n\n\n // Delete DB plan\n $plan->delete();\n\n\n $message = 'The plan was successfully deleted';\n\n }\n \n\n return response(['message' => $message], 200);\n \n } catch (Exception $e) {\n return response(['message' => $e->getMessage()], 500);\n }\n }", "public function destroy($id)\n {\n Log::debug(\"DESTROY PLAN\");\n\n $stripeService = new StripeService();\n $stripeService->setStripeKey();\n\n $stripeSubscriptionService = new StripeSubscriptionService();\n $result = $stripeSubscriptionService->deletePlan($id);\n\n if ($result['message'] == 'Success'){\n\n //return new StripeDeletedPlanResource($result['plan']);\n\n session()->flash('success', 'Plan deleted successfully.');\n \n return redirect( route ('plans.index') );\n\n } else {\n\n Log::debug($result['message']);\n\n session()->flash('error', $result['message']);\n\n return redirect()->back();\n\n }\n\n }", "public function destroy(Plancompta $plancompta)\n {\n //\n }", "function deleteContinueReport($conn, $planID){\n\t$sql = \"DELETE FROM temporaryreport WHERE PlanId = :planID\";\n\t$sth = $conn->prepare($sql);\n\t\n\t$sth->bindParam(':planID', $planID, PDO::PARAM_INT, 11);\n\t\n\t$sth->execute();\n\t$sth->closeCursor();\n}", "public function destroy($id)\n {\n $plan = Plan::findOrFail($id);\n $plan->delete();\n return $this->showOne($plan);\n }", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function eliminar($idplan)\n {\n include_once 'controlador/util/bd_conexion_pdo.php';\n\n $conexion = (new Conexion())->conectarPDO();\n\n $sentencia = $conexion->prepare(\"DELETE FROM plan WHERE idplan = :idplan\");\n $sentencia->bindParam(':idplan', $idplan);\n\n $sentencia->execute();\n\n $sentencia->closeCursor();\n\n $resultado = $sentencia->rowCount();\n\n $sentencia = null;\n $conexion = null;\n\n return $resultado;\n }", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function testDeletePackingPlan()\n {\n }", "public function forceDeleted(PlanSubscription $planSubscription)\n {\n //\n }", "public function delete()\n {\n //recuperation des informations pour la suppression d'une matière\n $data = $this->request->data;\n $id_planing = (int)$data['id_planing'] ?? null;\n \n if (empty($id_planing)) {\n $this->_return('Veillez spécifier l\\'identifiant du programme à supprimer', false);\n }\n\n if (true === $this->model->exist('id_planing', (int)$data['id_planing'], 'Presences')) {\n $this->_return('impossible de supprimer ce planing car il comporte encore des presences ', false);\n }\n\n try {\n $this->model->remove($id_planing);\n $this->_return('La matière a étè supprimer avec succès', true);\n //code...\n } catch (Exception $e) {\n $this->_exception($e);\n }\n }", "public function delete() {\n\t$stmt = $this->_database->prepare('DELETE FROM planetterrains WHERE refid = ?');\n\t$stmt->bind_param('i', $this->refid);\n\t$stmt->execute();\n\tif (\\is_array($this->deposit) && \\count($this->deposit) > 0) {\n\t $this->deposit[$this->refid]->delete();\n\t}\n }", "public function destroy($id)\n\t{\n\t\treturn Travelplan::whereId($id)->first()->destroy();\n\t\t\n\t}", "public function destroy(tbl_project $tbl_project)\n {\n //\n }", "public function deleteFlatplan ($slug, $plan){\n\t\ttry{\n\t\t\t$org = Organization::where('slug', '=', $slug)->firstOrFail();\n\t\t\t$flatplan = Flatplan::where('organization_id', '=', $org->id)->where('slug', '=', $plan)->firstOrFail();\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\treturn View::make('fourOhFour');\n\t\t}\n\t\ttry{\n\t\t\t$role = Role::where('organization_id', '=', $org->id)->where('user_id', '=', Auth::user()->id)->firstOrFail();\n\t\t}\n\t\tcatch (Exception $e){\n\t\t\treturn Redirect::to('/'.$org->slug)->with('flash_message', 'You do not have permission to edit this organization');\n\t\t}\n\t\tif($role->permissions == 'edit'){\n\t\t\t$pages = Page::where('flatplan_id', '=', $flatplan->id)->get();\n\t\t\tif($pages){\n\t\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\t\t\t\tforeach ($pages as $page) {\n\t\t\t\t\t$assignments = Assignment::where('page_id', '=', $page->id)->get();\n\t\t\t\t\tif($assignments){\n\t\t\t\t\t\tforeach($assignments as $assignment){\n\t\t\t\t\t\t\t$assignment->delete();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$page->delete();\n\t\t\t\t}\n\t\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1');\n\t\t\t}\n\t\t\t$flatplan->delete();\n\t\t\treturn Redirect::to('/'.$org->slug)->with('flash_message', 'Flatplan deleted successfully');\n\t\t}\n\t\telse{\n\t\t\treturn Redirect::to('/'.$org->slug.'/'.$flatplan->slug.'/'.$page->page_number)->with('flash_message', 'You do not have permission to delete this flatplan');\n\t\t}\t\n\t}", "public function deleteStatement()\n {\n }", "public function destroy($id)\n {\n $retorn=[\"can_create\"=>false];\n if(Auth::user()->can_create) {\n $plan = App\\Plan::findOrFail($id);\n $plan->delete();\n $retorn=[\"can_create\"=>true];\n }\n return response()->json($retorn);\n }", "public function destroy($id)\n {\n $plan = Plan::find($id);\n // $plan->clients()->delete();\n $plan->delete();\n return back()->with(['done' => 'Plan Deleted Successfully']);\n }", "static public function ctrBorrarPlan()\n\t{\n\t\tif(isset($_GET[\"idCurricular\"]))\n\t\t{\n\t\t\t$tabla = \"planes\";\n\t\t\t$datos = $_GET[\"idCurricular\"];\n\t\t\t$respuesta = ModeloPlanes::mdlBorrarPlanes($tabla,$datos);\n\n\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\techo '<script> \n\t \t\t\t\t\tswal({\n\t \t\t\t\t\t\ttype: \"success\",\n\t \t\t\t\t\t\ttitle: \"Plan curricular ha sido borrado correctamente\",\n\t \t\t\t\t\t\tshowConfirmButton: true,\n\t \t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t \t\t\t\t\t\tcloseOnConfirm: false\n\t \t\t\t\t\t}).then((result)=>{\n\t \t\t\t\t\t\tif(result.value)\n\t \t\t\t\t\t\t{\n\t \t\t\t\t\t\t\twindow.location = \"PlanCurricular\";\n\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\t})\n\n\t \t\t\t\t \t</script>';\n\t\t\t}\n\t\t}\n\t}", "function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}", "public function delete(): void;", "public function destroy($id){\n $data = UserPlan::find($id);\n\n $data->delete();\n\n return response()->json([\n 'message' => 'Delete data success'\n ]);\n }", "public function delete() {\n\n // Does the program object have an ID?\n if ( is_null( $this->programID ) ) trigger_error ( \"Program::delete(): Attempt to delete an program object that does not have its ID property set.\", E_USER_ERROR );\n\n // Delete the program\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $st = $conn->prepare ( \"DELETE FROM programs WHERE programID = :id LIMIT 1\" );\n $st->bindValue( \":id\", $this->programID, PDO::PARAM_INT );\n $st->execute();\n $conn = null;\n }", "public abstract function delete();", "public function destroy($id)\n {\n $plan = Plan::findOrFail($id);\n\n if ( $plan->condition->state_id != trans('globals.condition.pending') ||\n $plan->user->first()->id != Auth::user()->id ) {\n abort(403);\n }\n\n $plan->delete();\n\n return self::redirection('plans', trans('plan.destroy.success'), null, null);\n }", "public function destroy($id)\n\t{\n\t\t$this->plan_task->find($id)->delete();\n\n\t return Redirect::route('admin.plans.index');\n\t}", "public function destroy($id)\n {\n $plan = Plan::where(['id' => $id]);\n $relaciones = $plan->with(['planesProyectos'])->get()->toArray()[0];\n\n if (count($relaciones['planes_proyectos']) > 0)\n return response()->json([\n 'message' => 'El plan tiene proyectos asignados y es posible que esten en seguimiento',\n 'data' => [],\n 'status' => 'error'\n ], 200);\n\n if ($plan->delete())\n return response()->json([\n 'message' => 'Plan eliminado',\n 'data' => [],\n 'status' => 'ok'\n ], 200);\n\n return response()->json([\n 'message' => 'Ocurrió un error',\n 'data' => [],\n 'status' => 'error'\n ], 200);\n }", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "function deleteUnfinishedModules($conn, $planID){\n\t$sql = \"DELETE FROM incompletecomponents WHERE PlanId = :planID\";\n\t$sth = $conn->prepare($sql);\n\t\n\t$sth->bindParam(':planID', $planID, PDO::PARAM_INT, 11);\n\t\n\t$sth->execute();\n\t$sth->closeCursor();\n}", "public function delete()\n {\n echo '客户要求减少一个需求' . PHP_EOL;\n }", "public function delete() {\r\n }", "public function destroy($id)\n {\n $plan= Plan::find($id);\n $plan->delete();\n flash('Plan borrado correctamente');\n\n return redirect()->route('plans.index');\n }", "function delete() ;", "function delete() ;", "public static function delete(){\r\n }", "public function destroy($id)\n {\n PlanMejora::destroy($id);\n return redirect('planes');\n }", "public static function delete() {\n\n\n\t\t}", "public function delete(): void\n {\n }", "abstract function delete();", "public function delete()\n {\n \n }", "public final function delete() {\n }", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "function delete_portfolio_project($PortID) {\r\n\r\n $conn = db_connect();\r\n\r\n $query = \"delete from PortfolioCategories\r\n where PortID='\".$PortID.\"'\";\r\n $result = @$conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } \r\n \r\n $query = \"delete from Portfolio\r\n where PortID='\".$PortID.\"'\";\r\n $result = @$conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "public function delete() {\n $sql = sprintf(\"DELETE FROM project WHERE id=%d\", $this->id);\n self::$connection->execute($sql);\n }", "public function deleting()\n {\n # code...\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete (){\n\n $table = new simple_table_ops();\n $table->set_id_column('timetable_id');\n $table->set_table_name('timetables');\n $table->delete();\n\n header(\"Location: http://\".WEBSITE_URL.\"/index.php?controller=timetable&action=show&submit=yes&timetable_period_id={$_GET['timetable_period_id']}\");\n }", "public function DELETE() {\n #\n }", "public function delete() {\n\n }", "public function delete($metricaevotranspiracion);", "function delete($tab, $cond)\n{\n\t$args = (func_num_args() > 2)? array_slice(func_get_args(),2) : null;\n\t$where = $this->getWhereSql($cond, $args);\n\n\t$sql = \"DELETE FROM $tab WHERE $where\";\n\t$res = $this->query($sql);\n\treturn $res;\n}", "public static function delete() {\r\n\t\t\r\n\t}" ]
[ "0.7521497", "0.74868625", "0.73012066", "0.72344637", "0.7232439", "0.72282875", "0.7214159", "0.69692075", "0.69659406", "0.6919226", "0.6894218", "0.6878555", "0.68476814", "0.6801455", "0.6692988", "0.6606185", "0.6542338", "0.65063864", "0.64856935", "0.6480352", "0.6411359", "0.6386892", "0.63809544", "0.6375117", "0.6283845", "0.62343854", "0.62343854", "0.62343854", "0.62343854", "0.62343854", "0.62343854", "0.62343854", "0.62343854", "0.62343854", "0.62343854", "0.62343854", "0.62343854", "0.62343854", "0.62343854", "0.62343854", "0.61831826", "0.6138615", "0.6138615", "0.61382353", "0.61370105", "0.6090069", "0.6085947", "0.608217", "0.608149", "0.60469675", "0.6042645", "0.6028727", "0.6023752", "0.5993162", "0.59852856", "0.5982478", "0.5948643", "0.5921134", "0.5908434", "0.5892109", "0.5880418", "0.58746886", "0.58715016", "0.5868345", "0.5856575", "0.5856575", "0.5856575", "0.5856575", "0.58471525", "0.58390325", "0.58321434", "0.58175725", "0.5798178", "0.5798178", "0.5781325", "0.5776655", "0.5770316", "0.57693213", "0.575697", "0.57347", "0.5713765", "0.5706766", "0.5689589", "0.5689132", "0.56867075", "0.5686412", "0.5686412", "0.5686412", "0.5686412", "0.5686412", "0.5686412", "0.5686412", "0.5686412", "0.5686412", "0.5686412", "0.56791365", "0.56740224", "0.56738764", "0.56720066", "0.565691", "0.5656544" ]
0.0
-1
Execute will be called in a endless loop
protected function execute(InputInterface $input, OutputInterface $output) { $this->issuedLicense(); $this->priceInvoice(); $this->activeInstance(); $this->suspendedInstance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function execute()\n\t{\n\t\t$this->run();\n\t}", "public function execute()\n {\n $this->run();\n }", "protected function doExecute()\n\t{\n\t\t// Your application routines go here.\n\t}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute(): void;", "protected abstract function run();", "abstract protected function _run();", "abstract protected function _run();", "public abstract function run();", "public abstract function run();", "public function execute() { }", "public function execute() {\n\t}", "abstract public function run();", "abstract public function run();", "abstract public function run();", "abstract public function run();", "abstract public function run();", "abstract public function run();", "abstract public function run();", "abstract public function run();", "abstract function run();", "final public function perform()\n {\n $this->execute($this->args, $this->app);\n }", "abstract public function Execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function run(){}", "public function run() {}", "public function execute()\n\t{\n\t\t$this->executeCall();\n\t\t$this->executeReminder();\n\t}", "abstract public function run() ;", "public abstract function execute();", "public abstract function execute();", "public abstract function execute();", "public function run()\n\t{\n\t\t//\n\t}", "public function execute()\n {\n }", "public function run()\n {\n // $this->call\n }", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "protected function _exec()\n {\n }", "function execute()\r\n\t{\r\n\t\t\r\n\t}", "public function __invoke()\n {\n $this->execute();\n }", "public function execute() {\n if ( $this->mInternalMode ) {\n $this->executeAction();\n } else {\n $this->executeActionWithErrorHandling();\n }\n }", "protected abstract function onExecute();", "public function execute() {\n }", "public function handle()\n {\n\n\n while (true) {\n $this->doRun();\n }\n\n }", "abstract public function execute();", "abstract public function execute();", "abstract public function execute();", "abstract public function execute();", "function execute()\n {\n }", "public function execute()\n {\n if ($this->synchronizer->isSynchronizationRequired()) {\n $this->synchronizer->synchronize();\n }\n }", "public function loop();", "public function run() {\n\t\tif ($this->schedule->isRun()) {\n\t\t\t$this->excuteHandle->excute();\n\t\t}\n\t}", "public function execute()\n {\n }", "public function execute()\n {\n }" ]
[ "0.7672592", "0.7438123", "0.72877234", "0.7224473", "0.7224473", "0.7224033", "0.7224033", "0.7224033", "0.7224033", "0.7224033", "0.7224033", "0.7223859", "0.7223859", "0.7223859", "0.7223859", "0.7223859", "0.7223859", "0.7223859", "0.7223859", "0.7223859", "0.7223859", "0.7223859", "0.7223859", "0.7223859", "0.6961193", "0.69396704", "0.69110346", "0.69110346", "0.6908868", "0.6908868", "0.6875662", "0.68711615", "0.6852097", "0.6852097", "0.6852097", "0.6852097", "0.6852097", "0.6852097", "0.6852097", "0.6852097", "0.68200076", "0.6819919", "0.6815976", "0.6814634", "0.6814634", "0.6814634", "0.6814634", "0.6814634", "0.6814634", "0.6814634", "0.6814634", "0.6814634", "0.6814634", "0.6814634", "0.6814634", "0.6814634", "0.6814634", "0.6814634", "0.6779798", "0.6759392", "0.6756708", "0.67530686", "0.6731037", "0.6731037", "0.6731037", "0.6726029", "0.6724018", "0.67195255", "0.6702927", "0.6702927", "0.6702927", "0.6702927", "0.6702927", "0.6702927", "0.6702927", "0.6702927", "0.6702927", "0.6702927", "0.6702927", "0.6702927", "0.6702927", "0.6702927", "0.6702927", "0.6702927", "0.66925466", "0.6618732", "0.6615682", "0.661185", "0.65829784", "0.6574618", "0.65702456", "0.6528366", "0.6528366", "0.6528366", "0.6528366", "0.65185857", "0.651407", "0.64997333", "0.6488782", "0.64671785", "0.64671785" ]
0.0
-1
Welcome to upload helper file This file get file to be uploaded return path where it is uploaded
function upload_file($file_name, $allowed_ext, $allowed_mime, $max_size, $location) { $ext = pathinfo($_FILES[$file_name]['name'], PATHINFO_EXTENSION); if ((in_array($_FILES[$file_name]['type'], $allowed_mime)) && (in_array(strtolower($ext), $allowed_ext)) && (@getimagesize($_FILES[$file_name]['tmp_name']) !== false) && ($_FILES[$file_name]['size'] <= $max_size)) { $md5 = substr(md5_file($_FILES[$file_name]['tmp_name']), 0, 7); $newname = time().$md5.'.'.$ext; move_uploaded_file($_FILES[$file_name]['tmp_name'], __DIR__.'/../'.$location.'/'.$newname); return $location.'/'.$newname; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function uploadPath();", "public function getRelativeUploadPath(): string;", "protected function getFullPathToUploadFile()\n {\n return $this->fullPathToUploadFile;\n }", "public function getUploadPath()\n\t{\n\t\t// return Yii::app()->params->upload.'/';\n\t\treturn Yii::app()->config->fixedValues['upload_path'];\n\t}", "public function uploadPath()\n {\n return call_user_func($this->savePath, $this->basePath);\n }", "public function upload(){\n \n if(!empty($_FILES['uploaded_file']))\n {\n $path = \"upload/\";\n $path = $path . basename( $_FILES['uploaded_file']['name']);\n\n if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {\n echo \"The file \". basename( $_FILES['uploaded_file']['name']). \n \" has been uploaded\";\n return $path;\n } else{\n echo \"There was an error uploading the file, please try again!\";\n }\n }\n }", "public function getUploadPath()\n {\n return Yii::$app->params['upload_dir'] . DIRECTORY_SEPARATOR . $this->path;\n }", "protected function getUploadPath()\n {\n return 'uploads/achtergrondfotos';\n }", "public function getUploadedPath()\n {\n return $this->uploadedPath;\n }", "public static function getUploadPath()\n {\n return '';\n }", "private function upload_file_and_get_path(): string\n {\n $this->load->library('upload');\n $image_path = \"\";\n $config['upload_path'] = './static/images/';\n $config['allowed_types'] = 'jpg|jpeg|png|gif|pdf';\n $config['encrypt_name'] = TRUE;\n $this->upload->initialize($config);\n if ($this->upload->do_upload('image_path')) {\n $info = $this->upload->data();\n $image_path = $info['file_name'];\n // delete the images present in table or else with every new upload unwanted files will keep on increasing\n } else {\n echo $this->upload->display_errors();\n return \"\";\n }\n return $image_path;\n }", "public function get_full_uploaded_file_path()\n {\n return $this->full_uploaded_file_path;\n }", "public function getUploadedFilePath()\n {\n return !empty($this->filepath) ? $this->filepath : \n (!empty($this->filename) ? (Yii::$app->params['uploadPath'] . $this->filename) : null);\n }", "public function getUploadedFile(){\n\t\t\t$pic = isset($this->EMP_IMG) ? $this->EMP_IMG : 'default.jpg';\n\t\t\treturn Yii::$app->params['HRD_EMP_UploadUrl'].$pic;\n\t\t}", "abstract protected function getUploadDir(): string;", "public function getFile()\n {\n $file = Input::file('report');\n $filename = $this->doSomethingLikeUpload($file);\n\n // Return it's location\n return $filename;\n }", "public function getUploadedPath()\n {\n return $this->getUploadsFolder() . '/' . $this->getRootUploadedPath();\n }", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getFilePath();", "public function getFilesPath() {\n\t\treturn $this->uploadPath;\n\t}", "public function getUploadDir(){\n return dirname(_FILE_). \"/img/\";\n }", "public function getFilepath();", "public function getRootUploadedPath()\n {\n return \"{$this->uploaded_filename}\";\n }", "protected function getUploadDir()\n {\n return 'upload/files';\n }", "public function get_uploaded_file_url()\n {\n return App::getBaseURL() . $this->uploaded_file_path;\n }", "public function basePathUpload() {\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t\t$pathupload = realpath ( APPLICATION_PATH . '/../public/data/uploads' );\n\t\t\t\t\t\treturn $pathupload;\n\t\t\t\t\t}", "public function getFileUploadLocation()\n {\n $config = $this->getServiceLocator()->get('config');\n return $config['module_config']['upload_location'];\n }", "public function getUploadPath()\n {\n $reflect = new ReflectionClass($this);\n return $this->uploadPath . $reflect->getShortName() . '/' . $this->id . '/';\n }", "public static function uploadPath(): string {\n\t\treturn config('filesystems.upload_folder_name') . DIRECTORY_SEPARATOR . self::UPLOAD_FOLDER_NAME;\n\t}", "public function uploadPath()\n {\n return config('quikservice.user.upload.profile-picture.path');\n }", "protected function getUploadDir() {\n return '/uploads';\n }", "public function getUploadUrl()\n {\n \treturn $this->getForm()->getUploadUrl();\n }", "protected function getUploadDir()\n {\n return 'uploads/serie';\n }", "protected function getUploadDir()\n {\n \t// when displaying uploaded doc/image in the view.\n \treturn 'uploads/imagen';\n }", "public function getUploadDir() {\n \treturn 'uploads/img';\n }", "public function getUploadedsPath()\n {\n return $this->uploadedsPath;\n }", "public function filePath();", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads/';\n }", "protected function getUploadDir() {\r\n return 'uploads/documents';\r\n }", "protected function getUploadDir() {\n // al mostrar el documento/imagen cargada en la vista.\n return 'bundles/mascotasmascotas/uploaded';\n }", "public function getUploadRootDir(){\n return __DIR__.'/../../../web/'.$this->getUploadDir();\n }", "public function getUploadDir()\n {\n // image profile should be saved\n return __DIR__.'/../../../../web/uploads/evento/'.$this->id;\n }", "protected function getUploadDir(): string\n {\n return 'uploads/img';\n }", "private function getUploadRootDir(){\n \treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "public function getUploadDir(){\n return \"uploads/img/parties\" ;\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/products';\n }", "protected function getUploadDir()\n {\n return 'uploads';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/lots';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'images/about_us';\n }", "public function upload();", "protected function getUploadDir()\r\n {\r\n // when displaying uploaded doc/image in the view.\r\n return 'uploads/images';\r\n }", "protected function getUploadDir()\n {\n // al mostrar el documento/imagen cargada en la vista.\n return 'uploads/images/equipo';\n }", "function wp_get_upload_dir()\n {\n }", "protected function getUploadDir()\n {\n return 'uploads/products';\n }", "public function getUploadDir()\n {\n return 'uploads/img';\n }", "public function getUploadDir()\n {\n return 'uploads/img';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/produtos';\n }", "protected function generateFullPathToUploadFile()\n {\n // $this->fullPathToUploadFile = str_replace(\"/\", \"\\\\\", storage_path('app/' . $this->pathToFile));\n $this->fullPathToUploadFile = storage_path('app/' . $this->pathToFile);\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/user';\n }", "protected function getUploadRootDir()\n {\n// documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getAbsolutePath()\n {\n return '/var/www/html/ColdkitchenSymfony/web/'.$this->getUploadPath();\n }", "public function getUploadDir()\n {\n return 'uploads/fanart';\n }", "public function imagePath(){\n return $this->upload_directory.DS.$this->filename;\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents/images/profile';\n }", "public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "function _wp_relative_upload_path($path)\n {\n }", "public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'web/images';\n }", "public function getUploadedFileInfo();", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "public function getAbsolutePath()\n {\n return $this->getUploadRootDir().'/'.$this->name;\n }", "public function getFilePath(): string;", "public function getFilePath(): string;", "function upload_path(string $path = null)\n { \n return public_path(\n trim_path(config('armin.path.file', 'files').DS.$path)\n );\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents/w2share';\n }", "public function getPath(): string\n {\n return asset('storage/upload/'.$this->path);\n }", "public function getUpload()\n {\n $index = $this->input->post(\"imageIndex\");\n if ($index == null) {\n echo \"Not a POST\";\n return;\n }\n $target_dir = $_SERVER['DOCUMENT_ROOT'] . \"/app/wed-upload/\";\n $target_file = $target_dir . $index;\n if (file_exists($target_file)) {\n error_log(\"Returning file: \" . $target_file);\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename='.basename($target_file));\n header('Expires: 0');\n header('Cache-Control: must-revalidate');\n header('Pragma: public');\n header('Content-Length: ' . filesize($target_file));\n error_log(readfile($target_file));\n exit;\n } else {\n echo \"File not exist\";\n }\n }", "public function get_uploadBasePath()\n {\n return $this->_uploadBasePath;\n }", "public function getUploadRootDir() {\n \treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/devis';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/images/agancy';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/guide';\n }", "public function getUploadfile()\n {\n return view(\"Admin::employee.uploadfile\");\n }", "protected function getUploadFotoDir() {\n return 'uploads/produtos/produto/';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/subtitles';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/user/images';\n }", "function upload_banner() {\n $destPath = 'assets/img/uploads/progression';\n #Find and move our file\n $destFile = $_SERVER['DOCUMENT_ROOT'].\"/\".$destPath.\"/\".basename($_FILES['img']['name']);\n $tmpFile = $_FILES['img']['tmp_name'];\n if (move_uploaded_file($tmpFile, $destFile)){\n return $destPath.\"/\".basename($_FILES['img']['name']);\n } else {\n die(\"File Moving Failed.\");\n }\n }", "function upload_path($field) {\n\t\tif (!defined('UPLOAD_PATH')) {\n\t\t\ttrigger_error(\"UPLOAD_PATH is not defined in the config file\", E_USER_ERROR);\n\t\t\treturn false;\n\t\t}\n\n\t\t$path = UPLOAD_PATH.$this->type().'/'.$field.'/';\n\n\t\tif (!file_exists($path)) {\n\t\t\ttrigger_error(\"Upload path '$path' doesn't exist\", E_USER_ERROR);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $path;\n\t}", "public function getUploadDir()\n {\n return 'uploads/images';\n }", "protected function getUploadDir()\n {\n return 'uploads/images';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/tracks';\n }" ]
[ "0.8447694", "0.7907046", "0.78354186", "0.76956284", "0.7639022", "0.7589565", "0.7583486", "0.7524702", "0.7502496", "0.74898064", "0.7483539", "0.7474317", "0.74570423", "0.7315897", "0.73075366", "0.72570217", "0.7250155", "0.71630424", "0.71630424", "0.71630424", "0.71630424", "0.7162862", "0.7142862", "0.7139284", "0.71086925", "0.7104771", "0.709242", "0.70735484", "0.70734787", "0.7062998", "0.70629543", "0.7036678", "0.70108795", "0.6995174", "0.69901985", "0.6985228", "0.6982267", "0.6975044", "0.69717044", "0.6941822", "0.69230825", "0.69149816", "0.68994105", "0.68886214", "0.6888122", "0.6884919", "0.68814766", "0.6871091", "0.6865075", "0.68573576", "0.6854167", "0.6852196", "0.6851937", "0.6849768", "0.6849288", "0.68492186", "0.6840976", "0.6840976", "0.6835122", "0.68341035", "0.6833613", "0.6832398", "0.6828685", "0.68218845", "0.6821447", "0.6821273", "0.6806148", "0.6806148", "0.6802366", "0.6799918", "0.6799174", "0.67941153", "0.67941153", "0.67941153", "0.67941153", "0.67941153", "0.67941153", "0.67941153", "0.67941153", "0.67931074", "0.67863876", "0.67863876", "0.6775074", "0.6768956", "0.6764664", "0.6761371", "0.67496437", "0.6747529", "0.6742938", "0.6740641", "0.6740331", "0.6737598", "0.6725912", "0.6725013", "0.671858", "0.67140025", "0.671392", "0.67069066", "0.67058855", "0.6701954", "0.6701324" ]
0.0
-1
/ Constructs the module.
public function __construct(array $fields = null) { $this->fields = $fields; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n parent::__construct(array(\n 'name' => __('Module Boilerplate', 'fl-builder'),\n 'description' => __('An starting point for coding new modules.', 'fl-builder'),\n 'category'\t\t=> __('Advanced Modules', 'fl-builder'),\n 'dir' => MY_MODULES_DIR . 'module-name/',\n 'url' => MY_MODULES_URL . 'module-name/',\n 'editor_export' => true, // Defaults to true and can be omitted.\n 'enabled' => true, // Defaults to true and can be omitted.\n ));\n }", "public function __construct()\n {\n if ($module = Registry::get('request')->getModules()) {\n $path = Micro::getInstance()->config['AppDir'] . $module . '/' . ucfirst(basename($module)) . 'Module.php';\n\n if (file_exists($path)) {\n $path = substr(basename($path), 0, -4);\n self::$module = new $path();\n }\n }\n }", "function __construct(){\n\t\t\n\t\tWPT2()->RegisterModule($this->name, $this->version, $this->author, $this->description, $this->error);\n\n\t\tif($this->helpfile){\n\t\t\tWPT2()->LoadHelp(get_class($this));\n\t\t}\n\n\t}", "protected function __construct()\n {\n $this->_module = new Reuse_Ack_Model_Module;\n }", "public function __construct()\n\t{\n\t\tmodules::init_module( 'unreal32', self::MOD_VERSION, self::MOD_AUTHOR, 'protocol', 'static' );\n\t\t// these are standard in module constructors\n\t}", "public function create_module() {\n\t\t$context = [];\n\t\t$this->climate->green()->out( 'Creating new Module…' );\n\n\t\t$context['name'] = null;\n\t\t$filename_module = null;\n\t\twhile ( $context['name'] == null || file_exists( $filename_module ) ) {\n\t\t\t$input = $this->climate->green()->input( \"What will your Module be called?\\r\\n>\" );\n\t\t\t$context['name'] = trim( $input->prompt() );\n\n\t\t\tif ( $context['name'] == null ) {\n\t\t\t\t$this->climate->error( Emoji::pileOfPoo() . ' Please give a name for this Module!' );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$context['name'] = Utility::modulize( $context['name'] );\n\t\t\t$context['id'] = strtolower( Utility::normalize( $context['name'] ) );\n\t\t\t$context['name_view'] = Utility::viewize( $context['name'] );\n\t\t\t$context['name_acf'] = Utility::acfize( $context['name'] );\n\n\t\t\t$filename_module = $GLOBALS['sloth']->container->get( 'path.theme' ) . DS . 'Module' . DS . $context['name'] . '.php';\n\t\t\tif ( file_exists( $filename_module ) ) {\n\t\t\t\t$this->climate->error( Emoji::pileOfPoo() . ' ' . sprintf( 'A module called %s exists!',\n\t\t\t\t\t\t$context['name'] ) );\n\t\t\t}\n\t\t}\n\n\t\t$input = $this->climate->green()->confirm( 'Do you want to use your module with Layotter?' );\n\t\t$context['layotter'] = $input->confirmed() ? [] : false;\n\n\t\tif ( is_array( $context['layotter'] ) ) {\n\t\t\t$input = $this->climate->green()->input( \"Please give a comprehensive title for your module.\\r\\n>\" );\n\t\t\t$context['layotter']['title'] = trim( $input->prompt() );\n\n\t\t\t$input = $this->climate->green()->input( \"Please give a short description of what this module will do.\\r\\n>\" );\n\t\t\t$context['layotter']['description'] = trim( $input->prompt() );\n\n\t\t\t$input = $this->climate->green()->input( \"Please choose an icon for this module.\\r\\n(choose from http://fontawesome.io/icons/)\\r\\n>\" );\n\t\t\t$context['layotter']['icon'] = trim( $input->prompt() );\n\t\t}\n\t\t/*\n\t\t\t\t$input = $this->climate->green()->confirm( 'Do you want me to create a sass file for this module?' );\n\t\t\t\t$context['sass'] = $input->confirmed();\n\n\t\t\t\t$input = $this->climate->green()->confirm( 'Do you want me to create a JavaScript file for this module?' );\n\t\t\t\t$context['js'] = $input->confirmed();\n\t\t*/\n\n\t\t# write it to file\n\t\t$view = View::make( 'Scaffold.Module.Class' );\n\t\tfile_put_contents( $filename_module, $view->with( $context )->render() );\n\n\t\t$filename_view = $GLOBALS['sloth']->container->get( 'path.theme' ) . DS . 'View' . DS . 'Module' . DS . $context['name_view'] . '.twig';\n\t\t$view = View::make( 'Scaffold.Module.View' );\n\t\tfile_put_contents( $filename_view, $view->with( $context )->render() );\n\n\n\t\t$sass_dir = DIR_ROOT . DS . 'src' . DS . 'sass' . DS;\n\t\tif ( ! is_dir( $sass_dir ) ) {\n\t\t\t$sass_dir = DIR_ROOT . DS . 'src' . DS . 'scss' . DS;\n\t\t}\n\n\t\t$filename_sass = $sass_dir . 'modules' . DS . '_' . $context['name_view'] . '.scss';\n\t\tif ( ! is_dir( dirname( $filename_sass ) ) ) {\n\t\t\tmkdir( dirname( $filename_sass ), 0777, true );\n\t\t}\n\t\t$view = View::make( 'Scaffold.Module.Sass' );\n\t\tfile_put_contents( $filename_sass, $view->with( $context )->render() );\n\n\n\t\t$filename_sass_bundle = $sass_dir . 'bundle.scss';\n\t\tfile_put_contents( $filename_sass_bundle,\n\t\t\tsprintf( \"\\n@import 'modules/%s';\", $context['name_view'] ),\n\t\t\tFILE_APPEND );\n\n\t\tif ( $context['layotter'] ) {\n\t\t\t$filename_acf = $GLOBALS['sloth']->container->get( 'path.theme' ) . DS . 'acf-json' . DS . $context['name_acf'] . '.json';\n\t\t\tif ( file_exists( $filename_acf ) ) {\n\t\t\t\t$this->climate->info( Emoji::thinkingFace() . ' ' . sprintf( 'A Field Group %s exists. Skipping scaffolding!',\n\t\t\t\t\t\t$context['name_acf'] ) );\n\t\t\t} else {\n\t\t\t\t$view = View::make( 'Scaffold.Module.Acf' );\n\t\t\t\t$data = json_decode( $view->with( $context + [ 'now' => time() ] )->render() );\n\t\t\t\tif ( json_last_error() != JSON_ERROR_NONE ) {\n\t\t\t\t\tthrow new \\Exception( 'Seems your scaffold is not correct json!' );\n\t\t\t\t}\n\t\t\t\tfile_put_contents( $filename_acf, json_encode( $data ) );\n\t\t\t}\n\t\t}\n\n\t\t$this->climate->info( sprintf( 'Module %s created!', $context['name'] ) );\n\t}", "protected function createModuleInfo()\n {\n return new Core_ModuleInfo(\n \"Ras Blog\",\n \"LemonStand blogging feature\",\n \"Ras\");\n }", "protected function createModuleInfo()\n {\n return new Core_ModuleInfo(\n \"SASS Compiler\",\n \"Automatically compiles SASS files\",\n \"Flynsarmy\" );\n }", "function __construct()\n\t{\n\t\t// Store module path\n\t\t$this->module_path = dirname(__FILE__);\n\t}", "public function construct()\n\t\t{\n\t\t}", "function __construct()\n\t{\n\t\t// Store module path\n\t\t$this->module_path = dirname(__FILE__);\n }", "public function __construct(){\n $arModuleVersion = [];\n include(__DIR__ . \"/version.php\");\n\n $this->MODULE_ID = 'almaybee.addstorestoorderproducts';\n $this->MODULE_VERSION = $arModuleVersion[\"VERSION\"];\n $this->MODULE_VERSION_DATE = $arModuleVersion[\"VERSION_DATE\"];\n $this->MODULE_NAME = Loc::getMessage(\"AL_MAYBEE_STORES_MODULE_NAME\");\n $this->MODULE_DESCRIPTION = Loc::getMessage(\"AL_MAYBEE_STORES_MODULE_DESCRIPTION\");\n $this->PARTNER_NAME = Loc::getMessage(\"AL_MAYBEE_STORES_MODULE_PARTNER_NAME\");\n// $this->PARTNER_URI = Loc::getMessage(\"CRM_GENESIS_SLOTS_PARTNER_URI\");\n }", "function createModule() \n {\n // load Module manager\n $moduleID = $this->values[ ModuleCreator::KEY_MODULE_ID ];\n $moduleManager = new RowManager_ModuleManager( $moduleID );\n \n $this->storeCommonVariables( $moduleManager );\n \n \n // if Module manager is not created then\n if (!$moduleManager->isCreated()) {\n \n // create Module Directory\n $directoryName = '';\n if ( !$moduleManager->isCore() ) {\n $directoryName = 'app_';\n }\n $directoryName .= $moduleManager->getModuleName();\n $this->createDirectory( $directoryName );\n \n // Create Base Files\n $this->createBaseFiles( $moduleManager );\n \n // update created status\n $moduleManager->setCreated();\n \n } else {\n \n // make sure variable info is updated\n \n }// end if\n \n \n // process StateVar info\n $this->processStateVarInfo( $moduleID );\n \n // process Data Access Object info\n $this->processDataAccessObjectInfo( $moduleID );\n \n // process Page Object info\n $this->processPageInfo( $moduleID );\n \n // process Page Transitions (form) info\n $this->processTransition( $moduleID );\n \n \n }", "function _construct() {\n \t\n\t\t\n\t}", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "function __construct(string $str_func)\n {\n parent::__construct($str_func);\n $this->_className = 'Module';\n\n //--- (end of generated code: YModule constructor)\n }", "public function construct() {\n\n }", "public function __construct()\n {\n parent::__construct();\n $this->compileModList();\n }", "public function __construct() {\n\t\t\t$opts = array(\n\t\t\t\t'description' => __('Superimage!', 'carrington-build'),\n\t\t\t\t'icon' => 'hero/icon.png'\n\t\t\t);\n\t\t\t\n\t\t\tcfct_build_module::__construct('cfct-module-hero', __('Hero', 'carrington-build'), $opts);\n\t\t}", "function __construct () {\n\t\t$this->active_module = $this->name;\n\t\t\n\t\tparent::__construct();\n\t}", "protected function createModuleInfo()\n\t\t{\n\t\t\treturn new Core_ModuleInfo(\n\t\t\t\t\"ImageMagick\",\n\t\t\t\t\"Provides IM-specific extensions for LemonStand thumbnail generator\",\n\t\t\t\t\"Limewheel Creative Inc.\" );\n\t\t}", "protected function _construct() \n {\n $this->selectedModule = $this->choice('For Which Module ?',$this->modulesName());\n\t\t$this->className = 'Create'.ucfirst($this->moduleName).'Table';\n }", "function __construct() {\n if(file_exists(__DIR__.\"/version.php\")) {\n $arModuleVersion = array();\n\n include(__DIR__.\"/version.php\");\n $this->MODULE_ID = 'manao.authfromsms';\n $this->MODULE_VERSION = $arModuleVersion[\"VERSION\"];\n $this->MODULE_VERSION_DATE = $arModuleVersion[\"VERSION_DATE\"];\n $this->MODULE_NAME = Loc::getMessage(\"SMS_AUTH_MODULE_NAME\");\n $this->MODULE_DESCRIPTION = Loc::getMessage(\"SMS_AUTH_MODULE_DESC\");\n $this->PARTNER_NAME = 'Manao';\n $this->PARTNER_URI = 'https://manao-team.com';\n }\n\n }", "function _construct(){ }", "public function create(Module $module);", "public function __construct() {\n $this->MODULE_ID = 'zk.passrestore';\n\n $arModuleVersion = array();\n include(__DIR__ . \"/version.php\");\n $this->MODULE_VERSION = $arModuleVersion[\"VERSION\"];\n $this->MODULE_VERSION_DATE = $arModuleVersion[\"VERSION_DATE\"];\n $this->MODULE_NAME = Loc::getMessage(\"PSW_RESTORE_MODULE_NAME\");\n $this->MODULE_DESCRIPTION = Loc::getMessage(\"PSW_RESTORE_MODULE_DESC\");\n\n $this->PARTNER_NAME = Loc::getMessage(\"PSW_RESTORE_PARTNER_NAME\");\n $this->PARTNER_URI = \"http://\";\n }", "public function __construct() {\n\t\t//$moduleConfig = $GLOBALS['MCONF'];\n\t\t//$modTSconfig = t3lib_BEfunc::getModTSconfig( 0, 'mod.'.$this->MCONF['name'] );\n\n\t\t// Include class files\n\t\t$this->classLoader();\n\n\t\t// Init global logList object\n\t\t$GLOBALS['logList'] = t3lib_div::makeInstance('tx_passwordmgr_model_loglist');\n\n\t\t// Initialize module Data. This holds the chosen view, the action and all post Data values\n\t\t$GLOBALS['moduleData'] = t3lib_div::makeInstance('tx_passwordmgr_model_moduleData');\n\n\t\t// Create a dummy object of temlpate. This is a hack to make template->getPageInfo() happy\n\t\t$this->doc=t3lib_div::makeInstance('template');\n\t}", "protected function createModuleInfo() {\n return new Core_ModuleInfo(\n \"Event Listing\",\n \"Adds an event listing and admin entry for them to be displayed on the frontend\",\n \"Keyed-Up Media LLC\" );\n }", "public function _construct()\r\n {\r\n $this->moduleHelper->setModuleName(self::MODULE_NAME_CONFIG_PATH);\r\n }", "public static function create(IModule $module, array $data = array());", "function\t__construct( $_moduleName=\"\") {\n\t\tFDbg::begin( 1, \"UI_Module.php\", \"UI_Module\", \"__construct( '$_moduleName'\") ;\n\t\tparent::__construct( \"UI_Module\", \"ModuleName\") ;\n\t\tif ( strlen( $_moduleName) > 0) {\n\t\t\ttry {\n\t\t\t\t$this->setKey( $_moduleName) ;\n\t\t\t} catch ( Exception $e) {\n\t\t\t\tthrow $e ;\n\t\t\t}\n\t\t}\n\t\tFDbg::end( 1) ;\n\t}", "public function parse() {\n // we'll be using these a lot, aliasing it in makes it a wee bit faster\n $reader = $this->reader;\n $cache = $this->cache;\n\n $module = new Module;\n $module->name = $this->module;\n $module->version = $this->version;\n $module->authors = $this->authors;\n\n // Loop our data and fill our objects\n while($reader->read()) {\n\n // package element - for pkg config\n if($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'package') {\n $module->pkgname = $reader->getAttribute('name');\n }\n\n // c:include element\n elseif($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'c:include') {\n $module->headers[] = $reader->getAttribute('name');\n }\n\n // include element - module deps\n elseif ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'include') {\n $module->dep[$reader->getAttribute('name')] = $reader->getAttribute('version');\n }\n\n // namespace element\n elseif ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'namespace') {\n $module->namespaces[] = $package = new Package;\n $package->name = $reader->getAttribute('name');\n $package->version = $reader->getAttribute('version');\n\n // oddly enough, shared-library info is here in namespace, not in overall module\n $temp = $reader->getAttribute('shared-library');\n $temp = explode(',', $temp);\n $module->libs += $temp;\n }\n\n // constant element\n elseif ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'constant') {\n $package->constant[] = $constant = new Constant;\n $constant->name = $reader->getAttribute('name');\n $constant->def = $reader->getAttribute('c:type');\n\n do {\n if($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'type') {\n $constant->type = $reader->getAttribute('c:type');\n break;\n }\n } while($reader->read());\n }\n\n // Unions\n elseif ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'union' && $reader->isEmptyElement == false) {\n $this->parseUnion();\n }\n\n // Struct fake objects\n elseif ($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'record' && $reader->isEmptyElement == false) {\n $package->classes[] = $this->parseStructClass();\n }\n }\n\n return $module;\n }", "function __construct()\n\t{\n\t\t// Store module path\n\t\t$this->module_path = dirname(__FILE__) .'/';\n\t\t$this->view_path = $this->module_path . 'views/';\n\t}", "public function __construct() {\n\n // Loading module configuration file data\n $this->_config = Kohana::config('modulename')->as_array();\n\n // Say hi! usign date entered in the config file\n echo 'Hello Modulename! '.$this->_config['some_config_value'];\n\n }", "public function create()\n {\n $this->setContent();\n // create config file\n $file = $this->generator->formatConfigPath() .\n ModulesInterface::CONFIG_FILENAME . PhpInterface::PHP_EXT;\n $isCreated = FileManager::createFile($file, $this->sourceCode, true);\n if ($isCreated) {\n Console::out($file . PhpInterface::SPACE . Console::CREATED, Console::COLOR_GREEN);\n }\n }", "public function Create()\n {\n parent::Create();\n\t\t\n\t\t//These lines are parsed on Symcon Startup or Instance creation\n //You cannot use variables here. Just static values.\n $this->RegisterPropertyString(\"author\", \"\");\n $this->RegisterPropertyString(\"modulename\", \"\");\n $this->RegisterPropertyString(\"url\", \"\");\n $this->RegisterPropertyString(\"version\", \"0.1\");\n $this->RegisterPropertyInteger(\"build\", 0);\n $this->RegisterPropertyInteger(\"CategoryID\", 0);\n $this->RegisterPropertyInteger(\"generateguid\", 0);\n $this->RegisterPropertyString(\"library_guid\", \"\");\n $this->RegisterPropertyString(\"io_guid\", \"\");\n $this->RegisterPropertyString(\"rx_guid\", \"\");\n $this->RegisterPropertyString(\"tx_guid\", \"\");\n $this->RegisterPropertyString(\"splitter_guid\", \"\");\n $this->RegisterPropertyString(\"splitterinterface_guid\", \"\");\n $this->RegisterPropertyString(\"device_guid\", \"\");\n $this->RegisterPropertyString(\"deviceinterface_guid\", \"\");\n $this->RegisterPropertyString(\"vendor\", \"\");\n $this->RegisterPropertyString(\"prefix\", \"\");\n $this->RegisterPropertyString(\"aliases\", \"\");\n $this->RegisterPropertyInteger(\"ownio\", 0);\n $this->RegisterPropertyInteger(\"typeio\", 0);\n $this->RegisterPropertyInteger(\"dataflowtype\", 0);\n $this->RegisterPropertyString(\"virtual_io_rx_guid\", \"{018EF6B5-AB94-40C6-AA53-46943E824ACF}\"); // Kann für die Kommunikation von ClientSocket, MulticastSocket, SerialPort, UDPSocket und ServerSocket (nur Buffer) genutzt werden\n $this->RegisterPropertyString(\"virtual_io_tx_guid\", \"{79827379-F36E-4ADA-8A95-5F8D1DC92FA9}\"); // Kann für die Kommunikation von ClientSocket, MulticastSocket, SerialPort, UDPSocket und ServerSocket (nur Buffer) genutzt werden\n $this->RegisterPropertyString(\"hid_rx_guid\", \"{FD7FF32C-331E-4F6B-8BA8-F73982EF5AA7}\"); // Kann für HID (Human Interface Device) Instanzen genutzt werden\n $this->RegisterPropertyString(\"hid_tx_guid\", \"{4A550680-80C5-4465-971E-BBF83205A02B}\"); // Kann für HID (Human Interface Device) Instanzen genutzt werden\n $this->RegisterPropertyString(\"server_rx_guid\", \"{7A1272A4-CBDB-46EF-BFC6-DCF4A53D2FC7}\"); // Kann für ServerSocket genutzt werden. Liefert Buffer, ClientIP und ClientPort\n $this->RegisterPropertyString(\"server_tx_guid\", \"{C8792760-65CF-4C53-B5C7-A30FCC84FEFE}\"); // Kann für ServerSocket genutzt werden. Liefert Buffer, ClientIP und ClientPort\n $this->RegisterPropertyString(\"www_reader_rx_guid\", \"{4CB91589-CE01-4700-906F-26320EFCF6C4}\"); // Kann für WWW Reader Instanzen genutzt werden\n $this->RegisterPropertyString(\"www_reader_tx_guid\", \"{D4C1D08F-CD3B-494B-BE18-B36EF73B8F43}\"); // Kann für WWW Reader Instanzen genutzt werden\n $this->RegisterPropertyString(\"io_clientsocket_guid\", \"{3CFF0FD9-E306-41DB-9B5A-9D06D38576C3}\"); // Client Socket\n $this->RegisterPropertyString(\"io_multicast_guid\", \"{BAB408E0-0A0F-48C3-B14E-9FB2FA81F66A}\"); // MulticastSocket\n $this->RegisterPropertyString(\"io_serialport_guid\", \"{6DC3D946-0D31-450F-A8C6-C42DB8D7D4F1}\"); // SerialPort\n $this->RegisterPropertyString(\"io_serversocket_guid\", \"{8062CF2B-600E-41D6-AD4B-1BA66C32D6ED}\"); // Server Socket\n $this->RegisterPropertyString(\"io_udpsocket_guid\", \"{82347F20-F541-41E1-AC5B-A636FD3AE2D8}\"); // UDPSocket\n $this->RegisterPropertyString(\"io_hid_guid\", \"{E6D7692A-7F4C-441D-827B-64062CFE1C02}\"); // HID\n $this->RegisterPropertyString(\"io_wwwreader_guid\", \"{4CB91589-CE01-4700-906F-26320EFCF6C4}\"); // WWW Reader\n }", "function __constructor(){}", "function __construct($db) {\n\tglobal $langs,$conf;\n\n\t$this->db = $db;\n\n\t// Id for module (must be unique).\n\t// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).\n\t$this->numero = 113900;\n\t\n\t// Key text used to identify module (for permissions, menus, etc...)\n\t$this->rights_class = 'oblyon';\n\n\t// Family can be 'crm','financial','hr','projects','products','ecm','technic','other'\n\t// It is used to group modules in module setup page\n\t$this->family = \"other\";\n\n\t// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)\n\t$this->name = preg_replace('/^mod/i','',get_class($this));\n\n\t// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)\n\t$this->description = \"Thème Oblyon\";\n\n\t// Possible values for version are: 'development', 'experimental', 'dolibarr' or version\n\t$this->version = '4.0.0b2';\n\n\t// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)\n\t$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);\n \n\t// Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)\n\t$this->special = 1;\n\n\t// Name of image file used for this module.\n\t// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'\n\t// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'\n\t$this->picto='oblyon@oblyon';\n\n\t// Defined all module parts (triggers, login, substitutions, menus, css, etc...)\n\t// for default path (eg: /oblyon/core/xxxxx) (0=disable, 1=enable)\n\t// for specific path of parts (eg: /oblyon/core/modules/barcode)\n\t// for specific css file (eg: /oblyon/css/oblyon.css.php)\n\t$this->module_parts = array(\n\t\t'menus' => 1, // Set this to 1 if module has its own menus handler directory (core/menus)\n\t\t// 'theme' => 0, // Set this to 1 if module has its own theme directory (core/theme)\n\t\t// 'css' => '/oblyon/css/oblyon.css.php', // Set this to relative path of css file if module has its own css file\n\t\t'js' => '/oblyon/js/pushy.js', // Set this to relative path of js file if module must load a js on all pages\n\t);\n\n\n\t// Config pages. Put here list of php page, stored into oblyon/admin directory, to use to setup module.\n\t$this->config_page_url = array(\"menus.php@oblyon\");\n\n\t// Dependencies\n\t$this->depends = array();\t\t// List of modules id that must be enabled if this module is enabled\n\t$this->requiredby = array();\t// List of modules id to disable if this one is disabled\n\t$this->phpmin = array(5,0);\t\t\t\t\t// Minimum version of PHP required by module\n\t$this->need_dolibarr_version = array(3,5);\t// Minimum version of Dolibarr required by module\n\t$this->langfiles = array(\"oblyon@oblyon\");\n\n\t// Constants\n\t$this->const = array ();\n\t$r = 0;\n\n\t$r ++;\n\t$this->const [$r] [0] = \"MAIN_MENU_STANDARD_FORCED\";\n\t$this->const [$r] [1] = \"chaine\";\n\t$this->const [$r] [2] = \"oblyon_menu.php\";\n\t$this->const [$r] [3] = 0;\n\t$this->const [$r] [4] = 1;\n\t$this->const [$r] [5] = 'current';\n\t$this->const [$r] [6] = 1;\n\n\t$r ++;\n\t$this->const [$r] [0] = \"MAIN_MENUFRONT_STANDARD_FORCED\";\n\t$this->const [$r] [1] = \"chaine\";\n\t$this->const [$r] [2] = \"oblyon_menu.php\";\n\t$this->const [$r] [3] = 0;\n\t$this->const [$r] [4] = 1;\n\t$this->const [$r] [5] = 'current';\n\t$this->const [$r] [6] = 1;\n\n\t$r ++;\n\t$this->const [$r] [0] = \"MAIN_MENU_SMARTPHONE_FORCED\";\n\t$this->const [$r] [1] = \"chaine\";\n\t$this->const [$r] [2] = \"oblyon_menu.php\";\n\t$this->const [$r] [3] = 0;\n\t$this->const [$r] [4] = 1;\n\t$this->const [$r] [5] = 'current';\n\t$this->const [$r] [6] = 1;\n\n\t$r ++;\n\t$this->const [$r] [0] = \"MAIN_MENUFRONT_SMARTPHONE_FORCED\";\n\t$this->const [$r] [1] = \"chaine\";\n\t$this->const [$r] [2] = \"oblyon_menu.php\";\n\t$this->const [$r] [3] = 0;\n\t$this->const [$r] [4] = 1;\n\t$this->const [$r] [5] = 'current';\n\t$this->const [$r] [6] = 1;\n\n\t$r ++;\n\t$this->const [$r] [0] = \"OBLYON_COLOR_MAIN\";\n\t$this->const [$r] [1] = \"chaine\";\n\t$this->const [$r] [2] = \"#0083A2\";\n\t$this->const [$r] [3] = 'Oblyon maincolor';\n\t$this->const [$r] [4] = 1;\n\t$this->const [$r] [5] = 'allentities';\n\t$this->const [$r] [6] = 0;\n\n\t$r ++;\n\t$this->const [$r] [0] = \"OBLYON_COLOR_TOPMENU_BCKGRD\";\n\t$this->const [$r] [1] = \"chaine\";\n\t$this->const [$r] [2] = \"#333333\";\n\t$this->const [$r] [3] = 'Oblyon background topmenu color';\n\t$this->const [$r] [4] = 1;\n\t$this->const [$r] [5] = 'allentities';\n\t$this->const [$r] [6] = 0;\n\n\t$r ++;\n\t$this->const [$r] [0] = \"OBLYON_COLOR_TOPMENU_BCKGRD_HOVER\";\n\t$this->const [$r] [1] = \"chaine\";\n\t$this->const [$r] [2] = \"#0083a2\";\n\t$this->const [$r] [3] = 'Oblyon background topmenu hover color';\n\t$this->const [$r] [4] = 1;\n\t$this->const [$r] [5] = 'allentities';\n\t$this->const [$r] [6] = 0;\n\n\t$r ++;\n\t$this->const [$r] [0] = \"OBLYON_COLOR_TOPMENU_TXT\";\n\t$this->const [$r] [1] = \"chaine\";\n\t$this->const [$r] [2] = \"#f4f4f4\";\n\t$this->const [$r] [3] = 'Oblyon topmenu text color';\n\t$this->const [$r] [4] = 1;\n\t$this->const [$r] [5] = 'allentities';\n\t$this->const [$r] [6] = 0;\n\n\t$r ++;\n\t$this->const [$r] [0] = \"OBLYON_COLOR_LEFTMENU_BCKGRD\";\n\t$this->const [$r] [1] = \"chaine\";\n\t$this->const [$r] [2] = \"#333333\";\n\t$this->const [$r] [3] = 'Oblyon background leftmenu color';\n\t$this->const [$r] [4] = 1;\n\t$this->const [$r] [5] = 'allentities';\n\t$this->const [$r] [6] = 0;\n\n\t$r ++;\n\t$this->const [$r] [0] = \"OBLYON_COLOR_LEFTMENU_BCKGRD_HOVER\";\n\t$this->const [$r] [1] = \"chaine\";\n\t$this->const [$r] [2] = \"#444444\";\n\t$this->const [$r] [3] = 'Oblyon background leftmenu hover color';\n\t$this->const [$r] [4] = 1;\n\t$this->const [$r] [5] = 'allentities';\n\t$this->const [$r] [6] = 0;\n\n\t$r ++;\n\t$this->const [$r] [0] = \"OBLYON_COLOR_LEFTMENU_TXT\";\n\t$this->const [$r] [1] = \"chaine\";\n\t$this->const [$r] [2] = \"#f4f4f4\";\n\t$this->const [$r] [3] = 'Oblyon leftmenu leftmenu hover color';\n\t$this->const [$r] [4] = 1;\n\t$this->const [$r] [5] = 'allentities';\n\t$this->const [$r] [6] = 0;\n\n\t$r ++;\n\t$this->const [$r] [0] = \"OBLYON_COLOR_BCKGRD\";\n\t$this->const [$r] [1] = \"chaine\";\n\t$this->const [$r] [2] = \"#F4F4F4\";\n\t$this->const [$r] [3] = 'Oblyon background color';\n\t$this->const [$r] [4] = 1;\n\t$this->const [$r] [5] = 'allentities';\n\t$this->const [$r] [6] = 0;\n\n\t$r ++;\n\t$this->const [$r] [0] = \"OBLYON_COLOR_LOGO_BCKGRD\";\n\t$this->const [$r] [1] = \"chaine\";\n\t$this->const [$r] [2] = \"#FFFFFF\";\n\t$this->const [$r] [3] = 'Oblyon background logo color';\n\t$this->const [$r] [4] = 1;\n\t$this->const [$r] [5] = 'allentities';\n\t$this->const [$r] [6] = 0;\n\n\n\t// Dictionaries\n\tif (! isset($conf->oblyon->enabled)) {\n\t\t$conf->oblyon=new stdClass();\n\t\t$conf->oblyon->enabled=0;\n\t}\n\t$this->dictionnaries=array();\n}", "function __construct()\r\n\t\t{\r\n\t\t$MiniComponents =jomres_singleton_abstract::getInstance('mcHandler');\r\n\t\tif ($MiniComponents->template_touch)\r\n\t\t\t{\r\n\t\t\t$this->template_touchable=false; return;\r\n\t\t\t}\r\n\t\t$ePointFilepath = get_showtime('ePointFilepath'); \r\n\t\tif (file_exists($ePointFilepath.'language'.JRDS.get_showtime('lang').'.php'))\r\n\t\t\trequire_once($ePointFilepath.'language'.JRDS.get_showtime('lang').'.php');\r\n\t\telse\r\n\t\t\t{\r\n\t\t\tif (file_exists($ePointFilepath.'language'.JRDS.'en-GB.php'))\r\n\t\t\t\trequire_once($ePointFilepath.'language'.JRDS.'en-GB.php');\r\n\t\t\t}\r\n\t\t\r\n\t\tif (get_showtime('task') == \"asamodule_report\")\r\n\t\t\t{\r\n\t\t\t$showtime = jomres_singleton_abstract::getInstance('showtime');\r\n\t\t\t\r\n\t\t\t$asamodule_plugin_information = get_showtime('asamodule_plugin_information');\r\n\t\t\t\r\n\t\t\t$asamodule_plugin_information['j06000number_of_properties'] = \r\n\t\t\t\tarray(\r\n\t\t\t\t\t\"asamodule_task\"=>\"number_of_properties\",\r\n\t\t\t\t\t\"asamodule_info\"=>\"Designed to be used with asamodule, and will show the number of published properties on the site.\",\r\n\t\t\t\t\t\"asamodule_example_link\"=>JOMRES_SITEPAGE_URL_NOSEF.'&tmpl='.get_showtime(\"tmplcomponent\").'&topoff=1&task=number_of_properties',\r\n\t\t\t\t\t\"asamodule_manual_link\"=>''\r\n\t\t\t\t\t);\r\n\t\t\tset_showtime('asamodule_plugin_information',$asamodule_plugin_information);\r\n\t\t\t}\r\n\t\t}", "protected function construct(){\n\n }", "function __construct() \r\n{\r\n $this->name=\"scheduled_job\";\r\n $this->title=\"scheduled job module\";\r\n $this->module_category=\"<#LANG_SECTION_SYSTEM#>\";\r\n //$this->checkInstalled();\r\n}", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__) .'/';\n $this->view_path = $this->module_path . 'views/';\n }", "function __construct( $moduleID, $pathModuleRoot ) \n {\n $this->values[ ModuleCreator::KEY_MODULE_ID ] = $moduleID;\n $this->values[ ModuleCreator::KEY_PATH_RAD_ROOT ] = $pathModuleRoot;\n }", "public function __construct()\n {\n parent::__construct();\n \n $this->m_define();\n }", "public function __construct()\n {\n $sModuleId = 'payppaypalplus';\n\n $this->setModuleData(\n array(\n 'id' => $sModuleId,\n 'title' => 'PayPal Plus',\n 'description' => 'PayPal Plus payments module for OXID eShop',\n )\n );\n\n $this->load($sModuleId);\n }", "public function init()\n {}", "private function createModule($name)\n\t{\n\t\t// get the module generator\n\t\trequire_once $this->cliPath . 'module/generator.php';\n\n\t\t// start a new module generator\n\t\t$module = new ModuleGenerator($name);\n\t}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "public function init() {}", "function __Construct()\n {\n parent::__Construct();\n }", "public static function build($name, $title) {\r\n\tif (!is_dir('modules/' . $name)) {\r\n\t $name = str_replace('-','_',tools::sanitizeString($name));\r\n\t tools::createDirectory('modules/' . $name);\r\n\t $template = '<?php\r\n namespace ' . $name . ';\r\n\r\n /**\r\n * @title ' . str_replace('\\'', '\\\\\\'', $title) . '\r\n * @description ' . str_replace('\\'', '\\\\\\'', $title) . '\r\n * @version 1\r\n * @browsers all\r\n * @php_version_min 5.3\r\n */\r\n\r\n class ' . $name . ' extends \\module {\r\n protected $name = \\'' . str_replace('\\'', '\\\\\\'', $name) . '\\';\r\n }\r\n ?>';\r\n\t file_put_contents('modules/' . $name . '/module.php', $template);\r\n\t include('modules/' . $name . '/module.php');\r\n\t $name2 = $name . '\\\\' . $name;\r\n\t $mod = new $name2();\r\n\t $page = new \\page('1', $name);\r\n\t $page->setModule($name);\r\n\t $page->setTitle('Index ' . $name);\r\n\t $page->setRegex('@^index$@');\r\n\t $mod->addPage($page);\r\n\t $mod->save();\r\n\t if (PROFILE == 'www')\r\n\t\t$config = new \\config('config.php', TRUE);\r\n\t else\r\n\t\t$config = new \\config('profiles/'.PROFILE . '/config.php', TRUE);\r\n\t $config->add('$config[\\'activeModules\\'][\\'' . $name . '\\']', '0');\r\n\t return $config->save();\r\n\t}else {\r\n\t return FALSE;\r\n\t}\r\n }", "public function __construct(){\n\t\t\tglobal $db_user;\n\t\t\tparent::__construct($db_user['module']);\n\t\t\t\n\t\t}", "public function __construct()\n {\n $this->module_roots = Main::$module_roots;\n $this->load_supported_features();\n }", "function __construct ($path)\n {\n $this->basepath = $path ;\n // pull the module and package names out of the path\n $this->moduleName = basename ( $path, \"/\" ) ; // just in case there are any trailing /\n $this->packageName = basename ( dirname ( dirname ( $path ) ) ) ; // simpler than explode :)\n require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php' ;\n $mb = new ModuleBuilder ( ) ;\n $this->packageKey = $mb->getPackageKey ( $this->packageName ) ;\n \n $this->load () ;\n \n }", "public function __construct()\n {\n Configure::checkTokenKey();\n $this->Discord = new Discord(Configure::read('Discord'));\n\n //Initialize the ModuleManager.\n $modulesPriorities = [];\n if (Configure::check('Modules.priority')) {\n $modulesPriorities = Configure::read('Modules.priority');\n }\n\n $this->ModuleManager = new ModuleManager($modulesPriorities);\n }", "public function __init(){}", "public function getModule();", "public function getModule();", "function __construct() {\n\n\t\t}", "public function _construct()\n\t{\n\n\t}", "public function init();", "public function init();", "public function init();", "public function init();", "public function init();", "public function init();", "public function init();", "public function init();", "public function init();", "public function init();", "public function init();", "public function init();", "public function init();", "function __construct() {\r\n $this->config->token = \\Bitrix\\Main\\Config\\Option::get($this->module_id, \"token\", '');\r\n $this->config->api = \\Bitrix\\Main\\Config\\Option::get($this->module_id, \"api\", '');\r\n $this->config->sender = \\Bitrix\\Main\\Config\\Option::get($this->module_id, \"sender\", '');\r\n\t}", "public function make() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}" ]
[ "0.70421374", "0.7001411", "0.68424916", "0.6837479", "0.6759943", "0.67455304", "0.67301065", "0.67265725", "0.6718134", "0.6717789", "0.67022246", "0.6615979", "0.6575237", "0.6573485", "0.6569661", "0.6569661", "0.6569661", "0.6569661", "0.6569661", "0.6569661", "0.6569054", "0.6549702", "0.654543", "0.6531409", "0.65191394", "0.6513346", "0.6496329", "0.6491405", "0.64678586", "0.6460937", "0.6408342", "0.6386916", "0.63667387", "0.63413346", "0.6336379", "0.63235325", "0.6319151", "0.63181937", "0.63175976", "0.62909234", "0.62526166", "0.62322885", "0.621605", "0.619816", "0.6181962", "0.6179015", "0.61720663", "0.6160726", "0.6156725", "0.6150253", "0.6127753", "0.61241126", "0.6121748", "0.6121748", "0.6121748", "0.6121748", "0.6121748", "0.6121044", "0.6121044", "0.6121044", "0.6121044", "0.6121044", "0.6121044", "0.6121044", "0.6121044", "0.6121044", "0.6121044", "0.6121044", "0.6121044", "0.6121044", "0.6121044", "0.6121044", "0.6108508", "0.6106932", "0.61001915", "0.6094344", "0.6087451", "0.6085479", "0.6081605", "0.6059205", "0.6059205", "0.60551035", "0.605057", "0.6035643", "0.6035643", "0.6035643", "0.6035643", "0.6035643", "0.6035643", "0.6035643", "0.6035643", "0.6035643", "0.6035643", "0.6035643", "0.6035643", "0.6035643", "0.60313284", "0.60261804", "0.6024187", "0.6024187", "0.6024187" ]
0.0
-1
/ Gets the error generated by the validation method.
public function getError() { return $this->err; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValidationFailed();", "public function validAndGetErrorMsg() {\r\n require_once 'Samus/Samus_CRUD/Samus_CRUD_RequestValidator.php';\r\n $req = new Samus_CRUD_RequestValidator($this->object);\r\n $req->init();\r\n return $req->result();\r\n }", "public function getError();", "public function getError();", "public function getError();", "public function getError() {\n\t\treturn $this->error;\n\t}", "public function getError() {\n\t\treturn $this->error;\n\t}", "public function getError() {\n\t\treturn $this->error;\n\t}", "public function getError() {\r\n return $this->error;\r\n }", "public function getError() { return $this->error; }", "public function getError () {\n\t\t\treturn $this->error; // seems useless for now\n\t\t}", "public function getError() {\n return $this->error;\n }", "public function getError() {\n return $this->error;\n }", "public function getError() {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError()\n {\n return $this->error;\n }", "public function getError() {\n return $this->get(self::ERROR);\n }", "public function getError() {\n return $this->get(self::ERROR);\n }", "public function getError() {}", "public function getError() {\n\n return $this->error;\n }", "function getError(){\n\t\t\treturn $this->error;\n\t\t}", "public function getError() {\n return $this->_error;\n }", "public function getError()\n {\n return $this->_error;\n }", "public function getError()\n {\n return $this->_error;\n }", "public function getError() {\n return $this->_error;\n }", "public function getError()\n\t{\n\t\treturn $this->_error;\n\t}", "public function getError()\n {\n return count($this->errors) ? current($this->errors) : NULL;\n }", "public function getError(){\n\t\treturn $this->error;\n\t}", "public function get_error() {\n return $this->error;\n }", "public function get_error() {\r\n return $this->error;\r\n }", "function getError()\r\n\t{\r\n\t\treturn $this->error_code;\r\n\t}", "public function get_error()\n\t\t{\n\t\t\treturn $this->error;\n\t\t}", "public function getError() {\n\t\treturn $this->current_error;\n\t}", "public static function error() {\n\t\treturn $this->_error;\n\t}", "public function getErrorMessage();", "public function getErrorMessage();", "public function get_error();", "public function get_error();", "function getError()\n\t{\n\t\treturn $this->err;\n\t}", "public function error()\n\t{\n\t\treturn $this->_errors['error'];\n\t}", "public function error()\n\t{\n\t\treturn $this->_errors['error'];\n\t}", "function getError()\n\t{\n\t\treturn $this->errors;\n\t}", "function getError()\n\t{\n\t\treturn $this->errors;\n\t}", "public function getError()\n\t{\n\t\t$arr = each($this->error);\n\t\treturn $arr['value'];\n\t}", "public function getError()\n {\n return $this->currentError;\n }", "public function getError() {\n\t\treturn self::$error;\n\t}", "public function getError()\n {\n return isset($this->error) ? $this->error : null;\n }", "public function getErrorMsg()\n\t{\n\t\treturn $this->error;\n\t}", "public function getError() {\n return self::$error;\n }", "public function error()\n {\n return $this->_error;\n }", "function getErrorMsg() {\n\t\treturn $this->errorMsg;\n\t}", "public function error () {\n\n return $this->_error;\n }", "public function error() {\n return $this->error;\n }", "public function error()\n {\n return $this->error;\n }", "public function error()\n {\n return $this->error;\n }", "public function error()\n\t{\n\t\treturn reset($this->errors);\n\t}", "public function error()\n {\n return $this->_error;\n }", "public function get_error(){\n return $this->error;\n }", "public function getErrorMessage()\n\t{\n\t\treturn $this->errorMessage;\n\t}", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getError()\n\t{\n\t\treturn $this->_usrError;\n\t}", "public static function getError()\n\t{\n\t\treturn self::$error;\n\t}", "public function getErrorMessage() {\n return $this->errorMessage;\n }", "public function getError()\n {\n }", "public function getError()\n {\n $nb_errors = count($this->errors);\n\n if (0 === $nb_errors) {\n return null;\n }\n\n return $this->errors[$nb_errors - 1];\n }", "public function getError()\n {\n return $this->fileInfo['error'];\n }", "public function getError() \n {\n $this->execute();\n \n return $this->error;\n }", "function error() {\n return $this->error_message;\n }", "public function getError()\n {\n return isset($this['error'])\n ? $this['error']\n : null;\n }", "public function getErrorMessage()\r\n {\r\n return $this->error_message;\r\n }", "public function getErrorMessage()\n\t{\n\t\treturn $this->_errorMessage;\n\t}", "public function getErrorMessage()\n {\n return $this->error_message;\n }", "public function error()\n {\n return $this->type('error');\n }", "public function getError(): string\n {\n return $this->error;\n }", "public function getErrorMessage()\n {\n return $this->validator->errors()->all();\n }", "public function errorMessage()\n {\n return $this->error;\n }", "function Error() {\n\t\treturn $this->error;\n\t}", "public function errorMessage()\n\t{\n\t\treturn $this->_source->errorMessage();\n\t}" ]
[ "0.79085577", "0.78873736", "0.76370144", "0.76370144", "0.76370144", "0.7602829", "0.7602829", "0.7602829", "0.7598822", "0.7597429", "0.7596064", "0.7587656", "0.7587656", "0.7587656", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7587489", "0.7555123", "0.7555123", "0.7543531", "0.75362116", "0.7533872", "0.7531002", "0.7528562", "0.7528562", "0.7528016", "0.75259423", "0.7506354", "0.7493558", "0.74910086", "0.7487787", "0.74784833", "0.7473704", "0.7454388", "0.74386317", "0.74326485", "0.74326485", "0.7432517", "0.7432517", "0.7427587", "0.7422929", "0.7422929", "0.7418238", "0.7418238", "0.7415231", "0.7395297", "0.7393812", "0.73607886", "0.7347189", "0.7325438", "0.7324261", "0.73147374", "0.73106587", "0.73097336", "0.73095757", "0.73095757", "0.7294374", "0.72908956", "0.72787505", "0.7276031", "0.72752434", "0.72752434", "0.72752434", "0.72752434", "0.72752434", "0.72752434", "0.72752434", "0.7251261", "0.7237222", "0.7232891", "0.72318184", "0.7230213", "0.7229397", "0.7224214", "0.7223662", "0.7218836", "0.7218768", "0.72114676", "0.7210041", "0.7195527", "0.71803397", "0.7175668", "0.71685874", "0.71641135", "0.7154418" ]
0.7417952
59
Store a newly created resource in storage.
public function store(Request $request, Product $product, User $buyer) { $rules = [ 'quantity' => 'required|integer|min:1' ]; $this->validate($request, $rules); if($buyer->id == $product->seller_id){ return $this->errorResponse('El comprador y el vendedor no pueden ser el mismo', Response::HTTP_UNPROCESSABLE_ENTITY); } if(!$buyer->esVerificado()){ return $this->errorResponse('El comprador no ha sido verificado', Response::HTTP_UNPROCESSABLE_ENTITY); } // dd($product->seller); if(!$product->seller->esVerificado()){ return $this->errorResponse('El vendedor no ha sido verificado', Response::HTTP_UNPROCESSABLE_ENTITY); } if(!$product->esDisponible()){ return $this->errorResponse('El producto no está disponible', Response::HTTP_UNPROCESSABLE_ENTITY); } if($product->quantity < $request->quantity){ return $this->errorResponse('La cantidad de producto no es suficiente', Response::HTTP_UNPROCESSABLE_ENTITY); } return DB::transaction(function() use ($request, $product, $buyer) { $product->quantity -= $request->quantity; $product->save(); $transaction = Transaction::create([ 'quantity' => $request->quantity, 'buyer_id' => $buyer->id, 'product_id' => $product->id ]); return $this->showOne($transaction, Response::HTTP_CREATED); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.7285922", "0.714503", "0.71324795", "0.6639801", "0.6620405", "0.6568167", "0.65257645", "0.650948", "0.64484984", "0.6375281", "0.6373189", "0.63650924", "0.63650924", "0.63650924", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731" ]
0.0
-1
Bypass if authentication is not required
public function call() { if (false === $this->shouldAuthenticate()) { return $this->next->call(); } $app = \Slim\Slim::getInstance(getenv('APP_NAME')); $app->hook('slim.before.dispatch', function() use ($app) { $resource = $app->router()->getCurrentRoute()->getName(); $permission = $app->request->getMethod(); $auth = $app->auth; $acl = $app->acl; if (!$auth->hasIdentity()) { return $app->redirectTo('intranet.login'); } $identity = $auth->getIdentity(); $app->view()->getInstance()->addGlobal('identity', $identity); if (!$acl->isAllowed($identity['role'], $resource, $permission)) { return $app->redirectTo('intranet.unauthorized'); } }); $this->next->call(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function requiresAuthentication() {\n return false;\n }", "public function authenticate() { return false; }", "protected function loginIfRequested() {}", "public static function forceAuthentication() {\n\t\tif (!self::authenticated()) {\n\t\t\tself::redirectToLogin();\n\t\t}\n\t}", "public function use_authentication()\n {\n }", "public function is_auth_required() {\r\n\r\n\t\treturn false;\r\n\t}", "public function checkAuthentication() {}", "public function maybeBypassLogin() {\n\t\t$bypass = apply_filters( 'aad_auto_forward_login', false );\n\n\t\t/*\n\t\t * If the user is attempting to logout AND the auto-forward to AAD\n\t\t * login is set then we need to ensure we do not auto-forward the user and get\n\t\t * them stuck in an infinite logout loop.\n\t\t */\n\t\tif ( $this->wantsToLogin() && $bypass && ! isset( $_GET['code'] ) ) {\n\t\t\twp_redirect( $this->getLoginUrl() );\n\t\t\tdie();\n\t\t}\n\t}", "public function doAuthentication();", "public function before()\n {\n if (in_array($this->request->action(), $this->_no_auth_action))\n {\n $this->_auth_required = FALSE;\n }\n\n parent::before();\n }", "protected function require_login()\n {\n return false;\n }", "protected function notAuthenticated()\n {\n $this->response = $this->response->withStatus(401);\n $this->jsonBody($this->payload->getInput());\n }", "private function login()\n {\n if (!isset($_SERVER['PHP_AUTH_USER']) || !$this->isAdmin()) {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n exit;\n }\n }", "public function use_authentication() {\n return $this->proxy_user && $this->proxy_pass;\n }", "private function _secureBackend()\n\t{\n\t\tif (!$this->_isAuthenticated()) {\n\t\t\theader(\"HTTP/1.1 401 Unauthorized\");\n\t\t\texit();\n\t\t}\n\t}", "public function authenticate() {\n\t\treturn FALSE;\n\t}", "public function skipsAuthorization(): bool\n {\n return true;\n }", "function http_require_auth() {\n\theader('WWW-Authenticate: Basic realm=\"HTTP Authentication System\"');\n\theader('HTTP/1.0 401 Unauthorized');\n\techo \"You must enter a valid login ID and password to access this resource\\n\";\n\texit;\n}", "public function beforeExecute() {\n $instance = \\UserAuth::getInstance();\n if ( $instance->isAuthenticated() === false) {\n $this->redirect(Main::getHomeRouter()->createUrl('login/login'));\n }\n }", "function auth_required() {\n $authinconfig = $this->config->taverna->needAuth;\n if (strcasecmp($authinconfig, 'false') == 0) {\n return FALSE; //no authorization required so we are authorized\n }\n return TRUE;\n }", "function auth(){\n\t\t//TODO auth implementieren\n\t\treturn true;\n\t}", "private function _checkAuth()\n {\n // check login or not\n if (!$this->getUser()->isAuthenticated()) {\n $this->redirect('login');\n }\n }", "function force_login()\n{\n\tif (!isset($GLOBALS['PHPCAS_CLIENT'])) {\n check_auth();\n }\n\tphpCAS::forceAuthentication();\n}", "protected function shouldSkipAuth()\n {\n $config = Config::getInstance();\n $disableAuth = (bool)$config->get('php-censor.security.disable_auth', false);\n $defaultUserId = (int)$config->get('php-censor.security.default_user_id', 1);\n\n if ($disableAuth && $defaultUserId) {\n $user = Factory::getStore('User')->getByPrimaryKey($defaultUserId);\n\n if ($user) {\n return true;\n }\n }\n\n return false;\n }", "abstract protected function auth();", "function allowAuthentication() {\n\t\t// true: will show login form if no cookie contains the userID.\n\t\treturn false;\n\t}", "private function authenticate() {\n\t\t//we do not need a session, so we don't need to have unnused db-entries in session db\n\t\tsession_destroy();\n\n\t\t$token = FormUtil::getPassedValue('token', null, 'GETPOST');\n\t\t$addr = $_SERVER['REMOTE_ADDR'];\n\n\t\tif($token == $this->getVar('Authtoken') && $this->getVar('Authtoken') != null && ($addr == $this->getVar('AllowedHost') || $this->getVar('AllowedHost') == '*')) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\techo 'You are a hacker, right?';\n\t\t\texit();\n\t\t}\n\t}", "function check_auth() {\n global $conf;\n if ($_SERVER['PHP_AUTH_USER'] !== $conf['username'] && $_SERVER['PHP_AUTH_PW'] !== $conf['password']) {\n header('WWW-Authenticate: Basic realm=\"CMS\"');\n header('HTTP/1.0 401 Unauthorized');\n print 'Could not authorise.';\n die();\n }\n}", "function authenticate() {}", "protected function authRequired()\n {\n return true;\n }", "private function _needsAuthentication() {\n\t\tif(isset(Environment::$api->noAuthRoutes) && is_array(Environment::$api->noAuthRoutes) && is_array($this->request->params)) {\n\t\t\t$requestRoute = implode('/', $this->request->params);\n\t\t\tforeach (Environment::$api->noAuthRoutes as $key => $route) {\n\t\t\t\tif($route===$requestRoute) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(Environment::$api->noAuth) { \n\t\t\treturn false;\n\t\t}\n\t\tif($this->method==='OPTIONS') {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function resetAuthentication()\n\t{\n\t\t$this->_authentication = false;\n\t}", "public function checkAccess()\n {\n if (!$this->isAuthenticated()) {\n header('HTTP/1.1 401 Unauthorized');\n exit();\n }\n }", "function disableAuth($value = true){\n\t\t$GLOBALS['amfphp']['disableAuth'] = $value;\n\t}", "public function authenticate() {}", "private function _prompt_login($user_id = 0)\n {\n header('WWW-Authenticate: Basic realm=\"'.$user_id.'\"');\n header('HTTP/1.0 401 Unauthorized');\n }", "function sloodle_require_login_no_guest()\n {\n global $CFG, $SESSION, $FULLME;\n // Attempt a direct login initially\n require_login(0, false);\n // Has the user been logged-in as a guest?\n if (isguestuser()) {\n // Make sure we can come back here after login\n $SESSION->wantsurl = $FULLME;\n // Redirect to the appropriate login page\n if (empty($CFG->loginhttps)) {\n redirect($CFG->wwwroot .'/login/index.php');\n } else {\n $wwwroot = str_replace('http:','https:', $CFG->wwwroot);\n redirect($wwwroot .'/login/index.php');\n }\n exit();\n }\n }", "public function requestAuth()\n {\n return null;\n }", "function unauthorized($realm = 'PHPRestSQL') {\n header('WWW-Authenticate: Basic realm=\"'.$realm.'\"');\n header('HTTP/1.0 401 Unauthorized');\n }", "public function authenticationReqd(){\n\t\theader('HTTP/1.0 401 Unauthorized');\n\t\t$this['app']['hologram']->setModule(\"WWW\")->log(\\Bakery\\Utilities\\Hologram::NORMAL, \"Response: Page requires authentication\");\r\n\t\t\n\t\t$_SESSION['redirect_to'] = $this['request']['uri'];\n\t\t\n\t\tif($this->isJson()){\n\n\t\t\treturn array(\"response\" => \"authentication required\");\n\t\t\t\n\t\t}\n\t\t\n\t\theader(\"Location: {$this['app']['security.login']['handler']}\");\n\t\t\n\t}", "public function authenticate()\n\t{\n\t\t$this->errorCode==self::ERROR_NONE;\n\t}", "private function _checkAuth()\n { if(!(isset($_SERVER['HTTP_X_USERNAME']) and isset($_SERVER['HTTP_X_PASSWORD']))) {\n // Error: Unauthorized\n $this->_sendResponse(401);\n }\n $username = $_SERVER['HTTP_X_USERNAME'];\n $password = $_SERVER['HTTP_X_PASSWORD'];\n // Find the user\n $user=User::model()->find('LOWER(username)=?',array(strtolower($username)));\n if($user===null) {\n // Error: Unauthorized\n $this->_sendResponse(401, 'Error: User Name is invalid');\n } else if(!$user->validatePassword($password)) {\n // Error: Unauthorized\n $this->_sendResponse(401, 'Error: User Password is invalid');\n }\n }", "public function isAuth() {}", "public static function forceAuthentication() \n\t{\n\t\tacPhpCas::setReporting();\n\t\treturn phpCAS::forceAuthentication();\t\t\n\t}", "function strictUserAuth($username) {\r\n\t\treturn true;\r\n\t}", "public function authentication()\n {\n }", "function strictUserAuth( $username ) {\n return true;\n }", "public function authenticate();", "public function authenticate();", "public function authenticate();", "public function beforeAction()\n {\n // do nothing, just disable the login check in parent::beforeAction;\n //\n }", "private function _getAuth()\n {\n if (!isset($_SERVER['PHP_AUTH_USER'])) {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n echo 'Sorry this action is not allowed for you';\n return false;\n } else {\n \n if ($_SERVER['PHP_AUTH_USER'] == 'testUser' && $_SERVER['PHP_AUTH_PW'] == 'testPassword') {\n return true;\n }\n \n return false;\n \n }\n }", "public function checkAuth();", "public function checkAuth();", "function requiresAuth()\n {\n return parent::requiresAuth() ||\n $this->create || $this->delete;\n }", "protected function protect()\n {\n header('HTTP/1.1 401 Unauthorized');\n\n switch ($this->type) {\n default:\n case self::AUTH_BASIC:\n header('WWW-Authenticate: Basic realm=\"' . $this->realm . '\"');\n break;\n case self::AUTH_DIGEST:\n header(\n 'WWW-Authenticate: Digest realm=\"' . $this->realm .\n '\", qop=\"auth\", nonce=\"' . md5(uniqid()) . '\", opaque=\"' . md5(uniqid()) . '\"'\n );\n break;\n }\n }", "function auth() {\n header('WWW-Authenticate: Basic realm=\"Citations\"');\n header('HTTP/1.0 401 Unauthorized');\n print 'authorisation required';\n exit;\n }", "function authorizedUsersOnly(){\n global $authenticatedUser;\n if(empty($authenticatedUser)){\n header(\"HTTP/1.1 401 Unauthorized\");\n header(\"Location: https://eso.vse.cz/~frim00/marvelous-movies/error-401\");\n exit();\n }\n }", "protected function needsAuthentication()\n {\n return !empty($this->authType);\n }", "protected function loginAuthenticate(){\n\n\t\t\n\t}", "public function checkAuthentication() \n {\n if(!isset($this->userInfo['admin_id']) && empty($this->userInfo['admin_id'])) \n {\n redirect('login/loginPage');\n }\n }", "public function authUser(){\n if(!isset($this->sessionBool) || empty($this->sessionBool)){\n die($this->alerts->ACCESS_DENIED);\n }else{\n if(!$this->sessionBool){\n die($this->alerts->ACCESS_DENIED);\n }\n } \n }", "public function preDispatch()\n {\n parent::preDispatch();\n if (!Mage::getSingleton('customer/session')->authenticate($this)) {\n $this->setFlag('', 'no-dispatch', true);\n }\n }", "protected function unauthorizedArea()\n\t{\n\t\t// Disable if there is a text file there.\n\t\tif ( file_exists(LD_PLUGIN_DIR.'/disable_auth.txt'))\n\t\t\treturn;\n\t\t\n\t\theader('WWW-Authenticate: Basic realm=\"'. $this->instance->relm.'\"');\n\t\theader('HTTP/1.0 401 Unauthorized');\n\t\techo '<h1>Authorization Required.</h1>';\n\t\texit;\n\t}", "function authenticate() {\n //this would be for hard-coded username/password, sometimes useful if you \n //don't have a database\n //echo $_SERVER[\"PHP_AUTH_USER\"] . \"<BR>\";\n if ((isset($_SERVER[\"PHP_AUTH_USER\"]) && ($_SERVER['PHP_AUTH_USER'] == 'client') &&\n isset($_SERVER['PHP_AUTH_PW']) && ($_SERVER[\"PHP_AUTH_PW\"] == 'secret'))) {\n header('HTTP/1.0 200 OK'); //all is good!\n } else {\n -\n //don't let them in!\n header('WWW-Authenticate: Basic realm=\"Test Authentication System\"');\n header('HTTP/1.0 401 Unauthorized');\n echo \"You must enter a valid login ID and password to access this resource\\n\";\n }\n exit; //stop execution of the program so we don't get any more errors\n}", "public function authenticate(){\n $user = $_SERVER['PHP_AUTH_USER'];\n $pass = $_SERVER['PHP_AUTH_PW'];\n\n if(!empty($user) && $this->api_config['allowed_users'][$user] === $pass){\n return True;\n }\n return False;\n }", "public function preDispatch()\n {\n parent::preDispatch();\n\n if (!Mage::getSingleton('customer/session')->authenticate($this)) {\n $this->setFlag('', 'no-dispatch', true);\n }\n }", "public function preDispatch()\n {\n parent::preDispatch();\n\n if (!Mage::getSingleton('customer/session')->authenticate($this)) {\n $this->setFlag('', 'no-dispatch', true);\n }\n }", "public function mustbeuser()\n {\n if (!$this->hasuser())\n {\n $this->web()->noaccess();\n }\n }", "public static function requireUnauthorized()\n {\n if(SessionHelper::isUserLoggedIn()){\n header('location: ' . (string)getenv('URL') . '/');\n }\n }", "public function __handleAuthentication() {\n $allowActions = array('adminLogin');\n\n if(strpos($this->action, 'admin') !== false && !in_array($this->action, $allowActions)) {\n $params = $this->getParams();\n\n if(empty($params['token']) || !$this->Session->check($params['token'])) {\n $this->sendError(API_MSG_INCORRECT_INPUT, API_CODE_NG, API_HTTP_CODE_200);\n }\n }\n }", "public function testAuthenticateNoHeaderWithParameterDisabled()\n {\n $request = new ServerRequest();\n\n $this->auth = new JwtAuthenticate($this->Registry, [\n 'userModel' => 'Users',\n 'parameter' => false,\n ]);\n\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n\n $request = new ServerRequest(['url' => 'posts/index?token=' . $this->token]);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n }", "public function isAuth();", "protected function hasAuth()\n {\n return !! $this->options['authentication'];\n }", "public function setAuthenticated();", "public function authenticate() {\n }", "function json_oauth_force_reauthentication() {\n\tif ( is_user_logged_in() ) {\n\t\t// Another handler has already worked successfully, no need to\n\t\t// reauthenticate.\n\n\t\treturn;\n\t}\n\n\t// Force reauthentication\n\tglobal $current_user;\n\t$current_user = null;\n\tget_currentuserinfo();\n}", "public function restrict() {\n\t\tif (!$this->is_logged_in()) {\n\t\t\tredirect('login', 'refresh');\n\t\t}\n\t}", "public function auth(){\n\t\tif( !isset($_SESSION) || !isset($_SESSION['userId']) ) {\n\t\t\treturn false;\n\t\t} elseif( !parent::fetchFromDB($_SESSION['userId']) ){\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn ( $this->checkIp() && $this->checkSessionId() );\n\t\t}\n\t}", "protected function denyRequest()\n {\n $this->loginAction();\n }", "private function compare_with_login()\n {\n }", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function preDispatch()\n {\n parent::preDispatch();\n $action = $this->getRequest()->getActionName();\n $loginUrl = Mage::helper('customer')->getLoginUrl();\n if (!Mage::getSingleton('customer/session')->authenticate($this, $loginUrl)) {\n $this->setFlag('', self::FLAG_NO_DISPATCH, true);\n }\n }", "private function authenticate()\n {\n $this->_validator->setCredentials($this->_user, $this->_pass);\n if ($this->_validator->authenticate()) {\n $this->_accepted = true;\n }\n }", "function require_webauth() {\n return $this->auth->require_webauth();\n }", "public function isAuthenticated()\r\n {\r\n return true; \r\n }", "function wind_require_login() {\n $conf = wind_config();\n $ticketid = false;\n if(array_key_exists($conf[\"logout_arg\"],$_GET)) {\n unset($_GET[$conf[\"logout_arg\"]]);\n wind_logout($conf);\n }\n if(array_key_exists(\"ticketid\",$_GET)) {\n $ticketid = $_GET['ticketid'];\n unset($_GET['ticketid']);\n }\n if(wind_exceptions($conf) \n || (array_key_exists(\"wind_user\",$_SESSION) \n\t && $_SESSION[\"wind_user\"])) {\n return \"OK\";\n }\n if($ticketid) {\n if(wind_verify_ticket($conf,$ticketid)) {\n\treturn \"OK\";\n }\n } \n wind_redirect($conf);\n }", "public function isLoginRequired()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function beginLogin() {\n return false;\n }", "function auth(){\n\tif(@!$_SESSION['auth']){\n\t\treturn false;\n\t}else{\n\t\treturn true;\n\t}\n}", "public function skipsAuthorization(): bool\n {\n return Gate::allows('skips-authorization', $this);\n }", "public function require_http_basic_auth() {\n\t\t// If authentication data was sent\n\t\tif ( is_null( $this->get_php_auth()->username ) || is_null( $this->get_php_auth()->password ) ) {\n\t\t\tthrow new HTTPBasicUnauthorized();\n\t\t}\n\n\t\treturn true;\n\t}", "function is_behind_webauth() {\n return $this->auth->is_behind_webauth();\n }", "public function beforeFilter() {\n if (is_object($this->Auth) && method_exists($this->Auth, 'allow')) {\n $this->Auth->allow();\n }\n }", "public function requireLogin()\n\t{\n\t\tif (!$this->getFBUID()) {\n\t\t\t$this->redirectToLogin();\n\t\t}\n\t}", "function auth_fail() {\n header('HTTP/1.1 401 Unauthorized');\n header('WWW-Authenticate: Digest realm=\"'.$realm.\n\t '\",qop=\"auth\",nonce=\"'.uniqid().'\",opaque=\"'.md5($realm).'\"');\n}", "public function call()\n {\n $req = $this->app->request();\n $res = $this->app->response();\n $authUser = $req->headers('PHP_AUTH_USER');\n $authPass = $req->headers('PHP_AUTH_PW');\n $dbUserAuthenticated = false;\n if ($authUser && $authPass){\n \t$stmt = $this->db->prepare('SELECT * FROM user WHERE username=:username AND password=:password;');\n \t$stmt->bindValue(':username', $authUser);\n \t$stmt->bindValue(':password', $authPass);\n\t\t\t$result = $stmt->execute();\n\t\t\tif($row = $result->fetchArray()){\n\t\t\t\t$dbUserAuthenticated = true;\n\t\t\t}\n }\n \n if ($authUser && $authPass && $dbUserAuthenticated) {\n $this->next->call();\n } \n else {\n \t//Statuscode 403 statt 401 zurückliefern, damit Browser kein Auth Fenster öffnet\n $res->setStatus(403);\n //Auth Header nicht setzen, da Statuscode sonst irgendwie auf 401 geändert wird\n //$res->header('WWW-Authenticate', sprintf('Basic realm=\"%s\"', $this->realm));\n }\n }", "public function hydrate()\n {\n if (auth()->guest()) {\n throw new AuthenticationException();\n }\n }" ]
[ "0.73726463", "0.73420566", "0.73229694", "0.6895796", "0.6864355", "0.68610966", "0.68545777", "0.680227", "0.6788091", "0.67189884", "0.67095715", "0.6701655", "0.6629694", "0.6602682", "0.6596859", "0.6585494", "0.65160054", "0.6483137", "0.64804476", "0.6450043", "0.6432154", "0.6427501", "0.6414888", "0.639968", "0.6384293", "0.6382232", "0.63684714", "0.63680243", "0.6357683", "0.63273686", "0.63190913", "0.6308794", "0.63077414", "0.6280055", "0.62482387", "0.6246529", "0.62463593", "0.62441385", "0.622566", "0.62241566", "0.62107944", "0.6195436", "0.61904943", "0.61793625", "0.6170859", "0.61575943", "0.6154251", "0.6152757", "0.6152757", "0.6152757", "0.611898", "0.61187893", "0.60962045", "0.60962045", "0.60853064", "0.6065158", "0.6056555", "0.60494214", "0.60389894", "0.6038354", "0.6021057", "0.60205853", "0.6020168", "0.6013638", "0.60096955", "0.6002145", "0.59965336", "0.59965336", "0.5994985", "0.59745616", "0.5973063", "0.59507513", "0.594757", "0.59391046", "0.5934873", "0.59220785", "0.5921435", "0.5919139", "0.5911888", "0.5908458", "0.59059155", "0.58937764", "0.58937764", "0.58937764", "0.58937764", "0.58930105", "0.5888317", "0.5887157", "0.5881984", "0.58779466", "0.58767986", "0.5876351", "0.58637434", "0.58613706", "0.5856236", "0.5853605", "0.5850582", "0.5839993", "0.58384985", "0.58288056", "0.5826456" ]
0.0
-1
get suggest list product
public function getSuggestList($limit, $offset = 0, $categoryId = null) { return $this->model->getSuggestList($limit, $offset, $categoryId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function suggest()\n\t{\n\t\tsession_write_close();\n\t\t$suggestions = $this->Item_products->get_search_suggestions($this->input->get('term'),100);\n\t\techo json_encode($suggestions);\n\t}", "function suggest()\n {\n // allow parallel searchs to improve performance.\n session_write_close();\n $suggestions = $this->Item->get_manage_items_search_suggestions($this->input->get('term'), 100);\n echo json_encode($suggestions);\n }", "function suggest()\n\t{\n\t\t//allow parallel searchs to improve performance.\n\t\tsession_write_close();\n\t\t$params = $this->session->userdata('price_rules_search_data') ? $this->session->userdata('price_rules_search_data') : array('deleted' => 0);\n\t\t$suggestions = $this->Price_rule->get_search_suggestions($this->input->get('term'),$params['deleted'],100);\n\t\techo json_encode(H($suggestions));\n\t}", "public function getSuggestions(Product $product)\n\t{\n\t\tLog::info('Getting suggestions for product id: '.$product->id);\n\t\t$tag = $product->tag;\n\t\tif (!is_null($tag) && !empty($tag))\n\t\t{\n\t\t\treturn Product::where('tag', 'LIKE', '%'.$tag.'%')\n\t\t\t\t\t->where('id', '!=', $product->id)\n\t\t\t\t\t->where('image_links', '!=', ',,,,')\n\t\t\t\t\t->orderBy('model', 'desc')\n\t\t\t\t\t->take(4)\n\t\t\t\t\t->get();\n\t\t} else \n\t\t{\n\t\t\treturn collect();\n\t\t}\n\t}", "function suggest() {\n $suggestions = $this->ticket->get_search_suggestions($this->input->get('term'), 100);\n\n echo json_encode($suggestions);\n }", "public function ajaxProcessGetAutocompleteProducts()\n {\n $query = Tools::getValue('q', false);\n if (!$query or $query === '' || strlen($query) < 2) {\n die();\n }\n\n $sql = 'SELECT p.`id_product`, p.`reference`, pl.`name`\n\t\tFROM `'._DB_PREFIX_.'product` p\n\t\t'.Shop::addSqlAssociation('product', 'p').'\n\t\tLEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product = p.id_product \n\t\t AND pl.id_lang = '.(int)$this->context->language->id.\n Shop::addSqlRestrictionOnLang('pl').'\n )\n WHERE pl.`name` LIKE \"%'.pSQL($query).'%\" \n OR p.`reference` LIKE \"%'.pSQL($query).'%\" \n OR p.`id_product` LIKE \"%'.pSQL($query).'%\"\n\t\tGROUP BY p.id_product';\n\n $products = Db::getInstance()->executeS($sql);\n\n $results = array();\n foreach ($products as $product) {\n $results[] = '['.$product['reference'].'] '.$product['name'].'|'.$product['id_product'];\n }\n\n /**\n * Result:\n *\n * Product|ID\n * Next Product|ID\n * ...\n */\n die(implode(PHP_EOL, $results));\n }", "public function getSuggestData()\n {\n \tif(!$this->helper('findologic')->isAlive()){\n \t\treturn parent::getSuggestData();\n \t}\t\n \t\n if (!$this->_suggestData) {\n \t$this->_suggestData = array();\n \t\n\t\t\t$query = $this->helper('catalogsearch')->getQueryText();\n \t$result = $this->helper('findologic')->autocomplete($query);\n\n \tif(isset($result->suggestions)) {\n \t $counter = 0;\n \t $data = array();\n \t \n\t foreach ($result->suggestions as $suggestion) {\n\t \t$suggestion = explode('|', $suggestion);\n\t \t\n\t $_data = array(\n\t 'title' => $suggestion[0],\n\t 'row_class' => ++$counter % 2 ? 'odd' : 'even',\n\t 'num_of_results' => $suggestion[1]\n\t );\n\t\n\t if ($_data['title'] == $query) {\n\t array_unshift($data, $_data);\n\t }\n\t else {\n\t $data[] = $_data;\n\t }\n\t }\n\t $this->_suggestData = $data;\n \t}\n }\n\n\t\treturn $this->_suggestData;\n }", "function suggest()\n\t{\n\t\t$suggestions = $this->Giftcard->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}", "function suggest()\n\t{\n\t\t$suggestions = $this->Supplier->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}", "public function suggest()\n\t{\n\t\t$suggestions = $this->Role->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}", "function suggest() {\n $suggestions = $this->tour->get_search_suggestions($this->input->post('term'), 100);\n echo json_encode($suggestions);\n }", "function productNameHint()\n{\n\t$query = $_POST['query'];\n\t$productManager = new productManager();\n\treturn $productManager->getNameHint($query);\n}", "public function suggests() : array;", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('warehouse_id');\n $client_id = ( !is_numeric(request()->get('client_id')) ) ? auth()->user()->current_client_id : request()->get('client_id');\n\n //instantiate model and run search\n $product_model = new Product();\n return $product_model->getListSearch(request()->get('search_term'), $warehouse_id, $client_id);\n }", "function getSearchTerms(ProductInterface $product);", "public function autoSuggestList()\n {\n // TODO: Implement autoSuggestList() method.\n }", "public function autocompletesearch($sellerid,$name)\n\t {\n\t\t \n\t\t $result4='';\n\t\t\t\t if($name!='')\n\t\t\t\t {\n\t\t\t\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t\t $products = $objectManager->create('Magento\\Catalog\\Model\\ProductFactory')\n\t\t\t\t ->create()\n\t\t\t\t\t\t\t\t\t ->getCollection()\n\t\t\t\t\t\t\t\t\t//->addFieldToFilter('store_id', 1)\n ->addFieldToFilter('name', array(\"like\"=>'%'.$name.'%') );\t\t\t\t\t\t\t\t\t\n\t\t\t\t \n\t\t\t\t //echo \"<pr>\";var_dump($products->getData()); \n\t\t\t\t if(!empty($products->getData())):\n\t\t\t\t foreach($products as $product)\n\t\t\t\t {\n $productId =$product->getId();\t \n\t\t\t\t\t\t\n\t\t\t\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t\t\t\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t\t\t\t\t$connection = $resource->getConnection();\n\t\t\t\t\t\t $quote_sql = \"Select * FROM marketplace_product where mageproduct_id=$productId and seller_id=$sellerid \";\n\t\t\t\t\t\t$result_result = $connection->fetchAll($quote_sql);\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($result_result))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$currentproduct = $objectManager->create('Magento\\Catalog\\Model\\Product')->load($productId);\n //echo\"<pre>\";print_r($currentproduct->getData());\n\t\t\t\t\t\t$cats = $currentproduct->getCategoryIds();\n\t\t\t\t\t\t$c=0;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$categoryname='';\n\t\t\t\t\t\t$categoryId='';\n\t\t\t\t\t\t foreach ($cats as $categoryIds) {\n\t\t\t\t\t\t\tif($categoryIds!=2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($c<1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t//$currentcategory = $objectManager->create('Magento\\Catalog\\Model\\category')->load($categoryIds);\n\t\t\t\t\t\t //$sami=$categoryIds;\n\t\t\t\t\t\t\t //$currentcategory = $objectManager->create('Magento\\Catalog\\Model\\category')->load($sami);\n\t\t\t\t\t\t\t// $categoryname=$currentcategory->getName();\n\t\t\t\t\t\t\t//$categoryId = 3;\n\t\t\t\t\t\t\t$categoryId =$categoryIds;\n\t\t\t\t\t\t\t$_objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t\t\t\t\t$object_manager = $_objectManager->create('Magento\\Catalog\\Model\\Category')\n\t\t\t\t\t\t\t->load($categoryId);\n\t\t\t\t\t\t\t//print_r($object_manager->getData());\n\t\t\t\t\t\t\t$categoryname=$object_manager->getName();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$c++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} \n\n\t\t\t\t\t\t$producturl=$currentproduct->getProductUrl();\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t//$result4[]=array(\"id\"=>$currentproduct->getId(),\"name\"=>$currentproduct->getName(),\"categoryName\"=>$currentcategory->getName());\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$result4[]=array(\"id\"=>$currentproduct->getId(),\"name\"=>$currentproduct->getName(),\"categoryName\"=>$categoryname,\"categoryid\"=>$categoryId,\"urltag\"=>$name);\t\n\t\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 $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'product'=>$result4);\n\t\t return $result; \n else:\n \t\t\t\t \n\t\t\t\t $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'product'=>'No result found!');\n\t\t return $result; \n\t\t\t\t \n\t\t\t\t endif;\n \n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t \n\t\t\t\t\t $result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n\t\t\t\t\t return $result; \n\t\t\t\t }\n\t\t\t\t \n\t }", "public function product_by_search() {\n\n $CI = & get_instance();\n\n $this->auth->check_admin_auth();\n\n $CI->load->library('lproduct');\n\n $product_id = $this->input->post('product_id');\n\n\n\n $content = $CI->lproduct->product_search_list($product_id);\n\n $this->template->full_admin_html_view($content);\n\n }", "public function getProductsBySearch()\n {\n $collection = new AjaxModel();\n $productList = $collection->getProducts($_POST['name']);\n foreach ($productList as $item) {\n //colon delimiter for each cell, bar delimiter for each row\n echo $item[0].\":\".$item[1].\":\".$item[2].\":\".$item[3].\":\".$item[4].\"|\";\n }\n }", "public function suggestPurchaseRequest()\n {\n return Product::select(DB::raw('id, productName as prDescription, reorderAmount - amount as prQty,reorderAmount, \"Write a descriptive Purpose for this request\" as prPurpose'))\n ->whereRaw('amount < reorderAmount and amount > 0')->limit(env('PURCHASE_ORDER_LIMIT'))->get();\n }", "public function get_prod_options_by_search()\n {\n $keyword = $this->input->get('keyword'); \n\n $result = $this->products_model->get_prod_by_search($keyword); \n\n $prod_options = '';\n\n if(!empty($result))\n {\n foreach($result as $row)\n { \n\t\t\t\t$prod = '['.$row['prod_id'].'] '.$row['prod_name'].' '.$row['prod_color']; \n\n\t\t\t\tpreg_match('/\\\\[(.+?)\\\\]/', $prod, $match); \n\n\t\t\t\t$pid = $match[1]; \n\n\t\t\t\t/* $prod .= \" - \".$pid; */\n\t\t\t\t\n\n $prod_options .= '<option value=\"'.$prod.'\"></option>';\n\t\t\t}\t\n }\n\t\t\n\t\techo $prod_options; \n\t}", "public function index()\n {\n $products = $this->getProducts();\n $categories = $this->getCategories();\n $users = $this->getUsers();\n\n return new SuggestionsResponse(\n request('query'),\n $categories,\n $products,\n $users\n );\n }", "function suggest_category() {\n $suggestions = $this->ticket->get_category_suggestions($this->input->get('term'));\n echo json_encode($suggestions);\n }", "public function getAutocomplete()\n {\n // get a suggester query instance\n $query = $this->client->createSuggester();\n $query->setQuery(strtolower(Input::get('term')));\n $query->setDictionary('suggest');\n $query->setOnlyMorePopular(true);\n $query->setCount(10);\n $query->setCollate(true);\n\n // this executes the query and returns the result\n $resultset = $this->client->suggester($query);\n\n $suggestions = array();\n\n foreach ($resultset as $term => $termResult) {\n foreach ($termResult as $result) {\n $suggestions[] = $result;\n }\n }\n\n return Response::json($suggestions);\n }", "public function suggest() {\n\t\tif(isset($_POST['query'])) $this->query_str = $_POST['query'];\n\t\telse return;\n\n\t\t$raw = null;\n\n\t\t//check if jar exists\n\t\tif(file_exists('../executable/app.jar')) $raw = shell_exec('cd ../executable/ && java -jar app.jar suggest ' . escapeshellarg($this->query_str));\n\t\telse return;\n\n\t\t$this->results = json_decode($raw);\n\t}", "public function purchasedProductsAutocomplete()\n\t{\n\t\t$purchase_data = $this->purchase->viewPurchaseProduct($purchase_id);\n\t}", "public function htheme_get_product_category_autocomplete() {\r\n\r\n\t\t#ARGUMENTS\r\n\t\t$args = array(\r\n\t\t\t'taxonomy' => 'product_cat',\r\n\t\t\t'orderby' => 'name',\r\n\t\t\t'show_count' => 1,\r\n\t\t\t'pad_counts' => 1,\r\n\t\t\t'hierarchical' => 0,\r\n\t\t\t'hide_empty' => 1\r\n\t\t);\r\n\r\n\t\t#GET CATEGORIES\r\n\t\t$the_categories = get_categories($args);\r\n\r\n\t\t#ARRAY\r\n\t\t$result = array();\r\n\r\n\t\t#SETUP RESULTS\r\n\t\tforeach ( $the_categories as $term )\t{\r\n\t\t\t$result[] = array(\r\n\t\t\t\t'value' => $term->term_id,\r\n\t\t\t\t'label' => $term->name,\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t#RETURN RESULTS\r\n\t\treturn $result;\r\n\r\n\t}", "public function getProductNameList()\n {\n $productName = [];\n // get the max of product for displaying\n $number = (int) $this->getRequest()->getParam('number');\n if ($number <= 0) {\n // set the default value\n $number = 5;\n }\n $productList = $this->product->getCollection()->addAttributeToFilter('type_id', array('eq' => 'simple'))->setPageSize($number)->setCurPage(1)->load()->getData();\n foreach ($productList as $product) {\n $productName[] = [\n 'name' => $this->productFactory->create()->load($product['entity_id'])->getName()\n ];\n }\n return $productName;\n }", "function suggestProduct($purchased_product_id){\n $get_purchased_product_info = $this->connection->prepare(\"\n SELECT product_description, category_id \n FROM product\n WHERE product_id=?\n ORDER BY timestamp DESC\n \");\n $get_purchased_product_info ->bind_param(\"i\",$purchased_product_id);\n $get_purchased_product_info ->execute();\n $get_purchased_product_info ->bind_result( $product_description, $category_id );\n $count=0;\n while($get_purchased_product_info ->fetch()){};\n $count++;\n /*get suggested products*/\n $get_suggested_product = $this->connection->prepare(\"\n SELECT product_id, product_name, price, weight, product_color, file \n FROM product\n WHERE category_id = ? AND product_id != ?\n LIMIT 3\n \");\n $get_suggested_product ->bind_param(\"ii\",$category_id, $purchased_product_id);\n $get_suggested_product->execute();\n $get_suggested_product->bind_result( $product_id, $product_name, $price, $weight, $product_color, $file );\n $found=0;\n while($get_suggested_product->fetch()){\n $found++;\n if( $file == \"\" ){\n $img = \"<img src='/upload/profile icon.png' class='img' />\";\n }else{\n $img = \"<img src='/upload/\".$file .\"' class='img' />\";\n }\n \n /*switch purpose id to create activity button for the products\n * 0 purpose id = activity buttons for users\n * 1 purpose id = activity button for admin\n */\n $activity_btn = \"<div id='btn' class='btn'>\n <button id='btn-front' class='btn-front' onclick='add_to_cart(\\\"\".$product_id.\"product_id_holder\\\",\\\"\".$product_id.\"table_id\\\", \\\"\".$product_id.\"choose_size\\\", \\\"\".$product_id.\"price\\\")'>\n Add to cart....\n </button>\n </div>\";\n \n echo\n \"<a href='#\".$product_name.$product_id.\"same_product_feed' >\".\n \"<div id='\".$product_name.$product_id.\"same_product_feed' class='figure'>\".\n \"<div id='\".$product_id.\"same_product_img_holder' class='img_holde' onclick='buy(\\\"\".$product_name.\"\".$product_id .\"same_product_feed\\\", \\\"\".$product_id.\"same_product_img_holder\\\", \\\"\".$product_id.\"same_product_buy_holder\\\", \\\"\".$product_id.\"same_product_buy_everything_holder\\\", \\\"\".$product_id.\"same_product_filter\\\")'>\".$img.\"</div>\".\n \"<div id='\".$product_id.\"same_product_buy_holder' class='product_name_holder' style='display:block;'>\".\n \"<div id='\".$product_id.\"same_product_buy_everything_holder'>\".\n \"<div class='margin_bottom'>\".$product_name.\"</div>\".\n \"<div class='margin_bottom'>\".\"R \".number_format($price, 2).\"</div>\".\n \"<div id='\".$product_id.\"same_product_filter' class='filter hide '>\".\n \"<div class='margin_bottom'>\".$product_description.\"</div>\".\n \"<div class='label'>\".$product_color.\"</div>\";\n\n echo \"<form action='object.php' method='post'>\";\n echo \"<div class='label'>\".\"Choose size\".\"</div>\";\n echo \"<select name='add_to_cart_product_size' id='\".$product_id.\"choose_size'>\";\n $weight_array = explode( ',' , $weight );\n for( $i= 0; $i < count( $weight_array ); $i++ ){\n echo \"<option type='checkbox' value='\".$weight_array[$i].\"' onclick='sizes'>\".$weight_array[$i].\"<option/>\";\n }\n echo \"</select>\";\n echo \"<div class='label'>\".\"Choose quantity\".\"</div>\";\n echo \"<select name='product_quantity' >\".\n \"<option value='1'>\".\"1\".\"</option>\".\n \"<option value='2'>\".\"2\".\"</option>\".\n \"<option value='3'>\".\"3\".\"</option>\".\n \"<option value='4'>\".\"4\".\"</option>\".\n \"<option value='5'>\".\"5\".\"</option>\".\n \"<option value='6'>\".\"6\".\"</option>\".\n \"<option value='7'>\".\"7\".\"</option>\".\n \"<option value='8'>\".\"8\".\"</option>\".\n \"<option value='9'>\".\"9\".\"</option>\".\n \"</select>\";\n //create hidden inputs to hold and send data of the product sent\n echo \"<input type='hidden' id='\".$product_id.\"product_id_holder' value='\".$product_id.\"'/>\".\n \"<input type='hidden' id='\".$product_id.\"table_id' value='2'/>\".\n \"<input type='hidden' id='\".$product_id.\"price' value='\".$price.\"'/>\".\n \"<input type='hidden' name='add_to_cart_product_id' value='\".$product_id.\"'/>\".\n \"<input type='hidden' name='add_to_cart_table_id' value='2'/>\".\n \"<input type='hidden' name='add_to_cart_product_price' value='$price'/>\".\n \"<input type='hidden' name='send_id' value='8'/>\".\n $activity_btn.\n \"<span id='output\".$product_id.\"'></span>\".\n \"</form>\".\n \"</div>\".\n \"</div>\".\n \"</div>\".\n \"</div>\".\n \"</a>\"\n ;\n }\n \n if($found > 0){\n echo \"<div class='successful_cart_holder'>\". \n \"You added the product successfully! \".\n \"<span class='heading'>\".\n \"You might also want to add these to your cart.\".\n \"</span>\".\"<br/>\".\n \"OR \".\n \"<a href='checkout.php'>\".\n \"<button class='btn_5'>Checkout</button>\".\n \"</a>\".\n \"OR \".\n \"<a href='index.php'>\".\n \"<button class='btn_5'>\".\n \"Continue Shopping\".\n \"</button>\".\n \"</a>\".\n \"</div>\";\n }else{\n echo \"<div class='successful_cart_holder'>\".\n \"Successfully added to cart.\".\n \"<a href='index.php'>OK</a>\".\n \"</div>\";\n }\n \n /*close connection*/\n $this->connection->close();\n }", "public function actionSuggestTags()\n {\n if (isset($_GET['q']) && ($keyword = trim($_GET['q'])) !== '') {\n $tags = Tag::model()->suggestTags($keyword);\n if ($tags !== array())\n echo implode(\"\\n\", (array)$tags);\n }\n }", "function item_search()\n {\n session_write_close();\n $suggestions = $this->Item->get_item_search_suggestions($this->input->get('term'), 'unit_price', 100);\n echo json_encode($suggestions);\n }", "public function getProductRecommendations()\n {\n return $this->productRecommendations;\n }", "public function searchProduct(Request $request){\n\n $searchKey = $request->term;\n $products = farmproduct::where('productName','LIKE','%'.$searchKey.'%')->get();\n $result='';\n \n if(count($products)==0){\n $result[] = 'No matches found.';\n }else{\n foreach($products as $product){\n $result[] = $product->productName;\n }\n }\n return $result;\n }", "function productoption()\n\t{\n\t\t$res = $this->product_model->productOptionList();\n\t\techo \"<pre />\";\n\t\tprint_r($res);\n\t\texit;\n\t\t\n\t\t//check if product type list is pulled. if not, list is set to empty array\n\t\t// $productTypeList = ( $res->rc == 0 ) ? $res->data->producttypelist : array();\n\t\t\n\t\t// $data['mainContent'] = 'producttype_list_view.tpl';\n\t\t\n\t\t// $data['data'] = array(\n\t\t\t// 'baseUrl'\t\t\t=> base_url(),\n\t\t\t// 'title'\t\t\t\t=> 'Product Type',\n\t\t\t// 'msgClass'\t\t\t=> $this->msgClass,\n\t\t\t// 'msgInfo'\t\t\t=> $this->msgInfo,\n\t\t\t// 'productTypeList'\t=> $productTypeList\n\t\t// );\n\t\t\n\t\t// $this->load->view($this->globalTpl, $data);\t\n\t}", "public function suggest() {\n // Set the content type to json\n $this->response->type('application/json');\n $result = $this->searchPlace();\n $this->set('result', $result);\n }", "public function AlternativesPerProduct()\n {\n $dos = ArrayList::create();\n $altCount = Config::inst()->get('RepeatOrderForm', 'number_of_product_alternatives');\n for ($i = 1; $i <= $altCount; $i++) {\n $alternativeField = \"Alternative\".$i.\"ID\";\n if ($this->$alternativeField) {\n $product = Product::get()->filter(['ID' => $this->$alternativeField])->first();\n if ($product) {\n $dos->push($product);\n }\n }\n }\n if ($dos && $dos->count()) {\n return $dos;\n }\n return null;\n }", "public function getRecommendations();", "public function getSuggestions()\n {\n return $this->suggestions;\n }", "public function getSuggestions()\n {\n return $this->suggestions;\n }", "public function getSuggestions()\n {\n return $this->suggestions;\n }", "public function ProductSearch() {\n\t\t\n\t\t$search_data \t\t=\tjson_decode($this->request->getContent(),true);\n\t\t$search_term\t\t=\t$search_data['search_term'];\n\t\t$seller_id\t\t\t=\t$search_data['seller_id'];\n\t\t\n\t\t$querydata \t\t= \t$this->_objectManager->create('Webkul\\Marketplace\\Model\\Product')\n\t\t\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t\t\t->addFieldToFilter(\n\t\t\t\t\t\t\t\t\t'seller_id',\n\t\t\t\t\t\t\t\t\t['eq' => $seller_id]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t->addFieldToFilter(\n\t\t\t\t\t\t\t\t\t'status',\n\t\t\t\t\t\t\t\t\t['eq' =>1]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t->addFieldToSelect('mageproduct_id')\n\t\t\t\t\t\t\t\t->setOrder('mageproduct_id');\n\t\t\t//return \t$querydata->getData();\t\t\t\t\n\t\t\t$collection = $this->_productCollectionFactory->create()->addAttributeToSelect(\n '*'\n );\n\t\t$collection->addAttributeToFilter('entity_id', array('in' => $querydata->getData()));\n\t\t$collection->addAttributeToFilter('name', array('like' => '%'.$search_term.'%'));\n\t\t\t\n\t\treturn $collection->getData();\n\t\t\t\n }", "function focus_product_list() {\n $query = $this->db->get('focus_products');\n return $query->result_array();\n }", "public function getProductRecommendationsHtml($query = null)\n {\n if (!$query){\n $query = Mage::helper('autocompleterecommendations')->getQuery();\n }\n \n $productRecommendationsHtml = false;\n \n if ($query->getQueryText()){\n \n $storeId = $query->getStoreId();\n $cacheKey = $storeId.$query->getQueryText().$query->getNumResults();\n $cache = Mage::app()->getCache();\n $productRecommendationsHtml = $cache->load($cacheKey);\n $productRecommendationsHtml = unserialize($productRecommendationsHtml);\n \n if (!$productRecommendationsHtml){\n \n $productRecommendations = $this->_getRecommendations($query);\n \n if ($productRecommendations && $productRecommendations->getSize()>0){\n \n $layout = Mage::getSingleton('core/layout');\n $productRecommendationsBlock = $layout->createBlock('autocompleterecommendations/recommendation');\n \n $productRecommendationsBlock->setType('product');\n $productRecommendationsBlock->setRecommendations($productRecommendations);\n \n $productRecommendationsHtml = $productRecommendationsBlock->toHtml();\n \n $cache->save(serialize($productRecommendationsHtml), $cacheKey, array('BLOCK_HTML'), 604800);\n \n }\n \n }\n \n }\n \n return $productRecommendationsHtml;\n }", "private function getSuggest(): Suggestions\n {\n if (!$this->suggest) {\n $this->suggest = new Suggestions(config(\"dadataapi.token\", \"\"));\n $this->suggest->init();\n }\n return $this->suggest;\n }", "public function product_by_search()\n\t{\n\t\t$CI =& get_instance();\n\t\t$this->auth->check_admin_auth();\n\t\t$CI->load->library('lproduct');\n\t\t$product_id = $this->input->post('product_id');\t\t\n $content = $CI->lproduct->product_search_list($product_id);\n $sub_menu = array(\n\t\t\t\tarray('label'=> 'Manage Product', 'url' => 'Cproduct', 'class' =>'active'),\n\t\t\t\tarray('label'=> 'Add Product', 'url' => 'Cproduct/manage_product')\n\t\t\t);\n\t\t$this->template->full_admin_html_view($content,$sub_menu);\n\t}", "public function getsuggestedAction()\r\n {\r\n $User = $this->getUser();\r\n $data = $User->getSuggested();\r\n return $data;\r\n }", "public function getSimilarProducts()\n {\n return $this->similar_products;\n }", "public function suggest() {\n \n $query = ['query' => ['match_all' => []]];\n if (Request::has('q')) {\n $query = [\n 'query' => [\n 'nested' => [\n 'path' => 'prefLabels',\n 'query' => [\n 'bool' => [\n 'must' => [\n [ 'prefix' => [ 'prefLabels.label' => Request::get('q') ] ],\n [ 'match' => [ 'prefLabels.lang' => 'en' ] ]\n ]\n ]\n ]\n ]\n ]\n ];\n }\n \n $hits = Subject::suggest($query, 'resource');\n return response()\n ->json($hits)\n ->header(\"Vary\", \"Accept\");\n }", "function find_products($keyword)\n{\n return get_products();\n}", "public function getProduct();", "public function getSuggestion()\n {\n return $this->suggestion;\n }", "public function getProductSelections();", "public function getSearch()\n {\n $products = $this->product->getExecuteFormSearch();\n $products->load('variants', 'brand');\n\n $this->theme->breadcrumb()->add('Product Search Result', URL::to('products/search'));\n $this->theme->setTitle('Product Search Result');\n\n $view_data = compact('products');\n\n return $this->theme->of('products.search', $view_data)->render();\n }", "public function suggest($keyword, $limit = 20) {\n $sql = \"SELECT * FROM prd_mahasiswa t INNER JOIN prd_pendaftaran pp ON pp.NIM=t.NIM\n INNER JOIN prd_sidangmaster ps ON ps.IdSidang=pp.IdSidang\n INNER JOIN prd_jenissidang pj ON pj.IDJenisSidang=ps.IDJenisSidang WHERE t.Nama LIKE '%$keyword%' or t.NIM LIKE '%$keyword%'\";\n $models = Yii::app()->db->createCommand($sql)->queryAll();\n $suggest = array();\n foreach ($models as $model) {\n $suggest[] = array(\n 'label' => $model['NIM'] . ' - ' . $model['Nama'] . ' - ' . $model['KodeJurusan'] . ' - ' . $model['NamaSidang'], // label for dropdown list\n 'value' => $model['idPendaftaran'], // value for input field\n 'nim' => $model['NIM'], // return values from autocomplete\n 'namaMhs' => $model['Nama'],\n 'namaProdi' => $model['KodeJurusan'],\n 'namaSidang' => $model['NamaSidang'],\n 'namaSidang' => $model['idPendaftaran'],\n );\n }\n return $suggest;\n }", "private function getSuggestions()\n {\n $category = $this->nodeStorage->load($this->categoryId);\n $secondaryTagIds = $this->getTagIds($category->field_moj_secondary_tags);\n $matchingIds = array_unique($this->getSecondaryTagItemsFor($secondaryTagIds));\n\n if (count($matchingIds) < $this->numberOfResults) {\n $matchingSecondaryTagIds = $this->getAllSecondaryTagItemsFor($secondaryTagIds);\n $matchingIds = array_unique(array_merge($matchingIds, $matchingSecondaryTagIds));\n }\n\n if (count($matchingIds) < $this->numberOfResults) {\n $primaryTagIds = $this->getTagIds($category->field_moj_top_level_categories);\n $matchingPrimaryTagIds = $this->getPrimaryTagItemsFor($primaryTagIds);\n $matchingIds = array_unique(array_merge($matchingIds, $matchingPrimaryTagIds));\n }\n\n $categoryIdIndex = array_search($this->categoryId, $matchingIds);\n\n if ($categoryIdIndex !== false) {\n unset($matchingIds[$categoryIdIndex]);\n }\n\n return $this->loadNodesDetails(array_slice($matchingIds, 0, $this->numberOfResults));\n }", "public function show_recommended_products() {\n\n\t\t\t$submission_id = isset( $_GET['fitts_submission'] ) ? $_GET['fitts_submission'] : '';\n\t\t\tif ( $submission_id ) {\n\n\t\t\t\t$product_ids = get_post_meta( $submission_id, 'linked_products', true );\n\t\t\t\tinclude FQ_PLUGIN_DIR . '/template/fitts-recommended-products.php';\n\n\t\t\t}\n\n\t\t}", "public function getProductInfosList(){\n return $this->_get(1);\n }", "public function product_list()\n\t{\n\t\t$query=$this->db->select('\n\t\t\t\t\ta.product_id,a.product_name,a.price,a.image_thumb,a.variants,a.product_model,\n\t\t\t\t\tc.category_name,c.category_id\n\t\t\t\t')\n\n\t\t\t\t->from('product_information a')\n\t\t\t\t->join('product_category c','c.category_id = a.category_id','left')\n\t\t\t\t->group_by('a.product_id')\n\t\t\t\t->order_by('a.product_name','asc')\n\t\t\t\t->get();\n\n\t\tif ($query->num_rows() > 0) {\n\t\t \treturn $query->result();\t\n\t\t}\n\t\treturn false;\n\t}", "public function autocompleteAction() {\n $suggestions = array(\n 'Application',\n 'Big',\n 'Computer',\n 'Development',\n 'Environment',\n 'Failure',\n 'Green',\n 'Hope',\n 'Injection',\n 'Java',\n 'Kilo'\n );\n\n $this->_helper->viewRenderer->setNoRender(true);\n $this->_helper->layout()->disableLayout();\n\n echo json_encode($suggestions);\n }", "public function getProdKeywords()\n {\n return $this->prod_keywords;\n }", "public function getProductOption();", "public function _getTags(Product $product)\n {\n return $product->getData('meta_keyword');\n }", "public function index()\n {\n $items = SpecSuggestions::getSuggestions();\n return view('admin.suggestions.index', compact('items'));\n }", "public function getSuggestData()\n {\n if (is_null($this->_suggestData)) {\n\n $picklistEntries = $this->getPicklistEntries();\n $response = array();\n $data = array();\n $counter = 0;\n\n if (is_array($picklistEntries)) {\n foreach ($picklistEntries as $entry) {\n $_data = array(\n 'value' => $entry->Moniker,\n 'title' => $entry->PartialAddress,\n 'row_class' => (++$counter)%2?'odd':'even'\n );\n array_push($data, $_data);\n }\n } elseif ($picklistEntries && ($picklistEntries->Score > 0)) { // only one result\n $_data = array(\n 'value' => $picklistEntries->Moniker,\n 'title' => $picklistEntries->PartialAddress,\n 'row_class' => (++$counter)%2?'odd':'even'\n );\n array_push($data, $_data);\n }\n\n $this->_suggestData = $data;\n }\n return $this->_suggestData;\n }", "public function getSupplierList()\n {\n return 'supplier';\n }", "public function search_product(){\n\t\t$CI =& get_instance();\n\t\t$this->auth->check_admin_auth();\n\t\t$CI->load->model('Orders');\n\t\t$product_name = $this->input->post('product_name');\n\t\t$category_id = $this->input->post('category_id');\n\t\t$product_search = $this->Orders->product_search($product_name,$category_id);\n if ($product_search) {\n foreach ($product_search as $product) {\n echo \"<div class=\\\"col-xs-6 col-sm-4 col-md-2 col-p-3\\\">\";\n echo \"<div class=\\\"panel panel-bd product-panel select_product\\\">\";\n echo \"<div class=\\\"panel-body\\\">\";\n echo \"<img src=\\\"$product->image_thumb\\\" class=\\\"img-responsive\\\" alt=\\\"\\\">\";\n echo \"<input type=\\\"hidden\\\" name=\\\"select_product_id\\\" class=\\\"select_product_id\\\" value='\".$product->product_id.\"'>\";\n echo \"</div>\";\n echo \"<div class=\\\"panel-footer\\\">$product->product_model - $product->product_name</div>\";\n echo \"</div>\";\n echo \"</div>\";\n \t}\n }else{\n \techo \"420\";\n }\n\t}", "public function showProduct(){\n\n\n $showquery = \"SELECT p.*,c.catName,b.brandName FROM forproduct as p,\n forcat as c,forbrand as b \n WHERE p.productCat = c.catID AND p.productBrand = b.brandId \n order by p.productId DESC\";\n\n\n \t$showres = $this->db->select($showquery);\n \tif($showres)\n \treturn $showres;\n\t \t}", "function customer_search() {\n $suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('term'), 100);\n echo json_encode($suggestions);\n }", "function getSuggestions($word) {\n\n\tglobal $editablePersonalDict; //bool to set editability of personal dictionary\n\tglobal $silpaspell_module; //the global link to the pspell module\n\n\t$retVal = \"\";\n\n\t//an array of all the suggestions that psepll returns for $word.\n\t$suggestions = silpaspell_suggest($silpaspell_module, $word);\n\n\t// If the number of suggestions returned by pspell is less than the maximum\n\t// number, just use the number of suggestions returned.\n\t$numSuggestions = count($suggestions);\n\t$tmpNum = min($numSuggestions, MAX_SUGGESTIONS);\n\n\tif ($tmpNum > 0) {\n\t\t//this creates the table of suggestions.\n\t\tfor ($i=0; $i<$tmpNum; $i++) {\n\t\t\t$retVal .= '<div class=\"suggestion\">' . $suggestions[$i] . '</div>';\n\t\t}\n\n\t\tif ($editablePersonalDict) {\n\t\t\t$retVal .= '<div class=\"addToDictionary\">Add To Dictionary</div>';\n\t\t}\n\t} else {\n\t\t$retVal .= \"No Suggestions\";\n\t}\n\n\techo $retVal; //the return value - a string containing the table of suggestions.\n\n}", "public function get_list_for_recommanded_pro(){\n\n\t\t$get_list_for_recommanded_pro = array();\n\n\t\t$sql = $this->query(\"SELECT * FROM `products` ORDER BY `popularity` DESC LIMIT 3\");\n\t\n\t\t\twhile ( $row = mysql_fetch_array($sql)) {\n\t\t\t\t# code...\n\n\t\t\t\t$get_list_for_recommanded_pro[] = $row;\n\n\t\t\t}\n\n\t\treturn $get_list_for_recommanded_pro;\n\t}", "function customer_search()\n {\n $suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('term'),100);\n echo json_encode($suggestions);\n }", "public function getProductList(){\n\n $productModel = new ProductModel();\n $products = $productModel->getProductList();\n $this->JsonCall($products);\n }", "function getOfferSpecial2() {\n\t$db =& JFactory::getDBO();\n\t$query = \"SELECT p.*, pf.file_url FROM\n\t\t#__cp_category c JOIN \n\t\t(#__cp_products p JOIN\n\t\t#__cp_product_files pf ON pf.product_id = p.product_id)\n\t\tON c.category_id=p.category_id \n\t\tWHERE p.`featured` = 1 AND p.`published` = 1 \".getWhere().\" GROUP BY p.product_id\";\n\n\t$db->setQuery($query);\n\t$rows = $db->loadObjectList();\n\treturn $rows;\n}", "function get_search_suggestions($search,$limit=25)\n\t{\n\t\t$suggestions = array();\n\t\t$this->db->from('skill');\n\t\t$this->db->like('skill_name', $search);\n\t\t$this->db->where('is_status',0);\n\t\t$this->db->limit($limit);\n\t\t$by_name = $this->db->get();\n\t\t$temp_suggestions = array();\n\t\tforeach($by_name->result() as $row)\n\t\t{\n\t\t\t$temp_suggestions[] = $row->skill_name;\n\t\t}\n\n\t\tsort($temp_suggestions);\n\t\tforeach($temp_suggestions as $temp_suggestion)\n\t\t{\n\t\t\t$suggestions[]=array('label'=> $temp_suggestion);\n\t\t}\n\n\t\t$this->db->select('skill_name_kh');\n\t\t$this->db->from('skill');\n\t\t$this->db->where('is_status',0);\n\t\t$this->db->distinct();\n\t\t$this->db->like('skill_name_kh', $search);\n\t\t$this->db->limit($limit);\n\t\t$by_name_kh = $this->db->get();\n\n\t\t$temp_suggestions = array();\n\t\tforeach($by_name_kh->result() as $row)\n\t\t{\n\t\t\t$temp_suggestions[] = $row->skill_name_kh;\n\t\t}\n\n\t\tsort($temp_suggestions);\n\t\tforeach($temp_suggestions as $temp_suggestion)\n\t\t{\n\t\t\t$suggestions[]=array('label'=> $temp_suggestion);\n\t\t}\n\n\t\t$this->db->from('skill');\n\t\t$this->db->like('skill_major_code', $search);\n\t\t$this->db->where('is_status',0);\n\t\t$this->db->limit($limit);\n\t\t$by_skill_major_code = $this->db->get();\n\t\t$temp_suggestions = array();\n\t\tforeach($by_skill_major_code->result() as $row)\n\t\t{\n\t\t\t$temp_suggestions[] = $row->skill_major_code;\n\t\t}\n\n\t\tsort($temp_suggestions);\n\t\tforeach($temp_suggestions as $temp_suggestion)\n\t\t{\n\t\t\t$suggestions[]=array('label'=> $temp_suggestion);\n\t\t}\n\n\t\t//only return $limit suggestions\n\t\tif(count($suggestions > $limit))\n\t\t{\n\t\t\t$suggestions = array_slice($suggestions, 0,$limit);\n\t\t}\n\n\t\treturn $suggestions;\n\t}", "public function getRecommendedProduct()\n {\n $this->db->connect();\n $sql = \"SELECT * FROM $this->table WHERE recommended = 'yes' LIMIT 4;\";\n $product = $this->db->executeFetchAll($sql);\n return $product;\n }", "public function provides()\n\t{\n\t\treturn array('products');\n\t}", "protected function get_product_reference_list () {\n global $_ud_license_updater;\n //echo \"<pre>\"; print_r( $_ud_license_updater ); echo \"</pre>\"; die();\n $response = array();\n if( \n isset( $_ud_license_updater[ $this->slug ] ) \n && is_callable( array( $_ud_license_updater[ $this->slug ], 'get_products' ) ) \n ) {\n $response = $_ud_license_updater[ $this->slug ]->get_products();\n }\n return $response;\n }", "function htheme_woolist_shortcode( $atts ) {\r\n\r\n\t\t#IF WOOCOMMERCE CLASS EXIST - ADD WOO VISUAL COMPOSER ELEMENTS\r\n\t\tif ( class_exists( 'WooCommerce' ) ){\r\n\t\t\t#SETUP WOO CONTENT CLASS\r\n\t\t\t$htheme_data = $this->htheme_woo_content->htheme_get_woo_product_list($atts, false);\r\n\r\n\t\t\t#RETURN DATA/HTML\r\n\t\t\treturn $htheme_data;\r\n\t\t} else {\r\n\t\t\treturn 'WooCommerce required!';\r\n\t\t}\r\n\r\n\t}", "public function productsearch($sellerid,$name,$userid)\n\t {\n\t\t \n\t\t $result4='';\n\t\t\t\t if($name!='')\n\t\t\t\t {\n\t\t\t\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t\t $products = $objectManager->create('Magento\\Catalog\\Model\\ProductFactory')\n\t\t\t\t ->create()\n\t\t\t\t\t\t\t\t\t ->getCollection()\n\t\t\t\t\t\t\t\t\t// ->addFieldToFilter('store_id', 1); \n ->addFieldToFilter('name', array(\"like\"=>'%'.$name.'%') );\t\t\t\t\t\t\t\t\t\n\t\t\t\t \n\t\t\t\t //var_dump($products->getData());\n\t\t\t\t if(!empty($products->getData())):\n\t\t\t\t foreach($products as $product)\n\t\t\t\t {\n $productId =$product->getId();\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t\t\t\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t\t\t\t\t$connection = $resource->getConnection();\n\t\t\t\t\t\t$quote_sql = \"Select * FROM marketplace_product where mageproduct_id=$productId and seller_id=$sellerid \";\n\t\t\t\t\t\t$result_result = $connection->fetchAll($quote_sql);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($result_result))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$currentproduct = $objectManager->create('Magento\\Catalog\\Model\\Product')->load($productId);\n\t\t\t\t\t\t\t\t\t\t$offfer_tag = $currentproduct->getData('offfer_tag');\n\t\t\t\t\t\t\t\t\t\t$attr = $currentproduct->getResource()->getAttribute('offfer_tag'); \t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$optionText =$attr->getSource()->getOptionText($offfer_tag);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif($optionText=='')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t $optionText='null';\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\t\t\t\t\t\t $_price=$currentproduct->getPrice();\n\t\t\t\t\t\t\t\t\t $_finalPrice=$currentproduct->getFinalPrice();\n\t\t\t\t\t\t\t\t\t $savetag='null';\n\t\t\t\t\t\t\t\t\t\tif($_finalPrice < $_price):\n\t\t\t\t\t\t\t\t\t\t$_savePercent = 100 - round(($_finalPrice / $_price)*100);\n\t\t\t\t\t\t\t\t\t\t//echo $_savePercent;\n\t\t\t\t\t\t\t\t\t\t$savetag=$_savePercent;\n\t\t\t\t\t\t\t\t\t endif;\n\n\t\t\t\t\t\t\t\t $producturl=$currentproduct->getProductUrl();\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t $wishlisttag='';\n\t\t\t\t\t\t\t\t\t\t\tif($userid > 0)\n\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t $wishlist = \"Select * FROM wishlist a,wishlist_item b where a.customer_id=$userid and a.wishlist_id=b.wishlist_id and b.product_id=$productId\";\n\t\t\t\t\t\t\t\t\t\t\t $result_wishlist = $connection->fetchAll($wishlist);\n\t\t\t\t\t\t\t\t\t\t\tif(!empty($result_wishlist))\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$wishlisttag=1;\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\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$wishlisttag=0;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t$wishlisttag=0;\n\t\t\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t $reviewFactory = $objectManager->create('Magento\\Review\\Model\\Review');\n\t\t\t\t\t\t\t\t\t\t $storeId = $this->storeManager->getStore()->getId();\n\t\t\t\t\t\t\t\t\t\t $reviewFactory->getEntitySummary($currentproduct, $storeId);\n\t\t\t\t\t\t\t\t\t\t $ratingSummary = $currentproduct->getRatingSummary()->getRatingSummary();\n\t\t\t\t\t\t\t\t\t\t if($ratingSummary=='')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$ratingSummary='null';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t$result4[]=array(\"id\"=>$currentproduct->getId(),\"name\"=>$currentproduct->getName(),\"description\"=>$currentproduct->getDescription(),\"price\"=>$currentproduct->getPrice(),\"finalPrice\"=>$currentproduct->getFinalPrice(),\"thumbnail\"=>'http://159.203.151.92/pub/media/catalog/product'.$currentproduct->getthumbnail(),\"offferTag\"=>array(\"shareurl\"=>$producturl,\"Tag\"=>$optionText,'discount'=>$savetag,'rating'=>$ratingSummary),'wishlisttag'=>$wishlisttag);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\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 $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'product'=>$result4);\n\t\t return $result; \n else:\n \t\t\t\t \n\t\t\t\t $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'product'=>'No result found!');\n\t\t return $result; \n\t\t\t\t \n\t\t\t\t endif;\n \n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t \n\t\t\t\t\t $result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n\t\t\t\t\t return $result; \n\t\t\t\t }\n\t\t\t\t \n\t }", "public function getProductList()\n {\n $output = $this->product->getProuductList();\n return $output;\n }", "function plugin_suggest_callback() {\r\n\t\t\tglobal $wpdb, $post;\r\n\t\t\t\r\n\t\t\t$posttype = $wpdb->escape($_GET['type']);\r\n\t\t\t$in = $wpdb->escape($_GET['q']);\r\n\r\n\t\t\t$query = \"SELECT ID from $wpdb->posts where post_type = '$posttype' AND post_title like '%$in%' \";\r\n\t\t\t$mypostids = $wpdb->get_col($query);\r\n\r\n\t\t\tforeach ($mypostids as $key => $value) {\r\n\t\t\t\tprint get_the_title($value) . \" [#\" . $value . \"]\" . \"\\n\";\r\n\t\t\t}\r\n\t\t\tdie(); // this is required to return a proper result\r\n\t\t}", "function get_item_kit_search_suggestions($search, $limit=25)\n\t{\n\t\t$suggestions = array();\n\n\t\t$by_name = $this->db->like('name', $search, $this->config->item('speed_up_search_queries') ? 'after' : 'both')\n\t\t\t\t\t->where('deleted',0)\n\t\t\t\t\t->where('category',\"tickets\")\n\t\t\t\t\t->order_by(\"name\", \"asc\")\n\t\t\t\t\t->get(\"item_kits\");\n\t\tforeach($by_name->result() as $row)\n\t\t{\n\t\t\t$suggestions[]=array('value' => 'KIT '.$row->item_kit_id, 'label' => $row->name);\n\t\t}\n\t\t\n\t\t$by_item_kit_number = $this->db->like('item_kit_number', $search, $this->config->item('speed_up_search_queries') ? 'after' : 'both')\n\t\t\t\t\t->where('deleted',0)\n\t\t\t\t\t->where('category',\"tickets\")\n\t\t\t\t\t->order_by(\"item_kit_number\", \"asc\")\n\t\t\t\t\t->get(\"item_kits\");\n\t\tforeach($by_item_kit_number->result() as $row)\n\t\t{\n\t\t\t$suggestions[]=array('value' => 'KIT '.$row->item_kit_id, 'label' => $row->item_kit_number);\n\t\t}\n\t\t\n\t\t//only return $limit suggestions\n\t\tif(count($suggestions > $limit))\n\t\t{\n\t\t\t$suggestions = array_slice($suggestions, 0,$limit);\n\t\t}\n\t\treturn $suggestions;\n\t\t\n\t}", "public function getProductList()\n {\n return $this->_call('catalog_product.list', '');\n }", "function searchProduct($type,$input)\n {\n $products;\n switch($type)\n {\n case 0:\n $products=Product::search($input);\n break;\n case 1:\n $products=Product::searchByName($input);\n break;\n case 2:\n $products=Product::searchByGroup($input);\n break;\n case 3:\n $products=Product::searchBySupplier($input);\n break;\n case 4:\n $products=Product::searchByTag($input);\n break;\n case 5: $products=Product::searchByDescription($input);\n break;\n default:\n break;\n }\n if(!empty($products))\n {\n return $products;\n }else {\n return false;\n }\n }", "public function get_hot_product_list($product_id=\"\",$type=\"\")\n\t{\n\t\t\n\t\t$result= $this->db->update('deals',array('deal_feature' => $type),array(\"deal_id\" => $product_id));\n\t\treturn 1;\n\t}", "public function getProductList()\n {\n if (! $this->productList) {\n $this->productList = $this->getCachedProductList();\n if (! $this->productList) {\n $this->productList = $this->getFinalProductList()\n ->applySearchFilter($this->getCurrentUserPreferencesKey('SEARCHFILTER'), $this->getCurrentUserPreferencesParams('SEARCHFILTER'))\n ->applyGroupFilter($this->getCurrentUserPreferencesKey('GROUPFILTER'), $this->getCurrentUserPreferencesParams('GROUPFILTER'))\n ->applyFilter($this->getCurrentUserPreferencesKey('FILTER'), $this->getCurrentUserPreferencesParams('FILTER'))\n ->applySorter($this->getCurrentUserPreferencesKey('SORT'), $this->getCurrentUserPreferencesParams('SORT'))\n ->applyDisplayer($this->getCurrentUserPreferencesKey('DISPLAY'), $this->getCurrentUserPreferencesParams('DISPLAY'))\n ->getProducts()\n ;\n $this->setCachedProductList($this->productList);\n }\n }\n\n return $this->productList;\n }", "public function suggestAction() {\n\n //GET DETAILS\n $params = array();\n $params['viewer_id'] = Engine_Api::_()->user()->getViewer()->getIdentity();\n $params['text'] = $this->_getParam('text');\n $params['limit'] = $this->_getParam('limit', 40);\n\n //FETCH RESULTS\n $videoSitereviews = Engine_Api::_()->sitereview()->getAutoSuggestedVideo($params);\n\n $data = array();\n $mode = $this->_getParam('struct');\n\n if ($mode == 'text') {\n foreach ($videoSitereviews as $videositereview) {\n $content_photo = $this->view->itemPhoto($videositereview, 'thumb.icon');\n $data[] = array(\n 'id' => $videositereview->video_id,\n 'label' => $videositereview->title,\n 'photo' => $content_photo\n );\n }\n } else {\n foreach ($videoSitereviews as $videositereview) {\n $content_photo = $this->view->itemPhoto($videositereview, 'thumb.icon');\n $data[] = array(\n 'id' => $videositereview->video_id,\n 'label' => $videositereview->title,\n 'photo' => $content_photo\n );\n }\n }\n\n if ($this->_getParam('sendNow', true)) {\n return $this->_helper->json($data);\n } else {\n $this->_helper->viewRenderer->setNoRender(true);\n $data = Zend_Json::encode($data);\n $this->getResponse()->setBody($data);\n }\n }", "public function testSuggest() {\n\n Mage::app()->setCurrentStore(5);\n\n /** @var $suggest MDN_Antidot_Model_Search_Suggest */\n $suggest = Mage::getModel('Antidot/search_suggest');\n\n $feeds = MDN_Antidot_Test_PHPUnitUtil::callPrivateMethod($suggest, 'getFeeds', array());\n\n $this->assertEquals(\n 'featured_products_5_fr&afs:feed=categories_3_fr&afs:feed=brands_3_fr',\n $feeds\n );\n\n\n }", "public function getSearchProducts_List ($text) {\n return API::getAPI('shop:search')->search($text);\n }", "public function productByUrlAction()\n {\n $search = \"http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n $words = explode('/', $search);\n $lastWord = array_pop($words);\n $vars['products'] = $this->model->getProductsBySearch($lastWord);\n $this->view->render('Riding Gear', $vars);\n }", "public static function getSKPD($keyword,$limit=20)\n\t{\n\t\t$models=Lembaga::model()->findAll(array(\n\t\t\t'condition'=>\"(kode_skpd LIKE :keyword OR nama_skpd LIKE :keyword)\", // or id_penembak LIKE \\\"$keyword\\\" \",\n\t\t\t'order'=>'kode_skpd',\n\t\t\t'limit'=>$limit,\n\t\t\t'params'=>array(':keyword'=>\"%$keyword%\")\n\t\t));\n\t\t$suggest=array();\n\t\tforeach($models as $model) {\n\t\t\t$suggest[] = array(\n\t\t\t\t'label'=>$model->kode_skpd.' - '.$model->nama_skpd.'',//.' - '.$model->call_code, // label for dropdown list\n\t\t\t\t'value'=>$model->id, // value for input field\n\t\t\t // return values from autocomplete\n\t\t\t\t'code'=>$model->kode_skpd,\n\t\t\t\t'nama'=>$model->nama_skpd, // return values from autocomplete\n\t\t\t\t//'nis'=>$model->nis_lec,\n\t\t\t\t//'call_code'=>$model->call_code,\n\t\t\t);\n\t\t}\n\t\treturn $suggest;\n\t}", "function fetch_product_list_select($search){\n \t\t$this->db->select('PRODUCT_ID, PRODUCT');\n \t\t$this->db->from('products');\n \t\t$this->db->where('PRODUCT REGEXP', $search);\n \t\t$query=$this->db->get();\n \t\treturn $query->result_array();\n \t}", "public function searchableAs()\n {\n return 'product';\n }", "public function resultSearch(){\n return $this->returnHTML($this->searchProduct());\n }", "public function search($searchTerm)\n {\n $results = array(\n 'snippet' => [],\n 'snippet_code' => [],\n 'page' => [],\n 'product' => [],\n 'actions' => [],\n 'word' => [],\n 'post' => []\n );\n\n $snippets = Yii::$app->user->identity->portal->hasMany(Snippet::className(), ['id' => 'snippet_id'])\n ->viaTable('snippet_portal', ['portal_id' => 'id'])\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'description', $searchTerm],\n ])\n ->limit(10)\n ->all();\n\n foreach ($snippets as $snippet) {\n $results['snippet'][] = [\n 'link' => Url::to([\n '/snippet/edit',\n 'id' => $snippet->id\n ]),\n 'name' => $snippet->name,\n 'id' => $snippet->id,\n 'class' => 'suggest-snippet'\n ];\n }\n\n // SNIPPET CODES / ALTERNATIVES\n\n /** @var SnippetCode[] $snippet_codes */\n $snippet_codes = SnippetCode::find()\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'code', $searchTerm]\n ])\n ->limit(10)\n ->all();\n\n foreach ($snippet_codes as $snippet_code) {\n $results['snippet_code'][] = [\n 'link' => Url::to([\n '/snippet/edit',\n 'id' => $snippet_code['snippet_id'],\n '#' => 'code' . $snippet_code['id'],\n ]),\n 'name' => $snippet_code->getSnippet()->one()->name . ' -> ' . $snippet_code->name,\n 'id' => $snippet_code->id,\n 'class' => 'suggest-snippet-code'\n ];\n }\n\n // Slovnik\n $words = (new Query())->select(\"id, identifier\")->from(\"word\")->where(['like', 'identifier', $searchTerm])\n ->limit(10)->all();\n\n foreach ($words as $word) {\n $results['word'][] = [\n 'link' => Url::to([\n '/word/edit',\n 'id' => $word['id']\n ]),\n 'name' => $word['identifier'],\n 'id' => $word['id'],\n 'class' => 'suggest-word'\n ];\n }\n\n // PAGES\n\n $pages = Page::find()->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ['like', 'title', $searchTerm],\n ])\n ->andWhere([\n 'portal_id' => Yii::$app->user->identity->portal_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($pages as $page) {\n $results['page'][] = [\n 'link' => Url::to(['/page/edit', 'id' => $page['id']]),\n 'id' => $page->id,\n 'name' => $page->breadcrumbs,\n 'class' => 'suggest-page'\n ];\n }\n\n // POSTS\n\n $posts = Post::find()->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ['like', 'title', $searchTerm],\n ])\n ->andWhere([\n 'portal_id' => Yii::$app->user->identity->portal_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($posts as $post) {\n $results['post'][] = [\n 'link' => Url::to(['/post/edit', 'id' => $post['id']]),\n 'id' => $post->id,\n 'name' => $post->name,\n 'class' => 'suggest-post'\n ];\n }\n\n // PRODUCTS\n\n $products = Product::find()\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ])\n ->andWhere([\n 'language_id' => Yii::$app->user->identity->portal->language_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($products as $product) {\n $results['product'][] = [\n 'link' => Url::to([\n '/product/edit',\n 'id' => $product['id']\n ]),\n 'name' => $product->breadcrumbs,\n 'id' => $product->id,\n 'class' => 'suggest-product'\n ];\n }\n\n $processActions = function ($searchTerm, $list, $prefix, $urlSuffix = '') {\n $actions = [];\n foreach ($list as $item) {\n $name = $prefix . $item[0];\n\n if ($searchTerm == '' || (mb_strlen($name) >= mb_strlen($searchTerm) && mb_substr(mb_strtolower($name), 0, mb_strlen($searchTerm)) == mb_strtolower($searchTerm))) {\n $actions[] = [\n 'link' => Url::to([\n '/' . $item[1] . '/' . $urlSuffix,\n ]),\n 'name' => $name,\n 'class' => 'suggest-action'\n ];\n }\n };\n return $actions;\n };\n\n $listActions = [['stránok', 'page'], ['ďakovačiek', 'thanks'], ['prekladov', 'word'], ['multimédii', 'multimedia'], ['snippetov', 'snippet'], ['produktov', 'product'], ['produktových premenných', 'product-var'], ['typov produktu', 'product-type'], ['tagov', 'tag'], ['šablón', 'template'], ['portálov', 'portal'], ['používateľov', 'user'], ['krajín', 'language']];\n $addActions = [['stránku', 'page'], ['ďakovačku', 'thanks'], ['preklad', 'word'], ['snippet', 'snippet'], ['produkt', 'product'], ['produktovú premennú', 'product-var'], ['typ produktu', 'product-type'], ['tag', 'tag'], ['šablónu', 'template'], ['portál', 'portal'], ['používateľa', 'user'], ['krajinu', 'language']];\n\n $results['actions'] += $processActions($searchTerm, $listActions, 'Zoznam ');\n $results['actions'] += $processActions($searchTerm, $addActions, 'Pridať ', 'edit');\n\n return $results;\n }", "public function getMatchingProduct($request);", "public function facetSuggestAction()\n {\n $suggestBlock = $this->getLayout()->createBlock('smile_elasticsearch/catalog_layer_filter_attribute_suggest');\n $this->getResponse()->setBody($suggestBlock->toHtml());\n }", "function similarProducts() {\n $filter = Yii::$app->session->get('filterOption');\n }", "private static function __getProductsListingData() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_Vqmod;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n // optional Product List Filter\n $output = '';\n $result = array();\n\n if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {\n $filterlist_sql = \"select distinct c.categories_id as id, cd.categories_name as name from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c, \" . TABLE_CATEGORIES . \" c, \" . TABLE_CATEGORIES_DESCRIPTION . \" cd, \" . TABLE_TEMPLATES_BOXES . \" tb, \" . TABLE_PRODUCT_ATTRIBUTES . \" pa where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '\" . (int)$lC_Language->getID() . \"' and tb.code = 'manufacturers' and tb.id = pa.id and pa.products_id = p.products_id and pa.value = '\" . (int)$_GET['manufacturers'] . \"' order by cd.categories_name\";\n } else {\n $filterlist_sql = \"select distinct m.manufacturers_id as id, m.manufacturers_name as name from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c, \" . TABLE_MANUFACTURERS . \" m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '\" . (int)$current_category_id . \"' order by m.manufacturers_name\";\n }\n $Qfilterlist = $lC_Database->query($filterlist_sql);\n $Qfilterlist->execute();\n if ($Qfilterlist->numberOfRows() > 1) {\n $output .= '<p><form name=\"filter\" action=\"' . lc_href_link(FILENAME_DEFAULT) . '\" method=\"get\">' . $lC_Language->get('filter_show') . '&nbsp;';\n if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {\n $output .= lc_draw_hidden_field('manufacturers', $_GET['manufacturers']);\n $options = array(array('id' => '', 'text' => $lC_Language->get('filter_all_categories')));\n } else {\n $output .= lc_draw_hidden_field('cPath', $cPath);\n $options = array(array('id' => '', 'text' => $lC_Language->get('filter_all_manufacturers')));\n }\n if (isset($_GET['sort'])) {\n $output .= lc_draw_hidden_field('sort', $_GET['sort']);\n }\n while ($Qfilterlist->next()) {\n $options[] = array('id' => $Qfilterlist->valueInt('id'), 'text' => $Qfilterlist->value('name'));\n }\n $output .= lc_draw_pull_down_menu('filter', $options, (isset($_GET['filter']) ? $_GET['filter'] : null), 'onchange=\"this.form.submit()\"');\n $output .= lc_draw_hidden_session_id_field() . '</form></p>' . \"\\n\";\n }\n\n if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {\n $lC_Products->setManufacturer($_GET['manufacturers']);\n }\n $Qlisting = $lC_Products->execute(); \n \n $result['mfgFilter'] = $output;\n $result['Qlisting'] = $Qlisting;\n \n return $result;\n }", "public function suggest($count = 1) {\n\n $person = $this->randomItem('Tim Berners-Lee', 'Super Mario', 'Jean-Michel Basquiat', 'Levon Helm', 'Barack Obama', 'Shigeru Miyamoto', 'Eero Aarnio', 'Martin Scorsese', 'Twyla Tharp', 'Edward Tufte');\n\n $safePlaces = array('104 Franklin Street, NYC', 'Grand Central Station', 'Corsica', 'Geneva', 'Portland', 'Tokyo', 'Atlantis', 'Waldo', 'Hot Coffee');\n\n $allPlaces = array_merge($safePlaces, array('Dublin', 'Heaven on Earth'));\n\n $things = array('3d printer', 'planet', 'goat', 'raccoon', 'computer program', 'skyscraper', 'data visualization', 'double-neck guitar', 'vinyl record', 'pdp-11', 'Baobab Tree', 'large hadron collider');\n\n $thingsIncludingIrregulars = array_merge($things, array('arcade game', 'salmon', 'javascript', 'zorbing', 'democracy', 'ARP 2600', 'IBM 701'));\n\n $resourceSearch = $this->randomItem('Find me', 'Search for', 'Get me', 'Run a search for', 'Look for', 'Find');\n\n $randomTypes = array_keys($this->_resourceTypes);\n\n $suggestions = array();\n\n $suggestionCases = array();\n\n for($i = 0; $i < $count; $i++) {\n\n shuffle($randomTypes);\n $type = $randomTypes[0];\n if($type == 'searchImages') {\n $preposition = $this->randomItem('of', 'with');\n } else {\n $preposition = $this->randomItem('of', 'about', 'with');\n }\n if($type == 'searchTweets') {\n $type = \"tweets\"; // No other dignified synonyms\n } else {\n $type = $this->randomItem($this->_resourceTypes[$type]) . 's';\n }\n\n // Don't repeat suggestion types until we have to\n if(count($suggestionCases) < 1) {\n $suggestionCases = range(0, 6);\n }\n shuffle($suggestionCases);\n $suggestionCase = array_shift($suggestionCases);\n\n switch($suggestionCase) {\n case 0:\n $thing = $this->randomItem($things) . 's';\n $number = $this->randomItem('two', 'three', 'four', 'five', 'ten', 'twenty', 'some', 'all the');\n $suggestions[] = implode(' ', array($resourceSearch, $number, $type, $preposition, $thing)) . '.';\n break;\n case 1:\n $thing = $this->randomItem($thingsIncludingIrregulars);\n $number = rand(2, 20);\n $suggestions[] = implode(' ', array($resourceSearch, $number, $thing, $type)) . '.';\n break;\n case 2:\n $suggestions[] = $this->randomItem(\"Define \" . $this->randomItem($thingsIncludingIrregulars) . \".\", \"What is a \" . $this->randomItem($things) . \"?\");\n break;\n case 3:\n $suggestions[] = $this->randomItem('Where is ', 'Where can I find ', 'Locate ') . $this->randomItem($allPlaces) . '?';\n break;\n case 4:\n $suggestions[] = $this->randomItem('Who is ', 'Do you know ') . $person . '?';\n break;\n case 5:\n $suggestions[] = $this->randomItem('How can I ', 'Where can I ') . $this->randomItem('help ', 'donate to ') . $this->randomItem('schools', 'kids', 'teachers') . '?';\n break;\n case 6:\n $suggestions[] = $this->randomItem('Is it safe in', 'Am I safe in', 'How safe is it in') . ' ' . $this->randomItem($safePlaces) . '?';\n }\n }\n return count($suggestions) == 1 ? $suggestions[0] : $suggestions;\n }", "public function listMatchingProducts($request);" ]
[ "0.73384386", "0.6899764", "0.6869235", "0.6773637", "0.67297345", "0.6727956", "0.6720789", "0.67138535", "0.67121", "0.6626844", "0.65645105", "0.64216655", "0.6418241", "0.63394344", "0.6332352", "0.6324489", "0.63177526", "0.6299369", "0.628603", "0.6263348", "0.621229", "0.6206497", "0.6182765", "0.6150381", "0.61386853", "0.6133979", "0.6094102", "0.6091657", "0.60894144", "0.6083974", "0.60795945", "0.6026496", "0.6010428", "0.6005207", "0.59975624", "0.5993121", "0.5977721", "0.59769803", "0.59769803", "0.59769803", "0.59766936", "0.59588075", "0.59583664", "0.59573776", "0.5940902", "0.59395325", "0.5935221", "0.5900219", "0.58898544", "0.5870227", "0.5866658", "0.58532757", "0.5830143", "0.5827971", "0.5820102", "0.57879674", "0.5768035", "0.57641625", "0.57635903", "0.5756073", "0.5755895", "0.5745381", "0.57254595", "0.5724701", "0.5717273", "0.571379", "0.57047784", "0.5685487", "0.56846064", "0.566104", "0.56557965", "0.5641094", "0.56265235", "0.5626298", "0.56241226", "0.562001", "0.561471", "0.561348", "0.56100154", "0.56086254", "0.5608582", "0.55960315", "0.55909526", "0.55902004", "0.5570954", "0.5548117", "0.55449194", "0.5544866", "0.55396616", "0.5538684", "0.55375713", "0.55341816", "0.55334896", "0.55252856", "0.552396", "0.55102605", "0.5508625", "0.5506629", "0.54979074", "0.5496318", "0.5495536" ]
0.0
-1
Run the database seeds.
public function run() { DB::table('users')->insert([ [ 'name' => 'Administrator', 'username' => 'admin', 'NIP' => '-', 'password' => Hash::make('sokadmin'), 'role_id' => 2 ],[ 'name' => 'Kaprodi', 'username' => 'kaprodi', 'NIP' => '-', 'password' => Hash::make('sokkaprodi'), 'role_id' => 3 ],[ 'name' => 'Prof. Drs. Ec. Ir. Riyanarto Sarno, M.Sc Ph.D', 'username' => '195908031986011001', 'NIP' => '195908031986011001', 'password' => Hash::make('195908031986011001'), 'role_id' => 1 ],[ 'name' => 'Prof.Ir. Supeno Djanali, M.Sc., Ph.D', 'username' => '194806191973011001', 'NIP' => '194806191973011001', 'password' => Hash::make('194806191973011001'), 'role_id' => 1 ],[ 'name' => 'Prof.Ir. Handayani Tjandrasa, M.Sc., Ph.D', 'username' => '194908231976032001', 'NIP' => '194908231976032001', 'password' => Hash::make('194908231976032001'), 'role_id' => 1 ],[ 'name' => 'Prof.Dr.Ir.Joko Lianto Buliali, M.Sc., Ph.D.', 'username' => '196707271992031002', 'NIP' => '196707271992031002', 'password' => Hash::make('196707271992031002'), 'role_id' => 1 ],[ 'name' => 'Dr. Agus Zainal Arifin, S.Kom., M.Kom.', 'username' => '197208091995121001', 'NIP' => '197208091995121001', 'password' => Hash::make('197208091995121001'), 'role_id' => 1 ],[ 'name' => 'Dr.Eng. Nanik Suciati, S.Kom., M.Kom.', 'username' => '197104281994122001', 'NIP' => '197104281994122001', 'password' => Hash::make('197104281994122001'), 'role_id' => 1 ],[ 'name' => 'Daniel Oranova Siahaan, S.Kom., M.Sc., PDEng', 'username' => '197411232006041001', 'NIP' => '197411232006041001', 'password' => Hash::make('197411232006041001'), 'role_id' => 1 ],[ 'name' => 'Mahendrawathi ER, S.T., M.Sc., Ph.D', 'username' => '197610112006042001', 'NIP' => '197610112006042001', 'password' => Hash::make('197610112006042001'), 'role_id' => 1 ],[ 'name' => 'Ir. Siti Rochimah, M.T., Ph.D.', 'username' => '196810021994032001', 'NIP' => '196810021994032001', 'password' => Hash::make('196810021994032001'), 'role_id' => 1 ],[ 'name' => 'Dr.tech.Ir. Raden Venantius Hari Ginardi, M.Sc.', 'username' => '196505181992031003', 'NIP' => '196505181992031003', 'password' => Hash::make('196505181992031003'), 'role_id' => 1 ],[ 'name' => 'Wahyu Saudi, S.Kom., M.M., M.Kom', 'username' => '197110302002121001', 'NIP' => '197110302002121001', 'password' => Hash::make('197110302002121001'), 'role_id' => 1 ],[ 'name' => 'Victor Hariadi, S.Si., M.Kom', 'username' => '196912281994121001', 'NIP' => '196912281994121001', 'password' => Hash::make('196912281994121001'), 'role_id' => 1 ],[ 'name' => 'Dwi Sunaryono, S.Kom., M.Kom', 'username' => '197205281997021001', 'NIP' => '197205281997021001', 'password' => Hash::make('197205281997021001'), 'role_id' => 1 ],[ 'name' => 'Umi Laili Yuhana,S.Kom., M.Sc', 'username' => '197906262005012002', 'NIP' => '197906262005012002', 'password' => Hash::make('197906262005012002'), 'role_id' => 1 ],[ 'name' => 'Tohari Ahmad, S.Kom., MIT., Ph.D', 'username' => '197505252003121002', 'NIP' => '197505252003121002', 'password' => Hash::make('197505252003121002'), 'role_id' => 1 ],[ 'name' => 'Dr. Royyana Muslim Ijtihadie, S.Kom., M.Kom.', 'username' => '197708242003041001', 'NIP' => '197708242003041001', 'password' => Hash::make('197708242003041001'), 'role_id' => 1 ],[ 'name' => 'Feby Artowodini Muqtadiroh,S.Kom,MT.', 'username' => '198302232009122002', 'NIP' => '198302232009122002', 'password' => Hash::make('198302232009122002'), 'role_id' => 1 ],[ 'name' => 'Waskitho Wibisono, S.Kom., M.Eng., Ph.D', 'username' => '197410222000031001', 'NIP' => '197410222000031001', 'password' => Hash::make('197410222000031001'), 'role_id' => 1 ],[ 'name' => 'Anny Yuniarti, S.Kom., M.Comp.Sc', 'username' => '198106222005012002', 'NIP' => '198106222005012002', 'password' => Hash::make('198106222005012002'), 'role_id' => 1 ],[ 'name' => 'Ir. Muchammad Husni, M.Kom', 'username' => '196002211984031001', 'NIP' => '196002211984031001', 'password' => Hash::make('196002211984031001'), 'role_id' => 1 ],[ 'name' => 'Dr. Chastine Fatichah, S.Kom., M.Kom.', 'username' => '197512202001122002', 'NIP' => '197512202001122002', 'password' => Hash::make('197512202001122002'), 'role_id' => 1 ],[ 'name' => 'Ary Mazharuddin Shiddiqi, S.Kom., M.Comp.Sc', 'username' => '198106202005012001', 'NIP' => '198106202005012001', 'password' => Hash::make('198106202005012001'), 'role_id' => 1 ],[ 'name' => 'Ahmad Saikhu, S.SI., MT.', 'username' => '197107182006041001', 'NIP' => '197107182006041001', 'password' => Hash::make('197107182006041001'), 'role_id' => 1 ],[ 'name' => 'Dr.Eng. Darlis Herumurti, S.Kom., M.Kom.', 'username' => '197712172003121001', 'NIP' => '197712172003121001', 'password' => Hash::make('197712172003121001'), 'role_id' => 1 ],[ 'name' => 'Dr. Radityo Anggoro, S.Kom., M.Sc', 'username' => '198410162008121002', 'NIP' => '198410162008121002', 'password' => Hash::make('198410162008121002'), 'role_id' => 1 ],[ 'name' => 'Imam Kuswardayan, S.Kom., MT.', 'username' => '197612152003121001', 'NIP' => '197612152003121001', 'password' => Hash::make('197612152003121001'), 'role_id' => 1 ],[ 'name' => 'Bilqis Amaliah, S.Kom., M.Kom', 'username' => '197509142001122002', 'NIP' => '197509142001122002', 'password' => Hash::make('197509142001122002'), 'role_id' => 1 ],[ 'name' => 'Yudhi Purwananto, S.Kom., M.Kom.', 'username' => '197007141997031002', 'NIP' => '197007141997031002', 'password' => Hash::make('197007141997031002'), 'role_id' => 1 ],[ 'name' => 'Isye Arieshanti, S.Kom., M.Phil', 'username' => '197804122006042001', 'NIP' => '197804122006042001', 'password' => Hash::make('197804122006042001'), 'role_id' => 1 ],[ 'name' => 'Diana Purwitasari, S.Kom., M.Sc', 'username' => '197804102003122001', 'NIP' => '197804102003122001', 'password' => Hash::make('197804102003122001'), 'role_id' => 1 ],[ 'name' => 'Sarwosri, S.Kom., MT.', 'username' => '197608092001122001', 'NIP' => '197608092001122001', 'password' => Hash::make('197608092001122001'), 'role_id' => 1 ],[ 'name' => 'Misbakhul Munir Irfan Subakti, S.Kom., M.Sc.', 'username' => '197402092002121001', 'NIP' => '197402092002121001', 'password' => Hash::make('197402092002121001'), 'role_id' => 1 ],[ 'name' => 'Fajar Baskoro, S.Kom., MT.', 'username' => '197404031999031002', 'NIP' => '197404031999031002', 'password' => Hash::make('197404031999031002'), 'role_id' => 1 ],[ 'name' => 'Ahmad Muklason,S.Kom.,M.Sc.', 'username' => '198203022009121009', 'NIP' => '198203022009121009', 'password' => Hash::make('198203022009121009'), 'role_id' => 1 ],[ 'name' => 'Ir. F.X. Arunanto. M.Sc', 'username' => '195701011983031004', 'NIP' => '195701011983031004', 'password' => Hash::make('195701011983031004'), 'role_id' => 1 ],[ 'name' => 'Sholiq,ST.,MT.', 'username' => '197103132009121001', 'NIP' => '197103132009121001', 'password' => Hash::make('197103132009121001'), 'role_id' => 1 ],[ 'name' => 'Apol Pribadi Subriadi, ST.,MT.', 'username' => '197002252009121001', 'NIP' => '197002252009121001', 'password' => Hash::make('197002252009121001'), 'role_id' => 1 ],[ 'name' => 'Arif Bramantoro, ST., MT.', 'username' => '197812112002121002', 'NIP' => '197812112002121002', 'password' => Hash::make('197812112002121002'), 'role_id' => 1 ],[ 'name' => 'Ir. Suhadi Lili', 'username' => '196907281993031001', 'NIP' => '196907281993031001', 'password' => Hash::make('196907281993031001'), 'role_id' => 1 ],[ 'name' => 'Ahmad Hoirul Basori, S.Kom.', 'username' => '198211152006041003', 'NIP' => '198211152006041003', 'password' => Hash::make('198211152006041003'), 'role_id' => 1 ],[ 'name' => 'Henning Titi Ciptaningtyas, S.Kom., M.Kom.', 'username' => '198407082010122004', 'NIP' => '198407082010122004', 'password' => Hash::make('198407082010122004'), 'role_id' => 1 ],[ 'name' => 'Arya Yudhi Wijaya, S.Kom., M.Kom', 'username' => '198409042010121002', 'NIP' => '198409042010121002', 'password' => Hash::make('198409042010121002'), 'role_id' => 1 ],[ 'name' => 'Wijayanti Nurul Khotimah, S.Kom., M.Sc', 'username' => '198603122012122004', 'NIP' => '198603122012122004', 'password' => Hash::make('198603122012122004'), 'role_id' => 1 ],[ 'name' => 'Rizky Januar Akbar, S.Kom., M.Eng.', 'username' => '198701032014041001', 'NIP' => '198701032014041001', 'password' => Hash::make('198701032014041001'), 'role_id' => 1 ],[ 'name' => 'Ratih Nur Esti Anggraini, S.Kom., M.Sc.', 'username' => '198412102014042003', 'NIP' => '198412102014042003', 'password' => Hash::make('198412102014042003'), 'role_id' => 1 ],[ 'name' => 'Ridho Rahman Hariadi, S.Kom., M.Sc.', 'username' => '198702132014041001', 'NIP' => '198702132014041001', 'password' => Hash::make('198702132014041001'), 'role_id' => 1 ],[ 'name' => 'Abdul Munif, S.Kom., M.Sc.', 'username' => '198608232015041004', 'NIP' => '198608232015041004', 'password' => Hash::make('198608232015041004'), 'role_id' => 1 ],[ 'name' => 'Rully Sulaiman, S.Kom.,M.Kom.', 'username' => '197002131994021001', 'NIP' => '197002131994021001', 'password' => Hash::make('197002131994021001'), 'role_id' => 1 ],[ 'name' => 'Dini Adni Navastara, S.Kom., M.Sc', 'username' => '198610172015042001', 'NIP' => '198610172015042001', 'password' => Hash::make('198610172015042001'), 'role_id' => 1 ],[ 'name' => 'Baskoro Adi Pratomo, S.Kom., M.Kom', 'username' => '198702182014041001', 'NIP' => '198702182014041001', 'password' => Hash::make('198702182014041001'), 'role_id' => 1 ],[ 'name' => 'Hudan Studiawan, S.Kom., M.Kom.', 'username' => '198705112012121003', 'NIP' => '198705112012121003', 'password' => Hash::make('198705112012121003'), 'role_id' => 1 ],[ 'name' => 'Adhatus Solichah Ahmadiyah, S.Kom., M.Sc', 'username' => '198508262015042002', 'NIP' => '198508262015042002', 'password' => Hash::make('198508262015042002'), 'role_id' => 1 ],[ 'name' => 'Nurul Fajrin Ariani, S.Kom., M.Sc.', 'username' => '198607222015042003', 'NIP' => '198607222015042003', 'password' => Hash::make('198607222015042003'), 'role_id' => 1 ] ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Check if overview files and module activities has value
public function isModulesReady(Course $course) { if ($course->modules->where('is_overview', 1)->isEmpty() || $this->getNoOfActivities($course) === 0) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isActivity() {\n\t\treturn $this->repoObj->lobType == 'activity';\n\t}", "public function hasExperimentInfos(){\n return $this->_has(2);\n }", "function usp_ews_check_activity_setting($configmonitoreddata, $courseid, $modules){\n\n\tglobal $DB;\n\t\n\t$dbmanager = $DB->get_manager(); // loads ddl manager and xmldb classes\n\n\n\tif (empty($configmonitoreddata)) {\n return false;\n }\n\n\t$modinfo = get_array_of_activities($courseid);\n\n\tforeach($configmonitoreddata as $monitor){\n\t\t$mod = $modinfo[$monitor->cmid];\n\t\t// if hidden then no sense giving unnecessary attention\n\t\tif($mod->visible == 1){\n\t\t\t// only if the activity is notlocked, otherwise that's unnecessary as in the manual meaning of lock is specified\n\t\t\tif($monitor->locked == 0){\n\t\t\n\t\t\t\tif (array_key_exists('defaultTime', $modules[$monitor->module])) {\n\t\t\t\t\t$fields = $modules[$monitor->module]['defaultTime'].' as due';\n\t\t\t\t\t$record = $DB->get_record($monitor->module, array('id'=>$monitor->instanceid, 'course'=>$courseid), $fields);\n\n\t\t\t\t\tif($record->due != $monitor->duedate && $record->due > time()){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t }\t\t\t\t\n\t}\n\n\treturn false;\n}", "function check_permission()\n {\n // Make sure the user is logged-in\n require_course_login($this->course, true, $this->cm);\n\n add_to_log($this->course->id, 'sloodle', 'view sloodle module', \"view.php?id={$this->cm->id}\", \"{$this->sloodle->id}\", $this->cm->id);\n \n // Check for permissions\n $this->module_context = get_context_instance(CONTEXT_MODULE, $this->cm->id);\n $this->course_context = get_context_instance(CONTEXT_COURSE, $this->course->id);\n if (has_capability('moodle/course:manageactivities', $this->module_context)) $this->canedit = true;\n\n // If the module is hidden, then can the user still view it?\n if (empty($this->cm->visible) && !has_capability('moodle/course:viewhiddenactivities', $this->module_context)) notice(get_string('activityiscurrentlyhidden'));\n }", "function check_module_visibilityANDavailability($DB, $module_infos, $visibility_allowhiddenmodules, $availability_ignoreavailabilityrestrictions){\n\n //Controlled in Moodle Gui: under 'availability (under \"Common module settings\")'\n $module_restrictions= new stdClass();\n try {\n\n $module_section_infos= $DB->get_record('course_sections', array('id' =>$module_infos->section));\n $module_section_availability = $module_section_infos->availability;\n\n //Get all module/section availability restrictions in array format: including those on complexe set of restrictions.\n $module_section_access_restrictions= get_availability_restelements_fromavfield( $module_section_availability);\n $module_access_restrictions= get_availability_restelements_fromavfield( $module_infos->availability );\n\n //Module visisbility: \"module visibility\" AND \"section visibility\"\n $module_restrictions->mod_visibility = $module_infos->visible;\n $module_restrictions->mod_accrestrictions = $module_access_restrictions;\n $module_restrictions->mod_section_accrestrictions = $module_section_access_restrictions;\n\n\n } catch (\\Exception $e) {\n //$module_infos->course_gen_infos = 'Resource not existant. Verify your request or contact Univ-Nantes Admin.';\n return $e;\n echo \"Exception occurred\";\n }\n\n return array($module_restrictions,decide_about_modVisibilityANDAvailability( $module_restrictions, $visibility_allowhiddenmodules, $availability_ignoreavailabilityrestrictions ));\n\n }", "public function canShowInfo() {}", "protected function checkUsage(){\n $modId = $this->getModId();\n $oDeclarator = AMI_ModDeclarator::getInstance();\n $parentModId = $oDeclarator->getParent($modId);\n return\n AMI::issetAndTrueOption($parentModId, 'use_categories');\n }", "function canViewActivities($user) {\n \treturn $user->isAdministrator() || $user->isProjectManager();\n }", "function CheckLibraryAccess(){\n if ($this->listSettings->HasSection(\"ACCESS\")) {\n if ($this->listSettings->HasItem(\"ACCESS\", \"GROUPS\")) {\n $this->Page->access_id = explode(\",\", $this->listSettings->GetItem(\"ACCESS\", \"GROUPS\"));\n\n }\n if ($this->listSettings->HasItem(\"ACCESS\", \"USERS\")) {\n $this->Page->access_user_id = explode(\",\", $this->listSettings->GetItem(\"ACCESS\", \"USERS\"));\n }\n if ($this->listSettings->HasItem(\"ACCESS\", \"ROLES\")) {\n $this->Page->access_role_id = explode(\",\", $this->listSettings->GetItem(\"ACCESS\", \"ROLES\"));\n }\n\n $this->Page->Auth->isLogged();\n }\n }", "function CheckShowListAccess($item=array())\n {\n if (empty($item)) { return TRUE; }\n\n $res=$this->HasModuleAccess();\n \n return $res;\n }", "private function overview()\n {\n foreach ($this->manager->getTranslationFiles() as $lang => $namespaces) {\n $files = 0;\n foreach ($namespaces as $namespace) {\n $files += count($namespace);\n }\n\n $this->info(\n $lang . ': Found ' . $files . ' files with ' . count($this->manager->getTranslationValues($lang)) .\n ' values' . (config('app.locale', null) == $lang ? ' *primary locale' : '')\n );\n }\n }", "public function fileIndexStatusIsTrueIfUidIsSet() {}", "function readActivities() {\n\t\t$scheduleFound = false;\n\t\t$file = \"data/activity.txt\";\n\t\t$handle = fopen($file,\"a+\");\n\t\tif (!$handle) {\n \treturn \"<p> Internal Error </p>\";\n }\n while (($line = fgets($handle)) !== false) {\n \t$current = explode(\":\",$line);\n \tif ($current[0] == $_SESSION['userName']) {\n \t\t// print to screen\n \t\techo '<div style=\"padding-left: 25px;\">';\n \t\techo \"Class with: \".$current[1].\" at: \".$current[2].\"<br>\";\n \t\techo \"</div>\";\n \t\t$scheduleFound = true;\n \t}\n }\n fclose($handle);\n return $scheduleFound;\n\t}", "function tab_print_recent_activity($course, $viewfullnames, $timestart) {\n global $CFG;\n\n return false; // True if anything was printed, otherwise false\n}", "function check_module_visibilityANDavailability_standalone($moduleid){\n\n $DB=$GLOBALS['GLBMDL_DB'];\n\n //Controlled in Moodle Gui: under 'availability (under \"Common module settings\")'\n $module_infos=new stdClass();\n $module_restrictions= new stdClass();\n try {\n\n $module_infos= $DB->get_record('course_modules', array('id' =>$moduleid));\n $resource_course_infos=new stdClass();\n $resource_course_infos=get_course_infos($module_infos->course, $DB);\n\n $module_infos=$resource_course_infos->course_modules[$moduleid];\n\n $module_section_infos= $DB->get_record('course_sections', array('id' =>$module_infos->section));\n $module_section_availability = $module_section_infos->availability;\n\n //Get all module/section availability restrictions in array format: including those on complexe set of restrictions.\n $module_section_access_restrictions= get_availability_restelements_fromavfield( $module_section_availability);\n $module_access_restrictions= get_availability_restelements_fromavfield( $module_infos->availability );\n\n //Module visisbility: \"module visibility\" AND \"section visibility\"\n $module_restrictions->mod_visibility = $module_infos->visible;\n $module_restrictions->mod_accrestrictions = $module_access_restrictions;\n $module_restrictions->mod_section_accrestrictions = $module_section_access_restrictions;\n\n\n } catch (\\Exception $e) {\n //$module_infos->course_gen_infos = 'Resource not existant. Verify your request or contact Univ-Nantes Admin.';\n return $e;\n echo \"Exception occurred\";\n }\n\n return array($module_restrictions,decide_about_modVisibilityANDAvailability( $module_restrictions, 0, 0 ));\n\n }", "public function hasAccessTo ( $module )\n\t{\n\t\tif ( !is_array( $this->userInfo[ 'modules' ] ) )\n\t\t{\n\t\t\t$this->userInfo[ 'modules' ] = array();\n\t\t}\n\t\treturn in_array( strtolower( $module ), $this->userInfo[ 'modules' ] );\n\t}", "protected function _hasModPermission(){\n global $auth;\n return $auth->acl_get('m_inttree');\n }", "public function availableAction()\n {\n $modules = array();\n //$modulesInstalled = $this->installedModules();\n $iterator = new \\DirectoryIterator(Pi::path('module'));\n foreach ($iterator as $fileinfo) {\n if (!$fileinfo->isDir() || $fileinfo->isDot()) {\n continue;\n }\n $directory = $fileinfo->getFilename();\n if (preg_match('/[^a-z0-9_]/i', $directory)) {\n continue;\n }\n $meta = Pi::service('module')->loadMeta($directory, 'meta');\n if (empty($meta)) {\n continue;\n }\n $author = Pi::service('module')->loadMeta($directory, 'author');\n //$clonable = isset($meta['clonable']) ? $meta['clonable'] : false;\n //$meta['installed'] = in_array($directory, $modulesInstalled);\n $meta['installed'] = Pi::registry('module')\n ->read($directory) ? true : false;\n if (empty($meta['clonable']) && $meta['installed']) {\n continue;\n }\n $meta['logo'] = !empty($meta['logo'])\n ? Pi::url('script/browse.php') . '?'\n . sprintf('module/%s/asset/%s', $directory, $meta['logo'])\n : Pi::url('static/image/module.png');\n $modules[$directory] = array(\n 'meta' => $meta,\n 'author' => $author,\n );\n }\n\n $this->view()->assign('modules', $modules);\n $this->view()->assign('title', __('Modules ready for installation'));\n }", "public function hasInfo() {\n return $this->_has(11);\n }", "function valid_action() {\n # of pages that are about that page (i.e. not admin\n # or recent changes)\n global $ACT;\n if($ACT == 'show') { return true; }\n if($ACT == 'edit') { return true; }\n if($ACT == 'revisions') { return true; }\n return false;\n }", "public function hasItemInfo(){\n return $this->_has(3);\n }", "function checkVisual($contentId=0) {\r\n\t\tglobal $option;\r\n\r\n\t\t$func = JRequest::getVar('view');\r\n\r\n\t\treturn ( $option == 'com_eventlist'\r\n\t\t&& $func == 'details'\r\n\t\t);\r\n\t}", "public function hasUsageRights() {}", "function usp_ews_modules_in_use($courseid) {\n global $DB;\n\t\n $dbmanager = $DB->get_manager(); // used to check if tables exist\n $modules = usp_ews_get_active_monitorable_modules();\n $modulesinuse = array();\n\n foreach ($modules as $module => $details) {\n if (\n $dbmanager->table_exists($module) &&\n $DB->record_exists($module, array('course'=>$courseid))\n ) {\n $modulesinuse[$module] = $details;\n }\n }\n return $modulesinuse;\n}", "function __isLogDetailsRequired($action){\n return (Configure::read('App.logs.models.rules.'.$action) > 1);\n }", "function is_concerned_resource( $module_infos, $mdl_considered_resources ){\n\n if( in_array($module_infos->modname, $mdl_considered_resources) ){\n\n return 1;\n }\n\n return 0;\n }", "private function fileSizeAndTypesModulesChecks()\n {\n $this->statisticsModule = \\Yii::$app->getModule('statistics');\n if (is_null($this->statisticsModule)) {\n throw new CommunityException(AmosCommunity::t('amoscommunity', 'statistics module not found'));\n }\n \n $this->cwhModule = \\Yii::$app->getModule('cwh');\n if (is_null($this->cwhModule)) {\n throw new CommunityException(AmosCommunity::t('amoscommunity', 'CWH module not found'));\n }\n \n $this->documentsModule = \\Yii::$app->getModule('documenti');\n if (is_null($this->documentsModule)) {\n throw new CommunityException(AmosCommunity::t('amoscommunity', 'documenti module not found'));\n }\n }", "function forum_check_text_access($path, $itemtype, $this_id, $user, $group_id, $context_id){\n global $CFG, $USER;\n \n include_once(\"{$CFG->dirroot}/{$path}/lib.php\");\n\n // get the forum post and all related stuff\n $post = get_record('forum_posts', 'id', $this_id);\n $discussion = get_record('forum_discussions', 'id', $post->discussion);\n $context = get_record('context', 'id', $context_id);\n $cm = get_record('course_modules', 'id', $context->instanceid);\n // $cm = get_coursemodule_from_instance('forum', $discussion->forum, $discussion->course);\n // $context = get_context_instance(CONTEXT_MODULE, $cm->id);\n if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', $context)){\n if (!empty($CFG->search_access_debug)) echo \"search reject : hidden forum resource \";\n return false;\n }\n \n // approval check : entries should be approved for being viewed, or belongs to the user \n if (($post->userid != $USER->id) && !$post->mailed && !has_capability('mod/forum:viewhiddentimeposts', $context)){\n if (!empty($CFG->search_access_debug)) echo \"search reject : time hidden forum item\";\n return false;\n }\n\n // group check : entries should be in accessible groups\n $current_group = get_current_group($discussion->course);\n $course = get_record('course', 'id', $discussion->course);\n if ($group_id >= 0 && (groupmode($course, $cm) == SEPARATEGROUPS) && ($group_id != $current_group) && !has_capability('mod/forum:viewdiscussionsfromallgroups', $context)){\n if (!empty($CFG->search_access_debug)) echo \"search reject : separated grouped forum item\";\n return false;\n }\n \n return true;\n}", "public function canView(array $activity): bool {\n $result = false;\n\n $userid = val('NotifyUserID', $activity);\n switch ($userid) {\n case ActivityModel::NOTIFY_PUBLIC:\n $result = true;\n break;\n case ActivityModel::NOTIFY_MODS:\n if (checkPermission('Garden.Moderation.Manage')) {\n $result = true;\n }\n break;\n case ActivityModel::NOTIFY_ADMINS:\n if (checkPermission('Garden.Settings.Manage')) {\n $result = true;\n }\n break;\n default:\n // Actual userid.\n if (Gdn::session()->UserID === $userid || checkPermission('Garden.Community.Manage')) {\n $result = true;\n }\n break;\n }\n\n return $result;\n }", "public function exist()\n {\n return $this->_info && app()->getModule($this->_info['name']) ? TRUE : FALSE;\n }", "public function hasInfo() {\n return $this->_has(3);\n }", "function dates_access_summary($conf, $context) {\n return t('Show only if the url has valid dates.');\n}", "public function hasSourceAccessions(){\n return $this->_has(6);\n }", "function dllc_print_recent_activity($course, $viewfullnames, $timestart) {\n return false;\n}", "public function hasInfo() {\n return $this->_has(21);\n }", "public function testCheckIfOverviewContainsCase()\n {\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->see('TestCase1')\n ->assertViewHas('testCases');\n\n }", "public function hasTaskList(){\n return $this->_has(2);\n }", "function modules_in_use($course) {\n global $DB;\n\n $dbmanager = $DB->get_manager(); // Used to check if tables exist.\n $modules = monitorable_modules();\n $modulesinuse = array();\n\n foreach ($modules as $module => $details) {\n if (\n $dbmanager->table_exists($module) &&\n $DB->record_exists($module, array('course' => $course))\n ) {\n $modulesinuse[$module] = $details;\n }\n }\n return $modulesinuse;\n}", "public function hasInfo() {\n return $this->_has(10);\n }", "public function hasInfo() {\n return $this->_has(7);\n }", "public function hasInfo() {\n return $this->_has(7);\n }", "function file_source_can_be_displayed($filename) {\n return in_array(get_file_extension($filename), get_displayable_file_types());\n }", "public function hasInfo() {\n return $this->_has(6);\n }", "function annotation_print_recent_activity($course, $viewfullnames, $timestart) {\n return false;\n}", "public function hasDescInfo(){\n return $this->_has(5);\n }", "function fm_user_can_view_file($id, $fileid, $groupid) {\r\n\tglobal $USER, $CFG;\r\n\t\t\t\r\n\t// If they own the file, they can view\r\n\tif ($groupid == 0){\r\n\t\t$ownertype = OWNERISUSER;\r\n\t\tif (count_records('fmanager_link', 'id', $fileid, 'owner', $USER->id, 'ownertype', $ownertype)) { \r\n\t\treturn true;\r\n\t\t}\t\r\n\t} else {\r\n\t\t$ownertype = OWNERISGROUP;\r\n\t\tif (count_records('fmanager_link', 'id', $fileid, 'owner', $groupid, 'ownertype', $ownertype)) { \r\n\t\treturn true;\r\n\t\t}\t\r\n\t}\r\n\t\r\n\t\r\n\t// If file is shared to them or to everyone in the course they can view\r\n\t$select = \" \r\n\t ( userid = '0' AND \r\n\t sharedlink = '{$fileid}' AND \r\n\t course = '{$id}' ) OR \r\n\t ( userid = '{$USER->id}' AND \r\n\t sharedlink = '{$fileid}' AND \r\n\t course = '{$id}'\r\n\t)\";\r\n\tif (count_records_select('fmanager_shared', $select)) {\r\n\t\treturn true;\r\n\t}\r\n\tif (!$sharedfile = get_record('fmanager_link', 'id', $fileid)) {\r\n\t\treturn false;\r\n\t} \r\n\r\n\t// If shared via shared/nested folder they can view\r\n\t$select = \" \r\n\t ( userid = '0' AND \r\n\t type = '2' AND \r\n\t course = '{$id}' AND \r\n\t sharedlink = '{$sharedfile->folder}' ) OR \r\n\t ( userid = '{$USER->id}' AND \r\n\t type = '2' AND \r\n\t course = '{$id}' AND \r\n\t sharedlink = '{$sharedfile->folder}'\r\n\t)\";\r\n\tif (count_records_select('fmanager_shared', $select)) {\r\n\t\treturn true;\r\n\t} else { \r\n\t // File isnt under the main folder\r\n\t\t$tmp = get_record('fmanager_folders', 'id', $sharedfile->folder);\r\n\t\tif (isset($tmp->pathid)){\r\n\t\t\t$folderid = $tmp->pathid;\r\n\t\t\twhile ($folderid) {\t// While folder id isnt the root (0)\r\n\t\t\t\t$select = \"\r\n\t\t\t\t ( userid = '0' AND \r\n\t\t\t\t type = '2' AND \r\n\t\t\t\t course = '{$id}' AND \r\n\t\t\t\t sharedlink = '{$folderid}' ) OR \r\n\t\t\t\t ( userid = '{$USER->id}' AND \r\n\t\t\t\t type = '2' AND \r\n\t\t\t\t course = '{$id}' AND \r\n\t\t\t\t sharedlink = '{$folderid}'\r\n\t\t\t )\";\r\n\t\t\t\tif (count_records_select('fmanager_shared', $select)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\t$tmp = get_record('fmanager_folders', 'id', $tmp->pathid);\r\n\t\t\t\t$folderid = $tmp->id;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// If file is shared via a shared category they can view\r\n\t$dummyvar = 1;\r\n\t$fid = $sharedfile->folder;\r\n\tif ($fid == 0) {\r\n\t\t$select = \" \r\n\t\t ( userid = '0' AND \r\n\t\t type = '1' AND \r\n\t\t course = '{$id}' AND \r\n\t\t sharedlink = '{$sharedfile->category}' ) OR \r\n\t\t ( userid = '{$USER->id}' AND \r\n\t\t type = '1' AND \r\n\t\t course = '{$id}' AND \r\n\t\t sharedlink = '{$sharedfile->category}'\r\n\t\t)\";\r\n\t\tif (count_records_select('fmanager_shared', $select)) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\twhile ($fid) {\t\r\n\t\t$folder = get_record('fmanager_folders', 'id', $fid);\r\n\t\t\r\n\t\t$select = \"\r\n\t\t ( userid = '0' AND \r\n\t\t type = '1' AND \r\n\t\t course = '{$id}' AND \r\n\t\t sharedlink = '{$folder->category}' ) OR \r\n\t\t ( userid = '{$USER->id}' AND \r\n\t\t type = '1' AND \r\n\t\t course = '{$id}' AND \r\n\t\t sharedlink = '{$folder->category}' )\r\n\t\t\";\r\n\t\tif (count_records_select('fmanager_shared', $select)) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\t$fid = $folder->pathid;\r\n\t\t}\r\n\t}\r\n\t// Otherwise, error is displayed\r\n\treturn false;\r\n}", "public function testCheckIfOverviewContainsSuite()\n {\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->see('TestSuite1')\n ->assertViewHas('testSuites');\n\n }", "function vitero_print_recent_activity($course, $viewfullnames, $timestart) {\n return false; // True if anything was printed, otherwise false.\n}", "public function check_files()\n {\n }", "public function shouldBeDisplayed()\n {\n return Auth::user()->can('browse', Actadmin::model('Page'));\n }", "private function hasView($page) {\r\n return file_exists($this->getView($page));\r\n }", "function getOverview() ;", "public function can_do_list() {\n global $CFG, $USER;\n\n if (has_capability('block/php_report:manageschedules', get_context_instance(CONTEXT_SYSTEM))) {\n //user can manage schedules globally, so allow access\n return true;\n }\n\n //determine if the export action is available in the context of scheduling\n $export_available = false;\n\n //go through the directories\n if ($handle = opendir($CFG->dirroot . '/blocks/php_report/instances')) {\n\n while (false !== ($report_shortname = readdir($handle))) {\n //get the report instance (this inherently checks permissions and report availability)\n if($instance = php_report::get_default_instance($report_shortname, $USER->id, php_report::EXECUTION_MODE_SCHEDULED)) {\n\n //check permissions and make sure scheduling is not explicitly disallowed\n if (!$instance->can_view_report()) {\n continue;\n }\n\n //make sure there is at least one available export format\n $export_formats = $instance->get_export_formats();\n if (count($export_formats) == 0) {\n continue;\n }\n\n $export_available = true;\n break;\n }\n }\n }\n\n return $export_available;\n }", "public function gatherFileMetrics()\n {\n if (!isset($this->_xml->project)) {\n return false;\n }\n\n // Handle <file> nodes\n $this->gatherFileMetricsFromGroup($this->_xml->project->file);\n\n // Handle <package> nodes\n if (isset($this->_xml->project->package)) {\n foreach ($this->_xml->project->package as $package) {\n $this->gatherFileMetricsFromGroup($package->file);\n }\n }\n\n return true;\n }", "public function hasActions();", "public function isInformation() {\n return (1 === $this->getStatusClass());\n }", "function wwassignment_check_backup_mods($course,$user_data=false,$backup_unique_code,$instances=null) {\n ////error_log(\"wwassignment_check_backup_mods \");\n ////error_log(\"user_data \".print_r($user_data,true) );\n ////error_log(\"backup code \".print_r($backup_unique_code,true));\n ////error_log(\"instance \".print_r($instance,true));\n $info=array();\n if (!empty($instances) && is_array($instances) && count($instances)) {\n foreach ($instances as $id => $instance) {\n $info += wwassignment_check_backup_mods_instances($instance,$backup_unique_code);\n }\n return $info;\n }\n //First the course data\n $info[0][0] = get_string(\"modulenameplural\",\"wwassignment\");\n if ($ids = wwassignment_ids ($course)) {\n $info[0][1] = count($ids);\n } else {\n $info[0][1] = 0;\n }\n \n ////error_log(\"end wwassignment_check_backup_mods\");\n\n return $info;\n }", "public function hasModule(){\n return $this->_has(1);\n }", "static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\n }", "public static function isValid(){\n\n\t\t$valid=false;\n\t\tif(isset($_GET[\"view\"])){\n\t\t\t$url =\"\";\n\t\t\tif(Core::$root==\"\"){\n\n\n\t\t\t\t$url = \"core/app/view/\".$_GET['view'].\"-view.php\";\n\n\t\t\t}\n\n\t\t\tif(file_exists($file = $url)){\n\t\t\t\t$valid = true;\n\t\t\t}\n\t\t}\n\t\treturn $valid;\n\t}", "public function testActivityInfoRetrieve()\n {\n }", "public function hasSourceAccessions(){\n return $this->_has(8);\n }", "public function testWorkflowSummary() {\n $this->drupalGet('admin/structure/types/manage/test');\n $page = $this->getSession()->getPage();\n $page->find('css', 'a[href=\"#edit-workflow\"]')->click();\n $this->assertSession()->waitForElementVisible('css', '[name=\"options[status]\"]');\n $page->findField('options[status]')->uncheck();\n $page->findField('options[sticky]')->check();\n $page->findField('options[promote]')->check();\n $page->findField('options[revision]')->check();\n $locator = '[href=\"#edit-workflow\"] .vertical-tabs__menu-item-summary';\n $page->waitFor(10, function () use ($page, $locator) {\n $summary = $page->find('css', $locator)->getText();\n return strpos('Not published', $summary) !== FALSE;\n });\n $summary = $page->find('css', $locator)->getText();\n $this->assertEquals('Not published, Promoted to front page, Sticky at top of lists, Create new revision', $summary);\n }", "public function includeAllFiles()\n {\n return in_array('all', $this->types);\n }", "public function hasVisit(){\n return $this->_has(2);\n }", "function contactmod_print_recent_activity($course, $viewfullnames, $timestart) {\n return false; // True if anything was printed, otherwise false\n}", "public function load_usage() {\n\n // Verify if usage exists\n if ( self::$the_usage ) {\n\n return self::$the_usage;\n\n } else {\n\n return false;\n\n }\n\n }", "public function isAccess();", "public function hasExperimentName(){\n return $this->_has(2);\n }", "public function hasExperimentName(){\n return $this->_has(2);\n }", "function moduleFunctionalCheck() {\n\tglobal $fmdb, $__FM_CONFIG;\n\t$html_checks = null;\n\t\n\t/** Count active name servers */\n\t$checks[] = (basicGetList('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'servers', 'server_id', 'server_', 'active')) ? null : sprintf('<p>' . _('You currently have no active servers defined. <a href=\"%s\">Click here</a> to define one or more to manage.') . '</p>', getMenuURL(_('Servers')));\n\t\n\t/** Count global options */\n\t$checks[] = (basicGetList('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'config', 'cfg_id', 'cfg_')) ? null : sprintf('<p>' . __('You currently have no global options defined for named.conf. <a href=\"%s\">Click here</a> to define one or more.') . '</p>', getMenuURL(__('Options')));\n\t\n\t/** Count zones */\n\t$checks[] = (basicGetList('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'domains', 'domain_id', 'domain_')) ? null : sprintf('<p>' . __('You currently have no zones defined. <a href=\"%s\">Click here</a> to define one or more.') . '</p>', getMenuURL(__('Zones')));\n\t\n\tforeach ($checks as $val) {\n\t\t$html_checks .= $val;\n\t}\n\t\n\treturn $html_checks;\n}", "function jen_panels_book_top_ctools_access_summary($conf, $context) {\n return t('Book page is top level');\n}", "function cicleinscription_print_recent_activity($course, $viewfullnames, $timestart) {\n return false; // True if anything was printed, otherwise false\n}", "public function checkPermission()\n {\n $this->checkIaoModulePermission('tl_iao_agreements');\n }", "public function hasFileDescription()\n {\n return $this->file_description !== null;\n }", "public function canManageDevelopments();", "function getDetailedStatus() ;", "protected function process_overview()\n {\n global $index_includes;\n\n $l_rules = [\n 'C__MAINTENANCE__OVERVIEW__FILTER__DATE_FROM' => [\n 'p_strPopupType' => 'calendar',\n 'p_strClass' => 'input-mini',\n 'p_bInfoIconSpacer' => 0,\n 'p_strValue' => date('Y-m-d'),\n ],\n 'C__MAINTENANCE__OVERVIEW__FILTER__DATE_TO' => [\n 'p_strPopupType' => 'calendar',\n 'p_strClass' => 'input-mini',\n 'p_bInfoIconSpacer' => 0,\n ]\n ];\n\n $l_day_of_week = date('N') - 1;\n $l_this_week_time = time() - ($l_day_of_week * isys_convert::DAY);\n\n $l_this_week = mktime(0, 0, 0, date('m', $l_this_week_time), date('d', $l_this_week_time), date('Y', $l_this_week_time));\n\n $this->m_tpl->activate_editmode()\n ->assign(\n 'ajax_url',\n isys_helper_link::create_url(\n [\n C__GET__AJAX => 1,\n C__GET__AJAX_CALL => 'maintenance'\n ]\n )\n )\n ->assign('this_week', $l_this_week)\n ->assign('this_month', mktime(0, 0, 0, date('m'), 1, date('Y')))\n ->assign('next_week', $l_this_week + isys_convert::WEEK)\n ->assign('next_month', mktime(0, 0, 0, (date('m') + 1), 1, date('Y')))\n ->assign('next_next_month', mktime(0, 0, 0, (date('m') + 2), 1, date('Y')))\n ->assign(\n 'planning_url',\n isys_helper_link::create_url(\n [\n C__GET__MODULE_ID => C__MODULE__MAINTENANCE,\n C__GET__SETTINGS_PAGE => C__MAINTENANCE__PLANNING\n ]\n )\n )\n ->smarty_tom_add_rules('tom.content.bottom.content', $l_rules);\n\n $index_includes['contentbottomcontent'] = __DIR__ . DS . 'templates' . DS . 'overview.tpl';\n }", "public function hasLoadModule(){\n return $this->_has(6);\n }", "function languagelab_check_backup_mods($course,$user_data=false,$backup_unique_code,$instances=null) {\n if (!empty($instances) && is_array($instances) && count($instances)) {\n $info = array();\n foreach ($instances as $id => $instance) {\n $info += languagelab_check_backup_mods_instances($instance,$backup_unique_code);\n }\n return $info;\n }\n\n //First the course data\n $info[0][0] = get_string(\"modulenameplural\",\"languagelab\");\n $info[0][1] = count_records(\"languagelab\", \"course\", \"$course\");\n return $info;\n }", "public function isUseful() {\n\t\tif(!$this->isApache()) return false;\n\t\t$f = '.htaccess';\n\t\t$paths = $this->wire('config')->paths;\n\t\t$assets = $paths->assets;\n\t\tif(!file_exists($assets . $f)) return true;\n\t\tif(!file_exists($assets . \"logs/$f\")) return true;\n\t\tif(!file_exists($assets . \"cache/$f\")) return true;\n\t\tif(!file_exists($assets . \"backups/$f\")) return true;\n\t\tif(!file_exists($paths->templates . $f)) return true;\n\t\tif(!file_exists($paths->site . $f)) return true;\n\t\tif(!file_exists($paths->site . \"modules/$f\")) return true;\n\t\treturn false;\n\t}", "public function hasAdditionalInfosList()\n {\n return $this->AdditionalInfos !== null;\n }", "function HasModuleAccess()\n {\n $res=$this->CaravansObj()->HasModuleAccess();\n\n return $res;\n }", "public function hasStatuses(){\n return $this->_has(1);\n }", "public function shouldBeDisplayed()\n {\n return Auth::user()->can('browse', app(Property::class));\n }", "public function isUsedInAssessments(){\n return ($this->assessments == 1);\n }", "public function fileLogActive() {\n\t\treturn isset($this->loggers['file']);\n\t}", "private function checkAccess() {\n $this->permission('Garden.Import'); // This permission doesn't exist, so only users with Admin == '1' will succeed.\n \\Vanilla\\FeatureFlagHelper::ensureFeature(\n 'Import',\n t('Imports are not enabled.', 'Imports are not enabled. Set the config Feature.Import.Enabled = true to enable imports.')\n );\n }", "public function test_admin_monitoring_b()\n {\n $this->request('GET', ['pages/Home', 'member_dsc_summary']);\n $this->assertResponseCode(404);\n }", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function checkAccess() {}", "public function check_role_access($cur_module,$modules, $page){\n\t\tforeach($modules as $per){\t\t\t\n\t\t\t$format_per[] = $per;\n\t\t}\n\t\t// not to check for view profile\n\t\tif($page != 'view_profile'){\n\t\t\tif (!in_array($cur_module, $format_per)){\n\t\t\t\theader('Location:../home/?access=invalid');\t\n\t\t\t}\n\t\t}\n\t\tforeach($modules as $key => $module){\n\t\t\t// check the user module exists in the database module list\n\t\t\tif (in_array($module, $format_per)) { \t\n\t\t\t\tswitch($module){\n\t\t\t\t\tcase 1:\t\t\n\t\t\t\t\t$mod['add_client'] = 1;\n\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\tcase 39:\t\t\t\t\t\n\t\t\t\t\t$mod['approve_client'] = 1;\n\t\t\t\t\tbreak;\t\n\t\t\t\t\tcase 2:\t\t\t\t\t\n\t\t\t\t\t$mod['client'] = 1;\n\t\t\t\t\tbreak;\t\n\t\t\t\t\t\n\t\t\t\t\tcase 4:\t\t\t\t\t\n\t\t\t\t\t$mod['add_position'] = 1;\n\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\tcase 38:\t\t\t\t\t\n\t\t\t\t\t$mod['approve_position'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5:\t\t\t\t\t\n\t\t\t\t\t$mod['position'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 7:\t\t\t\t\t\n\t\t\t\t\t$mod['create_resume'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 8:\t\t\t\t\t\n\t\t\t\t\t$mod['view_resume'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 10:\t\t\t\t\t\n\t\t\t\t\t$mod['view_interview'] = 1;\n\t\t\t\t\tbreak;\t\n\t\t\t\t\t\n\t\t\t\t\tcase 13:\t\t\t\t\t\n\t\t\t\t\t$mod['create_incentive'] = 1;\n\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\t\tcase 14:\t\t\t\t\t\n\t\t\t\t\t$mod['view_incentive'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 15:\t\t\t\t\t\n\t\t\t\t\t$mod['approve_incentive'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 29:\t\t\t\t\t\n\t\t\t\t\t$mod['sent_item'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 35:\n\t\t\t\t\t$mod['view_billing'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 36:\t\t\t\t\t\n\t\t\t\t\t$mod['add_billing'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 37:\t\t\t\t\t\n\t\t\t\t\t$mod['approve_billing'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 30:\t\t\t\t\t\n\t\t\t\t\t$mod['manage_grade'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 31:\t\t\t\t\t\n\t\t\t\t\t$mod['manage_users'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 32:\t\t\t\n\t\t\t\t\t$mod['manage_role'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 33:\t\t\t\t\t\n\t\t\t\t\t$mod['manage_mailer_template'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 34:\t\t\t\t\t\n\t\t\t\t\t$mod['manage_incentive'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 40:\t\t\t\t\t\n\t\t\t\t\t$mod['manage_designation'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 41:\t\t\t\t\t\n\t\t\t\t\t$mod['manage_contact_branch'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 43:\t\t\t\t\t\n\t\t\t\t\t$mod['manage_functional_area'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 51:\t\t\t\t\t\n\t\t\t\t\t$mod['api_keys'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 52:\t\t\t\t\t\n\t\t\t\t\t$mod['manage_qualification'] = 1;\n\t\t\t\t\tbreak;\t\n\t\t\t\t\t\n\t\t\t\t\tcase 45:\t\t\t\t\t\n\t\t\t\t\t$mod['create_my_leaves'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 46:\t\t\t\t\t\n\t\t\t\t\t$mod['approve_my_leaves'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 47:\t\t\t\t\t\n\t\t\t\t\t$mod['view_my_leaves'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 48:\t\t\t\t\t\n\t\t\t\t\t$mod['view_todays_plan'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 49:\t\t\t\t\t\n\t\t\t\t\t$mod['create_todays_plan'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tcase 50:\t\t\t\t\t\n\t\t\t\t\t$mod['view_event'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tcase 18:\t\t\t\t\t\n\t\t\t\t\t$mod['ctc_wise_monthly_openings_handled'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 19:\t\t\t\t\t\n\t\t\t\t\t$mod['ctc_wise_client_openings_handled'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 17:\t\t\t\t\t\n\t\t\t\t\t$mod['month_wise_client_openings_handled'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 20:\t\t\t\t\t\n\t\t\t\t\t$mod['ctc_wise_cv_status'] = 1;\n\t\t\t\t\tbreak;\t\t\t\t\n\t\t\t\t\tcase 22:\t\t\t\t\t\n\t\t\t\t\t$mod['client_wise_cv_status'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 64:\t\t\t\t\t\n\t\t\t\t\t$mod['month_wise_cv_status'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 23:\t\t\t\t\t\n\t\t\t\t\t$mod['ctc_wise_average_takt_time'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 24:\t\t\t\t\t\n\t\t\t\t\t$mod['employee_productivity'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 25:\t\t\t\t\t\n\t\t\t\t\t$mod['employee_business_conversion'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 26:\t\t\t\t\t\n\t\t\t\t\t$mod['client_business_conversion'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 27:\t\t\t\t\t\n\t\t\t\t\t$mod['client_wise_billing'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 28:\t\t\t\t\t\n\t\t\t\t\t$mod['recruiter_wise_billing'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 53:\t\t\t\t\t\n\t\t\t\t\t$mod['individual_contribution'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 54:\t\t\t\t\t\n\t\t\t\t\t$mod['recruiter_incentive_earning'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 55:\t\t\t\t\t\n\t\t\t\t\t$mod['crm_incentive_earning'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 56:\t\t\t\t\t\n\t\t\t\t\t$mod['location_wise_active_clients'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 57:\t\t\t\t\t\n\t\t\t\t\t$mod['business_continuity'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 58:\t\t\t\t\t\n\t\t\t\t\t$mod['client_retention'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 59:\t\t\t\t\t\n\t\t\t\t\t$mod['cv_rejection_analysis'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 60:\t\t\t\t\t\n\t\t\t\t\t$mod['position_rejection_analysis'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 61:\t\t\t\t\t\n\t\t\t\t\t$mod['collection_days'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 62:\t\t\t\t\t\n\t\t\t\t\t$mod['recuiter_wise'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 63:\t\t\t\t\t\n\t\t\t\t\t$mod['client_wise'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn $mod;\n\t}", "public function hasFiles(): bool\n {\n return $this->type != 'menu_links';\n }", "public function activities() {\n \n // Verify if is a team's member\n if ( $this->session->userdata( 'member' ) && !get_user_option('display_activities') ) {\n redirect('user/app/dashboard');\n }\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Verify if account is confirmed\n $this->_check_unconfirmed_account();\n \n // Load view/user/activities.php file\n $this->body = 'user/activities';\n $this->user_layout();\n }" ]
[ "0.56601524", "0.562251", "0.55698764", "0.5406959", "0.54017127", "0.53426015", "0.5328145", "0.5305146", "0.52707255", "0.5270139", "0.5253192", "0.522312", "0.52072424", "0.5192396", "0.5192114", "0.5175076", "0.5128811", "0.5126968", "0.51202744", "0.5104638", "0.5076102", "0.5067071", "0.506552", "0.5053936", "0.50287145", "0.5027461", "0.5024752", "0.5015818", "0.5011642", "0.50086224", "0.50064975", "0.5005197", "0.500509", "0.5001987", "0.49940428", "0.49883944", "0.49807292", "0.4977544", "0.4970037", "0.49678957", "0.49678957", "0.49677613", "0.49677086", "0.4953993", "0.49502113", "0.49459383", "0.49436238", "0.49394053", "0.49214944", "0.4914224", "0.48786378", "0.4876328", "0.48631763", "0.48617575", "0.4859975", "0.48553255", "0.48544663", "0.48544028", "0.48527476", "0.48521414", "0.4849379", "0.48490843", "0.48466918", "0.4845266", "0.48326504", "0.48251262", "0.482507", "0.48153076", "0.48141512", "0.48141512", "0.4804292", "0.4801075", "0.4799994", "0.4799604", "0.4796949", "0.4796286", "0.47962463", "0.4795242", "0.47945458", "0.47911212", "0.4788652", "0.47809705", "0.4767985", "0.47669187", "0.47596487", "0.4757093", "0.47522402", "0.4751364", "0.47490165", "0.47487628", "0.47487628", "0.47484648", "0.47484648", "0.47484648", "0.4748422", "0.4748422", "0.4748422", "0.47464526", "0.47415975", "0.47368026" ]
0.4831083
65
Returns an collection of items for a page.
public function getItems($offset, $itemCountPerPage) { $entries = Doctrine_Query::create() ->from('Zfplanet_Model_Entry') ->orderBy('publishedDate DESC') ->limit($itemCountPerPage) ->offset($offset) ->execute(); return $entries; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPageItems()\n {\n }", "public function getList($page);", "public function getPageItems() {\r\n\t\treturn $this->__pageItems;\r\n\t}", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getItems();", "public function getNewsForTop(int $page = 1): Collection\n {\n }", "function getItems();", "function getItems();", "public function Items() {\n\t\t$output = new ArrayList();\n\t\t$output->merge($this->getPages());\n\t\t$output->merge($this->getDataObjects());\n\n\t\t$this->extend('updateItems', $output);\n\n\t\treturn $output;\n\t}", "public function loadPage($page = 0) {\n return $this->posts()\n ->with('tags')\n ->with('user')\n ->take(Post::ITEM_PER_PAGE)\n ->offset($page * Post::ITEM_PER_PAGE)\n ->get();\n }", "public function getCollection()\n {\n $store = Mage::app()->getRequest()->getParam('store');\n $website = Mage::app()->getRequest()->getParam('website');\n if ($store) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId = Mage::getConfig()->getNode('stores')->{$store}->{'system'}->{'store'}->{'id'}->asArray();\n } elseif ($website) {\n /** @var Mage_Core_Model_Config_Element $cfg */\n $storeId =\n array_values(Mage::getConfig()->getNode('websites')->{$website}->{'system'}->{'stores'}->asArray());\n } else {\n $storeId = 0;\n }\n\n return Mage::getModel('cms/mysql4_page_collection')\n ->addStoreFilter($storeId)\n ->addFieldToFilter('is_active', 1)\n ->addFieldToFilter('identifier', array(array('nin' => array('no-route', 'enable-cookies'))));\n\n }", "public function getTeaserForTop(int $page = 1): Collection\n {\n }", "public function getPages() {}", "protected function getCmsPageCollection()\n {\n /** @var \\Magento\\Cms\\Model\\ResourceModel\\Page\\Collection $cmsPageCollection */\n $cmsPageCollection = $this->cmsPageCollectionFactory->create();\n $cmsPageCollection->load();\n return $cmsPageCollection;\n }", "public function getItems($page=1) {\n\t\t##\thttps://docs.topspin.net/tiki-index.php?page=Store+API\n\t\t##\n\t\t##\tPARAMETERS\n\t\t##\t\t@page\t\t\t\tRequested page number.\n\t\t##\t\t@offer_type\t\t\tReturn offers of the given type. Valid types are: buy_button, email_for_media, bundle_widget (multi-track streaming player in the app) or single_track_player_widget.\n\t\t##\t\t@product_type\t\tReturn offers for the given product type. Valid types: image, video, track, album, package, other_media, merchandise.\n\t\t##\t\t@tags\t\t\t\tSelect spins by tag. Include multiple tags by separating them with a comma.\n\t\t##\n\t\t##\tRETURN\n\t\t##\t\tAn array containing the list of items\n\t\t$url = 'http://app.topspin.net/api/v1/offers';\n\t\t$post_args = array(\n\t\t\t'artist_id' => $this->artist_id,\n\t\t\t'page' => $page\n\t\t);\n\t\t$data = json_decode($this->process($url,$post_args,false));\t\t\n\t\tif($data) { return $data->offers; }\n\t}", "public function getPages();", "public function index()\n {\n $enities = PageEntity::with('collections')->get();\n\n return $enities;\n }", "public function getItems()\n {\n $items = Item::latest()->paginate(9);\n\n // dd($items);\n return $items;\n }", "public function getItems(): CollectionInterface;", "public function listAll($page = 1)\n {\n $query = $this->http->getConfig('query') ?? [];\n $query = $query + ['page' => $page];\n\n $fullResponse = $this->request('get', $this->http, $this->module, null, $query);\n\n $data = json_decode($fullResponse, true);\n\n $this->storage = array_merge($this->storage, $data[$this->module]);\n\n $nextPage = array_key_exists('page_context', $data) && $data['page_context']['has_more_page'];\n\n return $nextPage ? $this->listAll($page + 1) : $this->storage;\n\n }", "public function pages()\n {\n return $this->morphedByMany('App\\Page', 'imageable');\n }", "public function getItems(){\n\t\treturn $this->_makeCall('items?');\n\t}", "protected function loadPage()\n {\n $this->getDataProvider()->getPagination()->setPage($this->getCurrentPage());\n $this->getDataProvider()->prepare(true);\n\n return $this->items = $this->getDataProvider()->getModels();\n }", "public function paginate(int $page_number, int $num_items_per_page): CollectionInterface;", "private function getItems()\n\t{\n\t\tglobal $objPage;\n\t\t$objDatabase = \\Database::getInstance();\n\t\t\n\t\t$time = time();\n\t\t$strBegin;\n\t\t$strEnd;\n\t\t$arrArticles = array();\n\t\t\n\t\t// Create a new data Object\n\t\t$objDate = new \\Date();\n\t\t\n\t\t// Set scope of pagination\n\t\tif($this->pagination_format == 'news_year')\n\t\t{\n\t\t\t// Display current year only\n\t\t\t$strBegin = $objDate->__get('yearBegin');\n\t\t\t$strEnd = $objDate->__get('yearEnd');\n\t\t}\n\t\telseif ($this->pagination_format == 'news_month')\t\n\t\t{\n\t\t\t// Display current month only\n\t\t\t$strBegin = $objDate->__get('monthBegin');\n\t\t\t$strEnd = $objDate->__get('monthEnd');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Display all\n\t\t}\n\t\t\n\t\t$strCustomWhere = '';\n\t\t// HOOK: allow other extensions to modify the sql WHERE clause\n\t\tif (isset($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where']) && count($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where']) > 0)\n\t\t{\n\t\t\tforeach($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$strCustomWhere = $this->$callback[0]->$callback[1]('news',$this);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fetch all news that fit in the scope\n\t\t$objArticlesStmt = $objDatabase->prepare(\"\n \tSELECT * FROM tl_news\n \tWHERE \n \t\tpid IN(\" . implode(',', $this->archives) . \") AND published=1 AND hide_in_pagination!=1\n \t\t\" . (!BE_USER_LOGGED_IN ? \" AND (start='' OR start<$time) AND (stop='' OR stop>$time)\" : \"\") . \"\n \t\t\" . ($strBegin ? \" AND (date>$strBegin) AND (date<$strEnd)\" : \"\" ) .\" \".$strCustomWhere. \"\n \tORDER BY date DESC\");\n\t \n\t\t$objArticles = $objArticlesStmt->execute();\n\t\t\n\t\tif ($objArticles->numRows < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// get all articles\n\t\t$arrArticles = $objArticles->fetchAllAssoc();\n\t\t\n\t\t// HOOK: allow other extensions to modify the items\n\t\tif (isset($GLOBALS['TL_HOOKS']['readerpagination']['getItems']) && count($GLOBALS['TL_HOOKS']['readerpagination']['getItems']) > 0)\n\t\t{\n\t\t\tforeach($GLOBALS['TL_HOOKS']['readerpagination']['getItems'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$arrArticles = $this->$callback[0]->$callback[1]('news',$arrArticles,$this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(count($arrArticles) < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// add keys for pagination (title, href)\n\t\tforeach($arrArticles as $i => $article)\n\t\t{\n\t\t\t// get alias\n \t\t$strAlias = (!$GLOBALS['TL_CONFIG']['disableAlias'] && $article['alias'] != '') ? $article['alias'] : $article['id'];\n \t\t\t\n \t\t\t$arrTmp = array\n \t\t\t(\n \t\t\t\t'href' => ampersand($this->generateFrontendUrl($objPage->row(), ((isset($GLOBALS['TL_CONFIG']['useAutoItem']) && $GLOBALS['TL_CONFIG']['useAutoItem']) ? '/' : '/items/') . $strAlias)),\n 'title' => specialchars($article['headline']),\n \t);\n \t\t\t\n \t\t\t$arrResult[] = array_merge($arrArticles[$i], $arrTmp);\n \t\t\tunset($arrTmp);\n\t\t}\n\t\t$arrArticles = $arrResult;\n\t\tunset($arrResult);\n\t\t\n\t\tif(count($arrArticles) < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// Higher the keys of the array by 1\n\t\t$arrTmp = array();\n\t\tforeach($arrArticles as $key => $value)\n\t\t{\n\t\t\t$arrTmp[$key+1] = $value;\n\t\t}\n\t\tksort($arrTmp);\n\t\t\n\t\t$arrArticles = $arrTmp;\n\t\tunset($arrTmp);\n\t\t\n\t\treturn $arrArticles;\n\t}", "public function getItems()\n {\n }", "protected function loadPage()\n\t{\n\t\t$this->_dataProvider->getPagination()->setCurrentPage($this->_currentPage);\n\t\treturn $this->_items = $this->dataProvider->getData(true);\n\t}", "public function getItems()\n {\n $arrLinks = array();\n\n $intNumberOfLinks = floor($this->intNumberOfLinks / 2);\n $intFirstOffset = ($this->intPage - $intNumberOfLinks - 1);\n\n if ($intFirstOffset > 0) {\n $intFirstOffset = 0;\n }\n\n $intLastOffset = ($this->intPage + $intNumberOfLinks - $this->intTotalPages);\n\n if ($intLastOffset < 0) {\n $intLastOffset = 0;\n }\n\n $intFirstLink = ($this->intPage - $intNumberOfLinks - $intLastOffset);\n\n if ($intFirstLink < 1) {\n $intFirstLink = 1;\n }\n\n $intLastLink = ($this->intPage + $intNumberOfLinks - $intFirstOffset);\n\n if ($intLastLink > $this->intTotalPages) {\n $intLastLink = $this->intTotalPages;\n }\n\n for ($i = $intFirstLink; $i <= $intLastLink; $i++) {\n $arrLinks[] = (object) array(\n 'page' => $i,\n 'current' => $i == $this->intPage,\n 'href' => $this->getItemLink($i)\n );\n }\n\n return $arrLinks;\n }", "public function getStoreItemsPage($items,$per_page,$page=1) {\n\t\t##\n\t\t##\tPARAMETERS\n\t\t##\t\t@items\t\t\t\tThe items list\n\t\t##\t\t@per_page\t\t\tA number specifying how many items per page to display\n\t\t##\t\t@page\t\t\t\tThe page number to display\n\t\t$offset = ($page>1) ? (($page-1)*$per_page) : 0;\n\t\treturn array_slice($items,$offset,$per_page);\n\t}", "public function fetchAllByPage($page, $itemsPerPage)\r\n {\r\n return $this->db->select('*')\r\n ->from(self::getTableName())\r\n ->whereEquals('lang_id', $this->getLangId())\r\n ->orderBy('id')\r\n ->desc()\r\n ->paginate($page, $itemsPerPage)\r\n ->queryAll();\r\n }", "public function getPageData(): Collection\n {\n return collect([\n // Globals.\n 'favicon' => $this->generalSettings->get('global_favicon'),\n 'site' => $this->context->get('site'),\n 'site_name' => $this->generalSettings->get('site_name'),\n 'disable_authors' => $this->generalSettings->get('disable_authors'),\n\n // Context.\n 'is_home' => $this->isHome(),\n 'title' => $this->getTitle(),\n 'description' => $this->context->get('meta_description'),\n 'permalink' => $this->context->get('permalink'),\n 'published' => $this->getPublishedDate(),\n 'last_modified' => $this->getLastModified(),\n 'author' => $this->context->get('author'),\n 'noindex' => $this->getNoIndex(),\n 'canonical_url' => $this->context->get('canonical_url'),\n 'locales' => $this->getLocales(),\n\n 'og_image' => $this->getOpenGraphImage(),\n 'og_type' => $this->getOpenGraphType(),\n\n 'twitter_card_type' => $this->context->get('twitter_card_type_page'),\n ]);\n }", "public function fetchAllByPage($page, $itemsPerPage)\n {\n return $this->db->select('*')\n ->from(self::getTableName())\n ->whereEquals('lang_id', $this->getLangId())\n ->orderBy('id')\n ->desc()\n ->paginate($page, $itemsPerPage)\n ->queryAll();\n }", "public function getItems()\n {\n $pageSize = $this->request->query('pageSize') ?? 30;\n $page = $this->request->query('page') ?? 1;\n $sortBy = $this->request->query('sort') ?? 'title_asc';\n $search = $this->request->has('search') ? $this->request->query('search') : null;\n $allowedFields = ['title', 'author', 'isbn'];\n $allowedOrder = ['asc', 'desc'];\n $sort = ControllerHelpers::deserializeSort($sortBy, $allowedFields, $allowedOrder);\n if (!$sort) {\n return response()->json([\n 'success' => false,\n 'message' => 'Please enter a valid sort params'\n ], 400);\n }\n\n $items = new ItemService();\n try {\n $result = $items->getItems($page, $pageSize, $search, $sort);\n if ($result) {\n return response()->json([\n 'success' => true,\n 'items' => $result\n ], 200);\n }\n } catch (Exception $ex) {\n return response()->json([\n 'success' => false,\n 'message' => 'your request could not be completed'\n ], 400);\n }\n\n }", "public function getDocumentSetsByPage(SiteTree $page);", "public function all()\n {\n return Page::all();\n }", "public function getPhotos($page, $itemsPerPage);", "function getPages() {\n\t\t$sql = 'SELECT * FROM page WHERE vis = 1 ORDER BY psn';\n\t\t$qrh = mysqli_query($this->lnk, $sql);\n\t\t$i = 1;\n\t\t\n\t\t// iterate and extract data to be passed to view\n\t\twhile ( $res = mysqli_fetch_array($qrh)) {\n\t\t\t$results[] = array('id' => $res['id'],'name' => $res['nam']);\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $results;\n\t\t\n\t}", "public function getPageAdvanced($page, $options = array())\n\t{\n\t\tif($page == \"new\") return new \\stdClass(); \n\t\t\t\n\t\t$items = $this->getPage($page);\n\t\t\t\n\t\tif(is_object($items)) \n\t\t{\n\t\t\t$items->load(\n\t\t\t\t'user', 'subpages', 'parentpages', 'products', 'categories', \n\t\t\t\t'tags', 'attributes', 'downloads');\n\t\t\t\n\t\t\t$this->loadImagesWithElements($items, array_get($options, 'skipWith', false));\n\t\t\t\n\t\t\t$items['lists'] = \n\t\t\t\t$items->userlists()->count(\\Illuminate\\Support\\Facades\\DB::raw(\n\t\t\t\t\t'DISTINCT name'\n\t\t\t\t));\n\t\t}\t\n\t\t\t\n\t\treturn $items;\n\t}", "protected function fetch($page){\n parent::fetch($page);\n\n // get primary keys values\n $primaryKeys = $this->getPrimaryKeys($this->collection, $this->connections);\n\n // related resources data\n $this->relatedData = $this->fetchRelatedData($primaryKeys, $this->connections);\n\n $this->iterator->rewind();\n\n }", "public function getItems($type);", "public function getItems(Request $request)\n {\n return Item::filter($request->all())\n ->paginate($request->get('per_page', 20));\n }", "public function getItems(): array;", "public function getItems(): array;", "public function get_list_by_page($args)\n\t\t{\n\t\t\t// Set only published post\n\t\t\t$this->set_files_by_published();\n\n\t\t\tif($this->files_count > 0)\n\t\t\t\treturn $this->get_list_by($args['page'], $args['amount']);\n\n\t\t\treturn array();\n\t\t}", "public function loadCollectionItems(Collection $collection): array;", "public function getNewsForCategory(NewsCategory $category, int $page = 1): Collection\n {\n }", "abstract protected function _getItems();", "public function index()\n {\n $pages = Page::active()->orderBy('order' , 'DESC')->get();\n\n return PageResource::collection($pages);\n }", "public function getFitPageItems () {\n return FitPageItemDao::getListByFitPage($this);\n }", "public function fetchAllByPage($page, $itemsPerPage, $albumId = null, $published = false)\r\n {\r\n return $this->prepareResults($this->photoMapper->fetchAllByPage($page, $itemsPerPage, $albumId, $published));\r\n }", "public function getPageResults(int $page = 1): array;", "function wv_wp_page_list() {\n\n $arglist = array(\n 'sort_order' => 'ASC',\n 'sort_column' => 'post_title',\n 'hierarchical' => 1,\n 'post_type' => 'page',\n 'post_status' => 'publish'\n );\n $mypages = get_pages($arglist);\n return $mypages;\n }", "public function getItems()\n {\n $this->loadItems();\n return $this->items;\n }", "function cicleinscription_get_itemsTable($table, $page = 0, $perpage = 0, $sort = \"o.name ASC\"){\n\tglobal $DB;\n\n\t$limitsql = '';\n\t$page = (int) $page;\n\t$perpage = (int) $perpage;\n\n\t# Iniciando paginacao\n\tif($page || $perpage){\n\tif ($page < 0) {\n\t$page = 0;\n\t}\n\n\tif ($perpage > ITEMS_MAX_PER_PAGE) {\n\t$perpage = ITEMS_MAX_PER_PAGE;\n\t} else if ($perpage < 1) {\n\t\t$perpage = ITEMS_PER_PAGE;\n\t}\n\t$limitsql = \" LIMIT $perpage\" . \" OFFSET \" . $page * $perpage;\n\t}\n\t\n\t// recupera todos os itens cadastrados\n\t$items = $DB->get_records_sql(\"SELECT o.*\n\t\t\t\tFROM {{$table}} o\n\t\t\t\tORDER BY {$sort} {$limitsql}\"\n\t\t\t);\n\t\n\treturn $items;\n}", "public function getItems() : array;", "public function getPaginatedList(\n ?int $page = 1,\n ?int $limit = 10\n ): PaginatedRepresentation {\n\n $allItems = $this->itemRepository->findAll();\n\n $nb_of_items = (int) count($allItems);\n $nb_of_pages = (int) ceil(($nb_of_items) / $limit);\n\n $itemsToDisplay = $this->itemRepository->findBy(\n [],\n null,\n $limit,\n ($page - 1) * $limit\n );\n\n\n $collection = new CollectionRepresentation($itemsToDisplay);\n\n $paginatedList = new PaginatedRepresentation(\n $collection,\n 'api_items_list',\n [],\n $page,\n $limit,\n $nb_of_pages,\n null,\n null,\n true,\n $nb_of_items\n );\n\n // To test the cache\n // sleep(2);\n\n return $paginatedList;\n }", "public function getAll()\n\t{\n\t\treturn new Collection($this->items);\n\t}", "public function pages()\n {\n $modular = [];\n\n foreach ($this->items as $path => $slug) {\n $page = $this->pages->get($path);\n if ($page !== null && !$page->isModule()) {\n $modular[$path] = $slug;\n }\n }\n $this->items = $modular;\n\n return $this;\n }", "public function getItems()\n {\n $items = Item::all();\n return response($items, 200);\n }", "function getAll($page=0)\n {\n global $config;\n\n $files = glob(PATH.\"/*.txt\");\n\n $start = ($page - 1) * $config->per_page;\n $end = $page * $config->per_page;\n $data = array();\n\n for ($i = $start; $i < $end; $i += 1)\n {\n\n if (!isset($files[$i])) { break; }\n\n # remove file extention\n $name = str_replace(\".txt\", \"\", str_replace(PATH.\"/\", \"\", $files[$i]));\n\n $data[] = (object)array(\n \"name\" => $this->getPuzzleName($name),\n \"id\" => $name\n );\n }\n\n return $data;\n }", "public function findAll($page = 1){\n $paginator = parent::findAll($page);\n $users = array();\n\n foreach($paginator as $user){\n $user->groups = $user->findManyToManyRowset('Group', 'FrontendUserGroup');\n\n foreach($user->groups as $group){\n $user->groupNames[] = $group->name;\n $user->groupIds[] = $group->id;\n }\n\n $users[] = $user;\n }\n\n return Zend_Paginator::factory($users);\n }", "public function getListPage(){\n\t\ttry{\n\t\t\t$sql = \"SELECT * FROM page\";\n\t\t\t$stmt = $this->_db->prepare($sql);\n\t\t\t$stmt->execute();\n\t\t\tif($stmt->errorCode() != 0){\n\t\t\t\t$error = $stmt->errorInfo();\n\t\t\t\tthrow new SQLException($error[2], $error[0], $sql, \"Impossible d'obtenir la liste des pages\");\n\t\t\t}\n\t\t\t$list = array();\n\t\t\twhile ($data = $stmt->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$list[] = new Page($data);\n\t\t\t}\n\t\t\treturn $list;\n\t\t}catch(PDOException $e){\n\t\t\tthrow new DatabaseException($e->getCode(), $e->getMessage(), \"Impossible d'obtenir la liste des pages\");\n\t\t}\n\t}", "public function getByPage($page = 0)\n {\n $page = $page > 0 ? --$page : 0;\n\n return $this->prepare(DB::findAll($this->table, 'ORDER BY time DESC LIMIT :page, '.$this->paginationLimit, array('page' => $page * $this->paginationLimit )));\n }", "static function get_pages(){\n\t\tglobal $wpdb;\n\t\t$sql = \"SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'page' AND post_status = 'publish'\";\n\t\t\n\t\treturn $wpdb->get_results($sql);\n\t}", "public function pageAction()\n {\n $page = $this->getRequest()->getParam('page', 1);\n $count = $this->getRequest()->getParam('count', 20);\n $collectionJson = Mage::helper('neklo_productposition/product')->getCollectionJson($page, $count);\n $this->getResponse()->setBody($collectionJson);\n $this->getResponse()->clearHeaders()->setHeader('Content-type', 'application/json', true);\n }", "public function getCollection();", "public function getCollection();", "public function getCollection();", "public function getCollection();", "public function getByPage($page = 1, $limit = 10)\n\t{\n\t\t\t$results = StdClass;\n\t\t\t$results->page = $page;\n\t\t\t$results->limit = $limit;\n\t\t\t$results->totalItems = 0;\n\t\t\t$results->items = array();\n\t\t\t\n\t\t\t$users = $this->model->skip($limit * ($page - 1))->take($limit)->get();\n\t\t\t\n\t\t\t$results->totalItems = $this->model->count();\n\t\t\t$results->items = $users->all();\n\t\t\t\n\t\t\treturn $results;\n\t}", "public function getArticle($page = 1)\n {\n return array();\n }", "public function getPagesAction() {\n\n //FETCH\n $paramss = array();\n $paramss['title'] = $this->_getParam('text');\n $paramss['viewer_id'] = Engine_Api::_()->user()->getViewer()->getIdentity();\n $paramss['limit'] = $this->_getParam('limit', 40);\n $paramss['orderby'] = 'title ASC';\n $usersitepages = Engine_Api::_()->getDbtable('pages', 'sitepage')->getSuggestClaimPage($paramss);\n $data = array();\n $mode = $this->_getParam('struct');\n if ($mode == 'text') {\n foreach ($usersitepages as $usersitepage) {\n $content_photo = $this->view->itemPhoto($usersitepage, 'thumb.icon');\n $data[] = array(\n 'id' => $usersitepage->page_id,\n 'label' => $usersitepage->title,\n 'photo' => $content_photo\n );\n }\n } else {\n foreach ($usersitepages as $usersitepage) {\n $content_photo = $this->view->itemPhoto($usersitepage, 'thumb.icon');\n $data[] = array(\n 'id' => $usersitepage->page_id,\n 'label' => $usersitepage->title,\n 'photo' => $content_photo\n );\n }\n }\n return $this->_helper->json($data);\n }", "public function &items();", "public function getPages()\n {\n return $this->getTable('ExhibitPage')->findBy(array('exhibit' => $this->id, 'sort_field' => 'order'));\n }", "function getPagedElements() {\n return $this->page_object;\n }", "public function getElements($page = null)\n {\n if ($page !== null) {\n $index = ($page - 1) * $this->getMaxPerPage();\n return array_slice($this->_elements, $index, $this->getMaxPerPage());\n }\n return $this->_elements;\n }", "static function PageMembergroups(Page $page)\n {\n if (!$page->Exists())\n {\n return array();\n }\n $sql = Access::SqlBuilder();\n $tblPmg = PageMembergroup::Schema()->Table();\n $tblMg = Membergroup::Schema()->Table();\n $join = $sql->Join($tblPmg);\n $joinCondition = $sql->Equals($tblPmg->Field('MemberGroup'), $tblMg->Field('ID'));\n $where = $sql->Equals($tblPmg->Field('Page'), $sql->Value($page->GetID()));\n $orderBy = $sql->OrderList($sql->OrderAsc($tblMg->Field('Name')));\n \n return Membergroup::Schema()->Fetch(false, $where, $orderBy, null, 0, null, $join, JoinType::Inner(), $joinCondition);\n }", "function getItems(){\r\n\t\t\treturn $this->items;\r\n\t\t}", "public static function get_page_items_returns() {\n return new external_single_structure(\n array(\n 'items' => new external_multiple_structure(\n feedback_item_exporter::get_read_structure()\n ),\n 'hasprevpage' => new external_value(PARAM_BOOL, 'Whether is a previous page.'),\n 'hasnextpage' => new external_value(PARAM_BOOL, 'Whether there are more pages.'),\n 'warnings' => new external_warnings(),\n )\n );\n }", "public function fetch(): ItemCollection\n {\n $result = $this->connection->getClient()->{$this->fetchMode}($this->toArray());\n\n return $this->processor->processItems($result);\n }", "public function index($page = 1) {\n // $items = Magazine::all(false);\n $p = new Pager(new Magazine(), 4, false);\n if(!$pager_set = $p->feed($page)) abort(404);\n $pager = $pager_set['pager'];\n $items = $pager_set['result_set'];\n require_once ROOT . '/view/main/index.php';\n }", "public function index()\n {\n $sort = FacadesRequest::get('sort');\n $dir = FacadesRequest::get('direction');\n\n if ($sort == '')\n $sort = 'created_at';\n\n $search = FacadesRequest::get('q');\n if ($search != '') {\n $pages = Page::where('name', 'LIKE', '%' . $search . '%')\n ->orWhere('description', 'LIKE', '%' . $search . '%')\n ->orderBy($sort, $dir)->paginate(10);\n }\n else {\n $pages = Page::orderBy($sort, $dir)->paginate(10);\n }\n\n\n return PageResource::collection($pages);\n }", "public function paginateCollection(Collection $collection, $page)\n {\n\n return array_values(\n $collection->slice(($page - 1) * $this->getPagination())\n ->take($this->getPagination())->all()\n );\n }", "public\tfunction pages()\n\t{\n\t\treturn\t$this->belongsToMany('App\\Page')->withTimestamps();\n\t}", "public function getItemsAttribute(): Collection;", "public function getItems()\n {\n return $this->_itemCollection;\n }", "public function get(int $page_size = null, int $after = null, int $before = null): InventoryCollection\n {\n return $this->collection(InventoryCollection::class, '2.0/inventory',\n compact('page_size', 'after', 'before'));\n }", "public function getPages()\n {\n list($page_id, $scope_pages, $scope_page_type) = array(\n $this['page_id'],\n $this['scope']['pages'],\n $this['scope']['page_type']\n );\n\n $result_pages = array();\n\n if ($scope_pages == 'this') {\n /**\n * Only current page\n */\n $result_pages[] = $page_id;\n } elseif (in_array($scope_pages, array('descendants', 'children'))) {\n /**\n * All descendants\n */\n $finder = fx::data('content')->descendantsOf($page_id);\n if ($scope_page_type) {\n $finder->where('type', $scope_page_type);\n }\n $result_pages = array_merge($result_pages, $finder->all()->getValues('id'));\n /**\n * With self page\n */\n if ($scope_pages == 'descendants') {\n $result_pages[] = $page_id;\n }\n }\n return array_unique($result_pages);\n }", "public function getByPage($page = 1, $limit = 10, $with = [])\n\t{\n\t\t$result = new \\StdClass;\n\t\t$result->page = $page;\n\t\t$result->limit = $limit;\n\t\t$result->totalItems = 0;\n\t\t$result->items = [];\n\n\t\t$model = $this->make($with)->skip($limit * ($page - 1))->take($limit)->get();\n\n\t\t$result->totalItems = $this->make()->count();\n\t\t$result->items = $model->all();\n\n\t\treturn $result;\n\t}", "public static function inativosPage($page)\n {\n return DB::table('clients')\n ->select('id', 'name', 'phone', 'email', 'updated_at')\n ->whereDate('updated_at', '<=', date('Y-m-d', strtotime('-30 days')))\n ->paginate($page);\n }" ]
[ "0.73115045", "0.7199129", "0.6982969", "0.6812391", "0.6812391", "0.6812391", "0.6812391", "0.6812391", "0.6812391", "0.6812391", "0.6812391", "0.6812391", "0.6812391", "0.6812391", "0.6812391", "0.6812391", "0.6783462", "0.6591818", "0.6591818", "0.6564522", "0.6553492", "0.6508278", "0.6499794", "0.64996296", "0.64797264", "0.64619213", "0.64419293", "0.6406715", "0.6387475", "0.63660234", "0.63544685", "0.634968", "0.6333307", "0.6306485", "0.62669146", "0.6264866", "0.62519443", "0.624526", "0.62089086", "0.6187835", "0.6177386", "0.61656624", "0.6159998", "0.6154781", "0.61504585", "0.61469865", "0.61236215", "0.6114067", "0.6109597", "0.6097037", "0.6082587", "0.6077319", "0.6074929", "0.6074929", "0.607096", "0.6044742", "0.6043491", "0.6040552", "0.60297877", "0.6027797", "0.60273635", "0.60238534", "0.59933174", "0.5990241", "0.59899426", "0.5966922", "0.59643286", "0.59262854", "0.5924839", "0.59191614", "0.5917461", "0.59071976", "0.59006447", "0.5900536", "0.5899828", "0.5892958", "0.58858895", "0.58858895", "0.58858895", "0.58858895", "0.58665514", "0.5862719", "0.5855643", "0.58455396", "0.5838159", "0.5837987", "0.58359355", "0.58328533", "0.58126074", "0.5809641", "0.58052427", "0.5803076", "0.5801708", "0.57989424", "0.57814574", "0.5777599", "0.5775311", "0.57684803", "0.5764258", "0.57606", "0.57602805" ]
0.0
-1
Returns the total number of rows in the collection.
public function count() { $count = Doctrine_Query::create() ->select('COUNT(id) as total') ->from('Zfplanet_Model_Entry') ->fetchone(); return $count->total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function count()\n {\n return count($this->_rows);\n }", "public function getNumberOfRows()\r\n {\r\n return count($this->data);\r\n }", "public function countRows()\n {\n return count($this->rows);\n }", "public function count() {\n return count($this->__rows__);\n }", "public function num_rows() {\n\t\t\treturn $this->count();\n\t\t}", "public function getNumberOfRows() {\n return count($this->rows);\n }", "public function count() {\n return $this->row_count();\n }", "public function count()\n {\n return $this->rows;\n }", "public function num_rows() {\n\t\treturn $this->GetNumRows();\n\t}", "public function getNumRows() {\n\t\treturn $this->_num_rows;\n\t}", "public function count(): int\n {\n return count($this->collection);\n }", "public function count()\n {\n $query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n return $row['total_rows'];\n }", "public function GetNumberOfRows() {\n return $this->num_rows;\n }", "public function count()\n {\n return $this->collection->count();\n }", "public function count()\n {\n return $this->collection->count();\n }", "public function countRows(): int\n {\n $result = $this->_getResult()->numRows(); // Returns an integer on success and an \\PEAR_Error object on failure\n return is_int($result) ? $result : 0;\n }", "public function count() {\r\n\t\treturn count($this->collection);\r\n\t}", "public function size()\n {\n return count($this->getCollection());\n }", "public function get_rows_count()\n\t{\n\t\treturn count($this->get_rows());\n\t}", "public function count()\n {\n return count($this->collection);\n }", "public function count(): int\n {\n return $this->collection->count();\n }", "public function getNumRows(){\n\t\treturn $this->instance->getNumRows();\n\t}", "public function count()\n {\n if ($this->count === null) {\n $this->count = $this->dataSource->count();\n }\n return $this->count;\n }", "public function count(): int\n {\n if ($this->numberOfRows === null) {\n if (is_array($this->rows)) {\n $this->numberOfRows = count($this->rows);\n } else {\n $this->numberOfRows = $this->query->count();\n }\n }\n return $this->numberOfRows;\n }", "function numRows()\n {\n $this->getRows();\n return $this->row_counter;\n }", "public function count()\n\t{\n\t\treturn $this->query->rowCount();\n\t}", "public function total(): int\n {\n return count($this->all());\n }", "public function countRows()\n {\n return $this->_result !== null ? $this->_result->rowCount() : 0;\n }", "public function rowCount()\n {\n return sasql_num_rows($this->result);\n }", "public function count(){\n\t\t\t$query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n\t\t\n\t\t\t$stmt = $this->conn->prepare( $query );\n\t\t\t$stmt->execute();\n\t\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\n\t\t\treturn $row['total_rows'];\n\t\t}", "public function num_rows()\r\n {\r\n return $this->num_rows;\r\n }", "public function getNumRows(): int\n {\n if (is_int($this->numRows)) {\n return $this->numRows;\n }\n if ($this->resultArray !== []) {\n return $this->numRows = count($this->resultArray);\n }\n if ($this->resultObject !== []) {\n return $this->numRows = count($this->resultObject);\n }\n\n return $this->numRows = count($this->getResultArray());\n }", "public function count()\n\t{\n\t\treturn $this->_totalItemCount;\n\t}", "public function getRowsCount()\n {\n if (is_null($this->summaryRow)) {\n return count($this->rows);\n } else {\n return count($this->rows) + 1;\n }\n }", "public function getRowCount()\n {\n return $this->row_count;\n }", "public function getRowCount()\n {\n return $this->row_count;\n }", "public function getRowCount()\n {\n return $this->row_count;\n }", "function count()\n{\n\tif (!$this->getSql()) return 0;\n\t$rows = $this->getClone()->select('count(*) as n');\n\treturn (int)$rows[0]['n'];\n}", "public function count(){\n $query = \"SELECT COUNT(*) as total_rows FROM \".$this->table_name. \"\";\n\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n return $row['total_rows'];\n }", "public function count(){\n $query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n return $row['total_rows'];\n }", "public function getNumberOfRows(){\r\n $this->setTable('subscribed');\r\n $table = $this->getTable();\r\n\r\n $sql = \"SELECT * FROM \" . $table;\r\n $stmt = $this->fetch()->query($sql);\r\n return $stmt->rowCount();\r\n }", "public function count()\n\t{\n\t\treturn (int) $this->getStatement()->rowCount();\n\t}", "public function count_rows() {\r\n return $this->db->count_all_results($this->table_name);\r\n }", "public function getNumberOfRows();", "public function count() {\n $this->_active_query->fields($this->func()->count());\n $query = $this->query( $this->_active_query->getQuery(), $this->_active_query->getParams() );\n return (int)$query->rowCount();\n }", "public function getRowCount() {\n return $this->Read->rowCount();\n }", "function numrows() {\r\n\t\treturn $this->numrows;\r\n\t}", "public function count(): int\n\t{\n\t\treturn $this->paginator->count();\n\t}", "public static function totalNumber()\n {\n return (int)self::find()->count();\n }", "public function rows(): int\n {\n return $this->rows;\n }", "public function count(): int\n {\n return $this->getIterator()->count();\n }", "public function count()\n {\n return $this->iterator->count();\n }", "public function count_rows()\n {\n $m_num_rows = $this->c_obj_stmt->rowCount();\n return $m_num_rows;\n }", "function NumRows() {\n\t\t\t$result = pg_num_rows($this->result);\n\t\t\treturn $result;\n\t\t}", "public function count()\n {\n return $this->getTotalItemCount();\n }", "public function total_rows();", "public function count()\n {\n return $this->queryResult->getSize();\n }", "public function count()\n {\n if (null === $this->count) {\n $this->count = count($this->resultSet);\n }\n return $this->count;\n }", "public function getRowCount(): int\n {\n return $this->rowCount;\n }", "public function count()\n {\n return $this->size();\n }", "public function num_rows()\n\t{\n\t\tif ($this->sqlResource)\n\t\t{\n\t\t\treturn (mysql_num_rows($this->sqlResource));\n\t\t}\n\t}", "function num_rows() {\r\n\t\treturn $this->dbh->num_rows();\r\n\t}", "public function countTotalItems()\n\t{\n\t\t$sql = \"SELECT * FROM items\";\n\t\t$query = $this->db->query($sql);\n\t\treturn $query->num_rows();\n\t}", "public function getNumberOfRows() {\n\n $query = $this->db->prepare(\"SELECT COUNT(*) FROM `products`\");\n\n try {\n\n $query->execute();\n $rows = $query->fetchColumn();\n\n return $rows;\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "function count()\n {\n $this->object->select($this->object->get_primary_key_column());\n $retval = $this->object->run_query(FALSE, FALSE, FALSE);\n return count($retval);\n }", "public function totalNumRows()\n {\n try {\n\n $sql = 'SELECT DISTINCT gil.id_item\n FROM geocontexter.gc_item AS gil\n '.$this->_sql_tables.'\n WHERE gil.title ILIKE ?\n '.$this->_sql_in_id_list;\n\n $res = $this->query($sql, array($this->search . '%'));\n return (int)count($res);\n\n } catch(\\Exception $e) {\n throw $e;\n }\n }", "function get_count()\n\t{\n\t\treturn $this->__num_rows;\n\t}", "public function getRowCount() {\n\t\treturn $this->ROW_COUNT;\n\t}", "public function getNumRows()\n {\n \treturn $this->previouslyExecuted->num_rows;\n }", "public function getTotal()\n\t{\n\t\t\n\t\treturn count($this->findAll());\n\t}", "public function getNbResults()\n\t{\n\t\tif (!$this->itemCount) {\n\t\t\t$this->itemCount = count($this->collection);\n\t\t}\n\n\t\treturn $this->itemCount;\n\t}", "public function numRows() : int\n\t{\n\t\treturn $this->handle->numRows($this->result);\n\t}", "public function num_rows()\n\t{\n\t\tif ( ! is_int($this->num_rows))\n\t\t{\n\t\t\tif (count($this->result_array) > 0)\n\t\t\t{\n\t\t\t\treturn $this->num_rows = count($this->result_array);\n\t\t\t}\n\t\t\telseif (count($this->result_object) > 0)\n\t\t\t{\n\t\t\t\treturn $this->num_rows = count($this->result_array);\n\t\t\t}\n\n\t\t\treturn $this->num_rows = count($this->result_array());\n\t\t}\n\n\t\treturn $this->num_rows;\n\t}", "public function count() {\n\t\treturn count($this->getData());\n\t}", "function numRows()\n\t{\n\t\treturn $this->_num_rows;\n\t}", "public function rowCount () {\n return $this->query->rowCount();\n }", "public function rowTotalCount() {\n if (is_null($this->response)) {\n throw new Exception('Response in NULL');\n }\n return $this->response->found;\n }", "public function count()\n {\n return $this->model->paginate(1, $this->select)->total();\n }", "public function getCount()\n\t{\n\t\treturn $this->data_source->count();\n\t}", "public function count(): int\n\t{\n\t\treturn count($this->all());\n\t}", "public function rowCount() {\n\t\tif( !$this->_result ) return 0;\n\t\treturn mssql_num_rows($this->_result);\n\t}", "public function GetRowCount() : INT\r\n {\r\n return($this->preparedStatement->rowCount());\r\n }", "function numResults() {\n\t\treturn $this->num_rows();\n\t}", "public function getTotal()\n\t{\n $rows = (new \\yii\\db\\Query())\n ->select('*')\n ->from($this->table)\n ->all();\n\t\treturn count($rows);\n\t}", "public function getNumTotalItems()\n {\n return $this->numTotalItems;\n }", "public function count(): int\n {\n return count( $this->toArray() );\n }", "public function count()\n\t{\n\t\treturn $this->getCount();\n\t}", "public function count()\n\t{\n\t\treturn $this->result->count();\n\t}", "public function numOfRows();", "public function getTotalCollectionCount() {\n return $this->totalCollectionCount;\n }", "public function size(): int {\n\t\treturn $this->count();\n\t}", "public function count() {\n\t\treturn count($this->getIterator());\n\t}", "public function count() {\n if($this->count === false) {\n if (is_object($this->table)) {\n $this->count = 1;\n } elseif (is_array($this->table)) {\n $this->count = count($this->table);\n } else {\n $this->count = 0;\n }\n }\n return $this->count;\n }", "public function countItems() : int\n {\n return $this->model->count();\n }", "public function count(): int\n {\n return count($this->data);\n }", "public function numRows() {\n\t\t$val = $this->numResults;\n\t\t$this->numResults = array();\n\t\treturn $val;\n\t}", "public function count()\n {\n $result = new QueryResult($this);\n return $result->count();\n }", "function RowCount() {}", "public function count(): int\n {\n return $this->statement->rowCount();\n }", "public function getTotalItemCount()\n\t{\n\t\treturn $this->_totalItemCount;\n\t}", "public function getTotalItemCount()\n {\n return $this->totalItemCount;\n }" ]
[ "0.81546694", "0.8141833", "0.8120072", "0.80941343", "0.8087115", "0.8062587", "0.8059919", "0.7985744", "0.7975975", "0.7967798", "0.79122126", "0.79096085", "0.790677", "0.79014206", "0.79014206", "0.789478", "0.7892104", "0.78877735", "0.78777176", "0.7868898", "0.786682", "0.781808", "0.7811403", "0.7803823", "0.7797891", "0.77871984", "0.778203", "0.77628344", "0.7758996", "0.77522945", "0.77365184", "0.772931", "0.7724958", "0.7724389", "0.772131", "0.772131", "0.772131", "0.7710913", "0.7705377", "0.7695729", "0.769228", "0.76916814", "0.7687897", "0.7685001", "0.7672251", "0.76672286", "0.7661243", "0.7659268", "0.76569104", "0.76550627", "0.7639581", "0.7635221", "0.7634922", "0.7628996", "0.7618697", "0.7607205", "0.7599984", "0.75970346", "0.7593553", "0.75918883", "0.75911415", "0.75900745", "0.75735974", "0.756561", "0.75631446", "0.75587016", "0.7556051", "0.7553547", "0.7550155", "0.7549295", "0.7520121", "0.75122064", "0.75118476", "0.7503885", "0.7503609", "0.7501396", "0.7500197", "0.7498326", "0.74828655", "0.74816334", "0.74715525", "0.74661434", "0.74651045", "0.7460697", "0.7457931", "0.7456252", "0.74489915", "0.74484575", "0.7426499", "0.7425877", "0.7421606", "0.7421232", "0.7420884", "0.74196124", "0.7419408", "0.7418801", "0.7418654", "0.7415971", "0.7411154", "0.74088365", "0.74083114" ]
0.0
-1
Execute all runonce files in module config directories
public function run() { $this->upgrade_to_1_1_0(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function run_init_scripts() {\n foreach (self::$_roots as $module_name => $root_path) {\n if (file_exists($fname =\n ($root_path . self::MODULE_BOOTSTRAP_FILE))) {\n include $fname;\n }\n }\n }", "public function runModules() {\n foreach ($this->modules as $module) {\n $this->runModule($module);\n }\n }", "public static function init() {\n foreach (static::$dirs as $dir) {\n if($phpFiles = glob($dir . DIRECTORY_SEPARATOR . '*.php')) {\n foreach ($phpFiles as $phpFile) {\n $namespace = basename($phpFile, '.php');\n static::$config[$namespace] = require_once $phpFile;\n }\n }\n }\n }", "public function __runEngine()\n\t{\n\t\t$directories = ['core'];\n\n\t\tforeach ($directories as $dir) {\n\t\t\t\t\n\t\t\t$filePath \t= TEMPLATEPATH.'/'.$dir; \n\t\t\t$php_files \t= scandir($filePath);\n\t\t\t$collectOfFiles = collect($php_files);\n\t\t\t$slice \t\t\t= $collectOfFiles->slice(2); \n\t\t\t$collectOfFiles = $slice->all(); \n\n\t\t\tforeach($collectOfFiles as $perFile)\n\t\t\t{\n\t\t\t\tinclude $filePath.'/'.$perFile;\n\t\t\t} \n\t\t} \n\n\t\t$this->__startClasses();\n\t}", "private static function runAll () {\n\t\tif(empty(self::$registered)) return;\n\n\t\tforeach(self::$registered as $plugin) {\n\t\t\t$plugin->run();\n\t\t}\n\t}", "public function run() {\n $this->load_dependencies();\n $this->load_localization();\n $this->load_admin();\n $this->load_public();\n }", "public function onEveryRun(): void\n {\n $this->pruneMissingDirectories();\n $this->pruneSymbolicLinks();\n $this->fixOldSampleValetDriver();\n $this->errorIfOldCustomDrivers();\n }", "protected function init()\n {\n $files = $this->fs->findFile('', 'init', 'php', true, true);\n\n if (!$files) {\n return;\n }\n\n $files = array_reverse($files);\n\n $di = $this->getDI();\n\n foreach ($files as $file) {\n include $file;\n }\n\n }", "public function runAll()\n {\n $this->init()->run()->done();\n }", "public function apply()\n {\n\n\n $files = 'start';\n //$load is empty as we will use the .default file to select the data directory\n $load = '';\n $reload = 1;\n \n $this->process->loadFiles($this->helper->getModuleName(),$load,explode(\",\",$files),$reload);\n \n }", "public function 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 }", "public function initializeConfiguration(){\n //initial Configured autoload\n if(count($GLOBALS['config']['autoload']))\n self::autoload($GLOBALS['config']['autoload']);\n\n\n }", "private function setupPHPConfigFiles()\n {\n foreach( glob('app/etc/*.php') as $file )\n {\n $key = str_replace('.php', null, basename($file));\n $data = include $file;\n \n $this->config->add($key, $data);\n }\n }", "public function Process() {\n\t\tforeach($this->modules as $module) {\n\t\t\t$module->Run();\n\t\t}\n\t}", "private function loadConfigFiles()\n { if (!$this->configFiles) {\n $this->configFiles[] = 'config.neon';\n }\n\n foreach ($this->configFiles as $file) {\n $this->configurator->addConfig($this->paths->getConfigDir().'/'.$file);\n }\n }", "private function once()\n {\n $alreadyRan = [];\n\n $docker = (new Docker())->mustRun(false);\n\n $temp = tempnam(sys_get_temp_dir(), 'dchelper');\n $docker->run(\"cp {$this->container}:{$this->lockFile} {$temp}\");\n if ($docker->exit === 0) {\n $alreadyRan = array_map('trim', file($temp));\n }\n\n $once = !\\is_array($this->once) ? [$this->once] : $this->once;\n\n $executed = 0;\n foreach ($once as $script) {\n\n $script = ($this->doEnvSubst)($script);\n\n if (!\\in_array($script, $alreadyRan)) {\n\n $this->runScript($script);\n\n $alreadyRan[] = $script;\n $executed ++;\n\n if (!$this->isLocal) {\n file_put_contents($temp, implode(PHP_EOL, $alreadyRan));\n $docker->mustRun()->run(\"cp $temp {$this->container}:{$this->lockFile}\");\n }\n }\n }\n\n debug($executed . ' script(s) executed.');\n\n @unlink($temp);\n }", "public function runInstallTasks();", "protected function setConfigurations()\n {\n if ($files = $this->getFiles('config'))\n {\n foreach ($files as $key => $filename)\n {\n $this->config->set(basename($filename, '.php'), require path('config').DIRECTORY_SEPARATOR.($filename));\n }\n }\n }", "public function executeModule()\n {\n }", "private static function setup()\n {\n $files = ['Routes', 'Setup', 'Response'];\n $folder = static::$root.'Setup'.'/';\n\n self::call($files, $folder);\n\n $files = ['Database', 'Panel', 'Security', 'Maintenance', 'Loggin', 'Translator', 'App', 'Robots'];\n $folder = static::$root.'Setup/Documentations'.'/';\n\n self::call($files, $folder);\n\n $files = ['AppSetupException'];\n $folder = static::$root.'Setup/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "function do_autoload() {\n\tinit_files();\n}", "protected function includeAndStartCoreBootstrap() {}", "public function runSetupScripts()\n\t\t{\n\t\t\t$xmlResources = \\Z::getConfig()->getResources();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$installedResources = \\Z::getModel('core/extension')->getCollection()->load();\n\t\t\t}\n\t\t\tcatch (\\Sys\\Exception $e)\n\t\t\t{\n\t\t\t\t$this->initialInstall();\n\t\t\t\t$installedResources = \\Z::getModel('core/extension')->getCollection()->load();\n\t\t\t}\n\t\t\tforeach ($xmlResources as $name => $resource)\n\t\t\t{\n\t\t\t\t// this is the version we should have installed on our system\n\t\t\t\t$latestVersion = $resource['requiredVersion'];\n\t\t\t\t// this is the version we currently have on our system, if the\n\t\t\t\t// extension is installed at all\n\t\t\t\t$installedExtension = $installedResources->isInstalled($name);\n\t\t\t\tif ($installedExtension)\n\t\t\t\t\t$installedVersion = $installedExtension->getVersion();\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$installedVersion = '0.0.0';\n\t\t\t\t\t$installedExtension = \\Z::getModel('core/extension');\n\t\t\t\t}\n\t\t\t\t$end = 'install-'.$latestVersion.'.php';\n\t\t\t\t$start = 'install-'.$installedVersion.'.php';\n\t\t\t\tif ($latestVersion != $installedVersion)\n\t\t\t\t{\n\t\t\t\t\t$installerFilesLocation = \\Z::getConfig()->getModule($resource['module'])->getPath('sql/'.$name.'/');\n\t\t\t\t\t$handle = opendir($installerFilesLocation);\n\t\t\t\t\tif ($handle)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile (FALSE !== ($file = readdir($handle)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (strpos($file, '.php') > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($file > $start) && ($file <= $end))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->_executedFiles[] = $installerFilesLocation.$file;\n\t\t\t\t\t\t\t\t\t//echo $installerFilesLocation.$file.'<br/>';\n\t\t\t\t\t\t\t\t\tinclude $installerFilesLocation.$file;\n\t\t\t\t\t\t\t\t\t// after the script is executed, set the\n\t\t\t\t\t\t\t\t\t// current version in the extension table\n\t\t\t\t\t\t\t\t\tif ($installedExtension->getCode() != '')\n\t\t\t\t\t\t\t\t\t\t$installedExtension->setVersion($latestVersion);\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t$installedExtension->setVersion($latestVersion)\n\t\t\t\t\t\t\t\t\t\t\t->setCode($name);\n\t\t\t\t\t\t\t\t\t$installedExtension->save();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// execute the install script for $file\n\t\t\t\t\t\t\t\t// update the version in the table\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclosedir($handle);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new \\Sys\\Exception('Cannot open the location => %s of the setup install scripts',\n\t\t\t\t\t\t\t$installerFilesLocation);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public static function run() {\n Cin::checkConfigVo();\n Cin::$manager->run();\n }", "public function run(){\n\n # run installers whos module is installed\n foreach( $this->_installers as $module ){\n\n // skip the ones that is not installed\n if(!Mage::helper('core')->isModuleEnabled($module)) continue;\n\n // get an installer object\n $installer = $this->_getInstaller($module);\n\n // make sure that we got an installer\n if(!$installer) continue;\n\n // skip the ones that is already installed\n if($this->hasInstallerRun($installer)) continue;\n\n // well, run it!\n try {\n if($installer->run()){\n $this->storeInstallerRun($installer);\n }\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n }", "function run()\n{\n //Require classes\n require_once getPath('class_path').'/class.Session.php';\n\n //Require resources\n require_once getPath('resources_path').'/session.php';\n require_once getPath('resources_path').'/strings.php';\n require_once getPath('resources_path').'/icons.php';\n require_once getPath('resources_path').'/functions.php';\n\n //Require template\n include_once getPath('template_path').'/template.php';\n}", "public function serversInit()\n\t{\n\t\t$api_root=$this->getPath();\n\t\t$p=opendir($api_root);\n\t\twhile(false!==($d=readdir($p)))\n\t\t{\n\t\t\tif($d!='.' && $d!='..' && is_dir($api_root.'/'.$d))\n\t\t\t{\n\t\t\t\tif(file_exists($api_root.'/'.$d.'/init.php') && file_exists($api_root.'/'.$d.'/config.xml'))\n\t\t\t\t{\n\t\t\t\t\t$settings=@simplexml_load_file($api_root.'/'.$d.'/config.xml');\n\t\t\t\t\tif(!$settings){\n\t\t\t\t\t\t$this->setError('Not inited: '.$d.'; wrong config file.');\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t#die_r($settings->api->name);\n\t\t\t\t\t\t$this->registerEngine((String)$settings->api->name,$settings->api->protocols);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function publishModulesMigrationsFiles()\n {\n foreach (ModulesConfig::getModulesNames() as $moduleName) {\n $this->publishModuleMigrationsFiles($moduleName);\n }\n }", "public function run () {\n\t\trequire_once $this->pluginFile;\n\t}", "function init_files() {\n\t$filenames = [\n\t\t'genesis',\n\t\t'general',\n\t\t'gravity-forms',\n\t\t'yoast-seo',\n\t\t'acf/options-page',\n\t\t'acf/general'\n\t];\n\n\tload_specified_files( $filenames );\n}", "private function loop_through_files_and_fire_hook() {\n\t\t$plugin_dir = dirname( app()->plugin_file );\n\n\t\t$recursive_dir = new \\RecursiveDirectoryIterator( $plugin_dir );\n\n\t\tforeach ( new \\RecursiveIteratorIterator( $recursive_dir ) as $file => $file_obj ) {\n\t\t\tif ( ! is_string( $file ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! app()->is_our_file( $file ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Do something to this file.\n\t\t\t *\n\t\t\t * @author Aubrey Portwood <[email protected]>\n\t\t\t * @since 2.0.0\n\t\t\t *\n\t\t\t * @param string $file The file.\n\t\t\t */\n\t\t\tdo_action( 'wp_kickstart_file', $file );\n\t\t}\n\t}", "public function main()\n\t{\n\t\t$this->loadConfig();\n\t\t$this->validateProject();\n\t\t$this->cleanConfig();\n\t\t$this->installDependencies();\n\t\t$this->createAutoload();\n\t\t$this->finish();\n\t}", "protected function load_files() {\n\t\trequire_once __DIR__ . '/class-papi-admin-meta-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-option-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-post.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-taxonomy.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-columns.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-page-type-switcher.php';\n\t}", "public function run()\n {\n $configs = [\n 'site.title' => null,\n 'site.url' => null,\n 'site.type' => null,\n 'site.image' => null,\n 'site.description' => null,\n 'username.twitter' => null,\n 'username.facebook' => null,\n 'username.instagram' => null,\n ];\n\n foreach ($configs as $key => $value) {\n $slpits = Str::of($key)->explode('.');\n $group = count($slpits) > 1 ? $slpits[0] : null;\n Config::create(['key' =>$key, 'value'=>$value, 'group' =>$group]);\n }\n }", "public function boot(): void\n {\n foreach (self::FILES as $file) {\n $file = __DIR__.\"/../../overrides/$file\";\n\n if (! file_exists($file)) {\n throw ShouldNotHappen::fromMessage(sprintf('File [%s] does not exist.', $file));\n }\n\n require_once $file;\n }\n }", "protected static function loadSingleExtLocalconfFiles() {}", "public function init() {\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitUsers.php');\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitGroups.php');\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitGroupsDifferentOU.php');\n\t\tparent::init();\n\t}", "public function run() {\n\t\t$this->loader->run();\n\t}", "public function run() {\n\t\t$this->loader->run();\n\t}", "public function run() {\n\t\t$this->loader->run();\n\t}", "public function run() {\n\t\t$this->loader->run();\n\t}", "public function run() {\n\t\t$this->loader->run();\n\t}", "public function run() {\n\t\t$this->loader->run();\n\t}", "public function run() {\n\t\t$this->loader->run();\n\t}", "public function run() {\n\t\t$this->loader->run();\n\t}", "public function run() {\n\t\t$this->loader->run();\n\t}", "public static function init( )\n {\n $config = \\Painless::load( 'system/common/config' );\n $triggers = $config->get( 'triggers.*' );\n \n if ( ! empty( $triggers ) )\n {\n foreach( $triggers as $name => $callback )\n {\n self::register( $name, $callback );\n }\n }\n }", "public function load_files() {\n\n\t\t// load our login piece\n\t\tif ( is_admin() || $GLOBALS['pagenow'] == 'wp-login.php' ) {\n\t\t\trequire_once( 'lib/core.php' );\n\t\t}\n\t}", "function do_cron() {\n global $config;\n ct_log(\"Cron-Job started.\", 2, -1, 'cron');\n \n $btns = churchcore_getModulesSorted(false, false);\n foreach ($btns as $key) {\n include_once (constant(strtoupper($key)) . \"/$key.php\");\n if (function_exists($key . \"_cron\") && getConf($key . \"_name\")) {\n $arr = call_user_func($key . \"_cron\");\n }\n }\n ct_sendPendingNotifications();\n ct_log(\"Cron-Job finished.\", 2, -1, 'cron');\n}", "private static function initialLoad() {\n include_once __DIR__ . '/Storange.php';\n Storange::getPathDir('wowframework/');\n include_once __DIR__ . '/exceptions/LoadFiles.php';\n }", "function load_modules() {\n $module_folders = scandir(clientele_ROOT . '/modules/');\n foreach ($module_folders as $key => $folder) {\n $module_folders[$key] = clientele_ROOT. '/modules/'. $module_folders[$key] . '/' . $module_folders[$key] . '.class.php'; \n }\n $module_folders = apply_filters('clientele_module_folders', $module_folders);\n foreach ($module_folders as $module_folder) {\n if (file_exists($module_folder)) {\n require($module_folder);\n $file_name = basename($module_folder, '.class.php');\n $this->register_module($file_name);\n }\n }\n do_action('clientele_modules_loaded');\n }", "private function loadSeedersAndCall(): void\n {\n $shipFiles = $this->getSeedersFromShip();\n $containersFiles = $this->getSeedersFromContainers();\n\n $files = array_merge($shipFiles, $containersFiles);\n\n foreach ($files as $file){\n $this->call($file);\n }\n }", "protected function setUp()\n {\n $_SERVER['argv'] = self::$argvOriginal;\n @unlink(self::$configFile);\n }", "function drush_lightcron_run_cron_hooks() {\n $modules = lightcron_parse_arguments(func_get_args(), FALSE);\n foreach ($modules as $module) {\n if (module_exists($module)) {\n $callback = $module . '_cron';\n if (function_exists($callback)) {\n $callback();\n drush_log(dt('!module (!date): cron hook executed.', array('!module' => $module, '!date' => date('Y-m-d H:i:s O'))), 'ok');\n }\n else {\n drush_log(dt('!module does not have a cron hook.', array('!module' => $module)), 'error');\n }\n }\n else {\n drush_log(dt('!module does not exist i.e. not installed and enabled.', array('!module' => $module)), 'error');\n }\n }\n}", "protected function prepareConfig($allModuleInfo){\n $this->checkMiscParameters($this->config);\n $this->getPaths($this->config->urlengine, $this->pseudoScriptName, $this->isCli);\n $this->modulesInfos = $this->_loadModulesInfo($this->config, $allModuleInfo);\n $this->_loadPluginsPathList($this->config);\n $this->checkCoordPluginsPath($this->config);\n $this->runConfigCompilerPlugins($this->config, $this->modulesInfos);\n }", "private function autoload_scripts() {\n\t\t\n\t}", "public static function runAll()\n {\n static::checkSapiEnv();\n static::init();\n static::daemonize();\n static::initWorkers();\n static::installSignal();\n static::saveMasterPid();\n static::displayUI();\n static::forkWorkers();\n static::resetStd();\n static::monitorWorkers();\n }", "public function load() {\n $this->loadModules($this->dir['modules_core'], 'core');\n $this->loadModules($this->dir['modules_custom'], 'custom');\n $this->runModules();\n }", "public static function load()\n {\n $files = glob(BASEDIR . '/config/*.php');\n foreach ($files as $file){\n $key = str_replace('.php', '', basename($file));\n static::$values[$key] = include $file;\n }\n }", "public function run() {\n $this->loader->run();\n }", "public function boot()\n {\n $list = glob(__DIR__ . '/macro/**/*.php');\n if ($list !== false) {\n foreach ($list as $file) {\n require_once($file);\n }\n }\n }", "public function run()\n {\n $this->loader->run();\n }", "protected function setStartupModule() {}", "public function run()\n {\n $items = $this->app->args->getParams('wild');\n list($proj, $env) = SettingFiles::extractProjEnv($items);\n\n $key = $proj . \".\" . $env;\n if (!Check::fileExists($key)) {\n $msg = Facilitator::onNoFileFound($proj, $env);\n \n $this->app->display($msg, 0);\n return;\n }\n\n $settings = SettingFiles::getObject($key);\n $rsync = new Rsync($settings);\n\n $msg = Facilitator::rsyncBanner($proj, $env, $rsync->cmd);\n $this->app->inline($msg);\n\n if ($this->app->args->simulate) {\n $msg = 'Simulation mode' . \"\\n\";\n\n $this->app->display($msg, 0);\n return;\n }\n\n $rsync->run();\n }", "protected function Init() \n {\n // Load the APP config.php and add the defined vars\n $this->load($this->files['app']['file_path'], 'app');\n \n // Load the core.config.php and add the defined vars\n $this->load($this->files['core']['file_path'], 'core', 'config');\n \n // Load the database.config.php and add the defined vars\n $this->load($this->files['db']['file_path'], 'db', 'DB_configs');\n }", "function auto_run()\n\t{\n\t\t//-----------------------------------------\n\t\t// Load some more caches\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->init_load_cache( array( 'components', 'languages' ) );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Init the nav\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code, '(FSY23) Universal Mod Installer' );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Load the XML class\n\t\t//-----------------------------------------\n\t\t\n\t\trequire_once( KERNEL_PATH.\"class_xml.php\" );\n\t\t$this->ipsclass->xml = new class_xml();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Init the settings\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->settings_init();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Init ACP Help\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->acp_help_init();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get our installed mods\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->installed_mods_init();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Init the mod\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->mod_init();\n\t\t\n\t\t//-----------------------------------------\n\t\t// What are we doing?\n\t\t//-----------------------------------------\n\t\t\n\t\tswitch ( $this->ipsclass->input['code'] )\n\t\t{\n\t\t\tcase 'settings':\n\t\t\t\t$this->view_settings();\n\t\t\t\tbreak;\n\t\t\tcase 'view':\n\t\t\t\t$this->view_mods();\n\t\t\t\tbreak;\n\t\t\tcase 'install':\n\t\t\t\t$this->pre_install();\n\t\t\t\tbreak;\n\t\t\tcase 'work':\n\t\t\t\t$this->runme();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->view_mods();\n\t\t\t\tbreak;\n\t\t}\n\t}", "private function runConfig()\n {\n $configs = [\n [\n 'name' => 'sub_title',\n 'alias_name' => 'SubTitle',\n 'value' => 'SubTitle',\n ],\n [\n 'name' => 'title',\n 'alias_name' => 'Title',\n 'value' => 'Title',\n ],\n ];\n\n foreach ($configs as $config) {\n factory(Config::class)->create($config);\n }\n }", "public function compileConfigFiles(): void\n {\n if (null !== $this->files)\n {\n $this->msg('Files', self::MSG_HEAD);\n\n foreach ($this->files as $arrFile)\n {\n $filename = StringUtil::standardize($arrFile['name']);\n $content = $this->getFileContent($arrFile['path']);\n\n $this->msg('Compile file: ' . $arrFile['path']);\n\n // Add default import path\n $this->importPaths[] = $this->rootDir . '/' . \\dirname($arrFile['path']);\n\n // Compile content and save file\n $this->saveFile($this->compile($content)->getCss(), $filename);\n }\n }\n }", "function __auto_load($epath)\n{\n //$epath = empty($epath)?SITE_ROOT:$epath;\n $r = $epath . 'Runtime/';\n $end_fun_file = $r . '~fun.php';\n if (!is_file($end_fun_file)) {\n $data = '';\n $dir = $epath . 'Common';\n $path = read_dir($dir, true);\n $filelist = array();\n foreach ($path as $file) {\n $file = $file['full'];\n $ext = trim(substr($file, -8, 8));\n if ($ext == '.fun.php') {\n $filelist[] = $file;\n }\n }\n if ($filelist) {\n foreach ($filelist as $e)\n $data .= __parse($e);\n mkdirs_a($r);\n if (!file_put_contents($end_fun_file, '<?php ' . $data))\n exit('please check the web root path is can write!');\n }\n unset($data, $filelist);\n }\n !function_exists('require_cache') ? require_once $end_fun_file : require_cache($end_fun_file);\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 setUp()\n {\n parent::setUp();\n\n foreach (glob(__DIR__ . '/cache/*.php') as $file) {\n unlink($file);\n }\n }", "public static function run_all_initializations(): array\n {\n if (self::CONFIG_RUNTIME['enable_debug']) {\n self::register_transaction_event_handler();\n return ['register_transaction_event_handler'];\n }\n return [];\n }", "public function all( )\n\t{\n\t\t\n\t\tglobal $router;\n\t\t\n\t\t$modules = scandir( $this->module_path );\n\t\t\n\t\tforeach ( $modules as $module ) {\n\t\t\t\n\t\t\tif ( $module != '.' || $modules != '..' ) {\n\t\t\t\tif ( is_dir( $this->module_path . '/' . $module ) && file_exists( $this->module_path . '/' . $module . '/routes.php' ) ) {\n\t\t\t\t\tinclude_once $this->module_path . '/' . $module . '/routes.php';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "public function run()\n {\n if (App::environment() === 'production') {\n exit('I just stopped you getting fired. Love, Amo.');\n }\n DB::table('modules')->delete();\n\n for($i = 0; $i < 10; ++$i)\n {\n DB::table('modules')->insert([\n 'name' => 'Module' . $i,\n 'image_url' => '/img/teacher_icon.jpg',\n 'slider_url' => 'slider_url_' . $i,\n 'slider_token' => 'slider_token_' . $i,\n ]);\n }\n }", "public function run()\n {\n $users = User::get();\n\n foreach($users as $user) {\n $module_ids = array_rand(DB::table('modules')->pluck('id')->toArray());\n\n if(empty($module_ids)) {\n $module_ids = 1;\n dump($module_ids);\n }\n\n $user->modules()->syncWithoutDetaching($module_ids);\n }\n }", "private function run_collector() {\n\n\t\t\tif ( ! is_array( $this->settings['modules'] ) || empty( $this->settings['modules'] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Cherry_Toolkit module should be loaded by default.\n\t\t\tif ( ! isset( $this->settings['modules']['cherry-toolkit'] ) ) {\n\t\t\t\t$this->settings['modules']['cherry-toolkit'] = array(\n\t\t\t\t\t'autoload' => true,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tforeach ( $this->settings['modules'] as $module => $settings ) {\n\t\t\t\t$priority = $this->get_module_priority( $module );\n\t\t\t\t$path = $this->get_module_path( $module );\n\n\t\t\t\tif ( ! array_key_exists( $module, self::$all_modules ) ) {\n\t\t\t\t\tself::$all_modules[ $module ] = array(\n\t\t\t\t\t\t$priority => $path,\n\t\t\t\t\t);\n\n\t\t\t\t} else {\n\t\t\t\t\t$old_priority = array_keys( self::$all_modules[ $module ] );\n\n\t\t\t\t\tif ( ! is_array( $old_priority ) || ! isset( $old_priority[0] ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$compare = version_compare( $old_priority[0], $priority, '<' );\n\n\t\t\t\t\tif ( $compare ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tself::$all_modules[ $module ] = array(\n\t\t\t\t\t\t$priority => $path,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filter a holder for all modules.\n\t\t\t *\n\t\t\t * @since 1.1.0\n\t\t\t * @var array\n\t\t\t */\n\t\t\tself::$all_modules = apply_filters( 'cherry_core_all_modules', self::$all_modules, $this );\n\t\t}", "function configurationApply(){\n\t\t// this create a \"config/files/config-XXX.conf\" whith the maker found\n\t\t$makers = glob($_SERVER['DOCUMENT_ROOT'].'/config/makers/make-config-*.php', GLOB_BRACE);\n\t\t\n\t\t// get an unique ID for this apply action\n\t\t$actionId = uniqid();\n\n\t\t// run all makers in the directory\n\t\tforeach($makers as $maker) {\n\t\t\t$pat[0]= 'make-config-';\n\t\t\t$pat[1]= '.php';\n\t\t\t$remp[0]= '';\n\t\t\t$remp[1]= '';\n\t\t\t// get the single maker name\n\t\t\t$maker_name = basename($maker);\n\t\t\t$maker_name = str_replace($pat,$remp,$maker_name);\n\t\t\t// set the temp conf file for the maker\n\t\t\tglobal $config_done;\n\t\t\t$config_done = $_SERVER['DOCUMENT_ROOT'].'/config/files/config-'.$maker_name.'.conf';\n\t\t\tglobal $config_generated;\n\t\t\tglobal $config_user_do;\n\t\t\tglobal $config_syst;\n\t\t\t// run the maker\n\t\t\tinclude($maker);\n\t\t\t// create the config temp file\n\t\t\tif($file = @fopen($config_done, 'w')) {\n\t\t\t\tfwrite($file,$config_generated);\n\t\t\t\tfclose($file);\n\t\t\t\t// add the task to the \"podServerSystem\" queue (copy files to their system path to apply configuration)\n\t\t\t\t$this->podServerSystem->addTask($config_user_do,'cp ' . $config_done . ' ' . $config_syst,TASK_COPY_FILE_CONFIG,$actionId);\n\n\t\t\t\t/* NOTE : you can add all makers you want by adding a file \"config/makers/make-config-YOURMAKERNAME.php\" \n\t\t\t\t In your maker file, you have to correctly configure \n\t\t\t\t\t\"$config_syst\" : the conf file path in your system\n\t\t\t\t\t\"$config_user_do\" : the user that copy the configuration system file (for \"podServerSystem\" tasks queue)\n\t\t\t\t And feed correctly the configuration \n\t\t\t\t\t\"$config_generated\" : the content of the conf. file to write to the system\n\t\t\t\t This action will execute it automatically when \"apply\" action will be used\n\t\t\t\t*/\n\t\t\t}\n\t\t}\n\t\t\n\t\t// copy uploaded files items of the global configuration to their system directory\n\t\tforeach ($this->itemsConfiguration as $item){\n\t\t\tif ($item->type == 'file') {\n\t\t\t\t$file_uploads = $_SERVER['DOCUMENT_ROOT'].'/uploads/' . $item->name;\n\t\t\t\t// if the directory does not exists, create it by adding a \"mkdir\" task for the system user\n\t\t\t\tif (!file_exists($item->values)) {\n\t\t\t\t\t$this->podServerSystem->addTask($item->value,'mkdir ' . $item->values,TASK_MKDIR_AUTO);\n\t\t\t\t}\n\t\t\t\t$file_system = $item->values . $item->name;\n\t\t\t\t// adding a \"cp\" task for the system user\t\t\t\n\t\t\t\tif ($item->values != '' && file_exists($file_uploads) ) {\n\t\t\t\t\t$this->podServerSystem->addTask($item->value,'cp ' . $file_uploads . ' ' . $file_system,TASK_COPY_FILE_ITEM,$actionId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function reload_all_sync() {\n\tglobal $config;\n\n\t/* parse config.xml again */\n\t$config = parse_config(true);\n\n\t/* set up our timezone */\n\tsystem_timezone_configure();\n\n\t/* set up our hostname */\n\tsystem_hostname_configure();\n\n\t/* make hosts file */\n\tsystem_hosts_generate();\n\n\t/* generate resolv.conf */\n\tsystem_resolvconf_generate();\n\n\t/* enable routing */\n\tsystem_routing_enable();\n\n\t/* set up interfaces */\n\tinterfaces_configure();\n\n\t/* start dyndns service */\n\tservices_dyndns_configure();\n\n\t/* configure cron service */\n\tconfigure_cron();\n\n\t/* start the NTP client */\n\tsystem_ntp_configure();\n\n\t/* sync pw database */\n\tunlink_if_exists(\"/etc/spwd.db.tmp\");\n\tmwexec(\"/usr/sbin/pwd_mkdb -d /etc/ /etc/master.passwd\");\n\n\t/* restart sshd */\n\tsend_event(\"service restart sshd\");\n\n\t/* restart webConfigurator if needed */\n\tsend_event(\"service restart webgui\");\n}", "public function run()\n {\n $this->call(OptionsTableSeeder::class);\n $this->call(AdvicesTableSeeder::class);\n $modules = Module::all();\n foreach ($modules as $module) {\n $name = $module->get('name');\n $this->call('Modules\\\\' . $name . '\\\\Database\\\\Seeders\\\\' . $name . 'DatabaseSeeder');\n }\n }", "public static function loadSectionFiles() {\n\t\tforeach (scandir( dirname(__FILE__) . Route::ROUTE_SECTION_DIR) as $filename) {\n\n\t\t $path = dirname(__FILE__) . Route::ROUTE_SECTION_DIR . '/' . $filename;\n\n\t\t if (is_file($path)) {\n\t\t\t\t$path_parts = pathinfo($path);\n\t\t \t$basename = $path_parts['filename'];\n\n\t\t \tif (self::endsWith($basename, Route::ROUTE_SECTION_SUFFIX)) {\n\t\t\t require_once $path;\n\t\t\t call_user_func(array($basename , 'init'));\n\t\t \t}\n\t\t }\n\t\t}\n\t}", "public function run()\n {\n \t$user_types = ['admin','inventory','department','account','center','doctor'];\n \t$modules = ['global_settings','patient','departments','tests','signatures','center'];\n\n \t\n\t\tforeach ($modules as $mod_value) {\n\t\t\tforeach ($user_types as $user_value) {\n\t\t\t\t$all_val = 0;\n\t\t\t\tif($user_value == 'admin'){\n\t\t\t\t\t$all_val = 1;\n\t\t\t\t}\n\n\t\t\t\tDB::table('roles')->insert([\n\t\t 'role_name' => $user_value,\n\t\t 'module_name' => $mod_value,\n\t\t 'read_module' => $all_val,\n\t\t 'write_module' => $all_val,\n\t\t 'modify_module' => $all_val,\n\t\t 'delete_module' => $all_val,\n\t\t 'view_module' => $all_val\t\t \n\t\t ]);\n\t\t\t}\n\t\t} \n }", "public function run()\n {\n $this->call(SocialIcons::class);\n $this->call(BackgroundImages::class);\n $this->call(UserAdminAcount::class);\n }", "public function import_configuration()\n\t{\n\t\t$this->logLine('Starting configuration import');\n\n\t\t// PRE-CONFIG start - create and register blank config instances - do not load!\n\t\t$config_aliases = array(\n\t\t\t'core',\n\t\t\t'core_backup',\n\t\t\t'emote', \n\t\t\t'menu',\n\t\t\t'search',\n\t\t\t'notify',\n\t\t);\n\t\tforeach ($config_aliases as $alias) \n\t\t{\n\t\t\te107::getConfig($alias, false)->clearPrefCache();\n\t\t}\n\t\t// PRE-CONFIG end\t\t\n\n\t\t// Basic stuff to get the handlers/classes to work.\n\n\n\t\t// $udirs = \"admin/|plugins/|temp\";\n\t\t// $e_SELF = $_SERVER['PHP_SELF'];\n\t\t// $e_HTTP = preg_replace(\"#\".$udirs.\"#i\", \"\", substr($e_SELF, 0, strrpos($e_SELF, \"/\")).\"/\");\n\n\t\t// define(\"MAGIC_QUOTES_GPC\", (ini_get('magic_quotes_gpc') ? true : false));\n\t\t// define('CHARSET', 'utf-8');\n\t\t// define(\"e_LANGUAGE\", $this->previous_steps['language']);\n\t\t// define('e_SELF', 'http://'.$_SERVER['HTTP_HOST']) . ($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_FILENAME']);\n\n\t\t$themeImportFile = array();\n\t\t$themeImportFile[0] = $this->e107->e107_dirs['THEMES_DIRECTORY'].$this->previous_steps['prefs']['sitetheme'].\"/install.xml\";\n\t\t$themeImportFile[1] = $this->e107->e107_dirs['THEMES_DIRECTORY'].$this->previous_steps['prefs']['sitetheme'].\"/install/install.xml\";\n\t\t// $themeImportFile[3] = $this->e107->e107_dirs['CORE_DIRECTORY']. \"xml/default_install.xml\";\n\n\t\t$XMLImportfile = false;\n\n\t\tif(vartrue($this->previous_steps['generate_content']))\n\t\t{\n\t\t\tforeach($themeImportFile as $file)\n\t\t\t{\n\t\t\t\tif(is_readable($file))\n\t\t\t\t{\n\t\t\t\t\t$XMLImportfile = $file;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$tp = e107::getParser();\n\n\t\tdefine('PREVIEWTHEMENAME',\"\"); // Notice Removal.\n\n//\t\tinclude_lan($this->e107->e107_dirs['LANGUAGES_DIRECTORY'].$this->previous_steps['language'].\"/lan_prefs.php\");\n\t\tinclude_lan($this->e107->e107_dirs['LANGUAGES_DIRECTORY'].$this->previous_steps['language'].\"/admin/lan_theme.php\");\n\n\t\t// [SecretR] should work now - fixed log errors (argument noLogs = true) change to false to enable log\n\t\t\n\t\t$coreConfig = $this->e107->e107_dirs['CORE_DIRECTORY']. \"xml/default_install.xml\";\t\t\n\t\t$ret = e107::getXml()->e107Import($coreConfig, 'replace', true, false); // Add core pref values\n\t\t$this->logLine('Attempting to Write Core Prefs.');\n\t\t$this->logLine(print_r($ret, true));\n\t\t/*\n\t\tif($XMLImportfile) // We cannot rely on themes to include all prefs..so use 'replace'. \n\t\t{\n\t\t\t$ret2 = e107::getXml()->e107Import($XMLImportfile, 'replace', true, false); // Overwrite specific core pref and tables entries. \n\t\t\t$this->logLine('Attempting to write Theme Prefs/Tables (install.xml)');\n\t\t\t$this->logLine(print_r($ret2, true));\n\t\t}\n\t\t\n\t*/\t//Create default plugin-table entries.\n\t\t// e107::getConfig('core')->clearPrefCache();\n\t\te107::getPlugin()->update_plugins_table('update');\n\t\t$this->logLine('Plugins table updated');\n\n\t\t// Install Theme-required plugins\n\t\tif(vartrue($this->previous_steps['install_plugins']))\n\t\t{\n\t\t\tif($themeInfo = $this->get_theme_xml($this->previous_steps['prefs']['sitetheme']))\n\t\t\t{\n\t\t\t\tif(isset($themeInfo['plugins']['plugin']))\n\t\t\t\t{\n\t\t\t\t\tforeach($themeInfo['plugins']['plugin'] as $k=>$plug)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->install_plugin($plug['@attributes']['name']);\n\t\t\t\t\t\t$this->logLine('Theme-related plugin installed: '.$plug['@attributes']['name']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\n\t\te107::getSingleton('e107plugin')->save_addon_prefs('update'); // save plugin addon pref-lists. eg. e_latest_list.\n\t\t$this->logLine('Addon prefs saved');\n\n\t\t// do this AFTER any required plugins are installated. \n\t\tif($XMLImportfile) // We cannot rely on themes to include all prefs..so use 'replace'.\n\t\t{\n\t\t\t$ret2 = e107::getXml()->e107Import($XMLImportfile, 'replace', true, false); // Overwrite specific core pref and tables entries.\n\t\t\t$this->logLine('Attempting to write Theme Prefs/Tables (install.xml)');\n\t\t\t$this->logLine(print_r($ret2, true));\n\t\t}\n\n\n\t\t$tm = e107::getSingleton('themeHandler');\n\t\t$tm->noLog = true; // false to enable log\n\t\t$tm->setTheme($this->previous_steps['prefs']['sitetheme'], false);\n\n\t\t// Admin log fix - don't allow logs to be called inside pref handler\n\t\t// FIX\n\t\te107::getConfig('core')->setParam('nologs', true); // change to false to enable log\n\t\t$pref = e107::getConfig('core')->getPref();\n\n\t\t// Set Preferences defined during install - overwriting those that may exist in the XML.\n\n\t\t$this->previous_steps['prefs']['sitelanguage'] \t\t= $this->previous_steps['language'];\n\t\t$this->previous_steps['prefs']['sitelang_init']\t\t= $this->previous_steps['language'];\n\n\t\t$this->previous_steps['prefs']['siteadmin'] \t\t= $this->previous_steps['admin']['display'];\n\t\t$this->previous_steps['prefs']['siteadminemail'] \t= $this->previous_steps['admin']['email'];\n\t\t$this->previous_steps['prefs']['install_date'] \t= time();\n\t\t$this->previous_steps['prefs']['siteurl']\t\t\t= e_HTTP;\n\n\t\t$this->previous_steps['prefs']['sitetag']\t\t\t= \"e107 Website System\";\n\t\t$this->previous_steps['prefs']['sitedisclaimer']\t= '';\n\n\t\t$this->previous_steps['prefs']['replyto_name']\t\t= $this->previous_steps['admin']['display'];\n\t\t$this->previous_steps['prefs']['replyto_email']\t\t= $this->previous_steps['admin']['email'];\n\n\t\t// Cookie name fix, ended up with 406 error when non-latin words used\n\t\t$cookiename \t\t\t\t\t\t\t\t\t\t= preg_replace('/[^a-z0-9]/i', '', trim($this->previous_steps['prefs']['sitename']));\n\t\t$this->previous_steps['prefs']['cookie_name']\t\t= ($cookiename ? substr($cookiename, 0, 4).'_' : 'e_').'cookie';\n\t\t\n\t\t### URL related prefs\n\t\t// set all prefs so that they are available, required for adminReadModules() - it checks which plugins are installed\n\t\te107::getConfig('core')->setPref($this->previous_steps['prefs']); \n\t\t\n\t\t$url_modules = eRouter::adminReadModules();\n\t\t$url_locations = eRouter::adminBuildLocations($url_modules);\n\t\t$url_config = eRouter::adminBuildConfig(array(), $url_modules);\n\t\t\n\t\t$this->previous_steps['prefs']['url_aliases']\t\t= array();\n\t\t$this->previous_steps['prefs']['url_config']\t\t= $url_config;\n\t\t$this->previous_steps['prefs']['url_modules']\t\t= $url_modules;\n\t\t$this->previous_steps['prefs']['url_locations']\t\t= $url_locations;\n\t\teRouter::clearCache();\n\t\t$this->logLine('Core URL config set to default state');\n\n\t\t$us = e107::getUserSession();\n\n\t\tif($us->passwordAPIExists() === true)\n\t\t{\n\t\t\t$this->previous_steps['prefs']['passwordEncoding'] = PASSWORD_E107_PHP;\n\t\t\t$pwdEncoding = PASSWORD_E107_PHP;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$pwdEncoding = PASSWORD_E107_MD5; // default already in default_install.xml\n\t\t}\n\n\t\t// Set prefs, save\n\t\te107::getConfig('core')->setPref($this->previous_steps['prefs']);\n\t\te107::getConfig('core')->save(FALSE,TRUE, FALSE); // save preferences made during install.\n\t\t$this->logLine('Core prefs set to install choices');\n\n\t\t// Create the admin user - replacing any that may be been included in the XML.\n\n\t\t$hash = $us->HashPassword($this->previous_steps['admin']['password'],$this->previous_steps['admin']['user'], $pwdEncoding);\n\n\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\t$userp = \"1, '{$this->previous_steps['admin']['display']}', '{$this->previous_steps['admin']['user']}', '', '\".$hash.\"', '', '{$this->previous_steps['admin']['email']}', '', '', 0, \".time().\", 0, 0, 0, 0, 0, '{$ip}', 0, '', 0, 1, '', '', '0', '', \".time().\", ''\";\n\t\t$qry = \"REPLACE INTO {$this->previous_steps['mysql']['prefix']}user VALUES ({$userp})\";\n\t\t$this->dbqry(\"REPLACE INTO {$this->previous_steps['mysql']['prefix']}user VALUES ({$userp})\" );\n\t\t$this->logLine('Admin user created');\n\n\t\t// Add Default user-extended values;\n\t\t$extendedQuery = \"REPLACE INTO `{$this->previous_steps['mysql']['prefix']}user_extended` (`user_extended_id` ,\t`user_hidden_fields`) VALUES ('1', NULL \t);\";\n\t\t$this->dbqry($extendedQuery);\n\n\t\te107::getDb()->close();\n\t//\tmysql_close($this->dbLink);\n\t\t\n\t\te107::getMessage()->reset(false, false, true);\n\t\t\n\t\treturn false;\n\t}", "protected function _addons()\n\t{\n\t\t$addons_files = array_merge(\n\t\t\tglob(APPPATH.'addons/menu', GLOB_ONLYDIR),\n\t\t\tglob(MODPATH.'*/addons/menu', GLOB_ONLYDIR)\n\t\t);\n\n\t\tforeach ($addons_files as $file) {\n\t\t\t$addons = glob($file.'/*.php');\n\t\t\tforeach ($addons as $addon) {\n\t\t\t\tinclude_once($addon);\n\t\t\t}\n\t\t}\n\n\t}", "public function run()\r\n\t{\r\n\t\t$this->loadModule();\r\n\t\r\n\t\t$this->loadController();\r\n\t\r\n\t\t// this can be overwritten by user in controller\r\n\t\t$this->loadDefaultView();\r\n\t}", "public function run()\n {\n $this->logRun();\n if (in_array('+', $this->config['mysqlbase'])) {\n $this->config['mysqlbase'] = $this->mysqlAllBases($this->mysql['host'], $this->mysql['user'], $this->mysql['pass']);\n }\n $this->mysqlDump($this->mysql['host'], $this->mysql['user'], $this->mysql['pass'], $this->config['filename'], $this->config['local'], $this->config['mysqlbase']);\n $this->deleteOld($this->config['true_filename'], $this->config['local'], $this->config['days']);\n $this->rsync($this->config['local'], $this->config['dstfolder']);\n $this->logEnd();\n }", "private static function proccess()\n {\n $files = ['Process', 'Command', 'Translator', 'Migrations', 'Links', 'Tag', 'Model', 'View', 'Controller', 'Seeds', 'Router', 'Exception', 'Events', 'Alias', 'Middleware', 'Helper', 'Tests', 'Mail', 'Query'];\n $folder = static::$root.'Processes'.'/';\n\n self::call($files, $folder);\n\n $files = ['TranslatorFolderNeededException', 'TranslatorManyFolderException'];\n $folder = static::$root.'Processes/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "function setup() {\n parent::setUp();\n\n $this->setUpPaths();\n $this->setUpDrupal($this->env, FALSE);\n $root = $this->sites[$this->env]['root'];\n $site = \"$root/sites/$this->env\";\n\n foreach ($this->paths as $key => $path) {\n // Only declare harmless options as these files hang around until shutdown.\n $contents = <<<EOD\n<?php\n// Written by Drush's contextCase::setup(). This file is safe to delete.\n\n\\$options['contextConfig'] = '$key';\n\\$command_specific['unit-eval']['contextConfig'] = '$key-specific';\n\nEOD;\n $path .= $key == 'user' ? '/.drushrc.php' : '/drushrc.php';\n if (file_exists($path)) {\n $this->exists[$key] = $path;\n if ($this->should_delete($path, $contents, $key)) {\n register_shutdown_function('unlink', $path);\n }\n }\n elseif (is_writable(dirname($path))) {\n if (file_put_contents($path, $contents)) {\n $this->exists[$key] = $path;\n if ($this->should_delete($path, $contents, $key)) {\n register_shutdown_function('unlink', $path);\n }\n }\n }\n else {\n // @todo Unwritable. Warn that some locations are not getting tested.\n }\n }\n\n // Also write a site alias so we can test its supremacy in context hierarchy.\n $path = $this->site . '/aliases.drushrc.php';\n $aliases['contextAlias'] = array(\n 'contextConfig' => 'alias1',\n 'command-specific' => array (\n 'unit-eval' => array (\n 'contextConfig' => 'alias-specific',\n ),\n ),\n );\n $contents = $this->file_aliases($aliases);\n // This file is in the sandbox so gets deleted at end/start of a test run.\n $return = file_put_contents($path, $contents);\n }", "function startscripts($path){\n\t\t global $run_updateScripts;\n\t\t $list = getManifest($path);\n\t\tif(!empty($list)){\n\t\t\t $commands = gencommands($path, $list);\n\t\t\t $error_commands = array();\n\t\t\t foreach($commands as $command){\n\t\t\t\t $output = array();\n\t\t\t\t exec($command, $output, $result);\n\t\t\t\t if($result > 0){\n\t\t\t\t\t $error_commands[] = $command; \n\t\t\t\t\t debug(\"Failed to execute [$command]\");\n\t\t\t\t\t debug(\"Error Message :-\");\n\t\t\t\t\t foreach($output as $message){\n\t\t\t\t\t\t debug(\"$message\");\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t else{\n\t\t\t\t\t debug(\"Successfuly executed [$command]\");\n\t\t\t\t }\n\t\t\t\t\t \n\t\t\t}\n\t\t\t$fh = fopen($path.\"/.processed\",\"w\");\n\t\t\tforeach($error_commands as $command){\n\t\t\t\tfputs($fh,$command.\"\\n\");\n\t\t\t}\n\t\t\tfclose($fh);\n\t\t\t$run_updateScripts = 1;\n\t\t}\n\t}", "protected static function addModuleConfigurationsToDb()\n {\n static::_addMainConfigurationEntries();\n static::_addCredentialsConfigurationEntries();\n static::_addTransactionsConfigurationEntries();\n static::_addWpfConfigurationEntries();\n static::_addOrderConfigurationEntries();\n static::_addThreedsOptions();\n static::_addScaExemptionOptions();\n }", "static function autoload()\r\n\t{\r\n\t\t\r\n\t}", "public function run()\n {\n $this->call(CountriesSeed::class);\n $this->call(ReplayMapsSeeding::class);\n $this->call(ReplayTypesSeeding::class);\n $this->call(ForumSectionSeeding::class);\n $this->call(UserRoleSeeding::class);\n $this->call(GameVersionSeeding::class);\n }", "private function setUpConfig() {\n\n //Get the file where the configs are and process the arrays\n require($this->_data['pathtodata']);\n\n $this->_data = array_merge($this->_data,$acs_confdata);\n\n if (empty($this->_data['indexfile']))\n $this->_data['indexfile'] = 'index';\n\n if (empty($this->_data['common_extension']))\n $this->_data['common_extension'] = COMMON_EXTENSION;\n \n $this->setUriData($this->_data); \n \n //Create the cache file of the config\n if (isset($this->_data['cache_config']) && $this->_data['cache_config'])\n $this->saveConfig();\n else\n if (file_exists($this->_data['cache_config_file']))\n unlink($this->_data['cache_config_file']); \n }", "public static function initModuleLoading(){\n\n\t}", "public function setUp()\n {\n $this->fs = new Filesystem();\n $this->cacheDir = __DIR__ . '/cache';\n if ($this->fs->exists($this->cacheDir)) {\n $this->fs->remove($this->cacheDir);\n }\n\n $this->cache = new ConfigFileScriptCache($this->cacheDir, true);\n }", "protected function loadConfigsForRegister(): void\n {\n $shipConfigs = $this->getConfigsFromShip();\n $containersConfigs = $this->getConfigsFromContainers();\n\n $configs = array_merge($shipConfigs, $containersConfigs);\n\n foreach ($configs as $file){\n $filename = pathinfo($file, PATHINFO_FILENAME);\n $this->mergeConfigFrom($file, $filename);\n }\n }", "public function start()\n\t{\n\t\t$this->define_home_dir_constant();\n\t\t$this->register_root_namespace();\n\t\tspl_autoload_register(array($this, 'autoload'));\n\t}", "static private function loadPlugins() {\n\n $config = Application::getConfig();\n\n if ($handle = opendir($config[\"system\"][\"plugin-folder\"])) {\n\n /* Das ist der korrekte Weg, ein Verzeichnis zu durchlaufen. */\n while (false !== ($entry = readdir($handle))) {\n if($entry != \".\" && $entry != \"..\") {\n require $config[\"system\"][\"plugin-folder\"] . \"/\" .$entry;\n }\n }\n closedir($handle);\n }\n }", "public static function init(): void\n {\n $dotenvDest = ROOT_DIRECTORY . self::DEST_APP_ETC_DOTENV_FILE;\n if (is_file($dotenvDest)) {\n require_once $dotenvDest;\n return;\n } else {\n $dotenvSrc = ROOT_DIRECTORY . self::SRC_APP_ETC_DOTENV_FILE;\n copy($dotenvSrc, $dotenvDest);\n }\n\n $magentoBootstrapFile = ROOT_DIRECTORY . self::MAGENTO_BOOTSTRAP_FILE;\n if (!is_file($magentoBootstrapFile)) {\n return;\n }\n\n require_once $dotenvDest;\n }", "public static function bootstrap () {\n\t\t$files = glob(TH_ROOT.TH_PLUGINS.'*/plugin.php');\n\t\tforeach($files as $file) {\n\t\t\trequire_once $file;\n\t\t\t// $plugin is a full path, we don't want that.\n\t\t\t$plugin = explode(TH_ROOT.TH_PLUGINS, $file, 2);\n\t\t\t$plugin = explode('/plugin.php', $plugin[1]);\n\t\t\t$possiblePlugins[] = $plugin[0];\n\t\t}\n\n\t\t$db = DB::select('plugins', '*', array('active = ?', 1));\n\t\t$activePlugins = $db->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tforeach($activePlugins as $row) {\n\t\t\tif(array_search($row['name'], $possiblePlugins) !== false) {\n\t\t\t\tself::$active[$row['name']]->bootstrap();\n\t\t\t}\n\t\t}\n\n\t\tself::runAll();\n\t}", "public function load_modules() {\n\t\tforeach ( $this->modules as $module_name ) {\n\t\t\t$module = $this->build( $module_name );\n\t\t\tif ( $module !== null ) {\n\t\t\t\t$module->init();\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.6575087", "0.62000906", "0.6194606", "0.61612505", "0.60497", "0.59930634", "0.5966905", "0.5893327", "0.5873614", "0.581501", "0.5800831", "0.57808274", "0.5764223", "0.5734841", "0.56934994", "0.5679971", "0.5662041", "0.5630095", "0.5623525", "0.5583241", "0.5555752", "0.55523914", "0.5546188", "0.5544473", "0.5543198", "0.5509829", "0.5464512", "0.5456382", "0.5427839", "0.5401272", "0.53885424", "0.53857297", "0.5364819", "0.5341829", "0.53231895", "0.5322213", "0.53116083", "0.5310102", "0.5310102", "0.5310102", "0.5310102", "0.5310102", "0.5310102", "0.5310102", "0.5310102", "0.5310102", "0.5302408", "0.52940387", "0.5291986", "0.5284608", "0.52794755", "0.52777934", "0.52742", "0.52729565", "0.5272791", "0.5269517", "0.5250268", "0.5248662", "0.5240932", "0.52366835", "0.5235511", "0.52349085", "0.52234966", "0.51942664", "0.5193261", "0.5192047", "0.5187179", "0.51849556", "0.5179116", "0.51748526", "0.51720357", "0.51700073", "0.5152836", "0.51395655", "0.5139", "0.5136465", "0.51353455", "0.5124677", "0.51028407", "0.5091782", "0.5091115", "0.5090945", "0.5087726", "0.5087388", "0.50827855", "0.5080905", "0.5077827", "0.5072509", "0.50646704", "0.50642496", "0.50583655", "0.50565124", "0.5054523", "0.50500417", "0.50418675", "0.5041455", "0.5041423", "0.50376797", "0.50302404", "0.50295395", "0.50264126" ]
0.0
-1
Carga los campos desde db
public function load($id){ $req=$this->db()->query("SELECT * FROM idea JOIN categorias on (idea.id_categoria=categorias.id_categoria) JOIN usuario on (usuario.id_correo = idea.id_correo) WHERE idea.id_idea = ".$id." GROUP BY idea.id_idea"); if($req==false) throw new Exception('MySQL: Error al cargar la idea'); $filas = $this->showData($req); $this->setId_idea($filas[0]['id_idea']); $this->setNombre_Idea($filas[0]['nombre_idea']); $this->setId_categoria($filas[0]['id_categoria']); $this->setFecha_limite($filas[0]['fecha_limite']); $this->setDesc_idea($filas[0]['desc_idea']); $this->setEnVenta($filas[0]['enVenta']); $this->setId_correo($filas[0]['id_correo']); $this->setImporte_venta($filas[0]['importe_venta']); $this->setCv_equipo($filas[0]['cv_equipo']); $this->setImporte_Solicitado($filas[0]['importe_solicitado']); $this->setImagen($filas[0]['imagen']); $this->setCategoria($filas[0]['valor']); $this->setNombreUsu($filas[0]['nombre']); $this->setDiasFin($this->diffFechas($this->getFecha_Limite())); $this->loadRecaudado(); $this->loadPopularidad(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function camposBD(){\n//\t\tSELECT idFactura, nombreTienda AS tienda, fecha, numfactura AS Factura FROM tblfacturas \n//\t\tINNER JOIN tbltiendas ON tbltiendas.idtblTienda = tblfacturas.idtblTienda\n\t\t$fields = array();\n\t\t$fields[] = 'idFactura';\t\n\t\t$fields[] = 'fecha';\t\n\t\t$fields[] = 'tienda';\t\n\t\t$fields[] = 'numFactura';\t\n\t\t/*$fields[] = 'opcion';\t*/\n\t\t/*$fields[] = 'comentario';*/\t\n\t\treturn $fields;\n\t}", "protected function fetch_fields()\n {\n if(empty($this->table_fields))\n {\n $fields = $this->_database->list_fields($this->table);\n foreach ($fields as $field) {\n $this->table_fields[] = $field;\n }\n }\n }", "private function getCampos()\n {\n \t$fields \t= [];\n \tif ( !empty( $this->parametros['campos'] ) )\n \t{\n if ( is_string($this->parametros['campos']) )\n {\n $fields = explode(',', $this->parametros['campos'] );\n }\n \t} else\n \t{\n \t\t$tabela = $this->parametros['tabela'];\n \t\t$fields = [$this->Controller->$tabela->primaryKey(), $this->Controller->$tabela->displayField() ];\n \t}\n\n \treturn $fields;\n }", "protected function asignarCamposRelacionales() {\n foreach($this->campos as $nombre=>$campo) {\n if($campo->tipo!='relacional'||($campo->relacion!='1:1'&&$campo->relacion!='1:0')) continue;\n $columna=$campo->columna;\n if(is_object($this->consultaValores->$nombre)) {\n //Asignado como entidad u objeto anónimo\n $this->consultaValores->$columna=$this->consultaValores->$nombre->id;\n } elseif(is_array($this->consultaValores->$nombre)) {\n //Asignado como array\n $this->consultaValores->$columna=$this->consultaValores->$nombre['id'];\n }\n }\n }", "private function load_columns_information() {\n $query = \"SELECT ordinal_position,\n column_name,\n data_type,\n is_nullable::boolean::integer\n FROM information_schema.columns\n WHERE table_schema = 'public'\n AND table_name = '{$this->get_table_name()}';\";\n $this->columns_information = DB::fetch_all($query);\n\n // Cria os campos da tabela no objeto corrente\n foreach($this->columns_information as $column) {\n $this->$column['column_name'] = null;\n $this->{'_' . $column['column_name']} = null;\n }\n }", "protected function _initAllFIeld() \n\t{\n\t\t$sql = 'select COLUMN_NAME from information_schema.COLUMNS where table_name = \"' . $this->table.'\"\n\t\t\t\tAND `TABLE_SCHEMA`=\"'. $this->db .'\";';\n\n\t\t$this->_fields = array_column($this->_getSelectResult($sql), 'COLUMN_NAME');\n\t}", "private function fillInfo()\n\t{\n\t\t$database = new db_Database();\n\n\t\t$database->query(\"select * from users where id=:id\");\n\t\t$database->bind(\":id\",$this->id);\n\t\t$set=$database->resultset();\n\t\t\n\t\t$this->password=$set[0]['pass'];\n\t\t$this->userName=$set[0]['userName'];\t\t\n\t\t$this->email=$set[0]['email'];\t\t\n\t\t$this->session=$set[0]['session'];\n\t\t$this->avatar=$set[0]['avatar'];\n\t\t\n\t}", "function asignar_valores(){\n\t\t$this->tabla=$_POST['tabla'];\n\t\t$this->pertenece=$_POST['pertenece'];\n\t\t$this->asunto=$_POST['asunto'];\n\t\t$this->descripcion=$_POST['contenido'];\n\t\t$this->fecha=$_POST['fecha'];\n\t\t$this->hora=$_POST['hora'];\n\t\t$this->fechamod=$_POST['fechamod'];\n\t}", "public function fetch_fields() {}", "function _init_fields()\n\t{\n\t\tif($this->table_name)\n\t\t{\n\t\t\t$this->db_fields = $this->db->list_fields($this->table_name);\n\t\t\t\n\t\t\tforeach($this->db_fields as $field)\n\t\t\t{\n\t\t\t\t$this->{$field} = NULL;\n\t\t\t}\n\t\t}\n\t}", "function dbSetVars() {\n\n foreach ($this->fields() as $f) {\n if ($this->$f === false) continue;\n $this->db->set($f,$this->$f);\n }\n\n }", "function SeteoCampos(){\n\t\t// Campos que van en en detalle, deben empezar su nombre con 'C'\n\t\t$this->addField('C1', 99999,\t0, 15);\n $this->addField('C2', 99999,\t0, 15);\n $this->addField('C3', 99999,\t0, 40);\t\t\n $this->addField('C4', 99999,\t0, 65);\t\t\n $this->addField('C5', 99999,\t0, 40);\n $this->addField('C6', 99999,\t0, 25);\t\t\n $this->addField('C7', 99999,\t0, 65);\t\t\n\t\t\n\t\t$this->addField('HG1', 0,\t0,\t160);\n\t\t\t\t\n\t}", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF)\n\t\t\treturn;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->id->DbValue = $row['id'];\n\t\t$this->nombre_contacto->DbValue = $row['nombre_contacto'];\n\t\t$this->name->DbValue = $row['name'];\n\t\t$this->lastname->DbValue = $row['lastname'];\n\t\t$this->_email->DbValue = $row['email'];\n\t\t$this->address->DbValue = $row['address'];\n\t\t$this->phone->DbValue = $row['phone'];\n\t\t$this->cell->DbValue = $row['cell'];\n\t\t$this->is_active->DbValue = $row['is_active'];\n\t\t$this->created_at->DbValue = $row['created_at'];\n\t\t$this->id_sucursal->DbValue = $row['id_sucursal'];\n\t\t$this->documentos->DbValue = $row['documentos'];\n\t\t$this->DateModified->DbValue = $row['DateModified'];\n\t\t$this->DateDeleted->DbValue = $row['DateDeleted'];\n\t\t$this->CreatedBy->DbValue = $row['CreatedBy'];\n\t\t$this->ModifiedBy->DbValue = $row['ModifiedBy'];\n\t\t$this->DeletedBy->DbValue = $row['DeletedBy'];\n\t\t$this->latitud->DbValue = $row['latitud'];\n\t\t$this->longitud->DbValue = $row['longitud'];\n\t\t$this->tipoinmueble->DbValue = $row['tipoinmueble'];\n\t\t$this->id_ciudad_inmueble->DbValue = $row['id_ciudad_inmueble'];\n\t\t$this->id_provincia_inmueble->DbValue = $row['id_provincia_inmueble'];\n\t\t$this->imagen_inmueble01->Upload->DbValue = $row['imagen_inmueble01'];\n\t\t$this->imagen_inmueble02->Upload->DbValue = $row['imagen_inmueble02'];\n\t\t$this->imagen_inmueble03->Upload->DbValue = $row['imagen_inmueble03'];\n\t\t$this->imagen_inmueble04->Upload->DbValue = $row['imagen_inmueble04'];\n\t\t$this->imagen_inmueble05->Upload->DbValue = $row['imagen_inmueble05'];\n\t\t$this->imagen_inmueble06->Upload->DbValue = $row['imagen_inmueble06'];\n\t\t$this->imagen_inmueble07->Upload->DbValue = $row['imagen_inmueble07'];\n\t\t$this->imagen_inmueble08->Upload->DbValue = $row['imagen_inmueble08'];\n\t\t$this->tipovehiculo->DbValue = $row['tipovehiculo'];\n\t\t$this->id_ciudad_vehiculo->DbValue = $row['id_ciudad_vehiculo'];\n\t\t$this->id_provincia_vehiculo->DbValue = $row['id_provincia_vehiculo'];\n\t\t$this->imagen_vehiculo01->Upload->DbValue = $row['imagen_vehiculo01'];\n\t\t$this->imagen_vehiculo02->Upload->DbValue = $row['imagen_vehiculo02'];\n\t\t$this->imagen_vehiculo03->Upload->DbValue = $row['imagen_vehiculo03'];\n\t\t$this->imagen_vehiculo04->Upload->DbValue = $row['imagen_vehiculo04'];\n\t\t$this->imagen_vehiculo05->Upload->DbValue = $row['imagen_vehiculo05'];\n\t\t$this->imagen_vehiculo06->Upload->DbValue = $row['imagen_vehiculo06'];\n\t\t$this->imagen_vehiculo07->Upload->DbValue = $row['imagen_vehiculo07'];\n\t\t$this->imagen_vehiculo08->Upload->DbValue = $row['imagen_vehiculo08'];\n\t\t$this->tipomaquinaria->DbValue = $row['tipomaquinaria'];\n\t\t$this->id_ciudad_maquinaria->DbValue = $row['id_ciudad_maquinaria'];\n\t\t$this->id_provincia_maquinaria->DbValue = $row['id_provincia_maquinaria'];\n\t\t$this->imagen_maquinaria01->Upload->DbValue = $row['imagen_maquinaria01'];\n\t\t$this->imagen_maquinaria02->Upload->DbValue = $row['imagen_maquinaria02'];\n\t\t$this->imagen_maquinaria03->Upload->DbValue = $row['imagen_maquinaria03'];\n\t\t$this->imagen_maquinaria04->Upload->DbValue = $row['imagen_maquinaria04'];\n\t\t$this->imagen_maquinaria05->Upload->DbValue = $row['imagen_maquinaria05'];\n\t\t$this->imagen_maquinaria06->Upload->DbValue = $row['imagen_maquinaria06'];\n\t\t$this->imagen_maquinaria07->Upload->DbValue = $row['imagen_maquinaria07'];\n\t\t$this->imagen_maquinaria08->Upload->DbValue = $row['imagen_maquinaria08'];\n\t\t$this->tipomercaderia->DbValue = $row['tipomercaderia'];\n\t\t$this->imagen_mercaderia01->Upload->DbValue = $row['imagen_mercaderia01'];\n\t\t$this->documento_mercaderia->DbValue = $row['documento_mercaderia'];\n\t\t$this->tipoespecial->DbValue = $row['tipoespecial'];\n\t\t$this->imagen_tipoespecial01->Upload->DbValue = $row['imagen_tipoespecial01'];\n\t\t$this->email_contacto->DbValue = $row['email_contacto'];\n\t}", "function ReInitTableColumns()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::ReInitTableColumns();\" . \"<HR>\";\n foreach ($this->form_fields as $prefix => $form) {\n foreach ($form as $i => $field) {\n foreach ($field as $param => $value) {\n //if found database parameters\n if (strpos($param, \"dbfield_\") !== false) {\n $columnparam = substr($param, strlen(\"dbfield_\"), strlen($param));\n $this->Storage->setColumnParameter($field[\"field_name\"], trim($columnparam), $value);\n }\n }\n }\n }\n }", "function getCampos($tabla){\r\n\t\t//DB_DataObject::debugLevel(5);\r\n\t\t//Crea una nueva instancia de $tabla a partir de DataObject\r\n\t\t$objDBO = DB_DataObject::Factory($tabla);\r\n\t\t\r\n\t\t$campos = $objDBO->table();\r\n\t\t\r\n\t\tunset($campos[\"id\"]);\r\n\t\tunset($campos[\"fecha\"]);\r\n\t\t\r\n\t\t//Libera el objeto DBO\r\n\t\t$objDBO->free();\r\n\t\t\r\n\t\treturn ($campos);\r\n\t}", "function getCampos(){\n\t\t$this->con->executa( \"select id, campo from workflow_campos\");\n\t\t\t//$this->con->navega();\n\n\t\t\t$i=0;\n\t\t\twhile ($this->con->navega(0)){\n\t\t\t\t$campos[ strtolower(trim($this->con->dados[\"id\"])) ] = strtolower(trim($this->con->dados[\"campo\"]));\n\n\t\t\t\t$i++;\n\t\t\t}\n $campos = $this->globais->ArrayMergeKeepKeys( $this->globais->SYS_ADD_CAMPOS, $campos);\n //$campos[ \"entradanoposto\" ] = \"entradanoposto\";\n //$array[\"FETCH\"] [$this->con->dados[\"idprocesso\"]][\"entradanoposto\" ] = $this->con->dados[\"wt_inicio\"] ;\n\n\t\treturn $campos;\n\n\t}", "protected function Campos()\n {\n $select = [\n ['value' => 'id1', 'text' => 'texto1'],\n ['value' => 'id2', 'text' => 'texto2']\n ];\n $this->text('unInput')->Validator(\"required|maxlength:20\");\n $this->text('unSelect')->Validator(\"required\")->type('select')->in_options($select);\n $this->date('unDate')->Validator(\"required\");\n }", "protected function prepare_fields()\n {\n }", "public function fetchFields();", "private function setFields()\n\t{\t\n\t\t$sql = '';\n\t\t\n\t\tforeach (array_keys($this->data) as $key)\n\t\t{\n\t\t\t$sql .= '`' . $key . '` = ? , ';\n\t\t}\n\t\t\n\t\t$sql = rtrim($sql, ', ');\n\t\t\n\t\treturn $sql;\n\t}", "function LoadDbValues(&$rs) {\r\n\t\tif (!$rs || !is_array($rs) && $rs->EOF) return;\r\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\r\n\t\t$this->Id_Pase->DbValue = $row['Id_Pase'];\r\n\t\t$this->Serie_Equipo->DbValue = $row['Serie_Equipo'];\r\n\t\t$this->Id_Hardware->DbValue = $row['Id_Hardware'];\r\n\t\t$this->SN->DbValue = $row['SN'];\r\n\t\t$this->Modelo_Net->DbValue = $row['Modelo_Net'];\r\n\t\t$this->Marca_Arranque->DbValue = $row['Marca_Arranque'];\r\n\t\t$this->Nombre_Titular->DbValue = $row['Nombre_Titular'];\r\n\t\t$this->Dni_Titular->DbValue = $row['Dni_Titular'];\r\n\t\t$this->Cuil_Titular->DbValue = $row['Cuil_Titular'];\r\n\t\t$this->Nombre_Tutor->DbValue = $row['Nombre_Tutor'];\r\n\t\t$this->DniTutor->DbValue = $row['DniTutor'];\r\n\t\t$this->Domicilio->DbValue = $row['Domicilio'];\r\n\t\t$this->Tel_Tutor->DbValue = $row['Tel_Tutor'];\r\n\t\t$this->CelTutor->DbValue = $row['CelTutor'];\r\n\t\t$this->Cue_Establecimiento_Alta->DbValue = $row['Cue_Establecimiento_Alta'];\r\n\t\t$this->Escuela_Alta->DbValue = $row['Escuela_Alta'];\r\n\t\t$this->Directivo_Alta->DbValue = $row['Directivo_Alta'];\r\n\t\t$this->Cuil_Directivo_Alta->DbValue = $row['Cuil_Directivo_Alta'];\r\n\t\t$this->Dpto_Esc_alta->DbValue = $row['Dpto_Esc_alta'];\r\n\t\t$this->Localidad_Esc_Alta->DbValue = $row['Localidad_Esc_Alta'];\r\n\t\t$this->Domicilio_Esc_Alta->DbValue = $row['Domicilio_Esc_Alta'];\r\n\t\t$this->Rte_Alta->DbValue = $row['Rte_Alta'];\r\n\t\t$this->Tel_Rte_Alta->DbValue = $row['Tel_Rte_Alta'];\r\n\t\t$this->Email_Rte_Alta->DbValue = $row['Email_Rte_Alta'];\r\n\t\t$this->Serie_Server_Alta->DbValue = $row['Serie_Server_Alta'];\r\n\t\t$this->Cue_Establecimiento_Baja->DbValue = $row['Cue_Establecimiento_Baja'];\r\n\t\t$this->Escuela_Baja->DbValue = $row['Escuela_Baja'];\r\n\t\t$this->Directivo_Baja->DbValue = $row['Directivo_Baja'];\r\n\t\t$this->Cuil_Directivo_Baja->DbValue = $row['Cuil_Directivo_Baja'];\r\n\t\t$this->Dpto_Esc_Baja->DbValue = $row['Dpto_Esc_Baja'];\r\n\t\t$this->Localidad_Esc_Baja->DbValue = $row['Localidad_Esc_Baja'];\r\n\t\t$this->Domicilio_Esc_Baja->DbValue = $row['Domicilio_Esc_Baja'];\r\n\t\t$this->Rte_Baja->DbValue = $row['Rte_Baja'];\r\n\t\t$this->Tel_Rte_Baja->DbValue = $row['Tel_Rte_Baja'];\r\n\t\t$this->Email_Rte_Baja->DbValue = $row['Email_Rte_Baja'];\r\n\t\t$this->Serie_Server_Baja->DbValue = $row['Serie_Server_Baja'];\r\n\t\t$this->Fecha_Pase->DbValue = $row['Fecha_Pase'];\r\n\t\t$this->Id_Estado_Pase->DbValue = $row['Id_Estado_Pase'];\r\n\t\t$this->Ruta_Archivo->Upload->DbValue = $row['Ruta_Archivo'];\r\n\t}", "function describir_campos($tabla_x,$bd_x=\"\"){\r\n\t\tif($bd_x!=\"\"){\r\n\t\t\t$bd = $bd_x.\".\";\r\n\t\t}#end if\r\n\t\t$query_x = \"SHOW FIELDS FROM \".$bd.$tabla_x;\r\n\t\t$result = mysqli_query($this->conexion,$query_x);\r\n\t\tif($result){\r\n\t\t\t$n_filas = mysqli_num_rows($result);\r\n\t\t\t$this->serial[$tabla_x] = \"\";\r\n\t\t\tfor ($i=0;$i<$n_filas;$i++){\r\n\t\t\t\t$row_x = mysqli_fetch_array($result);\r\n\t\t\t\tif($i==0){\r\n\t\t\t\t\t$this->campo_clave = $row_x[0];\r\n\t\t\t\t}#end if\r\n\t\t\t\t$this->nombre[$i] = $row_x[0];\r\n\t\t\t\t$this->tipo[$i] = $row_x[1];\r\n\t\t\t\tif($row_x[\"Key\"] == \"PRI\"){\r\n\t\t\t\t\t$this->campo_clave = $row_x[0];\r\n\t\t\t\t}#end if\r\n\t\t\t}#end next i\r\n\t\t}#end if result\r\n\t}", "public function examen(){\r\n\t\tparent::conectaBDMy();\t \r\n\t\t$this->idExamen=\"\";\t\t\r\n\t\t$this->tipoExamen=\"\";\t\r\n\t\t$this->descripcion=\"\";\r\n\t}", "public function listaCampos() {\r\n return Array(\"empleado\", \"nombre\", \"nif\", \"perfil_Usuario\", \"etiqueta_Emp\", \"observaciones_Emp\", \"centro_Directivo_Depart\", \"centro_Trabajo\", \"puesto_Trabajo\", \"servicio\", \"tipo_Usuario\", \"grupo_Nivel\");\r\n }", "function LoadDbValues(&$rs) {\r\n\t\tif (!$rs || !is_array($rs) && $rs->EOF) return;\r\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\r\n\t\t$this->Dni_Tutor->DbValue = $row['Dni_Tutor'];\r\n\t\t$this->Apellidos_Nombres->DbValue = $row['Apellidos_Nombres'];\r\n\t\t$this->Edad->DbValue = $row['Edad'];\r\n\t\t$this->Domicilio->DbValue = $row['Domicilio'];\r\n\t\t$this->Tel_Contacto->DbValue = $row['Tel_Contacto'];\r\n\t\t$this->Fecha_Nac->DbValue = $row['Fecha_Nac'];\r\n\t\t$this->Cuil->DbValue = $row['Cuil'];\r\n\t\t$this->MasHijos->DbValue = $row['MasHijos'];\r\n\t\t$this->Id_Estado_Civil->DbValue = $row['Id_Estado_Civil'];\r\n\t\t$this->Id_Sexo->DbValue = $row['Id_Sexo'];\r\n\t\t$this->Id_Relacion->DbValue = $row['Id_Relacion'];\r\n\t\t$this->Id_Ocupacion->DbValue = $row['Id_Ocupacion'];\r\n\t\t$this->Lugar_Nacimiento->DbValue = $row['Lugar_Nacimiento'];\r\n\t\t$this->Id_Provincia->DbValue = $row['Id_Provincia'];\r\n\t\t$this->Id_Departamento->DbValue = $row['Id_Departamento'];\r\n\t\t$this->Id_Localidad->DbValue = $row['Id_Localidad'];\r\n\t\t$this->Fecha_Actualizacion->DbValue = $row['Fecha_Actualizacion'];\r\n\t\t$this->Usuario->DbValue = $row['Usuario'];\r\n\t}", "function prepareForDb() {\n $this->description = sql_escape($this->description);\n $this->postsHeader = sql_escape($this->postsHeader);\n $this->postBody = sql_escape($this->postBody);\n $this->postsFooter = sql_escape($this->postsFooter);\n $this->formLogged = sql_escape($this->formLogged);\n $this->form = sql_escape($this->form);\n $this->navigation = sql_escape($this->navigation);\n $this->name = sql_escape($this->name);\n $this->nameLin = sql_escape($this->nameLin);\n $this->memberName = sql_escape($this->memberName);\n $this->date = sql_escape($this->date);\n $this->time = sql_escape($this->time); \n $this->nextPage = sql_escape($this->nextPage);\n $this->previousPage =sql_escape($this->previousPage);\n $this->firstPage = sql_escape($this->firstPage);\n $this->lastPage = sql_escape($this->lastPage);\n\t$this->gravDefault = sql_escape($this->gravDefault);\n }", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF) return;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->empleado_id->DbValue = $row['empleado_id'];\n\t\t$this->codigo->DbValue = $row['codigo'];\n\t\t$this->cui->DbValue = $row['cui'];\n\t\t$this->nombre->DbValue = $row['nombre'];\n\t\t$this->apellido->DbValue = $row['apellido'];\n\t\t$this->direccion->DbValue = $row['direccion'];\n\t\t$this->departamento_origen_id->DbValue = $row['departamento_origen_id'];\n\t\t$this->municipio_id->DbValue = $row['municipio_id'];\n\t\t$this->telefono_residencia->DbValue = $row['telefono_residencia'];\n\t\t$this->telefono_celular->DbValue = $row['telefono_celular'];\n\t\t$this->fecha_nacimiento->DbValue = $row['fecha_nacimiento'];\n\t\t$this->nacionalidad->DbValue = $row['nacionalidad'];\n\t\t$this->estado_civil->DbValue = $row['estado_civil'];\n\t\t$this->sexo->DbValue = $row['sexo'];\n\t\t$this->igss->DbValue = $row['igss'];\n\t\t$this->nit->DbValue = $row['nit'];\n\t\t$this->licencia_conducir->DbValue = $row['licencia_conducir'];\n\t\t$this->area_id->DbValue = $row['area_id'];\n\t\t$this->departmento_id->DbValue = $row['departmento_id'];\n\t\t$this->seccion_id->DbValue = $row['seccion_id'];\n\t\t$this->puesto_id->DbValue = $row['puesto_id'];\n\t\t$this->observaciones->DbValue = $row['observaciones'];\n\t\t$this->tipo_sangre_id->DbValue = $row['tipo_sangre_id'];\n\t\t$this->estado->DbValue = $row['estado'];\n\t}", "public function database(){\n\t\t// define each field\n\t\t\t$fields[$this->name] = array(\n\t\t\t\t\t'field' => $this->name,\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'option' => array(),\n \t\t\t\t\t'key' => '',\n\t\t\t\t\t'default' => false,\n\t\t\t\t\t'extra' => '',\n\t\t\t\t\t'comment' => 'locales',\n\t\t\t);\n\t\treturn $fields;\n\t}", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF)\n\t\t\treturn;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->id->DbValue = $row['id'];\n\t\t$this->fecha_tamizaje->DbValue = $row['fecha_tamizaje'];\n\t\t$this->id_centro->DbValue = $row['id_centro'];\n\t\t$this->apellidopaterno->DbValue = $row['apellidopaterno'];\n\t\t$this->apellidomaterno->DbValue = $row['apellidomaterno'];\n\t\t$this->nombre->DbValue = $row['nombre'];\n\t\t$this->ci->DbValue = $row['ci'];\n\t\t$this->fecha_nacimiento->DbValue = $row['fecha_nacimiento'];\n\t\t$this->dias->DbValue = $row['dias'];\n\t\t$this->semanas->DbValue = $row['semanas'];\n\t\t$this->meses->DbValue = $row['meses'];\n\t\t$this->sexo->DbValue = $row['sexo'];\n\t\t$this->discapacidad->DbValue = $row['discapacidad'];\n\t\t$this->id_tipodiscapacidad->DbValue = $row['id_tipodiscapacidad'];\n\t\t$this->resultado->DbValue = $row['resultado'];\n\t\t$this->resultadotamizaje->DbValue = $row['resultadotamizaje'];\n\t\t$this->tapon->DbValue = $row['tapon'];\n\t\t$this->tipo->DbValue = $row['tipo'];\n\t\t$this->repetirprueba->DbValue = $row['repetirprueba'];\n\t\t$this->observaciones->DbValue = $row['observaciones'];\n\t\t$this->id_apoderado->DbValue = $row['id_apoderado'];\n\t\t$this->id_referencia->DbValue = $row['id_referencia'];\n\t}", "function _set_editable_fields()\n\t{\n\t\tif (empty($this->fields))\n\t\t{\n\t\t\t// pull the fields dynamically from the database\n\t\t\t$this->db->cache_on();\n\t\t\t$this->fields = $this->db->list_fields($this->primary_table);\n\t\t\t$this->db->cache_off();\n\t\t}\n\t}", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF) return;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->id_admission->DbValue = $row['id_admission'];\n\t\t$this->nomr->DbValue = $row['nomr'];\n\t\t$this->ket_nama->DbValue = $row['ket_nama'];\n\t\t$this->ket_tgllahir->DbValue = $row['ket_tgllahir'];\n\t\t$this->ket_alamat->DbValue = $row['ket_alamat'];\n\t\t$this->ket_jeniskelamin->DbValue = $row['ket_jeniskelamin'];\n\t\t$this->ket_title->DbValue = $row['ket_title'];\n\t\t$this->dokterpengirim->DbValue = $row['dokterpengirim'];\n\t\t$this->statusbayar->DbValue = $row['statusbayar'];\n\t\t$this->kirimdari->DbValue = $row['kirimdari'];\n\t\t$this->keluargadekat->DbValue = $row['keluargadekat'];\n\t\t$this->panggungjawab->DbValue = $row['panggungjawab'];\n\t\t$this->masukrs->DbValue = $row['masukrs'];\n\t\t$this->noruang->DbValue = $row['noruang'];\n\t\t$this->tempat_tidur_id->DbValue = $row['tempat_tidur_id'];\n\t\t$this->nott->DbValue = $row['nott'];\n\t\t$this->NIP->DbValue = $row['NIP'];\n\t\t$this->dokter_penanggungjawab->DbValue = $row['dokter_penanggungjawab'];\n\t\t$this->KELASPERAWATAN_ID->DbValue = $row['KELASPERAWATAN_ID'];\n\t\t$this->NO_SKP->DbValue = $row['NO_SKP'];\n\t\t$this->sep_tglsep->DbValue = $row['sep_tglsep'];\n\t\t$this->sep_tglrujuk->DbValue = $row['sep_tglrujuk'];\n\t\t$this->sep_kodekelasrawat->DbValue = $row['sep_kodekelasrawat'];\n\t\t$this->sep_norujukan->DbValue = $row['sep_norujukan'];\n\t\t$this->sep_kodeppkasal->DbValue = $row['sep_kodeppkasal'];\n\t\t$this->sep_namappkasal->DbValue = $row['sep_namappkasal'];\n\t\t$this->sep_kodeppkpelayanan->DbValue = $row['sep_kodeppkpelayanan'];\n\t\t$this->sep_jenisperawatan->DbValue = $row['sep_jenisperawatan'];\n\t\t$this->sep_catatan->DbValue = $row['sep_catatan'];\n\t\t$this->sep_kodediagnosaawal->DbValue = $row['sep_kodediagnosaawal'];\n\t\t$this->sep_namadiagnosaawal->DbValue = $row['sep_namadiagnosaawal'];\n\t\t$this->sep_lakalantas->DbValue = $row['sep_lakalantas'];\n\t\t$this->sep_lokasilaka->DbValue = $row['sep_lokasilaka'];\n\t\t$this->sep_user->DbValue = $row['sep_user'];\n\t\t$this->sep_flag_cekpeserta->DbValue = $row['sep_flag_cekpeserta'];\n\t\t$this->sep_flag_generatesep->DbValue = $row['sep_flag_generatesep'];\n\t\t$this->sep_nik->DbValue = $row['sep_nik'];\n\t\t$this->sep_namapeserta->DbValue = $row['sep_namapeserta'];\n\t\t$this->sep_jeniskelamin->DbValue = $row['sep_jeniskelamin'];\n\t\t$this->sep_pisat->DbValue = $row['sep_pisat'];\n\t\t$this->sep_tgllahir->DbValue = $row['sep_tgllahir'];\n\t\t$this->sep_kodejeniskepesertaan->DbValue = $row['sep_kodejeniskepesertaan'];\n\t\t$this->sep_namajeniskepesertaan->DbValue = $row['sep_namajeniskepesertaan'];\n\t\t$this->sep_nokabpjs->DbValue = $row['sep_nokabpjs'];\n\t\t$this->sep_status_peserta->DbValue = $row['sep_status_peserta'];\n\t\t$this->sep_umur_pasien_sekarang->DbValue = $row['sep_umur_pasien_sekarang'];\n\t\t$this->statuskeluarranap_id->DbValue = $row['statuskeluarranap_id'];\n\t\t$this->keluarrs->DbValue = $row['keluarrs'];\n\t}", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF) return;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->id->DbValue = $row['id'];\n\t\t$this->id_admission->DbValue = $row['id_admission'];\n\t\t$this->nomr->DbValue = $row['nomr'];\n\t\t$this->statusbayar->DbValue = $row['statusbayar'];\n\t\t$this->kelas->DbValue = $row['kelas'];\n\t\t$this->tanggal->DbValue = $row['tanggal'];\n\t\t$this->kode_tindakan->DbValue = $row['kode_tindakan'];\n\t\t$this->qty->DbValue = $row['qty'];\n\t\t$this->tarif->DbValue = $row['tarif'];\n\t\t$this->bhp->DbValue = $row['bhp'];\n\t\t$this->user->DbValue = $row['user'];\n\t\t$this->nama_tindakan->DbValue = $row['nama_tindakan'];\n\t\t$this->kelompok_tindakan->DbValue = $row['kelompok_tindakan'];\n\t\t$this->kelompok1->DbValue = $row['kelompok1'];\n\t\t$this->kelompok2->DbValue = $row['kelompok2'];\n\t\t$this->kode_dokter->DbValue = $row['kode_dokter'];\n\t\t$this->no_ruang->DbValue = $row['no_ruang'];\n\t}", "protected function alterar(){\n header(\"Content-type: text/html;charset=utf-8\");\n $sql = \"SHOW FULL FIELDS FROM \" . $this->table;\n $execute = conexao::toConnect()->executeS($sql);\n $sets = \"\";\n $id_registro = '';\n $contador = \"\";\n $count = 1;\n foreach ($execute as $contar) {\n if ($contar->Key != 'PRI') {\n $atributos_field = $contar->Field;\n $select_p = substr(strtoupper($atributos_field), 0, 1);\n $select_t = substr($atributos_field, 1);\n $get = 'get' . $select_p . $select_t;\n if ($this->$get() != null) {\n $contador = $contador + 1;\n }\n }\n }\n foreach ($execute as $key => $attr){\n if ($attr->Key != 'PRI') {\n $atributos_field = $attr->Field;\n $select_p = substr(strtoupper($atributos_field), 0, 1);\n $select_t = substr($atributos_field, 1);\n $get = 'get' . $select_p . $select_t;\n if ($this->$get() != null) {\n if ($count != $contador) {\n $sets .= $attr->Field . \" = '\" . $this->$get() . \"',\";\n } else {\n $sets .= $attr->Field . \" = '\" . $this->$get().\"'\";\n }\n $count = $count + 1;\n }\n }else{\n $id_registro = $attr->Field;\n }\n }\n $update = \"UPDATE \".$this->table.\" SET \".$sets.\" WHERE \".$id_registro.\" = \".$this->getIdTable();\n\n $execute_into = conexao::toConnect()->executeQuery($update);\n if (count($execute_into) > 0) {\n return $execute_into;\n }else{\n return false;\n }\n }", "public function setFielda($campos) {\n $fields = $this->separate($campos[0]);\n\n # Get the query based in filters\n $this->checkFields($fields);\n # If exists two type fields, check table\n $this->checkTable($campos[1]);\n # Check type of data\n $this->checkType();\n}", "protected function fetchFields(){\n $fields = X3::db()->fetchFields($this->modelName);\n $_res = array();\n foreach($fields as $name=>$field){\n $dataType = X3_MySQL_Command::parseMySQLField($field);\n $_res[$name] = $dataType;\n }\n return $_res;\n }", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF)\n\t\t\treturn;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->id->DbValue = $row['id'];\n\t\t$this->id_sector->DbValue = $row['id_sector'];\n\t\t$this->id_actividad->DbValue = $row['id_actividad'];\n\t\t$this->id_categoria->DbValue = $row['id_categoria'];\n\t\t$this->apellidopaterno->DbValue = $row['apellidopaterno'];\n\t\t$this->apellidomaterno->DbValue = $row['apellidomaterno'];\n\t\t$this->nombre->DbValue = $row['nombre'];\n\t\t$this->fecha_nacimiento->DbValue = $row['fecha_nacimiento'];\n\t\t$this->sexo->DbValue = $row['sexo'];\n\t\t$this->ci->DbValue = $row['ci'];\n\t\t$this->nrodiscapacidad->DbValue = $row['nrodiscapacidad'];\n\t\t$this->celular->DbValue = $row['celular'];\n\t\t$this->direcciondomicilio->DbValue = $row['direcciondomicilio'];\n\t\t$this->ocupacion->DbValue = $row['ocupacion'];\n\t\t$this->_email->DbValue = $row['email'];\n\t\t$this->cargo->DbValue = $row['cargo'];\n\t\t$this->nivelestudio->DbValue = $row['nivelestudio'];\n\t\t$this->id_institucion->DbValue = $row['id_institucion'];\n\t\t$this->observaciones->DbValue = $row['observaciones'];\n\t\t$this->id_centro->DbValue = $row['id_centro'];\n\t}", "private function setField()\n {\n $sql = '';\n $sql = rtrim($sql , ', ');\n\n foreach (array_keys($this->data) as $key){\n $sql .= '`' . $key . '` = ?, ';\n }\n\n $sql = rtrim($sql , ', ');\n return $sql;\n }", "private function setFields(): string\n {\n $sql = '';\n\n foreach (array_keys($this->data) as $key) {\n $sql .= '`' . $key . '` = ? , ';\n }\n return rtrim($sql, ', ');\n }", "private function loadFields(){\n\t\t$this->fields = $this->wpdb->get_results($this->wpdb->prepare(\"\n\t\t\tSELECT\n\t\t\t\t`field`.`id` \t\t\t'field_id',\n\t\t\t\t`type`.`name` \t\t\t'type',\n\t\t\t\t`field`.`name`\t\t\t'name',\n\t\t\t\t`field`.`label`\t\t\t'label',\n\t\t\t\t`field`.`default`\t\t'default',\n\t\t\t\t`field`.`required`\t\t'required',\n\t\t\t\t`field`.`depends_id`\t'depends_id',\n\t\t\t\t`field`.`depends_value`\t'depends_value',\n\t\t\t\t`field`.`placeholder`\t'placeholder'\n\t\t\tFROM `mark_reg_fields` `field`\n\t\t\tLEFT JOIN `mark_reg_field_types` `type` ON `type`.`id` = `field`.`type_id`\n\t\t\tWHERE\n\t\t\t\t`field`.`enabled` = 1\n\t\t\t\tAND `field`.`form_id` = %d\n\t\t\t\tAND `field`.`backend_only` = 0\n\t\t\tORDER BY\n\t\t\t\t`field`.`order`\n\t\t\", $this->form_id));\n\t}", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF) return;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->id->DbValue = $row['id'];\n\t\t$this->period_id->DbValue = $row['period_id'];\n\t\t$this->person_id->DbValue = $row['person_id'];\n\t\t$this->tipejurnal_id->DbValue = $row['tipejurnal_id'];\n\t\t$this->nomer->DbValue = $row['nomer'];\n\t\t$this->createon->DbValue = $row['createon'];\n\t\t$this->keterangan->DbValue = $row['keterangan'];\n\t}", "public function prepareFieldset();", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF) return;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->idservicio_medico_prestado->DbValue = $row['idservicio_medico_prestado'];\n\t\t$this->idcuenta->DbValue = $row['idcuenta'];\n\t\t$this->fecha_inicio->DbValue = $row['fecha_inicio'];\n\t\t$this->fecha_final->DbValue = $row['fecha_final'];\n\t\t$this->estado->DbValue = $row['estado'];\n\t}", "public function loadData(){\r\n\t\t\t $pseudo = addslashes($this -> getPseudo()) ;\r\n\r\n\t\t if(! empty($pseudo)){\r\n\t\t\t$q = \"select * from UserTab where User_pseudo='\".$pseudo.\"'\";\r\n\t\t\t$r = execute($q);\r\n\t\t\twhile( $l = mysql_fetch_assoc($r) ){\r\n\t\t\t\t$this -> setFields($l);//Affectation aux champs de l'objet UserTab \r\n\t\t\t}\r\n\t\t }\r\n\r\n\t }", "private function _fields() {\n if ($this->_table() && empty($this->fields)) {\n $this->fields = $this->db->list_fields($this->_table());\n }\n return $this->fields;\n }", "private function camposObligatorios()\n {\n $this->setRequiredField(\"mascara\");\n $this->setRequiredField(\"etiqueta\");\n/*\n $this->setRequiredField(\"id_padre\");\n*/\n $this->setRequiredField(\"posicion\");\n $this->setRequiredField(\"visible\");\n $this->setRequiredField(\"nivel_acceso\");\n/*\n $this->setRequiredField(\"accion\");\n*/\n\n return;\n }", "public function GruporModelo()\n\t\t{\n\t\t\t$id = \"\";\n\t\t\t$numero = \"\";\n\t\t\t$franja = \"\";\n\t\t}", "private function setAutofillFields() {\n foreach (static::getFields() as $field_name => $field) {\n if ($field instanceof AutofillField) {\n $this->values[$field_name] = $field->fill();\n }\n }\n }", "function asignar_valores2(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->telefono=$_POST['telefono'];\n\t\t$this->email=$_POST['email'];\n\t\t\n\t\t$this->marca=$_POST['marca'];\n\t\t$this->modelo=$_POST['modelo'];\n\t\t$this->ano=$_POST['ano'];\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t}", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF) return;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->id->DbValue = $row['id'];\n\t\t$this->detail_jenis_spp->DbValue = $row['detail_jenis_spp'];\n\t\t$this->id_jenis_spp->DbValue = $row['id_jenis_spp'];\n\t\t$this->status_spp->DbValue = $row['status_spp'];\n\t\t$this->no_spp->DbValue = $row['no_spp'];\n\t\t$this->tgl_spp->DbValue = $row['tgl_spp'];\n\t\t$this->keterangan->DbValue = $row['keterangan'];\n\t\t$this->jumlah_up->DbValue = $row['jumlah_up'];\n\t\t$this->bendahara->DbValue = $row['bendahara'];\n\t\t$this->nama_pptk->DbValue = $row['nama_pptk'];\n\t\t$this->nip_pptk->DbValue = $row['nip_pptk'];\n\t\t$this->kode_program->DbValue = $row['kode_program'];\n\t\t$this->kode_kegiatan->DbValue = $row['kode_kegiatan'];\n\t\t$this->kode_sub_kegiatan->DbValue = $row['kode_sub_kegiatan'];\n\t\t$this->tahun_anggaran->DbValue = $row['tahun_anggaran'];\n\t\t$this->jumlah_spd->DbValue = $row['jumlah_spd'];\n\t\t$this->nomer_dasar_spd->DbValue = $row['nomer_dasar_spd'];\n\t\t$this->tanggal_spd->DbValue = $row['tanggal_spd'];\n\t\t$this->id_spd->DbValue = $row['id_spd'];\n\t\t$this->kode_rekening->DbValue = $row['kode_rekening'];\n\t\t$this->nama_bendahara->DbValue = $row['nama_bendahara'];\n\t\t$this->nip_bendahara->DbValue = $row['nip_bendahara'];\n\t\t$this->no_spm->DbValue = $row['no_spm'];\n\t\t$this->tgl_spm->DbValue = $row['tgl_spm'];\n\t\t$this->status_spm->DbValue = $row['status_spm'];\n\t\t$this->nama_bank->DbValue = $row['nama_bank'];\n\t\t$this->nomer_rekening_bank->DbValue = $row['nomer_rekening_bank'];\n\t\t$this->npwp->DbValue = $row['npwp'];\n\t\t$this->pimpinan_blud->DbValue = $row['pimpinan_blud'];\n\t\t$this->nip_pimpinan->DbValue = $row['nip_pimpinan'];\n\t\t$this->no_sptb->DbValue = $row['no_sptb'];\n\t\t$this->tgl_sptb->DbValue = $row['tgl_sptb'];\n\t}", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF)\n\t\t\treturn;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->replid->DbValue = $row['replid'];\n\t\t$this->nama->DbValue = $row['nama'];\n\t\t$this->besar->DbValue = $row['besar'];\n\t\t$this->idkategori->DbValue = $row['idkategori'];\n\t\t$this->rekkas->DbValue = $row['rekkas'];\n\t\t$this->rekpendapatan->DbValue = $row['rekpendapatan'];\n\t\t$this->rekpiutang->DbValue = $row['rekpiutang'];\n\t\t$this->aktif->DbValue = $row['aktif'];\n\t\t$this->keterangan->DbValue = $row['keterangan'];\n\t\t$this->departemen->DbValue = $row['departemen'];\n\t\t$this->info1->DbValue = $row['info1'];\n\t\t$this->info2->DbValue = $row['info2'];\n\t\t$this->info3->DbValue = $row['info3'];\n\t\t$this->ts->DbValue = $row['ts'];\n\t\t$this->token->DbValue = $row['token'];\n\t\t$this->issync->DbValue = $row['issync'];\n\t}", "public function fieldCreate()\n\t{\n\t\t$fields=array();\n\t\tforeach($this->getTable()->result_array() as $row)\n\t\t{\n\t\t\tif($row['Extra']!=='auto_increment')\n\t\t\t{\n\t\t\t\t$fields[]=array(\n\t\t\t\t\t'field'=>$row['Field'],\n\t\t\t\t\t'max_length'=>preg_match('/varchar/',$row['Type']) ? (preg_replace('/[A-Za-z()]/','',$row['Type'])!=='' ? '\\'maxlength\\'=>'.preg_replace('/[A-Za-z()]/','',$row['Type']).',' : false) : false,\n\t\t\t\t\t'type'=>preg_match('/text/',$row['Type']) ? 'Area' : 'Field',\n\t\t\t\t\t'required'=>$row['Null']=='NO' ? true : false,\n\t\t\t\t\t'input'=>preg_match('/^(password|pass|passwd|passcode)$/i',$row['Field']) ? 'password' : 'text',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $fields;\n\t}", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF) return;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->tgl->DbValue = $row['tgl'];\n\t\t$this->no_spp->DbValue = $row['no_spp'];\n\t\t$this->jns_spp->DbValue = $row['jns_spp'];\n\t\t$this->kd_mata->DbValue = $row['kd_mata'];\n\t\t$this->urai->DbValue = $row['urai'];\n\t\t$this->jmlh->DbValue = $row['jmlh'];\n\t\t$this->jmlh1->DbValue = $row['jmlh1'];\n\t\t$this->jmlh2->DbValue = $row['jmlh2'];\n\t\t$this->jmlh3->DbValue = $row['jmlh3'];\n\t\t$this->jmlh4->DbValue = $row['jmlh4'];\n\t\t$this->nm_perus->DbValue = $row['nm_perus'];\n\t\t$this->alamat->DbValue = $row['alamat'];\n\t\t$this->npwp->DbValue = $row['npwp'];\n\t\t$this->pimpinan->DbValue = $row['pimpinan'];\n\t\t$this->bank->DbValue = $row['bank'];\n\t\t$this->rek->DbValue = $row['rek'];\n\t\t$this->nospm->DbValue = $row['nospm'];\n\t\t$this->tglspm->DbValue = $row['tglspm'];\n\t\t$this->ppn->DbValue = $row['ppn'];\n\t\t$this->ps21->DbValue = $row['ps21'];\n\t\t$this->ps22->DbValue = $row['ps22'];\n\t\t$this->ps23->DbValue = $row['ps23'];\n\t\t$this->ps4->DbValue = $row['ps4'];\n\t\t$this->kodespm->DbValue = $row['kodespm'];\n\t\t$this->nambud->DbValue = $row['nambud'];\n\t\t$this->nppk->DbValue = $row['nppk'];\n\t\t$this->nipppk->DbValue = $row['nipppk'];\n\t\t$this->prog->DbValue = $row['prog'];\n\t\t$this->prog1->DbValue = $row['prog1'];\n\t\t$this->bayar->DbValue = $row['bayar'];\n\t}", "function readReal(){ \n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE id=1 LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t$this->id = $row['id'];\n\t\t$this->nmp = $row['nama_pondok'];\n\t\t$this->almt = $row['alamat_pondok'];\n\t\t$this->komp = $row['komputer_pondok'];\n\t\t$this->sms = $row['no_sms_gateway'];\n\t}", "public function trataDados()\r\n {\r\n // trata os campos do form\r\n if ($this->form->isSubmitted() && $this->form->isValid()) {\r\n $this->data = $this->form->getData();\r\n\r\n // não filtra campo em branco\r\n foreach ($this->data as $k => $v){\r\n if(empty($v)){\r\n unset($this->data[$k]);\r\n }\r\n }\r\n }\r\n $this->trataObjetos();\r\n }", "private function userDataFromDB($all) {\n\n foreach ($all as $value) {\n\n $user_data = $this->users->find($value->userId);\n $value->name = $user_data->name;\n $value->mail = $user_data->email;\n $value->gravatar = $user_data->gravatar;\n }\n return $all;\n }", "function LoadDbValues(&$rs) {\r\n\t\tif (!$rs || !is_array($rs) && $rs->EOF) return;\r\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\r\n\t\t$this->Nro_Serie->DbValue = $row['Nro_Serie'];\r\n\t\t$this->SN->DbValue = $row['SN'];\r\n\t\t$this->Cant_Net_Asoc->DbValue = $row['Cant_Net_Asoc'];\r\n\t\t$this->Id_Marca->DbValue = $row['Id_Marca'];\r\n\t\t$this->Id_Modelo->DbValue = $row['Id_Modelo'];\r\n\t\t$this->Id_SO->DbValue = $row['Id_SO'];\r\n\t\t$this->Id_Estado->DbValue = $row['Id_Estado'];\r\n\t\t$this->User_Server->DbValue = $row['User_Server'];\r\n\t\t$this->Pass_Server->DbValue = $row['Pass_Server'];\r\n\t\t$this->User_TdServer->DbValue = $row['User_TdServer'];\r\n\t\t$this->Pass_TdServer->DbValue = $row['Pass_TdServer'];\r\n\t\t$this->Cue->DbValue = $row['Cue'];\r\n\t\t$this->Fecha_Actualizacion->DbValue = $row['Fecha_Actualizacion'];\r\n\t\t$this->Usuario->DbValue = $row['Usuario'];\r\n\t}", "function field_data()\r\n\t{\r\n\t\t$retval = array();\r\n /*\r\n echo \"<pre>\";\r\n var_dump($this->result_id);\r\n var_dump($this->pdo_results);\r\n echo \"</pre>\";\r\n */\r\n $table_info = $this->pdo_results;\r\n assert(is_array($table_info));\r\n foreach ($table_info as $row_info) {\r\n $F = new stdClass();\r\n $F->name = $row_info['name'];\r\n $F->type = $row_info['type'];\r\n $F->default = $row_info['dflt_value'];\r\n $F->max_length = 0;\r\n $F->primary_key = $row_info['pk'];\r\n \r\n $retval[] = $F;\r\n }\r\n\r\n return $retval;\r\n }", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF) return;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->id->DbValue = $row['id'];\n\t\t$this->name->DbValue = $row['name'];\n\t\t$this->_email->DbValue = $row['email'];\n\t\t$this->password->DbValue = $row['password'];\n\t\t$this->companyname->DbValue = $row['companyname'];\n\t\t$this->servicetime->DbValue = $row['servicetime'];\n\t\t$this->country->DbValue = $row['country'];\n\t\t$this->phone->DbValue = $row['phone'];\n\t\t$this->skype->DbValue = $row['skype'];\n\t\t$this->website->DbValue = $row['website'];\n\t\t$this->linkedin->DbValue = $row['linkedin'];\n\t\t$this->facebook->DbValue = $row['facebook'];\n\t\t$this->twitter->DbValue = $row['twitter'];\n\t\t$this->active_code->DbValue = $row['active_code'];\n\t\t$this->identification->DbValue = $row['identification'];\n\t\t$this->link_expired->DbValue = $row['link_expired'];\n\t\t$this->isactive->DbValue = $row['isactive'];\n\t\t$this->pio->DbValue = $row['pio'];\n\t\t$this->google->DbValue = $row['google'];\n\t\t$this->instagram->DbValue = $row['instagram'];\n\t\t$this->account_type->DbValue = $row['account_type'];\n\t\t$this->logo->DbValue = $row['logo'];\n\t\t$this->profilepic->DbValue = $row['profilepic'];\n\t\t$this->mailref->DbValue = $row['mailref'];\n\t\t$this->deleted->DbValue = $row['deleted'];\n\t\t$this->deletefeedback->DbValue = $row['deletefeedback'];\n\t\t$this->account_id->DbValue = $row['account_id'];\n\t\t$this->start_date->DbValue = $row['start_date'];\n\t\t$this->end_date->DbValue = $row['end_date'];\n\t\t$this->year_moth->DbValue = $row['year_moth'];\n\t\t$this->registerdate->DbValue = $row['registerdate'];\n\t\t$this->login_type->DbValue = $row['login_type'];\n\t\t$this->accountstatus->DbValue = $row['accountstatus'];\n\t\t$this->ispay->DbValue = $row['ispay'];\n\t\t$this->profilelink->DbValue = $row['profilelink'];\n\t\t$this->source->DbValue = $row['source'];\n\t\t$this->agree->DbValue = $row['agree'];\n\t\t$this->balance->DbValue = $row['balance'];\n\t\t$this->job_title->DbValue = $row['job_title'];\n\t\t$this->projects->DbValue = $row['projects'];\n\t\t$this->opportunities->DbValue = $row['opportunities'];\n\t\t$this->isconsaltant->DbValue = $row['isconsaltant'];\n\t\t$this->isagent->DbValue = $row['isagent'];\n\t\t$this->isinvestor->DbValue = $row['isinvestor'];\n\t\t$this->isbusinessman->DbValue = $row['isbusinessman'];\n\t\t$this->isprovider->DbValue = $row['isprovider'];\n\t\t$this->isproductowner->DbValue = $row['isproductowner'];\n\t\t$this->states->DbValue = $row['states'];\n\t\t$this->cities->DbValue = $row['cities'];\n\t\t$this->offers->DbValue = $row['offers'];\n\t}", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF) return;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->id->DbValue = $row['id'];\n\t\t$this->name->DbValue = $row['name'];\n\t\t$this->_email->DbValue = $row['email'];\n\t\t$this->password->DbValue = $row['password'];\n\t\t$this->companyname->DbValue = $row['companyname'];\n\t\t$this->servicetime->DbValue = $row['servicetime'];\n\t\t$this->country->DbValue = $row['country'];\n\t\t$this->phone->DbValue = $row['phone'];\n\t\t$this->skype->DbValue = $row['skype'];\n\t\t$this->website->DbValue = $row['website'];\n\t\t$this->linkedin->DbValue = $row['linkedin'];\n\t\t$this->facebook->DbValue = $row['facebook'];\n\t\t$this->twitter->DbValue = $row['twitter'];\n\t\t$this->active_code->DbValue = $row['active_code'];\n\t\t$this->identification->DbValue = $row['identification'];\n\t\t$this->link_expired->DbValue = $row['link_expired'];\n\t\t$this->isactive->DbValue = $row['isactive'];\n\t\t$this->pio->DbValue = $row['pio'];\n\t\t$this->google->DbValue = $row['google'];\n\t\t$this->instagram->DbValue = $row['instagram'];\n\t\t$this->account_type->DbValue = $row['account_type'];\n\t\t$this->logo->DbValue = $row['logo'];\n\t\t$this->profilepic->DbValue = $row['profilepic'];\n\t\t$this->mailref->DbValue = $row['mailref'];\n\t\t$this->deleted->DbValue = $row['deleted'];\n\t\t$this->deletefeedback->DbValue = $row['deletefeedback'];\n\t\t$this->account_id->DbValue = $row['account_id'];\n\t\t$this->start_date->DbValue = $row['start_date'];\n\t\t$this->end_date->DbValue = $row['end_date'];\n\t\t$this->year_moth->DbValue = $row['year_moth'];\n\t\t$this->registerdate->DbValue = $row['registerdate'];\n\t\t$this->login_type->DbValue = $row['login_type'];\n\t\t$this->accountstatus->DbValue = $row['accountstatus'];\n\t\t$this->ispay->DbValue = $row['ispay'];\n\t\t$this->profilelink->DbValue = $row['profilelink'];\n\t\t$this->source->DbValue = $row['source'];\n\t\t$this->agree->DbValue = $row['agree'];\n\t\t$this->balance->DbValue = $row['balance'];\n\t\t$this->job_title->DbValue = $row['job_title'];\n\t\t$this->projects->DbValue = $row['projects'];\n\t\t$this->opportunities->DbValue = $row['opportunities'];\n\t\t$this->isconsaltant->DbValue = $row['isconsaltant'];\n\t\t$this->isagent->DbValue = $row['isagent'];\n\t\t$this->isinvestor->DbValue = $row['isinvestor'];\n\t\t$this->isbusinessman->DbValue = $row['isbusinessman'];\n\t\t$this->isprovider->DbValue = $row['isprovider'];\n\t\t$this->isproductowner->DbValue = $row['isproductowner'];\n\t\t$this->states->DbValue = $row['states'];\n\t\t$this->cities->DbValue = $row['cities'];\n\t\t$this->offers->DbValue = $row['offers'];\n\t}", "public function listarPorCpf(){\n $query = \"select * from usuario where cpf=?\";\n\n //preparando a consulta para a execução\n $stmt=$this->conn->prepare($query);\n\n //vamos fazer um blind(ligação) do cpf pesquisado\n //com o paramêtro da consulta, neste caso é o \n //ponto de interrogação\n $stmt ->bindParam(1,$this->cpf);\n\n //executar efetivamente a consulta \n $stmt ->execute();\n\n //Organizar os dados retornados da consulta para \n // a exibição em formato de json\n // Vamos usar uma variavel e um array para associar \n // os campos da tabela\n $linha = $stmt->fetch(PDO::FETCH_ASSOC);\n\n //organizar no objeto usuario(aqrquivo usuario.php)\n //os dados retornados\n //da tabela usuario que está no banco de dados\n \n $this->idusuario = $linha['idusuario'];\n $this->email = $linha['email'];\n $this->senha = $linha['senha'];\n $this->nome = $linha['nome'];\n $this->cpf = $linha['cpf'];\n $this->telefone = $linha['telefone'];\n $this->foto = $linha['foto'];\n\n\n }", "private function cargar_parametros_familias(){\n $sql = \"SELECT id,codigo,descripcion FROM mos_requisitos_familias ORDER BY orden\";\n $columnas_fam = $this->dbl->query($sql, array());\n return $columnas_fam;\n }", "public function fill_fields() {\n if (isset($this->id) && isset($this->name)) {\n /* already filled */\n return true;\n } else if (isset($this->id)) {\n $stmt = $this->pdo->prepare(\"select name from $this->table where id = :id\");\n $stmt->bindValue(':id', $this->id);\n $stmt->execute();\n $res = $stmt->fetchAll();\n if (count($res) != 1) {\n return false;\n } else {\n $this->name = $res[0][0];\n return true;\n }\n } else if (isset($this->name)) {\n $stmt = $this->pdo->prepare(\"select id from $this->table where name = :name\");\n $stmt->bindValue(':name', $this->name);\n $stmt->execute();\n $res = $stmt->fetchAll();\n if (count($res) != 1) {\n return false;\n } else {\n $this->id = $res[0][0];\n return true;\n }\n } else {\n return false;\n }\n }", "function recuperar_datos() {\n\t\tglobal $nombre, $tipo ;\n\t\t\n\t\t\t$pers_id =(isset($_POST['id_marcas']) && !empty($_POST['id_marcas']))? $_POST['id_marcas']:\"\";\n\t\t\t$tipo =(isset($_POST['tipo']) && !empty($_POST['tipo']))? $_POST['tipo']:\"A\"; \t\n\n\t\t\t$nombre=(isset($_POST[\"nombre\"]) && !empty($_POST[\"nombre\"]))? $_POST[\"nombre\"]:\"\";\t\t\t\n\t\n\t\t}", "public function load_field(){\r\n $this->layout=\"ajax\";\r\n $module=$_POST['module'];\r\n $this->loadModel($module);\r\n $field_names= Set::extract('/COLUMNS/Field',$this->$module->query(\"DESCRIBE {$this->$module->useTable}\"));\r\n $field= array_combine($field_names, $field_names);\r\n $this->set(compact('field'));\r\n }", "private function _set_fields()\n {\n @$this->form_data->question_id = 0;\n\n $this->form_data->category_id = 0;\n $this->form_data->sub_category_id = 0;\n $this->form_data->sub_two_category_id = 0;\n $this->form_data->sub_three_category_id = 0;\n $this->form_data->sub_four_category_id = 0;\n\n $this->form_data->ques_text = '';\n $this->form_data->survey_weight = '';\n $this->form_data->ques_type = '';\n $this->form_data->qus_fixed = 0;\n $this->form_data->ques_expiry_date = '';\n\n\n $this->form_data->filter_question = '';\n $this->form_data->filter_category = 0;\n $this->form_data->filter_type = '';\n $this->form_data->filter_expired = '';\n }", "function asignar_valores(){\n\t\t//$this->ciudad=$_SESSION['ciudad_admin'];\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->cantidad=$_POST['cantidad'];\n\t\t$this->cedula=$_POST['cedula'];\n\t\t$this->correo=$_POST['correo'];\n\t}", "protected function setDbColumns()\n {\n $connection = $this->model()->eloquent()->getConnectionName();\n\n $this->dbColumns = collect(Schema::connection($connection)->getColumnListing($this->model()->getTable()));\n }", "function LoadRowValues(&$rs) {\n\t\tglobal $planilla;\n\t\t$planilla->idPlanilla->setDbValue($rs->fields('idPlanilla'));\n\t\t$planilla->Nombre->setDbValue($rs->fields('Nombre'));\n\t}", "private function _setFieldNames() {\n $this->id = \"id\";\n $this->name = \"name\";\n $this->surveyId = \"survey_id\";\n $this->languageId = \"language_id\";\n $this->deleted = \"deleted\"; \n }", "function getFieldAndValues($params) {\n global $conn;\n\n if (!is_array($params))\n exit('Parâmetro inválido!');\n\n $id = $params['id'];\n $mod = $params['modulo'];\n $pre = $params['pre'];\n $ref = isset($params['ref']) ? $params['ref'] : 'id';\n\n if (empty($id) || empty($mod) || empty($pre))\n exit('Dados inválidos');\n\n\n /*\n *pega lista de colunas\n */\n $sql= \"SELECT * FROM \".TABLE_PREFIX.\"_{$mod} WHERE {$pre}_{$ref}=\\\"{$id}\\\"\";\n $fields = array();\n if(!$qry = $conn->query($sql))\n echo $conn->error();\n\n else {\n\n while($fld = $qry->fetch_field())\n array_push($fields, str_replace($pre.'_', null, $fld->name));\n\n $qry->close();\n }\n\n /*\n *pega valores dessas colunas\n */\n $sqlv= \"SELECT * FROM \".TABLE_PREFIX.\"_{$mod} WHERE {$pre}_{$ref}=\\\"{$id}\\\"\";\n if(!$qryv = $conn->query($sqlv))\n echo $conn->error();\n\n else {\n $valores = $qryv->fetch_array(MYSQLI_ASSOC);\n $qryv->close();\n }\n\n $res = null;\n foreach ($fields as $i=>$col)\n $res .= \"{$col} = \".$valores[$pre.'_'.$col].\";\\n\";\n\n\n return $res.\"\\n\";\n}", "function allinea_db(){\n\t\tif ($this->attributes['BYTB']!='' ) $this->fields_value_bytb($this->attributes['BYTB']);\n\t\tif ($this->attributes['TB']!='no'){\n\t\t\t$i=0;\n\t\t\tforeach ($this->values as $key => $val){\n\t\t\t\t$ret[$i]=\"{$key} NUMBER\";\n\t\t\t\t$i++;\n\t\t\t\t$ret[$i]=\"D_{$key} VARCHAR2(200 CHAR)\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $ret;\n\t\t}\n\t\telse return ;\n\t}", "function populate(){\n\t\t$this->db_tools->populate();\n\t\t$this->db_tools->echo_populate();\n\t}", "public function loadFromDb()\n {\n $this->getLogger()->debug(\"Reading {$this->tableName} from DB.\");\n $query = $this->getQueryFactory()->createSelectAllQuery($this->tableName);\n $res = $query->execute();\n $fields = array();\n foreach ($res->fetchAll(\\PDO::FETCH_ASSOC) as $row) {\n $fields[$row['id']] = $row;\n }\n ksort($fields);\n return $fields;\n }", "private static function fields()\n {\n $fields = static::$fields;\n $primary_key = static::$primary_key;\n\n $rows = [$primary_key, ...$fields];\n\n if(!count($rows)) {\n return ['*'];\n }\n\n return $rows;\n }", "function ManejoBD(){\n\t\t$this->BaseDatos = \"instituto\"; # aignar valor a la propiedad $BaseDatos\n\t\t$this->Servidor = \"localhost\"; # aignar valor a la propiedad $Servidor\n\t\t$this->Usuario = \"root\"; # aignar valor a la propiedad $Usuario\n\t\t$this->Clave = \"123456\"; # aignar valor a la propiedad $Clave\n\t}", "public function cargarDatos($fila){\n\t\tforeach($fila as $prop => $valor) {\n\t\t\tif(in_array($prop, static::$fila)) {\n\t\t\t\tswitch($prop){\n\t\t\t\t\tcase \"fk_user\":\n\t\t\t\t\t\t$this->setFkUser($valor);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"name\":\n\t\t\t\t\t\t$this->setName($valor);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"last_name\":\n\t\t\t\t\t\t$this->setLastName($valor);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"dni\":\n\t\t\t\t\t\t$this->setDni($valor);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"birth_day\":\n\t\t\t\t\t\t$this->setBirthDay($valor);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"phone\":\n\t\t\t\t\t\t$this->setPhone($valor);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"borrado\":\n\t\t\t\t\t\t$this->setBorrado($valor);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function loadAllFieldsData()\n {\n // prepare request\n $sth = self::$connection->prepare('SELECT * FROM fields ORDER BY field_order ASC');\n // run it\n $sth->execute();\n\n // check if not empty or error\n if (self::$data = $sth->fetchAll(PDO::FETCH_ASSOC)) {\n // return answer\n return self::$data;\n }\n\n return false;\n }", "function asignar_valores(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->telefono=$_POST['telefono'];\n\t\t$this->email=$_POST['email'];\n\t\t\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->ano=$_POST['ano'];\n\t\t$this->valor_vehiculo=$_POST['valor_vehiculo'];\n\t\t$this->saldo=$_POST['saldo'];\n\t\t$this->valor_inicial=$_POST['valor_inicial'];\n\t\t$this->comision=$_POST['comision'];\n\t\t$this->plazo=$_POST['plazo'];\n\t\t$this->cuotas=$_POST['cuotas'];\n\t\t$this->total=$_POST['total'];\n\t}", "function obtenerCampartidos($id) {\n\t\t$this->db->select('compartidos');\n\t\t$this->db->from($this->nombre2);\n\t\t$this->db->where('id_user', $id);\n\t\t$consulta = $this->db->get();\n\t\treturn current($consulta->result());\n\t}", "function obtenerCampartidos($id) {\n $this->db->select('compartido');\n $this->db->from($this->nombre2);\n $this->db->where('id_user', $id);\n $consulta = $this->db->get();\n return current($consulta->result());\n }", "function valores($idCampo)\r\n {\r\n $mg = ZendExt_Aspect_TransactionManager::getInstance();\r\n $conn = $mg->getConnection('metadatos');\r\n $query = Doctrine_Query::create($conn);\r\n $result = $query->select('v.valor')\r\n ->from('NomValorestruc v')\r\n ->where(\"v.idcampo='$idCampo'\")\r\n //->groupBy('v.valor')\r\n ->execute()\r\n ->toArray();\r\n return $result;\r\n }", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF)\n\t\t\treturn;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->product_id->DbValue = $row['product_id'];\n\t\t$this->cat_id->DbValue = $row['cat_id'];\n\t\t$this->company_id->DbValue = $row['company_id'];\n\t\t$this->pro_model->DbValue = $row['pro_model'];\n\t\t$this->pro_name->DbValue = $row['pro_name'];\n\t\t$this->pro_description->DbValue = $row['pro_description'];\n\t\t$this->pro_condition->DbValue = $row['pro_condition'];\n\t\t$this->pro_features->DbValue = $row['pro_features'];\n\t\t$this->post_date->DbValue = $row['post_date'];\n\t\t$this->ads_id->DbValue = $row['ads_id'];\n\t\t$this->pro_base_price->DbValue = $row['pro_base_price'];\n\t\t$this->pro_sell_price->DbValue = $row['pro_sell_price'];\n\t\t$this->featured_image->Upload->DbValue = $row['featured_image'];\n\t\t$this->folder_image->DbValue = $row['folder_image'];\n\t\t$this->pro_status->DbValue = $row['pro_status'];\n\t\t$this->branch_id->DbValue = $row['branch_id'];\n\t\t$this->lang->DbValue = $row['lang'];\n\t}", "public function load()\n {\n $pdo = $this->getDbConnection();\n $query = \"SELECT * FROM {$this->dbTable}\";\n $data = $pdo->query($query)->fetchAll(\\PDO::FETCH_ASSOC);\n\n foreach ($data as ['key' => $key, 'value' => $value]) {\n $this->setData($key, $value);\n }\n }", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF) return;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->Id_tercero->DbValue = $row['Id_tercero'];\n\t\t$this->nombre_tercero->DbValue = $row['nombre_tercero'];\n\t\t$this->direccion_tercero->DbValue = $row['direccion_tercero'];\n\t\t$this->telefono1_tercero->DbValue = $row['telefono1_tercero'];\n\t\t$this->telefono2_tercero->DbValue = $row['telefono2_tercero'];\n\t\t$this->fax_tercero->DbValue = $row['fax_tercero'];\n\t\t$this->nit_tercero->DbValue = $row['nit_tercero'];\n\t\t$this->tipo_tercero->DbValue = $row['tipo_tercero'];\n\t\t$this->e_mail_tercero->DbValue = $row['e_mail_tercero'];\n\t\t$this->Contacto_tercero->DbValue = $row['Contacto_tercero'];\n\t\t$this->gran_contrib_tercero->DbValue = $row['gran_contrib_tercero'];\n\t\t$this->autoretenedor_tercero->DbValue = $row['autoretenedor_tercero'];\n\t\t$this->activo_tercero->DbValue = $row['activo_tercero'];\n\t\t$this->tercero__registrado_por->DbValue = $row['tercero_ registrado_por'];\n\t\t$this->reg_comun_tercero->DbValue = $row['reg_comun_tercero'];\n\t\t$this->responsable_materiales_tercero->DbValue = $row['responsable_materiales_tercero'];\n\t\t$this->grupo_nomina_tercero->DbValue = $row['grupo_nomina_tercero'];\n\t\t$this->tercero__lider_Obra->DbValue = $row['tercero_ lider_Obra'];\n\t\t$this->tercero_nombre_lider->DbValue = $row['tercero_nombre_lider'];\n\t\t$this->empresa_tercero->DbValue = $row['empresa_tercero'];\n\t}", "protected function loadDbValues(&$rs)\n\t{\n\t\tif (!$rs || !is_array($rs) && $rs->EOF)\n\t\t\treturn;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->id->DbValue = $row['id'];\n\t\t$this->fecha->DbValue = $row['fecha'];\n\t\t$this->hora->DbValue = $row['hora'];\n\t\t$this->audio->DbValue = $row['audio'];\n\t\t$this->st->DbValue = $row['st'];\n\t\t$this->fechaHoraIni->DbValue = $row['fechaHoraIni'];\n\t\t$this->fechaHoraFin->DbValue = $row['fechaHoraFin'];\n\t\t$this->telefono->DbValue = $row['telefono'];\n\t\t$this->agente->DbValue = $row['agente'];\n\t\t$this->fechabo->DbValue = $row['fechabo'];\n\t\t$this->agentebo->DbValue = $row['agentebo'];\n\t\t$this->comentariosbo->DbValue = $row['comentariosbo'];\n\t\t$this->IP->DbValue = $row['IP'];\n\t\t$this->actual->DbValue = $row['actual'];\n\t\t$this->completado->DbValue = $row['completado'];\n\t\t$this->_2_1_R->DbValue = $row['2_1_R'];\n\t\t$this->_2_2_R->DbValue = $row['2_2_R'];\n\t\t$this->_2_3_R->DbValue = $row['2_3_R'];\n\t\t$this->_3_4_R->DbValue = $row['3_4_R'];\n\t\t$this->_4_5_R->DbValue = $row['4_5_R'];\n\t\t$this->_4_6_R->DbValue = $row['4_6_R'];\n\t\t$this->_4_7_R->DbValue = $row['4_7_R'];\n\t\t$this->_4_8_R->DbValue = $row['4_8_R'];\n\t\t$this->_5_9_R->DbValue = $row['5_9_R'];\n\t\t$this->_5_10_R->DbValue = $row['5_10_R'];\n\t\t$this->_5_11_R->DbValue = $row['5_11_R'];\n\t\t$this->_5_12_R->DbValue = $row['5_12_R'];\n\t\t$this->_5_13_R->DbValue = $row['5_13_R'];\n\t\t$this->_5_14_R->DbValue = $row['5_14_R'];\n\t\t$this->_5_51_R->DbValue = $row['5_51_R'];\n\t\t$this->_6_15_R->DbValue = $row['6_15_R'];\n\t\t$this->_6_16_R->DbValue = $row['6_16_R'];\n\t\t$this->_6_17_R->DbValue = $row['6_17_R'];\n\t\t$this->_6_18_R->DbValue = $row['6_18_R'];\n\t\t$this->_6_19_R->DbValue = $row['6_19_R'];\n\t\t$this->_6_20_R->DbValue = $row['6_20_R'];\n\t\t$this->_6_52_R->DbValue = $row['6_52_R'];\n\t\t$this->_7_21_R->DbValue = $row['7_21_R'];\n\t\t$this->_8_22_R->DbValue = $row['8_22_R'];\n\t\t$this->_8_23_R->DbValue = $row['8_23_R'];\n\t\t$this->_8_24_R->DbValue = $row['8_24_R'];\n\t\t$this->_8_25_R->DbValue = $row['8_25_R'];\n\t\t$this->_9_26_R->DbValue = $row['9_26_R'];\n\t\t$this->_9_27_R->DbValue = $row['9_27_R'];\n\t\t$this->_9_28_R->DbValue = $row['9_28_R'];\n\t\t$this->_9_29_R->DbValue = $row['9_29_R'];\n\t\t$this->_9_30_R->DbValue = $row['9_30_R'];\n\t\t$this->_9_31_R->DbValue = $row['9_31_R'];\n\t\t$this->_9_32_R->DbValue = $row['9_32_R'];\n\t\t$this->_9_33_R->DbValue = $row['9_33_R'];\n\t\t$this->_9_34_R->DbValue = $row['9_34_R'];\n\t\t$this->_9_35_R->DbValue = $row['9_35_R'];\n\t\t$this->_9_36_R->DbValue = $row['9_36_R'];\n\t\t$this->_9_37_R->DbValue = $row['9_37_R'];\n\t\t$this->_9_38_R->DbValue = $row['9_38_R'];\n\t\t$this->_9_39_R->DbValue = $row['9_39_R'];\n\t\t$this->_10_40_R->DbValue = $row['10_40_R'];\n\t\t$this->_10_41_R->DbValue = $row['10_41_R'];\n\t\t$this->_11_42_R->DbValue = $row['11_42_R'];\n\t\t$this->_11_43_R->DbValue = $row['11_43_R'];\n\t\t$this->_12_44_R->DbValue = $row['12_44_R'];\n\t\t$this->_12_45_R->DbValue = $row['12_45_R'];\n\t\t$this->_12_46_R->DbValue = $row['12_46_R'];\n\t\t$this->_12_47_R->DbValue = $row['12_47_R'];\n\t\t$this->_12_48_R->DbValue = $row['12_48_R'];\n\t\t$this->_12_49_R->DbValue = $row['12_49_R'];\n\t\t$this->_12_50_R->DbValue = $row['12_50_R'];\n\t\t$this->_1__R->DbValue = $row['1__R'];\n\t\t$this->_13_54_R->DbValue = $row['13_54_R'];\n\t\t$this->_13_54_1_R->DbValue = $row['13_54_1_R'];\n\t\t$this->_13_54_2_R->DbValue = $row['13_54_2_R'];\n\t\t$this->_13_55_R->DbValue = $row['13_55_R'];\n\t\t$this->_13_55_1_R->DbValue = $row['13_55_1_R'];\n\t\t$this->_13_55_2_R->DbValue = $row['13_55_2_R'];\n\t\t$this->_13_56_R->DbValue = $row['13_56_R'];\n\t\t$this->_13_56_1_R->DbValue = $row['13_56_1_R'];\n\t\t$this->_13_56_2_R->DbValue = $row['13_56_2_R'];\n\t\t$this->_12_53_R->DbValue = $row['12_53_R'];\n\t\t$this->_12_53_1_R->DbValue = $row['12_53_1_R'];\n\t\t$this->_12_53_2_R->DbValue = $row['12_53_2_R'];\n\t\t$this->_12_53_3_R->DbValue = $row['12_53_3_R'];\n\t\t$this->_12_53_4_R->DbValue = $row['12_53_4_R'];\n\t\t$this->_12_53_5_R->DbValue = $row['12_53_5_R'];\n\t\t$this->_12_53_6_R->DbValue = $row['12_53_6_R'];\n\t\t$this->_13_57_R->DbValue = $row['13_57_R'];\n\t\t$this->_13_57_1_R->DbValue = $row['13_57_1_R'];\n\t\t$this->_13_57_2_R->DbValue = $row['13_57_2_R'];\n\t\t$this->_13_58_R->DbValue = $row['13_58_R'];\n\t\t$this->_13_58_1_R->DbValue = $row['13_58_1_R'];\n\t\t$this->_13_58_2_R->DbValue = $row['13_58_2_R'];\n\t\t$this->_13_59_R->DbValue = $row['13_59_R'];\n\t\t$this->_13_59_1_R->DbValue = $row['13_59_1_R'];\n\t\t$this->_13_59_2_R->DbValue = $row['13_59_2_R'];\n\t\t$this->_13_60_R->DbValue = $row['13_60_R'];\n\t\t$this->_12_53_7_R->DbValue = $row['12_53_7_R'];\n\t\t$this->_12_53_8_R->DbValue = $row['12_53_8_R'];\n\t}", "function generar()\r\n\t{\r\n\t\tforeach($this->columnas as $ef) {\r\n\t\t \t$this->datos->tabla('columnas')->nueva_fila($ef->get_datos());\r\n\t\t}\r\n\t\tparent::generar();\r\n\t}", "public function getSelectDataFields();", "public function selectAllRegiuniData(){\n $sql = \"SELECT * FROM regiune ORDER BY id DESC\";\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_OBJ);\n }", "private function readFields( )\n {\n global $UNDERQL;\n\n $l_fs = @ mysql_list_fields( $UNDERQL['db']['name'], $this->table_name );\n $l_fq = @ mysql_query( 'SHOW COLUMNS FROM `' . $this->table_name . '`' );\n $l_fc = @ mysql_num_rows( $l_fq );\n @ mysql_free_result( $l_fq );\n $i = 0;\n\n $this->table_fields_names[$this->table_name] = array( );\n $this->string_fields = array( );\n\n while ( $i < $l_fc )\n {\n $l_f = mysql_fetch_field( $l_fs );\n if ( $l_f->numeric != 1 )\n $this->string_fields[@ count( $this->string_fields )] = $l_f->name;\n\n $this->table_fields_names[$this->table_name]\n [@count($this->table_fields_names[$this->table_name])] = $l_f->name;\n $i++;\n }\n }", "public function actualizarCampos(){\n //---- eliminamos todos los registros\n $sql = \"DELETE FROM \". TABLE_EMPRESA .\"_campo WHERE uid_empresa = \". $this->getUID();\n if( !$this->db->query($sql) ){ return $this->db->lastErrorString(); }\n\n //---- asignamos los que se han indicado en el formulario\n $inserts = array();\n $asignados = isset($_REQUEST[\"elementos-asignados\"]) ? $_REQUEST[\"elementos-asignados\"] : [];\n foreach ($asignados as $idCampoAsignado) {\n $inserts[] = \"(\". $this->getUID() .\", \". $idCampoAsignado .\")\";\n }\n\n if (!count($inserts)) return true;\n\n $sql = \"INSERT INTO \". TABLE_EMPRESA .\"_campo ( uid_empresa, uid_campo ) VALUES \". implode(\",\", $inserts);\n if( !$this->db->query($sql) ){ return $this->db->lastErrorString(); }\n\n //----- si todo va bien\n return true;\n }", "public function asignado() {\n \treturn $this->db\n \t\t->select(format_select(array(\n \t\t\t'cirugia.idCirugia' \t\t\t => 'idCirugia',\n \t\t\t'empleado.idEmpleado' \t\t => 'idEmpleado',\n \t\t\t'empleado.matricula'\t\t\t => 'matricula',\n \t\t\t'empleado.nombre' \t\t\t => 'nombre',\n \t\t\t'empleado.apellido_paterno' => 'a_paterno',\n \t\t\t'empleado.apellido_materno' => 'a_materno',\n \t\t\t'especialidad.nombre' \t\t => 'especialidad',\n \t\t\t'cirugia.fecha' \t\t\t\t => 'fecha',\n \t\t\t'quirofano.nombre'\t\t\t => 'quirofano'\n \t\t)))\n \t\t->join('usuario','tipo_usuario.idTipo_Usuario = usuario.idTipo_Usuario')\n \t\t->join('empleado','empleado.idEmpleado = usuario.idEmpleado')\n \t\t->join('departamento','departamento.idDepartamento = tipo_usuario.idDepartamento')\n \t\t->join('especialidad','especialidad.idEspecialidad = departamento.idEspecialidad')\n \t\t->join('proceso_tipo_usuario','proceso_tipo_usuario.idTipo_Usuario = tipo_usuario.idTipo_Usuario')\n \t\t->join('proceso','proceso.idProceso = proceso_tipo_usuario.idProceso')\n \t\t->join('cirugia','cirugia.idProceso = proceso.idProceso AND cirugia.idquirofano > 0 AND cirugia.status = \"1\"')\n \t\t->join('quirofano','cirugia.idQuirofano = quirofano.idQuirofano')\n \t\t->get('tipo_usuario')\n \t\t->result_array();\n }", "function envios_datos()\n\t{\n\n\t\tparent::objeto();\n\n\t\t$this->tabla=\"envios\";\n\t\t$this->campoClave=\"IdEnvio\";\n\t\t$this->id=null;\n\t\t\n\t\t\n$v=new Variable(2,$this->tabla,\"IdEnvio\",1);\n\t\t\t\n$v->clave=true;\n\t\t\t\n\t\t\t\n$v->autonumerica=true;\n\t\t\t\n$this->agregarVariable2($v);\n$v=new Variable(2,$this->tabla,\"IdMail\",2);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"Envio\",3);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"Descripcion\",4);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"TablaDatosExtras\",5);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"CondicionDatosExtras\",6);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"FechaCreacion\",7);\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"FechaModificacion\",8);\n$this->agregarVariable2($v);\n\n\t}", "public function loadFields()\n\t{\n\t\t// Get only the fields from the class instance, not its descendants\n\t\t$getFields = create_function('$obj', 'return get_object_vars($obj);');\n\t\t$fields = $getFields($this);\n\n\t\t// Field defaults\n\t\t$defaults = array(\n\t\t\t'primary' => false,\n\t\t\t'relation' => false\n\t\t);\n\n\t\t// Go through and set up each field\n\t\tforeach ($fields as $name => $options)\n\t\t{\n\t\t\t// Merge the defaults\n\t\t\t$options = array_merge($defaults, $options);\n\n\t\t\t// Is this the primary field?\n\t\t\tif ($options['primary'] === true)\n\t\t\t{\n\t\t\t\t$this->primaryKeyField = $name;\n\t\t\t}\n\n\t\t\t// Is this a relation?\n\t\t\tif ($options['relation'] !== false)\n\t\t\t{\n\t\t\t\t$this->relations[$name] = $options;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->fields[$name] = array();\n\t\t}\n\t}", "public function TemparioData(){\n\t\t$this->id = \"\"; \n\t\t$this->id_tempario = \"\";\n\t\t$this->descripcion = \"\";\n\t\t$this->tiempo = \"\";\n\t\n\t\t\n\t}", "function setParamsToSaveQuery()\n {\n \n \n if($this->form->getQuery())\n {\n $stringTmp=$this->form->getQuery()->getSqlQuery();\n $stringTmp=substr($stringTmp, strpos($stringTmp,' FROM ' ));\n $stringTmp=substr($stringTmp, 0, strpos($stringTmp,' LIMIT ' ));\n $this->getUser()->setAttribute('queryToSaveWhere', $stringTmp);\n }\n \n if($this->form->getQuery()->getParams())\n {\n $stringTmp=\"\";\n $arrayTmp=$this->form->getQuery()->getParams();\n if(isset($arrayTmp['where']))\n {\n foreach($arrayTmp['where'] as $key=>$value)\n {\n $stringTmp.=\";|\".$value.\"|\";\n }\n $this->getUser()->setAttribute('queryToSaveParams', $stringTmp);\n }\n }\n return;\n }", "function LoadDbValues(&$rs) {\n\t\tif (!$rs || !is_array($rs) && $rs->EOF) return;\n\t\t$row = is_array($rs) ? $rs : $rs->fields;\n\t\t$this->Id_Item->DbValue = $row['Id_Item'];\n\t\t$this->codigo_item->DbValue = $row['codigo_item'];\n\t\t$this->nombre_item->DbValue = $row['nombre_item'];\n\t\t$this->und_item->DbValue = $row['und_item'];\n\t\t$this->precio_item->DbValue = $row['precio_item'];\n\t\t$this->costo_item->DbValue = $row['costo_item'];\n\t\t$this->tipo_item->DbValue = $row['tipo_item'];\n\t\t$this->marca_item->DbValue = $row['marca_item'];\n\t\t$this->cod_marca_item->DbValue = $row['cod_marca_item'];\n\t\t$this->detalle_item->DbValue = $row['detalle_item'];\n\t\t$this->saldo_item->DbValue = $row['saldo_item'];\n\t\t$this->activo_item->DbValue = $row['activo_item'];\n\t\t$this->maneja_serial_item->DbValue = $row['maneja_serial_item'];\n\t\t$this->asignado_item->DbValue = $row['asignado_item'];\n\t\t$this->si_no_item->DbValue = $row['si_no_item'];\n\t\t$this->precio_old_item->DbValue = $row['precio_old_item'];\n\t\t$this->costo_old_item->DbValue = $row['costo_old_item'];\n\t\t$this->registra_item->DbValue = $row['registra_item'];\n\t\t$this->fecha_registro_item->DbValue = $row['fecha_registro_item'];\n\t\t$this->empresa_item->DbValue = $row['empresa_item'];\n\t}", "private function _prepareFields()\n\t{\n\t\t$result = [];\n\n\t\tforeach ($this->_fields as $field => $params) {\n\n\t\t\tif ($field == 'languageTable') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$tmp = '`' . $field . '` ' . $params['type'];\n\n\t\t\tif (in_array($params['type'], ['char', 'varchar'])) {\n\t\t\t\t$length = isset($params['length']) ? $params['length'] : 100;\n\t\t\t\t$tmp .= '(' . $length . ')';\n\t\t\t}\n\n\t\t\t$tmp .= ($params['null']) ? ' NULL' : ' NOT NULL';\n\t\t\t$tmp .= ($params['default'] || $params['default'] === 0) ? ' DEFAULT ' . $params['default'] : '';\n\n\n\t\t\tif ($field == 'id') {\n\t\t\t\t$tmp .= ' AUTO_INCREMENT PRIMARY KEY';\n\t\t\t}\n\n\t\t\t$result[] = $tmp;\n\t\t}\n\n\t\treturn implode(',', $result);\n\t}", "function asignar_valores(){\n\t\t$this->codigo=$_POST['codigo'];\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->marca=$_POST['marca'];\n\t\t$this->fecha=$_POST['fecha'];\n\t\t$this->categoria=$_POST['categoria'];\n\t\t$this->hotel=$_POST['hoteles'];\n\t\t$this->cantidad=$_POST['cantidad'];\n\t\t$this->lugar=$_POST['lugar'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->detal=$_POST['detal'];\n\t\t$this->mayor=$_POST['mayor'];\n\t\t$this->limite=$_POST['limite'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t\t$this->claves=$_POST['claves'];\n\t\t$this->segmento=$_POST['segmento'];\n\t\t$this->principal=$_POST['principal'];\n\t\t\n\t\t\n\t}", "public function readAll(){\n //select all data\n $query = \"SELECT\n id, num_compte, cle_rib, num_agence, duree_epargne, frais, solde, created\n FROM\n \" . $this->table_name . \"\n ORDER BY\n num_compte\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "function setColeccion() {\n $this->query = \"SELECT * FROM PROFESOR\";\n $this->datos = BDConexionSistema::getInstancia()->query($this->query);\n\n for ($x = 0; $x < $this->datos->num_rows; $x++) {\n $this->addElemento($this->datos->fetch_object(\"Profesor\"));\n }\n }", "private function prepare()\n {\n $this->selectFields[$this->tableName][] = $this->rootEntityIdentifier;\n\n $sColumns = explode(',', $this->requestParams['sColumns']);\n\n for ($i = 0; $i < $this->iColumns; $i++) {\n\n if ($this->requestParams['mDataProp_' . $i] != null) {\n\n $field = $this->requestParams['mDataProp_' . $i];\n\n if ($sColumns[$i] != '') {\n if ($field != $sColumns[$i]) {\n $field = $sColumns[$i];\n }\n }\n\n // association delimiter found\n if (strstr($field, '.') !== false) {\n\n // separate fields\n $fieldsArray = explode('.', $field);\n // set associations in selectFields[]\n $this->setAssociations($fieldsArray, 0, $this->metadata);\n\n } else {\n\n // no association found\n if ($field !== $this->rootEntityIdentifier) {\n array_push($this->selectFields[$this->tableName], $field);\n }\n\n $this->allFields[] = $this->tableName . '.' . $field;\n\n }\n\n } else {\n\n $this->allFields[] = '';\n\n }\n }\n\n return $this;\n }" ]
[ "0.6947466", "0.66658026", "0.6479266", "0.63830566", "0.630348", "0.62740916", "0.6259464", "0.6240629", "0.6193093", "0.618637", "0.61638695", "0.61525714", "0.6143584", "0.61424536", "0.6117064", "0.60997313", "0.6096213", "0.604814", "0.59918755", "0.595419", "0.5934333", "0.59304935", "0.59245634", "0.5914815", "0.5907261", "0.59071493", "0.5901821", "0.5897677", "0.58923405", "0.589102", "0.58845985", "0.5878746", "0.58713067", "0.58624744", "0.5851511", "0.5847428", "0.5827018", "0.5824842", "0.5815859", "0.57844764", "0.5781612", "0.57797825", "0.5756775", "0.57564193", "0.57469803", "0.57460713", "0.5734025", "0.5723455", "0.57103425", "0.5708499", "0.57040995", "0.5704074", "0.5703344", "0.57020396", "0.56968796", "0.56906104", "0.56851935", "0.5684453", "0.5684453", "0.5661905", "0.56552887", "0.56501865", "0.5649982", "0.5640607", "0.56385857", "0.5624286", "0.5606865", "0.5602849", "0.5602493", "0.5591067", "0.5585623", "0.55837536", "0.55820125", "0.5578611", "0.5570924", "0.55667174", "0.5566214", "0.5548357", "0.5546915", "0.5537883", "0.5532321", "0.5527982", "0.5524328", "0.5515063", "0.550955", "0.5503189", "0.5496723", "0.54955304", "0.5494894", "0.54921776", "0.548933", "0.5488644", "0.5487207", "0.5481034", "0.5477005", "0.5470722", "0.54697657", "0.546225", "0.54613036", "0.54533994", "0.5450664" ]
0.0
-1
Inserta los datos en la db
public function setIdea(){ $query="INSERT INTO idea (nombre_idea, id_categoria, fecha_limite, desc_idea, enVenta, id_correo, importe_venta, cv_equipo, importe_solicitado, imagen) VALUES('".$this->getNombre_Idea()."', '".$this->getId_Categoria()."', '".$this->getFecha_Limite()."', '".$this->getDesc_idea()."', '".$this->getEnVenta()."', '".$this->getId_Correo()."', '".$this->getImporte_Venta()."', '".$this->getCv_Equipo()."', '".$this->getImporte_solicitado()."', '".$this->getImagen()."');"; if($this->db()->query($query) == false) throw new Exception('MySQL: Error al realizar la inserción SQL. setIdea()'); $query="UPDATE idea SET enVenta = NULL WHERE idea.enVenta=0"; if($this->db()->query($query) == false) throw new Exception('MySQL: Error al realizar la inserción SQL. Update'); $query="UPDATE idea SET importe_venta = NULL WHERE idea.importe_venta=0"; if($this->db()->query($query) == false) throw new Exception('MySQL: Error al realizar la inserción SQL. Update'); //Consigue el ID de la BBDD $query = $this->getBy('nombre_idea', $this->getNombre_Idea()); $this->setId_idea($query[0]['id_idea']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insert() {\n $conexion = StorianDB::connectDB();\n $insercion = \"INSERT INTO cuento (titulo, contenido, autor) VALUES (\\\"\".$this->titulo.\"\\\", \\\"\".$this->contenido.\"\\\", \\\"\".$this->autor.\"\\\")\";\n $conexion->exec($insercion);\n }", "public function insertDatabase();", "public function insert(){\n $bd = Database::getInstance();\n $bd->query(\"INSERT INTO canciones(artista, ncancion, idGen, album) VALUES (:art, :nca, :gen, :alb);\",\n [\":art\"=>$this->artista,\n \":gen\"=>$this->idGen,\n \":alb\"=>$this->album,\n \":nca\"=>$this->ncancion]);\n }", "public function insert()\n {\n $db = new Database();\n $db->insert(\n \"INSERT INTO position (poste) VALUES ( ? )\",\n [$this->poste]\n );\n }", "private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\n }", "public function Insert(){\n //Instancia conexao com o PDO\n $pdo = Conecta::getPdo();\n //Cria o sql passa os parametros e etc\n $sql = \"INSERT INTO $this->table (idcidade, cidade) VALUES (?, ?)\";\n $consulta = $pdo->prepare($sql);\n $consulta ->bindValue(1, $this->getIdCidade());\n $consulta ->bindValue(2, $this->getCidade());\n $consulta ->execute();\n $last = $pdo->lastInsertId();\n }", "public function insert($datos_){\n $id=$datos_->getId();\n$nombre_proyecto=$datos_->getNombre_proyecto();\n$nombre_actividad=$datos_->getNombre_actividad();\n$modalidad_participacion=$datos_->getModalidad_participacion();\n$responsable=$datos_->getResponsable();\n$fecha_realizacion=$datos_->getFecha_realizacion();\n$producto=$datos_->getProducto();\n$semillero_id=$datos_->getSemillero_id()->getId();\n\n try {\n $sql= \"INSERT INTO `datos_`( `id`, `nombre_proyecto`, `nombre_actividad`, `modalidad_participacion`, `responsable`, `fecha_realizacion`, `producto`, `semillero_id`)\"\n .\"VALUES ('$id','$nombre_proyecto','$nombre_actividad','$modalidad_participacion','$responsable','$fecha_realizacion','$producto','$semillero_id')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "public function Insertar($datos){\n\t\t\t#1. Convertir de array a Datos\n\t\t\t#2. Crear el SQL\n\n\t\t}", "public function insertarDatosSQL(){\n $this->comentario->insertarComentario(\n \t$this->idUser,\n \t$this->date,\n \t$this->comentarioText,\n \t$this->producto);\n }", "public function inserirDados()\n\t\t{\n\t\t\t$insertIdoso = \"INSERT INTO idoso(logradouro,\n\t\t\t\t\t\t\t\t\t\ttipo_logradouro,\n\t\t\t\t\t\t\t\t\t\tnumero,\n\t\t\t\t\t\t\t\t\t\tcomplemento,\n\t\t\t\t\t\t\t\t\t\tbaiiro,\n\t\t\t\t\t\t\t\t\t\tcidade,\n\t\t\t\t\t\t\t\t\t\tuf,\n\t\t\t\t\t\t\t\t\t\tusuario_id_usuario)\n\t\t\t\t\t\t\t\tVALUES(:logradouro,\n\t\t\t\t\t\t\t\t\t\t:tipo_logradouro,\n\t\t\t\t\t\t\t\t\t\t:numero,\n\t\t\t\t\t\t\t\t\t\t:complemento,\n\t\t\t\t\t\t\t\t\t\t:baiiro,\n\t\t\t\t\t\t\t\t\t\t:cidade,\n\t\t\t\t\t\t\t\t\t\t:uf,\n\t\t\t\t\t\t\t\t\t\t:usuario_id_usuario)\";\n\n\t\t\t$stmt->pdo->prepare($insertIdoso);\n\t\t\t$stmt->bindParam(':logradouro', $this->logradouro);\n\t\t\t$stmt->bindParam(':tipo_logradouro', $this->tipo_logradouro);\n\t\t\t$stmt->bindParam(':numero', $this->numero);\n\t\t\t$stmt->bindParam(':complemento', $this->complemento);\n\t\t\t$stmt->bindParam(':bairro', $this->baiiro);\n\t\t\t$stmt->bindParam(':cidade', $this->cidade);\n\t\t\t$stmt->bindParam(':uf', $this->uf);\n\t\t\t$stmt->bindParam(':usuario_id_usuario', $this->buscarTodosDados());\n\n\t\t\tif($stmt->execute()) {\n\t\t\t\theader(\"Location: localhost:8001/contato\");\n\t\t\t} else {\n\t\t\t\tdie('Erro ao cadastrar');\n\t\t\t}\n\t\t}", "public function persist (){\n \n $this->query = \"INSERT INTO libros(titulo,autor,editorial) VALUES (:titulo, :autor, :editorial)\";\n\n // $this->parametros['id']=$user_data[\"id\"];\n $this->parametros['titulo']=$this->titulo;\n $this->parametros['autor']=$this->autor;\n $this->parametros['editorial']=$this->editorial;\n \n $this->get_results_from_query();\n\n\n $this->mensaje = \"Libro agregado exitosamente\";\n \n }", "public function insert(){\n\t\t$sql = new Sql();\n\t\t$results = $sql->select(\"CALL sp_insert_usuario(:LOGIN, :PASS)\", array(\n\t\t\t':LOGIN'=>$this->getDeslogin(),\n\t\t\t':PASS'=>$this->getDessenha()\n\t\t));\n\n\t\tif (isset($results[0])) {\n\t\t\t\n\t\t\t$this->setData($results[0]);\n\n\t\t}\n\t}", "public function insert() {\n\t\t$db = self::getDB();\n\t\t$sql = \"INSERT INTO posts\n\t\t\t\t\t(nome, conteudo, fk_idUsuario, fk_idTopico)\n\t\t\t\tVALUES\n\t\t\t\t\t(:nome, :conteudo, :fk_idUsuario, :fk_idTopico)\";\n\t\t$query = $db->prepare($sql);\n\t\t$query->execute([\n\t\t\t':nome' => $this->getNome(),\n\t\t\t':conteudo' => $this->getConteudo(),\n\t\t\t':fk_idUsuario' => $this->getFkIdUsuario(),\n\t\t\t':fk_idTopico' => $this->getFkIdTopico()\n\t\t]);\n\t\t$this->idPost = $db->lastInsertId();\n\t}", "public function insert(){\n\t\tif(!mysql_query(\"INSERT INTO $this->tabla (nombre) VALUES ('$this->nombre')\")){\n\t\t\tthrow new Exception('Error insertando renglón');\n\t\t}\n\t}", "public function insert()\n {\n $sql = new Sql();\n $result = $sql->select(\"CALL sp_usuario_insert(:LOGIN, :PASSWORD)\", array(\n \":LOGIN\"=>$this->getDeslogin(),\n \":PASSWORD\"=>$this->getDessenha()\n ));\n\n if(count($result) > 0){\n $row = $result[0];\n $this->setIdusuario($row['idusuario']);\n $this->setDeslogin($row['deslogin']);\n $this->setDessenha($row['dessenha']);\n $this->setDataCadastro(new DateTime($row['dataCadastro']));\n }\n }", "public function insertarDataInicialEnSchema(){\n $sql = \"INSERT INTO moto_market.usuarios (usuario, password, email, nombre, apellido, ruta_avatar) VALUES ('Valen13', '$2y$10\\$qf6VYsFmsKP5jnbuMonYMeYkNXXDU1Rhz2FHS7ayYpO/82ATX/x5S', '[email protected]', 'Valentin', 'Mariño', 'C:\\xampp\\htdocs\\Prueba\\ProyectoConFuncionesAgregadas/images/perfiles/5b3dad65b6e90.jpg');\n INSERT INTO moto_market.usuarios (usuario, password, email, nombre, apellido, ruta_avatar) VALUES ('monty15', '$2y$10\\$rYwEXX3AjtZYYbWb9HjsT.V5sBiDmi3bb7ldCPbvqOhGdA8VRWJY6', '[email protected]', 'Monty', 'Hola', 'C:\\xampp\\htdocs\\Prueba\\ProyectoConFuncionesAgregadas/images/perfiles/5b3dad959ec8b.jpg');\";\n\n $this->db->prepare($sql)->execute();\n }", "public function insert() {\r\n // Rôle : insérer l'objet courant dans la base de données\r\n // Retour : true / false\r\n // Paramètre : aucun\r\n \r\n // Vérification de l'id\r\n if (!empty($this->getId())) {\r\n debug(get_class($this).\"->insert() : l'objet courant a déjà un id\");\r\n return false;\r\n }\r\n \r\n // Construction de la requête\r\n $sql = \"INSERT INTO `\".$this->getTable().\"` SET \";\r\n $param = [];\r\n $start = true;\r\n \r\n foreach ($this->getChamps() as $nom => $champs) {\r\n if ($nom === $this->getPrimaryKey() or !$champs->getAttribut(\"inBdd\")) {\r\n continue;\r\n }\r\n if ($start) {\r\n $sql .= \"`$nom` = :$nom\";\r\n $start = false;\r\n } else {\r\n $sql .= \", `$nom` = :$nom\";\r\n }\r\n \r\n $param[\":$nom\"] = $champs->getValue();\r\n }\r\n \r\n $sql .= \";\";\r\n \r\n // Préparation de la requête\r\n $req = self::getBdd()->prepare($sql);\r\n \r\n // Exécution de la requête\r\n if (!$req->execute($param)) {\r\n debug(get_class($this).\"->insert() : échec de la requête $sql\");\r\n return false;\r\n }\r\n \r\n // Assignation de l'id\r\n if ($req->rowCount() === 1) {\r\n $this->set($this->getPrimaryKey(), self::getBdd()->lastInsertId());\r\n return true;\r\n } else {\r\n debug(get_class($this).\"->insert() : aucune entrée, ou bien plus d'une entrée, créée\");\r\n return false;\r\n }\r\n }", "public function insert($titulos){\n// $id=$titulos->getId();\n$descripcion=$titulos->getDescripcion();\n$universidad_id=$titulos->getUniversidad_id();\n$docente_id=$titulos->getDocente_id()->getId();\n\n try {\n $sql= \"INSERT INTO `titulos`( `descripcion`, `universidad`, `docente_id`)\"\n .\"VALUES ('$descripcion','$universidad_id','$docente_id')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "public function insert(array $dados): void\n {\n $this->db->insert($this->table, $dados);\n }", "public function insert($data);", "public function insertar(){\n $mysqli = new mysqli(Config::BBDD_HOST, Config::BBDD_USUARIO, Config::BBDD_CLAVE, Config::BBDD_NOMBRE);\n //Arma la query\n $sql = \"INSERT INTO tipo_domicilios ( \n tipo,\n nombre\n ) VALUES (\n '\" . $this->tipo .\"', \n '\" . $this->nombre .\"'\n );\";\n //Ejecuta la query\n if (!$mysqli->query($sql)) {\n printf(\"Error en query: %s\\n\", $mysqli->error . \" \" . $sql);\n }\n //Obtiene el id generado por la inserción\n $this->idtipo = $mysqli->insert_id;\n //Cierra la conexión\n $mysqli->close();\n }", "public function insert($contenido);", "function insert_db($campos, $valores, $tab) {\n\t\t$inicio = \"INSERT INTO $tab(\";\n\t\t$meio = \") VALUES (\";\n\t\t$fim = \")\";\n\t\t$valor = sizeof($campos);\n\t\t//verifica el numero de elementos de un array\n\t\t$strc = \"\";\n\t\tfor($i = 0; $i <= ($valor - 1); $i++) {\n\t\t\t$strc .= \"$campos[$i]\";\n\t\t\tif($i != ($valor - 1)) {\n\t\t\t\t$strc .= \",\";\n\t\t\t}\n\t\t}\n\t\t$strv = \"\";\n\t\tfor($k = 0; $k <= ($valor - 1); $k++) {\n\t\t\t$strv .= \"\\\"$valores[$k]\\\"\";\n\t\t\tif($k != ($valor - 1)) {\n\t\t\t\t$strv .= \",\";\n\t\t\t}\n\t\t}\n\t\t$insere = \"$inicio$strc$meio$strv$fim\";\n\t\t$this -> query_db($insere);\n\t}", "public function insert($tarConvenio);", "public function insertar($data){\n\t\t\t$this->db->insert('tareas',array(\n\t\t\t\t'titulo'=>$data['titulo'],\n\t\t\t\t'descripcion'=>$data['descripcion'],\n\t\t\t\t'id_estado'=>1,\n\t\t\t\t'fecha_alta'=>date('Y-m-d H:i:s'),\n\t\t\t\t'fecha_modificacion'=>date('Y-m-d H:i:s'),\n\t\t\t\t'fecha_baja'=>null\n\t\t\t\t)\n\t\t\t);\n\t\t}", "function insertar($bd);", "public function insertDb(){\r\n\t\t\t$User_nom = addslashes($this -> getNom()) ;\r\n\t\t\t$User_prenom = addslashes($this -> getPrenom()) ;\r\n\t\t\t$User_pseudo = addslashes($this -> getPseudo());\r\n\t\t\t$User_pw = $this -> getPw();\r\n\t\t\t$User_email = addslashes($this -> getEmail());\r\n\t\t\t$VilleId = addslashes($this -> getVilleId()) ;\r\n\t\t\t$User_tel = addslashes($this -> getTel()) ;\r\n\t\t\t$Date_ins = $this -> getDateIns();\r\n\t\t\t$Date_modif = $this -> getDateModif();\r\n\t\t\t$VilleId = $this -> getVilleId();\r\n $User_nletter = $this -> getNLetter() ;\r\n $User_etat = $this -> getEtat();\r\n $nb = $this -> getNbNegativeUsers();\r\n $User_inscrit = $this -> getInscrit();//Ce user refuse de s'inscrire\r\n\t\t\tif(!empty($User_pseudo) && !empty($User_email) && !empty($User_tel)){//Si les champs obligatoires sont renseignes\r\n\t\t\t\t$query = \"insert into UserTab values(\".\r\n\t\t\t\t \"UserId,\".\r\n\t\t\t\t \"$VilleId,\".\r\n\t\t\t\t\t \"'\".$User_pseudo.\"',\".\r\n\t\t\t\t \"'\".$User_nom.\"',\". \r\n\t\t\t\t \"'\".$User_prenom.\"',\". \r\n\t\t\t\t \"'\".$Date_ins.\"',\".\t\t \r\n\t\t\t\t \"'\".$Date_modif.\"',\".\t\r\n\t\t\t\t \"'\".$User_email.\"',\". \r\n\t\t\t\t \"'\".$User_tel.\"',\".\r\n\t\t\t\t\t \"password(\\\"\".$User_pw.\"\\\"),\". //fonction password de MySQL crypte une chaine de caractere.\r\n\t\t\t\t\t\t\t\t // J'utilise \\\" pour tenir compte des caracteres speciaux de MySQL tel que \"'\" , \"*\" , etc \r\n\t\t\t\t $User_nletter .\",\".\r\n $User_etat.\",\".\r\n $User_inscrit.\r\n\t\t\t\t \")\";\r\n\r\n\t\t\t\t/*** Execution de la requete preparer ***/\r\n\t\t $r = execute($query);\r\n if($User_nletter == 1 ){//On insere son mail dans NewsLetterTab si ce user a accepter de recevoir les anonces\r\n $res = execute(\"insert into NewsLetterTab values(NewsLetterId , '$User_email')\");\r\n }\r\n\r\n\r\n\t\t\t\t/*** Recupere l'autoincrement pour l'UserId de cet UserTab ***/\r\n\t\t\t\t$User_nomtable = 'UserTab';\r\n\t\t $id = getAutoIncrementValue($User_nomtable);\r\n\t\t $this -> setUserId($id);\r\n\t\t\t}\r\n\r\n\r\n }", "public function cadastrar(){\r\n //DEFINIR A DATA DE CADASTRO\r\n $this->cadastro = date('Y-m-d H:i:s');\r\n\r\n $db = new Database('cartao');\r\n $this->id = $db->insert([\r\n 'bandeira' => $this->bandeira,\r\n 'numero' => $this->numero,\r\n 'doador' => $this->doador,\r\n ]);\r\n\r\n }", "function insertarEnBd(){\n\t/* Conexion con base de datos. */\n\t$conexion = new PDO('mysql:host=localhost;dbname=tarea02;charset=UTF8', 'root', '');\n $conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n \n\t/* Se define la consulta SQL */\n\t$consulta = \"INSERT INTO alumno (matricula,nombre,carrera,email,telefono) VALUES (\";\n\t$consulta .= \"'.$this->matricula.','$this->nombre','$this->carrera','$this->email','$this->telefono');\";\n\t\n\t/* Se efectúa la consulta. */\n\t$conexion->exec($consulta);\n\n}", "public function inserir()\n {\n }", "function insere_db($campos,$valores,$tabela) {\n\t$inicio=\"INSERT INTO $tabela(\";\n\t$meio=\") VALUES (\";\n\t$fim=\")\";\n\t$valor = sizeof($campos);\n\t$strc=\"\";\n\tfor($i=0;$i <= ($valor-1);$i++){\n\t\t$strc.=\"$campos[$i]\";\n\t\tif($i != ($valor-1)){\n\t\t $strc.=\",\";\n\t\t}\n\t }\n\t$strv=\"\";\n\tfor($k=0;$k <= ($valor-1);$k++){\n\t\t$strv.=\"\\\"$valores[$k]\\\"\";\n\t\tif($k != ($valor-1)){\n\t\t $strv.=\",\";\n\t\t}\n\t }\n\t$insere=\"$inicio$strc$meio$strv$fim\";\n\t//echo $insere;\n\t$foi = consulta_db($insere);\n\treturn $foi;\n}", "function inserirAgencia(){\n\n $banco = abrirBanco();\n //declarando as variáveis usadas na inserção dos dados\n $nomeAgencia = $_POST[\"nomeAgencia\"];\n $cidadeAgencia = $_POST[\"cidadeAgencia\"];\n\n //a consulta sql\n $sql = \"INSERT INTO Agencias(nomeAgencia,cidadeAgencia) VALUES ('$nomeAgencia','$cidadeAgencia')\";\n \n //executando a inclusão\n $banco->query($sql);\n //fechando a conexao com o banco\n $banco->close();\n voltarIndex();\n\n }", "function insert($table, $insertNames, $values) {\n for($i = 0; $i < count($values); $i++) {\n $values[$i] = htmlspecialchars($values[$i]);\n }\n\n \n /**Kontrola stringu */\n if(!is_string($table)) {\n throw new Exception(\"Tabulka musí být string.\");\n }\n /**Kontorla poli */\n else if(!is_array($insertNames) || !is_array($values)) {\n throw new Exception(\"Hodnota musí být ve formátu pole.\");\n }\n /**Kontrola poctu nazvu atribtu s novymi hodnotami */\n else if(count($insertNames) !== count($values)){\n throw new Exception(\"Hodnoty se musí rovnat.\");\n }\n\n /**Pripojeni k databazi */\n $connect = NULL;\n try {\n $connect = require(\"connect.php\");\n }catch(Exception $e) {\n throw $e;\n }\n /**Formatovani a kontrola SQL utoku */\n $insertNames = implode(',', $insertNames);\n $value = '';\n for($i = 0; $i<count($values)-1; $i++) {\n $value .= '?,';\n }\n $value .= '?';\n /**Formatovani metody */\n $statement = $connect->prepare('INSERT INTO ' .$table .'('.$insertNames.') VALUES (' .$value.')');\n\n if(!$statement->execute($values)){\n throw new Exception(\"Chyba při INSERT dotazu\");\n }\n}", "public function insert($actividades_fuera);", "public function insert($otros_votos);", "function inserir($tabela,$dados)\n\t{\n\t\t$this->conectar();\n\t\t$this->sql=\"\";\n\t\t\n\t\t// Dividimos o Array dentro de $dados em Chaves e Valores\n\t\t$campos = array_keys($dados);\n\t\t$valores = array_values($dados);\n\t\t\n\t\t//Executamos a Query \n\t\t$this->sql = \"INSERT INTO \".$tabela.\" (\".implode(', ', $campos).\") VALUES ('\" . implode('\\', \\'', $valores) . \"')\";\n\t\t\n\t\t//Verificamos se a Query foi executada corretamente\n\t\n\t\t\n\t\t$this->query = mysqli_query($this->conectar(),$this->sql) or die ($this->erro($this->sql));\n\t}", "private function addData ()\n {\n foreach ($this->data as $key=>$value)\n {\n $keys[] = $key;\n $values[] = $value;\n \n }\n $cols = implode($keys, \",\");\n $dataValues = \"'\".implode($values, \"','\").\"'\";\n $query = \"INSERT INTO `$this->tablename`($cols)VALUES($dataValues);\";\n \n $conn = $this->DB->conn;\n \n $sql = $conn->query($query);\n \n if($sql == TRUE) return TRUE;\n else \n {\n \n throw new Exception(\"Error : Data Not inserted to database :( \".$conn->error);\n \n }\n \n }", "public function insert() {\n $sql = \"INSERT INTO contratos (numero_contrato, objeto_contrato, presupuesto, fecha_estimada_finalizacion)\n VALUES (:numero_contrato, :objeto_contrato, :presupuesto, :fecha_estimada_finalizacion)\";\n $args = array(\n \":numero_contrato\" => $this->numeroContrato,\n \":objeto_contrato\" => $this->objetoContrato,\n \":presupuesto\" => $this->presupuesto,\n \":fecha_estimada_finalizacion\" => $this->fechaEstimadaFinalizacion,\n );\n $stmt = $this->executeQuery($sql, $args);\n\n if ($stmt) {\n $this->id = $this->getConnection()->lastInsertId();\n }\n\n return !$stmt ? false : true;\n }", "function inserir() {\n\t\t$this->sql = mysql_query(\"INSERT INTO suporte (user_cad, data_cad, id_regiao, exibicao, tipo, prioridade, assunto, mensagem, arquivo, status, status_reg,suporte_pagina)\n\t\t\t\t\t VALUES\t('$this->id_user_cad ','$this->data_cad','$this->id_regiao', '$this->exibicao', '$this->tipo','$this->prioridade', '$this->assunto', '$this->menssagem', '$this->tipo_arquivo','1','1','$this->pagina');\") or die(mysql_error());\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\n\t\t}", "public function insert($producto);", "public function insert($perifericos);", "function insert($bd,$data){\n$data_one = \"\";\n$data_two = \"\";\n$contador = count($data);\n$i = 1;\nforeach ($data as $key => $value) {\n\t\tif($i < $contador){\n\t\t\t$data_one .= $key.\",\";\n\t\t\t$data_two .= \":\".$key.\",\";\n\t\t}else{\n\t\t\t$data_one .= $key;\n\t\t\t$data_two .= \":\".$key;\n\t\t}\n\t\t$i++;\n}\n $sql = \"INSERT INTO \".$bd.\" (\".$data_one.\") VALUES (\".$data_two.\")\";\n$conexion = new ConexionOther();\n$stmt= $conexion->prepare($sql);\n$dato = $stmt->execute($data);\n//$stmt = null;\nreturn $dato;\n}", "function insertarEnBd(){\n $conexion = new PDO('mysql:host=localhost;dbname=tarea02;charset=UTF8', 'root', '');\n $conexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n \n /* Se define la consulta SQL */\n $consulta = \"INSERT INTO maestro (noEmpleado,carrera,nombre,telefono) VALUES (\";\n $consulta .= \"'$this->noEmpleado','$this->carrera','$this->nombre','$this->telefono');\";\n \n /* Se efectúa la consulta. */\n $conexion->exec($consulta);\n\n}", "public function insert($datos){\r\n try{\r\n $query = $this->db->connect()->prepare('INSERT INTO PRODUCTO (ID_PRODUCTO, NOMBRE, DESCRIPCION, PRECIO, FOTO, STOCK, CATEGORIA) VALUES(:id_producto, :nombre, :descripcion,:precio, :foto, :stock, :categoria)');\r\n $query->execute(['id_producto' => $datos['id_producto'], 'nombre' => $datos['nombre'], 'descripcion' => $datos['descripcion'], 'precio' => $datos['precio'], 'foto' => $datos['foto'], 'stock' => $datos['stock'], 'categoria' => $datos['categoria']]);\r\n return true;\r\n }catch(PDOException $e){\r\n //echo $e->getMessage();\r\n //echo \"Ya existe esa matrícula\";\r\n return false;\r\n }\r\n \r\n }", "function insertarFase(){\n global $conexion, $data;\n $title = '{\"en\": \"'.$data[\"title\"].'\", \"es\":\"'.$data[\"title\"].'\"}';\n $description = '{\"en\": \"'.$data[\"description\"].'\", \"es\":\"'.$data[\"description\"].'\"}';\n $start_date = $data[\"start_date\"];\n $end_date = $data[\"end_date\"];\n $procces_id = $data[\"proceso_id\"];\n $created_at = $data[\"created_at\"];\n $updated_at = $data[\"updated_at\"];\n $active = $data[\"active\"];\n $position = $data[\"position\"];\n $resultado = pg_query($conexion, \"INSERT INTO decidim_participatory_process_steps (title, description, start_date, end_date, decidim_participatory_process_id, created_at, updated_at, active, position) VALUES ('$title', '$description', '$start_date', '$end_date', '$procces_id', '$created_at', '$updated_at', '$active', '$position') RETURNING id \");\n validarErrorPG($resultado);\n }", "public function inserir() {\n $query = '\n insert into tb_atividade(\n id_evento, nome, qntd_part, inscricao, valor, tipo, carga_hr, data_inicio, data_fim\n ) values ( \n :id_evento, \n :nome, \n :qntd_part, \n :inscricao, \n :valor, \n :tipo, \n :carga_hr, \n :data_inicio, \n :data_fim\n )';\n\n $stmt = $this->conexao->prepare($query);\n $stmt->bindValue(':id_evento', $this->atividade->__get('id_evento'));\n $stmt->bindValue(':nome', $this->atividade->__get('nome'));\n $stmt->bindValue(':qntd_part', $this->atividade->__get('qntd_part'));\n $stmt->bindValue(':inscricao', $this->atividade->__get('inscricao'));\n $stmt->bindValue(':valor', $this->atividade->__get('valor'));\n $stmt->bindValue(':tipo', $this->atividade->__get('tipo'));\n $stmt->bindValue(':carga_hr', $this->atividade->__get('carga_hr'));\n $stmt->bindValue(':data_inicio', $this->atividade->__get('data_inicio'));\n $stmt->bindValue(':data_fim', $this->atividade->__get('data_fim'));\n\n return $stmt->execute();\n }", "public function insert(){\n\t\t$parametro = func_get_args();\n\t\t$resultado = $this->execSql($this->INSERT,$parametro);\n//\t\t\tdie();\n\t\tif(!$resultado){\n\t\t\t$this->onError(\"COD_INSERT\",$this->INSERT);\n\t\t}\n\t\treturn $resultado;\n\t}", "function insertData($table, $data){\n\t\t\n\t\tvalidate();\n\n\t\t$values = $cols = \"\";\n\n\t\tforeach ($data as $key => $value) {\n\t\t\t$cols .= \" \" . $key . \",\";\n\t\t\t$values .= \" \" . $value . \",\";\n\t\t}\n\n\t\t$cols = substr($cols, 0, strlen($cols) - 1);\n\t\t$values = substr($values, 0, strlen($values) - 1);\n\n\t\t$query = \"INSERT INTO $table ($cols) VALUES ($values)\";\n\n\t\t\n\t\ttry {\n\n\t\t\t$pdo = db_init();\n\n\t\t\t$pdo->exec($query);\n\n\t\t\treturn 1;\n\t\t} catch (PDOException $e) {\n\t\t\tlogging($_SERVER['PHP_SELF'] . \", 112, Error Insert Data:\". $e->getMessage() .\" ,\" . date(\"Y-m-d\") . \" \" . date(\"h:i:sa\"));\n\t\t\treturn;\n\t\t}\n\n\t}", "public function persist() {\n $bd = BD::getConexion();\n $sql = \"insert into usuarios (nombre, clave) values (:nombre, :clave)\";\n $sthSql = $bd->prepare($sqlInsertUsuario);\n $result = $sthSql->execute([\":nombre\" => $this->nombre, \":clave\" => $this->clave]);\n $this->id = (int) $bd->lastInsertId();\n }", "function insert(){\n\t\t\t$result = $this->consult();\n\t\t\tif(count($result) > 0){\n\t\t\t\t$this->form_data[\"id_paciente\"] = $result[0]->id_paciente;\n\t\t\t\t$this->id_paciente = $result[0]->id_paciente;\n\t\t\t\treturn $this->update();\n\t\t\t}\n\n\t\t\ttry{\n\t\t\t\t$this->db->trans_start();\n\t\t\t\t$this->db->insert('paciente', $this->form_data);\n\t\t\t\t$this->db->trans_complete();\n\t\t\t\treturn array(\"message\"=>\"ok\");\n\t\t\t} catch (Exception $e){\n\t\t\t\treturn array(\"message\"=>\"error\");\n\t\t\t}\n\t\t}", "public function insert($cotizacion);", "public function insererBD()\r\n {\r\n // Connexion à la base\r\n self::connexionBD();\r\n \r\n // Prépare la requête\r\n $requete = self::getBaseDeDonnees()->getCnxBD()->prepare(self::RQT_AJOUTER_UTIL);\r\n \r\n // Exécution de la requête avec les paramètres.\r\n return $requete->execute(array(\r\n ':login' => $this->login,\r\n ':mdp' => $this->mdp,\r\n ':email' => $this->email,\r\n ':type' => $this->type\r\n ));\r\n }", "public function insertData($table_name, $columns, $rows, PDO $pdo) {\n \n // create table in database\n $query_table = $pdo->prepare($this->createTable($table_name, $columns));\n\n if($query_table->execute() === false){\n throw new PDOException(\"Wystapił problem z baza danych. Dane nie zostały zapisane. \n Skontaktuj sie z administratorem\"); \n }\n \n $this->records = $rows;\n\n // insert data to database\n foreach ($this->records as $value) {\n\n\n $sql = \"INSERT INTO \".$table_name.\"(id, first_name, last_name, email, gender, country) \n VALUES (:id, :first_name, :last_name, :email, :gender, :country)\";\n \n $query = $pdo->prepare($sql);\n \n $query->bindParam(':id', $value['id']);\n $query->bindParam(':first_name', $value['first_name']);\n $query->bindParam(':last_name', $value['last_name']);\n $query->bindParam(':email', $value['email']);\n $query->bindParam(':gender', $value['gender']);\n $query->bindParam(':country', $value['country']);\n \n\n if($query->execute() === false){\n throw new PDOException(\"Wystapił problem z baza danych. Dane nie zostały zapisane. Skontaktuj sie z administratorem\");\n }\n\n }\n \n }", "public function insertIntoDatabase(PDO $db) {\n\t\tif (null===$this->getId()) {\n\t\t\t$stmt=self::prepareStatement($db,self::SQL_INSERT_AUTOINCREMENT);\n\t\t\t$stmt->bindValue(1,$this->getGenre());\n\t\t\t$stmt->bindValue(2,$this->getJaar());\n\t\t\t$stmt->bindValue(3,$this->getMaand());\n\t\t\t$stmt->bindValue(4,$this->getNummer());\n\t\t\t$stmt->bindValue(5,$this->getMutualiteit());\n\t\t\t$stmt->bindValue(6,$this->getFactuurdatum());\n\t\t\t$stmt->bindValue(7,$this->getFactuurFile());\n\t\t\t$stmt->bindValue(8,$this->getCreditActief());\n\t\t\t$stmt->bindValue(9,$this->getVervangt());\n\t\t} else {\n\t\t\t$stmt=self::prepareStatement($db,self::SQL_INSERT);\n\t\t\t$this->bindValues($stmt);\n\t\t}\n\t\t$affected=$stmt->execute();\n\t\tif (false===$affected) {\n\t\t\t$stmt->closeCursor();\n\t\t\tthrow new Exception($stmt->errorCode() . ':' . var_export($stmt->errorInfo(), true), 0);\n\t\t}\n\t\t$lastInsertId=$db->lastInsertId();\n\t\tif (false!==$lastInsertId) {\n\t\t\t$this->setId($lastInsertId);\n\t\t}\n\t\t$stmt->closeCursor();\n\t\t$this->notifyPristine();\n\t\treturn $affected;\n\t}", "function insert($tabla, $campos, $valores){\n #se forma la instruccion SQL\n $q = 'INSERT INTO '.$tabla.' ('.$campos.') VALUES ('.$valores.')';\necho $q;\n $resultado = $this->consulta($q);\n \n if($resultado) return true;\n else return false;\n}", "public function insertar($data){\n $stm = Conexion::conector()->prepare(\"INSERT INTO tareas VALUES(null,:A,:B)\");\n $stm->bindParam(\":A\",$data[\"nombre\"]); //definir q es A y de donde lo obtengo\n $stm->bindParam(\":B\",$data[\"descripcion\"]);\n return $stm->execute();\n }", "public function insert($tables,$data){\n $this->db->insert($tables,$data);\n }", "public function insert($tables,$data){\n $this->db->insert($tables,$data);\n }", "public function insert($tables,$data){\n $this->db->insert($tables,$data);\n }", "public function insertarProducto($datos){\n $con= new conectar();\n $conexion= $con->conexion();\n $sql= \"INSERT INTO producto(nombre, descripcion, imagen, codigo_categoria, stock, precio)\n values('$datos[0]','$datos[1]','$datos[2]','$datos[3]','$datos[4]','$datos[5]')\"; \n return $result= mysqli_query($conexion, $sql); \n }", "function insert() {\n\t\t$sql = \"INSERT INTO lessons\n\t\t\t\tVALUES (?, ?, ?, ?, ?)\";\n\t\t\n\t\t$this->db->query($sql, array($this->lessons_id, $this->name, $this->date, $this->active, $this->rank));\n\t\t$this->last_insert_id = $this->db->insert_id();\t\t\n\t\t\n\t}", "public function Save($dados){\n if($dados->id != '0')\n {\n $this->sqlStatement = \" UPDATE tbfornecedores SET \";\n $this->sqlStatement .= \" tx_cnpj = '{$dados->cnpj}' ,\n tx_empresa = '{$dados->nome}' ,\n tx_endereco_rua = '{$dados->rua}' ,\n tx_endereco_num = '{$dados->numero}' ,\n tx_endereco_bairro = '{$dados->bairro}' ,\n tx_endereco_uf = '{$dados->uf}' ,\n tx_endereco_cep = '{$dados->cep}' ,\n tx_ddd = '{$dados->ddd}' ,\n tx_telefone = '{$dados->telefone}' ,\n tx_ramal = '{$dados->ramal}' ,\n tx_site = '{$dados->site}' ,\n tx_roles = '{$dados->roles}' ,\n int_idusuario = {$dados->usuario} \";\n $this->sqlStatement .= \" WHERE int_idfornecedor = {$dados->id} \";\n }\n else\n {\n $this->valueID = $this->sequence->getSequence('tbfornecedores');\n $this->sqlStatement .= \" INSERT INTO tbfornecedores\n (\n int_idfornecedor,\n tx_cnpj, \n tx_empresa,\n tx_endereco_rua,\n tx_endereco_num,\n tx_endereco_bairro,\n tx_endereco_uf,\n tx_endereco_cep,\n tx_ddd,\n tx_telefone,\n tx_ramal,\n tx_site,\n tx_roles,\n int_idusuario\n )\";\n $this->sqlStatement .= \"VALUES\n (\n {$this->valueID},\n '{$dados->cnpj}',\n '{$dados->nome}',\n '{$dados->rua}',\n '{$dados->numero}',\n '{$dados->bairro}',\n '{$dados->uf}',\n '{$dados->cep}',\n '{$dados->ddd}',\n '{$dados->telefone}',\n '{$dados->ramal}',\n '{$dados->site}',\n '{$dados->roles}',\n {$dados->usuario}\n )\";\n }\n\n try{\n $this->dbInstance->Execute($this->sqlStatement,\"Save cotacao()\");\n }\n catch (Exception $e)\n {\n echo \"<b>Erro de query: </b>\" . $e -> getMessage() . \"\\n <b>Linha: </b>\" . $e -> getLine() . \"\\n\";\n exit;\n }\n return true;\n }", "public function insert($table, array $data);", "public function productosInsert($nombre, $preciounitario, $preciopaquete, $unidadesporpaquete, $unidadesenstock, $categoria, $proveedor,$foto)\n {\n $sql = \"INSERT INTO productos (nombreproducto,preciounitario,preciopaquete,unidadesporpaquete,unidadesenstock,idcategoria,idproveedor,foto) VALUES ('$nombre',$preciounitario,$preciopaquete,$unidadesporpaquete,$unidadesenstock,'$categoria','$proveedor','$foto')\";\n \nmysqli_query($this->open(), $sql) or die('Error. ' . mysqli_error($sql));\n $this->productosSelect();\n }", "public function Insertistorique() {\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n\n if (isset($_REQUEST['data'])) {\n $idSociete = $_REQUEST['data']['idSociete'];\n $idUser = $_REQUEST['data']['idUser'];\n $idObjet = $_REQUEST['data']['idObjet'];\n $typeHisto = $_REQUEST['data']['typeHisto'];\n $typeAction = $_REQUEST['data']['typeAction'];\n $data = $_REQUEST['data']['data'];\n $dateAction = $_REQUEST['data']['dateAction'];\n\n\n // Input validations\n if (!empty($idSociete)) {\n\n try {\n $sql = $this->db->prepare(\"INSERT INTO historique (idUser, idObjet, typeHisto, typeAction, data, dateAction, idSociete )\"\n . \"VALUES(:idUser, :idObjet, :typeHisto, :typeAction, :data, :dateAction, :idSociete)\");\n\n $sql->bindParam('idUser', $idUser, PDO::PARAM_INT);\n $sql->bindParam('idObjet', $idObjet, PDO::PARAM_STR);\n $sql->bindParam('typeHisto', $typeHisto, PDO::PARAM_STR);\n $sql->bindParam('typeAction', $typeAction, PDO::PARAM_INT);\n $sql->bindParam('data', $data, PDO::PARAM_STR);\n $sql->bindParam('dateAction', $dateAction, PDO::PARAM_STR);\n $sql->bindParam('idSociete', $idSociete, PDO::PARAM_INT);\n\n $sql->execute();\n\n if ($sql) {\n $success = array('status' => \"Success\", \"msg\" => \"Successfully inserted\");\n $this->response($this->json($success), 200);\n }\n } catch (Exception $ex) {\n $this->response('', $ex->getMessage()); // If no records \"No Content\" status\n }\n }\n }\n\n // If invalid inputs \"Bad Request\" status message and reason\n $error = array('status' => \"Failed\", \"msg\" => \"Invalid param\");\n $this->response($this->json($error), 400);\n }", "public function cadastrar()\n{\n //DEFINIR A DATA\n $this->data = date('Y-m-d H:i:s');\n\n //INSERIR A VAGA NO BANCO\n $obDatabase = new Database('vagas');\n $obDatabase->insert([\n 'titulo' => $this->titulo,\n 'descricao' => $this->descricao,\n 'ativo' => $this->ativo,\n 'data' => $this->data\n ]);\n //echo \"<pre>\"; print_r($obDatabase); echo \"</pre>\"; exit;\n\n\n //ATRIBUIR O ID DA VAGA NA INSTANCIA\n\n //RETORNAR SUCESSO\n}", "public function insert (array $datos = array()) {\n \n $resultado = null;\n try {\n $campos = \"\";\n $valores = \"VALUES (\";\n foreach ($datos as $key => $value) {\n if (!$campos == \"\") { \n $campos.=\",\"; \n $valores.=\",\"; \n };\n $campos.=$key;\n #$valores.=\" ?\";\n #$valores.=\"'\".$value.\"'\";\n $valores.=$value;\n }\n $valores.=\")\";\n $sql=\"INSERT INTO \".$this->_tabla.\" (\".$campos.\") \".$valores;\n #echo \"\\n\".$sql.\"\\n\";\n $stmt = $this->_getConnection()->prepare($sql);\n $i=0;\n foreach ($datos as $key => $value) {\n $stmt->bindValue(++$i, $value, PDO::PARAM_INPUT_OUTPUT );\n }\n $resultado = $stmt->execute();\n } catch (PDOException $e) {\n echo 'Problema de coneccion: ' . $e->getMessage() .\" : \". $sql.\"\\n\";\n throw $e;\n }\n return $resultado;\n }", "public function insert() {\n \n $sql = \"INSERT INTO $this->table(\"\n . \"tb_user_id,\"\n . \"tb_user_directors_id,\"\n . \"tb_boleto_venc_boleto,\"\n . \"tb_boleto_hash_boleto,\"\n . \"tb_boleto_hash_nfe,\"\n . \"tb_boleto_hash_sla,\"\n . \"tb_boleto_status_boleto,\"\n . \"tb_boleto_date,\"\n . \"tb_boleto_hour)\"\n . \"VALUES (?,?,?,?,?,?,?,?,?)\";\n \n $stmt = DB::prepare($sql);\n \n $stmt->bindParam(1, $this->tb_user_id);\n $stmt->bindParam(2, $this->tb_user_directors_id);\n $stmt->bindParam(3, $this->tb_boleto_venc_boleto);\n $stmt->bindParam(4, $this->tb_boleto_hash_boleto);\n $stmt->bindParam(5, $this->tb_boleto_hash_nfe);\n $stmt->bindParam(6, $this->tb_boleto_hash_sla);\n $stmt->bindParam(7, $this->tb_boleto_status_boleto);\n $stmt->bindParam(8, $this->tb_boleto_date);\n $stmt->bindParam(9, $this->tb_boleto_hour);\n \n $stmt->execute();\n }", "public function insert($table, $data)\n {\n\n ksort($data);\n\n $fieldNames = implode(',', array_keys($data));\n $fieldValues = ':'.implode(', :', array_keys($data));\n $query = \"INSERT INTO $table ($fieldNames) VALUES($fieldValues)\";\n\n $this->prepareQuery($query);\n\n foreach ($data as $key => $value) {\n $this->bind(\":$key\", $value);\n }\n $this->executeQuery($this->statement);\n }", "public function insert($fisicasuelo);", "public function insert($usuario_has_hojaruta);", "public function insertar(){\n $this -> conexion -> abrir();\n $this -> conexion -> ejecutar($this -> AdministradorDAO -> insertar());\n $res = $this -> conexion -> filasAfectadas();\n $this -> conexion -> cerrar();\n return $res;\n }", "protected function insert() {\n $dbh = $this->getDbh();\n $table = $this->tableName;\n $data = [];\n\n foreach ($this->fillable as $key => $value) {\n $data[$key] = $this->$key;\n }\n\n $query = 'INSERT INTO `' . $table . '` VALUES (NULL,';\n $first = true;\n foreach ($data AS $k => $value) {\n if (!$first)\n $query .= ', ';\n else\n $first = false;\n $query .= ':'.$k;\n }\n $query .= ')';\n\n $msc = microtime(true);\n\n $sth = $dbh->prepare($query);\n $sth->execute($data);\n\n $msc = microtime(true) - $msc;\n $line = \"insert() => \" . $query . \" with \" . implode(\"', '\", $data);\n $this->writeRequestLog($line, $msc);\n\n return true;\n }", "public function insert()\n {\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $columlList = \" (\";\n $valuelList = \" (\";\n foreach ($this->attributes as $column => $value) {\n $columlList .= $column . \", \";\n $valuelList .= \":\".$column . \", \";\n }\n $columlList = str_last_replace(\", \", \")\", $columlList);\n $valuelList = str_last_replace(\", \", \")\", $valuelList);\n $sqlQuery = \"INSERT INTO \" . $this->table . $columlList . \" VALUES\" . $valuelList;\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n #println($sqlQuery, \"blue\");\n }\n }", "public function insertar(){\n $pdo=Conexion::conectar();\n $sentencia = $pdo->prepare(\"INSERT INTO empleado (id, nombre, apellido,direccion,telefono,email,estado,firma,jefe,id_cargo,id_departamento) VALUES (:id, :nombre, :apellido,:direccion,:telefono,:email,:estado,:firma,:jefe,:id_cargo,:id_departamento)\");\n $sentencia->bindParam(':id', $id);\n $sentencia->bindParam(':nombre', $nombre);\n $sentencia->bindParam(':apellido', $apellido);\n $sentencia->bindParam(':direccion', $direccion);\n $sentencia->bindParam(':telefono', $telefono);\n $sentencia->bindParam(':email', $email);\n $sentencia->bindParam(':estado', $estado);\n $sentencia->bindParam(':firma', $firma);\n $sentencia->bindParam(':jefe', $jefe);\n $sentencia->bindParam(':id_cargo', $id_cargo);\n $sentencia->bindParam(':id_departamento', $id_departamento);\n \n // estos los valores de los input\n $id=\"0700950454\";\n $nombre=\"aaa\";\n $apellido=\"ssss\";\n $direccion=\"sss\";\n $telefono=23323232;\n $email=\"[email protected]\";\n $estado=1;\n $firma=\"NULL\";\n $jefe=\"0706430980\";\n $id_cargo=3;\n $id_departamento=16;\n $sentencia->execute();\n \n \n //CUANDO NO TIENE JEFE--=EL EMPLEADO ES JEFE (NO ENVIAR EL PARAMETRO JEFE,LA BDD AUTOMTICAMENTE PONE NULL)\n $pdo=Conexion::conectar();\n $sentencia = $pdo->prepare(\"INSERT INTO empleado (id, nombre, apellido,direccion,telefono,email,estado,firma,id_cargo,id_departamento) VALUES (:id, :nombre, :apellido,:direccion,:telefono,:email,:estado,:firma,:id_cargo,:id_departamento)\");\n $sentencia->bindParam(':id', $id);\n $sentencia->bindParam(':nombre', $nombre);\n $sentencia->bindParam(':apellido', $apellido);\n $sentencia->bindParam(':direccion', $direccion);\n $sentencia->bindParam(':telefono', $telefono);\n $sentencia->bindParam(':email', $email);\n $sentencia->bindParam(':estado', $estado);\n $sentencia->bindParam(':firma', $firma);\n $sentencia->bindParam(':id_cargo', $id_cargo);\n $sentencia->bindParam(':id_departamento', $id_departamento);\n \n // estos los valores de los inputs\n $id=\"0700950454\";\n $nombre=\"aaa\";\n $apellido=\"ssss\";\n $direccion=\"sss\";\n $telefono=23323232;\n $email=\"[email protected]\";\n $estado=1;\n $firma=\"NULL\";\n $id_cargo=3;\n $id_departamento=16;\n $sentencia->execute();\n \n \n\n \n }", "public function insert($aluno) {\n\t}", "public function persist() {\n $bd = BD::getConexion();\n $sqlInsertUsuario = \"insert into usuarios (nomUsuario, clave) values (:nomUsuario, :clave)\";\n $sthSqlInsertUsuario = $bd->prepare($sqlInsertUsuario);\n $result = $sthSqlInsertUsuario->execute([\":nomUsuario\" => $this->nomUsuario, \":clave\" => $this->clave]);\n $this->id = (int) $bd->lastInsertId();\n }", "public function mostrar_insertar() {\r\n\t\t\t$this -> pantalla_edicion('insertar'); \r\n\t\t }", "public function insertar($objeto){\r\n\t}", "public function insert( $objet);", "public function run() {\n\t\t\\DB::statement(\" INSERT INTO efectores.tipo_efector(id_tipo_efector,sigla,descripcion)\n(\n\tSELECT *\n\tFROM dblink('dbname=sirge host=192.6.0.118 user=postgres password=PN2012\\$',\n\t 'SELECT id_tipo_efector,sigla,descripcion\n\t\t FROM efectores.tipo_efector')\n\t AS migracion(id_tipo_efector integer,\n sigla character varying(4),\n descripcion character varying(50))\n);\");\n\t}", "public function insert($data){\n // TODO: Modif bagian ini\n $this->db->insert('pokemon', $data);\n }", "public function insertarDatosCompra($datos){\n $con= new conectar();\n $conexion= $con->conexion();\n $sql= \"INSERT INTO compras_realizadas(idLog, fecha,nombre,precio)\n values('$datos[0]','$datos[1]','$datos[2]','$datos[3]')\"; \n return $result= mysqli_query($conexion, $sql); \n }", "protected function saveInsert()\n {\n }", "public function insertar()\n {\n\n $nameanimal = $this->request->getPost(\"nameanimal\");\n $ageanimal = $this->request->getPost(\"ageanimal\");\n $time = $this->request->getPost(\"time\");\n $foodanimal = $this->request->getPost(\"foodanimal\");\n $description = $this->request->getPost(\"description\");\n $typeanimal = $this->request->getPost(\"typeanimal\");\n $photoanimal = $this->request->getPost(\"photoanimal\");\n\n //2. Organizar los datos que llegan de las vistas\n // en un arreglo asociativo \n //(las claves deben ser iguales a los campos o atributos de la tabla en BD)\n $datosEnvio = array(\n \"nameanimal\" => $nameanimal,\n \"ageanimal\" => $ageanimal,\n \"time\" => $time,\n \"foodanimal\" => $foodanimal,\n \"description\" => $description,\n \"typeanimal\" => $typeanimal,\n \"photoanimal\" => $photoanimal\n );\n\n //3. Utilizar el atributo this-> validate del controlador para validar datos\n if ($this->validate('animalPOST')) {\n $id = $this->model->insert($datosEnvio);\n\n return $this->respond($this->model->find($id));\n } else {\n $validation = \\Config\\Services::validation();\n return $this->respond($validation->getErrors());\n }\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}", "protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}", "public function _insertar($objeto) {\n\t\t$this->db->setTable_name( $this->table_name );\t\t\n\t\t$this->db->setIs_query(false);\n\t\t\n\t\t$query = $this->_create_query_insertar( $objeto );\n\t\t// echo \"<br> $query <br>\\n\";\n\t\t\n\t\tif ( $this->db->getDriver() == amaguk_database_connection::DB_DRIVER_POSTGRESL ){\n\t\t\t$this->db->setField_key_name( $this->fields[0] );\n\t\t\t\n\t\t\t$this->db->insert_query( $query );\n\t\t}else{\n\t\t\t$this->db->query( $query );\n\t\t}\t\t\n\t\t\n\t\t$this->where=\"\";\n\t\t//print $query;\n\t\t$this->clearCondition();\n\t\t\n\t}", "public function run()\n {\n DB::table('localidades')->insert($this->localidades);\n }", "public function run()\n {\n DB::table('localidades')->insert($this->localidades);\n }", "public function insert($tienda);", "public function insert() {\n \n $query = $this->dbConnection->prepare(\"INSERT INTO `menu` (`id`, `name`, `nameen`, `address`, `isMenu`, `order`) VALUES (NULL, :name, :nameen, :address, :isMenu, :order)\");\n $query->bindValue(':name', $this->name, PDO::PARAM_STR);\n $query->bindValue(':nameen', $this->nameen, PDO::PARAM_STR);\n $query->bindValue(':address', $this->address, PDO::PARAM_STR);\n $query->bindValue(':isMenu', $this->isMenu, PDO::PARAM_STR);\n $query->bindValue(':order', $this->order, PDO::PARAM_STR);\n $query->execute();\n $this->id = $this->dbConnection->lastInsertId();\n }", "public function insertar($idordencompra, $nrofactura, $idproveedor, $idpersonal, $idsucursal, $idformapago, $idtipodoc, $iddeposito, \n $fecha_hora, $obs, $monto_compra, $idmercaderia, $cantidad, $precio, $total_exenta, $total_iva5, $total_iva10, $liq_iva5, $liq_iva10, $cuota){\n\n $sql = \"INSERT INTO compras (idordencompra, nrofactura, idproveedor, idpersonal, idsucursal, idformapago, idtipodocumento, iddeposito, fecha, obs, monto, cuotas, estado) \n VALUES ('$idordencompra', '$nrofactura', '$idproveedor', '$idpersonal', '$idsucursal', '$idformapago', '$idtipodoc', '$iddeposito', '$fecha_hora', '$obs', '$monto_compra', '$cuota', '1')\";\n \n $idcompranew = ejecutarConsulta_retornarID($sql);\n\n $num_elementos=0;\n $sw=true;\n\n while($num_elementos < count($idmercaderia)){\n\n $sql_detalle = \"INSERT INTO compras_detalle (idcompra, idmercaderia, cantidad, precio) \n VALUES ('$idcompranew', '$idmercaderia[$num_elementos]', '$cantidad[$num_elementos]', '$precio[$num_elementos]')\";\n ejecutarConsulta($sql_detalle) or $sw = false;\n\n $num_elementos =$num_elementos + 1;\n }\n\n //aca realimazamos la insercion en la tabla libro compras\n\n $sql2 = \"INSERT INTO libro_compras (idcompra, idproveedor, fecha, montoexenta, montoiva5, montoiva10, grabiva5, grabiva10, montopagado) \n VALUES ('$idcompranew', '$idproveedor', '$fecha_hora', '$total_exenta', '$total_iva5', '$total_iva10', '$liq_iva5', '$liq_iva10', '$monto_compra')\";\n\n ejecutarConsulta($sql2);\n\n //aca realizamos la insercion en la tabla cuentas a pagar \n\n if($idformapago == 1){\n $formaPago = 'CONTADO';\n }else{\n $formaPago = 'CREDITO';\n }\n\n $monto_cuota = $monto_compra / $cuota;\n\n $fecha = strtotime($fecha_hora);\n $fecha = date('Y-m-d H:i:s', $fecha);\n $cont = 0;\n\n for ($i=1; $i <= $cuota ; $i++) { \n\n if($i >= 2){\n $cont = $cont + 1;\n $fecha = date(\"Y-m-d H:i:s\", strtotime($fecha_hora. \"+ {$cont} month\"));\n }\n\n if($cuota == 1){\n $concepto = \"Cuota Nro. \". $i .\"/\". $cuota .\" \". $formaPago;\n }else{\n $concepto = \"Cuota Nro. \". $i .\"/\". $cuota .\" \". $formaPago .\" \". $cuota .\" MESES\";\n }\n\n $sql3 = \"INSERT INTO cuentas_a_pagar (idcompra, idproveedor, nrofactura, idnotacredidebi, totalcuota, nrocuota, montocuota, fechavto, obs, estado) \n VALUES ('$idcompranew', '$idproveedor', '$nrofactura', '0', '$cuota', '$i', '$monto_cuota', '$fecha','$concepto', '1')\";\n\n ejecutarConsulta($sql3);\n\n }\n\n $sql4 = \"UPDATE orden_compras SET estado = '2' WHERE idordencompra = '$idordencompra'\";\n ejecutarConsulta($sql4);\n\n return $sw;\n\n }", "function insert($data){\n try{\n $query=$this->db->conn()->prepare(\"INSERT INTO ALUMNO (NOMBRE,APELLIDO,TELEFONO) VALUES (:nombre,:apellido,:telefono)\");\n $query->execute(['nombre'=>$data['nombre'],'apellido'=>$data['apellido'],'telefono'=>$data['telefono']]);\n return true;\n }catch(PDOException $e){\n return false;\n }\n }", "Function donneefournisseurs()\r\n {\r\n echo \"copie des données de la table fournisseurs\";\r\n $req=\"INSERT INTO `\".Valorisation::$anneenouvelle.\"`.`fournisseurs` SELECT * FROM `\".Valorisation::$anneeancienne.\"`.`fournisseurs`\";\r\n Valorisation::$bddnew->query($req); \r\n }", "public function insertar(){\n $this -> Conexion -> abrir();\n $this -> Conexion -> ejecutar( $this -> ClienteDAO -> insertar());\n $res = $this -> Conexion -> filasAfectadas();\n $this -> Conexion -> cerrar();\n return $res;\n }", "public function insertar($tabla, $datos){\n $resultado=$this->con->query(\"INSERT INTO $tabla VALUES(null,$datos)\") or die($this->con);\n if($resultado)\n return true;\n return false;\n }", "public function run()\n {\n \n DB::insert('insert into estudante (nome, senha) values (?, ?)', ['pastel4', \"123457\"]);\n }", "public function run()\n {\n DB::table(\"data\")->insert([\n \t\"name\"=>\"IVA\",\n \t\"data\"=>\"21\"\n ]);\n DB::table(\"data\")->insert([\n \t\"name\"=>\"DESIGN_INDEX\",\n \t\"data\"=>\"BUTTONS\"\n ]);\n\n }", "public function insertar() {\n $this->consultaValores->id=null;\n return $this->ejecutarConsulta('insertar');\n }", "public function insert($tableName, $data);" ]
[ "0.73764616", "0.7310832", "0.7171039", "0.7148388", "0.7098001", "0.70854694", "0.70723313", "0.7062839", "0.70349985", "0.6960343", "0.6944691", "0.6932344", "0.69030565", "0.68867105", "0.68710804", "0.6865734", "0.68537337", "0.6830176", "0.68171525", "0.68063366", "0.68018186", "0.6800654", "0.679896", "0.6791448", "0.6790154", "0.67692864", "0.6764478", "0.6744945", "0.67337406", "0.67258483", "0.6719186", "0.66903454", "0.6653589", "0.66500646", "0.6647701", "0.66431564", "0.6641298", "0.66313607", "0.66303456", "0.6624884", "0.6621164", "0.66054064", "0.660404", "0.65936613", "0.65807796", "0.65773755", "0.6565626", "0.6562527", "0.65614444", "0.65606093", "0.6554999", "0.65499514", "0.6544423", "0.65439445", "0.65368605", "0.65355086", "0.6527644", "0.6527644", "0.6527644", "0.65047395", "0.6502266", "0.6497167", "0.6491215", "0.6489254", "0.64798355", "0.64782125", "0.647764", "0.6476551", "0.64721525", "0.6470615", "0.64628077", "0.64580643", "0.64536136", "0.6448973", "0.6448396", "0.644725", "0.6446397", "0.6441831", "0.64407504", "0.64362794", "0.6435226", "0.64329237", "0.6425131", "0.6422226", "0.64165455", "0.6412903", "0.6412409", "0.6403757", "0.6403627", "0.6403627", "0.63916254", "0.63891727", "0.63886267", "0.63886195", "0.637353", "0.63718903", "0.63663065", "0.6364987", "0.63615984", "0.63520056", "0.6351838" ]
0.0
-1
Setter for Id. This is the only Id we allow to be set manually, as we use the one from the ESP board.
public function setId($id) { $this->id = $id; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SetId($value) { $this->id=$value; }", "public function updateId() {\n $this->Id = session_id();\n }", "function setId($value) {\n $this->_id = intval($value);\n }", "public function setId()\n\t{\n\t}", "public function setId($x) { $this->id = $x; }", "public function setId($Id) \n {\n $this->Id = $Id;\n }", "public function setId($id)\n {\n $this->id = $id ? $id : uniqid();\n }", "function setId($id) {\n\t\t$this->_id = $id;\n\t}", "public function setId($id){\n\t\tself::$_id[get_class($this)] = $id;\n\t}", "public function SetId ($id);", "public function setId()\n {\n $apiKey = new ApiKey;\n $apiKey->setId();\n $this->id = $apiKey->getId();\n }", "function setId($id) {\r\n $this->_id = $id;\r\n }", "public function setId($var){\n\t\t$this->id=$var;\n\t}", "public function setId($id)\n {\n $id = (int) $id;\n \n if ($id > 0)\n {\n $this->_id = $id;\n }\n }", "function setId($id) {\n $this->id = $id;\n }", "function setId($id) {\n $this->id = $id;\n }", "public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }", "public function resetId()\n {\n\n $this->id = null;\n\n }", "function set_id($id) {\n\t\t$this->id = $id;\n\t}", "function setId($id) {\r\n\t\t// Set id and wipe data\r\n\t\t$this->_id = $id;\r\n\t}", "public function setId($id) { $this->id = $id; }", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($var)\n {\n GPBUtil::checkString($var, True);\n $this->Id = $var;\n\n return $this;\n }", "public function setId($id)\n {\n $this->id = $id;\n\n return $id;\n }", "public function setId($id){\n $this->_id = $id;\n }", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function setId( $id ) {\n\t\t$this->id = $id;\n\t}", "public function setId( $id ) {\n\t\t$this->id = $id;\n\t}", "private function setId($id)\n {\n $this->id = $id;\n }", "static public function setId($id){\n \tif (self::$_id != $id){\n \t\tself::$_id = $id;\n \t\tself::regenerate();\n \t}\n }", "function setId($id)\n {\n $this->id = $id;\n }", "function set_id($id)\r\n {\r\n $this->set_default_property(self :: PROPERTY_ID, $id);\r\n }", "function set_id($id)\n {\n $this->id = $id;\n }", "private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}", "function setId($id){\r\n\t\t$this->id = $id;\r\n\t}", "function set_id($id)\n {\n $this->set_default_property(self :: PROPERTY_ID, $id);\n }", "public function setId( $id )\n {\n $this->id = $id;\n }", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($id) {\n\t\t$this->id = $id;\n\t}", "public function setId($Id){\n return $this->Id=$Id;\n }", "public function setId($id)\n {\n $this->_id = (int) $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "function setId($id){\n\t\t$this->id = $id;\n\t}", "public function setId($id) \n {\n $this->id = $id;\n }", "function setId($id)\n\t{\n\t\t// Set id\n\t\t$this->_id\t = $id;\n\t}", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($id){\n $this->id = $id;\n }", "public function setId($var)\n {\n GPBUtil::checkInt32($var);\n $this->Id = $var;\n\n return $this;\n }", "public static function setId($id)\n {\n self::$id = $id;\n }", "public function setId($Id)\n {\n $this->__set(\"id\", $Id);\n }", "public function setId($Id)\n {\n $this->__set(\"id\", $Id);\n }", "public function setId($Id)\n {\n $this->__set(\"id\", $Id);\n }", "public function setId($id) {\r\n $this->_id = $id;\r\n }", "function setId($id) {\n\t\t$this->setData('id', $id);\n\t}", "public function setId($id) {\n\t\t$this->id = (integer)$id;\n\t}", "function setId($value){\n\t\t//echo \"setting ID to \".$value;\n\t\t$this->_id=$value;\n\t\t//echo \"ID set to \".$this->_id;\n\t\treturn $this;\n\t}", "public function setId($var)\n {\n GPBUtil::checkString($var, True);\n $this->id = $var;\n }", "public function setId($id) {\r\n $this->id = $id;\r\n }", "public function setId($id) {\r\n $this->id = $id;\r\n }", "public function setId($id)\n {\n\n $this->idKey = $id;\n $this->context->element = $id;\n\n }", "public function set_id($id) {\n $this->_newid = preg_replace(\"/[^a-zA-Z0-9]/\", '', $id);\n }", "public function setId($id){\n\t\t$this->id = $id;\n\t}", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->_id = $id;\n }", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->_id = (int)$id;\n }", "private function SetID($value)\n\t\t{\n\t\t\t$this->id = $value;\n\t\t}", "public function setId($id){\n\t\t\t$this->id = $id;\n\t\t}", "public function determineId() {}", "public function setId($id)\r\n\t\t{\r\n\t\t\t$this->_id = $id;\r\n\t\t}", "public function setId($value)\n {\n $this->setDataField('id', $value);\n }", "public function setId($id) {\n $this->id = $id;\n }", "public function setId($id)\r\n\t{\r\n\t\t$this->id = $id;\r\n\t}", "public function setId($id)\r\n {\r\n $this->_id = (int) $id;\r\n }", "protected function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n\t\t{\n\t\t\t$this->id = $id;\n\t\t}", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }", "public function setId($id)\n {\n $this->id = $id;\n }" ]
[ "0.76595205", "0.69730693", "0.6950831", "0.69189614", "0.68374735", "0.6822702", "0.68183273", "0.6782295", "0.6763848", "0.67638075", "0.6745041", "0.6737561", "0.67334545", "0.6723596", "0.6711666", "0.6711666", "0.6692713", "0.66814744", "0.6679587", "0.66738033", "0.6665181", "0.666508", "0.6659731", "0.66592157", "0.6655654", "0.6648081", "0.6644969", "0.6644969", "0.6641955", "0.663863", "0.6632048", "0.6623055", "0.6622707", "0.6611699", "0.6611255", "0.66039836", "0.66036725", "0.66007566", "0.66007566", "0.66007566", "0.66007566", "0.66007566", "0.659606", "0.6595877", "0.6591318", "0.65911925", "0.6585876", "0.6585032", "0.6576232", "0.6576232", "0.6576232", "0.65748453", "0.6570951", "0.65622574", "0.65622574", "0.65622574", "0.6555555", "0.65541255", "0.6550077", "0.65481275", "0.6543334", "0.6540425", "0.6540425", "0.6536896", "0.6533428", "0.65281594", "0.6519052", "0.65056056", "0.6500469", "0.6500469", "0.6500469", "0.6500469", "0.6497865", "0.64962476", "0.6494297", "0.6492409", "0.6487505", "0.6486493", "0.647608", "0.6470885", "0.6468995", "0.646116", "0.64593685", "0.6454273", "0.6454273", "0.6454273", "0.6454273", "0.6454273", "0.6454273", "0.6454273", "0.6454273", "0.6454273", "0.6454273", "0.6454273", "0.6454273", "0.6454273", "0.6454273", "0.6454273", "0.6454273", "0.6454273", "0.6454273" ]
0.0
-1
generate new user emails checks for generic password
public function generate_new_passwords() { // all users added with "password" will be automatically sent a welcome message // and new password $resetpassword = 'password'; // get users $user_list = $this->get_user->get_all_users(); // go through users foreach($user_list as $user) { // check if password is "password" $user_id = $user->user_id; if ($this->get_user->check_password($user_id, $resetpassword) == 1) { // generate simple random password $newpassword = uniqid(); // write new password to database $data = array( 'password' => $newpassword ); $this->get_user->update('user_id', $user_id, $data); // email user new password $this->send_password_mail($user_id, $newpassword); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generateNewPassword($mail);", "static function password_expired_email() {\n $model = \\Auth::$model;\n $user = $model::requested();\n\n if (!$user->nil()) {\n if ($user->validate()) {\n\n password_expired_email($user) ?\n flash(\"Enviamos um e-mail para <small><b>$user->email</b></small> com as instruções para você criar uma nova senha.\") :\n flash('Não foi possível lhe enviar o e-mail. Por favor, tente novamente mais tarde.', 'error');\n\n go('/');\n } else {\n flash('Verifique os dados do formulário.', 'error');\n }\n }\n\n globals('user', $user);\n }", "private function emailAtLogin() {}", "public function create_password() {\n\t\tif(!empty($this->request->params['named']['email'])){\n\t\t\t$email = $this->request->params['named']['email'];\n\t\t}\n\t\t\n\t\t$authUserData = $this->Auth->user();\n\t\tif(empty($authUserData)){\n\t\t\t$this->Session->setFlash(__('There was an error logging you in and setting up a password. Your temporary password has been sent to your email address.', true));\n\t\t\t//Send the temporary password to the user's email address\n\t\t\t$options = array(\n\t\t\t\t\t\t\t\t'layout'=>'temporary_password',\n\t\t\t\t\t\t\t\t'subject'=>'Your Temporary Password',\n\t\t\t\t\t\t\t\t'view'=>'default'\n\t\t\t\t\t\t\t\t);\n\t\t\t$viewVars = array('temp_password'=>$authUserData['User']['email'],'user'=>$user);\n\n\t\t\t//Send the email\n\t\t\t$this->_sendEmail($email,$options,$viewVars);\n\t\t\t$this->redirect(array('controller'=>'users','action'=>'login'));\n\t\t}\n\t\t\n\t\t$user = $this->User->find('first',array('conditions'=>array('email'=>$authUserData['User']['email'])));\n\t\tif (!empty($this->request->data)) {\n\t\t\t$this->request->data['User']['id'] = $user['User']['id']; //Get the logged in user's id\n\t\t\tif ($this->User->verifyNewPassword($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Password created.', true));\n\t\t\t\t$this->redirect(array('controller'=>'uploads','action'=>'index'));\n\t\t\t}\n\t\t}\n\t}", "public function send_password(){\n\t\t$tmpUsername = $_POST[\"txtUsername\"];\n\t\t$tmpEmail = $_POST[\"txtEmail\"];\n\t\t$inRepository = new InterfacePersonRepo;\n\t\t$tmpUser = $inRepository->getRepositoryByUsername($tmpUsername);\n\t\tif(count($tmpUser)>1){\n\t\t\texit();\n\t\t}\n\t\tif($tmpUser[0]->Email == $tmpEmail){\n\t\t\t$fgUser = new Person;\n\t\t\t$fgUser->setUsername($tmpUsername);\n\t\t\t$fgUser->setEmail($tmpEmail);\n\t\t\t$email = $inRepository->sendmailRepository($fgUser);\n\t\t\treturn View::make('alert/authen/alertEmail')->with('Email',$email);\n\t\t}else{\n\t\t\treturn View::make('alert/authen/alertEmail2');\n\t\t}\n\t}", "public function generateResetPassword()\n {\n $this->setRules([ StringLiterals::EMAIL => 'required|max:100|email' ]);\n $this->_validate();\n $this->_customer = $this->_customer->where('email', $this->request->email)->first();\n if (isset($this->_customer) && is_object($this->_customer) && ! empty($this->_customer->id)) {\n $this->_customer->access_otp_token = mt_rand();\n $this->_customer->save();\n $this->email = $this->email->fetchEmailTemplate('password_reset_otp');\n $this->email->content = str_replace([ '##USERNAME##','##OTP##' ], [ $this->_customer->name,$this->_customer->access_otp_token ], $this->email->content);\n $this->notification->email($this->_customer, $this->email->subject, $this->email->content);\n return true;\n }\n return false;\n }", "public function p_emailpassword(){\n\n # if javascript is disabled this checks if user entered email and password to login\n if (!$_POST['email']) {\n Router::redirect(\"/users/emailpassword/error\"); \n }\n # proceed with checking if email exists\n else { \n $q= 'Select user_id \n From users \n WHERE email=\"'.$_POST['email'].'\"';\n \n $user_id= DB::instance(DB_NAME)->select_field($q);\n \n #email doesnt exists\n if(!$user_id){ \n \n Router::redirect(\"/users/emailpassword/error1\"); \n }\n # email exists , email the password that is generated using generate_random_string\n else{\n $password=Utils::generate_random_string(8); \n $new_password=sha1(PASSWORD_SALT.$password);\n $new_modified= Time::now();\n\n $data=Array('modified'=>$new_modified,\n 'password'=>$new_password \n );\n $success= DB::instance(DB_NAME)->update('users',$data,'WHERE user_id=' .$user_id); \n \n \n $to[] = Array(\"name\" => $_POST['email'], \"email\" => $_POST['email']);\n $from = Array(\"name\" => APP_NAME, \"email\" => APP_EMAIL);\n $subject = \"Password reset message from \".APP_NAME; \n \n $body = \"This is the password: \".$password ;\n # Send email\n $sent = Email::send($to, $from, $subject, $body, FALSE, '');\n # IF EMAIL IS SENT and password update is successful proceed to login \n if($sent AND $success)\n Router::redirect('/users/login');\n # else error out, either send email failed or couldnt update database \n else\n Router::redirect('/users/emailpassword/error2');\n }\n } # end of first else \n }", "function userRandomPassword()\n{\n\n global $errorSearch;\n\n $length = 20;\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-._#!?%';\n $charactersLength = strlen($characters);\n $randomString = '';\n\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[rand(0, $charactersLength - 1)];\n }\n $password_hash = password_hash($randomString, PASSWORD_DEFAULT);\n\n if (database::getConnections()->updateAdminRandomPassword(\"userdata\", $_POST[\"userId\"], $password_hash) == true) {\n $errorSearch = '<p class=\"success\">Erfolgreich das Passwort geändert. Dem User wurde ein Random Passwort per E-Mail zugeschickt!</p>';\n\n // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG // ACHTUNG\n // SPÄTER ENTFERNEN NUR ZUM AUSPROBIEREN UND SCHAUEN, SOLANGE AUCH DIE MAIL NICHT AUFTAUCHT!\n echo 'Das Neue Passwort von dem User lautet (Ohne Leerzeichen und \"\") = \"' . $randomString . '\" !';\n } else {\n $errorSearch = '<p class=\"error\">Es ist ein Fehler aufgetreten und das Passwort des Users konnte nicht abgeändert werden. Bitte wende dich an den Besitzer und Backend Developer!</p>';\n }\n\n $newMail = new mail();\n $newMail->randomPasswordMail($_POST[\"userEmail\"], $randomString);\n}", "public function forgot_pwd()\r\n {\r\n //provided the correct combination of user name and email address\r\n\r\n $username = htmlspecialchars($_POST['username']);\r\n $email = htmlspecialchars($_POST['email']);\r\n\r\n require_once 'database/profile.php';\r\n require_once 'database/session.php';\r\n\r\n $usernameId = getUserId($username);\r\n if (!$usernameId) {\r\n return \"Username does not exist.\";\r\n }\r\n\r\n $userInfo = getProfile($usernameId);\r\n if ($userInfo[\"email\"] != $email) {\r\n return \"Email doesn't match the one we have on file.\";\r\n }\r\n\r\n $password = getPassword($userId);\r\n return $this->send_forgotten_pwd($username, $password, $email);\r\n \r\n }", "function sendSignupEmail($user_id, $password){\n define('EMAIL_SUBJECT', 'MW Resource Checkout');\n $from = \"[email protected]\";\n $headers = \"From: $from\\r\\n\";\n $headers .= \"Content-type: text/html\\r\\n\";\n mail(getUserEmail($user_id), EMAIL_SUBJECT, genSignupEmail(getUsername($user_id), $password), $headers);\n}", "public function validateForgotPassword($input){\n $userData = array();\n $error=array();\n\n\n if(empty($input['email'])){\n $error = array_merge($error,array('email' => 'This field is required.'));\n }\n else{\n $cleanData = $this->cleanInput($input['email']);\n require_once('../app/Core/Database.php');\n $db = new Database();\n $conn = $db->setConnection();\n if($conn !== null){\n $stmt = $conn->query(\"SELECT username,email FROM user where email='\".$cleanData.\"'\");\n if($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n $username = $row['username'];\n $newPassword = uniqid();\n require '../app/vendor/autoload.php';\n $mail = new PHPMailer(true);\n try{\n $mail->isSMTP();// set mailer to use smtp\n $mail->Host = 'smtp.gmail.com'; //specify the smtp server\n $mail->SMTPAuth = true; // enable smtp authenticatiion\n $mail->Username = \"[email protected]\"; // SMTP username\n $mail->Password = \"hello@there123HT\"; // SMTP pasword\n $mail->SMTPSecure = \"tls\"; // Enable TLS encryption\n $mail->Port = 587; // TCP port to connect to\n\n // recipient\n $mail->setFrom(\"[email protected]\",\"Seralance\");\n $mail->addAddress($row['email'],$row['email']);\n \n //content\n $mail->isHTML(true); // set email format to html\n $mail->Subject = \"Forgotten password\";\n $msg =<<<EOT\n <html>\n <body>\n <div style=\"text-align: center;\">\n <img src=\"{$_SESSION['baseurl']}public/assets/images/seralance-logo.png\" alt=\"Seralance\">\n </div>\n \n <p style=\"text-align: center;\">\n Your username is {$username}.\n </p>\n <p style=\"text-align: center;\">\n Your newly generated password is {$newPassword}.\n </p>\n </body>\n </html>\n EOT;\n\n $mail->Body =$msg;\n\n $mail->send();\n $this->updatePassword(array('email'=>$row['email'],'newpassword'=>$newPassword));\n\n }\n catch(Exception $e){\n $error = array_merge($error,array('email' => 'Sorry for the inconvenience! We could not send a new password. Please try again later.'));\n } \n }\n else{\n $error = array_merge($error,array('email' => 'Email does not exist.'));\n } \n } \n }\n \n if(empty($error)){\n return array('valid'=>1 ,'data'=>$userData);\n }\n else{\n return array('valid'=>0,'error'=>$error);\n }\n\n \n }", "function generatePW($email){\n $pw = password_hash($email,PASSWORD_DEFAULT);\n return $pw;\n }", "public static function email_password_renew() {\n if ($u = static::check_record_existence()) {\n\n $m = auth_model();\n $u = $m::first(array('where' => 'id = \\'' . $u->id . '\\''));\n\n if ($u->emailPasswordRenew())\n flash('Email com as instruções para Renovação de senha enviado para ' . $u->email . '.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }", "public function passwordEmail()\n {\n $this->shellshock(request(), [\n 'email' => 'required|email',\n 'g-recaptcha-response' => 'sometimes|recaptcha',\n ]);\n\n if (($user = app(config('turtle.models.user'))->where('email', request()->input('email'))->first())) {\n $token = Password::getRepository()->create($user);\n\n Mail::send(['text' => 'turtle::emails.password'], ['token' => $token], function (Message $message) use ($user) {\n $message->subject(config('app.name') . ' Password Reset Link');\n $message->to($user->email);\n });\n\n flash('success', 'Password reset link emailed!');\n\n return response()->json(['reload_page' => true]);\n }\n else {\n return response()->json(['errors' => ['email' => [trans('auth.failed')]]], 422);\n }\n }", "public function testRegisterLongEmail() {\n\t\t$data = $this->getUserData(\n\t\t\t'othrus',\n\t\t\t$this->first_name,\n\t\t\t$this->surname,\n\t\t\tstr_repeat('abc45', 6) + '@' + str_repeat('def90',4) + '.es'\n\t\t);\n\t\t\n\t\t$response = $this->call('POST','v1/users', $data);\n\t\t$resp_data = $response->getData();\n\t\t\n\t\t$this->assertResponseStatus(400);\n\t\t$this->assertTrue($resp_data->error);\n\t}", "function sendEmailPassword($user_id, $password){\n\t\n\t $result = $GLOBALS['db']->query(\"SELECT email1, email2, first_name, last_name FROM users WHERE id='$user_id'\");\n\t $row = $GLOBALS['db']->fetchByAssoc($result);\n\t \n\t if(empty($row['email1']) && empty($row['email2'])){\n\t \n\t $_SESSION['login_error'] = 'Please contact an administrator to setup up your email address associated to this account';\n\t return;\n\t }\n\t \n\t require_once(\"include/SugarPHPMailer.php\");\n\t\t$notify_mail = new SugarPHPMailer();\n\t\t$notify_mail->CharSet = AppConfig::setting('email.default_charset');\n\t\t$notify_mail->AddAddress(((!empty($row['email1']))?$row['email1']: $row['email2']), $row['first_name'] . ' ' . $row['last_name'] );\n \n\t\tif (empty($_SESSION['authenticated_user_language'])) {\n\t\t\t$current_language = AppConfig::setting('locale.defaults.language');\n\t\t}\n\t\telse {\n\t\t\t$current_language = $_SESSION['authenticated_user_language'];\n\t\t}\n\n\t\t$notify_mail->Subject = 'info@hand Token';\n\t\t$notify_mail->Body = 'Your info@hand session authentication token is: ' . $password;\n\t\tif(AppConfig::setting('email.send_type') == \"SMTP\") {\n\t\t\t$notify_mail->Mailer = \"smtp\";\n\t\t\t$notify_mail->Host = AppConfig::setting('email.smtp_server');\n\t\t\t$notify_mail->Port = AppConfig::setting('email.smtp_port');\n\t\t\tif (AppConfig::setting('email.smtp_auth_req')) {\n\t\t\t\t$notify_mail->SMTPAuth = TRUE;\n\t\t\t\t$notify_mail->Username = AppConfig::setting('email.smtp_user');\n\t\t\t\t$notify_mail->Password = AppConfig::setting('email.smtp_password');\n\t\t\t}\n\t\t}\n\n\t\t$notify_mail->From = 'no-reply@' . AppConfig::setting(array('email.from_host_name', 'site.host_name'));\n\t\t$notify_mail->FromName = 'info@hand Authentication';\n\n\t\tif(!$notify_mail->Send()) {\n\t\t\t$GLOBALS['log']->warn(\"Notifications: error sending e-mail (method: {$notify_mail->Mailer}), (error: {$notify_mail->ErrorInfo})\");\n\t\t}\n\t\telse {\n\t\t\t$GLOBALS['log']->info(\"Notifications: e-mail successfully sent\");\n\t\t}\n\t\n\t\t\t\n\t\t\n\t}", "public function forgotpasswordAction()\n {\n $user_service = $this->getServiceLocator()->get('user');\n $email_sent = false;\n\n if ($this->getRequest()->isPost())\n {\n $data = $this->getRequest()->getPost();\n\n $email = trim($data['email']);\n $email = strtolower($email);\n $user_service->emailPassword($email);\n $email_sent = true;\n }\n\n return ['email_sent' => $email_sent];\n }", "function register(){\r\n\t\tif(!isset($_POST['username']) || !isset($_POST['email']) ){\r\n\t\t\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Invalid Request\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\r\n\t\t//get inputs\r\n\t\t$username = $_POST['username'];\r\n\t\t$email = $_POST['email'];\r\n\t\t\r\n\t\t$v = new DooValidator;\r\n\t\t//validate\r\n\t\tif(($error = $v->testEmail($_POST['email'])) != null){\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = $error;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//check if username or email already exist in users db\r\n\t\t$u = Doo::db()->find('Users', array(\r\n\t\t\t'where' => \"username = :username OR email = :email\", \r\n\t\t\t'param' => array(':username' => $username, ':email' => $email)\r\n\t\t\t)\r\n\t\t);\r\n\t\t\r\n\t\t\r\n\t\tif(!empty($u)){\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Username or Email already exist\";\r\n\t\t\treturn;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//generate temp password\r\n\t\t$tmpPassword = $this->str_rand(6);\r\n\t\t\r\n\r\n\t\t//send email with temp password\r\n\t\t$to = $email;\r\n\r\n\t\t// Your subject\r\n\t\t$subject = \"Your temp password here\";\r\n\r\n\t\t// From\r\n\t\t$header=\"from: Register-EVAS <[email protected]>\";\r\n\t\t//$header = null;\r\n\t\t\r\n\t\t// Your message\r\n\t\t$message = \"Your Comfirmation password \\r\\n\";\r\n\t\t$message.= \"$tmpPassword\";\r\n\t\t\r\n\t\t//ini_set ( \"SMTP\", \"smtp-server.example.com\" ); \r\n\t\t\r\n\t\t// send email\r\n\t\tif(!mail($to, $subject, $message, $header)){\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Error sending email to $email\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//store new user temp password \r\n\t\tDoo::loadModel('Users');\r\n\t\t$u = new Users;\r\n\t\t$u->username = $username;\r\n\t\t$u->email = $email;\r\n\t\t$u->isEnabled = 1;\r\n\t\t$u->change_password_on_login = 1;\r\n\t\t$u->password = md5($tmpPassword);\r\n\t\t$u->default_basemap = \"Google Streets\";\r\n\t\t$u->cluster_zoom_level = 15;\r\n\t\t$u->is_enabled = 1;\r\n\t\t $u->client = \"T-Mobile\";\r\n\t\t$u->insert();\r\n\t\t\t\r\n\t\t//success!\r\n\t\t$this->res->success = true;\r\n\t}", "function genSignupEmail($username, $password){\n $reg_email = \"\n <h3>Welcome to Millard West Resource Checkout</h3>\n <ul>\n <li>You can use this web app to checkout school resources\n <li>This is the sole method for checking out laptop carts and computer labs\n <li>The Media Center computers are <em>not</em> managed by this system\n </ul>\n\n <p>\n Your new login information is:\n <ul style=\\\"list-style-type:none;\\\">\n <li>Username: $username\n <li>Password: $password\n </ul>\n </p>\n\n <p>Please change your password the first time you login.</p>\n\n <p>To do this:</p>\n <ol>\n <li>Go to the settings tab\n <li>Type in your current password\n <li>Enter your new password twice\n </ol>\n\n <a href=\\\"http://i.westwildcats.org/checkout/\\\">MW Checkout</a>\n \";\n return $reg_email;\n}", "function register($name, $email, $password, $password2) {\n\t\tglobal $pdo;\n\n\t\t//delete old registration attempts\n\t\t$pdo->query(\"DELETE FROM user WHERE verified = 0 AND TIME_TO_SEC(TIMEDIFF(CURRENT_TIMESTAMP, code_generation_time)) > 600\");\n\n\t\t//empty or array check\n\t\tif(empty($name) || is_array($name) || empty($email) || is_array($email) || empty($password) || is_array($password) || empty($password2) || is_array($password2)) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t//check if passwords match\n\t\tif($password !== $password2) {\n\t\t\treturn 2;\n\t\t}\n\n\t\t//check if the password, user name and email meets our requirements\n\t\tif(!password_security_check($password) || !valid_name_check($name) || strlen($email) > 256) {\n\t\t\treturn 3;\n\t\t}\n\n\t\t//check if email is already used\n\t\t$sql = \"SELECT email FROM user WHERE REPLACE(email, \\\".\\\", \\\"\\\") = REPLACE(:email, \\\".\\\", \\\"\\\")\";\n $sth = $pdo->prepare($sql);\n\t\t$sth->bindValue(\":email\", mail_simplify($email), PDO::PARAM_STR);\n $sth->execute();\n\n\t\tif($sth->rowCount() != 0) {\n\t\t\treturn 4;\n\t\t}\n\n\t\t//generate verification code\n\t\t$verification_code = hash(\"sha256\", microtime() . (string)rand() . $email);\n\t\t//hash password\n\t\t$password_hash = password_hash($password, PASSWORD_BCRYPT);\n\n\t\t//get data required for email\n\t\t$reg_link = \"https://swapitg.com/firstlogin/$verification_code\";\n\t\t$subject = \"Registration\";\n\t\t$mailfile = fopen(__DIR__ . \"/register_mail_template.html\", \"r\") or die(\"Unable to open file!\");\n\t\t$message = strtr(fread($mailfile, filesize(__DIR__ . \"/register_mail_template.html\")), array('$reg_link' => $reg_link, '$name' => htmlspecialchars($name)));\n\t\tfclose($mailfile);\n\t\t$sender_email = \"[email protected]\";\n\t\t$sender_name = \"SwapitG no-reply\";\n\n\t\t//send email\n\t\tif(mail($email, $subject, wordwrap($message, 70, \"\\r\\n\"), \"From: $sender_name<$sender_email>\\r\\nContent-type: text/html; charset=utf-8\", \" -f \" . $sender_email)) {\n\t\t\t//if mail send sucessfully create new user wich is not verified yet\n\t\t\t$sql = \"INSERT INTO user (email, name, password, verification_code) VALUES (:email, :name, :password_hash, :verification_code)\";\n\t $sth = $pdo->prepare($sql);\n\t\t\t$sth->bindValue(\":email\", mail_simplify($email), PDO::PARAM_STR);\n\t\t\t$sth->bindValue(\":name\", htmlspecialchars($name), PDO::PARAM_STR);\n\t\t\t$sth->bindParam(\":password_hash\", $password_hash, PDO::PARAM_STR);\n\t\t\t$sth->bindParam(\":verification_code\", $verification_code, PDO::PARAM_STR);\n\t $sth->execute();\n\n\t\t\t//set email and password in the session for easier verification if the user verifies the email in the same session\n\t\t\tstart_session();\n\t\t\t$_SESSION[\"reg_email\"] = $email;\n\t\t\t//xor password for security reasons\n\t\t\t$_SESSION[\"reg_password\"] = $password ^ substr(str_pad($verification_code, strlen($password), $verification_code), 0, strlen($password));\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn 5;\n\t\t}\n\t}", "function testGeneratePassword() {\r\n $this->User = new User();\r\n \t\t$pass = $this->User->generatePassword(); \t\r\n \t$this->assertNotNull($pass);\r\n \t$this->assertPattern('#[a-zA-Z0-9]{6,15}#', $pass, 'Password is not between 6 and 15 chars long');\r\n }", "public function forgot_password() {\n $flash = null;\n // if the user has tried logging in\n if(isset($_POST['username'])){\n $email = $_POST['username'];\n $user = $this->User->getByEmail($email);\n $pass = rand(111111, 999999);\n if($this->User->setPassword($user['id'], $pass)) {\n $text = <<<END\nBecause of a request on our site, your password has been reset. To change your password, go to /users/change_password\nYour username is: {$email}\nYour password is: {$pass}\nEND;\n $email = self::getLib('email');\n $html = $email->text2html($text, email);\n $email->setSender('support');\n $email->setReplyTo('support');\n $email->setRecipients( array($recipient) );\n $email->setSubject(\"Your password has been reset\");\n $email->addMessagePart($text);\n $email->addMessagePart($html, \"html\");\n $email->send();\n $flash = \"An email with your new password has been sent to you. You should receive it shortly.\";\n } else {\n $flash = \"An error occured.\";\n }\n } else {\n $flash = \"Please enter a user name.\";\n }\n return array('flash' => $flash);\n }", "public function forgotPassword()\n { \n $siteUrl = ($this->request->type)?env('WEB_SITE_AUDIO_URL'):env('WEB_SITE_URL');\n $this->setRules([ 'email' => 'required|exists:customers,email' ]);\n $this->setMessages('email.exists', trans('customer::customer.email_not_registered'));\n $this->_validate();\n $newPassword = str_random(8);\n $user = $this->_customer->where('email', $this->request->email)->first();\n $user->forgot_password = $newPassword;\n $user->save();\n if (!empty($user) && count($user->toArray()) > 0) {\n $this->email = $this->email->fetchEmailTemplate('forgot_password');\n $this->email->subject = str_replace(['##SITE_NAME##'], [config ()->get ( 'settings.general-settings.site-settings.site_name' )], $this->email->subject);\n $this->email->content = str_replace([ '##USERNAME##','##FORGOTPASSWORD##' ], [ $user->name, $siteUrl.'reset-password' . '/' . $user->forgot_password ], $this->email->content);\n $this->notification->email($user, $this->email->subject, $this->email->content);\n }\n return true;\n }", "function generatePassword() {\n // 57 prefixes\n $aPrefix = array('aero', 'anti', 'ante', 'ande', 'auto', \n 'ba', 'be', 'bi', 'bio', 'bo', 'bu', 'by', \n 'ca', 'ce', 'ci', 'cou', 'co', 'cu', 'cy', \n 'da', 'de', 'di', 'duo', 'dy', \n 'eco', 'ergo', 'exa', \n 'geo', 'gyno', \n 'he', 'hy', 'ki',\n 'intra', \n 'ma', 'mi', 'me', 'mo', 'my', \n 'na', 'ni', 'ne', 'no', 'ny', \n 'omni', \n 'pre', 'pro', 'per', \n 'sa', 'se', 'si', 'su', 'so', 'sy', \n 'ta', 'te', 'tri',\n 'uni');\n\n // 30 suffices\n $aSuffix = array('acy', 'al', 'ance', 'ate', 'able', 'an', \n 'dom', \n 'ence', 'er', 'en',\n 'fy', 'ful', \n 'ment', 'ness',\n 'ist', 'ity', 'ify', 'ize', 'ise', 'ible', 'ic', 'ical', 'ous', 'ish', 'ive', \n 'less', \n 'sion',\n 'tion', 'ty', \n 'or');\n\n // 8 vowel sounds \n $aVowels = array('a', 'o', 'e', 'i', 'y', 'u', 'ou', 'oo'); \n\n // 20 random consonants \n $aConsonants = array('w', 'r', 't', 'p', 's', 'd', 'f', 'g', 'h', 'j', \n 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'qu');\n\n // Some consonants can be doubled\n $aDoubles = array('n', 'm', 't', 's');\n\n // \"Salt\"\n $aSalt = array('!', '#', '%', '?');\n\n $pwd = $aPrefix[array_rand($aPrefix)];\n\n // add random consonant(s)\n $c = $aConsonants[array_rand($aConsonants)];\n if ( in_array( $c, $aDoubles ) ) {\n // 33% chance of doubling it\n if (rand(0, 2) == 1) { \n $c .= $c;\n }\n }\n $pwd .= $c;\n\n // add random vowel\n $pwd .= $aVowels[array_rand($aVowels)];\n\n $pwdSuffix = $aSuffix[array_rand($aSuffix)];\n // If the suffix begins with a vovel, add one or more consonants\n if ( in_array( $pwdSuffix[0], $aVowels ) ) {\n $pwd .= $aConsonants[array_rand($aConsonants)];\n }\n $pwd .= $pwdSuffix;\n\n $pwd .= rand(2, 999);\n # $pwd .= $aSalt[array_rand($aSalt)];\n\n // 50% chance of capitalizing the first letter\n if (rand(0, 1) == 1) {\n $pwd = ucfirst($pwd);\n }\n return $pwd;\n }", "function forgotPassword(){\n\t\t\t$this->__dataDecode();\n\t\t\tif(!empty($this->data)){\n\t\t\t$data = $this->data;\n\t\t\t$username = $data['User']['userName'];\n\t\t\t$userDetail = $this->User->find('first',array('conditions'=>array(\"User.username \"=> $username)));\n\t\t\tif($username==null){\n\t\t\t\techo $username;\n\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t$response['response']['message']\t= 'please Enter userName';\n\t\t\t\t$this->set('response', $response);\n\t\t\t\techo json_encode($response);\n\t\t\t\tdie();\n\t\t\t}\n\t\t\telse{ \n\t\t\t\t$userID = $userDetail['User']['id'];\n\t\t\t\t$data = $this->data;\n\t\t\t\t$email_to = $userDetail['User']['email'];\n\t\t\t\tif($userDetail['User']['username'] == ($username)){\n\t\t\t\t\t$password= $this->createRandomPassword();\n\t\t\t\t\t$new_password=md5($password);\n\t\t\t\t\t$this->User->id = $userID;\n\t\t\t\t\t$this->data['User']['password'] = trim($new_password);\n\t\t\t\t\tunset($this->User->validate['password']);\n \t\t\t\t\tunset($this->User->validate['confirm_password']);\n\t\t\t\t\tif($this->User->save($this->data)){\n\t\t\t\t\t\t//Default Mail component is called, to send mail. We are setting the variables for sending email\n\t\t\t\t\t\t$this->Email->to = $email_to;\n\t\t\t\t\t\t//$this->Email->bcc = array($adminEmail);\n\t\t\t\t\t\t$this->Email->subject = 'Your password here';\n\t\t\t\t\t\t$this->Email->replyTo = EMAIL_REPLY;\n\t\t\t\t\t\t$this->Email->from = \"iWrestled admin <\".EMAIL_REPLY.\">\";\n\t\t\t\t\t\t//Here, the element in /views/elements/email/html/ is called to create the HTML body\n\t\t\t\t\t\t$this->Email->template = 'simple_message'; // note no '.ctp'\n\t\t\t\t\t\t//Send as 'html', 'text' or 'both' (default is 'text')\n\t\t\t\t\t\t$this->Email->sendAs = 'both'; // because we like to send pretty mail\n\t\t\t\t\t\t//Set view variables as normal\n\t\t\t\t\t\t$this->set('userDetail', $userDetail);\n\t\t\t\t\t\t$this->set(\"password\", $password);\n\t\t\t\t\t\t//Do not pass any args to send()\n\t\t\t\t\t\tif($this->Email->send()){\n\t\t\t\t\t\t\t$response['error']\t\t\t= 0;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'success';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Password send to your email id';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{ \n\t\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Password Enter valid email id';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t}", "function userSetTemporaryPassword($email) {\n\tqbLogin();\n\tglobal $qb;\n\tglobal $temp_password;\n\t$response = $qb->DoQuery(C_DBID_USERS, \"{'\".C_FID_USER_EMAIL.\"'.EX.'\".$email.\"'}\", 'a');\n\tif (isset($response[0]['3'])) {\n\t\t// Generate and encrypt a temporary password\n\t\t//$temp_password = random_string(10);\n\t\t$temp_password = random_str(10);\n\t\t//$temp_password = substr(bin2hex(openssl_random_pseudo_bytes(128)),0,10);\n\t\t$enc_temp_password = encrypt($temp_password);\n\t\t$fields = array(\n\t\t\tarray(\n\t\t\t\t'fid' => C_FID_USER_TEMPORARY_PASSWORD,\n\t\t\t\t'value' => $enc_temp_password\n\t\t\t)\n\t\t);\n\t\t$qb->EditRecord(C_DBID_USERS, $response[0]['3'], $fields); // Save the temporary password in QuickBase\n\t\tsendMail($email, null, 'forgot', $temp_password); // Send the user their temporary password\n\t}\n}", "function user_regenerate_password() {\n\t\t$this->left_menu_list = array();\n\t\t\n\t\tif (isset($this->data)) {\n\t\t\t$user = $this->User->find('first', array(\n\t\t\t\t'conditions' => array('User.email' => $this->data['User']['email']),\n\t\t\t\t'contain' => array()\n\t\t\t));\n\t\t\tif (empty($user)) {\n\t\t\t\t$this->Session->setFlash('Uživatel se zadanou emailovou adresou neexistuje.');\n\t\t\t} else {\n\t\t\t\t// udelam hash, pomoci ktereho budu moci identifikovat uzivatele a zaslu ho na jeho emailovou adresu (v dane url)\n\t\t\t\t$hash = $this->User->createHash($user);\n\t\t\t\tif ($this->User->sendHash($user, $hash)) {\n\t\t\t\t\t$this->Session->setFlash('Výzva k potvrzení změny hesla byla odeslána.');\n\t\t\t\t} else {\n\t\t\t\t\t$this->Session->setFlash('Výzvu k potvrzení změny hesla se nepodařilo odeslat.');\n\t\t\t\t}\n\t\t\t\t$this->redirect(array('controller' => 'users', 'action' => 'login'));\n\t\t\t}\n\t\t}\n\t}", "public function emailUser () {\n\t\t\t// Load the data helper class and get user instance\n\t\t\t$data = Mage::helper (\"twofactor/data\");\n\t\t\t$user = Mage::getSingleton (\"admin/session\")->getUser ();\n\t\t\t// Load the authentication model that belongs with logged in user\n\t\t\t$auth = Mage::getModel (\"twofactor/auth\");\n\t\t\t$auth->load ( $user->getUserId () );\n\t\t\t$auth->setId ( $user->getUserId () );\n\t\t\t// Construct the user contact's full name\n\t\t\t$fullName = ucfirst ( $user->getFirstname () ) . \" \";\n\t\t\t$fullName .= ucfirst ( $user->getLastname () );\n\t\t\t// Format timestamp date and time\n\t\t\t$timestamp = $auth->getLastTimestamp ();\n\t\t\t$timestampDate = \"-\";\n\t\t\t$timestampTime = \"-\";\n\t\t\tif ( $timestamp !== null ) {\n\t\t\t\t$timestampDate = Mage::getModel (\"core/date\")->date (\n\t\t\t\t\t\"m/d/Y\", strtotime ( $timestamp )\n\t\t\t\t);\n\t\t\t\t$timestampTime = Mage::getModel (\"core/date\")->date (\n\t\t\t\t\t\"h:i:s A\", strtotime ( $timestamp )\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Construct and send out ban notice email to user\n\t\t\t$template = Mage::getModel (\"core/email_template\")->loadDefault (\"twofactor_user\");\n\t\t\t$template->setSenderEmail ( Mage::getStoreConfig (\"trans_email/ident_general/email\") );\n\t\t\t$template->setSenderName (\"JetRails 2FA Module\");\n\t\t\t$template->setType (\"html\");\n\t\t\t$template->setTemplateSubject (\n\t\t\t\tMage::helper (\"twofactor\")->__(\"Your Magento admin account is locked\")\n\t\t\t);\n\t\t\t$template->send ( $user->getEmail (), $fullName,\n\t\t\t\tarray (\n\t\t\t\t\t\"base_url\" => Mage::getBaseUrl ( Mage_Core_Model_Store::URL_TYPE_WEB ),\n\t\t\t\t\t\"last_timestamp_date\" => $timestampDate,\n\t\t\t\t\t\"last_timestamp_time\" => $timestampTime,\n\t\t\t\t\t\"ban_attempts\" => $data->getData () [\"ban_attempts\"],\n\t\t\t\t\t\"ban_time\" => $data->getData () [\"ban_time\"],\n\t\t\t\t\t\"username\" => $user->getUsername (),\n\t\t\t\t\t\"year\" => date (\"Y\")\n\t\t\t\t)\n\t\t\t);\n\t\t}", "private function send_new_password_email( $email, $new_password ){\n\t\t\n\t\t$user = $this->mysqli->get_user( $email, md5( $new_password ) );\n\t\t\n\t\t$email_logo_url = get_option( 'ec_option_email_logo' );\n\t \t\n\t\t// Get receipt\n\t\tob_start();\n if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_retrieve_password_email.php' ) )\t\n\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_retrieve_password_email.php' );\t\n\t\telse\n\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_retrieve_password_email.php' );\n\t\t$message = ob_get_contents();\n\t\tob_end_clean();\n\t\t\n\t\t$headers = array();\n\t\t$headers[] = \"MIME-Version: 1.0\";\n\t\t$headers[] = \"Content-Type: text/html; charset=utf-8\";\n\t\t$headers[] = \"From: \" . get_option( 'ec_option_password_from_email' );\n\t\t$headers[] = \"Reply-To: \" . get_option( 'ec_option_password_from_email' );\n\t\t$headers[] = \"X-Mailer: PHP/\".phpversion();\n\t\t\n\t\t$email_send_method = get_option( 'ec_option_use_wp_mail' );\n\t\t$email_send_method = apply_filters( 'wpeasycart_email_method', $email_send_method );\n\t\t\n\t\tif( $email_send_method == \"1\" ){\n\t\t\twp_mail( $email, $GLOBALS['language']->get_text( \"account_forgot_password_email\", \"account_forgot_password_email_title\" ), $message, implode(\"\\r\\n\", $headers));\n\t\t\n\t\t}else if( $email_send_method == \"0\" ){\n\t\t\tmail( $email, $GLOBALS['language']->get_text( \"account_forgot_password_email\", \"account_forgot_password_email_title\" ), $message, implode(\"\\r\\n\", $headers));\n\t\t\t\n\t\t}else{\n\t\t\tdo_action( 'wpeasycart_custom_forgot_password_email', get_option( 'ec_option_password_from_email' ), $email, \"\", $GLOBALS['language']->get_text( \"account_forgot_password_email\", \"account_forgot_password_email_title\" ), $message );\n\t\t\t\n\t\t}\n\t\t\n\t}", "function sendUserForgotPassword($argArrPOST) {\n\n @extract($argArrPost);\n $objValid = new Validate_fields;\n $objCore = new Core();\n $objValid->check_4html = true;\n\n $objValid->add_text_field('Email', strip_tags($argArrPOST['frmUserLoginEmail']), 'email', 'y');\n\n if ($objValid->validation()) {\n $errorMsgFirst = 'Please enter valid email address!';\n } else {\n $errorMsg = $objValid->create_msg();\n }\n if ($errorMsg) {\n $objCore->setErrorMsg($errorMsg);\n return false;\n } else {\n $arrUserFlds = array('pkUserID', 'UserFirstName', 'UserEmail', 'UserPassword');\n $varUserWhere = ' 1 AND UserEmail = \\'' . trim($argArrPOST['frmUserLoginEmail']) . '\\'';\n $arrUserList = $this->select(TABLE_USERS, $arrUserFlds, $varUserWhere);\n if ($arrUserList) {\n //update the random key in the database\n\n $varRandomPassword = $this->generate_random_string(5); //die;\n\n\n $varRandomKey = md5(uniqid(microtime()));\n $arrUpdateArray = array('UserAuthorizationToken' => $varRandomKey, 'UserPassword' => md5($varRandomPassword));\n $varaffectedRecord = $this->update(TABLE_USERS, $arrUpdateArray, $varUserWhere);\n\n\n\n $argUserName = $arrUserList[0]['UserEmail'];\n //$argPassword = $arrUserList[0]['UserPassword'];\n $argPassword = $varRandomPassword;\n $argFirstName = $arrUserList[0]['UserFirstName'];\n\n //Send forget Password To User\n $varPath = '<img src=\"' . SITE_ROOT_URL . 'common/images/logo2.png' . '\"/>';\n\n $varToUser = $argArrPOST['frmUserLoginEmail'];\n $varFromUser = SITE_NAME . '<' . SITE_EMAIL_ADDRESS . '>';\n $varSubject = 'Venueset:Login Details';\n $varResetPasswordlink = '<a href=\"' . SITE_ROOT_URL . 'reset_password.php?userId=' . $arrUserList[0]['pkUserID'] . '&authorizationToken=' . base64_encode($varRandomKey) . '\">Reset Password</a>';\n $varOutput = file_get_contents(SITE_ROOT_URL . 'common/email_template/html/user_forget_password.html');\n $varUnsubscribeLink = 'Click <a href=\"' . SITE_ROOT_URL . 'unsubscribe.php?user=' . md5(trim($argArrPOST['frmUserLoginEmail'])) . '\" target=\"_blank\">here</a> to unsubscribe.';\n\n $arrBodyKeywords = array('{USER_FIRST_NAME}', '{USER_NAME}', '{USER_PASSWORD}', '{IMAGE_PATH}', '{SITE_NAME}', '{RESET_PASSWORD_LINK}', '{UNSUBSCRIBE_LINK}');\n\n $arrBodyKeywordsValues = array($argFirstName, $argUserName, $argPassword, $varPath, SITE_NAME, $varResetPasswordlink, $varUnsubscribeLink);\n $varBody = str_replace($arrBodyKeywords, $arrBodyKeywordsValues, $varOutput);\n //echo $varBody;die;\n $objCore->sendMail($varToUser, $varFromUser, $varSubject, $varBody);\n $objCore->setSuccessMsg(FRON_END_USER_FORGET_PASSWORD_SEND);\n return true;\n } else {\n $objCore->setErrorMsg(FRON_END_USER_EMAIL_EXIST_ERROR);\n return false;\n }\n }\n }", "function textAndEmailUserPassword($mysqli, $userId, $plainTextPassword) {\n\t// email\n\t$email_to = getUsersEmail ( $mysqli, $userId );\n\t$email_subject = \"Your Password\";\n\t$email_message = \"Password: $plainTextPassword\";\n\tmail ( $email_to, $email_subject, $email_message );\n\t// text message\n\t$userPhoneNumber = getUsersPhoneNumber ( $mysqli, $userId );\n\t$userCellCarrier = getUserCellCarrier ( $mysqli, $userId );\n\t$text_to = $userPhoneNumber . $userCellCarrier;\n\t$text_subject = \"Your Password\";\n\t$text_message = \"Password: $plainTextPassword\";\n\tmail ( $text_to, $text_subject, $text_message );\n}", "public function forgot_password_post()\n\t{\n\t\t$array['username'] = strtolower($this->post('username'));\n\n\t\t$error = [];\n\n\t\tif (filter_var($array['username'], FILTER_VALIDATE_EMAIL) \n\t\t\tOR preg_match('/^[A-Za-z][A-Za-z0-9]{5,100}$/', $array['username'])) {\n\n\t\t\tif (empty($array['username'])) {\n\t\t\t\t$this->response(['status' => FALSE, 'error' => 'Username is empty'], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t} else {\n\t\t\t\t$validate_user = $this->api_model->validate_user($array['username'], $array['username']);\n\t\t\t\t\n\t\t\t\tif ($validate_user) {\n\t\t\t\t\t$new_password = $this->get_random_string();\n\t\t\t\t\t$update_user = $this->api_model->update_password($validate_user, $new_password);\n\t\t\t\t\tif ($update_user) {\n\t\t\t\t\t\t$send_email = $this->send_email($validate_user['email'], $new_password);\n\t\t\t\t\t\tif ($send_email) {\n\t\t\t\t\t\t\t$this->response(['status' => TRUE, 'message' => 'New password sent to email'], REST_Controller::HTTP_OK);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->response(['status' => FALSE, 'error' => ['Something went wrong']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->response(['status' => FALSE, 'error' => ['Password update failed']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->response(['status' => FALSE, 'error' => ['Username or email is incorrect']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$error[] = 'Invalid username format.';\n\t\t\t$this->response(['status' => FALSE, 'error' => $error], REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\n\t}", "public function regeneratePassword(string $email): void;", "function makeUser($firstname, $lastname, $username, $email, $department, $isReadOnly){\n $password = genPassword(7);\n $md5_password = md5($password);\n sqlQuery(\"INSERT INTO users SET user_firstname='$firstname', user_lastname='$lastname', user_username='$username', user_email='$email', user_isreadonly='$isReadOnly', user_department='$department', user_password='$md5_password'\");\n sendSignupEmail(getUserId($username), $password);\n alog(\"Added user $username\");\n}", "public static function password() {\n if ( !isset($_POST['email']) ) {\n return;\n }\n \n $password = substr(Helper::hash(rand(0,16^32).$_POST['email']),0,12);\n \n $result = Database::checkUser($_POST['email']);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Unbekannter Benutzer!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n return;\n }\n \n $id = $result[0]['id'];\n $passwordold = $result[0]['password'];\n \n $pw = Helper::hash($password.$_POST['email']);\n \n $success = Database::setPassword($id,$passwordold,$pw);\n if ( $success !== false ) {\n self::passwordMail($_POST['email'],$password);\n self::setError('Ein neues Passwort wurde dir zugeschickt!<br>');\n } else {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n }\n }", "public function setpassword(){\n\t\t$args = $this->getArgs();\n\t\t$out = $this->getModel()->getUserDataByRenewToken(UserController::getRenewTokenHash($args[\"GET\"][\"token\"]));\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "static function password_forgot() {\n $model = \\Auth::$model;\n\n # hash GET param exists\n if (!$hash = data('hash'))\n go('/');\n\n # user hash exists\n $user = $model::first(array(\n 'fields' => 'id, email, name',\n 'where' => \"hash_password_forgot = '$hash'\"\n ));\n\n if (empty($user))\n go('/');\n\n # POST passwords sent\n if ($model::data()) {\n $user->password = $model::data('password');\n $user->password_confirm = $model::data('password_confirm');\n\n # validate passwords\n if ($user->validate()) {\n $user->password = auth_encrypt($user->password);\n $user->hash_password_forgot = '';\n\n $user->edit() ?\n flash('Sua senha foi alterada com sucesso.') :\n flash('Algo ocorreu errado. Entre em contrato com a empresa.', 'error');\n\n go('/');\n }\n }\n\n globals('user', $user);\n }", "public function forgotpasswordAction() {\n $form = new Admin_Form_ResendPassword();\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->_request->getPost())) {\n //check user is registered\n $values = $form->getValues();\n $siteUsersMapper = new Application_Model_Table_AdminUsers();\n $exists = $siteUsersMapper->fetchByUsername($values['email_address']);\n if($exists){\n //user exists\n $recoveryEmailsMapper = new Application_Model_Table_AdminUserRecoveryEmails();\n $recoveryEmail = $recoveryEmailsMapper->createRow();\n $recoveryEmail->admin_user_id = $exists->admin_user_id;\n $recoveryEmail->email_address = $exists->username;\n $recoveryEmail->hashActivationKey();\n $recoveryEmail->save();\n }\n $this->_helper->FlashMessenger->addMessage('You password has been reset, please check your email' , 'successful');\n $this->_helper->redirector->goToRouteAndExit(array(), 'admin-dashboard', true);\n }\n }\n $this->view->form = $form;\n }", "public function testSendPasswordRecoveryEmail()\n {\n }", "protected function handleGeneratePasswordTemplate()\n {\n $id = $this->config['passwordsetting']['generatepasswordtmpl'];\n if (empty($id)) {\n return;\n }\n $bodyHtml = $this->getEmailTemplateBodyHtml($id);\n $find = '<p> $contact_user_link_guid </p>';\n\n if (!empty($bodyHtml) && false !== strpos($bodyHtml, $find)) {\n $replace = '<p> <a title=\"$contact_user_link_guid\" href=\"$contact_user_link_guid\">$contact_user_link_guid</a> </p>';\n $bodyHtml = str_replace($find, $replace, $bodyHtml);\n\n $this->updateEmailTemplateBodyHtml($id, $bodyHtml);\n }\n }", "private function generatePassword() {\n // account is not wide open if conventional logins are permitted\n $guid = '';\n\n for ($i = 0; ($i < 8); $i++) {\n $guid .= sprintf(\"%x\", mt_rand(0, 15));\n }\n\n return $guid;\n }", "function register_resend_email($email) {\n\t\tglobal $pdo;\n\n\t\t//delete old registration attempts\n\t\t$pdo->query(\"DELETE FROM user WHERE verified = 0 AND TIME_TO_SEC(TIMEDIFF(CURRENT_TIMESTAMP, code_generation_time)) > 600\");\n\n\t\t//empty or array check\n\t\tif(empty($email) || is_array($email)) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t//check if email exists and is not verified\n\t\t$sql = \"SELECT name, verification_code FROM user WHERE REPLACE(email, \\\".\\\", \\\"\\\") = REPLACE(:email, \\\".\\\", \\\"\\\") AND verified = 0\";\n\t\t$sth = $pdo->prepare($sql);\n\t\t$sth->bindValue(\":email\", mail_simplify($email), PDO::PARAM_STR);\n\t\t$sth->execute();\n\n\t\tif($sth->rowCount() == 0) {\n\t\t\t//check if email exists but is already verified\n\t\t\t$sql = \"SELECT id FROM user WHERE REPLACE(email, \\\".\\\", \\\"\\\") = REPLACE(:email, \\\".\\\", \\\"\\\") AND verified = 1\";\n\t\t\t$sth2 = $pdo->prepare($sql);\n\t\t\t$sth2->bindValue(\":email\", mail_simplify($email), PDO::PARAM_STR);\n\t\t\t$sth2->execute();\n\n\t\t\tif($sth2->rowCount() == 0) {\n\t\t\t\treturn 2;\n\t\t\t} else {\n\t\t\t\treturn 3;\n\t\t\t}\n\t\t}\n\n\t\t//get data required for email\n\t\t$name_verification_code = $sth->fetch();\n\t\t$name = $name_verification_code[\"name\"];\n\t\t$verification_code = $name_verification_code[\"verification_code\"];\n\n\t\t$reg_link = \"https://swapitg.com/firstlogin/$verification_code\";\n\t\t$subject = \"Registration\";\n\t\t$mailfile = fopen(__DIR__ . \"/register_mail_template.html\", \"r\") or die(\"Unable to open file!\");\n\t\t$message = strtr(fread($mailfile, filesize(__DIR__ . \"/register_mail_template.html\")), array('$reg_link' => $reg_link, '$name' => htmlspecialchars($name)));\n\t\tfclose($mailfile);\n\t\t$sender_email = \"[email protected]\";\n\t\t$sender_name = \"SwapitG no-reply\";\n\n\t\t//send email\n\t\tif(mail($email, $subject, wordwrap($message, 70, \"\\r\\n\"), \"From: $sender_name<$sender_email>\\r\\nContent-type: text/html; charset=utf-8\", \" -f \" . $sender_email)) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn 4;\n\t\t}\n\t}", "public function verifyAction()\n {\n $email = Request::post('email', Filter::FILTER_EMAIL, false);\n\n if (!$email || !Validator_Email::validate($email)) {\n Response::jsonError($this->moduleLang->get('email_invalid'));\n }\n\n $model = Model::factory('User');\n\n $userIds = $model->getList(\n ['limit' => 1],\n [\n 'email' => $email,\n 'enabled'=> true\n ],\n ['id']\n );\n\n if (count($userIds) == 0) {\n Response::jsonError($this->moduleLang->get('email_user_unknown'));\n }\n\n $userId = $userIds[0]['id'];\n\n $user = Db_Object::factory('User', $userId);\n $authCode = Utils::hash(uniqid(time(),true));\n\n $confDate = new DateTime('now');\n $confDate = $confDate->add(new DateInterval('P1D'))->format('Y-m-d H:i:s');\n\n try{\n $user->setValues(array(\n 'confirmation_code' => $authCode,\n 'confirmation_expiried' => $confDate\n ));\n if(!$user->save())\n throw new Exception('Cannot update user info');\n }catch (Exception $e){\n Response::jsonError($this->_lang->get('CANT_EXEC'));\n }\n\n $this->sendEmail($user);\n\n Response::jsonSuccess(array(\n 'msg' => $this->moduleLang->get('pwd_success')\n ));\n }", "function procForgotPass() {\n global $database, $session, $mailer, $form;\n /* Username error checking */\n $subuser = $_POST['user'];\n $field = \"user\"; //Use field name for username\n if (!$subuser || strlen($subuser = trim($subuser)) == 0) {\n $form->setError($field, \"Username not entered<br>\");\n } else {\n /* Make sure username is in database */\n $subuser = stripslashes($subuser);\n if (strlen($subuser) < 5 || strlen($subuser) > 30 ||\n !eregi(\"^([0-9a-z])+$\", $subuser) ||\n (!$database->usernameTaken($subuser))) {\n $form->setError($field, \"Username does not exist<br>\");\n }\n }\n\n /* Errors exist, have user correct them */\n if ($form->num_errors > 0) {\n $_SESSION['value_array'] = $_POST;\n $_SESSION['error_array'] = $form->getErrorArray();\n }\n /* Generate new password and email it to user */ else {\n /* Generate new password */\n $newpass = $session->generateRandStr(8);\n\n /* Get email of user */\n $usrinf = $database->getUserInfo($subuser);\n $email = $usrinf['email'];\n\n /* Attempt to send the email with new password */\n if ($mailer->sendNewPass($subuser, $email, $newpass)) {\n /* Email sent, update database */\n $database->updateUserField($subuser, \"password\", md5($newpass));\n $_SESSION['forgotpass'] = true;\n }\n /* Email failure, do not change password */ else {\n $_SESSION['forgotpass'] = false;\n }\n }\n\n header(\"Location: \" . $session->referrer);\n }", "function wp_generate_password($length = 12, $special_chars = \\true, $extra_special_chars = \\false)\n {\n }", "function validateAndSend($user_email){\n\t\t\t$userPassword = $this->manage_content->getValue_email('owner_info','password','owner_email',$user_email);\n\t\t\tif(isset($userPassword[0]['password']))\n\t\t\t{\t\n\t\t\t\t$message = \"Your password for the account is\".$userPassword[0]['password'];\n\t\t\t\t$mailsent = $this->mail_function->sendMail($user_email,$message,$user_email);\n\t\t\t\treturn $mailsent;\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"Invalid user.\";\n\t\t\t}\n\n\t\t}", "public static function generatePassword() {\r\n return StringGenerator::generateRandomAlphaAndNumbersAndSpecial(12);\r\n }", "public function request_password($email)\n \t{\n\t//Get the userid from their email address\n\t$getuserid = $this->db->query_first(\"\n\t\t\tSELECT userid\n\t\t\tFROM \".TABLE_PREFIX.\"user\n\t\t\tWHERE email = '\" . $this->db->escape_string($email) . \"'\");\n\t//Gets list of users with the email address\n\t$users = $this->db->query_read_slave(\"\n\t\tSELECT userid, username, email, languageid\n\t\tFROM \" . TABLE_PREFIX . \"user\n\t\tWHERE email = '\" . $this->db->escape_string($email) . \"'\n\t\");\n\tif ($this->db->num_rows($users))\n\t{\n\t\t//Loops through users\n\t\twhile ($user = $this->db->fetch_array($users))\n\t\t{\n\t\t\t//If the userid's do not match up with whats in the database\n\t\t\tif ($getuserid['userid'] AND $getuserid['userid'] != $user['userid'])\n\t\t\t{\n\t\t\t\t//Exit the loop\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//Set vb username\n\t\t\t$user['username'] = unhtmlspecialchars($user['username']);\n\t\t\t//Generate new activation id\n\t\t\t$user['activationid'] = build_user_activation_id($user['userid'], 2, 1);\n\t\t\t//Use custom phrase and send out lost password email\n\t\t\teval(fetch_email_phrases('lostpw', $user['languageid']));\n\t\t\tvbmail($user['email'], $subject, $message, true);\n\t\t}\n\t\t//Return as a success\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\treturn \"No account with that email address exists, please try again.\";\n\t}\n\t\t\n\t}", "protected function emailPassword($snum, $first_name, $last_name)\n {\n $conn = Doctrine_Manager::getInstance();\n $guard_user = Doctrine_Core::getTable('sfGuardUser')->findOneBy('username', array($snum));\n \n //fetch the first 'domain' from the table and set it to $domain\n $domain = Doctrine_Core::getTable('Email')->createQuery('a')->fetchOne()->getDomain();\n\n if ($guard_user == null)\n $guard_user = new sfGuardUser();//FIXME this step useful but only if used as part of the import/addStudents functions. As it is this is just unnecessary as is the following code which is repeated in all 3 functions\n\n $email = 's' . $snum . '@'.$domain;\n\n $password = $this->random_password();\n $guard_user->setUsername($snum);\n $guard_user->setPassword($password);\n $guard_user->setFirstName($first_name);\n $guard_user->setLastName($last_name);\n $guard_user->setIsActive(true);\n $guard_user->setIsSuperAdmin(false);\n \n $guard_user->save();\n\n $message = \"Dear \" . $guard_user->getFirstName() . \",\" . PHP_EOL . PHP_EOL . \n \"Your account has been created for the Project Allocation and Nomination System.\" . PHP_EOL . PHP_EOL .\n \"Username: \" . $snum . PHP_EOL .\n \"Password: \" . $password . PHP_EOL . PHP_EOL .\n \"Please follow the link to access the system.\" . PHP_EOL .\n \"http://\" . $this->getRequest()->getHost() . \n $this->getRequest()->getRelativeUrlRoot() . PHP_EOL . PHP_EOL .\n \"Thanks,\\nProject Allocation and Nomination System (PANS)\" . PHP_EOL . PHP_EOL;\n\n $headers = 'From: ' . $this->getUser()->getGuardUser()->getName() . ' <noreply@' . $domain . '>' . PHP_EOL . 'X-Mailer: PHP-' . phpversion() . PHP_EOL;\n \n $result = mail( $email,\n \"3001ICT - Your password has been created for project nominations\",\n $message,\n $headers);\n \n if ($result == false) \n return $snum;\n else \n return null;\n }", "function newUser($email, $password){\n\n}", "function sending_forgot_password_email($data, &$content) {\n\t\t// Create content\n\t\t$content = sprintf($this->ci->lang->line('auth_forgot_password_content'), \n\t\t\t$this->ci->config->item('DX_website_name'), \n\t\t\t$data['reset_password_uri'],\n\t\t\t$data['password'],\n\t\t\t$data['key'],\n\t\t\t$this->ci->config->item('DX_webmaster_email'),\n\t\t\t$this->ci->config->item('DX_website_name'));\n\t}", "static function password_forgot() {\n parent::password_forgot();\n view_var('user', globals('user'));\n }", "public function passwordEmail()\n {\n $this->validateAjax(request(), [\n 'email' => 'required|email',\n 'g-recaptcha-response' => 'sometimes|recaptcha',\n ]);\n\n if ($user = Students::where('email', request()->input('email'))->first()) {\n $token = Password::getRepository()->create($user);\n\n Mail::send(['text' => 'student.password'], ['token' => $token], function (Message $message) use ($user) {\n $message->subject(config('app.name') . ' Password Reset Link');\n $message->to($user->email);\n });\n\n flash('success', 'Password reset link emailed!');\n\n return response()->json(['reload_page' => true]);\n }\n else {\n return response()->json(['message' => trans('auth.failed')], 422);\n }\n }", "function createNewUser($nickName, $eMail, $password, $rights=2)\n {\n global $usrTableName,\n $usrSessionIDFieldType, $usrSessionIDField,\n $usrUniqueIDFieldType, $usrUniqueIDField,\n $usrEMail, $usrRightsField, $usrNicknameField, $usrPassword,\n $usrPasswordAlgorithm;\n\n\n $this->check_usrFieldTypes();\n\n $stage=0;\n try {\n $cc=db_sql(\"select count(*) from $usrTableName where $usrNicknameField='$nickName'\");\n $stage++;\n if ($cc==0) {\n\n switch (strtoupper($usrUniqueIDFieldType))\n {\n case 'INTEGER':\n $guid=intval(db_sql(\"select max($usrSessionIDField) from $usrTableName\"));\n $guid++;\n break;\n case 'CHAR':\n case 'VARCHAR':\n case 'CHARACTER VARYING':\n if (function_exists($usrPasswordAlgorithm))\n $guid=$usrPasswordAlgorithm(md5('USER_SECURITY'.y_uniqid()));\n else {\n _recordWastedTime(\"Throwing an exception \"+__FILE__+\":\"+__LINE__);\n throw new Exception(\"userPasswordAlgorithm '$usrPasswordAlgorithm' is not a recognized function\");\n }\n break;\n default: {\n _recordWastedTime(\"Throwing an exception \"+__FILE__+\":\"+__LINE__);\n throw new Exception(\"$usrTableName.$usrSessionIDField is of type '$usrSessionIDFieldType' which is not usable by userContext\");\n }\n }\n $stage++;\n\n $userData=array();\n $userData[$usrUniqueIDField]=$guid;\n $userData[$usrPassword]=$usrPasswordAlgorithm($password);\n $userData[$usrEMail]=$eMail;\n $userData[$usrRightsField]=$rights;\n $userData[$usrNicknameField]=$nickName;\n\n // die(\"plain password: '$password'<br>\\n\".var_dump($userData));\n\n $fieldList='';\n $fieldValue='';\n foreach($userData as $k=>$v) {\n if ($k>'') {\n if (db_fieldExists($usrTableName, $k)) {\n $fieldType=strtoupper(db_fieldType($usrTableName,$k));\n if (strpos(\"*$fieldType\",'CHAR')>0)\n $v=\"'$v'\";\n if ($fieldList>'') {\n $fieldList.=', ';\n $fieldValue.=', ';\n }\n $fieldList.=$k;\n $fieldValue.=$v;\n } else\n throw new Exception(\"$k does not exists in table $usrTableName\");\n }\n }\n\n $stage++;\n\n $sql=\"insert into $usrTableName ($fieldList) values ($fieldValue)\";\n // die($password.\"<br>\".$sql);\n db_sql($sql);\n $stage++;\n }\n }\n catch(Exception $e)\n {\n $aux=\"ERROR AT USER CREATION (stage: $stage) \".$e->getMessage();\n _dumpY(8,0,$aux);\n die($aux);\n }\n }", "function send_tempPass($email){\n\n\n $temp_pass = generate_temp_pass();\n $insert_to_db_pass = md5($temp_pass);\n $username = $_SESSION['username'];\n $email = htmlspecialchars($email);\n \n change_to_temp($insert_to_db_pass,$_SESSION['email'],$username);\n $to = $_SESSION['email'];\n\n $subject = \"Temporary Password\";\n\n //message to the user!\n $message = \"\n <html>\n <body style='background: #3B653D;'>\n <div>\n <h1 style = 'color:#ffffff; font-size:32px; text-align: center;'> Here is your account temporary password info $email !<br></h1>\n \n <span style = 'color:#ffffff;' font-size:20px;'> Temporary Password: $temp_pass </span><br>\n <span><a style = 'color:#ffffff;' href =http://farvlu.farmingdale.edu/~foxrc/BCS350_Project/change_password_link.php> Click here to change password </a> </span>\n \n </div>\n </body>\n </html>\";\n $headers = \"MIME-Version: 1.0\" . PHP_EOL;\n $headers .= \"Content-type:text/html;charset=UTF-8\" . PHP_EOL;\n $headers .= \"From: [email protected]\". PHP_EOL;\n mail($to,$subject,$message,$headers);\n\n}", "public function resetAndUpdatePassword() {\n $this->validate ( $this->request, $this->getRules () );\n $user = User::where ( 'email', $this->request->email )->first ();\n \n if (!empty($user) && count ( $user->toArray() ) > 0) {\n $user->password = Hash::make ( (true) ? config()->get('app.user_password'): $this->generatePassword() );\n \n $user->save ();\n $this->email = $this->email->fetchEmailTemplate ( 'admin_forgot' );\n $this->email->subject = str_replace(['##SITE_NAME##'], [config ()->get ( 'settings.general-settings.site-settings.site_name' )], $this->email->subject);\n $this->email->content = str_replace (['##USERNAME##','##FORGOTPASSWORD##'],[$user->name,'admin123'],$this->email->content );\n $this->notification->email ( $user, $this->email->subject, $this->email->content );\n return true;\n } else {\n return false;\n }\n }", "public function sendEmail()\n {\n /* @var $user User */\n $user = User::findOne([\n 'u_email' => $this->username,\n ]);\n\n if ($user) {\n if (!User::isPasswordResetTokenValid($user->password_reset_token)) {\n $user->generatePasswordResetToken();\n }\n\n if ($user->save(false)) {\n \t$userName = $user->u_name;\n $userEmail = $user->u_email;\n \t \n \tif(!empty($userName) && !empty($userEmail)) {\n $subject = \"[Price Genius]: Your Reset Password Request\";\n $resetLink = Yii::$app->urlManager->createAbsoluteUrl(['api/reset-password', 'token' => $user->password_reset_token]);\n $content = ['userName' => $userName, 'resetLink' => $resetLink];\n $promotionName = \"Forgot Password\";\n return SendMail::sendSupportMail($user->u_email, $user->u_name, $subject, $content, $promotionName);\n \t\t}\n }\n \n }\n return false;\n }", "public function forgotten_password($email)\n\t{\n\t\t$query=\"SELECT * FROM \".parent::SUFFIX.\"user_details where email='\".$email.\"'\";\n\t\t$resultpassword= mysql_query($query);\n\t\t$resultfetchquery=mysql_fetch_object($resultpassword); \n\t\t//$link=\"<a href='\".AbstractDB::SITE_PATH.\"sign_in_new.php'>Clcik here</a>\";\n\t\t$cnf=$this->automailCls->send_automail_user('forgot_password',\n\t\tarray(\n\t\t\t\t\t'first_name'=>$resultfetchquery->first_name,\n\t\t\t\t\t'last_name'=>$resultfetchquery->last_name,\n\t\t\t\t\t'email'=>$resultfetchquery->email,\n\t\t\t\t\t'username'=>$resultfetchquery->username,\n\t\t\t\t\t'password'=>base64_decode($resultfetchquery->password),\n\t\t\t\t\t'link'=>$link),\n\t\t\t\t\tarray($resultfetchquery->email));\n\t\t\t\t\t\n\t\treturn $cnf;\t\t\t\n\t}", "function userForgotPassword($userData)\n\t\t{\n\t\t\tif(isset($userData['email']) && !empty($userData['email']))\n\t\t\t{\n\t\t\t\t//get values from email id\n\t\t\t\t$user = $this->manageContent->getValue_where('user_credentials','*','email_id',$userData['email']);\n\t\t\t\tif(!empty($user[0]))\n\t\t\t\t{\n\t\t\t\t\t//set password\n\t\t\t\t\t$password = uniqid();\n\t\t\t\t\t//update the password\n\t\t\t\t\t$update_pass = $this->manageContent->updateValueWhere('user_credentials','password',md5($password),'email_id',$userData['email']);\n\t\t\t\t\t//mail to user\n\t\t\t\t\t$mailsent = $this->mailSent->forgotPasswordMail($user[0]['email_id'], $user[0]['username'], $password);\n\t\t\t\t\tif($mailsent == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$_SESSION['success'] = 'Password is sent to your mail';\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$_SESSION['warning'] = 'Mail sending unsuccessfull';\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$_SESSION['warning'] = 'Invalid EmailId';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function obtain_password() {\n $this -> load -> helper('send_email');\n $user = $this -> basic -> get_where('users', array('user_email' => $this -> input -> post('email'))) -> row();\n $this -> load -> library('form_validation');\n $this -> form_validation -> set_error_delimiters('<p>', '</p>');\n $this -> form_validation -> set_rules('email', t('email'), \"required|trim|valid_email\");\n if ($this -> form_validation -> run()) {\n if ($user != null) {\n $msg = \"<h1>Recuperación de Contraseña</h1> Sent : \" . date('m-d-Y') . \"<br/><br/>\";\n $msg .= \"Remitente: Cenline\" . \"<br/><br/><br/>\";\n $msg .= \"<i>Usted ha solicitado el servicio de recuperación de contraseña de \n Cenline Site. Sus datos de acceso son: </i> <br/> \n Email: \" . $user -> user_email . \"<br/> Contraseña: \" . $user -> user_password . \" \\</a>\";\n\n $contact_send = array('to' => $user -> user_email, 'subject' => 'Recuperación de Contraseña', 'message' => $msg);\n\n send_email($contact_send);\n } else {\n $response['html'] = t('The email user does not exist');\n $response['error'] = 1;\n echo json_encode($response);\n }\n } else {\n $response['html'] = validation_errors();\n $response['error'] = 1;\n echo json_encode($response);\n }\n }", "public static function sendEmailToResetPassword($data)\n {\n $email = $data['email'];\n $user = \\Modules\\Frontend\\Auth\\User::where('email', $email)\n ->first();\n if (empty($user)) {\n return ['rs'=>System::FAIL, 'msg'=>STheme::lang('lang.msg.user_not_exists')];\n } else {\n DB::beginTransaction();\n try {\n $newPass = Functions::generateRandomString(6);\n $user->password = Hash::make($newPass);\n $user->save();\n $params = [\n 'email' => $email,\n 'name' => $user->first_name.' '.$user->last_name,\n 'subject' => STheme::lang('lang.general.reset_password'),\n 'data' => ['newPass'=>$newPass],\n 'template' => 'mails.resetPassword'\n ];\n DB::commit();\n System::sendMail($params);\n if (Mail::failures()) {// check for failures\n return ['rs'=>System::FAIL, 'msg'=>STheme::lang('lang.msg.mail_not_send')];\n }\n Session::flash(System::FLASH_SUCCESS, STheme::lang('lang.msg.send_mail_forgot_password_success'));\n return [\n 'rs'=>System::SUCCESS,\n 'msg'=>'',\n 'redirect_url'=>'/forgot-password'\n ];\n } catch (\\Exception $e) {\n DB::rollBack();\n return ['rs'=>System::FAIL, 'msg'=>$e->getMessage()];\n }\n }\n }", "function __sendForgotPasswordEmail($id = null) {\n $id = $this->request->getData('user_id');\n if (!empty($id)) {\n $user = $this->Users->get($id);\n $email = new Email();\n $email\n ->template('reset_password_request', 'default')\n ->subject('OTP Code Request - DO NOT REPLY')\n ->emailFormat('html')\n ->setViewVars(['user' => $user,\n 'password' => $password])\n ->from('[email protected]')\n ->to($user->email)\n ->send();\n\n return true;\n }\n return false;\n }", "private function generate_pass()\n {\n echo password_hash('admin', PASSWORD_BCRYPT);\n }", "public function forgotten_password() {\n $email = $this->input->post('email');\n if (!$this->users_model->fields(array('id'))->where('email', $email)->limit(1)->get()) {\n return $this->send_error('NOT_REGISTERED');\n }\n $this->load->helper('string');\n $this->load->library('email');\n $token = random_string('sha1');\n if (!$this->users_model->where('email', $email)->update(array('forgotten_password_code' => $token, 'forgotten_password_time' => time()))) {\n return $this->send_error('ERROR');\n }\n $this->email->from(config_item('email_from'), config_item('email_from_name'))\n ->to($email)\n ->subject('Passwrod reset | Go4Slam app')\n ->message('Hello, <br><br> Press the link below to set a new password. <br><br><a href=\"' . base_url() . 'user/reset_password/' . urlencode($email) . '/' . urlencode($token) . '\">Click here</a>')\n ->set_mailtype('html');\n if (!$this->email->send()) {\n return $this->send_error('UNABLE_TO_SEND_EMAIL');\n }\n return $this->send_success();\n }", "function Trigger_CheckPasswords(&$tNG) {\r\r\n $myThrowError = new tNG_ThrowError($tNG);\r\r\n $myThrowError->setErrorMsg(\"Could not create account.\");\r\r\n $myThrowError->setField(\"password\");\r\r\n $myThrowError->setFieldErrorMsg(\"The two passwords do not match.\");\r\r\n return $myThrowError->Execute();\r\r\n}", "public function testGeneratePassword() {\n // Asking for a password 15 characters long\n $password = security::generate_password( 15 );\n\n // Make sure it's 15 characters\n $this->assertEquals( 15, strlen( $password ) );\n }", "function _generatePassword($member) {\n\t\treturn substr(\n\t\t\tMD5($member['Member']['name'] . $member['Member']['email'] . strtotime('now')), 0 , 6);\n\t}", "function UsernamesWithPassword(){\r\n\r\n // === Users' Array ===\r\n $myUsers = [\"Funke\", \"Blessin\", \"Alex\", \"Felix\", \"Danjuma\"];\r\n\r\n\r\n // Creating a new array from myUsers using randomization\r\n foreach($myUsers as $index => $value){\r\n $ToAdd = rand(100, 999);\r\n if(strlen($value) < 6){ // when lenght of myUser < 6 add 3 random numbers to myUser \r\n $finalUsername[$index] = $value.$ToAdd;\r\n } \r\n elseif(strlen($value) >= 6 && strlen($value) < 8){ // when length of username is greater than 6 and < 8 leave myUser\r\n $finalUsername[$index] = $value;\r\n } \r\n else{// when myUser is > 8 echo\r\n echo \"Username cannot be less than 6 or more than 8 characters\";\r\n return;\r\n } \r\n }\r\n\r\n // === Password array ===\r\n $Password = [\"mjk\", \"hgt\", \"old\", \"plr\", \"yho\"];\r\n\r\n \r\n \r\n // create new password by conncatenating old and random numbers\r\n foreach($Password as $index => $value){\r\n $ToAdd = rand(100, 999);\r\n $password = $value.$ToAdd.$value;\r\n $finalpasswords[$index] = $password;\r\n }\r\n \r\n // ===== Display Final username and password =====\r\n for ($i=0; $i < count($finalUsername); $i++) { \r\n echo \"<h2>username : {$finalUsername[$i]} <br/> password : {$finalpasswords[$i]}</h2>\";\r\n }\r\n return;\r\n}", "public function sendEmail()\n {\n /* @var $user User */\n $user = User::findOne([\n 'status' => User::STATUS_ACTIVE,\n 'email' => $this->email,\n ]);\n\n if ($user) {\n if (!User::isPasswordResetTokenValid($user->password_reset_token)) {\n $user->generatePasswordResetToken();\n }\n\n if ($user->save()) {\n\t\t\t\t$mail = new UserMails;\n\t\t\t\treturn $mail->passwordEmail($user);\n }\n }\n\n return false;\n }", "public function reset($username) {\r\n\t\tglobal $db;\r\n\t\t// Resets a users password.\r\n\t\tif (strpos($username,'@') > 0) {\r\n\t\t\t// Its an Email.\r\n\t\t\t$udata = db::get_array(\"users\",array(\"email\"=>$username));\r\n\t\t} else {\r\n\t\t\t$udata = db::get_array(\"users\",array(\"username\"=>$username));\r\n\t\t}\r\n\t\t// Check if they exist.\r\n\t\tif (count($udata) > 0) {\r\n\t\t\t// Yup\r\n\t\t\t$rand = $this->gen_rand();\r\n\t\t\t$udata = $udata[0];\r\n\t\t\t$uid = $udata['id'];\r\n\t\t\t\r\n\t\t\t// Update their account.\r\n\t\t\tdb::update(\"users\",array(\"passreset\"=>1,\"passresetkey\"=>$rand),array(\"id\"=>$uid));\r\n\t\t\t\r\n\t\t\t// Send them an email.\r\n\t\t\t$e = new email_tmpl();\r\n\t\t\t$e->init($udata['email'],\"Password Reset\");\r\n\t\t\t$e->load(\"password_reset\");\r\n\t\t\t$e->set_var(\"key\",$rand);\r\n\t\t\t$e->set_var(\"username\",$udata['username']);\r\n\t\t\t$eres = $e->send();\r\n\t\t\t\r\n\t\t\t// Add a notification too. C:\r\n\t\t\tif ($eres) {\r\n\t\t\t\t$this->notifications($uid)->create(\"Password Reset\",\"You have requested a password reset, We've sent you an Email to you containing a link to reset your password. If this wasn't you contact support immediately.\");\r\n\t\t\t\treturn array(\"res\"=>true,\"msg\"=>\"Password has been reset and Emailed to {$udata['email']}\",\"email\"=>$udata['email']);\r\n\t\t\t} else {\r\n\t\t\t\t$this->notifications($uid)->create(\"Password Reset\",\"You have requested a password reset. However we were unable to send you an Email. Please open a support ticket or contact us directly via IRC.\");\r\n\t\t\t\treturn array(\"res\"=>true,\"msg\"=>\"Password has been reset but could not be Emailed to {$udata['email']} please open a support ticket if you have account access, e.g. still logged in or talk to staff on IRC.\",\"email\"=>$udata['email']);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// Nope.\r\n\t\t\treturn array(\"res\"=>false,\"msg\"=>\"There was no such user with that Username/E-Mail!\");\r\n\t\t}\r\n\t}", "function forgot_password() {\r\n\r\n $this->layout = 'default';\r\n\r\n if(!empty($this->data))\r\n {\r\n\r\n\r\n $errorarray = array();\r\n if (isset($this->data['User']['email']) && (trim($this->data['User']['email']) == '' || trim($this->data['User']['email'])=='Type here')) {\r\n $errorarray['enter_email'] = ENTER_EMAIL;\r\n }\r\n else\r\n {\r\n // For check valid email or not\r\n if($this->IsEmail($this->data['User']['email'])==0)\r\n $errorarray['valid_email'] = ENTER_VALIDEMAIL;\r\n else\r\n {\r\n $check_email = $this->User->find('all', array('conditions' => array('email like'=>$this->data['User']['email'],'user_type like'=>'user','status LIKE'=>0)));\r\n\r\n if(empty($check_email))\r\n {\r\n $errorarray['email_not_match'] = EMAIL_NOTFOUND;\r\n }\r\n }\r\n }\r\n\r\n $this->set('errorarray',$errorarray);\r\n\r\n if(empty($errorarray))\r\n {\r\n $new_pass = $this->generatePassword(PASSWORD_LIMIT);\r\n\r\n $name = trim($check_email[0]['User']['name']);\r\n $email = trim($check_email[0]['User']['email']);\r\n\r\n //$this->email_client_forgetpass($name,$email,$new_pass);\r\n\r\n $update_user['User']['password'] = md5($new_pass);\r\n $update_user['User']['encrypt_password'] = $this->encrypt_pass($new_pass);\r\n $update_user['User']['id'] = $check_email[0]['User']['id'];\r\n\r\n// $this->pre($update_user);\r\n// $this->pre($this->data);\r\n// exit;\r\n\r\n $this->User->save($update_user);\r\n //$this->redirect(DEFAULT_ADMINURL . 'users/forgot_password/succhange');\r\n }\r\n }\r\n }", "function forgotten_password() {\n $this->load->library('form_validation');\n\n $this->form_validation->set_rules('forgot_password_identity', 'Identity (Email / Login)', 'required');\n\n // Run the validation.\n if ($this->form_validation->run()) {\n // The 'forgotten_password()' function will verify the users identity exists and automatically send a 'Forgotten Password' email.\n $response = $this->ez_auth->forgotten_password($this->input->post('forgot_password_identity'));\n\n // Save any public status or error messages (Whilst suppressing any admin messages) to CI's flash session data.\n $this->session->set_flashdata('message', $this->ez_auth->get_messages());\n\n // Redirect user.\n redirect();\n }\n else {\n // Set validation errors.\n $this->data['message'] = validation_errors('<p class=\"error_msg\">', '</p>');\n\n return FALSE;\n }\n }", "public function forgotPassword()\n {\n $email = $this->input->post('email');\n $token = bin2hex(random_bytes(25));\n\n $user_id = $this->authentication_helper->checkEmail($email);\n\n if (isset($user_id) && !empty($user_id)) \n {\n $status = $this->authentication_worker->createToken($token, $user_id);\n if ($status) {\n $to_email = $email;\n $subject = \"Redefina sua senha\";\n $url = site_url('authentication/resetNewPassword' . \"?token=\" . $token);\n $message = \"Redefina sua senha da ZZjober clicando no link<br/><a href='\" . $url. \"'>\".$url.\"</a>\";\n $this->sendMail($to_email, $subject, $message);\n $this->session->set_flashdata('success_msg', 'Verifique seu e-mail para redefinir sua nova senha através do link');\n redirect('home/Entrar');\n }\n } else {\n $this->session->set_flashdata('error_msg', 'E-mail não encontrado');\n redirect('home/Entrar');\n }\n\n }", "public function forget_password($username)\n {\n try\n {\n $stmt = $this->db->prepare(\"SELECT email FROM users WHERE email=:email LIMIT 1\");\n $stmt->execute(array(\n 'email'=> mb_strtolower($username, 'UTF-8')\n ));\n $userRow = $stmt->fetch(PDO::FETCH_ASSOC);\n if($stmt->rowCount() > 0)\n {\n $tokenreset = sha1(uniqid().$username);\n $linkreset = \"http://interminale.fr.nf/forget_password?email=\".$username.\"&token=\".$tokenreset;\n\n $addmdpoublie = $this->db->prepare(\"INSERT INTO forget_password(email,token) VALUES(:email, :token)\");\n $addmdpoublie->execute(array(\n 'email'=> mb_strtolower($username, 'UTF-8'),\n 'token' => $tokenreset\n ));\n\n require $_SERVER['DOCUMENT_ROOT'].'/app/controllers/phpmailer/PHPMailerAutoload.php';\n\n // Retrieve the email template required\n $msg_html = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/app/view/email-forgetpassword.template.html');\n\n // Replace the % with the actual information\n $msg_html = str_replace('%linkreset%', $linkreset, $msg_html);\n\n $mail = new PHPMailer;\n $mail->isSMTP();\n $mail->SMTPDebug = 0;\n $mail->Debugoutput = 'html';\n $mail->Host = 'smtp.gmail.com';\n $mail->Port = 587;\n $mail->SMTPSecure = 'tls';\n $mail->SMTPAuth = true;\n $mail->Username = \"[email protected]\";\n $mail->Password = \"~Py+Ai3j(O5g8!\";\n $mail->isHTML(true);\n $mail->CharSet = 'UTF-8';\n $mail->setFrom('[email protected]', 'Interminale');\n $mail->addReplyTo($username);\n $mail->addAddress($username);\n $mail->Subject = 'Réinitialisation mot de passe - Interminale';\n $mail->Body = $msg_html;\n\n $mail->AltBody = strip_tags($msg_html);\n\n //send the message, check for errors\n if (!$mail->send()) {\n $message = array('status' => 0, 'err' => \"L'email n'a pas pu être envoyé :/ Réessayez.\");\n return $message;\n } else {\n $message = array('status' => 1, 'err' => 'Un mail a été envoyé à '.$username.'.<br />Cliquez sur le lien reçu pour changer le mot de passe');\n return $message;\n }\n }\n else\n {\n $message = array('status' => 0, 'err' => 'L\\'adresse mail ne conrespond à aucun compte :/');\n return $message;\n }\n }\n catch(PDOException $e)\n {\n die('<h1>ERREUR LORS DE LA CONNEXION A LA BASE DE DONNEE. <br />REESAYEZ ULTERIEUREMENT</h1>');\n }\n }", "function SentVerificationEmail($email,$username,$password){\n \t$to = $email;\n\t$subject = 'DoggieCare Forget Password';\n\t$message = 'Username ='.$username.' || Password='.$password;\n\t$headers = 'From: [email protected]' . \"\\r\\n\" .\n 'Reply-To: [email protected]' . \"\\r\\n\" .\n 'X-Mailer: PHP/' . phpversion();\n\nmail($to, $subject, $message, $headers);\n \n }", "function notify_password($username, $password) {\n\n $conn = db_connect();\n $result = $conn->query(\"select email from user\n where username='\".$username.\"'\");\n if (!$result) {\n throw new Exception('Could not find email address.');\n } else if ($result->num_rows == 0) {\n throw new Exception('Could not find email address.');\n // username not in db\n } else {\n $row = $result->fetch_object();\n $email = $row->email;\n $from = \"From: support@phpbookmark \\r\\n\";\n $mesg = \"Your PHPBookmark password has been changed to \".$password.\"\\r\\n\"\n .\"Please change it next time you log in.\\r\\n\";\n\n if (mail($email, 'PHPBookmark login information', $mesg, $from)) {\n return true;\n } else {\n throw new Exception('Could not send email.');\n }\n }\n}", "function generate_password($username, $password1, $password2) {\n $password1 = $password2 = wp_generate_password();\n }", "public function testRegisterRepeatedEmail() {\n\t\t$data = $this->getUserData(\n\t\t\t'othrus',\n\t\t\t$this->first_name,\n\t\t\t$this->surname,\n\t\t\t$this->email\n\t\t);\n\t\t\n\t\t$response = $this->call('POST','v1/users', $data);\n\t\t$resp_data = $response->getData();\n\t\t\n\t\t$this->assertResponseStatus(400);\n\t\t$this->assertTrue($resp_data->error);\n\t}", "protected function composeEmailToUser()\n\t{\n\t\t$theURL = ( empty($this->myReentryURL) ?\n\t\t\t\t$this->composeReentryURL() : $this->myReentryURL ) ;\n\t\t$s = $this->model->getRes( 'account/email_body_pwd_reset_instr/'\n\t\t\t. $this->myEmailAddr . '/'\n\t\t\t. $this->getRandomCharsFromToken() )\n\t\t\t. '<a href=\"' . $theURL . '\">' . $theURL . '</a>'\n\t\t\t;\n\t\treturn $s ;\n\t}", "function password_change($email) {\n\t\tglobal $pdo;\n\n\t\t//empty or array check\n\t\tif(empty($email) || is_array($email)) {\n\t\t\treturn 1;\n\t\t}\n\n\t\t//check if user exists\n\t\t$sql = \"SELECT id FROM user WHERE REPLACE(email, \\\".\\\", \\\"\\\") = REPLACE(:email, \\\".\\\", \\\"\\\") AND verified = 1\";\n\t\t$sth = $pdo->prepare($sql);\n\t\t$sth->bindValue(\":email\", mail_simplify($email), PDO::PARAM_STR);\n\t\t$sth->execute();\n\n\t\tif($sth->rowCount() == 0) {\n\t\t\treturn 2;\n\t\t}\n\n\t\t//get the id of the user\n\t\t$id = $sth->fetch()[\"id\"];\n\n\t\t//generate verification code\n\t\t$verification_code = hash(\"sha256\", microtime() . (string)rand() . $email);\n\n\t\t//get data required for email\n\t\t$change_link = \"https://swapitg.com/changepassword/$verification_code\";\n\t\t$subject = \"Change Passsword\";\n\t\t$mailfile = fopen(__DIR__ . \"/change_password_mail_template.html\", \"r\") or die(\"Unable to open file!\");\n\t\t$message = strtr(fread($mailfile, filesize(__DIR__ . \"/change_password_mail_template.html\")), array('$change_link' => $change_link));\n\t\tfclose($mailfile);\n\t\t$sender_email = \"[email protected]\";\n\t\t$sender_name = \"SwapitG no-reply\";\n\n\t\t//send email\n\t\tif(mail($email, $subject, wordwrap($message, 70, \"\\r\\n\"), \"From: $sender_name<$sender_email>\\r\\nContent-type: text/html; charset=utf-8\", \" -f \" . $sender_email)) {\n\t\t\t//set the verification code\n\t\t\t$sql = \"UPDATE user SET verification_code = :verification_code, code_generation_time = CURRENT_TIMESTAMP WHERE id = :id\";\n\t\t\t$sth = $pdo->prepare($sql);\n\t\t\t$sth->bindParam(\":verification_code\", $verification_code, PDO::PARAM_STR);\n\t\t\t$sth->bindParam(\":id\", $id, PDO::PARAM_INT);\n\t\t\t$sth->execute();\n\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn 3;\n\t\t}\n\t}", "function _mailToUser($userVoornaam, $userAchternaam, $userUsername, $userEmail, $generatedPassword) {\n $to = $userEmail;\n $subject = 'TEDxPXL registratie';\n $message = \"Beste \" . $userVoornaam . \" \" . $userAchternaam . \"\\n\\nBedankt voor uw registratie bij TEDxPXL.\\nU kan nu inloggen met \" . $userUsername . \" met als wachtwoord \" . $generatedPassword . \"\\nU zal uw wachtwoord moeten wijzigen bij de eerste keer inloggen.\\n\\nMet vriendelijke groet\\n\\nTEDxPXL Administratie\";\n $headers = 'From: [email protected]';\n if (!mail($to, $subject, $message, $headers)) {\n //echo \"Email sending failed\";\n }\n }", "function autoregister_create_new_user($itemId)\n {\n $item = Item::newInstance()->findByPrimaryKey($itemId['pk_i_id']);\n // if not exist user\n if( $item['fk_i_user_id'] == NULL ) {\n // create new user + send email\n $name = $item['s_contact_name'];\n $email = $item['s_contact_email'];\n // prepare data for register user\n $aux_password = osc_genRandomPassword();\n // clear params ....\n $input = array();\n $input['s_name'] = Params::getParam('s_name') ;\n Params::setParam('s_name', $name ); // from inserted item\n $input['s_email'] = Params::getParam('s_email') ;\n Params::setParam('s_email', $email ); // from inserted item\n $input['s_password'] = Params::getParam('s_password') ;\n Params::setParam('s_password', $aux_password ); // generated\n $input['s_password2'] = Params::getParam('s_password2') ;\n Params::setParam('s_password2', $aux_password ); // generated\n $input['s_website'] = Params::getParam('s_website') ;\n Params::setParam('s_website', '');\n $input['s_phone_land'] = Params::getParam('s_phone_land') ;\n Params::setParam('s_phone_land', '');\n $input['s_phone_mobile'] = Params::getParam('s_phone_mobile') ;\n Params::setParam('s_phone_mobile', '');\n $input['countryId'] = Params::getParam('countryId');\n Params::setParam('countryId', '');\n $input['regionId'] = Params::getParam('regionId');\n Params::setParam('regionId', '');\n $input['cityId'] = Params::getParam('cityId');\n Params::setParam('cityId', '');\n $input['cityArea'] = Params::getParam('cityArea') ;\n Params::setParam('cityArea', '');\n $input['address'] = Params::getParam('address') ;\n Params::setParam('address', '');\n $input['b_company'] = (Params::getParam('b_company') != '' && Params::getParam('b_company') != 0) ? 1 : 0 ;\n Params::setParam('b_company', '0');\n\n require_once LIB_PATH . 'osclass/UserActions.php' ;\n $userActions = new UserActions(false) ;\n $success = $userActions->add() ;\n\n switch($success) {\n case 1: osc_add_flash_ok_message( _m('The user has been created. An activation email has been sent')) ;\n $success = true;\n break;\n case 2: osc_add_flash_ok_message( _m('Your account has been created successfully')) ;\n $success = true;\n break;\n case 3: osc_add_flash_warning_message( _m('The specified e-mail is already in use')) ;\n $success = false;\n break;\n case 4: osc_add_flash_error_message( _m('The reCAPTCHA was not entered correctly')) ;\n $success = false;\n break;\n case 5: osc_add_flash_warning_message( _m('The email is not valid')) ;\n $success = false;\n break;\n case 6: osc_add_flash_warning_message( _m('The password cannot be empty')) ;\n $success = false;\n break;\n case 7: osc_add_flash_warning_message( _m(\"Passwords don't match\")) ;\n $success = false;\n break;\n }\n\n if($success) {\n Log::newInstance()->insertLog('plugin_autoregister', 'autoregister', '', $email.' '.$_SERVER['REMOTE_ADDR'], 'autoregister', osc_logged_admin_id()) ;\n // update user of item\n $user = User::newInstance()->findByEmail($email);\n Item::newInstance()->update(array('fk_i_user_id' => $user['pk_i_id'] ), array('pk_i_id' => $itemId ) );\n $item = Item::newInstance()->findByPrimaryKey($itemId);\n\n autoregister_sendMail($email, $user, $aux_password);\n\n // not activated\n if( $item['b_active'] != 1 ) {\n osc_run_hook('hook_email_item_validation', $item);\n }\n }\n\n // set params again\n Params::setParam('s_name', $input['s_name']);\n Params::setParam('s_email', $input['s_email']);\n Params::getParam('s_password', $input['s_password']) ;\n Params::getParam('s_password2', $input['s_password2']) ;\n Params::setParam('s_website', $input['s_website']);\n Params::setParam('s_phone_land', $input['s_phone_land']);\n Params::setParam('s_phone_mobile', $input['s_phone_mobile']);\n Params::setParam('countryId', $input['countryId']);\n Params::setParam('regionId', $input['regionId']);\n Params::setParam('cityId', $input['cityId']);\n Params::setParam('cityArea', $input['cityArea'] );\n Params::setParam('address', $input['address']);\n Params::setParam('b_company', $input['b_company']);\n // end\n }\n }", "function CreateUser()\n{\n$names = array(\"Micheal\",\"Chika\",\"Yakubu\",\"Bola\",\"Josephine\");\n//Username values\n\n$passwords = array(\"qwe\",\"rty\",\"uio\",\"pas\",\"dfg\");\n//Password headers values\n\n\n$errormsg = \"not allowed (Username must not exceeed 8 characters)\";\n//Error messages for unallowed characters\n\nfunction RandNum3()\n{\n$randnum=\"\";\nfor ($i=0; $i < 3; $i++) \n{\n$randnum.= rand (0,9);\n}\nreturn $randnum;\n}\n//Function to generate random 3 digits\n\nforeach ($names as $index => $user)\n{\nif (strlen($user) < 6) \n//Sort Usernames lower than 6\n{\n$newuser[$index]=$user.RandNum3();\n//add 3 random digits to Username\n}\n\nif (strlen($user) >= 6 && strlen($user) <= 8)\n//Username between 6 and 8\n{\n$newuser[$index]=$user;\n}\n\nif (strlen($user) > 8) \n//Username greater than 8\n{\necho \"<font color='red'>Error</font> <b>\".$user.\"</b> \".$errormsg.\"<br><br>\";\n//Display error\n}\n\n}\n\nforeach ($passwords as $index => $pass)\n{\n$newpass[$index]=$pass.RandNum3().$pass;\n}\n//Generate password from headers\n\n$arrlength = count($newuser);\n\nfor($x = 0; $x < $arrlength; $x++) \n{\n\necho \"<b>Username:\".$newuser[$x].\"<br>Password:\".$newpass[$x].\"</b><br><br>\";\n// Display user details\n} \n}", "public function validate_forgot_pwd($to_email_id, $username, $encrypted_password, $password) { \n $this->db->select(\"usr.user_id, usr.user_name , usr.password\");\n $this->db->from(\"tms_users usr\");\n $this->db->where(\"usr.registered_email_id\",$to_email_id);\n $this->db->where(\"usr.user_name\",$username);\n $qry = $this->db->get();\n if($qry->num_rows()>0) { \n $this->db->select(\"usr.user_id,pers.first_name, pers.last_name, pers.gender\");\n $this->db->from(\"tms_users usr\");\n $this->db->join(\"tms_users_pers pers\", \" usr.user_id=pers.user_id\");\n $this->db->where(\"usr.user_id\",$qry->row('user_id'));\n $this->db->where(\"usr.user_name\",$username);\n $qry1 = $this->db->get(); \n if($qry1->num_rows()>0) { \n $update_array=array('password'=>$encrypted_password);\n $this->db->where('user_id', $qry->row('user_id'));\n $this->db->trans_start();\n $this->db->update('tms_users',$update_array);\n $this->db->trans_complete();\n if ($this->db->trans_status() === FALSE) { \n return 'database_error';\n }\n $mail_subject= \"Your New TMS Password\";\n $data=$password;\n $mail_body = $this->get_mail_body($data,$qry1->row('first_name'),$qry1->row('gender')); \n $cc_email_id = \"\";\n $mail_result = send_mail($to_email_id,$cc_email_id,$mail_subject,$mail_body); \n if($mail_result) {\n return 'mail_sent';\n } else {\n return 'mail_not_sent';\n }\n } else { \n return 'invalid_username';\n }\n } else {\n return 'email_id_not_present';\n }\n }", "public function passes($attribute, $value)\n {\n \n $value = strtolower($value);\n\n $patternMail = \"/^[a-z0-9]+([._-][a-z0-9]+)*@([a-z0-9]+([._-][a-z0-9]+))+$/\"; \n $patternPhone = \"/^[9|8|7][0-9]{8}$/\";\n $preMail=\"\";\n $postMail=\"\";\n\n if(preg_match($patternPhone, $value)){ \n $userCheck = User::where('phone', '=', $value)->first();\n if (!empty($userCheck)) {\n\n return false;\n\n }elseif(decrypt($userCheck->password)==){\n\n }\n return true;\n\n if ($this->auth->attempt([\n 'phone' => $value,\n 'password' => $password\n ], $remember == 1 ? true : false)) {\n return true;\n }else{\n return false;\n }\n\n }elseif(preg_match($patternMail, $value )){\n\n $email = explode(\"@\", $value );\n $postMail= $email[1];\n if ($email[1]==\"yahoo.com\") {\n $preMail=$email[0];\n }elseif($email[1]==\"yahoo.es\"){\n $preMail=$email[0];\n }elseif ($email[1]==\"hotmail.com\") {\n $preMail=$email[0];\n }elseif ($email[1]==\"outlook.com\") {\n $preMail=$email[0];\n }elseif ($email[1]==\"icloud.com\") {\n $preMail=$email[0];\n }else{\n if(!strpos($email[0], \"+\")){\n $preMail=$email[0]; \n }else{\n $email=explode(\"+\", $email[0]);\n $preMail=$email[0]; \n }\n $preMail=str_replace(\".\", \"\",$email[0]); \n }\n $formattedMail = $preMail.\"@\".$postMail; \n\n if ($this->auth->attempt([\n 'mail' => $formattedMail,\n 'password' => $password\n ], $remember == 1 ? true : false)) {\n return true;\n }else{\n return true;\n }\n\n }else{ \n\n return false; \n\n } //\n }", "function genera_password($longitud,$tipo=\"alfanumerico\"){\n \nif ($tipo==\"alfanumerico\"){\n$exp_reg=\"[^A-Z0-9]\";\n} elseif ($tipo==\"numerico\"){\n$exp_reg=\"[^0-9]\";\n}\n \nreturn substr(eregi_replace($exp_reg, \"\", md5(time())) .\neregi_replace($exp_reg, \"\", md5(time())) .\neregi_replace($exp_reg, \"\", md5(time())),\n0, $longitud);\n}", "public function vxUserCreateCheck() {\n\t\t$rt = array();\n\t\t\n\t\t$rt['errors'] = 0;\n\t\t\n\t\t$rt['usr_email_value'] = '';\n\t\t/* usr_email_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow (100 sbs)\n\t\t3 => mismatch\n\t\t4 => conflict\n\t\t999 => unspeicific */\n\t\t$rt['usr_email_error'] = 0;\n\t\t$rt['usr_email_error_msg'] = array(1 => '你忘记填写电子邮件地址了', 2 => '你的电子邮件地址太长了', 3 => '你的电子邮件地址看起来有问题', 4 => '这个电子邮件地址已经注册过了');\n\t\t\n\t\t$rt['usr_nick_value'] = '';\n\t\t/* usr_nick_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow (20 mbs)\n\t\t3 => invalid characters\n\t\t4 => conflict\n\t\t999 => unspecific */\n\t\t$rt['usr_nick_error'] = 0;\n\t\t$rt['usr_nick_error_msg'] = array(1 => '你忘记填写昵称了', 2 => '你的昵称太长了,精简一下吧', 3 => '你的昵称中包含了不被允许的字符', 4 => '你填写的这个昵称被别人用了');\n\t\t\n\t\t$rt['usr_password_value'] = '';\n\t\t$rt['usr_confirm_value'] = '';\n\t\t/* usr_password_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow (32 sbs)\n\t\t3 => invalid characters\n\t\t4 => not identical\n\t\t999 => unspecific */\n\t\t$rt['usr_password_error'] = 0;\n\t\t$rt['usr_password_error_msg'] = array(1 => '你忘记填写密码了', 2 => '你的这个密码太长了,缩减一下吧', 3 => '你填写的密码中包含了不被允许的字符', 4 => '你所填写的两个密码不匹配');\n\t\t/* usr_confirm_error:\n\t\t0 => no error\n\t\t1 => empty\n\t\t2 => overflow (32 sbs)\n\t\t3 => invalid characters(should not reach here in final rendering)\n\t\t4 => not identical\n\t\t999 => unspecific */\n\t\t$rt['usr_confirm_error'] = 0;\n\t\t$rt['usr_confirm_error_msg'] = array(1 => '你忘记填写密码确认了', 2 => '你的这个密码确认太长了,缩减一下吧', 3 => '你填写的密码中包含了不被允许的字符', 4 => '你所填写的两个密码不匹配');\n\t\t\n\t\t$rt['c_value'] = 0;\n\t\t$rt['c_error'] = 0;\n\t\t$rt['c_error_msg'] = array(1 => '你忘记填写确认码了', 4 => '你填写的确认码是错的');\n\t\t\n\t\t/* check: c */\n\t\tif (isset($_POST['c'])) {\n\t\t\t$rt['c_value'] = strtolower(trim($_POST['c']));\n\t\t\tif (strlen($rt['c_value']) > 0) {\n\t\t\t\tif ($rt['c_value'] != strtolower($_SESSION['c'])) {\n\t\t\t\t\t$rt['c_error'] = 4;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$rt['c_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['c_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t\t\n\t\t}\n\t\t\n\t\t/* check: usr_email */\n\t\t\n\t\tif (isset($_POST['usr_email'])) {\n\t\t\t$rt['usr_email_value'] = strtolower(make_single_safe($_POST['usr_email']));\n\t\t\tif (strlen($rt['usr_email_value']) == 0) {\n\t\t\t\t$rt['usr_email_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t} else {\n\t\t\t\tif (strlen($rt['usr_email_value']) > 100) {\n\t\t\t\t\t$rt['usr_email_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t} else {\n\t\t\t\t\tif (!is_valid_email($rt['usr_email_value'])) {\n\t\t\t\t\t\t$rt['usr_email_error'] = 3;\n\t\t\t\t\t\t$rt['errors']++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_email_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\t\n\t\tif ($rt['usr_email_error'] == 0) {\n\t\t\t$sql = \"SELECT usr_email FROM babel_user WHERE usr_email = '\" . $rt['usr_email_value'] . \"'\";\n\t\t\t$rs = mysql_query($sql, $this->db);\n\t\t\tif (mysql_num_rows($rs) > 0) {\n\t\t\t\t$rt['usr_email_error'] = 4;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t\tmysql_free_result($rs);\n\t\t}\n\t\t\n\t\t/* check: usr_nick */\n\t\t\n\t\tif (isset($_POST['usr_nick'])) {\n\t\t\t$rt['usr_nick_value'] = make_single_safe($_POST['usr_nick']);\n\t\t\tif (strlen($rt['usr_nick_value']) == 0) {\n\t\t\t\t$rt['usr_nick_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t} else {\n\t\t\t\tif (mb_strlen($rt['usr_nick_value']) > 20) {\n\t\t\t\t\t$rt['usr_nick_error'] = 2;\n\t\t\t\t\t$rt['errors']++;\n\t\t\t\t} else {\n\t\t\t\t\tif (!is_valid_nick($rt['usr_nick_value'])) {\n\t\t\t\t\t\t$rt['usr_nick_error'] = 3;\n\t\t\t\t\t\t$rt['errors']++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_nick_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\tif ($rt['usr_nick_error'] == 0) {\n\t\t\t$sql = \"SELECT usr_nick FROM babel_user WHERE usr_nick = '\" . $rt['usr_nick_value'] . \"'\";\n\t\t\t$rs = mysql_query($sql, $this->db);\n\t\t\tif (mysql_num_rows($rs) > 0) {\n\t\t\t\t$rt['usr_nick_error'] = 4;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t\tmysql_free_result($rs);\n\t\t}\n\t\t\n\t\t/* check: usr_gender */\n\t\tif (isset($_POST['usr_gender'])) {\n\t\t\t$rt['usr_gender_value'] = intval($_POST['usr_gender']);\n\t\t\tif (!in_array($rt['usr_gender_value'], array(0,1,2,5,6,9))) {\n\t\t\t\t$rt['usr_gender_value'] = 9;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_gender_value'] = 9;\n\t\t}\n\t\t\n\t\t/* check: usr_password and usr_confirm */\n\t\t\n\t\tif (isset($_POST['usr_password'])) {\n\t\t\t$rt['usr_password_value'] = $_POST['usr_password'];\n\t\t\tif (strlen($rt['usr_password_value']) == 0) {\n\t\t\t\t$rt['usr_password_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_password_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\tif (isset($_POST['usr_confirm'])) {\n\t\t\t$rt['usr_confirm_value'] = $_POST['usr_confirm'];\n\t\t\tif (strlen($rt['usr_confirm_value']) == 0) {\n\t\t\t\t$rt['usr_confirm_error'] = 1;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t} else {\n\t\t\t$rt['usr_confirm_error'] = 1;\n\t\t\t$rt['errors']++;\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_error'] == 0) && ($rt['usr_confirm_error'] == 0)) {\n\t\t\tif (strlen($rt['usr_password_value']) > 32) {\n\t\t\t\t$rt['usr_password_error'] = 2;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t\tif (strlen($rt['usr_confirm_value']) > 32) {\n\t\t\t\t$rt['usr_confirm_error'] = 2;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (($rt['usr_password_error'] == 0) && ($rt['usr_confirm_error'] == 0)) {\n\t\t\tif ($rt['usr_password_value'] != $rt['usr_confirm_value']) {\n\t\t\t\t$rt['usr_confirm_error'] = 4;\n\t\t\t\t$rt['errors']++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $rt;\n\t}", "public function emailpassword($error = NULL) {\n \n $this->template->content3=View::instance('v_users_emailpassword'); \n $this->template->title= APP_NAME. \" :: Login\";\n // add required js and css files to be used in the form\n $client_files_head=Array('/js/languages/jquery.validationEngine-en.js',\n '/js/jquery.validationEngine.js',\n '/css/validationEngine.jquery.css'\n );\n $this->template->client_files_head=Utils::load_client_files($client_files_head); \n # Pass data to the view\n $this->template->content3->error = $error;\n\n echo $this->template;\n\n\n }", "public function postForgotPw(){\n\t\t//find user where email = input email\n\t\t$user = User::where('email','=',Str::lower(Input::get('email')));\n\n\t\t//if user found\n\t\tif($user->count()){\n\n\t\t\t//if match found\n\t\t\t$user \t\t\t\t\t= $user->first();\n\n\t\t\t//generate new activate code and new password\n\t\t\t$code \t\t\t\t\t= str_random(60);\n\t\t\t$password \t\t\t\t= str_random(10);\n\n\t\t\t//update value in db\n\t\t\t$user->activate_code\t= $code;\n\t\t\t$user->password_temp\t= Hash::make($password);\n\n\t\t\t//save to db\n\t\t\tif($user->save()){\n\n\t\t\t\t//send email to user with new password and activate link\n\t\t\t\tMail::send('emails.auth.forgot_mail',array('link' => URL::route('account-recover', $code), 'name' => $user->last_name, 'password'=>$password), function($message) use ($user){\n\t\t\t\t\t$message->to($user->email, $user->last_name)->subject(\"It's ok, it happens. Here is yours...\");\n\t\t\t\t});\t\t\t\t\n\t\t\t\t\n\t\t\t\t//return to forgot-pw page\n\t\t\t\treturn Redirect::route('account-forgot-pw')\n\t\t\t\t\t\t->with('global','<div class=\"alert alert-success\" role=\"alert\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"glyphicon glyphicon-envelope\" aria-hidden=\"true\"></span>\n\t\t\t\t\t\t\t\t\t\t\tNew password has been sent. Please check your mail.\n\t\t\t\t\t\t\t\t\t\t</div>');\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t//return error msg wrong old password\n\t\t\treturn Redirect::route('account-forgot-pw')\n\t\t\t\t\t->with('global','<div class=\"alert alert-danger\" role=\"alert\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"glyphicon glyphicon-exclamation-sign\" aria-hidden=\"true\"></span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"sr-only\">Error:</span>\n\t\t\t\t\t\t\t\t\t\tIncorrect Email Address. Please try again.\n\t\t\t\t\t\t\t\t\t</div>');\n\t\t}\n\t}", "function resetPassword($userEmail){\n\n}", "public function newPassword() {\n $this->form_validation->set_rules('email', 'Email', 'required');\n $this->form_validation->set_rules('temp_code', 'Temporärer Code', 'required');\n $this->form_validation->set_rules('password', 'Passwort', 'required');\n \n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n $this->loadUser();\n \n if ($this->user_model->getValue('temp_code') != $this->input->post('temp_code')) {\n \t$this->error(404, 'Verification error');\n }\n \n if ($this->user_model->getValue('temp_code_valid_until') < date('Y-m-d H:i:s')) {\n \t$this->error(408, 'Provided code not valid anymore');\n }\n \n $this->user_model->setValue(\n \t'hashed_password',\n \tpassword_hash($this->input->post('password'), PASSWORD_DEFAULT));\n \t\n if (! $this->user_model->updatePassword()) {\n \t$this->error(400, 'Error wail updating password');\n }\n \n $data['new password'] = 'set';\n $this->response($data);\n }", "protected function forgotPassword($args) {\n\n if ($args['ent_email'] == '' || $args['ent_user_type'] == '')\n return $this->_getStatusMessage(1, 1);\n\n if ($args['ent_user_type'] == '1') {\n $table = 'master';\n $uid = 'mas_id';\n } else if ($args['ent_user_type'] == '2') {\n $table = 'slave';\n $uid = 'slave_id';\n } else {\n return $this->_getStatusMessage(1, 1);\n }\n\n $selectUserQry = \"select email,password,$uid from $table where email = '\" . $args['ent_email'] . \"'\";\n $selectUserRes = mysql_query($selectUserQry, $this->db->conn);\n\n if (mysql_num_rows($selectUserRes) <= 0)\n return $this->_getStatusMessage(66, $selectUserQry);\n\n $userData = mysql_fetch_assoc($selectUserRes);\n\n $randData = $this->_generateRandomString(20) . '_' . $args['ent_user_type'];\n\n $mail = new sendAMail($this->host);\n $resetRes = $mail->forgotPassword($userData, $randData);\n\n if ($resetRes['flag'] == 0) {\n $updateResetDataQry = \"update $table set resetData = '\" . $randData . \"', resetFlag = 1 where email = '\" . $args['ent_email'] . \"'\";\n mysql_query($updateResetDataQry, $this->db->conn);\n//$resetRes['update'] = $updateResetDataQry;\n return $this->_getStatusMessage(67, $resetRes);\n } else {\n return $this->_getStatusMessage(68, $resetRes);\n }\n }", "public function dialogResetPassword(Application $app)\n {\n // get the form values\n $form = $app['request']->get('form');\n // validate the email\n $errors = $app['validator']->validateValue($form['email'], new Assert\\Email());\n if (count($errors) > 0) {\n // invalid email\n $message = '';\n foreach ($errors as $error) {\n $message .= sprintf('%s< br />', $error->getMessage());\n }\n return $this->dialogForgottenPassword($app, $message);\n }\n $Users = new Users($app);\n if (false === ($user = $Users->selectUser($form['email']))) {\n $message = 'There exists no user with the submitted email address.';\n $app['monolog']->addDebug(sprintf('[%s - %s] %s', __METHOD__, __LINE__, $message));\n return $this->dialogForgottenPassword($app, $message);\n }\n // email address is valid, so we can create a new GUID and send a mail\n if (false === ($guid = $Users->createNewGUID($form['email']))) {\n $message = 'Can\\'t create a new GUID as long the last GUID is not expired. You must wait 24 hours between the creation of new passwords.';\n $app['monolog']->addDebug(sprintf('[%s - %s] %s', __METHOD__, __LINE__, 'No GUID created, last creation within the last 24 hours.'));\n return $this->dialogForgottenPassword($app, $message);\n }\n\n // create the email body\n $body = $app['twig']->render($app['utils']->getTemplateFile(\n '@phpManufaktur/Basic/Template',\n 'framework/mail/password.create.twig'),\n array('name' => $user['displayname'], 'server' => FRAMEWORK_URL,\n 'reset_password_url' => FRAMEWORK_URL.'/password/create/'.$guid['guid']\n ));\n // create the message\n $message = \\Swift_Message::newInstance()\n ->setSubject($app['translator']->trans('kitFramework password reset'))\n ->setFrom(array(SERVER_EMAIL_ADDRESS))\n ->setTo(array($form['email']))\n ->setBody($body)\n ->setContentType('text/html');\n // send the message\n $app['mailer']->send($message);\n\n // show a response dialog\n return $app['twig']->render($app['utils']->getTemplateFile(\n '@phpManufaktur/Basic/Template',\n 'framework/password.create.twig'),\n array('email' => $form['email']));\n }", "public function createpost()\n {\n $pass = $_POST['password'];\n for($i=0;$i<5;$i++){\n $pass=md5($pass);\n }\n if($this->input->post('form_key') && $this->input->post('form_key') == $this->session->userdata('formkey'))\n {\n if($this->checkEmail(trim($this->input->post('email')))){\n $salt = $this->hash->key(8);\n $regisdate = mktime(0, 0, 0, date('m'), date('d'), date('Y'));\n $arr = array(\n 'username' => 'taikhoan',\n 'fullname' => $this->input->post('fullname'),\n 'email' => $this->input->post('email'),\n 'phone' => $this->input->post('phone'),\n 'use_regisdate' => $regisdate,\n 'use_salt' => $salt,\n 'password' => $pass,\n 'use_key' => $this->hash->create($this->input->post('fullname'), $this->input->post('fullname'), 'sha256md5'),\n 'active' => 0,\n 'lever' => 0,\n 'block'=>0,\n 'address_province' => $this->input->post('province'),\n );\n $id = $this->f_usersmodel->Add('users',$arr);\n $this->f_usersmodel->Update_Where('users', array('id' => $id),\n array('md5_id' => md5($id), 'token' => md5($this->input->post('email') . $id),));\n if (isset($id)) {\n $config = Array(\n 'protocol' => 'smtp',\n 'smtp_host' => $this->config->item('smtp_hostssl'),\n 'smtp_port' => $this->config->item('smtp_portssl'),\n 'smtp_user' => $this->config->item('smtp_user'), // change it to yours\n 'smtp_pass' => $this->config->item('smtp_pass'), // change it to yours\n 'mailtype' => 'html',\n 'charset' => 'utf-8',\n 'wordwrap' => TRUE\n );\n\n $this->load->library('email', $config);\n $user=$this->f_usersmodel->getFirstRowWhere('users',array('id'=>$id));\n $subject = $this->site_name.' - Kích hoạt tài khoản';\n $message = '\n <p>Nhấn vào link dưới đây để kích hoạt tài khoản:</p>\n <a href=\"'.base_url('users_frontend/userActive?id='.$user->md5_id.'&token='.$user->token).'\">\n '.base_url('users_frontend/userActive?id='.$user->md5_id.'&token='.$user->token).'</a>';\n\n // Get full html:\n $body =\n '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n <html xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <title>' . htmlspecialchars($subject, ENT_QUOTES, $this->email->charset) . '</title>\n <style type=\"text/css\">\n body {\n font-family: Arial, Verdana, Helvetica, sans-serif;\n font-size: 16px;\n }\n </style>\n </head>\n <body>\n ' . $message . '\n </body>\n </html>';\n\n $receiver_email = $user->email . ','.@$this->option->site_email;\n $this->email->set_newline(\"\\r\\n\");\n $this->email->from(@$this->option->site_email,'Thông tin tài khoản'); // change it to yours\n $this->email->to($receiver_email);\n $this->email->subject($subject);\n $this->email->message($body);\n if ($this->email->send()) {\n $this->session->set_flashdata(\"mess\", \"Đăng ký tài khoản thành công!\");\n redirect(base_url('dang-ky-thanh-cong?u='.$user->md5_id));\n } else {\n $this->session->set_flashdata(\"mess_err\", \"Đăng ký thành công! Lỗi gửi email\");\n redirect($_SERVER['HTTP_REFERER']);\n }\n $this->session->set_flashdata(\"mess\", \"Đăng ký tài khoản thành công!\");\n }\n }else{\n redirect($_SERVER['HTTP_REFERER']);\n }\n }\n }", "public function mail_varify(){\n \t$return = $this->login_model->mail_varify(); \t\n \tif($return){ \n \t$data['email'] = $return;\n \t$this->load->view('admin/set_password', $data); \n \t} else { \n\t \t\t$data['email'] = 'allredyUsed';\n \t$this->load->view('admin/set_password', $data);\n \t} \n }", "public function testRegistrationPasswordLessChars()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/add_user')\n ->type('username', 'Tester1')\n ->type('first_name', 'Test')\n ->type('last_name', 'User')\n ->type('password', 'a1')\n ->type('password_confirmation', 'a1')\n ->click('button[type=\"submit\"]')\n\n // we're still on the registration page\n ->waitForText('The password must be at least 6 characters.')\n ->assertSee('The password must be at least 6 characters.');\n });\n }", "public function generatePasswordResetToken()\n {\n $this->password = Yii::$app->security->generateRandomString() . '_' . time();\n }", "function user_new($user, $mail, $level)\n{\n\n if (!user_level(5) || (!isset($user, $mail, $level)) || (!is_string($user) || empty($user) || isset($user{10})) || (!is_string($mail) || empty($mail) || isset($mail{50})) || !ereg('^[1-5]$', $level)) {\n\techo \"amsd\";\n return false;\n\t}\n\n else if (!user_mail($mail)) {\n\techo \"mah\";\n return false;\n\t}\n\n $pass = RandomString();\n if (!@mysql_num_rows(mysql_query(\"SELECT `id` FROM `amsn_users` WHERE `user` = '\" . mysql_real_escape_string($user) . \"' LIMIT 1\"))) {\n if (@mysql_query(\"INSERT INTO `amsn_users` (user, pass, email, level) VALUES ('\" . mysql_real_escape_string($user) . \"', '\" . sha1($pass) . \"', '\" . mysql_real_escape_string($mail) . \"', '\" . (int)$level . \"')\")) {\n if (email($mail, \"aMSN Web administration\", \"You are now a part of the aMSN webpage administration, welcome!\\nYour username and password are the following:\\n\\n - User: $user\\n - Password: $pass\\n\\nYou can change the password anytime you want in your control panel\", \"From: aMSN Admin <[email protected]>\")) {\n mysql_query(\"DELETE FROM `amsn_users` WHERE id = '\" . mysql_insert_id() . \"' LIMIT 1\");\n\techo \"dude\";\n return false;\n } else\n return true;\n\t} else {\n\t\techo mysql_error();\n\t\techo \"insert problem\";\n\t\treturn false;\n\t}\n } else \n return false;\n\n}", "function motDePasseOublie($mail) { $userManager = new OpenClassrooms\\DWJP4\\Backend\\Model\\UsersManager();\n $emailExist = $userManager->emailExist($mail);\n if($emailExist){\n //S'il existe, on fabrique le code , on update le code , on envoi le message\n $pseudo=$emailExist[0]['USER_PSEUDO'];\n $code = codeValidation();\n //echo $pseudo;\n // echo \" code : \".$code;\n $updatePassword = $userManager->updatePsswd($code,$pseudo);\n $message = messagePasswdOublie($mail,$code);\n //echo $message;\n }else {\n //echo \"pas de mail exist\";\n }\n // on retourne sur la page d'identification\n require ('view/backend/identificationView.php'); \n}", "function reset_email()\n\t{\n\t\t$user_id\t\t= $this->uri->segment(3);\n\t\t$new_email_key\t= $this->uri->segment(4);\n\n\t\t// Reset email\n\t\tif ($this->tank_auth->activate_new_email($user_id, $new_email_key)) {\t// success\n\t\t\t$this->tank_auth->logout();\n\t\t\t$this->_show_message($this->lang->line('auth_message_new_email_activated').' '.anchor('/auth/login/', 'Login'));\n\n\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// fail\n\t\t\t$this->_show_message($this->lang->line('auth_message_new_email_failed'));\n\t\t}\n\t}" ]
[ "0.709545", "0.68329805", "0.67693996", "0.6749227", "0.66979414", "0.6665304", "0.66307354", "0.656412", "0.64873266", "0.6419626", "0.6404173", "0.6376843", "0.6341731", "0.6314451", "0.62974715", "0.6284961", "0.6277273", "0.62592727", "0.62543994", "0.6230435", "0.62228", "0.6200125", "0.6196302", "0.61760724", "0.61751735", "0.6169589", "0.61391497", "0.6137654", "0.6135426", "0.61324626", "0.610041", "0.60977966", "0.60967237", "0.60913926", "0.6089611", "0.6081953", "0.60702586", "0.6066019", "0.606313", "0.6061267", "0.6057843", "0.6053627", "0.60485446", "0.6044004", "0.6020906", "0.60197794", "0.60120064", "0.600881", "0.6007361", "0.5992954", "0.5988695", "0.59867036", "0.59759337", "0.59753144", "0.5967582", "0.5959417", "0.59580404", "0.59540766", "0.59444314", "0.5944394", "0.59357226", "0.5932745", "0.5928892", "0.59273607", "0.5923104", "0.59226716", "0.5921998", "0.5918559", "0.5913016", "0.59125406", "0.59116524", "0.5909722", "0.590305", "0.5902639", "0.590263", "0.5898471", "0.5897625", "0.5895358", "0.58886313", "0.58885777", "0.5878691", "0.58767605", "0.5876624", "0.5876537", "0.5876215", "0.587148", "0.5866317", "0.58580613", "0.5857294", "0.58556986", "0.585182", "0.5851048", "0.5850016", "0.584896", "0.58489513", "0.58458525", "0.5840243", "0.58401513", "0.5839648", "0.583549" ]
0.739786
0
iterate through users and if no role exists then set to none
public function check_access_type() { // get users $user_list = $this->get_user->get_all_users(); // check user is in access table foreach($user_list as $user) { // check if user exists $user_access = $this->get_user->user_level($user->user_id); // inserts new user into table if ($user_access == NULL && $user_access == '') { $this->get_user->insert_access($user->user_id,'student'); } // generates new password if default value of 'password' is found $this->generate_new_passwords(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_get_users_with_no_role($site_id = \\null)\n {\n }", "function wporphanageex_adopt_all_orphans() {\n\tforeach ( wporphanageex_get_all_users() as $user_id ) {\n\t\t$user = new WP_User( $user_id );\n\t\tif ( ! user_can( $user_id, 'read' ) ) {\n\t\t\t$user->set_role( wporphanageex_search_user_role( $user_id ) );\n\t\t}\n\t}\n}", "function reset_role( $role ) {\n $default_roles = array(\n 'administrator' => array(\n 'switch_themes' => 1,\n 'edit_themes' => 1,\n 'activate_plugins' => 1,\n 'edit_plugins' => 1,\n 'edit_users' => 1,\n 'edit_files' => 1,\n 'manage_options' => 1,\n 'moderate_comments' => 1,\n 'manage_categories' => 1,\n 'manage_links' => 1,\n 'upload_files' => 1,\n 'import' => 1,\n 'unfiltered_html' => 1,\n 'edit_posts' => 1,\n 'edit_others_posts' => 1,\n 'edit_published_posts' => 1,\n 'publish_posts' => 1,\n 'edit_pages' => 1,\n 'read' => 1,\n 'level_10' => 1,\n 'level_9' => 1,\n 'level_8' => 1,\n 'level_7' => 1,\n 'level_6' => 1,\n 'level_5' => 1,\n 'level_4' => 1,\n 'level_3' => 1,\n 'level_2' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'edit_others_pages' => 1,\n 'edit_published_pages' => 1,\n 'publish_pages' => 1,\n 'delete_pages' => 1,\n 'delete_others_pages' => 1,\n 'delete_published_pages' => 1,\n 'delete_posts' => 1,\n 'delete_others_posts' => 1,\n 'delete_published_posts' => 1,\n 'delete_private_posts' => 1,\n 'edit_private_posts' => 1,\n 'read_private_posts' => 1,\n 'delete_private_pages' => 1,\n 'edit_private_pages' => 1,\n 'read_private_pages' => 1,\n 'delete_users' => 1,\n 'create_users' => 1,\n 'unfiltered_upload' => 1,\n 'edit_dashboard' => 1,\n 'update_plugins' => 1,\n 'delete_plugins' => 1,\n 'install_plugins' => 1,\n 'update_themes' => 1,\n 'install_themes' => 1,\n 'update_core' => 1,\n 'list_users' => 1,\n 'remove_users' => 1,\n 'add_users' => 1,\n 'promote_users' => 1,\n 'edit_theme_options' => 1,\n 'delete_themes' => 1,\n 'export' => 1,\n ),\n \n 'editor' => array(\n 'moderate_comments' => 1,\n 'manage_categories' => 1,\n 'manage_links' => 1,\n 'upload_files' => 1,\n 'unfiltered_html' => 1,\n 'edit_posts' => 1,\n 'edit_others_posts' => 1,\n 'edit_published_posts' => 1,\n 'publish_posts' => 1,\n 'edit_pages' => 1,\n 'read' => 1,\n 'level_7' => 1,\n 'level_6' => 1,\n 'level_5' => 1,\n 'level_4' => 1,\n 'level_3' => 1,\n 'level_2' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'edit_others_pages' => 1,\n 'edit_published_pages' => 1,\n 'publish_pages' => 1,\n 'delete_pages' => 1,\n 'delete_others_pages' => 1,\n 'delete_published_pages' => 1,\n 'delete_posts' => 1,\n 'delete_others_posts' => 1,\n 'delete_published_posts' => 1,\n 'delete_private_posts' => 1,\n 'edit_private_posts' => 1,\n 'read_private_posts' => 1,\n 'delete_private_pages' => 1,\n 'edit_private_pages' => 1,\n 'read_private_pages' => 1,\n ),\n \n 'author' => array(\n 'upload_files' => 1,\n 'edit_posts' => 1,\n 'edit_published_posts' => 1,\n 'publish_posts' => 1,\n 'read' => 1,\n 'level_2' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'delete_posts' => 1,\n 'delete_published_posts' => 1,\n ),\n \n 'contributor' => array(\n 'edit_posts' => 1,\n 'read' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'delete_posts' => 1,\n ),\n \n 'subscriber' => array(\n 'read' => 1,\n 'level_0' => 1,\n ),\n \n 'display_name' => array(\n 'administrator' => 'Administrator',\n 'editor'\t=> 'Editor',\n 'author'\t=> 'Author',\n 'contributor' => 'Contributor',\n 'subscriber'\t=> 'Subscriber',\n ),\n \n );\n \n $role = strtolower( $role );\n \n remove_role( $role );\n \n return add_role( $role, $default_roles['display_name'][$role], $default_roles[$role] );\n}", "function _requireUserRolesDropdown() {\n\n\t\t//p($this->mcontents['aAllRoles']);\n\n\t\t$this->mcontents['aAllUserRoles'][0] = 'All';\n\t\tforeach( $this->mcontents['aAllRoles'] AS $sName => $aItem ) {\n\n\t\t\t$this->mcontents['aAllUserRoles'][ $aItem['id'] ] = $aItem['title'];\n\t\t}\n\t}", "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}", "function populate_roles()\n {\n }", "function sync_roles( $user ) {\n\t\tif ( array_key_exists( $this->auth_host_index, $this->config->roles) ) {\n $role_id = $this->config->roles[$this->auth_host_index];\n if ( $role_id != 0 ) {\n $systemcontext = get_context_instance( CONTEXT_SYSTEM );\n role_assign( $role_id, $user->id, $systemcontext->id, 'auth_imap_plus' );\n }\n }\n\t}", "private function checkRoles()\n {\n // populate roles\n if(array_key_exists('userid', $_SESSION))\n $_SESSION['roles'] = $this->Role_expert->getRoles($_SESSION['userid'], $_SESSION['groupid']);\n //@todo\n }", "public static function unautorize_enrol_users_returns() {\n\t\treturn null;\n\t}", "function get_current_user_role($user_id) {\n $user = new WP_User( $user_id );\n if ( !empty( $user->roles ) && is_array( $user->roles ) ) {\n return $user->roles;\n }\n \n return ;\n}", "public function getUserDefaultRoles();", "function populatePotentialUsers($roleID)\r\n\t{\r\n\t\t$sqlquery = \"select user.id, user.user_name, user.first_name,\r\n \t\t\t\t\tuser.last_name, user.email_address\r\n \t\t\t from\tlsc_users user\r\n \t\t\t where\tuser.is_active = '1'\r\n \t\t\t and\tuser.id not in\r\n \t\t\t\t\t(\r\n \t\t\t\t\t\tselect \trolemap.user_id\r\n \t\t\t\t\t\tfrom\tlsc_role_user_mapping rolemap\r\n \t\t\t\t\t\twhere\trolemap.is_active = '1'\r\n \t\t\t\t\t\tand\t\trolemap.role_id = \".$roleID. \")\";\r\n\r\n\t\t$potentialUsers_data = $this->dbUtil->executeSelect($sqlquery);\r\n\t\treturn $potentialUsers_data;\r\n\t}", "public function rolesForUser();", "function cjpopups_user_role($user_info_or_id){\n\tglobal $wpdb, $wp_roles;\n\tif(is_array($user_info_or_id)){\n\t\t$uid = cjpopups_user_info($user_info_or_id, 'ID');\n\t}else{\n\t\t$uid = $user_info_or_id;\n\t}\n\t$user = get_userdata( $uid );\n\tif($user && !empty($user->roles)){\n\t\t$capabilities = $user->{$wpdb->prefix . 'capabilities'};\n\t\tif ( !isset( $wp_roles ) ){\n\t\t\t$wp_roles = new WP_Roles();\n\t\t}\n\t\tforeach ( $wp_roles->role_names as $role => $name ){\n\t\t\tif ( array_key_exists( $role, $capabilities ) ){\n\t\t\t\treturn $role;\n\t\t\t}\n\t\t}\n\t}else{\n\t\treturn 'non-user';\n\t}\n}", "function hook_roles() {\n\t\treturn null;\n\t}", "function wporphanageex_search_user_role( $user_id = false ) {\n\tglobal $wpdb, $current_user;\n\n\t$current_user = wp_get_current_user();\n\tif ( ! $user_id ) {\n\t\t$user_id = $current_user->ID;\n\t}\n\n\t$prefixes = get_option( 'wporphanageex_prefixes' );\n\tif ( $prefixes && is_array( $prefixes ) ) {\n\t\tforeach ( $prefixes as $prefix ) {\n\t\t\t$role = get_user_meta( $user_id, $prefix . 'capabilities', true );\n\t\t\tif ( $role != '' && is_array( $role ) ) {\n\t\t\t\tforeach ( $role as $key => $value ) {\n\t\t\t\t\treturn $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// if no one was found, return default role\n\t$default = get_option( 'wporphanageex_role' );\n\treturn $default;\n}", "function populate_roles_270()\n {\n }", "public static function autorize_enrol_users_returns() {\n\t\treturn null;\n\t}", "function populate_roles_280()\n {\n }", "function populate_roles_210()\n {\n }", "function current_user_roles($user_id = null)\n{\n if (!is_null($user_id)) {\n return \\Yii::$app->authManager->getRolesByUser($user_id);\n }\n\n// return \\base\\libs\\Redis::getUserRoles($user_id);\n}", "function populate_roles_230()\n {\n }", "public function run()\n {\n User::find(1)->assignRole('admin');\n foreach (User::all() as $user) {\n if ($user->id == 1) {\n continue;\n }\n $user->assignRole('user');\n\n }\n }", "public function resetExaminedFlagForAllUsers();", "function user_role_need ($role) {\r\n\t$info = user_info();\r\n\treturn ($info[3] == $role ? true : false);\r\n}", "public function testSetRoleUsers()\n {\n }", "function get_user_roles()\n{\n $roles = get_acl()->getRoles();\n foreach ($roles as $key => $val) {\n $roles[$val] = __(Inflector::humanize($val));\n unset($roles[$key]);\n }\n return $roles;\n}", "function editable_roles( $roles ){\n if( isset( $roles['administrator'] ) && !current_user_can('administrator') ){\n unset( $roles['administrator']);\n }\n return $roles;\n }", "public function init_roles()\n {\n }", "function populate_roles_250()\n {\n }", "protected function initRoles()\n {\n $this->roles = new ArrayCollection();\n }", "function roles_dashboard_upgrade() {\n\tif (!elgg_is_admin_logged_in()) {\n\t\treturn;\n\t}\n\n\t$dbprefix = elgg_get_config('dbprefix');\n\t$roles = roles_get_all_selectable_roles();\n\tif (empty($roles)) {\n\t\treturn;\n\t}\n\t$role_guids = array();\n\tforeach ($roles as $role) {\n\t\t$role_guids[] = (int) $role->guid;\n\t}\n\t$role_guids_in = implode(',', $role_guids);\n\n\t$subtype_id = (int) get_subtype_id('object', MultiDashboard::SUBTYPE);\n\n\t// Grab users that have been assigned a role but that role does not have a dashboard\n\t$users = new ElggBatch('elgg_get_entities', array(\n\t\t'types' => 'user',\n\t\t'joins' => array(\n\t\t\t\"JOIN {$dbprefix}entity_relationships er ON e.guid = er.guid_one\n\t\t\t\tAND er.relationship = 'has_role'\n\t\t\t\tAND er.guid_two IN ($role_guids_in)\",\n\t\t),\n\t\t'wheres' => array(\n\t\t\t\"NOT EXISTS (SELECT 1 FROM {$dbprefix}entities e2\n\t\t\t\tJOIN {$dbprefix}entity_relationships er2 ON er2.guid_one = e2.guid\n\t\t\t\tWHERE e2.owner_guid = e.guid\n\t\t\t\t\tAND e2.subtype = $subtype_id\n\t\t\t\t\tAND er2.relationship = 'dashboard_for'\n\t\t\t\t\tAND er2.guid_two = er.guid_two)\"\n\t\t),\n\t\t'limit' => 0,\n\t));\n\n\t$users->setIncrementOffset(false);\n\n\t$fixed = $error = 0;\n\tforeach ($users as $user) {\n\t\tforeach ($roles as $role) {\n\t\t\t$relationship = check_entity_relationship($user->guid, 'has_role', $role->guid);\n\t\t\tif (!$relationship) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// check if role-specific dashboard exists\n\t\t\t$dashboards = elgg_get_entities_from_relationship(array(\n\t\t\t\t'types' => 'object',\n\t\t\t\t'subtypes' => MultiDashboard::SUBTYPE,\n\t\t\t\t'owner_guid' => $user->guid,\n\t\t\t\t'relationship' => 'dashboard_for',\n\t\t\t\t'relationship_guid' => $role->guid,\n\t\t\t\t'inverse_relationship' => true,\n\t\t\t\t'count' => true,\n\t\t\t));\n\n\t\t\tif (!$dashboards) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$dashboard = new ElggObject();\n\t\t\t$dashboard->subtype = MultiDashboard::SUBTYPE; // not using MultiDashboard instantiation due to problems with save() overwriting values\n\t\t\t$dashboard->owner_guid = $user->guid;\n\t\t\t$dashboard->container_guid = $user->guid;\n\t\t\t$dashboard->title = $role->getDisplayName();\n\t\t\t$dashboard->name = $role->name;\n\t\t\t$dashboard->roles_context = \"role::{$role->name}\";\n\t\t\t$dashboard->dashboard_type = 'widgets';\n\t\t\t$dashboard->num_columns = ROLES_DASHBOARD_NUM_COLUMNS;\n\t\t\tif ($dashboard->save()) {\n\t\t\t\tadd_entity_relationship($dashboard->guid, 'dashboard_for', $role->guid);\n\t\t\t\t$fixed++;\n\t\t\t} else {\n\t\t\t\t$error++;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($fixed) {\n\t\tsystem_message(\"$fixed missing dashboard role tabs have been created\");\n\t}\n}", "function populate_roles_160()\n {\n }", "function populate_roles_260()\n {\n }", "public function getDefaultUserRole()\n {\n return $this->defaultUserRole;\n }", "public function clear()\n {\n $this->missingRoles = [];\n }", "function populate_roles_300()\n {\n }", "function getAdminUsers(){\n\tglobal $connection, $roles;\n\t$sql = \"SELECT * FROM Accounts WHERE role IS NOT NULL\";\n\t$result = mysqli_query($connection, $sql);\n\t$users = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n\treturn $users;\n}", "function ihc_switch_role_for_user($uid=0){\n\t$do_switch = get_option('ihc_automatically_switch_role');\n\tif ($do_switch && $uid){\n\t\t$data = get_userdata($uid);\n\t\tif ($data && isset($data->roles) && isset($data->roles[0])){\n\t\t\t$role = get_option('ihc_automatically_new_role');\n\t\t\tif (empty($role)){\n\t\t\t\t$role = 'subscriber';\n\t\t\t}\n\t\t\t$arr['role'] = $role;\n\t\t\t$arr['ID'] = $uid;\n\t\t\twp_update_user($arr);\n\t\t}\n\t}\n}", "function set_roles( $user_id, $roles ) {\r\n\r\n\t\t}", "public function run()\n {\n //\n User::findOrFail(1)->assignRole('procurer');\n User::findOrFail(2)->assignRole('bidder');\n User::findOrFail(3)->assignRole('super-admin');\n }", "public function actionUserRole ()\n\t\t{\n\t\t\t$userClass = $this->module->modelUser;\n\t\t\t$post = Yii::$app->request->post();\n\t\t\t$user = $userClass::findOne($post[ 'id' ]);\n\t\t\tif (!is_null($user))\n\t\t\t{\n\n\t\t\t\tLogManager::info(Yii::tr('Пользователю {user} забрали права {roles}', [ 'user' => Html::a($user->name, Url::toRoute([ 'user/view', 'id' => $user->id ])), 'roles' => implode(',', $user->getRolesNames()) ]));\n\t\t\t\t$user->revokeAllRoles();\n\t\t\t\tif (is_array($post[ 'roles' ]))\n\t\t\t\t{\n\t\t\t\t\tforeach ($post[ 'roles' ] as $item)\n\t\t\t\t\t{\n\t\t\t\t\t\t$user->assignRole($item);\n\t\t\t\t\t}\n\t\t\t\t\tLogManager::info(Yii::tr('Пользователю {user} добавили права {roles}', [ 'user' => Html::a($user->name, Url::toRoute([ 'user/view', 'id' => $user->id ])), 'roles' => implode(',', $post[ 'roles' ]) ]));\n\t\t\t\t}\n\t\t\t}\n\t\t\tYii::$app->end();\n\t\t}", "public function user_manager_role($h)\n {\n list ($icons, $user_role, $user) = $h->vars['user_manager_role'];\n \n // Check to see if this user has any stop_spam_flags:\n $sql = \"SELECT usermeta_value FROM \" . TABLE_USERMETA . \" WHERE usermeta_userid = %d AND usermeta_key = %s\";\n $flags = $h->db->get_var($h->db->prepare($sql, $user->user_id, 'stop_spam_flags'));\n $h->vars['stop_spam_flags'] = $flags;\n \n if ($flags) {\n \n $flags = unserialize($flags);\n $title = $h->lang['stop_spam_flagged_reasons'];\n \n if ($flags) {\n foreach ($flags as $flag) {\n $title .= $flag . \", \";\n }\n $title = rstrtrim($title, \", \");\n $icons .= \" <img src = '\" . BASEURL . \"content/plugins/user_manager/images/flag_red.png' title='\" . $title . \"'>\";\n }\n \n $h->vars['user_manager_role'] = array($icons, $user_role, $user);\n }\n }", "function _s_get_user_role( $user = null ) {\n\t$user = $user ? new WP_User( $user ) : wp_get_current_user();\n\treturn $user->roles ? array_values( $user->roles )[0] : false;\n}", "function cs_get_user_role() {\n\tglobal $current_user;\n\t$user_roles = $current_user->roles;\n\t$user_role = array_shift($user_roles);\n\treturn $user_role;\n}", "public function setRoles()\n {\n if (!array_key_exists(User::ROLE_ADMINISTRATOR, Yii::$app->authManager->getRolesByUser(Yii::$app->user->getId()))) {\n $array = Yii::$app->authManager->getRoles();\n unset($array[self::ADMINISTRATOR]);\n } else {\n $array = Yii::$app->authManager->getRoles();\n }\n\n $roles = ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'name');\n\n $now = Yii::$app->authManager->getRolesByUser(Yii::$app->user->getId());\n\n //unset($roles[array_search('super_administrator', $roles)]);\n unset($roles[array_search('user', $roles)]);\n\n foreach ($roles as $key => $role) {\n $roles[$key] = Yii::t('backend', $role);\n }\n\n if (array_key_exists(User::ROLE_CUSTOMER, Yii::$app->authManager->getRolesByUser(Yii::$app->user->getId()))) {\n $key = array_search(User::ROLE_CUSTOMER, $roles);\n $roles = array_intersect_key($roles, [$key => $roles[$key]]);\n }\n\n return $roles;\n }", "private function checkUserRole($id) {\n $dv_users = Yii::$app->db->createCommand(\"SELECT id FROM assist_user_meta WHERE uid = '$id' AND meta_key = 'role' AND meta_value = '6' \")->queryAll();\n if (empty($dv_users)){\n $output = 0;\n } else {\n $output = 1;\n }\n return $output;\n }", "public function run()\n {\n foreach (User::$defaultUsers as $user) {\n User::firstOrCreate(\n ['email' => $user['email']],\n [\n 'email' => $user['email'],\n 'name' => $user['name'],\n 'password' => bcrypt($user['password']),\n\n ])->assignRole($user['role']);\n }\n }", "public function remove_roles() {\n global $wp_roles;\n\n if ( ! class_exists( 'WP_Roles' ) ) {\n return;\n }\n\n if ( ! isset( $wp_roles ) ) {\n $wp_roles = new WP_Roles();\n }\n\n if ( $this->role_exists( 'customer' ) ) {\n remove_role( 'customer' );\n }\n\n if ( $this->role_exists( 'shop_manager' ) ) {\n remove_role( 'shop_manager' );\n }\n }", "function egsr_remove_wp_roles(){\n $wp_roles = new WP_Roles();\n // $wp_site_roles = egsr_custom_site_roles();\n $wp_site_roles = egsr_default_wp_site_roles();\n foreach ($wp_site_roles as $key => $value) {\n $role = get_role($key);\n if(isset($role->name) == $key){ // Check if Role exists already\n $wp_roles->remove_role($key); // Remove role + capabilities\n }\n }\n}", "function pilau_editable_roles( $roles ) {\n\n\t// Only admins should be able to update_core, and only admins can edit admins\n\tif ( ! current_user_can( 'update_core' ) && array_key_exists( 'administrator', $roles ) ) {\n\t\tunset( $roles['administrator'] );\n\t}\n\n\treturn $roles;\n}", "function egsr_activation(){\n $wp_roles = new WP_Roles();\n\n // $wp_site_roles = egsr_custom_site_roles();\n $wp_site_roles = egsr_default_wp_site_roles();\n $user_exist = false;\n foreach ($wp_site_roles as $key => $value) {\n $role = get_role($key);\n if(isset($role->name) == $key){ // Check if Role exists already\n $args = array(\n 'role' => $key,\n );\n $users = get_users($args);\n if(count($users) > 0 ){ // Check if no Users with current role exist\n $user_exist = true;\n }\n }\n }\n\n if($user_exist){\n $site_url = get_site_url();\n $body_msg = '<p>In EMBL Group websites, default Wordpress roles \"Author\", \"Contributor\", \"Editor\" and \"Subscriber\" will be deprecated in favour of EMBL custom ones.</p>'; \n $error_msg = '<p class=\"error\">\n This plugin cannot be activated because users with either one of the above-mentioned Wordpress roles are active. <br>You can temporarily set those users as having no roles, and after activating the plugin replace them with EMBL custom ones: \n \"EMBL Group Admin\", \"EMBL Group Editor\" or \"EMBL Staff\"</p><p><a href=\"' . $site_url . '/wp-admin/users.php\">Users List Page&raquo;</a></p>';\n deactivate_plugins( basename( __FILE__ ) );\n wp_die( '<h1>Error</h1>' . $body_msg . $error_msg, 'Plugin Activation Error', array( 'response'=>200, 'back_link'=>TRUE ) );\n }\n}", "function hasRole($role, $userId = null);", "function um_roles_init( $wp_roles = null ) {\r\n\r\n\t\t\t//Add UM role data to WP Roles\r\n\t\t\tforeach ( $wp_roles->roles as $roleID => $role_data ) {\r\n\t\t\t\t$role_meta = get_option( \"um_role_{$roleID}_meta\" );\r\n\r\n\t\t\t\tif ( ! empty( $role_meta ) )\r\n\t\t\t\t\t$wp_roles->roles[$roleID] = array_merge( $role_data, $role_meta );\r\n\t\t\t}\r\n\r\n\r\n\t\t\t//Add custom UM roles\r\n\t\t\t$roles = array();\r\n\r\n\t\t\t$role_keys = get_option( 'um_roles' );\r\n\r\n\t\t\tif ( $role_keys ) {\r\n\r\n\t\t\t\tforeach ( $role_keys as $role_key ) {\r\n\t\t\t\t\t$role_meta = get_option( \"um_role_{$role_key}_meta\" );\r\n\t\t\t\t\tif ( $role_meta ) {\r\n\t\t\t\t\t\t//$role_meta['name'] = 'UM ' . $role_meta['name'];\r\n\t\t\t\t\t\t$roles['um_' . $role_key] = $role_meta;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tforeach ( $roles as $role_id => $details ) {\r\n\t\t\t\t\t$capabilities = ! empty( $details['wp_capabilities'] ) ? array_keys( $details['wp_capabilities'] ) : array();\r\n\t\t\t\t\t$details['capabilities'] = array_fill_keys( array_values( $capabilities ), true );\r\n\t\t\t\t\tunset( $details['wp_capabilities'] );\r\n\t\t\t\t\t$wp_roles->roles[$role_id] = $details;\r\n\t\t\t\t\t$wp_roles->role_objects[$role_id] = new \\WP_Role( $role_id, $details['capabilities'] );\r\n\t\t\t\t\t$wp_roles->role_names[$role_id] = $details['name'];\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Return the modified $wp_roles array\r\n\t\t\treturn $wp_roles;\r\n\t\t}", "private function loadUserRoles()\n {\n $this->userRoles = [];\n\n $roles = Yaml::parse(file_get_contents($this->configFilePath));\n if (is_array($roles) && !empty($roles['user_roles'])) {\n foreach ($roles['user_roles'] as $role => $ids) {\n !empty($this->userRoles[$role]) ? $this->userRoles[$role] += $ids : $this->userRoles[$role] = $ids;\n }\n }\n }", "function isa_editor_manage_users()\n{\n if (get_option('isa_add_cap_editor_once') != 'done') {\n // let editor manage users\n $edit_editor = get_role('editor'); // Get the user role\n $edit_editor->add_cap('edit_users');\n $edit_editor->add_cap('list_users');\n $edit_editor->add_cap('promote_users');\n $edit_editor->add_cap('create_users');\n $edit_editor->add_cap('add_users');\n $edit_editor->add_cap('delete_users');\n\n update_option('isa_add_cap_editor_once', 'done');\n }\n}", "public function _getUserRole()\n {\n $this->selftest();\n return $this->objectUserRole;\n }", "public function getUsers_role_role()\n {\n return $this->users_role_role;\n }", "public function clearRlUsuarioOrgaos()\n\t{\n\t\t$this->collRlUsuarioOrgaos = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function roleListAll() {\n $this->_adminUserDao = new AdminUserDao();\n\n $ret = array();\n $roles = $this->_adminroledao->getAll();\n foreach ($roles as $role) {\n $user = $this->_adminUserDao->getRow(array(array('username', '=', $role->owner)));\n if($user){\n $ret[$role->owner]['role'][] = $role;\n $ret[$role->owner]['user'] = $user;\n }else{\n if($role->owner == config('admin.user.super_user.username')){\n $ret[$role->owner]['role'][] = $role;\n// $ret[$role->owner]['user'] = (new AdminUserDao())->fill(config('admin.user.super_user'));\n// $ret[$role->owner]['user'] = $this->_adminUserDao->getRow(array(array('id', '=', config('admin.user\n $ret[$role->owner]['user']['username'] = $role->owner;\n }\n }\n }\n return $ret;\n }", "public function showUsers()\n {\n $role = Sentinel::findRoleBySlug('Client');\n $id=Sentinel::getUser()->id;\n $users=$role->users()->with('roles')->get();\n if($users->isNotEmpty()){\n $roles = Sentinel::findRoleBySlug('Client')->get();\n \n $roletype= $roles[1]->name;\n \n return view('Admins.viewUsers',compact('users','roletype'));\n }\n else\n {\n return view('Admins.viewUsers',compact('users'));\n }\n }", "public static function deassign_user_role($user_id, $role_id)\n\t{\n\t\t$result = DB::update(self::TABLE_USER_ROLES)\n\t\t\t->set(array(\n\t\t\t\t\"active\" => 0\n\t\t\t))\n\t\t\t->where(\"user_id\", \"=\", $user_id)\n\t\t\t->and_where(\"role_id\", \"=\", $role_id)\n\t\t\t->execute();\n\t\t\t\n\t\treturn $result;\n\t}", "function install_roles() {\n $db = DB::getInstance();\n if(!$db->query(file_get_contents(CORE_INSTALLER_FILES_PATH.'/db/roles.sql'))->error()) {\n return true;\n }\n else {\n System::addMessage('error', rt('An error occurred during the creation of the default user roles'));\n }\n return false;\n}", "function SetUserRole ($userRoleId = null, $data = array()) {\n $answer = $this->answer;\n\n if ($userRoleId) {\n // update user role\n $this->db\n ->where('role_id', $userRoleId)\n ->update('user_role', $data);\n // here must be notification email function\n }\n else {\n // create user role\n $this->db->insert('user_role', $data);\n $userRoleId = $this->db->insert_id();\n\n // here must be notification email function, new id is for it\n }\n\n $answer['success'] = true;\n $answer['result'] = $userRoleId;\n return $answer;\n }", "function wporphanageex_get_roles() {\n\tglobal $wpdb;\n\n\t$option = $wpdb->prefix . 'user_roles';\n\treturn get_option( $option );\n}", "function groups_calculate_role_people($rs,$context) {\n global $CFG;\n if(!$rs) {\n return false;\n }\n \n $roles = get_records_menu('role', null, 'name', 'id, name');\n $aliasnames = role_fix_names($roles, $context);\n\n // Array of all involved roles\n $roles=array();\n // Array of all retrieved users\n $users=array();\n // Fill arrays\n while($rec=rs_fetch_next_record($rs)) {\n // Create information about user if this is a new one\n if(!array_key_exists($rec->userid,$users)) {\n // User data includes all the optional fields, but not any of the\n // stuff we added to get the role details\n $userdata=clone($rec);\n unset($userdata->roleid);\n unset($userdata->roleshortname);\n unset($userdata->rolename);\n unset($userdata->userid);\n $userdata->id=$rec->userid;\n\n // Make an array to hold the list of roles for this user\n $userdata->roles=array();\n $users[$rec->userid]=$userdata;\n }\n // If user has a role...\n if(!is_null($rec->roleid)) {\n // Create information about role if this is a new one\n if(!array_key_exists($rec->roleid,$roles)) {\n $roledata=new StdClass;\n $roledata->id=$rec->roleid;\n $roledata->shortname=$rec->roleshortname;\n if(array_key_exists($rec->roleid,$aliasnames)) {\n $roledata->name=$aliasnames[$rec->roleid];\n } else {\n $roledata->name=$rec->rolename;\n }\n $roledata->users=array();\n $roles[$roledata->id]=$roledata;\n }\n // Record that user has role\n $users[$rec->userid]->roles[] = $roles[$rec->roleid];\n }\n }\n rs_close($rs);\n\n // Return false if there weren't any users\n if(count($users)==0) {\n return false;\n }\n\n // Add pseudo-role for multiple roles\n $roledata=new StdClass;\n $roledata->name=get_string('multipleroles','role');\n $roledata->users=array();\n $roles['*']=$roledata;\n\n // Now we rearrange the data to store users by role\n foreach($users as $userid=>$userdata) {\n $rolecount=count($userdata->roles);\n if($rolecount==0) {\n debugging(\"Unexpected: user $userid is missing roles\");\n } else if($rolecount>1) {\n $roleid='*';\n } else {\n $roleid=$userdata->roles[0]->id;\n }\n $roles[$roleid]->users[$userid]=$userdata;\n }\n\n // Delete roles not used\n foreach($roles as $key=>$roledata) {\n if(count($roledata->users)===0) {\n unset($roles[$key]);\n }\n }\n\n // Return list of roles containing their users\n return $roles;\n}", "function get_role_users($roleid, $context, $parent=false, $fields='', $sort='u.lastname ASC', $view=false) {\n global $CFG;\n\n if (empty($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';\n }\n\n // whether this assignment is hidden\n $hiddensql = ($view && !has_capability('moodle/role:viewhiddenassigns', $context))? ' AND r.hidden = 0 ':'';\n if ($parent) {\n if ($contexts = get_parent_contexts($context)) {\n $parentcontexts = ' OR r.contextid IN ('.implode(',', $contexts).')';\n } else {\n $parentcontexts = '';\n }\n } else {\n $parentcontexts = '';\n }\n\n if ($roleid) {\n $roleselect = \"AND r.roleid = $roleid\";\n } else {\n $roleselect = '';\n }\n\n $SQL = \"SELECT $fields\n FROM {$CFG->prefix}role_assignments r,\n {$CFG->prefix}user u\n WHERE (r.contextid = $context->id $parentcontexts)\n AND u.id = r.userid $roleselect\n $hiddensql\n ORDER BY $sort\n \"; // join now so that we can just use fullname() later\n\n return get_records_sql($SQL);\n}", "private static function cacheUserRoles()\n\t{\n\t\t$roles = ORM::for_table( _table_user_roles)\n\t\t\t\t\t->distinct()->select('role_id')\n\t\t\t\t\t->select('name')\n\t\t\t\t\t->join( _table_roles, array( _table_user_roles.'.role_id','=', _table_roles.'.id'))\n\t\t\t\t\t->where('user_id',$_SESSION[session_key]['user_id'])\n\t\t\t\t\t->find_many();\n\n\t\tif(!$roles)\n\t\t{\n\t\t\t$_SESSION[session_key]['has_roles'] = null;\n\t\t\tunset($_SESSION[session_key]['has_roles']);\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach($roles as $role)\n\t\t{\n\t\t\t$_SESSION[session_key]['has_roles'][$role->role_id] = $role->name;\n\t\t}\n\n\t\treturn $_SESSION[session_key]['has_roles'];\n\t}", "function get_user_role() {\n global $current_user;\n $user_roles = $current_user->roles;\n $user_role = array_shift($user_roles);\n return $user_role; // return translate_user_role( $user_role );\n}", "public function getExplicitRoles()\n {\n $manager = \\FelixOnline\\Core\\BaseManager::build('FelixOnline\\Core\\UserRole', 'user_roles', 'id');\n $manager->filter('user = \"%s\"', array($this->getUser()));\n\n $values = $manager->values();\n if (!$values) {\n return null;\n }\n\n $roles = array();\n foreach ($values as $value) {\n $roles[] = $value->getRole();\n }\n\n return $roles;\n }", "function beSelf(){\r\n\t\t$_SESSION['userid'] = $_SESSION['realUserId'];\r\n\t\t$_SESSION['roleid'] = $_SESSION['realRoleId'];\r\n\t\tunset( $_SESSION['realRoleId'] );\r\n\t\tunset( $_SESSION['realUserId'] );\r\n\t}", "public static function resolve_user_role($name)\n {\n }", "public function setRole() {\n\n $res= $_POST['link']->query(\"SELECT t2.perm_name FROM role_perm as t1\n JOIN permissions as t2 ON t1.perm_id = t2.perm_id\n WHERE t1.role_id = $this->rol_id\");\n\n\n foreach($res as $item)\n $this->role_perm[]= $item['perm_name'];\n }", "public function prepare_roles () {\n $roles = [];\n // Get non-empty user roles.\n $available_roles = count_users();\n // Get role titles.\n $wp_roles = wp_roles();\n // Creates an array with each role's data\n foreach ($wp_roles->role_names as $role_name => $role_title) {\n if ( array_key_exists( $role_name, $available_roles['avail_roles'] ) && (int)$available_roles['avail_roles'][ $role_name ] ) {\n\n $roles[ $role_name ] = [\n 'name' => $role_name,\n 'title' => translate_user_role( $role_title ),\n 'count' => (int)$available_roles['avail_roles'][ $role_name ]\n ];\n }\n }\n $this->roles = $roles;\n }", "public function displayRoles()\n { \n\n $user_data = $this->UserOrganisation_model->getAllByGet();\n foreach($user_data as $data){\n $email = $data->email;\n $roles = $this->UserOrganisation_model->findRole($data->id);\n if(count($roles)){\n foreach($roles as $role){\n $data = $role->name;\n $roleId = $role->pivot->role_id;\n $userId = $role->pivot->user_id;\n $arr_data = array('id'=>$roleId,'userId'=>$userId,'role'=>$data,'email'=>$email);\n $datas[]=$arr_data;\n }\n }else{\n $datas=$roles;\n }\n }\n return view('acl\\revoke_role', ['users' => $datas]);\n }", "function simpanUserRole($role) {\r\n $this->db->trans_begin();\r\n foreach ($role as $det) {\r\n $this->db->where('user_krid', $det['user_krid']);\r\n $this->db->where('user_roleid', $det['user_roleid']);\r\n $this->db->delete('ms_user_role');\r\n if ($det['check'] == 1) {\r\n $array = array(\r\n 'user_krid' => $det['user_krid'],\r\n 'user_roleid' => $det['user_roleid'],\r\n );\r\n $this->db->INSERT('ms_user_role', $array);\r\n }\r\n }\r\n if ($this->db->trans_status() === FALSE) {\r\n $this->db->trans_rollback();\r\n return false;\r\n } else {\r\n $this->db->trans_commit();\r\n return true;\r\n }\r\n }", "public function set_user_id($userid, $ornone = true) {\n $this->userids = array($userid);\n $this->allownouser = $ornone;\n }", "public function refreshUserACLs() {\r\n if ($this->modx->getUser()) {\r\n $this->modx->user->getAttributes(array(), '', true);\r\n }\r\n }", "public function getUsers_role_id()\n {\n return $this->users_role_id;\n }", "public function prepareUserAndRole() : void\n {\n if ($this->option(\"refresh\") != \"false\") {\n $this->cleanRoleAndPermissionTables();\n }\n\n $this->role = Role::find(config('system.roles.admin.id'));\n if (!$this->role) {\n $this->role = Role::create([\n 'id' => config('system.roles.admin.id'),\n 'name' => config('system.roles.admin.name')\n ]);\n $this->info('Role Created Successfully');\n }\n\n $user = User::find(1);\n\n if (!$user) {\n $user = User::create([\n 'name' => config('system.company.name'),\n 'email' => config('system.company.email'),\n 'password' => Hash::make(config('system.company.password')),\n 'lang' => 'en',\n 'admin_theme' => null,\n 'agent_type' => 1,\n 'image' => null,\n 'remember_token' => null,\n 'type' => 'admin',\n 'agents_can_assign' => null,\n 'agent_status_id' => null,\n 'whats_app_text' => config('system.company.description'),\n 'update_dashboard' => '0',\n 'created_at' => '2019-01-01 00:00:00',\n 'updated_at' => '2019-01-01 00:00:00',\n ]);\n\n $user->assignRole($this->role);\n\n $this->info('User Created Successfully And Role assign to him');\n } else {\n if (!$user->hasRole(config('system.roles.admin.id'))) {\n $user->assignRole($this->role);\n $this->info('Role Added Successfully');\n }\n }\n }", "function egsr_add_default_wp_roles()\n{\n // Exit if script is run from other than Admin\n if ( !current_user_can('administrator') ) {\n return;\n }\n $group_site_roles = egsr_default_wp_site_roles();\n foreach ($group_site_roles as $key => $value) {\n $role = get_role($key);\n // Check if Role doesn't exist already\n if(!isset($role->name) == $key){\n // Add role + capabilities\n add_role(\n $key,\n $value['label'],\n $value['caps']\n );\n }\n }\n}", "function role_unassign($roleid=0, $userid=0, $groupid=0, $contextid=0, $enrol=NULL) {\n\n global $USER, $CFG;\n\n $success = true;\n\n $args = array('roleid', 'userid', 'groupid', 'contextid');\n $select = array();\n foreach ($args as $arg) {\n if ($$arg) {\n $select[] = $arg.' = '.$$arg;\n }\n }\n if (!empty($enrol)) {\n $select[] = \"enrol='$enrol'\";\n }\n\n if ($select) {\n if ($ras = get_records_select('role_assignments', implode(' AND ', $select))) {\n $mods = get_list_of_plugins('mod');\n foreach($ras as $ra) {\n /// infinite loop protection when deleting recursively\n if (!$ra = get_record('role_assignments', 'id', $ra->id)) {\n continue;\n }\n $success = delete_records('role_assignments', 'id', $ra->id) and $success;\n\n /// If the user is the current user, then reload the capabilities too.\n if (!empty($USER->id) && $USER->id == $ra->userid) {\n load_all_capabilities();\n }\n $context = get_record('context', 'id', $ra->contextid);\n\n /// Ask all the modules if anything needs to be done for this user\n foreach ($mods as $mod) {\n include_once($CFG->dirroot.'/mod/'.$mod.'/lib.php');\n $functionname = $mod.'_role_unassign';\n if (function_exists($functionname)) {\n $functionname($ra->userid, $context); // watch out, $context might be NULL if something goes wrong\n }\n }\n\n /// now handle metacourse role unassigment and removing from goups if in course context\n if (!empty($context) and $context->contextlevel == CONTEXT_COURSE) {\n\n // cleanup leftover course groups/subscriptions etc when user has \n // no capability to view course\n // this may be slow, but this is the proper way of doing it\n if (!has_capability('moodle/course:view', $context, $ra->userid)) {\n // remove from groups\n if ($groups = get_groups($context->instanceid, $ra->userid)) {\n foreach ($groups as $group) {\n delete_records('groups_members', 'groupid', $group->id, 'userid', $ra->userid);\n }\n }\n\n // delete lastaccess records\n delete_records('user_lastaccess', 'userid', $ra->userid, 'courseid', $context->instanceid);\n }\n\n //unassign roles in metacourses if needed\n if ($parents = get_records('course_meta', 'child_course', $context->instanceid)) {\n foreach ($parents as $parent) {\n sync_metacourse($parent->parent_course);\n }\n }\n }\n }\n }\n }\n\n return $success;\n}", "private function usersCompletedByRole($role)\n\t{\n\t\t$memberships = $role->memberships;\n\n\t\t$arregloUsuarios = [];\n\n\t\t// e5_T -> id: status custom_fields\n\t\tforeach ($memberships as $m) {\n\t\t\tif($m->name != 'Default') {\n\t\t\t\t$users = $m->users()->get();\n\t\t\t\tforeach ($users as $user) {\n\t\t\t\t\t$arregloUsuarios[]\t= [ \n\t\t\t\t\t\t'first_name' => $user->firstname,\n\t\t\t\t\t\t'last_name' => $user->lastname,\n\t\t\t\t\t\t'email' => $user->email\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\n\t\treturn $arregloUsuarios;\n\t}", "function wpbod_nombres_roles() {\n \n global $wp_roles;\n \n if ( ! isset( $wp_roles ) ) {\n $wp_roles = new WP_Roles();\n }\n \n $wp_roles->roles['contributor']['name'] = 'Profesor';\n $wp_roles->role_names['contributor'] = 'Profesor';\n \n $wp_roles->roles['subscriber']['name'] = 'Cliente';\n\t$wp_roles->role_names['subscriber'] = 'Cliente';\n\t\n\t$wp_roles->roles['customer']['name'] = 'Registro';\n $wp_roles->role_names['customer'] = 'Registro';\n\n \n}", "public function roles();", "public function roles();", "public function roles();", "public function roles();", "public function clearUserDemoss()\n {\n $this->collUserDemoss = null; // important to set this to NULL since that means it is uninitialized\n }", "protected function scrubUsers() {\n $content_folder = $this->defaultContentConfig['path'];\n // Currently scrub only anonymous and super admin accounts since these are\n // added by a new Drupal install always, which conflicts with Default\n // Content when attempting to import (throws error as content already\n // exists).\n $scrub_users_uids = [0, 1];\n $scrub_task = $this->taskFilesystemStack();\n foreach ($scrub_users_uids as $uid) {\n $uuid = $this->getUserUuid($uid);\n $scrub_task->remove(\"$content_folder/content/user/$uuid.json\");\n }\n $scrub_task->run();\n }", "public function testRemoveUserRoleWithEmptyData()\n {\n $this->removeUserRole($this->user->id, [])\n ->assertJsonStructure([\n 'message',\n 'errors' => [\n 'role'\n ]\n ]);\n }", "function owa_translate_role($roles) {\r\n\t\r\n\tif (!empty($roles)) {\r\n\t\r\n\t\tif (in_array('administrator', $roles)) {\r\n\t\t\t$owa_role = 'admin';\r\n\t\t} elseif (in_array('editor', $roles)) {\r\n\t\t\t$owa_role = 'viewer';\r\n\t\t} elseif (in_array('author', $roles)) {\r\n\t\t\t$owa_role = 'viewer';\r\n\t\t} elseif (in_array('contributor', $roles)) {\r\n\t\t\t$owa_role = 'viewer';\r\n\t\t} elseif (in_array('subscriber', $roles)) {\r\n\t\t\t$owa_role = 'everyone';\r\n\t\t} else {\r\n\t\t\t$owa_role = 'everyone';\r\n\t\t}\r\n\t\t\r\n\t} else {\r\n\t\t$owa_role = 'everyone';\r\n\t}\r\n\t\r\n\treturn $owa_role;\r\n}", "public function setRoles($roles = [])\n {\n\n $rolesPermissionsToUpdate = Role::whereIn('name',$roles);\n $rolesPermissionsToDelete = $this->roles()->whereNotIn('role_id',$rolesPermissionsToUpdate->pluck('id')->toArray())->where('user_id',$this->id);\n\n UserRole::whereIn('role_id',$rolesPermissionsToDelete->pluck('id')->toArray())->where('user_id',$this->id)->delete();\n\n $diff = array_intersect($rolesPermissionsToUpdate->pluck('name')->toArray(),$roles);\n\n if (sizeOf($diff) > 0)\n {\n collect($diff)->each(function($roleName) use ($rolesPermissionsToUpdate){\n\n $role = Role::where('name',$roleName)->first();\n\n UserRole::create([\n 'user_id' => $this->id,\n 'role_id' => $role->id\n ]);\n\n });\n }\n\n }", "function set_user_role($role, $user_id = null) {\n\tglobal $db;\n\tif ($user_id == null)\n\t\t// defaults to the current user\n\t\t$user_id = $_SESSION['user_id'];\n\n\t$prepared = $db->prepare(\"\n UPDATE users\n\t\t\tSet role_id = (SELECT role_id FROM roles WHERE name = ?)\n\t\t\tWhere user_id = ?\n \");\n\n\t$prepared->bind_param('si', $role, $user_id);\n\n\tif (!$prepared->execute()) {\n\t\t$message['error'][] = ERROR;\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "function noUser() {\n\t}", "public function testThatGetRolesThrowsExceptionIfUserIdIsMissing()\n {\n $api = new MockManagementApi();\n\n try {\n $api->call()->users()->getRoles( '' );\n $caught_message = '';\n } catch (EmptyOrInvalidParameterException $e) {\n $caught_message = $e->getMessage();\n }\n\n $this->assertContains( 'Empty or invalid user_id', $caught_message );\n }", "function my_unenrol_user($type='teacher',$userid,$courseid) {\n global $DB;\n \n $hasil=array();\n\n if (!$plugin=enrol_get_plugin('manual')) {\n $hasil['result']=0;\n return $hasil;\n }\n\n $instances = enrol_get_instances($courseid, true);\n foreach ($instances as $instance) {\n if ($instance->enrol === 'manual') {\n break;\n }\n }\n if ($instance->enrol !== 'manual') {\n $hasil['result']=0;\n return $hasil;\n }\n\n $role = $DB->get_record('role', array('shortname' => $type), '*', MUST_EXIST);\n\n\n $plugin->unenrol_user($instance, $userid);\n\n $hasil['result']=32;\n return $hasil;\n\n}", "function erp_get_editable_roles (){\n if(! function_exists('get_editable_roles')){\n require_once(ABSPATH . 'wp-admin/includes/user.php');\n }\n $wp_roles = get_editable_roles();\n\n if( !current_user_can( 'administrator' ) ){\n unset( $wp_roles['administrator'] );\n }\n\n $roles = apply_filters( 'erp_editable_roles', $wp_roles );\n\n return $roles;\n}", "function set_user_role_woocommerce( $args ) {\n\t$args['role'] = 'subscriber';\n\treturn $args;\n}", "function getUserRoleName()\n{\n return array_flip(getConfig('role'))[Auth::user()->role_id];\n}", "protected function get_role_list($user_object)\n {\n }" ]
[ "0.6636881", "0.63854456", "0.6010978", "0.5876335", "0.58606595", "0.58605295", "0.57766813", "0.5773733", "0.5769813", "0.57535785", "0.57119465", "0.5678119", "0.5629089", "0.56255156", "0.5602651", "0.55890536", "0.55696434", "0.5567759", "0.55439055", "0.55392283", "0.5532079", "0.5495326", "0.54927194", "0.5486217", "0.5485191", "0.5462049", "0.54609275", "0.5456317", "0.54550636", "0.54530996", "0.5438769", "0.5437541", "0.5435138", "0.54207975", "0.5412631", "0.54115814", "0.5410672", "0.5396923", "0.53826517", "0.53656435", "0.53650904", "0.5345711", "0.534229", "0.53309727", "0.5309739", "0.5307156", "0.53062934", "0.5304315", "0.52995884", "0.5290966", "0.5288876", "0.52857524", "0.52810276", "0.52769077", "0.5276833", "0.5276793", "0.5272491", "0.5271962", "0.5263693", "0.52493995", "0.5247635", "0.5245917", "0.52410483", "0.52304107", "0.5227495", "0.5224957", "0.52201635", "0.5218301", "0.52147585", "0.52046335", "0.52045137", "0.5204119", "0.52022487", "0.5197796", "0.51970345", "0.5192347", "0.5190793", "0.51861167", "0.5184176", "0.5180759", "0.5177595", "0.51656055", "0.51643735", "0.5161669", "0.51539207", "0.51539207", "0.51539207", "0.51539207", "0.5153161", "0.5148906", "0.51454663", "0.51404613", "0.5137774", "0.51366836", "0.51346767", "0.51298875", "0.5120737", "0.5116578", "0.5116165", "0.5106032", "0.51008695" ]
0.0
-1
checks that the table column count matches the data
public function check_import_match($table_name, $text_line) { $error = 0; $arr = explode(",",$text_line); $string_count = sizeof($arr); $cols = $this->data_driver->get_column_count($table_name); if ($cols != FALSE) { $col_count = sizeof($cols); } else { $error = "Table name doesn't exist"; return $error; } if ($string_count == $col_count) { return $error; } else { $error = "Column count does not match. Check selection or data format"; return $error; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ae_check_db_fields( ) {\n\n $count = 0;\n $cols = ae_get_db_fields();\n $foo = ae_db_queries();\n if( $cols ){\n foreach($cols as $col) {\n\n if( isset($foo[$col->COLUMN_NAME]) ) {\n\n if(\n $col->DATA_TYPE != $foo[$col->COLUMN_NAME]['type'] ||\n $col->CHARACTER_MAXIMUM_LENGTH < $foo[$col->COLUMN_NAME]['numb']\n ) {\n $count++;\n }\n }\n }\n }\n\n return $count;\n}", "public function columnCount();", "function detectColumns($data) {\n global $colCount, $schema;\n $colCount = count($data); \n $schema = $data;\n}", "public function hasColumns(){\n return $this->_has(3);\n }", "abstract public function getColumnsCount();", "public function verifyTableNodeColumnsCount(\n\t\tTableNode $table,\n\t\tint $count\n\t): void {\n\t\tif (\\count($table->getRows()) < 1) {\n\t\t\tthrow new Exception(\"Table should have at least one row.\");\n\t\t}\n\t\t$rowCount = \\count($table->getRows()[0]);\n\t\tif ($count !== $rowCount) {\n\t\t\tthrow new Exception(\"Table expected to have $count rows but found $rowCount\");\n\t\t}\n\t}", "function diy_check_table_columns($table_name, $field_name, $db_connection = 'mysql') {\n\t\t$connection = DB::connection($db_connection);\n\t\treturn $connection->getSchemaBuilder()->hasColumn($table_name, $field_name);\n\t}", "public function count()\n\t{\n\t\treturn count($this->columns);\n\t}", "public function hasColumnNumber(){\n return $this->_has(5);\n }", "public function columnCount()\n {\n }", "private function validate_columns(){\n\n for($i=0;$i<9;$i++){\n $col = array_column($this->sudoku_array, $i);\n\n if(count($col) !=9 || count(array_unique($col)) !=9){\n return false;\n }\n }\n return true;\n }", "public function hasRowCount(){\n return $this->_has(7);\n }", "public function columnCount() {\n\t\tif( !$this->_result ) return 0;\n\t\treturn mssql_num_fields($this->_result);\n\t}", "public function testGetColumnCountWithSchema() {\n $expected = 10;\n \n $stub = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOStatement\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"__toString\"))\n ->getMock();\n \n $schema = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\Meta\\Schema\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"getKeyMap\"))\n ->getMock();\n \n $map = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\Meta\\KeyMap\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"count\"))\n ->getMock();\n \n $map->expects($this->once())\n ->method(\"count\")\n ->will($this->returnValue($expected));\n \n $schema->expects($this->once())\n ->method(\"getKeyMap\")\n ->will($this->returnValue($map));\n \n $property = new \\ReflectionProperty($stub, \"schema\");\n $property->setAccessible(true);\n $property->setValue($stub, $schema);\n \n $this->assertEquals($expected, $stub->columnCount());\n }", "public function testChallengeTableHasExpectedColumns()\n {\n $this->assertTrue(\n Schema::hasColumns('challenges',\n [\n \"id\", \"title\", \"description\", \"value\", \"session_id\",\n \"created_at\", \"updated_at\"\n ]\n ), 1\n );\n }", "public function columnCount()\n {\n return oci_num_fields($this->sth);\n }", "public function count($col);", "public static function checkTable()\n {\n $db = JFactory::getDBO();\n\n $tables = $db->getTableList();\n\n if (!empty($tables)) {\n // swap array values with keys, convert to lowercase and return array keys as values\n $tables = array_keys(array_change_key_case(array_flip($tables)));\n $app = JFactory::getApplication();\n $match = str_replace('#__', strtolower($app->getCfg('dbprefix', '')), '#__wf_profiles');\n\n return in_array($match, $tables);\n }\n\n // try with query\n self::buildCountQuery();\n\n return $db->execute();\n }", "abstract public function countTable();", "public function testGetColumnCountWithNoSchema() {\n $expected = 0;\n $stub = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOStatement\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"__toString\"))\n ->getMock();\n \n $this->assertEquals($expected, $stub->columnCount());\n }", "public function columnCount()\n {\n return sasql_num_fields($this->connection);\n }", "function GetColCount()\n {\n return mysqli_num_fields($this->rs);\n }", "private function checkNrOfCells($data) {\r\n //Check if there are the same number of cells in each row\r\n $checkValue = 0;\r\n $nrOfCells = count($data);\r\n for ($i = 0; $i < $nrOfCells; $i++) {\r\n foreach ($data AS $key => $value) {\r\n $counted = count($value);\r\n if ($i === 0) {\r\n $checkValue = $counted;\r\n } elseif ($checkValue != $counted) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "public function getColumnCount(): int\r\n {\r\n return count($this->columns);\r\n }", "public function getColumnsCount()\n {\n return count($this->columns);\n }", "protected function validateQuery(): bool {\n\t\t$columnsCount = count($this->columns);\n\t\t$valuesCount = count($this->values);\n\t\tif ($columnsCount === 0 || $valuesCount === 0) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ($this->values as $valueRow) {\n\t\t\tif (count($valueRow) !== $columnsCount) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn parent::validateQuery();\n\t}", "public function hasColumn($name);", "function validate_rows() {\r\n $ok = True;\r\n for ($i = 0; $i < $this->db_count; $i++) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (!$this->validate_field($colvar,$i)) { # make sure this field is not empty\r\n $ok = False;\r\n }\r\n }\r\n }\r\n return $ok;\r\n }", "function getNCols() \n {\n if($this->rsQry)\n {\n return true;\n }\n else\n {\n\t\t\t return mysql_num_fields($this->rsQry);\n }\n\t\t}", "public function getColumnCount()\n {\n $res = $this->getMetaData();\n $colcount = 0;\n foreach ($this->_metaData['sections'] as $section) {\n $sec_colcount = 0;\n foreach ($section['columns'] as $col) {\n if (isset($col['colspan'])) {\n $sec_colcount += $col['colspan'];\n } else {\n $sec_colcount++;\n }\n }\n if ($sec_colcount > $colcount) {\n $colcount = $sec_colcount;\n }\n }\n\n return $colcount;\n }", "function numCols($result)\n {\n $this->getRows();\n return(count(array_keys($this->_record)));\n }", "public function getColumnCount()\n {\n return $this->column_count;\n }", "public function hasPrimaryKeyColumns(){\n return $this->_has(4);\n }", "protected function columnMatchCheck ( $lineColumns ) {\n }", "private function getColumns() {\n\t\t$cols = $this->connection->fetchAll(\"DESCRIBE `\".$this->connection->database.\"`.`$this->table`\");\n\t\tif (!$cols) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tself::$primaryKey[$this->table]=FALSE;\n\t\tforeach ($cols as $col) {\n\t\t\tself::$tables[$this->table][ $col['Field']] = $col['Type'];\n\t\t\tif ($col['Key']=='PRI') {\n\t\t\t\tself::$primaryKey[$this->table] = $col['Field'];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public abstract function row_count();", "public function checkThatColumnsWorkToo(): void\n {\n $name = 'fluent-field';\n $label = 'Fun stuff:';\n Column::make($name)->testAttribute($label);\n\n $columns = $this->crudPanel->column($name);\n $this->assertCount(1, $columns);\n $this->assertArrayHasKey($name, $columns);\n $columnToTest = $columns[$name];\n $this->assertEquals('text', $columnToTest['type']);\n $this->assertEquals($label, $columnToTest['testAttribute']);\n }", "public function testIsColumnAvailable()\n {\n /* ----------------------------------------------------\n * in below $csvData var we have faked the header data\n * -----------------------------------------------------*/\n $csvData = [['first_name','last_name','address']]; \n \n $column = 'first_name';\n\n /*\n |--------------------------------------------------------------------------\n | Success Scenario\n |--------------------------------------------------------------------------\n |\n | Let's test the success scenario\n |\n */\n\n $resp = $this->isColumnAvailable($column, $csvData);\n\n /* ------------------------------------------------------------------------------\n * we compare the response of isColumnAvailable in case when column is available\n * -------------------------------------------------------------------------------*/\n $this->assertEqualsCanonicalizing($resp,[\"key\"=>0,\"name\"=>\"first_name\"]);\n \n\n /*\n |--------------------------------------------------------------------------\n | Failure Scenario\n |--------------------------------------------------------------------------\n |\n | Let's test the failure scenario\n |\n */\n\n $resp = $this->isColumnAvailable('unknown_column', $csvData);\n\n /* ----------------------------------------------------------------------------------\n * we compare the response of isColumnAvailable method in case when column not found\n * -----------------------------------------------------------------------------------*/\n $this->assertFalse($resp);\n \n }", "public function hasTable() {\n return $this->_has(5);\n }", "public function CheckExitColumn($table,$col){\n if(trim($col) == '') return array();\n $db_column= new db_query(\"SHOW COLUMNS FROM \" . $table . \" LIKE '\" . trim($col) . \"'\");\n //$result = mysqli_query();\n $exists = mysqli_fetch_assoc($db_column->result);\n unset($db_column);\n if(!empty($exists)){\n return $exists;\n }\n return array();\n }", "function sql_num_fields($res)\n {\n return $res->columnCount();\n }", "function mf_mysql_column_exist($table_name, $column_name,$dbh) {\r\n\r\n\t\t$query = \"SHOW COLUMNS FROM $table_name LIKE '$column_name'\";\r\n\t\t$sth = mf_do_query($query,array(),$dbh);\r\n\t\t$row = mf_do_fetch_result($sth);\r\n\t\t\r\n\t\tif(!empty($row)){\r\n\t\t\treturn true;\t\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function num_fields()\r\n\t{\r\n\t\tif ( is_array($this->pdo_results) ) {\r\n\t\t\treturn sizeof($this->pdo_results[$this->pdo_index]);\r\n\t\t} else {\r\n\t\t\treturn $this->result_id->columnCount();\r\n\t\t}\r\n\t}", "public function get_column_count()\n {\n }", "public function count_Row($columnCount,$condition,$table){\n\n if($condition != \"\"){\n\n\t\t\t\t $stmt = $this->dbstatus->prepare(\"Select \".$columnCount.\" From \".$table.\" WHERE \".$condition.\"\");\n\n\t\t\t $stmt->execute();\n\n\t\t\t if($stmt->rowCount() > 0){\n\n\t\t\t $get = $stmt->fetchObject();\n\n\t\t\t\t return $get->$columnCount;\n\n\t\t\t }else{\n\n\t\t\t\t return 0;\n\n\t\t\t }\n\n\n\t\t}else{\n\n\t\t\t $stmt = $this->dbstatus->prepare(\"Select \".$columnCount.\" From \".$table.\"\");\n\n\t\t\t $stmt->execute();\n\n\t\t\t if($stmt->rowCount() > 0){\n\n\t\t\t\t $get = $stmt->fetchObject();\n\n\t\t\t\t return $get->$columnCount;\n\n\t\t\t }else{\n\n\t\t\t\t return 0;\n\n\t\t\t }\n\n\t\t}\n\n}", "public function columnCount($sql) {\n $sth = $this->prepare($sql);\n $sth->execute();\n\n return $sth->columnCount();\n }", "public function testResultNumFields()\n {\n \t$this->assertEquals(4, $this->conn->query('SELECT * FROM test')->numFields());\n \t$this->assertEquals(2, $this->conn->query('SELECT id, title FROM test')->numFields(), 'SELECT id, title FROM test');\n }", "function count_filtered()\n {\n $this->_get_datatables_query();\n $query = $this->db->get();\n return $query->num_rows();\n }", "public function column_exists($table_name, $column, $dbname = null)\n {\n $columns = $this->columns($table_name, $dbname);\n return sizeof(array_intersect($columns, (array) $column)) === sizeof((array) $column);\n }", "function issetTableColumn($table_name, $column_name)\n{\n global $wpdb;\n $columns = $wpdb->get_results(\"SHOW COLUMNS FROM \" . $table_name, ARRAY_A);\n foreach ($columns as $column) {\n if ($column['Field'] == $column_name) {\n return true;\n }\n }\n}", "public abstract function getColumnsCount($result_set);", "abstract public function tableColumns();", "function f_fieldExists($link, $table, $column, $column_attr = \"VARCHAR( 255 ) NULL\") {\r\n $exists = false;\r\n $columns = mysqli_query($link, \"SHOW COLUMNS FROM $table LIKE '\".$column.\"'\");\r\n //ferror_log(\"SQL: $sql \". \"returns \". $num_rows . \" rows.\");\r\n $exists = ( mysqli_num_rows($columns) )?TRUE:FALSE;\r\n if (!$exists) {\r\n ferror_log(\"ALTER TABLE `$table` ADD `$column` $column_attr\");\r\n if (mysqli_query($link, \"ALTER TABLE `$table` ADD `$column` $column_attr\")) {\r\n return TRUE;\r\n }\r\n } else {\r\n return TRUE;\r\n }\r\n return FALSE;\r\n}", "function num_fields($query)\n\t{\n\t\treturn $query->columnCount();\n\t}", "public function dataExists($table, $data)\n\t{\n\t\t$this->db->where('deleted_at is Null');\n\t\t$query = $this->db->get_where($table, $data);\n\t\t$queryStats = ($query->num_rows() > 0 ? 1 : 0);\n\t\treturn $queryStats;\n\t\t// return $query->num_rows();\n\t}", "function pdo_num_fields($stmt) {\r\n return pdo_stmt($stmt)->columnCount();\r\n }", "public function count_filtered(){\n $this->datatables_query();\n $query = $this->db->get();\n return $query->num_rows();\n }", "function getNumRowsData($data,$table)\n {\n $this->db->where(array('role_id'=>$data));\n return $this->db->count_all_results($table);\n }", "public function getNumberOfColumns() {\n return count($this->columns);\n }", "public static function hasColumns(string $tableName, array $columnNames, DataSource $dataSource): bool\n {\n $columnNamesString = implode( ', ', array_map(fn($name) => \"'$name'\", $columnNames) );\n $totalColumNames = count($columnNames);\n\n if (empty($tableName) || empty($totalColumNames))\n {\n return false;\n }\n\n $databaseName = $dataSource->getDatabaseName();\n\n $sql = match ($dataSource->type) {\n DataSourceType::SQLITE => <<<EOF\nSELECT COUNT(*) AS column_count\nFROM pragma_table_info('$databaseName')\nWHERE name IN ($columnNamesString)\nHAVING COUNT(*) = $totalColumNames\nEOF,\n\n DataSourceType::POSTGRESQL => <<<EOF\nSELECT COUNT(*) AS column_count\nFROM information_schema.columns\nWHERE table_name = '$databaseName'\n AND column_name IN ($columnNamesString)\nHAVING COUNT(*) = $totalColumNames;\nEOF,\n\n default => <<<EOF\nSELECT COUNT(*) as total_fields\nFROM INFORMATION_SCHEMA.COLUMNS\nWHERE TABLE_SCHEMA = '$databaseName'\n AND TABLE_NAME = '$tableName'\n AND COLUMN_NAME IN ($columnNamesString)\nHAVING COUNT(*) = $totalColumNames\nEOF\n };\n\n $statement = $dataSource->getClient()->query($sql);\n\n if (false === $statement)\n {\n throw new ORMException(print_r($dataSource->getClient()->errorInfo(), true));\n }\n\n $columns = self::getColumnNames($tableName, $dataSource, $databaseName);\n\n if (!$columnNames)\n {\n return false;\n }\n\n foreach($columnNames as $columnName)\n {\n if (!in_array($columnName, $columns))\n {\n return false;\n }\n }\n\n return true;\n }", "public function testSongDatabase1()\n {\n $this->assertTrue(\n Schema::hasColumns('songs', [\n 'id', 'title', 'detail'\n ]),\n // 1\n );\n }", "private function hasNoColumns() {\n if (count($this->columns) === 0) return true;\n\n\n if (count($this->columns) === 1 && isset($this->columns['*'])) {\n return true;\n }\n\n return false;\n }", "function count_filtered($tablename,$orderkey,$orderdir,$columns)\n\t{\n\t\t$this->_get_datatables_query($tablename,$orderkey,$orderdir,$columns);\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}", "public function testGetFromTableWithAllFields()\n {\n $db = 'PMA_db';\n $table = 'PMA_table';\n\n $GLOBALS['dbi']->expects($this->once())\n ->method('fetchResult')\n ->with(\n \"SELECT * FROM `pma_central_columns` \"\n . \"WHERE db_name = 'PMA_db' AND col_name IN ('id','col1','col2');\",\n null, null, DatabaseInterface::CONNECT_CONTROL\n )\n ->will(\n $this->returnValue(array_slice($this->columnData, 0, 2))\n );\n $this->assertEquals(\n array_slice($this->modifiedColumnData, 0, 2),\n $this->centralColumns->getFromTable(\n $db,\n $table,\n true\n )\n );\n }", "function RowCount() {}", "public function dataExists($table, $data)\n\t{\n\t\t$query = $this->db->get_where($table, $data);\n\t\t$queryStats = ($query->num_rows() > 0 ? 1 : 0);\n\t\treturn $queryStats;\n\t\t// // return $query->num_rows();\n\t}", "function Ensuretable()\n {\n $result = mysqli_query(\"SHOW COLUMNS FROM $this->tablename\"); \n if(!$result || mysqli_num_rows($result) <= 0)\n {\n return $this->CreateTable();\n }\n return true;\n }", "public function updateNecessary(): bool\n {\n $upgradeApi = GeneralUtility::makeInstance(UpgradeApi::class);\n $elementCount = 0;\n $tables = explode(',', self::TABLES);\n foreach ($tables as $table) {\n if (!isset($this->tableFields[$table])) {\n continue;\n }\n $fields = $this->tableFields[$table];\n foreach ($fields as $field) { \n $elementCount += \n $upgradeApi->countOfTableFieldMigrations(\n $table,\n $field, \n $field . '_uid', \n ParameterType::STRING,\n \\PDO::PARAM_INT\n );\n if ($elementCount > 0) {\n break;\n }\n }\n if ($elementCount > 0) {\n break;\n }\n }\n return ($elementCount > 0);\n }", "public function rowCount();", "public function rowCount();", "public function columnCount()\r\n\t{\r\n\t\treturn intval($this->columnCount);\r\n\t}", "public function hasTable() {\n return $this->_has(2);\n }", "public function GetColumnCount() : INT\r\n {\r\n return($this->preparedStatement->columnCount());\r\n }", "public function rowCount() {}", "public function columnExists( $tablename, $columnname );", "public function getColumns()\n {\n return strlen($this->string);\n }", "public function checkrow(){\n return $this->select->num_rows;\n }", "function countItems($select, $tblName ,$where = NULL , $and = NULL)\n{\n global $conn;\n $countStmt = $conn->prepare(\"SELECT COUNT($select) FROM $tblName $where $and\");\n $countStmt ->execute();\n // numbers of col retreived\n return $countStmt ->fetchColumn();\n\n}", "public function testColumnaCompleta(CartonInterface $carton) {\n\t$flag = true;\t\n\tforeach( $carton->columnas() as $col ){\t\n\t\t$cant = 0;\t\n\t\tforeach( $col as $num ){\n\t\t\tif($num != 0){\n\t\t\t$cant++;\t\t\t\n\t\t\t}\n\t\t}\n\t\tif($cant == 3){\n\t\t$flag = false;\n\t\t}\n\t}\n $this->assertTrue($flag);\n }", "public function testGetDataTableDuplicateColumnNames() {\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 STRING_VALUE named as UUID at the end. The UUID column must contain the content from STRING_VALUE\r\n\t\t// and STRING_VALUE must exist only once.\r\n\t\t$datatable = $this->getPersistenceAdapter()->getDataTable('select UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE, STRING_VALUE as UUID from POTEST');\r\n\t\t// Compare contents\r\n\t\t$headers = $datatable->getHeaders();\r\n\t\t$this->assertEquals(5, count($headers), 'Wrong header names count');\r\n\t\t$this->assertEquals('UUID', $headers[0], 'Column 0 has wrong header name');\r\n\t\t$this->assertEquals('BOOLEAN_VALUE', $headers[1], 'Column 1 has wrong header name');\r\n\t\t$this->assertEquals('INT_VALUE', $headers[2], 'Column 2 has wrong header name');\r\n\t\t$this->assertEquals('STRING_VALUE', $headers[3], 'Column 3 has wrong header name');\r\n\t\t$this->assertEquals('UUID', $headers[4], 'Column 4 has wrong header name');\r\n\t\t$datamatrix = $datatable->getDataMatrix();\r\n\t\t$this->assertEquals(3, count($datamatrix), 'Wrong row count');\r\n\t\tfor ($i = 0; $i < 3; $i++) {\r\n\t\t\t$this->assertEquals(5, count($datamatrix[$i]), 'Wrong column count in row '.$i);\r\n\t\t\t// The UUID column was overwritten by aliasing the string column in the statement\r\n\t\t\t$this->assertEquals(''.$records[$i]['UUID'], $datamatrix[$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), $datamatrix[$i][1], 'Cell content does not match in row '.$i.' in column 1');\r\n\t\t\t$this->assertEquals(''.$records[$i]['int'], $datamatrix[$i][2], 'Cell content does not match in row '.$i.' in column 2');\r\n\t\t\t$this->assertEquals(''.$records[$i]['string'], $datamatrix[$i][3], 'Cell content does not match in row '.$i.' in column 3');\r\n\t\t\t$this->assertEquals(''.$records[$i]['string'], $datamatrix[$i][4], 'Cell content does not match in row '.$i.' in column 4');\r\n\t\t}\r\n\t}", "public function hasColumns($type = NULL)\n\t{\n\t\treturn count($type == NULL ? $this->getColumns() : $this->getColumns($type)) > 0;\n\t}", "public function isValidCustomRow(){\n return $this->capacity === $this->getNbSeatsCustomRow();\n }", "public function getCountRowsOfTable ($tableName,$fieldname='*');", "function has_changes() {\n $changed = (count($this->add['tables' ]) + count($this->update['tables' ]) + count($this->remove['tables' ]) +\n count($this->add['routines']) + count($this->update['routines']) + count($this->remove['routines']) +\n count($this->add['events' ]) + count($this->update['events' ]) + count($this->remove['events' ]) +\n count($this->add['views' ]) + count($this->update['views' ]) + count($this->remove['views' ]) +\n count($this->add['triggers']) + count($this->update['triggers']) + count($this->remove['triggers'])\n );\n return ($changed != 0 or isset($this->schema->charset) or isset($this->schema->collate));\n }", "function Pico_CheckTable($table_name, $column, $definition)\n{\n\tglobal $db;\n\t\n\t$fields = $db->assoc('SHOW COLUMNS FROM `'.$table_name.'`');\n\t$all_fields = array();\n\tforeach ($fields as $f)\n\t{\n\t\t$all_fields[] = $f['Field'];\n\t}\n\t\n\tif (!in_array($column, $all_fields))\n\t{\n\t\t$db->run('ALTER TABLE `'.$table_name.'` ADD COLUMN `'.$column.'` ' . $definition);\n\t}\n}", "public function hasColumn($tableName, $columnName);", "function test_tableEqualsColumn()\n {\n $this->qt = new MDB_QT(TABLE_QUESTION);\n $newData = array(TABLE_QUESTION => 'Why does this not work?');\n $id = $this->qt->add($newData);\n $this->assertTrue($id != false);\n\n $newData['id'] = $id;\n $this->assertEqual($newData, $this->qt->get($id));\n }", "public function checkDatabaseStructure( );", "function isColumnValid(array $grid, int $x, bool $verbose = false): bool;", "public function isColumn($key)\n {\n return in_array(strtolower($key), $this->columns());\n }", "public function testQueryFetchColumn()\n {\n $column = $this->getConnection()->query()('SELECT \"Hello World\"')()('fetch-column')();\n return $this->assertTrue(count($column['rows']) < 1);\n }", "final private function checkCol($i,$j){\n\t\tfor($k=0;$k<$j; $k++)\n\t\t\tif (isset($this->contents[$i]->contents[$k]->attrs['colspan']) and \n\t\t\t\t\t(int)$this->contents[$i]->contents[$k]->attrs['colspan'] + $k > $j)\n\t\t\treturn $k+1;\n\t\treturn 0;\n\t}", "abstract public function hasRow();", "function fn_check_table_fields($data, $table_name, $dbc_name = '')\n{\n\t$_fields = fn_get_table_fields($table_name, array(), false, $dbc_name);\n\tif (is_array($_fields)) {\n\t\tforeach ($data as $k => $v) {\n\t\t\tif (!in_array($k, $_fields)) {\n\t\t\t\tunset($data[$k]);\n\t\t\t}\n\t\t}\n\t\tif (func_num_args() > 3) {\n\t\t\tfor ($i = 3; $i < func_num_args(); $i++) {\n\t\t\t\tunset($data[func_get_arg($i)]);\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}\n\treturn false;\n}", "public function hasColumn($name) {\n $info = $this->_data->getDeepValue('columns/' . $name);\n return !empty($info);\n }", "public function getNumRows();", "private function isValidRowColumn(): bool {\n foreach ($this->board as $row => $cols) {\n $curRow = [];\n $curCol = [];\n foreach ($cols as $col => $cellValue) {\n // check if repeated in row\n if(in_array($this->board[$row][$col], $curRow)){\n return false;\n }\n array_push($curRow, $this->board[$row][$col]);\n\n // check if repeated in column \n if(in_array($this->board[$col][$row], $curCol)){\n return false;\n }\n array_push($curCol, $this->board[$col][$row]);\n }\n }\n return true;\n }", "public function count() {\n return count($this->__rows__);\n }", "public function numOfRows();", "public function numFields();" ]
[ "0.72854537", "0.6850018", "0.67990756", "0.6696057", "0.66153663", "0.6521014", "0.64371336", "0.64166206", "0.63804793", "0.63425076", "0.6285483", "0.6272128", "0.622768", "0.6225625", "0.6211134", "0.6204711", "0.6189118", "0.6157521", "0.61515105", "0.6146612", "0.612834", "0.61193264", "0.6110976", "0.6080313", "0.6076889", "0.6056656", "0.60391456", "0.60138685", "0.6009867", "0.59912354", "0.59664327", "0.59232104", "0.59194714", "0.5908085", "0.5876954", "0.5835251", "0.5822454", "0.5821815", "0.578649", "0.5784013", "0.57756865", "0.5766803", "0.5751959", "0.5750537", "0.57457733", "0.57450056", "0.57302976", "0.57196945", "0.5708715", "0.57083964", "0.5684869", "0.5673839", "0.5669279", "0.5669016", "0.56573606", "0.5656886", "0.5655401", "0.5649801", "0.56448144", "0.56441975", "0.5642554", "0.56424266", "0.5636845", "0.56358546", "0.56181276", "0.5616026", "0.5613336", "0.560738", "0.560714", "0.560714", "0.56068873", "0.56068015", "0.5602886", "0.5593964", "0.55865943", "0.55663645", "0.5565433", "0.5561252", "0.55577993", "0.5556683", "0.55366087", "0.552806", "0.55217505", "0.5517316", "0.5516607", "0.5500289", "0.54992574", "0.54990363", "0.54835165", "0.5474607", "0.5470879", "0.54707336", "0.5468214", "0.5467682", "0.54663634", "0.5456356", "0.54548436", "0.5452246", "0.54478", "0.5444954" ]
0.63453245
9
read a text file and load the database
public function process_file() { // $done = false; $error = ''; // $filelist = directory_map('/var/lib/mysql-files/uploads/', 1); // // returns the table selected in the drop down // $table_name = $this->input->post('tablename'); // // returns the array position of the selected item on the // dropdown list $fileno = $this->input->post('filename'); // // get text as an array of strings, the dropdown returns a number // $textarray = $this->read_text($filelist[$fileno]); // // gets the first line of the text file // $text_line = $textarray[0]; // $return_value = $this->check_import_match($table_name, $text_line); // // get list of table columns // $filepath = '/var/lib/mysql-files/uploads/'.$filelist[$fileno]; // // loads a list of table names into an array // $tables = $this->load_table_names(); // send back to import page with message if ($return_value === 0) { $this->data_driver->load_data($table_name, $filepath); // $message = 'Your data has been successfully imported'; // this checks that new users have a role assigned $this->check_access_type(); } else { $message = $return_value; } // call page $this->call_page($tables, $filelist, $message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadTextFile($text_file)\n {\n try {\n TextFileValidator::textFile($text_file);\n $file = fopen($text_file, \"r\") or die(\"Unable to open file!\");\n while (!feof($file)) {\n $line = fgets($file);\n $this->addLine($line);\n }\n fclose($file);\n } catch (Exception $a) {\n die($a->getMessage());\n }\n }", "private function _load_db()\n {\n $json_string = file_get_contents(\"dbmov.json\");\n $this->_db = json_decode($json_string, true);\n }", "private function _load_db()\n {\n $json_string = file_get_contents(\"dbtv.json\");\n $this->_db = json_decode($json_string, true);\n $this->_ep_list = $this->_flatten_episodes();\n }", "function loadFileFromDB() {\n\t\t// If file contents are in bin_data column, fetch data and store in file.\n\t\tif (isset($this->data_array[\"bin_data\"]) && \n\t\t\ttrim($this->data_array[\"bin_data\"]) != \"\") {\n\n\t\t\t// Need to decode the string first.\n\t\t\t$theFileContent = base64_decode($this->data_array[\"bin_data\"]);\n\n\t\t\t$theDir = dirname($this->getFile());\n\t\t\tif (!file_exists($theDir)) {\n\t\t\t\t// Its parent directory does not exist yet. Create it.\n\t\t\t\tmkdir($theDir);\n\t\t\t}\n\n\t\t\t// Create the file for future use.\n\t\t\t$fp = fopen($this->getFile(), \"w+\");\n\t\t\tfwrite($fp, $theFileContent);\n\t\t\tfclose($fp);\n\t\t}\n\t}", "function loadBiblio($file){\n $line = fgets($file);\n while($line != \"\"){\n while($line != \"\\r\\n\" && $line != \"\"){\n if(strpos($line, \" : \") != FALSE){\n $explode = explode(\" : \", $line);\n $property = array(\"name\" => trim($explode[0]), \"value\" => trim($explode[1]));\n }\n else{\n throw new Exception(\"Unexpected : \");\n }\n $table[$property[\"name\"]] = $property[\"value\"];\n $line = fgets($file);\n }\n $line = fgets($file);\n $ttable[] = $table;\n }\n return $ttable;\n}", "public function load()\n\t{\n\t\tif (!$infile = $this->arguments->getOpt(3))\n\t\t{\n\t\t\t$this->output->error('Please provide an input file');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!is_file($infile))\n\t\t\t{\n\t\t\t\t$this->output->error(\"'{$infile}' does not appear to be a valid file\");\n\t\t\t}\n\t\t}\n\n\t\t// First, set some things aside that we need to reapply after the update\n\t\t$params = [];\n\t\t$params['com_system'] = \\Component::params('com_system');\n\t\t$params['com_tools'] = \\Component::params('com_tools');\n\t\t$params['com_usage'] = \\Component::params('com_usage');\n\t\t$params['com_users'] = \\Component::params('com_users');\n\t\t$params['plg_projects_databases'] = \\Plugin::params('projects', 'databases');\n\n\t\t$tables = App::get('db')->getTableList();\n\n\t\t// See if we should drop all tables first\n\t\tif ($this->arguments->getOpt('drop-all-tables'))\n\t\t{\n\t\t\t$this->output->addLine('Dropping all tables...');\n\t\t\tforeach ($tables as $table)\n\t\t\t{\n\t\t\t\tApp::get('db')->dropTable($table);\n\t\t\t}\n\t\t}\n\n\t\t// Craft the command to be executed\n\t\t$infile = escapeshellarg($infile);\n\t\t$cmd = \"mysql -u \" . Config::get('user') . \" -p'\" . Config::get('password') . \"' -D \" . Config::get('db') . \" < {$infile}\";\n\n\t\t$this->output->addLine('Loading data from ' . $infile . '...');\n\n\t\t// Now push the big red button\n\t\texec($cmd);\n\n\t\t$migration = new Migration(App::get('db'));\n\n\t\t// Now load some things back up\n\t\tforeach ($params as $k => $v)\n\t\t{\n\t\t\tif (!empty($v))\n\t\t\t{\n\t\t\t\t$migration->saveParams($k, $v);\n\t\t\t}\n\t\t}\n\n\t\t$this->output->addLine('Load complete!', 'success');\n\t}", "public function run()\n {\n $this->loadTextFile($this->text_file);\n }", "public function load($file);", "public function load($file);", "public function load($file);", "public function loadDatabase(){\n $table = new Table('Textarea_Widgets');\n $table->add_column('Title', 'text');\n $table->add_column('Content', 'text');\n $table->add_column('WidgetName', 'text');\n $table->create();\n }", "public static function run($file, $table)\n {\n try\n {\n //==========================================================================================================\n //Attempt to open the text file and, if successful, loop through the entries in the text file and insert the\n //default data into the table\n //==========================================================================================================\n $file = fopen((getcwd() . $file), \"r\") or die(\"Unable to open file \" . $file);\n if(!feof($file)) {\n $header = trim(fgets($file));\n while(strpos($header, \"#\") !== false){\n $header = trim(fgets($file));\n }\n $header = explode(\"|\", $header);\n }\n\n while (!feof($file))\n {\n $data = trim(fgets($file));\n\n //======================================================================================================\n //Ignore comments (#) and process the file.\n //======================================================================================================\n if (strlen($data) > 0)\n {\n $data = explode(\"|\", $data);\n if (count($header)==2)\n {\n DB::table($table)->insert([trim($header[0]) => trim($data[0]),\n trim($header[1]) => trim($data[1])]);\n }elseif(count($header)==3){\n DB::table($table)->insert([trim($header[0]) => trim($data[0]),\n trim($header[1]) => trim($data[1]),\n trim($header[2]) => trim($data[2])]);\n }\n }\n }\n }\n finally\n {\n fclose($file);\n }\n }", "public function loadFromFile($file)\n {\n \n }", "function _loadDataText() {\r\n\t\treturn unserialize(file_get_contents($this->data_txt));\r\n\t}", "protected function loadData(string $file) {\r\n $fn = sprintf(\"%s/%s.sql\", dirname($file), pathinfo($file, PATHINFO_FILENAME));\r\n\r\n if ($file = realpath($fn)) {\r\n return $this->importMysqlDump(file_get_contents($fn));\r\n }\r\n\r\n throw new Exception(\"File not found: $fn\");\r\n }", "protected function loadFromFile() {\n $columns = [];\n\n while ( ! $this->file->eof()) {\n $row = (array)$this->file->fgetcsv();\n\n if (empty($columns)) {\n $columns = $row;\n continue;\n }\n\n $row = array_filter($row);\n\n if (empty($row)) {\n continue;\n }\n\n $attributes = array_fill_keys($columns, null);\n\n foreach ($row as $index => $value) {\n $attributes[$columns[$index]] = $value;\n }\n\n $model = $this->model->newInstance($attributes, true);\n\n $this->records[$model->id] = $model;\n }\n }", "abstract public function load($filename);", "abstract protected function load(Connection $db);", "public function loadFromDB()\n {\n }", "function importDB($filename) {\n global $DB;\n // Temporary variable, used to store current query\n $templine = '';\n // Read in entire file\n $lines = file($filename);\n // Loop through each line\n foreach ($lines as $line) {\n // Skip it if it's a comment\n if (substr($line, 0, 2) == '--' || $line == '')\n continue;\n\n // Add this line to the current segment\n $templine .= $line;\n // If it has a semicolon at the end, it's the end of the query\n if (substr(trim($line), -1, 1) == ';') {\n // Perform the query\n mysqli_query($DB,$templine) or print($msg[\"BACKUPRESTORE\"][\"SQLQueryNOK\"][$Lang].' \\'<strong>' . $templine . '\\': ' . mysqli_error($DB) . '<br /><br />');\n // Reset temp variable to empty\n $templine = '';\n } // ENDIF\n } // END FOREACH\n mysqli_query($DB,\"FLUSH PRIVILEGES\");\n echo \"Table imported (\".$filename.\") successfully\"; \n}", "protected function importDatabaseData() {}", "public function load() {\n $filename = STORAGE_PATH.$this->id.'.fba';\n if (file_exists($filename)) {\n\n // Split the file where the blocks terminate '<!--SPLITME-->'\n $text = file_get_contents($filename);\n $array = explode('<!--SPLITME-->',$text);\n\n // Set the texts for this article\n $this->article_title = $array[0];\n $this->article_body = $array[1];\n $this->article_comments = $array[2];\n if(strpos($this->article_body, '<!--DESCRIPTION-->')) {\n $this->article_description = strip_tags((explode('<!--DESCRIPTION-->', $this->article_body))[0]);\n } else {\n $this->article_description = '';\n }\n // Confirm the existence of the article\n $this->existence = true;\n }\n }", "public function _restore_db_from_file($file, $settings) {\n // Must be overridden.\n }", "public static function loadFile($file)\n\t{\n\t\treturn self::getConnection()->loadFile($file);\n\t}", "function LoadData($file)\n {\n // Read file lines\n $lines = file($file);\n $data = array();\n foreach($lines as $line)\n $data[] = explode('|',trim($line));\n return $data;\n }", "function importFromSQLFile($Path) {\n\t\t$templine = ''; // Temporary variable, used to store current query\n\t\t$lines = file($Path); // Read in entire file\n\t\tforeach ($lines as $line) {\n\t\t\tif (substr($line, 0, 2) == '--' || $line == '') continue; // Skip it if it's a comment\n\t\t\t$templine .= $line; // Add this line to the current segment\n\t\t\tif (substr(trim($line), -1, 1) == ';') { // If it has a semicolon at the end, it's the end of the query\n\t\t\t mysql_query($templine) or print('Error performing query \\'' . $templine . '\\': ' . mysql_error().PHP_EOL); // Perform the query\n\t\t\t $templine = ''; // Reset temp variable to empty\n\t\t\t}\n\t\t}\n\t}", "function loadData() {\n\t\t$connection = createConnection();\n\n\t\t$loggedIn = Login::checkToken($connection);\n\t\tif (!$loggedIn){\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t# Set any cookies to null to prevent the 'stuck logged in' bug\n\t\tLogin::removeSessionToken($connection);\n\n\t\techo(\"<h1>Connecting to database.</h1>\");\n\t\t# If there is no connection made we can quit, as there is an error\n\t\tif (!$connection) {\n\t\t\tdie(\"Connection failed: \" . mysqli_connect_error());\n\t\t}\n\t\techo \"Connected successfully\";\n\t\t\n\t\t# Let's import our database file\n\t\t$fileName = \"./data/orderdb_sql.ddl\";\n\t\t# Import the data from the file\n\t\t$file = file_get_contents($fileName, true);\n\t\t# Create an array of all of the file contents\n\t\t$lines = explode(\";\", $file);\n\t\techo(\"<p>\"+$lines[0]+\"</p>\");\n\n\t\techo(\"<ol>\");\n\t\t# For each line in the file\n\t\tforeach ($lines as $line){\n\t\t\t# Trime the line\n\t\t\t$line = trim($line);\n\t\t\t# As long as the line isn't blank\n\t\t\tif($line != \"\"){\n\t\t\t\t# Print it out in a list\n\t\t\t\techo(\"<li>\".$line . \";</li><br/>\");\n\t\t\t\t# Run a query on the line\n\t\t\t\t$result = $connection->query($line);\n\t\t\t\tif($result == FALSE){\n\t\t\t\t\tprintf(\"error: %s\\n\", $connection->error);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t# Finally let's close this connection\n\t\t$connection->close();\n\t\techo(\"</p><h2>Database loading complete!</h2>\");\n\t\treturn TRUE;\n\t}", "function Import() {\n // Fichier sql\n $filename = 'http://localhost/alumnus/alumnus.sql';\n\n // Connexion\n $bdd = new PDO('mysql:host=localhost; dbname=alumnus', 'root', '');\n // Variable temporaire stockant la requête (ligne par ligne)\n $templine = '';\n // Lecture entière du fichier\n $lines = file($filename);\n // Boucle à travers chaque ligne\n foreach ($lines as $line){\n // Passage à la ligne suivante si c'est un commentaire ('--' et '/* */') ou si la ligne est vide\n if (substr($line, 0, 2) == '--' || substr($line, 0, 2) == '/*' || $line == '')\n continue;\n\n // Ajout ou concaténation de la ligne au segment actuel\n $templine .= $line;\n // Détection de fin de ligne avec le point-virgule\n if (substr(trim($line), -1, 1) == ';') {\n // Exécution de la requête\n $bdd->exec($templine);\n // Réinitialisation de la variable temporaire\n $templine = '';\n }\n }\n\n // Déconnexion\n $bdd = null;\n}", "public function import($filename = self::PHP_PUTDATA) {\n\n $fh = fopen($filename, 'r');\n\n while (($row = fgets($fh)) !== false) {\n\n if (!empty($row)) {\n\n list($key, $val) = explode(' ', $row);\n $key = $this->getRedisKey(trim($key));\n $val = trim($val);\n\n if ($this->getGraph()->persistent) {\n Redis::getRedis()->set($key, $val);\n } else {\n Redis::getRedis()->set($key, $val, Config::getConfig()->redis->ttl);\n }\n\n }\n\n }\n\n }", "public function readFile() {\n\t\ttry {\n\t\t\tparent::readFile();\n\t\t} catch (LFException $e) {\n\t\t\tthrow $e;\n\t\t}\n\n\t\t// convert all language values from utf-8 to the original charset\n\t\tif (!typo3Lib::isTypo3BackendInUtf8Mode()) {\n\t\t\t$this->localLang = typo3Lib::utf8($this->localLang, FALSE, array('default'));\n\t\t}\n\t}", "function importSql($file) {\n // Reading SQL from file\n echo \"Reading SQL from file '\" . $this->importFilename . \"': \";\n if($this->compress) {\n $lines = gzfile($file);\n } else {\n $lines = file($file);\n }\n echo \" DONE!\\n\";\n\n echo \"Importing SQL into database '\" . $this->database . \"': \";\n $x = 0;\n $importSql = \"\";\n $procent = 0;\n foreach($lines as $line) {\n // Print progress\n $x++;\n $numOfLines = count($lines);\n if($x % (int) ($numOfLines / 20) == 0) {\n $procent += 5;\n if($procent % 25 == 0)\n echo \"$procent%\";\n else\n echo \".\";\n }\n\n // Importing SQL\n $importSql .= $line;\n if(substr(trim($line), strlen(trim($line)) - 1) == \";\") {\n $query = @mysql_query($importSql, $this->connection);\n if(!$query)\n return false;\n $importSql = \"\";\n }\n }\n return true;\n }", "public function importData($file, $dbTable)\n {\n $query = \"\n LOAD DATA LOCAL INFILE '{$file}'\n INTO TABLE {$dbTable} \n FIELDS TERMINATED BY '|'\n (service_no, c, ptp, @person_type_name, member_name, \n s, service_name, rank_rate, pg, occ, occupation_name,\n birth_date, g, hor_city, hor_county, hor_cntry, \n hor_st, state_prv_nm, marital_status, religion_name, \n l, race_name, ethnic_name, race_omb, ethnic_group_name, \n cas_circumstances, cas_city, cas_st, cas_ctry, cas_region_code,\n country_or_water_name, unit_name, d, process_dt, death_dt,\n year, wc, oitp, oi_name, oi_location, close_dt, aircraft, \n h, casualty_type_name, casualty_category, casualty_reason_name, \n csn, body, casualty_closure_name, wall, incident_category,\n i_status_dt, i_csn, i_h, i_aircraft, @created_at, @updated_at)\n SET created_at=NOW(), updated_at=null, person_type_name=LOWER(person_type_name)\";\n\n DB::connection()->getpdo()->exec($query);\n }", "public function __construct($fileName){\n // load db credentials from protected secrets file \n \t$secretsFile = fopen($fileName,\"r\") or die (\"Unable to open file! \" . $fileName);\n\n $servername = trim(fgets($secretsFile)); \n $username = trim(fgets($secretsFile)); \n $password = trim(fgets($secretsFile));\n\n fclose($secretsFile); \n \n $this->db = new dbConnect($servername, $username, $password); \n }", "private function loadFiles($path)\n\t{\n\t\t$parse_table_name = function($path) { \n\t\t\tpreg_match('/\\/([^\\/]+?)\\.xml/', $path, $match);\n\t\t\treturn $match[1];\n\t\t};\n\t\t\n\t\t# Foreach xml file in the given path we should load it into the database\n\t\tforeach (glob($path.'/*.xml') as $file)\n\t\t{ \n\t\t\t# Parse xml\n\t\t\t$xml_data = simplexml_load_file($file, null, LIBXML_NOCDATA);\n\n\t\t\t# Find table name and fields\n\t\t\t$table = $parse_table_name($file);\n\t\t\t$fields = array_reduce(current($xml_data), function($fields, $el) {\n\t\t\t\t$keys = array_keys(current($el->attributes()));\n\t\t\t\treturn array_unique(array_merge($keys, $fields ?: []));\n\t\t\t});\n\t\t\t$fields = implode(',', $fields);\n\n\t\t\t# Create table schema\n\t\t\t$sql = \"CREATE TABLE {$table} ({$fields})\";\n\t\t\t$this->_connection->query($sql);\n\n\t\t\t# Load data using PDO connection\n\t\t\tforeach ($xml_data as $index => $element)\n\t\t\t{\n\t\t\t\t$attributes = current($element->attributes());\n\t\t\t\t$fields = implode(',', array_keys($attributes));\n\t\t\t\t$attribute_fields = ':'.implode(',:', array_keys($attributes));\n\t\t\t\t\n\t\t\t\t$sql = \"INSERT INTO {$table} ({$fields}) VALUES ($attribute_fields)\";\n\t\t\t\t$sth = $this->_connection->prepare($sql);\n\t\t\t\t$sth->execute($attributes);\n\t\t\t}\n\t\t}\n\t}", "function LoadData($file)\n {\n $lines = file($file);\n $data = array();\n foreach ($lines as $line)\n $data[] = explode(';', trim($line));\n return $data;\n }", "function readDB() {\n\n\t\t// READ FROM MYSQL, kh_mod 0.3.0, add\n\t\treturn ($this->sqldatabase)?\n\t\t\t\t $this->readDBSQL()\n\t\t\t\t :\n\t\t\t\t $this->readDBFlatfile();\n\t}", "abstract public function load();", "abstract public function load();", "public static function openDatabaseFile($file, iKey $mkey, &$error)\r\n\t{\r\n\t\t$reader = ResourceReader::openFile($file);\r\n\t\tif($reader == null)\r\n\t\t{\r\n\t\t\t$error = \"file '\" . $file . '\" does not exist.';\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t$db = Database::loadFromKdbx($reader, $mkey, $error);\r\n\t\t$reader->close();\r\n\t\treturn $db;\r\n\t}", "public function loadFile($filePath);", "public function readDatabase() {\n\t\t$q = $this->pdo->query(\"SELECT count(*) FROM `Articles`\");\n\t\t$count = $q->fetch(PDO::FETCH_ASSOC)[\"count(*)\"];\n\t\t$numFetched = 0;\n\t\t$start = 0;\n\t\t// Fetch only 50 articles at a time to limit the memory impact\n\t\twhile($numFetched < $count){\n\t\t\t$q = $this->pdo->query(\"SELECT \".$this->columns.\" FROM `Articles` LIMIT $start,100\");\n\t\t\tforeach($q->fetchAll(PDO::FETCH_ASSOC) as $a){\n\t\t\t\t$this->articles[] = $this->makeArticleFromDB($a);\n\t\t\t\t$numFetched += 1;\n\t\t\t}\n\t\t\t$start += 100;\n\t\t}\n\t}", "abstract protected function _loadMappingFile($file);", "abstract protected function _loadMappingFile($file);", "public function loadDBProperties()\n\t{\n\t\t$xml = simplexml_load_file(self::DB_PROPERTIES);\n\t\t$this->hostname = (string)$xml->hostname;\n\t\t$this->username = (string)$xml->username;\n\t\t$this->password = (string)$xml->password;\n\t\t$this->database = (string)$xml->database;\n\t}", "public function __construct($file)\n {\n $this->loadSchema($file);\n }", "function openFile($pdo) {\n $cities = fopen('cities.txt', 'r');\n\n $ctr=1;\n while (!feof($cities)) {\n $city = fgetcsv($cities, 0, ';');\n\n insertDatabase($city[0], $city[1], $pdo, $ctr);\n $ctr++;\n }\n}", "public abstract function load();", "function insertFromFileToDb($txtFileURL, $link, $table, $column){\n echo $txtFileURL;\n $s = file_get_contents(__DIR__.\"\\\\$txtFileURL\");\n $sAr = explode(\"\\n\", $s);\n $sAr = array_map('trim',$sAr); //remove possible white space\n for ($i=0; $i < count($sAr) ; $i++) {\n $sql = \"INSERT INTO `$table`(`$column`) VALUES ('$sAr[$i]')\";\n if ($link->query($sql) !== TRUE) echo \"Error: \" . $sql . \"<br>\" . $link->error;\n }\n}", "public function importSql($pathAndFilename) {\n\t\t$sql = file($pathAndFilename, FILE_IGNORE_NEW_LINES & FILE_SKIP_EMPTY_LINES);\n\n\t\t\t// Remove MySQL style key length delimiters (yuck!) if we are not setting up a MySQL db\n\t\tif ($this->pdoDriver !== 'mysql') {\n\t\t\t$sql = preg_replace('/\"\\([0-9]+\\)/', '\"', $sql);\n\t\t}\n\n\t\t$statement = '';\n\t\tforeach ($sql as $line) {\n\t\t\t$statement .= ' ' . trim($line);\n\t\t\tif (substr($statement, -1) === ';') {\n\t\t\t\t$this->databaseHandle->query($statement);\n\t\t\t\t$statement = '';\n\t\t\t}\n\t\t}\n\t}", "public function loadFromFile($filename)\n\t{\n\t\t$this->load(file_get_contents($filename));\n\t}", "public function readFromFile($filePath = null)\n {\n if (!$filePath) {\n $filePath = $this->filePath;\n }\n \n if ($filePath) {\n if (is_file($filePath)) {\n $fileContents = file_get_contents($filePath);\n\n if ($fileContents) {\n $data = [];\n $lines = explode(PHP_EOL, $fileContents);\n\n // Extract the field names.\n $iLine = 0;\n $nLines = count($lines);\n $foundTableDef = false;\n while (!$foundTableDef && $iLine < $nLines) {\n $foundTableDef = substr($lines[$iLine++], 0, 12) == 'CREATE TABLE';\n }\n if ($foundTableDef) {\n $isFieldName = true;\n while ($isFieldName) {\n $line = trim($lines[$iLine++]);\n $this->fieldNames[] = substr($line, 1, strrpos($line, '`') - 1);\n $isFieldName = $line = trim($lines[$iLine])[0] == '`';\n }\n }\n \n // Extract the data.\n // Find the insert statement.\n $foundInsert = false;\n while (!$foundInsert && $iLine < $nLines) {\n ++$iLine;\n $foundInsert = substr($lines[$iLine], 0, 11) == 'INSERT INTO';\n }\n \n if ($foundInsert) {\n $line = $lines[$iLine];\n $iChar = 23;\n \n // Continue to the end of the data.\n while ($line[$iChar] != ';') {\n// echo $line[$iChar].' => NOT AT END ;'.PHP_EOL;\n \n // Move to start of a set of values.\n while ($line[$iChar++] != '(') {\n// echo $line[$iChar].' => NOT AT START OF VALUES ('.PHP_EOL;\n }\n// echo $line[$iChar].' => FOUND START ('.PHP_EOL;\n \n // Add data until the end of the set of values are\n // reached.\n $row = [];\n $iField = 0;\n while ($line[$iChar] != ')') {\n// echo $line[$iChar].' => NOT AT END OF VALUES )'.PHP_EOL;\n $value = '';\n \n // If data is a string enclosed in the text delimiter then find\n // the matching end delimiter, not a delimiter escaped with a slash or a field delimiter.\n if ($line[$iChar] == '\\'') {\n// echo $line[$iChar].' => TEXT DELIMITER FOUND'.PHP_EOL;\n $iChar++;\n while ($line[$iChar] != '\\'' || ($line[$iChar - 1] == '\\\\')) {\n// echo $line[$iChar].' => NOT TEXT DELIMITER OR ESCAPED'.PHP_EOL;\n $value .= $line[$iChar];\n// echo $value.PHP_EOL;\n ++$iChar;\n }\n// echo $line[$iChar].' => END TEXT DELIMITER FOUND'.PHP_EOL;\n ++$iChar;\n } else {\n// echo $line[$iChar].' => NO TEXT DELIMITER'.PHP_EOL;\n }\n \n // If data not enclosed in the text delimiter then find\n // the data before the field delimiter.\n while (\n $line[$iChar] != ',' && $line[$iChar] != ')'\n ) {\n// echo $line[$iChar].' => NOT FIELD DELIMITER OR END OF VALUES'.PHP_EOL;\n $value .= $line[$iChar++];\n// echo $value.PHP_EOL;\n }\n \n// echo $line[$iChar].' => FIELD DELIMITER OR END OF VALUES FOUND'.PHP_EOL;\n// echo $value.PHP_EOL;\n \n $row[$this->fieldNames[$iField++]] = $value;\n if ($line[$iChar] == ',') {\n ++$iChar;\n }\n }\n ++$iChar;\n $data[] = $row;\n// var_dump($data);die;\n }\n// var_dump($data);die;\n }\n } else {\n throw new \\Exception('Dump file cannot be opened or is empty');\n }\n } else {\n throw new \\Exception('File does not exist');\n }\n } else {\n throw new \\Exception(\n 'No file path defined to read in mysqldump file'\n );\n }\n \n return new DataSet($data);\n }", "function LoadData($file)\r\r\n\t{\r\r\n\t\t$f = new LineInputWrapper( new FileInputStream($file) );\r\r\n\t\t$data = /*. (UString[int][int]) .*/ array();\r\r\n\t\t$separator = u(\";\");\r\r\n\t\twhile( ($line = $f->readLine()) !== NULL )\r\r\n\t\t\t$data[] = UString::fromISO88591($line)->explode($separator);\r\r\n\t\treturn $data;\r\r\n\t}", "function load_texts($file)\n{\n\n if (substr($file, -5) != '.json') {\n throw new Exception('Invalid language file found in language folder.');\n }\n\n $fname = strtolower(substr(basename($file), 0, - (strlen('.json'))));\n\n $GLOBALS[\"__LANGUAGE__{$fname}__\"] = json_decode(file_get_contents($file), true);\n}", "public function loadData($path) {\n\t\t\n\t\t$this->properties->lines = 1;\n\t\t\n\t\t$sql = 'INSERT INTO '.$this->properties->table.' ('.implode(\", \", $this->properties->columns).') VALUES (:'.implode(\", :\", $this->properties->columns).')'; \n\t\t$statement = $this->properties->con->prepare($sql); \t\t\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t\t\n\t\t\tif(substr(finfo_file($finfo,$path),0,4) != \"text\") {\n\t\t\t\tthrow new ImporterException(\"Not a CSV document!\");\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($path,\"rt\");\n\t\t\t\n\t\t\tif(!$fp) {\n\t\t\t\tthrow new ImporterException(\"Couldn't read file!\");\n\t\t\t}\n\t\t\t\n\t\t\t$first_row = 1;\n\t\t\t\n\t\t\twhile(($row = fgetcsv($fp,0,$this->properties->delimeter,$this->properties->enclosure)) !== false) {\n\t\t\t\tif(count($row) == 1 && !$row[0]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tforeach($row as &$value) {\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t}\n\t\t\t\t$this->data[] = $row;\n\t\t\t\tif($first_row && $this->properties->has_header) {\n\t\t\t\t\t$first_row = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tparent::insertData($statement);\n\t\t\t\t$this->properties->lines++;\n\t\t\t\t$this->properties->has_header = false;\n\t\t\t\t$this->properties->append = true;\n\t\t\t\t$this->data = array();\n\t\t\t}\n\t\t\t\n\t\t\tfclose($fp);\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t/*if($this->properties->lines > 1) {\n\t\t\t\tparent::deleteData();\n\t\t\t}*/\n\t\t\tthrow new ImporterException(\"<b>File</b>: \".$path.\"<br /><br /><b>Error</b>: \".$e->getMessage().\"<br/>\");\n\t\t}\n\n\t}", "private function import()\n {\n if ($this->option('file') == null) {\n $this->warn('Please specify an import file');\n\n return;\n }\n\n $translatedLocaleValues = [];\n $file = fopen($this->option('file'), 'r');\n\n // Header row\n $line = fgetcsv($file, 0, $this->csvSeperator);\n if ($line[0] == 'translation_string') {\n $translationLocale = $line[2];\n } else {\n $this->warn('The given file seems to have an incorrect format');\n\n return;\n }\n\n // Data rows\n while (($line = fgetcsv($file, 0, $this->csvSeperator)) !== false) {\n if (empty($line[2])) {\n continue;\n }\n\n $translatedLocaleValues[$translationLocale][$line[0]] = $line[2];\n }\n\n $this->manager->write($translatedLocaleValues);\n }", "abstract public function loadData();", "protected function load()\n\t{\n //---------------------\n\t\tif (($handle = simplexml_load_file($this->_origin)) !== FALSE)\n\t\t{\n $this->_fields = array(\"id\",\"task\",\"priority\",\"size\",\"group\",\"deadline\", \"status\",\"flag\");\n foreach($handle as $item){\n $record = new stdClass();\n for ($i = 0; $i < count($this->_fields); $i ++ )\n $record->{$this->_fields[$i]} = (string)$item[$this->_fields[$i]];\n $this->_data[$record->id] = $record;\n }\n\t\t}\n\t\t// --------------------\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t}", "function read($a_force_db = false)\n\t{\n\t\tparent::read($a_force_db);\n\t\t$this->loadFromDb();\n\t}", "function loadAndInsert($filename,$dbObject,$extraData,$tag)\n{\n $db = $dbObject->getConnection();\n $row = 1;\n if (($handle = fopen($filename, \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, 7000, \",\")) !== FALSE) {\n if ($row == 1) {\n $row++;\n } else {\n $input = [];\n $num = count($data);\n for ($c=0; $c < $num; $c++) {\n $temp = [];\n $temp['general'] = $data[$c];\n $input[] = $temp;\n }\n //add extra data\n foreach ($extraData as $temp) {\n $input[] = $temp;\n }\n // insert in DB\n doInsert($dbObject, $tag, $input,$db);\n }\n }\n }\n $db = null;\n fclose($handle);\n}", "protected function read() {\n\t\t$fileContent = trim(file_get_contents($this->filepath));\n\t\t$pattern = '/\\$([^=]+)=([^;]+);/';\n\t\t$matches = null;\n\t\t$matchesFound = preg_match_all($pattern, $fileContent, $matches);\n\t\t$configContents = array();\n\t\tif ($matchesFound) {\n\t\t\t$configContents = $matches[0];\n\t\t}\n\t\t$this->rows = array();\n\t\tforeach ($configContents as $configLine) {\n\t\t\t$this->rows[] = new ConfigFileRow($configLine, $this);\n\t\t}\n\t\t$this->rowIndex = -1;\n\t\tunset($fileContent);\n\t}", "public function runFile($path)\n\t{\n\t\ttry{\n\t\t\tif(!($sql = file_get_contents($path)))\n\t\t\t\tthrow new DatabaseConnectionNotice('SQL file not found at ' . $path);\n\n\t\t\tif($this->multi_query($sql))\n\t\t\t{\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tif($result = $this->store_result())\n\t\t\t\t\t\t$result->free();\n\t\t\t\t}while($this->more_results() && $this->next_result());\n\t\t\t}else{\n\t\t\t\t$this->throwError();\n\t\t\t}\n\t\t\treturn true;\n\t\t}catch(Exception $e){\n\t\t\treturn false;\n\t\t}\n\t}", "function readDatabase($filename, $id) \n{\n $data = implode(\"\", file($filename));\n $parser = xml_parser_create();\n xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);\n xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);\n xml_parse_into_struct($parser, $data, $values, $tags);\n xml_parser_free($parser);\n\n // loop through the structures\n foreach ($tags as $key=>$val) {\n if ($key == \"molecule\") {\n $molranges = $val;\n // each contiguous pair of array entries are the \n // lower and upper range for each molecule definition\n for ($i=0; $i < count($molranges); $i+=2) {\n //echo $molranges[$i][\"value\"];\n $offset = $molranges[$i] + 1;\n $len = $molranges[$i + 1] - $offset;\n $tdb[] = parseMol(array_slice($values, $offset, $len));\n }\n } else {\n continue;\n }\n }\n return $tdb;\n}", "public function database($fileName = '/Lib.db.php')\n {\n require_once __LIBRARY_PATH.$fileName;\n $this->db = new Database();\n }", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function LoadData($file) {\n\t\t// Read file lines\n\t\t$lines = file($file);\n\t\t$data = array();\n\t\tforeach($lines as $line) {\n\t\t\t$data[] = explode(';', chop($line));\n\t\t}\n\t\treturn $data;\n\t}", "function readData()\r\n\t{\r\n\t\tif( !file_exists( $this->source_file ) )\r\n\t\t{\r\n\t\t\tdie( \"Can not proceed: Can not locate data file: '\" . $this->source_file . \"'\" );\r\n\t\t}\r\n\t\t$this->m_aData = fopen( $this->source_file , 'r');\r\n\t}", "function serendipity_parse_sql_inserts($filename) {\n $queries = array();\n\n $fp = fopen($filename, 'r', 1);\n if ($fp) {\n while (!@feof($fp)) {\n $line = trim(fgets($fp, 65536));\n if (preg_match('#^insert\\s*into.*;$#i', $line)) {\n array_push($queries, $line);\n }\n }\n }\n fclose($fp);\n\n return $queries;\n}", "function reading_file($file_txt) {\n\t$data_txt = $file_txt;\n\t$fh = fopen($data_txt, \"r\");\n\t$file = file_get_contents($data_txt);\n\treturn $file;\n}", "public function loadFile ($arquivo) {\n\t\t#################################################################################\n\t\t## Variáveis globais\n\t\t#################################################################################\n\t\tglobal $log;\n\t\t\n\t\t#################################################################################\n\t\t## Verifica se o arquivo existe\n\t\t#################################################################################\n\t\tif (!file_exists($arquivo)) \t{\n\t\t\t$this->adicionaErro(0, 0, null, 'Arquivo não encontrado ('.$arquivo.') ');\n\t\t\tthrow new \\Exception('Arquivo não encontrado ('.$arquivo.') ');\n\t\t}\n\n\t\t#################################################################################\n\t\t## Verifica se o arquivo pode ser lido\n\t\t#################################################################################\n\t\tif (!is_readable($arquivo)) \t{\n\t\t\t$this->adicionaErro(0, 0, null, 'Arquivo não pode ser lido ('.$arquivo.') ');\n\t\t\tthrow new \\Exception('Arquivo não pode ser lido ('.$arquivo.') ');\n\t\t}\n\n\t\t#################################################################################\n\t\t## Lê o arquivo\n\t\t#################################################################################\n\t\t$lines\t= file($arquivo);\n\t\t\n\t\t#################################################################################\n\t\t## Verifica se o arquivo tem informação\n\t\t#################################################################################\n\t\tif (sizeof($lines) < 2) {\n\t\t\t$this->adicionaErro(0, 0, null, 'Arquivo sem informações ('.$arquivo.') ');\n\t\t\tthrow new \\Exception('Arquivo sem informações ('.$arquivo.') ');\n\t\t}\n\t\t \n\t\t#################################################################################\n\t\t## Percorre as linhas do arquivo\n\t\t#################################################################################\n\t\tfor ($i = 0; $i < sizeof($lines); $i++) {\n\t\t\t$codTipoReg\t\t= substr($lines[$i],7 ,1);\n\t\t\t//$log->info(\"Tipo de registro encontrado: $codTipoReg\");\n\t\t\tif ($codTipoReg == 3) {\n\t\t\t\t$codSegmento\t= substr($lines[$i],13 ,1);\n\t\t\t}else{\n\t\t\t\t$codSegmento\t= \"\";\n\t\t\t}\n\t\t\t$tipoReg\t\t= \"R\".$codTipoReg.$codSegmento;\n\t\t\t$linha\t\t\t= str_replace(array(\"\\n\", \"\\r\"), '', $lines[$i]); \n\t\t\t$reg\t\t\t= $this->adicionaRegistro($tipoReg);\n\t\t\tif ($reg === null) {\n\t\t\t\tcontinue;\n\t\t//\t\t$this->adicionaErro(0, $i+1, null, \"Linha fora do padrão definido\");\n\t\t//\t\treturn;\n\t\t\t}else{\n\t\t\t\t$ok\t\t\t= $this->registros[$reg]->carregaLinha($linha);\n\t\t\t}\n\t\t\t\n\t\t\tif ($ok !== true) \t{\n\t\t\t\t$log->err(\"Erro no tipo de registro: $codTipoReg, CodSegmento: $codSegmento, mensagem: $ok\");\n\t\t\t\t$this->adicionaErro(0, $this->registros[$reg]->getLinha(), $this->registros[$reg]->getTipoRegistro(), $ok);\n\t\t\t}\n\t\t}\n\n\t}", "public function LoadData($file) {\r\n\t\t// Read file lines\r\n\t\t$lines = file($file);\r\n\t\t$data = array();\r\n\t\tforeach($lines as $line) {\r\n\t\t\t$data[] = explode(';', chop($line));\r\n\t\t}\r\n\t\treturn $data;\r\n\t}", "abstract function loadDbData($compid);", "public function import(string $filePath);", "public function load($filePath)\n {\n $this->filePath = $filePath;\n\n $this->storeCsvTemp();\n\n $this->extractRows();\n $this->combineKeys();\n }", "public function loadMappings($filepath);", "function load_from_database () : bool {\n $db = $this->getDatabase();\n\n $id = $db->escape($this->id);\n $sql = \"SELECT * FROM content_files WHERE content_id = '\" . $id . \"'\";\n if ( !($result = $db->query($sql)) ) {\n message_die(SQL_ERROR, \"Unable to query content\", '', __LINE__, __FILE__, $sql);\n }\n if (!$row = $db->fetchRow($result)) {\n $this->lastError = \"Content unknown: \" . $this->id;\n return false;\n }\n $this->load_from_row($row);\n return true;\n }", "private function loadFile()\n\t{\n\t\tif( empty($this->content) ) {\n\t\t\tif( empty($this->file) ) {\n\t\t\t\tthrow new Exception('Which file should I parse, you ...!');\n\t\t\t} else {\n\t\t\t\tif( strtolower( $this->file->getExtension() ) == 'zip' ) {\n\t\t\t\t\t$this->content = $this->handleZipFile( $this->file );\n\t\t\t\t} else {\n\t\t\t\t\t$this->content = $this->file->getContents();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function serendipity_parse_sql_tables($filename) {\n $in_table = 0;\n $queries = array();\n\n $fp = fopen($filename, 'r', 1);\n if ($fp) {\n while (!@feof($fp)) {\n $line = trim(fgets($fp, 4096));\n if ($in_table) {\n $def .= $line;\n if (preg_match('/^\\)\\s*(type\\=\\S+|\\{UTF_8\\})?\\s*\\;$/i', $line)) {\n $in_table = 0;\n array_push($queries, $def);\n }\n } else {\n if (preg_match('#^create table \\{PREFIX\\}\\S+\\s*\\(#i', $line)) {\n $in_table = 1;\n $def = $line;\n }\n\n if (preg_match('#^create\\s*(\\{fulltext\\}|unique|\\{fulltext_mysql\\})?\\s*index#i', $line)) {\n array_push($queries, $line);\n }\n }\n }\n fclose($fp);\n }\n\n return $queries;\n}", "function db_load_data($db_link, $file, $table){\n $query = \"LOAD DATA LOCAL INFILE'\" . $file . \"' INTO TABLE \". $table .\n \" FIELDS TERMINATED BY ',' ENCLOSED BY '\\' ESCAPED BY '\\\\\\\\' LINES TERMINATED BY '\\\\r\\\\n' IGNORE 1 LINES\";\n $result = mysqli_query($db_link, $query);\n if($result === FALSE) die(mysqli_error($db_link));\n return mysqli_affected_rows($db_link);\n}", "protected function __construct()\n\t{\n\t\t// Read the local configuration file\n\t\t$strMode = 'top';\n\t\t$resFile = fopen(TL_ROOT . '/system/modules/course_builder/config/database.sql', 'rb');\n\n\t\twhile (!feof($resFile))\n\t\t{\n\t\t\t$strLine = fgets($resFile);\n\t\t\t$strTrim = trim($strLine);\n\n\t\t\tif ($strTrim == '?>')\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($strTrim == '-- LESSON SEGMENT START --')\n\t\t\t{\n\t\t\t\t$strMode = 'data';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($strTrim == '-- LESSON SEGMENT STOP --')\n\t\t\t{\n\t\t\t\t$strMode = 'bottom';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($strMode == 'top')\n\t\t\t{\n\t\t\t\t$this->strTop .= $strLine;\n\t\t\t}\n\t\t\telseif ($strMode == 'bottom')\n\t\t\t{\n\t\t\t\t$this->strBottom .= $strLine;\n\t\t\t}\n\t\t\telseif ($strTrim != '')\n\t\t\t{\n\t\t\t\tif (preg_match('@^[ ]*`([^`]+)`([^,]*)@i', $strLine, $arrMatch))\n\t\t\t\t{\n\t\t\t\t\t$this->arrData[$arrMatch[1]] = trim($arrMatch[2]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfclose($resFile);\n\n\t\t// Do not use __destruct, because Database object might be destructed first (see http://dev.contao.org/issues/2236)\n\t\tregister_shutdown_function(array($this, 'storeFile'));\n\t}", "public function dataFromSQLFiles(): void\n {\n if (file_exists($this->resourceDir . '/epsg/epsg.sqlite')) {\n unlink($this->resourceDir . '/epsg/epsg.sqlite');\n }\n\n $sqlite = new SQLite3(\n $this->resourceDir . '/epsg/epsg.sqlite',\n SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE\n );\n\n $sqlite->enableExceptions(true);\n $sqlite->exec('PRAGMA journal_mode=WAL'); // WAL is faster\n\n $tableSchema = file_get_contents($this->resourceDir . '/epsg/PostgreSQL_Table_Script.sql');\n if (str_starts_with($tableSchema, self::BOM)) {\n $tableSchema = substr($tableSchema, 3);\n }\n $sqlite->exec($tableSchema);\n\n $tableData = file_get_contents($this->resourceDir . '/epsg/PostgreSQL_Data_Script.sql');\n if (str_starts_with($tableData, self::BOM)) {\n $tableData = substr($tableData, 3);\n }\n $sqlite->exec($tableData);\n\n // Custom alias/no-op method\n $sqlite->exec(\"INSERT INTO epsg_coordoperationmethod (coord_op_method_code, coord_op_method_name, reverse_op, data_source, revision_date, deprecated, remarks) VALUES (32768, 'Alias', 1, 'PHPCoord', '2021-10-28', 0, '')\");\n\n // Corrections\n $sqlite->exec(\"UPDATE epsg_coordoperationparamvalue SET param_value_file_ref = NULL WHERE param_value_file_ref = ''\");\n $sqlite->exec('UPDATE epsg_coordinateaxis SET uom_code = 9102 WHERE uom_code = 9122'); // supplier-defined degrees to regular degrees\n $sqlite->exec('UPDATE epsg_coordoperation SET deprecated = 1 WHERE coord_op_code IN (1851, 9235, 15933)');\n $sqlite->exec('DELETE FROM epsg_coordinatereferencesystem WHERE coord_ref_sys_code = 9912;'); // erroneous test entry\n\n /*\n * AusGeoidv2 abuses the NTv2 file format to have very large files, and a confusing implementation (latitude shifts are actually height offsets),\n * so use a GTX conversion of those files instead...\n */\n $sqlite->exec('UPDATE epsg_coordoperation SET coord_op_method_code = 1088 WHERE coord_op_code IN (9465, 9466, 9467, 9693)');\n $sqlite->exec('UPDATE epsg_coordoperation SET coord_op_method_code = 9665 WHERE coord_op_code IN (5656, 5657, 8451, 9461, 9692)');\n\n $sqlite->exec(\"UPDATE epsg_coordoperationparamvalue SET param_value_file_ref = REPLACE(param_value_file_ref, '.gsb', '.gtx') WHERE coord_op_code IN (9465, 9466, 9467, 9693) OR coord_op_code IN (5656, 5657, 8451, 9692)\");\n $sqlite->exec('UPDATE epsg_coordoperationparamvalue SET coord_op_method_code = 1088 WHERE coord_op_code IN (9465, 9466, 9467, 9693)');\n $sqlite->exec('UPDATE epsg_coordoperationparamvalue SET coord_op_method_code = 9665 WHERE coord_op_code IN (5656, 5657, 8451, 9692)');\n\n /*\n * VERTCON files/extents described in EPSG are the old VERTCON1/2 .94 file format, not the VERTCON3 .b files\n * which cover geographically different extents. Therefore we use the official NOAA VDatum GTX conversions of the\n * older files instead to avoid yet-another-grid-format implementation.\n */\n $sqlite->exec('UPDATE epsg_coordoperation SET coord_op_method_code = 1084 WHERE coord_op_code IN (7969, 7970, 7971)');\n $sqlite->exec(\"UPDATE epsg_coordoperationparamvalue SET param_value_file_ref = REPLACE(param_value_file_ref, '.94', '.gtx') WHERE coord_op_code IN (7969, 7970, 7971)\");\n $sqlite->exec('UPDATE epsg_coordoperationparamvalue SET coord_op_method_code = 1084 WHERE coord_op_code IN (7969, 7970, 7971)');\n\n /*\n * Transformation from S-JTSK [JTSK03] to S-JTSK is listed as NADCON even though there's an official NTv2 file.\n * EPSG have declined to add it as an alternate to the DB, so override that here.\n */\n $sqlite->exec('UPDATE epsg_coordoperation SET coord_op_method_code = 9615 WHERE coord_op_code = 8364');\n $sqlite->exec('DELETE FROM epsg_coordoperationparamvalue WHERE coord_op_code = 8364');\n $sqlite->exec(\"INSERT INTO epsg_coordoperationparamvalue (coord_op_code, coord_op_method_code, parameter_code, param_value_file_ref) VALUES (8364, 9615, 8656, 'Slovakia_JTSK03_to_JTSK.gsb')\");\n\n /*\n * Time-dependent transformations from/to WGS84 are only present in transforms involving specific realisations\n * so add transforms to/from the generic ensemble codes to the most recent version.\n * XXX technically, the ensemble accuracy is 2m not 0, but we're actively assuming the latest realisation\n */\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32768, 'WGS 84 to WGS 84 (G2139) (geocen)', 'transformation', 4978, 9753, 32768, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32768, 1262, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32769, 'WGS 84 to WGS 84 (G2139) (geog2D)', 'transformation', 4326, 9755, 32768, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32769, 1262, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32770, 'WGS 84 to WGS 84 (G2139) (geog3D)', 'transformation', 4979, 9754, 32768, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32770, 1262, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32771, 'WGS 84 to WGS 84 (G2139) (geog2D to geocen)', 'transformation', 4326, 9753, 9602, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32771, 1262, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32772, 'WGS 84 to WGS 84 (G2139) (geog3D to geocen)', 'transformation', 4979, 9753, 9602, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32772, 1262, 1203)\");\n\n /*\n * Time-dependent transformations from/to ETRS89 are only present in transforms involving specific realisations\n * so add transforms to/from the generic ensemble codes to ETRF2000 (ETRF2014 is technically better, ETRF2000\n * is still recommended by EUREF for georeferencing)\n * XXX technically, the ensemble accuracy is 0.1m not 0, but we're actively assuming the relevant realisation\n */\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32773, 'ETRS89 to ETRF2000 (geocen)', 'transformation', 4936, 7930, 32768, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32773, 1298, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32774, 'ETRS89 to ETRF2000 (geog2D)', 'transformation', 4258, 9067, 32768, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32774, 1298, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32775, 'ETRS89 to ETRF2000 (geog3D)', 'transformation', 4937, 7931, 32768, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32775, 1298, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32776, 'ETRS89 to ETRF2000 (geog2D to geocen)', 'transformation', 4258, 7930, 9602, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32776, 1298, 1203)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32777, 'ETRS89 to ETRF2000 (geog3D to geocen)', 'transformation', 4937, 7930, 9602, 0, 'PHPCoord', '2023-02-23', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32777, 1298, 1203)\");\n\n /*\n * EPSG has a transform listed from generic ETRS89 (2D) to generic WGS84 (2D) but not the 3D for some reason\n */\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32778, 'ETRS89 to WGS 84 (geocen)', 'transformation', 4936, 4978, 32768, 1, 'PHPCoord', '2023-02-19', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32778, 1262, 1298)\");\n $sqlite->exec(\"INSERT INTO epsg_coordoperation (coord_op_code, coord_op_name, coord_op_type, source_crs_code, target_crs_code, coord_op_method_code, coord_op_accuracy, data_source, revision_date, deprecated, show_operation, remarks) VALUES (32779, 'ETRS89 to WGS 84 (geog3D)', 'transformation', 4937, 4979, 32768, 1, 'PHPCoord', '2023-02-19', 0, 1, '')\");\n $sqlite->exec(\"INSERT INTO epsg_usage (object_table_name, object_code, extent_code, scope_code) VALUES ('epsg_coordoperation', 32779, 1262, 1298)\");\n\n /*\n * Too many \"world\" extents with confusing descriptions, unify\n */\n $sqlite->exec('UPDATE epsg_usage SET extent_code = 1262 WHERE extent_code IN (1263, 2346, 2830, 4393, 4520, 4523)');\n\n $sqlite->close();\n }", "private function load($file) {\n $yml = new \\Yaml($file);\n $data = $yml->parse();\n\n $this->name = \\a::get($data, 'name', NULL);\n $this->theme = \\a::get($data, 'theme', \\c::get('theme', 'grass'));\n $this->eventdate = \\a::get($data, 'eventdate', NULL);\n $this->intro = \\a::get($data, 'intro', NULL);\n $this->storeFields(\\a::get($data, 'fields', FALSE));\n $this->action = \\a::get($data, 'action', NULL);\n }", "protected function load_database()\n\t{\n\t\t$this->db= load_class(\"DB\", 'database');\n\t}", "public function loadStorage($file){\n\t\tif (file_exists($file)) {\n\t\t\t$this->user = unserialize(file_get_contents($file));\n\t\t}\n\t}", "public function LoadData($file) {\n // Read file lines\n $lines = file($file);\n $data = array();\n foreach($lines as $line) {\n $data[] = explode(';', chop($line));\n }\n return $data;\n }", "public function load(){\n\t\tif (is_file($this->_filename) && is_readable($this->_filename)){\n\t\t\t$this->_storage = require($this->_filename);\n\t\t\t$this->_dataAvailable = true;\n\t\t}\n\t}" ]
[ "0.6579144", "0.65604305", "0.6471807", "0.6206675", "0.6129278", "0.5933081", "0.59056747", "0.5866924", "0.5866924", "0.5866924", "0.5809635", "0.5785229", "0.5778364", "0.5771357", "0.5770827", "0.5719143", "0.5713884", "0.56911826", "0.56901693", "0.566998", "0.56670684", "0.5665484", "0.56374794", "0.55753165", "0.5573733", "0.55563813", "0.5551714", "0.554673", "0.55413496", "0.5512786", "0.55083936", "0.5478487", "0.5475696", "0.54682624", "0.5457587", "0.5436002", "0.5430535", "0.5430535", "0.5409179", "0.5405163", "0.53982127", "0.5395092", "0.5395092", "0.5378603", "0.5362691", "0.533166", "0.53289753", "0.53259873", "0.5313989", "0.53007454", "0.5297276", "0.52939343", "0.5274389", "0.5269529", "0.5264692", "0.52501595", "0.52272886", "0.5225014", "0.5213368", "0.5210945", "0.5179128", "0.5172349", "0.51710737", "0.51669294", "0.51669294", "0.51669294", "0.51669294", "0.516542", "0.516542", "0.516542", "0.516542", "0.516542", "0.516542", "0.516542", "0.516542", "0.516542", "0.516542", "0.516542", "0.516542", "0.516542", "0.5165251", "0.51596254", "0.51594716", "0.51561314", "0.5152472", "0.51450294", "0.514256", "0.51262915", "0.5120482", "0.5117163", "0.5117108", "0.5109221", "0.5108913", "0.50888145", "0.5074034", "0.50666225", "0.5056318", "0.5054504", "0.50419205", "0.50383735", "0.50237685" ]
0.0
-1
main function that gets a list of database tables and sends to view
function index() { // // initialize email settings // $config['protocol'] = 'sendmail'; $config['mailpath'] = '/usr/sbin/sendmail'; $config['charset'] = 'iso-8859-1'; $config['mailtype'] = 'html'; $config['wordwrap'] = TRUE; // $this->email->initialize($config); // // gets a list of files in the uploads directory // $files = directory_map('/var/lib/mysql-files/uploads/', 1); // // get all the table names from the database // $tables = $this->data_driver->get_tables(); // // set tables // $tables = $this->load_table_names(); // // this sends data to the drop down lists // $message = 'Import Data Utility'; if ($files == FALSE) { echo anchor('pages', 'Home', 'title="Home"'); echo '<br>'; echo "There are currently no files in the upload directory"; } else { // initial call the the view $this->call_page($tables, $files, $message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function _listTables();", "public function admin_get_tables() {}", "public function admin_get_tables() {}", "function listTables();", "public function getListOfTables() {}", "protected function getDatabaseTables() {}", "abstract public function getTables();", "public function list_tables(){\n\t\treturn $this->fetch_all(\"SHOW TABLES\");\n\t}", "public function getTables();", "public function getTables();", "public function getTables();", "function showTable(&$database)\n{\n $columns = $database->query(\"SHOW TABLES\")->fetchAll();\n\n foreach ($columns as $col) {\n echo '<a href=\"./table.php?name=' . $col[0] . '\" >';\n echo \"$col[0] </a> <br/>\";\n }\n\n\n}", "abstract protected function fetchTableNamesDb();", "public function showTables(){\n $resultQuery = $this->executeQuery(\"SHOW TABLES;\");\n echo \"Liste des tables : <br><br>\";\n while( $row = mysqli_fetch_row($resultQuery) ){\n echo \" - \".$row[0].\"<br>\";\n }\n echo \"<br>\";\n }", "public function getTableList()\n\t{\n\t\t$this->connect();\n\n\t\t$type = 'table';\n\n\t\t$query = $this->getQuery(true)\n\t\t\t->select('name')\n\t\t\t->from('sqlite_master')\n\t\t\t->where('type = :type')\n\t\t\t->bind(':type', $type)\n\t\t\t->order('name');\n\n\t\t$this->setQuery($query);\n\n\t\t$tables = $this->loadColumn();\n\n\t\treturn $tables;\n\t}", "public function listTables() {\r\n\t\tswitch ($this->getDbtype()) {\r\n\t\t\tcase 'mysql':\r\n\t\t\t\t$sql = \"SHOW FULL TABLES WHERE TABLE_TYPE = 'BASE TABLE'\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'pgsql':\r\n\t\t\t\t$sql = \"SELECT CONCAT(table_schema,'.',table_name) AS name FROM information_schema.tables \r\n WHERE table_type = 'BASE TABLE' AND table_schema NOT IN ('pg_catalog','information_schema')\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'sqlite':\r\n\t\t\t\t$sql = 'SELECT name FROM sqlite_master WHERE type = \"table\" AND name != \"sqlite_sequence\"';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'mssql':\r\n\t\t\t\t$sql = \"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE'\";\r\n\t\t\tcase 'oracle':\r\n\t\t\t\t$sql = \"SELECT * FROM dba_tables\";\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new Exception($this->getDbtype() . ' does not support listing table');\r\n\t\t}\r\n\t\t$result = $this->query($sql);\r\n\t\t$result->setFetchMode(PDO::FETCH_NUM);\r\n\t\t$meta = array();\r\n\t\tforeach ($result as $row) {\r\n\t\t\t$meta[] = $row[0];\r\n\t\t}\r\n\t\treturn $meta;\r\n\t}", "public function admin_get_dbs() {}", "function raw_db_list_database_tables()\r\n{\r\n global $g_current_db;\r\n\r\n $tables = array();\r\n $sql = \"SELECT name FROM sqlite_master WHERE (type = 'table')\";\r\n $res = sqlite_query($g_current_db, $sql);\r\n if ($res) {\r\n while (sqlite_has_more($res)) {\r\n $tables[] = sqlite_fetch_single($res);\r\n }\r\n } else return false;\r\n return $tables;\r\n}", "public function list_tables() {\n try {\n $sql = \"SHOW TABLES\";\n $result = $this->conn->query($sql);\n //return $result->fetchAll(PDO::FETCH_NUM);\n\n $tables = array();\n foreach($result as $row) {\n //echo $row[0].\"<br>\";\n array_push($tables, $row[0]);\n }\n return $tables;\n\n } catch (PDOException $e) {\n echo(\"DB ERROR: \".$e->getMessage());\n }\n }", "abstract public function list_tables($db_name_str = false, $filter = false);", "public function showTables($database = null){\n\t\treturn $this->instance->listTables($database);\n\t}", "function tablesList ()\n {\n $sql = \"SELECT a.relname AS name\n FROM pg_class a, pg_user b\n WHERE ( relkind = 'r') and relname !~ '^pg_' AND relname !~ '^sql_'\n AND relname !~ '^xin[vx][0-9]+' AND b.usesysid = a.relowner\n AND NOT (EXISTS (SELECT viewname FROM pg_views WHERE viewname=a.relname));\";\n\n $result = $this->all($sql);\n\n if (!$result)\n {\n trigger_error(ERROR_NO_TABLE_LIST, E_USER_ERROR);\n exit;\n }\n else\n {\n $tables = array();\n foreach ($result as $item) $tables[] = $item['name'];\n return $tables;\n }\n }", "public function list_tables(){\n\t\treturn $this->fetch_all(\"SELECT c.relname AS table FROM pg_class c, pg_user u \"\n .\"WHERE c.relowner = u.usesysid AND c.relkind = 'r' \"\n .\"AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) \"\n .\"AND c.relname !~ '^(pg_|sql_)' UNION \"\n .\"SELECT c.relname AS table_name FROM pg_class c \"\n .\"WHERE c.relkind = 'r' \"\n .\"AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) \"\n .\"AND NOT EXISTS (SELECT 1 FROM pg_user WHERE usesysid = c.relowner) \"\n .\"AND c.relname !~ '^pg_'\");\n\t}", "function get_db_tables(){\n\t\tglobal $GonxAdmin;\n\t\t\n\t\t$result = @$this->list_tables($this->dbName);\n\t\tif (!$result) {\n\t\t print \"Erreur : impossible de lister les tables\\n\";\n\t\t print 'Erreur '.$GonxAdmin[\"dbtype\"].' : ' . $this->error();\n\t\t exit;\n\t\t}\n\t while ($row = $this->fetch_row($result)) {\n\t\t\t$Tables[] = $row[0];\n\t }\n\t\treturn $Tables;\t\t\n\t}", "public function getTables()\n {\n $sqlStm = \"SELECT TABLE_NAME as tableName,\n CASE TABLE_TYPE WHEN 'VIEW' THEN 'true'\n ELSE 'false'\n END as isView\n FROM information_schema.tables\n WHERE TABLE_SCHEMA = ?\";\n \n $query = new DataQuery($sqlStm);\n $param = new DataParameter('schema', DataParameter::TYPE_VARCHAR , $this->schema);\n return $this->query($query, array($param));\n }", "function print_tables($database_connection) {\r\n\r\n $tables = get_tables($database_connection);\r\n\r\n foreach($tables as $table) {\r\n print(\"<h3>{$table}</h3>\");\r\n print_table($database_connection, $table);\r\n print(\"<br><br>\");\r\n }\r\n }", "public static function getTables() {\n }", "public function list(Request $request, Response $response, array $args) {\n\n $db = __DIR__ . '/../../database/'.$args['database'].'.json';\n $table = strtolower($args['database']);\n\n if($this->ckeckDatabase($db) == true) {\n $contents = file_get_contents($db);\n $json = json_decode($contents, true);\n return $response->withJson($json[$table], 200, JSON_PRETTY_PRINT);\n } else {\n return $response->withJson(['message' => 'A base de dados nao existe!'], 200, JSON_PRETTY_PRINT);\n };\n\n }", "public function index(){ \n \t$data['query1'] = $this->MBahagia->tampil_data();\n \t$data['query2'] = $this->MCamplong->tampil_data();\n \t$data['query3'] = $this->MPanglima->tampil_data();\n \t$data['query4'] = $this->MPKPRI->tampil_data();\n \t$data['query5'] = $this->MRahmat->tampil_data();\n\n \t\n \t$this->global['pageTitle'] = 'RichiSoft | Local Database';\n\t\t$this->loadViews(\"ViewTables/TableSlave\", $this->global, $data, NULL);\n\t}", "public function getDBTablesDetails()\n\t{\n\t\t//$functions = $this->system_structure_m->getDBTablesDetails();\n\t\t//echo json_encode($functions);\n\t}", "public function list_tables(){\n if (!$this->select_db($this->_currentDB))\n \t return FALSE;\n \t$tables=array();\n \t$table_exts=array($this->_index_ext,$this->_data_ext,$this->_frame_ext);\n \t$dbpath=$this->_db_root_dir.$this->_currentDB;\n \t$d=dir($dbpath);\n \twhile($tmp=$d->read()){\n $fileInfo = pathinfo($dbpath.'/'.$tmp);\n if(is_file($dbpath.'/'.$tmp) && $fileInfo['extension']=='txt'){\n \t$tmp=str_replace($table_exts,'',$tmp);\n \t\t$tables[]=$tmp;\t\n }\n \t}\n \t$tables=array_unique($tables);\n \treturn $tables;\n }", "public function getTablesBD(){\n $bd=$this->db->database;\n $this->db->select('TABLE_NAME as tabla');\n $this->db->from('INFORMATION_SCHEMA.tables');\n $this->db->where([\"TABLE_SCHEMA\"=>$bd]);\n $this->db->order_by('TABLE_NAME', 'asc');\n $result = $this->db->get()->result_array();\n echo json_encode($result);\n }", "public function &getTables();", "function print_tables($db_name=null){ // print tables of the DB\n\t$inst=$_SESSION['vwmldbm_inst'];\n\tif(!$inst) return;\n\tglobal $conn,$DB,$DTB_PRE,$TB_PRE;\n\tif($db_name==null) $db_name=$DB;\n\t$count=0;\n\t$sql=\"select name,type,creating_order,sql_txt from {$DTB_PRE}vwmldbm_tb where db='$db_name' order by creating_order asc\";\n\t$res=mysqli_query($conn,$sql);\n\techo \"<table border=1 width=100%><tr><td align=center bgcolor=bbffbb>Name</td>\n\t\t\t<td align=center bgcolor=bbffbb>Type</td>\n\t\t\t<td align=center bgcolor=bbffbb>Creating Order</td>\n\t\t\t<td align=center bgcolor=bbffbb>SQL</td></tr>\";\n\tif($res) while($rs=mysqli_fetch_array($res)){\n\t\t$count++;\n\t\techo \"<tr>\";\n\t\techo \"\t<td width=120>[$count] \".$rs['name'].\"</td>\";\n\t\tif($rs['type']=='T') $tb_type='Table';\n\t\tif($rs['type']=='C') $tb_type='Table(Code)';\n\t\telseif($rs['type']=='V') $tb_type='VIEW';\n\t\t\n\t\techo \"\t<td width=100 align=center>$tb_type</td>\";\n\t\techo \"\t<td width=100 align=center>\".$rs['creating_order'].\"</td>\";\n\t\techo \"\t<td width=300><textarea rows=2 cols=34>\".$rs['sql_txt'].\"</textarea></td>\";\n\t\techo \"</tr>\";\n\t}\n\techo \"</table>\";\n}", "function showtable()\r\n {\r\n $c=$this->connector();\r\n $r='';\r\n $r.=$this->logout();\r\n $r.=\"<div id='isi'>\r\n <center><a href='?act=mysql'>Show Database</a></center><br />\r\n <table width=50% align='center' class='xpltab' cellspacing=0 ><tr><th style='border-left:thin solid #f00;'>Table</th><th>Column count</th><th>Dump</th><th>Drop</th></tr>\";\r\n $db=$_GET['db'];\r\n $query=$this->qe(\"SHOW TABLES FROM $db\");\r\n while($data=mysql_fetch_array($query))\r\n {\r\n\r\n $iml=$this->qe(\"SHOW COLUMNS FROM $db.$data[0]\");\r\n $h=(mysql_num_rows($iml))?mysql_num_rows($iml):0;\r\n $r.= \"<tr><td><a href='?act=showcon&db=$db&table=$data[0]'>$data[0]</td><td>$h</td><td><a href='?act=downdb&db=$db&table=$data[0]'>Dump</a></td><td><a href='?act=dropdb&db=$db&tbl=$data[0]'>Drop</a></td></tr>\";\r\n \r\n }\r\n \r\n $r.= \"</table>\".$this->sqlcommand().\"</div>\";\r\n return $r;\r\n $this->free($query);\r\n $this->free($iml);\r\n mysql_close($c);\r\n }", "public function getDbTables($filter = array()){\r\n\t\t$args = Utility_Functions::argsToArray($filter);\r\n\t\t$args = Utility_Functions::cleanArgsValue($args);\r\n\t\r\n\t\t$model = new Table_ActionLog();\r\n\t\r\n\t\t$where = array( \"table_name\" => array( \" like \" => \"{$args['text']}%\" ) );\r\n\t\r\n\t\t$foundData = $model->selectActions($where, $sortField = null, $limit = 15, array(\"sys_action_log.table_name as name\"),\"table_name\");\r\n\t\r\n\t\t$json = $foundData->toArray();\r\n\t\r\n\t\techo $this->_toJson($json);\r\n\t}", "public function index()\n {\n $tables = table::orderby('id','desc')->get();\n return view('admin.table.index',compact('tables',));\n }", "public function showTables()\n {\n switch($this->db_type){\n case 'mssql';\n case 'sqlsrv':\n $sql = 'SELECT * FROM sys.all_objects WHERE type = \\'U\\'';\n break;\n case 'pgsql':\n $sql = 'SELECT tablename FROM pg_tables WHERE tableowner = current_user';\n break;\n case 'sqlite':\n $sql = 'SELECT * FROM sqlite_master WHERE type=\\'table\\'';\n break;\n case 'oci':\n $sql = 'SELECT * FROM system.tab';\n break;\n case 'ibm':\n $schema = '';\n $sql = 'SELECT TABLE_NAME FROM qsys2.systables'.\n (($schema != '') ? ' WHERE TABLE_SCHEMA = \\''.$schema.'\\'' : '');\n break;\n case 'mysql':\n default:\n $sql = 'SHOW TABLES IN `'.$this->db_name.'`';\n break;\n }\n\n try{\n $sth = $this->query($sql);\n $result = $sth->fetchAll();\n }catch(PDOException $e){\n $this->error( $e->getMessage());\n $result = false;\n }\n return $result;\n }", "function get_table_list() {\n $sql_public_table_list = \"SELECT table_name FROM information_schema.tables WHERE (table_schema = 'public') ORDER BY table_name\";\n $sql_chado_table_list = \"SELECT table_name FROM information_schema.tables WHERE (table_schema = 'chado') ORDER BY table_name\";\n $public_table_results = db_query($sql_public_table_list)->fetchAll();\n $chado_table_results = db_query($sql_chado_table_list)->fetchAll();\n\n $public_tables = [];\n $chado_tables = [];\n foreach ($public_table_results as $value) {\n $public_tables[] = $value->table_name;\n }\n foreach ($chado_table_results as $value) {\n $chado_tables[] = 'chado.' . $value->table_name;\n }\n return array_merge($public_tables, $chado_tables);\n}", "public function index()\n {\n // get all the database\n\n\n // $tables = Table::all();\n // return view('app.index', ['tables' => $tables]);\n \n\n\n\n $tables = Table::paginate(3);\n return view('app.index',compact('tables'));\n }", "function load_tables()\n\t{\n\t\treturn $this->_load_tables('/mydoliboard/sql/');\n\t}", "public function getTableList()\n\t{\n\t\t$db = new mysql_db();\n\n\t\t$result = $db->query(\"show tables\");\n\t\t\n\t\t$db->fetch_array($result);\n\t\t\n\t\treturn $arr;\n\t}", "public function indexTable()\n {\n $this->paginate = array('all', 'order' => array('modified' => 'desc'));\n $contentVariableTables = $this->paginate('ContentVariableTable');\n $this->set(compact('contentVariableTables', $contentVariableTables));\n }", "public function index()\n {\n return view('services.databases', ['databases' => databases::all()]);\n\n }", "public function index()\n {\n $tables = Table::all();\n \n return view('tables.index',['tables'=> $tables]);\n }", "public function allDatabaseEntrysForTablePagesAction() {\r\n\t\ttry {\r\n\t\t\t$searchPhrase = (string) $this->getModuleData('tx_extracache_manager_searchPhraseForTablePages');\r\n\t\t\t$sqlWhere = $this->createSqlWhereClauseForDbRecords($searchPhrase, array('tstamp','crdate','starttime','endtime')) . Tx_Extracache_System_Persistence_Typo3DbBackend::getSqlWherePartForPagesWithCacheCleanerStrategy();\r\n\t\t\t$this->getView()->assign ( 'allDatabaseEntrysForTablePages', $this->getCacheDatabaseEntryRepositoryForTablePages()->query ( '(tx_extracache_cleanerstrategies!=\\'\\' OR tx_extracache_events!=\\'\\') AND '.$sqlWhere ) );\r\n\t\t\treturn $this->getView()->render ( 'allDatabaseEntrysForTablePages' );\r\n\t\t} catch (Exception $e) {\r\n\t\t\treturn $this->showErrorMessage($e);\r\n\t\t}\r\n\t}", "public function listtabelAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('%');\n }", "public function listTables($database = null){\n\t\treturn $this->instance->listTables($database);\n\t}", "public static function all() {\n\t\t$classe = get_called_class();\n\t\t$table = str_replace(\"db_\", \"\", $classe);\n\t\t$liste = db::findAll(db::table($table));\n\t\treturn $liste;\n\t}", "function load_tables() {\n return $this->_load_tables('/oblyon/sql/');\n }", "public function getTables()\n {\n\treturn $this->query('select [name] from [tables]');\n }", "public function index()\n {\n \t$tables = DB::select('SHOW TABLES');\n $tabelPilihan = '';\n $hasilSementara = '';\n return view('datasource.index', compact('tables', 'hasilSementara', 'tabelPilihan'));\n }", "public function getTableNames();", "private function generateTables()\n\t\t{\n\t\t\tif ($this->connectFail == False)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t*\tdatabase schema access\n\t\t\t\t*/\n\n\t\t\t\t$content = file_get_contents('dbase.sql');\n\t\t\t\t$queries = explode(\";\\n\\n\", $content);\n\n\t\t\t\tforeach ($queries as $key => $query)\n\t\t\t\t{\n\t\t\t\t\t$er = False;\n\t\t\t\t\t$df = $this->execQuery($query);\n\n\t\t\t\t\t#print $df.\"\\n\".$er.PHP_EOL;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function get_tables()\n\t{\n\t\treturn $this->driver_query('table_list');\n\t}", "public function getTables()\n\t{\n $result = $this->fetchingData(array(\n 'query' => \"SHOW FULL TABLES\"\n ));\n\n return $result;\n\t}", "function get_tables_from_db( ){\n\t\t\t$db_connect = mysql_connect($this->host,$this->username, $this->password);\n\t\t\t$tables = mysql_list_tables($this->db); \n\t\t\twhile($row = mysql_fetch_assoc($tables)){\n\t\t\t\tforeach($row as $k=>$v){\n\t\t \t\t\t$a_tables[]=$v;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $a_tables;\n\t\t}", "public function ListTable()\n {\n echo $this->ListTableText();\n }", "public function getTableList() {\n\t\t$db = new mysql_db();\n\n\t\t$result = $db -> query(\"show tables\");\n\n\t\t$db -> fetch_array($result);\n\t\t$db -> close_connection();\n\t\treturn $arr;\n\t}", "public function showDatabases(){\n\t\treturn $this->instance->listDatabases();\n\t}", "function getTableNames() {\n\n //Gets tablenames from the database\n Global $serverInfo;\n $conn = connect();\n $sql = \"SHOW TABLES FROM \" . $serverInfo[3];\n $result = $conn->query($sql);\n\n //Outputs data if information was found\n $tableArray = [];\n if ($result->num_rows > 0) {\n\n //Writes found data into an array\n $i = 0;\n while ($row = $result->fetch_assoc() ) {\n $tableArray[$i] = $row[\"Tables_in_\" . $serverInfo[3] ];\n $i++;\n }\n return $tableArray;\n }\n}", "function nav_sqltabele() {\n\n\tglobal $db;\n\n\techo \"Lista svih tabela: \";\n\t\n $komanda = 'SHOW tables';\n\t$result = mysql_query($komanda, $db);\n\t$br_redova = mysql_num_rows($result);\n\t\n\tfor ($i = 0; $i < $br_redova; $i++) {\n\n\t\t\techo \"<a href='?tab=\" . mysql_tablename($result, $i) . \"'>\" . mysql_tablename($result, $i) . \"</a>\";\n\t\t\techo \" | \";\t\t\t\n\n\t}\n\n\t\n\n}", "function _showTables() {\n print \"<pre>\";\n print_r($this->_tables);\n print \"</pre>\";\n }", "function pdo_list_tables($dbname, $link=NULL) {\r\n $dbname = str_replace(\"`\", \"``\", $dbname);\r\n return pdo_query(\"SHOW TABLES FROM `$dbname`\", pdo_handle($link));\r\n }", "function get_chado_table_list() {\n $sql_table_list = \"SELECT table_name FROM information_schema.tables WHERE table_schema = 'chado' ORDER BY table_name;\";\n $result_table = db_query($sql_table_list);\n $input_table = $result_table->fetchAll();\n $table_list = [];\n foreach ($input_table as $value) {\n $table_list[] = $value->table_name;\n }\n return $table_list;\n}", "protected function getAllTables()\n {\n return $this->getConnection()->select(\n $this->grammar->compileGetAllTables()\n );\n }", "function diy_get_all_tables($connection = null) {\n\t\treturn collect(DB::connection($connection)->select('show tables'))->map(function ($val) {\n\t\t\tforeach ($val as $tbl) return $tbl;\n\t\t});\n\t}", "public function table_get_all($table);", "function get_tables()\n{\n $tableList = array();\n $res = mysqli_query($this->conn,\"SHOW TABLES\");\n while($cRow = mysqli_fetch_array($res))\n {\n $tableList[] = $cRow[0];\n }\n return $tableList;\n}", "function table_list()\n{\n\t//TODO - a similar function is in db_verify.php. Should probably all be moved to mysql_class.php.\n\n\t$exclude = array();\n\t$exclude[] = \"core\";\n\t$exclude[] = \"rbinary\";\n\t$exclude[] = \"parser\";\n\t$exclude[] = \"tmp\";\n\t$exclude[] = \"online\";\n\t$exclude[] = \"upload\";\n\t$exclude[] = \"user_extended_country\";\n\t$exclude[] = \"plugin\";\n\n\t$coreTables = e107::getDb()->db_TableList('nolan');\n\n\t$tables = array_diff($coreTables,$exclude);\n\n\tforeach($tables as $e107tab)\n\t{\n\t\t$count = e107::getDb()->gen(\"SELECT * FROM #\".$e107tab);\n\n\t\tif($count)\n\t\t{\n\t\t\t$tabs[$e107tab] = $count;\n\t\t}\n\t}\n\n\treturn $tabs;\n}", "public function getAll()\n {\n return $this->tables;\n }", "public function show_tables()\n\t{\n\t\t$results = $this->get_rows('SHOW TABLES');\n\t\tforeach ($results as $row)\n\t\t{\n\t\t\t$array[] = $row[0];\n\t\t}\n\n\t\treturn $array;\n\t}", "public function index()\n {\n return view('home', [\n 'tables' => Table::where('user_id', Auth::user()->id)->get()\n ]);\n }", "abstract public function list_tables($like = NULL);", "final public function tables()\n {\n return $this->doTables();\n }", "public function getTableList()\n\t{\n\t\t$result = [];\n\t\tforeach ($this->manager->getDataSources($this->languageId) as $tableName => $tableInfo)\n\t\t{\n\t\t\t$result[] = [\n\t\t\t\t$tableName,\n\t\t\t\t$tableInfo['TABLE_DESCRIPTION'],\n\t\t\t];\n\t\t}\n\t\treturn $result;\n\t}", "private function getTableNames(){\n $exceptions = array_merge(\n self::EXCEPTION_TABLES,\n explode(\",\",str_replace(' ','',$this->params['exceptions']))\n );\n $exceptions = array_filter($exceptions);\n $this->tables = DB::table('information_schema.tables')->select([\n 'table_name'\n ])->where('table_schema','public')->whereNotIn('table_name',$exceptions)->get();\n }", "function viewAllTable($db, $cols = null)\n{\n try {\n $sql = \"SELECT * FROM corps\";\n $sql = $db->prepare($sql);\n $sql->execute();\n $corps = $sql->fetchAll(PDO::FETCH_ASSOC);\n if ($sql->rowCount() > 0)\n {\n $table = \"<table>\" . PHP_EOL;\n if ($cols)\n {\n $table .= \"<tr>\";\n foreach ($cols as $col)\n {\n $table .= \"<th>$col</th>\";\n }// End of Foreach\n $table .= \"</tr>\" . PHP_EOL;\n } // End of If ($col)\n foreach ($corps as $corp) {\n $table .= \"<tr><td>\" . $corp['id'] . \"</td>\";\n $table .= \"<td>\" . $corp['corp'] . \"</td>\";\n $table .= \"<td>\" . date('m/d/Y', strtotime($corp['incorp_dt'])) . \"</td>\";\n $table .= \"<td>\" . $corp['email'] . \"</td>\";\n $table .= \"<td>\" . $corp['zipcode'] . \"</td>\";\n $table .= \"<td>\" . $corp['owner'] . \"</td>\";\n $table .= \"<td>\" . $corp['phone'] . \"</td>\";\n $table .= \"</tr>\" . PHP_EOL;\n }// End of Foreach\n $table .= \"</table>\" . PHP_EOL;\n } // End of If ($sql->count)\n else\n {\n $table = \"There is no Data\" . PHP_EOL;\n }\n return $table;\n\n } // End of Try Statement\n catch (PDOException $e)\n {\n die(\"There was a problem viewing the table \");\n } // End of Catch Statement\n}", "public function actionGetTableNames($db) {\n if (Yii::app()->getRequest()->getIsAjaxRequest()) {\n $all = array();\n if (!empty($db) && Yii::app()->hasComponent($db) !== false && (Yii::app()->getComponent($db) instanceof CDbConnection))\n $all = array_keys(Yii::app()->{$db}->schema->getTables());\n\n echo json_encode($all);\n } else\n throw new CHttpException(404, 'The requested page does not exist.');\n }", "public function showTable() {\n\t\t$tableName = $this->request->getVariable('id');\n\t\t$this->smarty->assign('dbTableObject',new $tableName());\n\t\t$this->pageDisplay('tools');\n\t}", "public function lista(){\n\t\t\tglobal $app;\n\t\t\t$sth = $this->PDO->prepare(\"SELECT * FROM sedecchamados\");\n\t\t\t$sth->execute();\n\t\t\t$result = $sth->fetchAll(\\PDO::FETCH_ASSOC);\n\t\t\t$app->render('default.php',[\"data\"=>$result],200); \n\t\t}", "public function getAllTables()\n {\n return $this->connection->select(\n $this->grammar->compileGetAllTables(\n $this->parseSearchPath(\n $this->connection->getConfig('search_path') ?: $this->connection->getConfig('schema')\n )\n )\n );\n }", "function tables()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['tables'] == 1 ) ? 'Database Table' : 'Database Tables';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'dropped' : 'created';\n\t\t$old_data = array();\n\t\t$new_fields = array();\n\t\t\n\t\tforeach ( $this->xml_array['tables_group']['table'] as $k => $v )\n\t\t{\n\t\t\t$this->ipsclass->DB->sql_drop_table( $v['name']['VALUE'].\"_bak\" );\n\t\t\t\n\t\t\tif ( !$this->ipsclass->input['un'] && in_array( SQL_PREFIX.$v['name']['VALUE'], $this->ipsclass->DB->get_table_names() ) )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->query( \"RENAME TABLE \".SQL_PREFIX.$v['name']['VALUE'].\" TO \".SQL_PREFIX.$v['name']['VALUE'].\"_bak;\" );\n\t\t\t\t$this->ipsclass->DB->cached_tables[] = SQL_PREFIX.$v['name']['VALUE'].\"_bak\";\n\t\t\t}\n\t\t\t\n\t\t\t$this->ipsclass->DB->sql_drop_table( $v['name']['VALUE'] );\n\t\t\t\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->query( $this->fix_create_table( \"CREATE TABLE IF NOT EXISTS \".SQL_PREFIX.$v['name']['VALUE'].\" (\".$v['data']['VALUE'].\") TYPE=\".$v['type']['VALUE'] ) );\n\t\t\t\t\n\t\t\t\tif ( in_array( SQL_PREFIX.$v['name']['VALUE'].\"_bak\", $this->ipsclass->DB->get_table_names() ) )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->DB->build_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => $v['name']['VALUE'].\"_bak\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\t );\n\t\t\t\t\t$this->ipsclass->DB->exec_query();\n\t\t\t\t\t\n\t\t\t\t\tif ( $this->ipsclass->DB->get_num_rows() )\n\t\t\t\t\t{\n\t\t\t\t\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$old_data[ $v['name']['VALUE'] ][] = $r;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->ipsclass->DB->query( \"SHOW COLUMNS FROM \".SQL_PREFIX.$v['name']['VALUE'].\";\" );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $this->ipsclass->DB->get_num_rows() )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twhile ( $row = $this->ipsclass->DB->fetch_row() )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$new_fields[ $v['name']['VALUE'] ][] = $row['Field'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach ( $old_data[ $v['name']['VALUE'] ] as $kk => $vv )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$insert = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ( $vv as $field => $value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ( in_array( $field, $new_fields[ $v['name']['VALUE'] ] ) )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$insert[ $field ] = $this->ipsclass->txt_safeslashes( $value );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( count( $insert ) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->ipsclass->DB->do_insert( $v['name']['VALUE'], $insert );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->ipsclass->DB->sql_drop_table( $v['name']['VALUE'].\"_bak\" );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['tables']} {$object} {$operation}....\" );\n\t}", "public function getAllTables()\n {\n return $this->fetchColumn(\"SHOW TABLES\");\n }", "function listTables($args) {\n\n $conn = mysql_pconnect($args['server'], $args['username'], $args['password']);\n if($conn === false) {\n throw 'Connection failed.';\n }\n\n $results = mysql_list_tables($args['database'], $conn);\n $tables = array();\n while( $row = mysql_fetch_assoc($results) ) {\n $tables[] = $row;\n }\n\n return array( 'tables' => $tables );\n }", "public function listtabelSDMAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('SDM');\n }", "public function allDatabaseEntrysForTableEventqueueAction() {\r\n\t\ttry {\r\n\t\t\t$this->getView()->assign ( 'allDatabaseEntrysForTableEventqueue', $this->getCacheDatabaseEntryRepositoryForTableEventqueue()->getAll () );\r\n\t\t\treturn $this->getView()->render ( 'allDatabaseEntrysForTableEventqueue' );\r\n\t\t} catch (Exception $e) {\r\n\t\t\treturn $this->showErrorMessage($e);\r\n\t\t}\r\n\t}", "abstract public function tableListQuery($dbname, $prefix);", "function listSources() {\n\t\t$db = $this->config['database'];\n\t\t$this->config['database'] = basename($this->config['database']);\n\n\t\t$cache = parent::listSources();\n\t\tif ($cache != null) {\n\t\t\treturn $cache;\n\t\t}\n\n\t\t$result = $this->fetchAll(\"SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;\");\n\n\t\tif (!$result || empty($result)) {\n\t\t\treturn array();\n\t\t} else {\n\t\t\t$tables = array();\n\t\t\tforeach ($result as $table) {\n\t\t\t\t$tables[] = $table[0]['name'];\n\t\t\t}\n\t\t\tparent::listSources($tables);\n\n\t\t\t$this->config['database'] = $db;\n\t\t\treturn $tables;\n\t\t}\n\t\t$this->config['database'] = $db;\n\t\treturn array();\n\t}", "function createDBTables() {\n $installer = new TrelloInstaller();\n return $installer->install();\n }", "public function getTables(){\n $pdo = $this->pdo;\n $statement = $pdo->prepare(\"SHOW TABLES FROM $this->name;\");\n $statement->execute();\n $tables = $statement->fetchAll($pdo::FETCH_NUM);\n foreach($tables as &$table)\n $table = $table[0];\n return $tables;\n }", "function getTableList(){\n\t\t// Process the query string and exclude querystring named \"p\"\n\t\tif (!empty($_SERVER['QUERY_STRING'])) {\n\t\t\t$qrystr = explode(\"&\",$_SERVER['QUERY_STRING']);\n\t\t\tforeach ($qrystr as $value) {\n\t\t\t\t$qstr = explode(\"=\",$value);\n\t\t\t\tif ($qstr[0]!=\"p\") {\n\t\t\t\t\t$arrQryStr[] = implode(\"=\",$qstr);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$aQryStr = $arrQryStr;\n\t\t\t$aQryStr[] = \"p=@@\";\n\t\t\t$queryStr = implode(\"&\",$aQryStr);\n\t\t}\n\n\t\t//bby: search module\n\t\t$qry = array();\n\t\tif (isset($_REQUEST['search_field'])) {\n\n\t\t\t// lets check if the search field has a value\n\t\t\tif (strlen($_REQUEST['search_field'])>0) {\n\t\t\t\t// lets assign the request value in a variable\n\t\t\t\t$search_field = $_REQUEST['search_field'];\n\n\t\t\t\t// create a custom criteria in an array\n\t\t\t\t$qry[] = \"mnu_name like '%$search_field%'\";\n\n\t\t\t}\n\t\t}\n\n\t\t// put all query array into one criteria string\n\t\t$criteria = (count($qry)>0)?\" where \".implode(\" and \",$qry):\"\";\n\n\t\t// Sort field mapping\n\t\t$arrSortBy = array(\n\t\t \"viewdata\"=>\"viewdata\"\n\t\t,\"mnu_name\"=>\"mnu_name\"\n\t\t,\"mnu_link\"=>\"mnu_link\"\n\t\t,\"mnu_ord\"=>\"mnu_ord\"\n\t\t);\n\n\t\tif(isset($_GET['sortby'])){\n\t\t\t$strOrderBy = \" order by \".$arrSortBy[$_GET['sortby']].\" \".$_GET['sortof'];\n\t\t}\n\n\t\t// Add Option for Image Links or Inline Form eg: Checkbox, Textbox, etc...\n\t\t$viewLink = \"\";\n\t\t$editLink = \"<a href=\\\"?statpos=tax&edit=',am.mnu_id,'\\\"><img src=\\\"\".SYSCONFIG_DEFAULT_IMAGES_INCTEMP.\"icons/edited/edit.png\\\" title=\\\"Edit\\\" hspace=\\\"2px\\\" border=0 width=\\\"16\\\" height=\\\"16\\\"></a>\";\n\t\t$delLink = \"<a href=\\\"?statpos=tax&delete=',am.mnu_id,'\\\" onclick=\\\"return confirm(\\'Are you sure, you want to delete?\\');\\\"><img src=\\\"\".SYSCONFIG_DEFAULT_IMAGES_INCTEMP.\"icons/edited/delete.png\\\" title=\\\"Delete\\\" hspace=\\\"2px\\\" border=0 width=\\\"16\\\" height=\\\"16\\\"></a>\";\n\n\t\t// SqlAll Query\n\t\t$sql = \"select am.*, CONCAT('$viewLink','$editLink','$delLink') as viewdata\n\t\t\t\t\t\tfrom app_modules am\n\t\t\t\t\t\t$criteria\n\t\t\t\t\t\t$strOrderBy\";\n\n\t\t// Field and Table Header Mapping\n\t\t$arrFields = array(\n\t\t \"viewdata\"=>\"Action\"\n\t\t,\"mnu_name\"=>\"Module Name\"\n\t\t,\"mnu_link\"=>\"Link\"\n\t\t,\"mnu_ord\"=>\"Order\"\n\t\t);\n\n\t\t// Column (table data) User Defined Attributes\n\t\t$arrAttribs = array(\n\t\t\"mnu_ord\"=>\" align='center'\",\n\t\t\"viewdata\"=>\"width='50' align='center'\"\n\t\t);\n\n\t\t// Process the Table List\n\t\t$tblDisplayList = new clsTableList($this->conn);\n\t\t$tblDisplayList->arrFields = $arrFields;\n\t\t$tblDisplayList->paginator->linkPage = \"?$queryStr\";\n\t\t$tblDisplayList->sqlAll = $sql;\n\t\t$tblDisplayList->sqlCount = $sqlcount;\n\n\t\treturn $tblDisplayList->getTableList($arrAttribs);\n\t}", "public function show_tables($database=false, $show_columns=true){\n\t\n\t\t$this->set_db($database);\n\t\t\n\t\t$query = \"SHOW TABLES FROM \".$this->database.\"\";\n\t\n\t\t$result = $this->sql_query($query, 'LISTING TABLES');\n\t\n\t\t$data = $this->fetch_data($result, 'row');\n\t\t\t\n\t\tif($show_columns){\n\t\t\t\n\t\t\t$list = $this->show_columns(false, $data);\n\n\t\t}\n\t\n\t\treturn $list;\n\t\n\t}", "public function listTables()\n {\n $schema = $this->fetchDatabase();\n\n $rows = $this->fetchAll(\"SELECT table_name, table_rows \n FROM information_schema.tables \n WHERE table_schema = '{$schema}' \n ORDER BY table_name\n \");\n\n $tables = [];\n foreach ($rows as $row) {\n $tables[$row['table_name']] = $row['table_rows'];\n }\n\n return $tables;\n }", "public function getAll($tables){\n return $this->db->get($tables)->result();\n }", "public function getAll($tables){\n return $this->db->get($tables)->result();\n }", "public function getAll($tables){\n return $this->db->get($tables)->result();\n }", "function listSources() {\n\t\t$cache = parent::listSources();\n\t\tif ($cache != null) {\n\t\t\treturn $cache;\n\t\t}\n\t\t$result = $this->_execute('SHOW TABLES FROM ' . $this->name($this->config['database']) . ';');\n\n\t\tif (!$result) {\n\t\t\treturn array();\n\t\t} else {\n\t\t\t$tables = array();\n\n\t\t\twhile ($line = mysql_fetch_row($result)) {\n\t\t\t\t$tables[] = $line[0];\n\t\t\t}\n\t\t\tparent::listSources($tables);\n\t\t\treturn $tables;\n\t\t}\n\t}", "public function getTableList()\n\t{\n\t\treturn [];\n\t}", "protected function export_tables() {\n\t\t\tif ( is_array( $this->table_list ) ) {\n\t\t\t\t// Multiple table export.\n\t\t\t\t$this->header( 'export' );\n\t\t\t\t$this->db_begin();\n\n\t\t\t\tforeach ( $this->table_list as $table_name ) {\n\t\t\t\t\t// Check if table exists to prevent SQL injection.\n\t\t\t\t\t$wpda_dictionary_exists = new WPDA_Dictionary_Exist( $this->schema_name, $table_name );\n\t\t\t\t\tif ( ! $wpda_dictionary_exists->table_exists() ) {\n\t\t\t\t\t\twp_die();\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->create_table( $table_name );\n\t\t\t\t\t$this->insert_rows( $table_name );\n\t\t\t\t}\n\n\t\t\t\t$this->db_end();\n\t\t\t} else {\n\t\t\t\t// Single table export.\n\t\t\t\t$table_name = $this->table_list;\n\n\t\t\t\t// Check if table exists to prevent SQL injection.\n\t\t\t\t$wpda_dictionary_exists = new WPDA_Dictionary_Exist( $this->schema_name, $table_name );\n\t\t\t\tif ( ! $wpda_dictionary_exists->table_exists() ) {\n\t\t\t\t\twp_die();\n\t\t\t\t}\n\n\t\t\t\t$this->header( $table_name );\n\t\t\t\t$this->db_begin();\n\n\t\t\t\t$this->create_table( $table_name );\n\t\t\t\t$this->insert_rows( $table_name );\n\n\t\t\t\t$this->db_end();\n\t\t\t}\n\t\t}", "public function dbAction (array $getVars)\n {\n //definition\n $this->view = \"index\";\n $this->modelName = 'TemplateDbModel';\n $this->params = $getVars;\n \n //invoking\n $this->invokeModel();\n $this->invokeView();\n \n //returning\n return $this->render; \n\n }" ]
[ "0.7404853", "0.7286365", "0.72856826", "0.7145066", "0.71086264", "0.70602745", "0.6997653", "0.69940615", "0.6967469", "0.6967469", "0.6967469", "0.6914595", "0.6842169", "0.68078417", "0.67902386", "0.67753017", "0.67710227", "0.6761959", "0.67216396", "0.6718599", "0.670689", "0.6687697", "0.6668052", "0.6659068", "0.665506", "0.66514134", "0.66358095", "0.66295016", "0.66186154", "0.6604868", "0.6603397", "0.65961945", "0.65756303", "0.65742826", "0.6563909", "0.6550847", "0.65475166", "0.6547421", "0.65375656", "0.6536982", "0.6514115", "0.6506878", "0.65036166", "0.64711136", "0.6457542", "0.645505", "0.64518756", "0.644483", "0.64422876", "0.6436851", "0.64145577", "0.6414419", "0.6407964", "0.6383988", "0.63811433", "0.6379784", "0.6377477", "0.63701326", "0.6360355", "0.6346735", "0.63420975", "0.6332903", "0.63091594", "0.6298184", "0.62752116", "0.627415", "0.62711245", "0.62539786", "0.6242002", "0.6239131", "0.6231088", "0.62282866", "0.6226314", "0.62261444", "0.6225936", "0.62236875", "0.6219908", "0.62190604", "0.6216784", "0.62084174", "0.6203333", "0.62031674", "0.6194821", "0.6189182", "0.6180928", "0.6180828", "0.6178358", "0.6169098", "0.6168481", "0.616779", "0.6140877", "0.61377263", "0.6136645", "0.6132515", "0.6127351", "0.6127351", "0.6127351", "0.6127285", "0.61104023", "0.6108689", "0.61022246" ]
0.0
-1