Beispiel #1
1
    function forgot()
    {
        // Create an instance of the client model
        $this->load->model('client');
        // Grab the email from form post
        $email = $this->input->post('email');
        if ($email && $this->client->email_exists($email)) {
            // send the reset email and then redirect to password_sent page
            $slug = md5($this->client->id . $this->client->email . date('Ymd') . 'yeoman');
            $this->load->library('email');
            ini_set('SMTP', 'smtp.menara.ma.');
            $this->email->from('*****@*****.**', 'Reputation App');
            $this->email->to($email);
            $this->email->subject('Please reset your password');
            $this->email->message('To reset your password please click the link below and follow the instructions:
' . '<a href="' . site_url('Login/reset/' . $this->client->id . '/' . $slug) . '">link</a>' . '

If you did not request to reset your password then please just ignore this email and no changes will occur.

Note: This reset code will expire after ' . date('j M Y') . '.');
            $b = $this->email->send();
            echo 'sent: ' . $b . ', link: ' . '<a href="' . site_url('Login/reset/' . $this->client->id . '/' . $slug) . '">link</a>';
            //redirect('Login/password_sent');
        } else {
            $this->show_forgot(true);
        }
    }
Beispiel #2
1
    /**
     *	this one is the magic one... (pentru asta am facut aceasta clasa...)
     *	scoatem urmatorul banner pentru un grup si incrementam view-ul...
     */
    function getNextBanner($group)
    {
        $CI =& get_instance();
        $output = "";
        $CI->db->where("banner_group", $group);
        $CI->db->where("order", "1");
        $query = $CI->db->get('banners');
        if ($query->num_rows() > 0) {
            $prev_banner = $query->row_array();
            $prev_id = $prev_banner["id"];
        } else {
            $prev_id = 0;
        }
        $CI->db->where("banner_group", $group);
        $CI->db->select_max('id', 'last_id');
        $query = $CI->db->get('banners');
        $last_banner = $query->row_array();
        $last_id = $last_banner["last_id"];
        $banner_id_where = "AND `b`.`id` > (SELECT `id` FROM `banners` WHERE `order` = '1')";
        if ($prev_id == 0 || $prev_id == $last_id) {
            $banner_id_where = "";
        }
        $query = $CI->db->query("SELECT \r\n\t\t\t\t\t\t\t\t\t`b`.*,\r\n\t\t\t\t\t\t\t\t\t`bl`.`name`,\r\n\t\t\t\t\t\t\t\t\t`bl`.`description`\r\n\t\t\t\t\t\t\t\tFROM \r\n\t\t\t\t\t\t\t\t\t`banners` as `b`\r\n\t\t\t\t\t\t\t\t\tLEFT JOIN `banners_lang` as `bl`\r\n\t\t\t\t\t\t\t\t\t\tON (`bl`.`banner_id` = `b`.`id`)\r\n\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\t`b`.`banner_group` = '{$group}'\r\n\t\t\t\t\t\t\t\t\tAND `bl`.`lang_id` = '" . $CI->lang_id . "'\r\n\t\t\t\t\t\t\t\t\t{$banner_id_where}\r\n\t\t\t\t\t\t\t\tLIMIT 1\r\n\t\t\t\t\t\t\t\t");
        if ($query->num_rows() > 0) {
            $banner = $query->row_array();
            // setam toate la 0 si asta curent la 1
            $CI->db->query("UPDATE `banners` SET `order` = '0' WHERE `banner_group` = '{$group}' ");
            $CI->db->query("UPDATE `banners` SET `order` = '1', `views` = `views`+1 WHERE `id` = '" . $banner["id"] . "' ");
            $output .= '<a href="' . site_url("banners/navigate/" . $banner["id"]) . '" target="_blank" title="' . $banner["name"] . ' - ' . $banner["description"] . '">
				<img src="' . base_url() . 'uploads/banners/' . $banner["file_name"] . '" alt="' . $banner["name"] . ' - ' . $banner["description"] . '"/></a>';
        }
        return $output;
    }
Beispiel #3
1
 public function load($parent)
 {
     $this->parent = $parent;
     //delete_option('redux-framework-tracking');
     $this->options = get_option('redux-framework-tracking');
     $this->options['dev_mode'] = $parent->args['dev_mode'];
     if (!isset($this->options['hash']) || !$this->options['hash'] || empty($this->options['hash'])) {
         $this->options['hash'] = md5(site_url() . '-' . $_SERVER['REMOTE_ADDR']);
         update_option('redux-framework-tracking', $this->options);
     }
     if (isset($_GET['redux_framework_disable_tracking']) && !empty($_GET['redux_framework_disable_tracking'])) {
         $this->options['allow_tracking'] = false;
         update_option('redux-framework-tracking', $this->options);
     }
     if (isset($_GET['redux_framework_enable_tracking']) && !empty($_GET['redux_framework_enable_tracking'])) {
         $this->options['allow_tracking'] = true;
         update_option('redux-framework-tracking', $this->options);
     }
     if (isset($_GET['page']) && $_GET['page'] == $this->parent->args['page_slug']) {
         if (!isset($this->options['allow_tracking'])) {
             add_action('admin_enqueue_scripts', array($this, '_enqueue_tracking'));
         } else {
             if (!isset($this->options['tour']) && ($this->parent->args['dev_mode'] == "true" || $this->parent->args['page_slug'] == "redux_demo")) {
                 add_action('admin_enqueue_scripts', array($this, '_enqueue_newsletter'));
             }
         }
     }
     if (isset($this->options['allow_tracking']) && $this->options['allow_tracking'] == true) {
         // The tracking checks daily, but only sends new data every 7 days.
         if (!wp_next_scheduled('redux_tracking')) {
             wp_schedule_event(time(), 'daily', 'redux_tracking');
         }
         add_action('redux_tracking', array($this, 'tracking'));
     }
 }
Beispiel #4
0
/**
 * Shortcode hook to display output HTML from CubePM
 * 
 * @todo Add support for blogs without permalink enabled
 * 
 * @param array $atts An associative array of attributes
 * @return string HTML output of CubePM
 */
function cpm_shortcode($atts)
{
    $html = '<div class="cubepm">';
    if (is_user_logged_in()) {
        $html .= cpm_header();
        $cpm_action = $_GET['cpm_action'];
        switch ($cpm_action) {
            default:
            case 'inbox':
                $html .= cpm_page_inbox();
                break;
            case 'new':
                $html .= cpm_page_new();
                break;
            case 'read':
                $html .= cpm_page_read();
                break;
            case 'admin-inbox':
                if (current_user_can('administrator')) {
                    $html .= cpm_page_admin_inbox();
                } else {
                    $html .= cpm_page_inbox();
                }
        }
    } else {
        $html .= '<p>' . __('You have to be logged in to use Private Messaging.', 'cubepm') . '<br /><a href="' . wp_login_url(site_url($_SERVER["REQUEST_URI"])) . '">' . __('Click here to login', 'cubepm') . ' &raquo;</a></p>';
    }
    $html .= '</div>';
    return $html;
}
Beispiel #5
0
 public function view($id)
 {
     $get_thread = $this->model_thread->get_thread($id);
     foreach ($get_thread as $t) {
         $data = array('idCategory' => $t->category, 'category' => $t->category_name, 'topic' => $t->topicName, 'user' => $t->author, 'tanggal' => $t->created_at, 'title' => $t->title, 'status' => $t->status, 'message' => BBCodeParser($t->message));
     }
     $user = sentinel()->getUser();
     if ($this->checkTA() == TRUE) {
         $data['tenagaAhli'] = $user->id;
         $data['draftSide'] = $this->model_thread->get_all_drafts($user->id);
     }
     $data['author'] = user($user->id)->full_name;
     $data['home'] = site_url('author/');
     $data['categoriesSide'] = $this->model_thread->get_categories();
     $data['threadSide'] = $this->model_thread->get_thread_from_author($user->id);
     $data['closeThreads'] = $this->model_thread->get_close_threads($user->id);
     $data['threadSide'] = $this->model_thread->get_thread_from_author($user->id);
     $data['closeThreads'] = $this->model_thread->get_close_threads($user->id);
     $data['authorSide'] = $this->model_thread->get_thread_from_author($user->id);
     $data['reply'] = $this->model_thread->get_reply($id);
     $data['countReply'] = count($data['reply']);
     $data['id'] = $id;
     if ($this->session->flashdata('success')) {
         $data['success'] = $this->session->flashdata('success');
     } elseif ($this->session->flashdata('failed')) {
         $data['failed'] = $this->session->flashdata('failed');
     }
     $this->load->view('thread/single', $data);
 }
function import_ajax_handler()
{
    global $data;
    $data = array();
    $data['count'] = 0;
    $data['existing_count'] = 0;
    $data['site_url'] = site_url();
    $data['objects'] = array();
    // global $email;
    // Handle the ajax request
    check_ajax_referer('import_drs');
    $collection_pid = $_POST['pid'];
    $collection_pid = explode("/", $collection_pid);
    $collection_pid = end($collection_pid);
    $url = "https://repository.library.northeastern.edu/api/v1/export/" . $collection_pid . "?per_page=2&page=1";
    $drs_data = get_response($url);
    $json = json_decode($drs_data);
    // $email = '';
    if ($json->pagination->table->total_count > 0) {
        $email .= $json->pagination->table->total_count;
        for ($x = 1; $x <= $json->pagination->table->num_pages; $x++) {
            $url = "https://repository.library.northeastern.edu/api/v1/export/" . $collection_pid . "?per_page=2&page=" . $x;
            $drs_data = get_response($url);
            $json = json_decode($drs_data);
            drstk_get_image_data($json);
        }
    } else {
        $data = json_decode($drs_data);
    }
    wp_send_json(json_encode($data));
}
Beispiel #7
0
 /**
  * Shows all users in a particular category
  *
  * This function shows config('items_per_page') users, starting from $page_offset-th page.
  * 
  * @param int $category_id The category ID, or 0 to select all categories.
  * @param int $page_offset The page number to show.
  */
 public function viewAll($category_id = 0, $page_offset = 1)
 {
     if ($this->input->post(NULL)) {
         $category_id = $this->input->post('category_id');
         redirect('admin/user/viewAll/' . $category_id . '/' . $page_offset);
     }
     $this->ui['header']['page'] = 'user';
     $this->ui['header']['title'] = $this->lang->line('users');
     $items_per_page = $this->setting->get('items_per_page');
     $criteria = array();
     if ($category_id > 0) {
         $criteria['user.category_id'] = $category_id;
     }
     $conditions['limit'] = $items_per_page;
     $conditions['offset'] = ($page_offset - 1) * $items_per_page;
     $conditions['order_by'] = array('category_id' => 'ASC', 'id' => 'ASC');
     $users = $this->user_manager->get_rows($criteria, $conditions);
     $categories = $this->category_manager->get_rows();
     $this->ui['content']['users'] = $users;
     $this->ui['content']['categories'] = $categories;
     $this->ui['content']['total_users'] = $this->user_manager->count_rows($criteria);
     $this->ui['content']['items_per_page'] = $items_per_page;
     $this->ui['content']['page_offset'] = $page_offset;
     $config['base_url'] = site_url('admin/user/viewAll/' . $category_id);
     $config['uri_segment'] = 5;
     $config['total_rows'] = $this->ui['content']['total_users'];
     $this->pagination->initialize($config);
     $this->ui['content']['pager'] = $this->pagination->create_links();
     $this->ui['content']['category_id'] = $category_id;
     $this->load->view('admin/header', $this->ui['header']);
     $this->load->view('admin/user/viewAll', $this->ui['content']);
     $this->load->view('footer', $this->ui['footer']);
 }
Beispiel #8
0
function redirect_to_registration()
{
    if (isset($_GET['action']) && $_GET['action'] == 'validatepage1') {
        wp_redirect(site_url('/registration-complete/'));
        exit;
    }
}
Beispiel #9
0
 function Auth()
 {
     $this->table = 'your_table';
     //The fields below should be columns in the table above, which are used to
     //authenticate the user's credentials.
     $this->userNameField = 'username';
     $this->passField = 'password';
     //The numeric column which stores the permissions/level of each user:
     $this->lvlField = 'lvl';
     //The following are general columns in the database which are
     //stored in the Session, for easily displaying some information
     //about the user:
     $this->miscFields = 'id,first,email,lvl,verified,credits';
     /* If there is a no lastLoggedIn field in the table which is updated
         to the current DATETIME whenever the user logs in, set the next
        variable to blank to disable this feature. */
     $this->lastLoggedInField = 'last_login';
     $this->homePageUrl = site_url();
     $this->loginPageUrl = site_url('accounts/login');
     $this->membersAreaUrl = site_url();
     //This is a CodeIgniter specific variable used to refer to the base
     //CodeIgniter Object:
     $this->obj =& get_instance();
     //This is my custom database library:
     $this->db = $this->obj->db;
     //All data passed on from a form to this class must be
     // already escaped to prevent SQL injection.
     //However, all data stored in sessions is escaped by the class.
     if ($this->isLoggedIn()) {
         $this->refreshInfo();
     }
 }
Beispiel #10
0
 function process_submission()
 {
     if (!current_user_can('pp_manage_settings')) {
         wp_die(__ppw('Cheatin&#8217; uh?'));
     }
     if (!empty($_REQUEST['pp_refresh_updates'])) {
         delete_site_transient('update_plugins');
         pp_get_version_info(true, false, true);
         wp_update_plugins();
         wp_redirect(admin_url('admin.php?page=pp-settings&pp_refresh_done=1'));
         exit;
     }
     if (!empty($_REQUEST['pp_renewal'])) {
         $opt_val = get_option('pp_support_key');
         $renewal_token = !is_array($opt_val) || count($opt_val) < 2 ? '' : substr($opt_val[1], 0, 16);
         $url = site_url('');
         $arr_url = parse_url($url);
         $site = urlencode(str_replace($arr_url['scheme'] . '://', '', $url));
         wp_redirect('http://presspermit.com/renewal/?pkg=press-permit-pro&site=' . $site . '&rt=' . $renewal_token);
         exit;
     }
     if (!empty($_REQUEST['pp_upload_config']) || !empty($_REQUEST['pp_support_forum'])) {
         require_once dirname(__FILE__) . '/admin/support_pp.php';
         $args = array();
         if (isset($_REQUEST['post_id'])) {
             $args['post_id'] = (int) $_REQUEST['post_id'];
         }
         if (isset($_REQUEST['term_taxonomy_id'])) {
             $args['term_taxonomy_id'] = (int) $_REQUEST['term_taxonomy_id'];
         }
         if (!empty($_REQUEST['pp_support_forum'])) {
             //$forum = ( ! empty( $_REQUEST['pp_forum'] ) ) ? sanitize_url($_REQUEST['pp_forum']) : 'pp2-technical-issues';
             $url = "http://presspermit.com/forums/";
             if (!empty($_REQUEST['pp_topic'])) {
                 $url = add_query_arg('pp_topic', $_REQUEST['pp_topic'], $url);
             }
             wp_redirect($url);
         }
         $success = _pp_support_upload($args);
         if (empty($_REQUEST['pp_support_forum'])) {
             if (-1 === $success) {
                 $flag = 'pp_config_no_change';
             } elseif ($success) {
                 $flag = 'pp_config_uploaded';
             } else {
                 $flag = 'pp_config_failed';
             }
             wp_redirect(admin_url("admin.php?page=pp-settings&{$flag}=1"));
         }
         exit;
     }
     if (isset($_POST['pp_submit'])) {
         $this->handle_submission('update');
     } elseif (isset($_POST['pp_defaults'])) {
         $this->handle_submission('default');
     } elseif (isset($_POST['pp_role_usage_defaults'])) {
         delete_option('pp_role_usage');
         pp_refresh_options();
     }
 }
Beispiel #11
0
 public function index()
 {
     $filtro_usuario = $this->input->post('usuario');
     $filtros_usuario = $this->paginador_model->filtro($filtro_usuario, 'usuario_filtro');
     /**
      * configuracion de paginacion
      */
     $data['usuarios'] = $this->usuario_model->get_usuarios($filtros_usuario);
     $total_rows = $data['usuarios'] == false ? 0 : $data['usuarios']->num_rows();
     $base_url = site_url('maestro/usuario/index');
     $config = $this->paginador_model->paginar($total_rows, $base_url);
     $perpage = $this->paginador_model->get_perpage();
     $this->pagination->initialize($config);
     /**
      * fin paginacion.
      */
     $data['per_page'] = $perpage;
     $data['usuarios'] = $this->usuario_model->get_usuarios($filtros_usuario, $perpage, $this->uri->segment(4));
     $data0['roles'] = $this->usuario_model->buscar('roles');
     $data0['bodegas'] = $this->usuario_model->buscar('bodegas', array('bode_estado' => 'A'));
     $data['vista_nuevo_usuario'] = $this->load->view('nuevo_usuario_view', $data0, true);
     $data['vista_editar_usuario'] = $this->load->view('editar_usuario_view', $data0, true);
     $data['vista_buscar_usuario'] = $this->load->view('buscar_usuario_view', $data0, true);
     $menu = array(array('callback' => 'nuevo_usuario();return false;', 'val' => '<img class="qtip" alt="Nuevo Usuario"  src="' . base_url() . 'assets/images/add-files.png" />'), array('callback' => 'buscar_usuario();return false;', 'val' => '<img class="qtip" alt="Buscar Usuario" src="' . base_url() . 'assets/images/search.png" />'), array('val' => '<img class="qtip" alt="Mostrar Todos" src="' . base_url() . 'assets/images/all.png" />', 'href' => site_url('maestro/usuario/todos')));
     $this->run('usuarios_view', $data, 'Listado de usuarios', $menu, null, null, 'usuario.js');
 }
Beispiel #12
0
 public function commentList()
 {
     //后台设置后缀为空,否则分页出错
     $this->config->set_item('url_suffix', '');
     //载入分页类
     $this->load->library('pagination');
     //每页显示数量
     $perPage = 10;
     //配置项设置
     $config['base_url'] = site_url('view/comment/commentList');
     $config['total_rows'] = $this->db->count_all_results('comment');
     $config['per_page'] = $perPage;
     $config['uri_segment'] = 4;
     $config['first_link'] = '首页';
     $config['prev_link'] = '上一页';
     $config['next_link'] = '下一页';
     $config['last_link'] = '尾页';
     $this->pagination->initialize($config);
     $data['links'] = $this->pagination->create_links();
     $offset = $this->uri->segment(4);
     $this->db->limit($perPage, $offset);
     $comment = $this->comment->commentList();
     $data['comment'] = $comment;
     $this->load->view('view/comment/commentList', $data);
 }
function setPaginationVb($site, $total_rows, $perpage, $urisegment = 3)
{
    $CI =& get_instance();
    $CI->load->library('pagination');
    $config['base_url'] = site_url($site);
    // What will CI use for the page links?
    $config['total_rows'] = $total_rows;
    $config['per_page'] = $perpage;
    // How many items per page?
    $config['num_links'] = 2;
    $config['full_tag_open'] = '<div class="news-pagination" style="padding-top:10px;">';
    $config['full_tag_close'] = "</div>";
    $config['first_link'] = 'Đầu';
    $config['first_tag_open'] = '';
    $config['first_tag_close'] = '';
    $config['last_link'] = 'Cuối';
    $config['last_tag_open'] = '';
    $config['last_tag_close'] = '';
    $config['next_link'] = 'Sau ';
    $config['next_tag_open'] = '';
    $config['next_tag_close'] = '';
    $config['prev_link'] = ' Trước';
    $config['prev_tag_open'] = '';
    $config['prev_tag_close'] = '';
    $config['num_tag_open'] = '';
    $config['num_tag_close'] = '';
    $config['cur_tag_open'] = '<span class="active">';
    $config['cur_tag_close'] = '</span>';
    $config['uri_segment'] = $urisegment;
    $CI->pagination->initialize($config);
    // config pagination
}
Beispiel #14
0
 public function save($driverID = null)
 {
     //$this->_set_fields();
     if ($driverID > 0) {
         $data['title'] = "Edit Driver";
     } else {
         $data['title'] = "New Driver";
     }
     $data['action'] = site_url('driver/save/' . $driverID);
     $this->_set_rules();
     $driver_info = array('driverID' => $this->input->post('driverID'), 'firstName' => $this->input->post('firstName'), 'lastName' => $this->input->post('lastName'), 'email' => $this->input->post('email'), 'phone' => $this->input->post('phone'), 'isActive' => $this->input->post('isActive'), 'Address' => $this->input->post('Address'), 'City' => $this->input->post('City'), 'State' => $this->input->post('State'), 'zipCode' => $this->input->post('zipCode'), 'socialSecurity' => $this->input->post('socialSecurity'), 'license' => $this->input->post('license'), 'bankName' => $this->input->post('bankName'), 'bankAccount' => $this->input->post('bankAccount'));
     $data['Driver'] = $driver_info;
     //$blnSuccess=$this->form_validation->run();
     $blnSuccess = true;
     $data['blnSuccess'] = $blnSuccess;
     if ($blnSuccess) {
         if ($driverID > 0) {
             $this->driver_model->update_driver($driver_info);
         } else {
             $this->driver_model->insert_driver($driver_info);
         }
     }
     if ($blnSuccess) {
         redirect('driver/index/' . $driverID);
     } else {
         $this->layout->view('driver/formDriver', $data);
     }
 }
Beispiel #15
0
 function admin_preload()
 {
     $this->CI->admin_navigation->child_link('members', 10, 'Manage Members', site_url('admincp/users'));
     $this->CI->admin_navigation->child_link('members', 20, 'Add Member/Administrator', site_url('admincp/users/add'));
     $this->CI->admin_navigation->child_link('members', 30, 'Login Records', site_url('admincp/users/logins'));
     $this->CI->admin_navigation->child_link('members', 40, 'Member Groups', site_url('admincp/users/groups'));
 }
Beispiel #16
0
function phpscript($file)
{
    $thisobject =& get_instance();
    $charset = $thisobject->config->item('charset');
    $path2file = site_url('recursos/scripts/' . $file);
    return '<script src="' . $path2file . '" type="text/javascript" charset="' . $charset . '"></script>' . "\n";
}
Beispiel #17
0
 function index()
 {
     $this->rapyd->load("phpfreechat");
     if (isset($this->session->userdata['logged_in']) and $this->session->userdata['logged_in']) {
         $this->session->set_userdata('last_activity', time());
         if ($this->datasis->essuper('usuario')) {
             $params["isadmin"] = true;
         }
         $params["nick"] = utf8_encode($this->session->userdata('usuario'));
         $params["language"] = "es_ES";
         $params["title"] = $this->datasis->traevalor("TITULO1");
         $params["serverid"] = md5('ProteoERP');
         // calculate a unique id for this chat
         $params["frozen_nick"] = false;
         $params["server_script_url"] = site_url('/chat');
         $params["data_public_url"] = site_url('phpfreechat/data/public');
         $params["quit_on_closedwindow"] = true;
         $params["display_pfc_logo"] = false;
         $chat = new phpfreechat($params);
         $data['head'] = $chat->printJavascript(true) . $chat->printStyle(true);
         $data['content'] = $chat->printChat(true);
         $data['title'] = " Prueba de chat ";
         $this->load->view('view_freechat', $data);
     } else {
         echo "window.close()";
     }
 }
Beispiel #18
0
 function dataedit()
 {
     $this->rapyd->load("dataobject", "dataedit");
     //              $link=site_url('finventario/bi_edificio/ultimo');
     //              $link2=site_url('finventario/bi_edificio/sugerir');
     $edit = new DataEdit("Muebles", "bi_bienes");
     $edit->back_url = site_url("bienes/bi_bienes/filteredgrid");
     $edit->pre_process('insert', '_valida');
     $edit->pre_process('update', '_valida');
     $edit->id = new inputField("Id", "id");
     $edit->id->mode = "autohide";
     $edit->id->when = array('show');
     $edit->nombre = new inputField("Nombre", "nombre");
     $edit->nombre->size = 30;
     $edit->nombre->maxlength = 30;
     $edit->descrip = new textareaField("Descripci&oacute;n", "descrip");
     $edit->descrip->rows = 4;
     $edit->descrip->cols = 50;
     $edit->modelo = new inputField("Modelo", "modelo");
     $edit->modelo->size = 20;
     $edit->modelo->maxlength = 30;
     $edit->color = new inputField("Color", "color");
     $edit->color->size = 20;
     $edit->color->maxlength = 30;
     $edit->buttons("modify", "save", "undo", "delete", "back");
     $edit->build();
     $data['content'] = $edit->output;
     $data['title'] = "Muebles";
     $data["head"] = script("jquery.pack.js") . $this->rapyd->get_head();
     $this->load->view('view_ventanas', $data);
 }
 /**
  * Display the delete interface for the news.
  */
 function id($id = NULL)
 {
     // Determine if the id given is valid.
     if ($id == NULL) {
         redirect(site_url($this->table . '/admin/menu'));
     }
     if (!$this->is_valid_id($id)) {
         return;
     }
     if ($this->input->post()) {
         // If canceling the delete, return to the menu.
         if ($this->input->post('action') === 'Cancel') {
             redirect(site_url($this->table . '/admin/menu'));
         }
         // process the post data.
         $this->_process_post();
         $this->_item = $this->input->post();
     } else {
         // Get the item's data.
         $this->_item = $this->table_model->get_news_for_admin_edit($id);
         $this->has_error();
     }
     // Store the item and set the page's title.
     $this->add_content('item', $this->_item);
     if (isset($this->_item['name'])) {
         $this->title .= ' >> ' . $this->_item['name'];
     }
     // Add the admin stylesheets.
     $this->add_style('admin');
     $this->add_style('admin_delete');
     // Show the delete item interface.
     $this->show_page($this->table . '/' . $this->page, $this->title, TRUE);
 }
    function optionsframework_mlu_init()
    {
        register_post_type('optionsframework', array('labels' => array('name' => __('Options Framework Internal Container', 'oblivion')), 'public' => true, 'show_ui' => false, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => false, 'supports' => array('title', 'editor'), 'query_var' => false, 'can_export' => true, 'show_in_nav_menus' => false));
    }
}
/**
 * Adds the Thickbox CSS file and specific loading and button images to the header
Beispiel #21
0
 public function index()
 {
     $d['title'] = "General Setting";
     $page = $this->uri->segment(3);
     $limit = $this->config->item('limit_data');
     if (!$page) {
         $offset = 0;
     } else {
         $offset = $page;
     }
     $this->AppModel->activity($d['title'], '');
     $d['tot'] = $offset;
     $tot_hal = $this->AppModel->getAllData("tb_buku");
     $config['base_url'] = site_url() . '/catalog/index';
     $config['total_rows'] = $tot_hal->num_rows();
     $config['per_page'] = $limit;
     $config['uri_segment'] = 3;
     $config['first_link'] = 'Awal';
     $config['last_link'] = 'Akhir';
     $config['next_link'] = 'Selanjutnya';
     $config['prev_link'] = 'Sebelumnya';
     $this->pagination->initialize($config);
     $d["paginator"] = $this->pagination->create_links();
     $d['data'] = $this->AppModel->getAllDataLimited("tb_buku", $limit, $offset);
     $d['menu'] = $this->load->view('menu');
     $d['content'] = $this->load->view('catalog/List', $d, true);
     $this->load->view('HomeView', $d);
 }
Beispiel #22
0
 public function __construct($skin = null, $info = null, $shortinit = false)
 {
     global $wpdb;
     // Line up a wpdb-like object to use
     $this->use_wpdb = !function_exists('mysql_query') && !function_exists('mysqli_query') || !$wpdb->is_mysql || !$wpdb->ready ? true : false;
     $this->our_siteurl = untrailingslashit(site_url());
     if (false == $this->use_wpdb) {
         // We have our own extension which drops lots of the overhead on the query
         $wpdb_obj = new UpdraftPlus_WPDB(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
         // Was that successful?
         if (!$wpdb_obj->is_mysql || !$wpdb_obj->ready) {
             $this->use_wpdb = true;
         } else {
             $this->wpdb_obj = $wpdb_obj;
             $this->mysql_dbh = $wpdb_obj->updraftplus_getdbh();
             $this->use_mysqli = $wpdb_obj->updraftplus_use_mysqli();
         }
     }
     if ($shortinit) {
         return;
     }
     $this->ud_backup_info = $info;
     $this->ud_foreign = empty($info['meta_foreign']) ? false : $info['meta_foreign'];
     parent::__construct($skin);
     $this->init();
     $this->backup_strings();
     $this->is_multisite = is_multisite();
 }
 /**
  * Create an HTML Link
  *
  * @param string $url for the link
  * @param string $text the link text
  * @param array $attributes of additional tag settings
  * @return string
  */
 public static function link($url, $text = '', array $attributes = NULL)
 {
     if (!$attributes) {
         $attributes = array();
     }
     return self::tag('a', $text, $attributes + array('href' => site_url($url)));
 }
