Ejemplo n.º 1
0
 public function init()
 {
     // $seg1 = $this->uri->segment(1,'');
     $seg1 = $this->config->item('layout_name');
     $ltype = isset($seg1) ? $seg1 : '';
     $this->load->config('layout');
     switch ($ltype) {
         case 'admin':
             $layout = $this->config->item('default', 'layout');
             if (!$layout) {
                 die('Layout not found.');
             }
             $this->layout->initialize($layout);
             if (!is_logged_in()) {
                 $seg2 = $this->uri->segment(2, '');
                 if ($seg1 === 'admin' && $seg2 !== 'login') {
                     redirect('admin/login');
                 }
             } elseif (is_logged_in() && get_user_role()) {
                 die('www');
                 redirect('lession');
             }
             break;
         default:
             $layout = $this->config->item('default', 'layout');
             if (!$layout) {
                 die('Layout not found.');
             }
             $this->layout->initialize($layout);
             //$this->load_settings_data();
             break;
     }
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     parent::__construct();
     if (!is_logged_in()) {
         redirect('login');
     }
     $this->data = array();
     $this->role = get_user_role();
     $this->load->library("form_validation");
     $this->load->model("user_model");
     $this->load->model("role_model");
 }
Ejemplo n.º 3
0
 public function init()
 {
     $layout = $this->config->item('admin', 'layout');
     if (!$layout) {
         die('Layout not found.');
     }
     $this->layout->initialize($layout);
     if (!is_logged_in()) {
         $seg2 = $this->uri->segment(2, '');
         if ($seg1 === 'admin' && $seg2 !== 'login') {
             redirect('admin/login');
         }
     } elseif (is_logged_in() && get_user_role()) {
         if (get_user_role() != '1') {
             redirect('home');
         } else {
             $seg2 = $this->uri->segment(2, '');
             if (empty($seg2)) {
                 redirect('admin/contact_form');
             }
         }
     }
 }
Ejemplo n.º 4
0
 public function init()
 {
     $seg1 = $this->uri->segment(1, '');
     $this->load->config('layout');
     switch ($seg1) {
         case 'admin':
             $layout = $this->config->item('admin', 'layout');
             if (!$layout) {
                 die('Layout not found.');
             }
             $this->layout->initialize($layout);
             if (!is_logged_in()) {
                 $seg2 = $this->uri->segment(2, '');
                 if ($seg1 === 'admin' && $seg2 !== 'login') {
                     redirect('admin/login');
                 }
             } elseif (is_logged_in() && get_user_role()) {
                 if (get_user_role() != '1') {
                     redirect('home');
                 }
             }
             break;
         default:
             $layout = $this->config->item('frontend', 'layout');
             if ($this->router->fetch_class() == 'dashboard') {
                 if (!is_logged_in()) {
                     redirect('login');
                 }
                 $this->header = 'frontend/_partials/inner-header';
             }
             if (!$layout) {
                 die('Layout not found.');
             }
             $this->layout->initialize($layout);
             break;
     }
 }
Ejemplo n.º 5
0
 public function init()
 {
     $seg1 = $this->uri->segment(1, '');
     $this->load->config('layout');
     switch ($seg1) {
         case 'admin':
             $layout = $this->config->item('admin', 'layout');
             if (!$layout) {
                 die('Layout not found.');
             }
             $this->layout->initialize($layout);
             if (!is_logged_in()) {
                 $seg2 = $this->uri->segment(2, '');
                 if ($seg1 === 'admin' && $seg2 !== 'login') {
                     redirect('admin/login');
                 }
             } elseif (is_logged_in() && get_user_role()) {
                 if (get_user_role() != '1') {
                     redirect('home');
                 } else {
                     $seg2 = $this->uri->segment(2, '');
                     if (empty($seg2)) {
                         redirect('admin/contact_form');
                     }
                 }
             }
             break;
         default:
             $layout = $this->config->item('frontend', 'layout');
             if (!$layout) {
                 die('Layout not found.');
             }
             $this->layout->initialize($layout);
             $this->load_settings_data();
             break;
     }
 }