Beispiel #24
0
 public function index()
 {
     $offset = $this->general_lib->get_offset();
     $limit = $this->general_lib->get_limit();
     $total = $this->user_mdl->count_all();
     $xdata['action'] = 'user/search' . $this->_filter();
     $xdata['action_delete'] = 'user/delete' . $this->_filter();
     $xdata['add_btn'] = anchor('user/add', '<span class="glyphicon glyphicon-plus"></span> Tambah', array('class' => 'btn btn-success btn-sm'));
     $xdata['delete_btn'] = '<button id="delete-btn" class="btn btn-danger btn-sm"><span class="glyphicon glyphicon-trash"></span> Delete Checked</button>';
     $this->table->set_template(tbl_tmp());
     $head_data = array('fullname' => 'Fullname', 'username' => 'Username', 'level_name' => 'Level', 'ip_login' => 'Last IP Login', 'user_agent' => 'Last User Agent', 'date_login' => 'Last Login', 'status_name' => 'Status');
     $heading[] = form_checkbox(array('id' => 'selectAll', 'value' => 1));
     $heading[] = '#';
     foreach ($head_data as $r => $value) {
         $heading[] = anchor('user' . $this->_filter(array('order_column' => "{$r}", 'order_type' => $this->general_lib->order_type($r))), "{$value} " . $this->general_lib->order_icon("{$r}"));
     }
     $heading[] = 'Action';
     $this->table->set_heading($heading);
     $result = $this->user_mdl->get()->result();
     $i = 1 + $offset;
     foreach ($result as $r) {
         $this->table->add_row(array('data' => form_checkbox(array('name' => 'check[]', 'value' => $r->id)), 'width' => '10px'), $i++, $r->fullname, $r->username, $r->level_nama, $r->ip_login, $r->user_agent, $r->date_login, '<label class="label label-' . ($r->status_kode == 'ON' ? 'success' : 'danger') . '">' . $r->status_nama . '</label>', anchor('user/edit/' . $r->id . $this->_filter(), 'Edit') . "&nbsp;|&nbsp;" . anchor('user/delete/' . $r->id . $this->_filter(), 'Delete', array('onclick' => "return confirm('you sure')")));
     }
     $xdata['table'] = $this->table->generate();
     $xdata['total'] = page_total($offset, $limit, $total);
     $config = pag_tmp();
     $config['base_url'] = site_url("user" . $this->_filter());
     $config['total_rows'] = $total;
     $config['per_page'] = $limit;
     $this->pagination->initialize($config);
     $xdata['pagination'] = $this->pagination->create_links();
     $data['content'] = $this->load->view('user_list', $xdata, true);
     $this->load->view('template', $data);
 }
function wplms_dashboard_template()
{
    if (!is_user_logged_in()) {
        wp_redirect(site_url());
    }
    $template = 'templates/dashboard';
    global $bp;
    if ($bp->current_component == 'dashboard') {
        wp_enqueue_style('wplms-dashboard-css', WPLMS_DASHBOARD_URL . '/css/wplms-dashboard.css', array(), '1.0');
        wp_enqueue_script('wplms-dashboard-js', WPLMS_DASHBOARD_URL . '/js/wplms-dashboard.js', array('jquery', 'jquery-ui-sortable'), '1.0');
        if (is_active_widget(false, false, 'wplms_instructor_dash_stats', true) || is_active_widget(false, false, 'wplms_dash_stats', true)) {
            wp_enqueue_script('wplms-sparkline', WPLMS_DASHBOARD_URL . '/js/jquery.sparkline.min.js', array('jquery'), true);
        }
        if (is_active_widget(false, false, 'wplms_instructor_stats', true) || is_active_widget(false, false, 'wplms_instructor_commission_stats', true) || is_active_widget(false, false, 'wplms_student_stats', true)) {
            wp_enqueue_script('wplms-raphael', WPLMS_DASHBOARD_URL . '/js/raphael-min.js', array('jquery'), true);
            wp_enqueue_script('wplms-morris', WPLMS_DASHBOARD_URL . '/js/morris.min.js', array('jquery'), true);
        }
        $translation_array = array('earnings' => __('Earnings', 'wplms-dashboard'), 'payout' => __('Payout', 'wplms-dashboard'), 'students' => __('# Students', 'wplms-dashboard'), 'saved' => __('SAVED', 'wplms-dashboard'), 'saving' => __('SAVING ...', 'wplms-dashboard'), 'stats_calculated' => __('Stats Calculated, reloading page ...', 'wplms-dashboard'));
        wp_localize_script('wplms-dashboard-js', 'wplms_dashboard_strings', $translation_array);
    }
    $located_template = apply_filters('bp_located_template', locate_template($template, false), $template);
    if ($located_template && $located_template != '') {
        bp_get_template_part(apply_filters('bp_load_template', $located_template));
    } else {
        bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/dashboard'));
    }
}
 /**
  *    generate_add_to_iCal_button
  *
  * @access    public
  * @param $html
  * @param $datetime
  * @return    string
  */
 public static function generate_add_to_iCal_button($html, $datetime)
 {
     // first verify a proper datetime object has been received
     if ($datetime instanceof EE_Datetime) {
         // set whether a link or submit button is shown
         $iCal_type = apply_filters('FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type', 'submit');
         // generate a link to the route we registered in set_hooks()
         $URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $datetime->ID()), site_url());
         // what type ?
         switch ($iCal_type) {
             // submit buttons appear as buttons and are very compatible with a theme's style
             case 'submit':
                 $html .= '<form id="download-iCal-frm-' . $datetime->ID() . '" class="download-iCal-frm" action="' . $URL . '" method="post" >';
                 $html .= '<input type="submit" class="ee-ical-sbmt" value="&#xf145;" title="' . __('Add to iCal Calendar', 'event_espresso') . '"/>';
                 $html .= '</form>';
                 break;
                 // buttons are just links that have been styled to appear as buttons, but may not be blend with a theme as well as submit buttons
             // buttons are just links that have been styled to appear as buttons, but may not be blend with a theme as well as submit buttons
             case 'button':
                 $html .= '<a class="ee-ical-btn small ee-button ee-roundish" href="' . $URL . '" title="' . __('Add to iCal Calendar', 'event_espresso') . '">';
                 $html .= ' <span class="dashicons dashicons-calendar"></span>';
                 $html .= '</a>';
                 break;
                 // links are just links that use the calendar dashicon
             // links are just links that use the calendar dashicon
             case 'icon':
                 $html .= '<a class="ee-ical-lnk" href="' . $URL . '" title="' . __('Add to iCal Calendar', 'event_espresso') . '">';
                 $html .= ' <span class="dashicons dashicons-calendar"></span>';
                 $html .= '</a>';
                 break;
         }
     }
     return $html;
 }