Ejemplo n.º 6
0
							<div id="entry-author-info">
								<div class="author-inner">
									<div id="author-avatar" class="image-style">
										<?php 
            echo get_avatar(get_the_author_meta('user_email'), 139);
            ?>
									</div><!-- #author-avatar -->		
									<div class="author-desc">		
										<ul class="author-detail">
											<li class="first bold-upper-normal"><?php 
            the_author_posts_link();
            ?>
</li>
											<li class="second">
												<i><?php 
            echo get_user_role(get_the_author_meta('ID'));
            ?>
</i>
											</li>
										</ul>
										<p><?php 
            the_author_meta('description');
            ?>
<p>
									</div>
								</div><!-- #author-inner -->
							</div><!-- #entry-author-info -->
							<?php 
        }
        ?>
	
Ejemplo n.º 7
0
</style>
<body>
<div class = "content" align="center">
    <h1>Patient Intake</h1>

    Here are a list of patients scheduled for today. Some of them still require patient intake paperwork, others may require an initial office visit from
    a medical student, and others may require approval from a doctor.<br>
    For Patient Intake, you can either:
<ol>
    <li>Click on the links and give the tablet to the patient or</li>
    <li>Read the token to the patient to fill out the digital paperwork</li>
</ol>
<?php 
global $db;
$date_str = date('m/d/Y');
$user_role = get_user_role($_SESSION['id']);
echo "<h2>Scheduled Patients for today: <i>{$date_str}</i></h2>";
echo "<ol>";
$query = "SELECT first_name, last_name, token, DATE_FORMAT(start_time, '%h:%i%p') AS start_time, Patients.patient_id, slot_id, completed_paperwork, status ";
$query .= "FROM Patients ";
$query .= "JOIN Schedule ON Patients.patient_id = Schedule.scheduled_patient_id ";
$query .= "LEFT JOIN OfficeVisitForm On Schedule.slot_id = OfficeVisitForm.visit_date_id ";
// LEFT JOIN, because if it's not filled out yet, that's okay, $status will be NULL
$query .= "WHERE Schedule.slot_date = CAST(NOW() AS DATE) ";
// get patients for today
$query .= "ORDER BY slot_date ASC";
$stmt = $db->prepare($query);
$stmt->bind_result($first_name, $last_name, $token, $start_time, $current_patient_id, $current_slot_id, $completed_paperwork, $status);
// bind the parameters to a result. Very useful!
$stmt->execute();
// Fetch all results and generate links to them
Ejemplo n.º 8
0
 *
 * This includes the header, options, and other information that should provide
 * The User Interface to the end user.
 *
 * @package   Property_Finder
 * @author    Your Name <*****@*****.**>
 * @license   GPL-2.0+
 * @link      http://example.com
 * @copyright 2013 Your Name or Company Name
 */
error_reporting(E_ALL);
ini_set('display_errors', '1');
// Leads for builder
include_once $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php';
global $wpdb;
$user_role = get_user_role(get_current_user_id());
$all_leads = array();
$builders_leads = array();
$offset = 0;
if ($user_role === 'kb_admin') {
    $lead_key = 'kb home';
} else {
    if ($user_role === 'tollbrothersadmin') {
        $lead_key = 'toll brothers';
    } else {
        if ($user_role === 'beazer_admin') {
            $lead_key = 'beazer homes';
        } else {
            if ($user_role === 'pardee_admin') {
                $lead_key = 'pardee homes';
            }
Ejemplo n.º 9
0
global $current_user_email;
global $current_user_firstname;
global $current_user_lastname;
global $current_user_displayname;
global $current_user_id;
global $myprofile;
global $wpdb;
// set global variables
$current_user_username = $current_user->user_login;
$current_user_email = $current_user->user_email;
$current_user_firstname = $current_user->user_firstname;
$current_user_lastname = $current_user->user_lastname;
$current_user_displayname = $current_user->display_name;
$current_user_id = $current_user->ID;
// get the current users role
$user_role = get_user_role();
// get avatars
$avatar = get_avatar($current_user_email, 20);
$avatar_200 = get_avatar($current_user_email, 220);
// set an empty $strenghts str var so that we can add it to the profile after the supevisor
$strengths = '';
?>

<?php 
do_action('bp_before_member_header');
?>

<div id="item-header-avatar" class="col-xs-3 col-md-3 fs-content-thumbnail">
	<a href="<?php 
bp_displayed_user_link();
?>
Ejemplo n.º 10
0
$row = $results->fetch_assoc();
?>

<!-- Custom CSS -->
<link href="css/index-logged-out.css" rel="stylesheet">
<link href="css/login.css" rel="stylesheet">

<header id="top" class="header">
    <div class="text-vertical-center">
        <h1>Welcome to Rowan EMR</h1>
        <h3>Logged in as: <?php 
echo $row['name'];
?>
</h3>
        <h4>(<?php 
echo get_user_role($_SESSION['id']);
?>
)</h4>
        <div class="row">
            <!-- <a href="patient-demographic.php?patient=new"> -->
            <a href = "patient-intake.php">
                <img border="25" src="res/image/New-Patient-Intake.png" width="150" height="150">
            </a>
            <a href="scheduling.php">
                <img border="25" src="res/image/Scheduling.png" width="150" height="150">
            </a>
            <a href="reports.php">
                <img border="25" src="res/image/Data-Export.png" width="150" height="150">
            </a>
        </div>
        <div class="row">
Ejemplo n.º 11
0
/**
 * Used to stop executing the page if the form is locked and the user is a non-admin.
 * If the user is an admin, we will let them update the page, but they will be warned.
 * @param int $patient_id The patient ID to check for
 * @param int $slot_id The slot ID to check for
 */
function check_if_locked($patient_id, $slot_id)
{
    $form_status = get_form_status($patient_id, $slot_id);
    $user_role = get_user_role($_SESSION['id']);
    //get id of Doctor (not patient!)
    // Prevent all non-admins from editing a locked form.
    if ($form_status == STATUS_LOCKED and $user_role != 'ADMIN') {
        // Form is locked, sorry, you can't edit it!
        die("Sorry, this form is locked! <a href = 'patient-info.php?patient_id={$patient_id}'>Click here for a read-only copy of this patient's data</a>");
    } elseif ($form_status == STATUS_LOCKED and $user_role == 'ADMIN') {
        echo '<div class="alert alert-danger"><strong>Attention! </strong>';
        echo 'This form is <strong>locked/read-only</strong> to all users, except admins. You may edit this form (as an admin).</div>';
    }
}
Ejemplo n.º 12
0
<div class="container">
	<div class="row">
		<div class="col-md-4">
			<?php 
$current_user = wp_get_current_user();
?>
			<img src="<?php 
echo get_profile_image();
?>
">
			<h3><?php 
echo $current_user->user_firstname . ' ' . $current_user->user_lastname;
?>
</h3>
			<p><i><?php 
echo get_user_role();
?>
</i></p>
			<p><?php 
echo get_profile_description();
?>
</p>
		</div>
		<div class="col-md-8">
			<?php 
if ($current_user->ID != 0) {
    ?>
			<h3>My Jobs</h3>
			<table class="job-table">
				<thead>
					<th>Job Title</th>
 /**
  *
  */
 public static function dispatcher()
 {
     if (isset($_GET['id'])) {
         $evento = Eventos::getInstance()->getById($_GET['id']);
         set_the_evento($evento);
     }
     if (isset($_GET['action'])) {
         $action = $_GET['action'];
     }
     if ($action == null) {
         if (get_user_role() == 'author') {
             // Listar inscrições
             self::inscricoes();
         } else {
             // Listar eventos
             self::showList();
         }
     } else {
         if ($action == 'add-new' || $action == 'edit') {
             //self::showForm($action, $evento);
             self::novoEvento();
         } else {
             if ($action == 'delete') {
                 self::delete($evento);
             } else {
                 if ($action == 'view') {
                     self::view($evento);
                 } else {
                     if ($action == 'inscricoes') {
                         self::inscricoes($evento);
                     } else {
                         if ($action == 'financeiro') {
                             self::financeiro($evento);
                         } else {
                             if ($action == 'avaliacoes') {
                                 self::avaliacoes($evento);
                             } else {
                                 if ($action == 'configuracoes') {
                                     self::configuracoes($evento);
                                 } else {
                                     if ($action == 'comunicacao') {
                                         self::comunicacao($evento);
                                     } else {
                                         if ($action == "editAreaAluno") {
                                             self::editAreaAluno($evento);
                                         } else {
                                             if ($action == "editCertificado") {
                                                 self::editCertificado($evento);
                                             } else {
                                                 echo "Action não encontrada em " . __CLASS__ . ": " . $action;
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 14
0
function current_user_have_role($role_id, $redirect = true)
{
    $ci =& get_instance();
    $user_id = validate_login();
    $user_role = get_user_role($user_id);
    if ($user_role != $role_id) {
        $location = $ci->router->fetch_class();
        if ($redirect) {
            redirect($location);
        }
        return false;
    } else {
        return true;
    }
}
Ejemplo n.º 15
0
        continue;
    }
    //Not an array means they didn't fill this portion out. That's okay. Go to next region.
    foreach ($current_treatment_arr as &$treatment_method) {
        // We have an array like $head_treatments as $current_treatment_arr that contains treatments like (ME, MFR, ...)
        // Insert the region name like Head and the treatment type like ME as separate rows in OfficeVisitFormTreatments
        insert_treatment($current_region, $treatment_method, $office_visit_form_id);
    }
}
/*----------------------------------------------------------------------------------------------------------------------
 * Step 4: We are done, let's tell the student doctor to wait for physician sign off
 *----------------------------------------------------------------------------------------------------------------------
 */
if ($form_status == STATUS_EMPTY) {
    echo 'Data filled out. All logged in Doctors will be notified.';
} elseif (get_user_role($_SESSION['id']) == 'DOCTOR' or get_user_role($_SESSION['id']) == 'ADMIN') {
    echo 'Thank you for approving this. This form is now locked (read-only).';
} else {
    echo 'Data filled out.';
}
echo '<br><a href="index.php">Go back to EMR System</a>';
/**
 * This will insert a specific treatment into OfficeVisitFormTreatments table
 * This is necessary because the treatments are stored as checkboxes
 * I did not want to add 10 regions * 9 treatments = 90 columns that might be null most of the time to the main
 * office visit table. MySQL does not have arrays (Postgres > MySQL)
 * The proper way to build a normalized DB here is to store each of those checkboxes as a new row
 * Example query ran by this function:
 *    INSERT INTO OfficeVisitFormTreatments (office_visit_id, region, treatment_method)
 *    VALUES (1, 'Head', 'ME')
 * If there were multiply treatments for head region, we'd have a similar row with MFR, HVLA, etc as treatments.
Ejemplo n.º 16
0
        ?>
						<tr>
							<td><?php 
        echo $user->id;
        ?>
</td>
							<td><?php 
        echo $user->account;
        ?>
</td>
							<td><?php 
        echo $user->username;
        ?>
</td>
							<td><?php 
        echo get_user_role($user->role_id);
        ?>
</td>
							<td><?php 
        echo get_user_group($user->group_id);
        ?>
</td>
							<td><?php 
        echo date('Y-m-d H:i:s', strtotime($user->create));
        ?>
</td>
							<td>
								<div class="btn-group">
									<a href="<?php 
        echo_path('/users/add');
        ?>
Ejemplo n.º 17
0
<?php

$curauth = get_query_var('author_name') ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
$role = get_user_role($curauth->ID);
?>

<div class="author small-12 columns">


		<div class="authorInfo large-8 medium-8 small-12 columns" itemscope itemtype="http://schema.org/Person">
            <div class="authorAvatar">

          <?php 
echo get_avatar($curauth->user_email, '80');
?>
        </div>



            <h2 itemprop="name" class="authorName"><?php 
echo $curauth->display_name;
?>
</h2>
            <?php 
if ($curauth->jobTitle) {
    echo '<span itemprop="jobTitle">' . esc_html($curauth->jobTitle) . '</span>';
}
?>
              <?php 
if ($curauth->organisation) {
    echo '<span itemprop="organization">' . esc_html($curauth->organisation) . '</span>';
Ejemplo n.º 18
0
<?php

/**
 * Template Name: Plantilla Membres
 *
 * @package  wp-softcatala
 */
//JS and Styles related to the page
//Template initialization
$title = 'Membres - Softcatalà';
$description = 'Membres, col·laboradors, gent de Softcatalà';
if (!empty($wp_query->query_vars['author'])) {
    $template = array('single-author.twig');
    $author = new TimberUser($wp_query->query_vars['author']);
    $context_holder['author'] = $author;
    $context_holder['author_role'] = get_user_role($author);
    $context_holder['author_content'] = apply_filters('the_content', $author->{'wpcf-descripcio_activitat'});
    $context_holder['author_image'] = get_gravatar_url($author->user_email);
    $context_holder['content_title'] = 'Publicades per ' . $author->name();
    $title = $author->name() . ' - Softcatalà';
    $description = $author->description();
    $projectes_ids = get_user_meta($author->ID, 'projectes', true);
    if ($projectes_ids) {
        $context_holder['projectes'] = array_map(function ($projecte_id) {
            $_projecte = get_post($projecte_id);
            return array('link' => get_post_permalink($projecte_id), 'title' => $_projecte->post_title);
        }, $projectes_ids);
    }
} else {
    $template = array('archive-author.twig');
    $post = new TimberPost();
/**
 * Count the posts
 * 
 * @param $author_id
 * @param $post_type
 * @return array
 */
function user_is($role = null)
{
    if (strtolower($role) != strtolower(get_user_role(null, true))) {
        return false;
    }
    return true;
}
Ejemplo n.º 20
0
function check_min_total()
{
    if (!is_user_logged_in()) {
        return;
    }
    // Only run in the Cart or Checkout pages
    if (is_cart() || is_checkout()) {
        global $woocommerce, $product;
        $total_quantity = 0;
        // Set minimum product cart total
        $minimum_cart_product_total = 0;
        //get current user's role
        $user_role = get_user_role();
        /**
         * role name: actual role
         *
         * distributor:retailer
         * whole_saler:wholesaler
         **/
        if ($user_role == 'distributor') {
            // for retailer
            $minimum_cart_product_total = 2;
        } elseif ($user_role == 'whole_saler') {
            // for wholesaler
            $minimum_cart_product_total = 15;
        } else {
            return;
        }
        //loop through all cart products
        foreach ($woocommerce->cart->cart_contents as $product) {
            //add up all items in the cart
            $haystack = array_values($product['variation']);
            // only check for the box items
            if (in_array("caseof72_300ml", $haystack) || in_array("caseof48_500ml", $haystack)) {
                $total_quantity += $product['quantity'];
            }
        }
        if ($total_quantity < $minimum_cart_product_total) {
            // Display our error message
            wc_add_notice(sprintf('You must have an order with a minimum of %s boxes to place your order, your current order total is %s boxes.', $minimum_cart_product_total, $total_quantity), 'error');
        }
    }
}
Ejemplo n.º 21
0
<?php

include 'core/init.php';
if (!logged_in()) {
    header("Location: index.php");
}
if (!get_user_role($_SESSION['id']) === "ADMIN") {
    header("Location: index.php");
}
include 'templates/header.php';
include 'templates/navbar.php';
include 'templates/remove-user-content.php';
include 'templates/footer.php';
function add_menus()
{
    // Se for author, deixo apenas confirmar inscrições
    if (get_user_role() == 'author') {
        add_menu_page('Inscrições', 'Inscrições', 'read', 'Inscricoes', array('ControllerEventos', 'inscricoes'), 'dashicons-index-card', 6);
    } else {
        add_menu_page('Eventos', 'Eventos', 'edit_pages', 'Eventos', array('ControllerEventos', 'dispatcher'), 'dashicons-calendar-alt', 5);
        // Incluir já eventos no menu
        $eventos = Eventos::getInstance()->getAtuaisERecentes();
        if ($eventos) {
            foreach ($eventos as $evento) {
                add_submenu_page('Eventos', PLib::date_relative($evento->data) . ' - ' . $evento->titulo, PLib::date_relative($evento->data) . ' - ' . $evento->titulo, 'edit_pages', 'Eventos&action=view&id=' . $evento->id, 'AdminPresenca');
            }
        }
        add_menu_page('Inscrições', 'Inscrições', 'read', 'Inscricoes', array('ControllerEventos', 'inscricoes'), 'dashicons-index-card', 6);
        add_menu_page('Pessoas', 'Pessoas', 'edit_pages', 'Pessoas', array('ControllerPessoas', 'dispatcher'), 'dashicons-groups', 7);
        if (TGO_EVENTO_GAMIFICATION === true) {
            add_menu_page('Gamification', 'Gamification', 'edit_pages', 'Gamification', array('ControllerGamification', 'dispatcher'), 'dashicons-smiley', 8);
            add_submenu_page('Gamification', 'Importar Eventos', 'Importar Eventos', 'edit_pages', 'GamificationGDGJF', array('ControllerGamification', 'import'));
            add_submenu_page('Gamification', 'Badges', 'Badges', 'edit_pages', 'badges', array('ControllerGamification', 'dispatcher'));
            add_submenu_page('Gamification', 'Eventos', 'Eventos', 'edit_pages', 'eventos', array('ControllerGamification', 'dispatcher'));
        }
        add_menu_page('Apoio', 'Apoio', 'edit_pages', 'AdminApoio', 'AdminApoio', 'dashicons-nametag', 9);
        add_submenu_page('AdminApoio', 'Tickets de Desconto', 'Tickets de Desconto', 'edit_pages', 'TicketsDesconto', array('ControllerDescontos', 'dispatcher'));
        add_submenu_page('AdminApoio', 'Locais', 'Locais', 'edit_pages', 'Locais', array('ControllerLocais', 'dispatcher'));
        add_submenu_page('AdminApoio', 'Organizadores', 'Organizadores', 'manage_options', 'Organizadores', array('ControllerOrganizadores', 'dispatcher'));
        add_submenu_page('AdminApoio', 'Templates', 'Templates', 'manage_options', 'edit.php?post_type=tgo_template');
        add_submenu_page('AdminApoio', 'Mensagens', 'Mensagens', 'manage_options', 'Mensagens', array('ControllerMensagens', 'dispatcher'));
        add_submenu_page('AdminApoio', 'Integrações', 'Integrações', 'manage_options', 'Integracoes', array('ControllerIntegracoes', 'dispatcher'));
        //    add_submenu_page('AdminApoio', 'Migrar Dados', 'Migrar Dados', 'manage_options', 'MenuConfig', array('AdminConfig', 'adminConfigHome'));
        add_submenu_page('AdminApoio', 'Sincronizar Gateways', 'Sincronizar Gateways', 'manage_options', 'Sincronizar', array('ControllerInscricoes', 'sincronizarGateways'));
    }
    // Actions sem menu
    add_submenu_page(null, 'Categorias', 'Categorias', 'read', 'Categorias', array('ControllerCategorias', 'dispatcher'));
    add_submenu_page(null, 'Inscrições', 'Inscrições', 'read', 'Inscricoes', array('ControllerInscricoes', 'dispatcher'));
    add_submenu_page(null, 'Comunicação', 'Comunicação', 'read', 'Comunicacao', array('ControllerComunicacao', 'dispatcher'));
    add_submenu_page(null, 'Preços', 'Preços', 'read', 'Precos', array('ControllerPrecos', 'dispatcher'));
    add_submenu_page(null, 'Descontos', 'Descontos', 'read', 'Descontos', array('ControllerDescontos', 'dispatcher'));
    add_submenu_page(null, 'Pessoas', 'Pessoas', 'read', 'Pessoas', array('ControllerPessoas', 'dispatcher'));
}