Beispiel #27
0
 public function out()
 {
     $session_data = $this->session->userdata('logged_in');
     $this->db->delete('w_user_online', array('user_id' => @$session_data['id_user']));
     $this->session->sess_destroy();
     echo "<script type=\"text/javascript\">location.href = '" . site_url() . "' + 'login'; </script>";
 }
Beispiel #28
0
 function lists()
 {
     $colModel['id_tahun_anggaran'] = array('ID', 20, TRUE, 'center', 0);
     $colModel['periode'] = array('Periode', 105, TRUE, 'center', 2);
     $colModel['tahun'] = array('Tahun', 75, TRUE, 'center', 2);
     $colModel['deskripsi'] = array('Deskripsi', 100, TRUE, 'left', 2);
     $colModel['regulasi'] = array('Regulasi', 220, TRUE, 'left', 2);
     $colModel['keterangan'] = array('Keterangan', 220, TRUE, 'left', 2);
     $colModel['aksi'] = array('AKSI', 60, FALSE, 'center', 0);
     //Populate flexigrid buttons..
     $buttons[] = array('Select All', 'check', 'btn');
     $buttons[] = array('separator');
     $buttons[] = array('DeSelect All', 'uncheck', 'btn');
     $buttons[] = array('separator');
     $buttons[] = array('Add', 'add', 'btn');
     $buttons[] = array('separator');
     $buttons[] = array('Delete Selected Items', 'delete', 'btn');
     $buttons[] = array('separator');
     $gridParams = array('height' => 300, 'rp' => 10, 'rpOptions' => '[10,20,30,40]', 'pagestat' => 'Displaying: {from} to {to} of {total} items.', 'blockOpacity' => 0.5, 'title' => '', 'showTableToggleBtn' => false);
     $grid_js = build_grid_js('flex1', site_url('rencanaPembangunan/c_tahun_anggaran/load_data'), $colModel, 'id_tahun_anggaran', 'asc', $gridParams, $buttons);
     $data['js_grid'] = $grid_js;
     $data['page_title'] = 'DATA TAHUN ANGGARAN';
     $data['menu'] = $this->load->view('menu/v_rencanaPembangunan', $data, TRUE);
     $data['content'] = $this->load->view('rencanaPembangunan/tahun_anggaran/v_list', $data, TRUE);
     $this->load->view('utama', $data);
 }
Beispiel #29
0
 function dataedit()
 {
     $this->rapyd->load('dataedit');
     $edit = new DataEdit($this->t**s, 'r_sector');
     $edit->back_url = site_url($this->url . "filteredgrid");
     $edit->post_process('insert', '_post_insert');
     $edit->post_process('update', '_post_update');
     $edit->post_process('delete', '_post_delete');
     $edit->id = new inputField('Id', 'id');
     $edit->id->rule = 'trim';
     $edit->id->size = 13;
     $edit->id->maxlength = 11;
     $edit->id->mode = 'autohide';
     $edit->id->when = array('show', 'modify');
     $edit->descrip = new inputField('Descrip', 'descrip');
     $edit->descrip->rule = 'trim';
     $edit->descrip->size = 40;
     $edit->descrip->maxlength = 100;
     $edit->monto = new inputField('Monto', 'monto');
     $edit->monto->rule = 'max_length[19]|numeric';
     $edit->monto->css_class = 'inputnum';
     $edit->monto->size = 10;
     $edit->monto->maxlength = 19;
     $edit->buttons('add', 'modify', 'save', 'undo', 'delete', 'back');
     $edit->build();
     $data['content'] = $edit->output;
     $data['head'] = $this->rapyd->get_head();
     $data['title'] = $this->t**s;
     $this->load->view('view_ventanas', $data);
 }
Beispiel #30
0
function list_categories($cats, $sub = '')
{
    foreach ($cats as $cat) {
        ?>
                  <tr>
                    <td style="padding:8px 0;">
                    <?php 
        echo $sub;
        ?>
                    <span class="glyphicon glyphicon-play" style="font-size:0.8em; color:#8bc53f;"></span>&nbsp;&nbsp;
                      <a class="sideCatA" style="" href="<?php 
        echo site_url($cat['category']->slug);
        ?>
">
                        <?php 
        echo ucwords(strtolower($cat['category']->name));
        ?>
                      </a>
                    </td>
                  </tr>
                  <?php 
        if (sizeof($cat['children']) > 0) {
            $sub2 = str_replace('&rarr;&nbsp;', '&nbsp;', $sub);
            $sub2 .= '&nbsp;&nbsp;&nbsp;&nbsp;';
            list_categories($cat['children'], $sub2);
        }
    }
}