function index()
 {
     $args = func_get_args();
     if (count($args) == 2) {
         $page = $args[0];
         $search = $args[1];
     } elseif (count($args) == 1) {
         $page = $args[0];
         $search = '';
     } else {
         $page = 1;
         $search = '';
     }
     if (!$page) {
         $page = 1;
     }
     if ($search) {
         $search = urldecode($search);
     }
     $show_search = $search;
     if ($this->per_page) {
         $total_count = $this->model->count_all();
         if ($search) {
             $show_search = $this->_parse_search($search);
         }
         $matched_count = $this->model->count_all();
         $pager_config = array('per_page' => $this->per_page, 'total_rows' => $matched_count);
         if ($search) {
             $pager_config['uri_segment'] = 5;
             $pager_config['base_url'] = ci_site_url(array($this->conf['path'], 'search', $search));
         } else {
             $pager_config['uri_segment'] = 3;
             $pager_config['base_url'] = ci_site_url($this->conf['path']);
         }
         $this->pagination->initialize($pager_config);
         $this->model->db->offset(($page - 1) * $this->per_page);
         $this->model->db->limit($this->per_page);
     }
     if ($search) {
         $show_search = $this->_parse_search($search);
     }
     $this->data['search'] = $search;
     $this->data['show_search'] = $show_search;
     $this->data['total_count'] = $total_count;
     $this->data['matched_count'] = $matched_count;
     $this->data['entries'] = $this->model->get_all();
     $this->data['include'] = $this->conf['path'] . '/index';
     if (!$this->no_load_view) {
         $this->load->view($this->template, $this->data);
     }
 }
Example #2
0
 function ci_anchor($uri = '', $title = '', $attributes = '')
 {
     $title = (string) $title;
     if (!is_array($uri)) {
         $site_url = !preg_match('!^\\w+://! i', $uri) ? ci_site_url($uri) : $uri;
     } else {
         $site_url = ci_site_url($uri);
     }
     if ($title == '') {
         $title = $site_url;
     }
     if ($attributes != '') {
         $attributes = _parse_attributes($attributes);
     }
     return '<a href="' . $site_url . '"' . $attributes . '>' . $title . '</a>';
 }
Example #3
0
    function index()
    {
        $target1 = ci_site_url(array('load', urlencode('Moscow, Russia')));
        $html = <<<EOT
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
</head>
<body>
<script type="text/javascript" src="{$target1}"></script>
</body>
</html>

EOT;
        echo $html;
    }
 function __construct()
 {
     parent::__construct();
     if ($this->input->server('SERVER_NAME') == 'localhost') {
         //			$this->output->enable_profiler(TRUE);
     }
     $detect = new lprMobileDetect();
     $this->is_mobile = $detect->isMobile();
     $this->load->database();
     $this->load->helper(array('url'));
     $skip_setup = array('setup', 'demo');
     if (!in_array($this->router->fetch_class(), $skip_setup) and !$this->is_setup()) {
         ci_redirect('setup');
     }
     $this->load->helper(array('language', 'form'));
     $this->load->helper(array('hitcode'));
     $this->load->library(array('form_validation', 'session'));
     $this->form_validation->set_error_delimiters('<div class="hc-form-error">', '</div>');
     // table
     $this->load->library('table');
     $table_tmpl = array('table_open' => '<table class="table table-striped">');
     $this->table->set_template($table_tmpl);
     // pagination
     $this->load->library('pagination');
     // conf
     $this->load->library('simple_auth', NULL, 'auth');
     $app_core = $this->config->item('nts_app_core') ? $this->config->item('nts_app_core') : $this->config->item('nts_app');
     $this->load->library('app_conf');
     $my_language = $this->app_conf->get('language');
     if (!file_exists(APPPATH . '/language/' . $my_language)) {
         $my_language = 'english';
     }
     $this->lang->load($app_core, $my_language);
     $this->data = array();
     $this->data['page_title'] = $this->config->item('nts_app_title');
     $this->data['message'] = $this->session->flashdata('message');
     $this->data['error'] = $this->session->flashdata('error');
     if (isset($GLOBALS['NTS_IS_PLUGIN']) && $GLOBALS['NTS_IS_PLUGIN'] == 'wordpress') {
         wp_localize_script('lctrScript1', 'url_prefix', ci_site_url('front/get'));
         wp_localize_script('lctrScript_front', 'lpr_vars', array('conf_trigger_autodetect' => $this->app_conf->get('trigger_autodetect') ? $this->app_conf->get('trigger_autodetect') : 0, 'conf_append_search' => $this->app_conf->get('append_search'), 'start_listing' => $this->app_conf->get('start_listing') ? 1 : 0, 'map_scrollwheel' => $this->app_conf->get('map_no_scrollwheel') ? FALSE : TRUE, 'show_print_link' => $this->app_conf->get('show_print_link'), 'show_matched_locations' => $this->app_conf->get('show_matched_locations')));
     }
 }
Example #5
0
    function index()
    {
        ci_redirect('');
        return;
        $target1 = ci_site_url('load');
        $html = <<<EOT
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
</head>
<body>
<script type="text/javascript" src="{$target1}"></script>
</body>
</html>

EOT;
        echo $html;
    }
Example #6
0
if ($object->user_id) {
    if ($conflicts) {
        $tabs['conflicts'] = '<i class="fa fa-exclamation-circle text-danger"></i> ' . lang('shift_conflicts');
        ob_start();
        require dirname(__FILE__) . '/edit_conflicts.php';
        $tab_content['conflicts'] = ob_get_contents();
        ob_end_clean();
    } else {
        $tabs['_conflicts'] = '<i class="fa fa-check text-success"></i> ' . lang('shift_no_conflicts');
    }
}
/* NOTES */
if ($this->hc_modules->exists('notes')) {
    $notes_count = $object->note->count();
    $tabs['notes'] = '<i class="fa fa-comment-o"></i> ' . lang('common_notes') . ' [' . $notes_count . ']';
    $tab_content['notes'] = array('content' => Modules::run('notes/admin/index', 'shift', $object->id), 'attr' => array('class' => 'hc-target', 'data-src' => ci_site_url(array('notes/admin/index', 'shift', $object->id))));
}
/* TRADES */
if ($user_id && $object->has_trade && $this->hc_modules->exists('shift_trades')) {
    $trade_menu = Modules::run('shift_trades/admin/trade_actions', $object);
    if ($trade_menu) {
        $tabs['trades'] = $trade_menu;
    }
}
/* HISTORY */
if ($this->hc_modules->exists('logaudit')) {
    $tabs['history'] = '<i class="fa fa-list-ul"></i> ' . lang('common_history');
    $tab_content['history'] = Modules::run('logaudit/admin/index', $object);
}
/* DELETE SERIES */
if ($group_count > 1 && $this->hc_modules->exists('shift_groups')) {
Example #7
0
				<li>
					<a href="<?php 
    echo ci_site_url('admin/install');
    ?>
"><?php 
    echo lang('menu_install');
    ?>
</a>
				</li>

				<?php 
    if (!isset($GLOBALS['NTS_IS_PLUGIN'])) {
        ?>
					<li>
						<a href="<?php 
        echo ci_site_url('admin/install/preview');
        ?>
"><?php 
        echo lang('menu_preview');
        ?>
</a>
					</li>
				<?php 
    }
    ?>

				<?php 
    if ($promo) {
        ?>
					<li>
						<a target="_blank" href="<?php 
Example #8
0
    foreach ($locations as $lid => $loc) {
        if (isset($temp_count_by_location[$lid])) {
            $count_by_location[$lid] = $temp_count_by_location[$lid];
        }
    }
    ?>
	<?php 
    if (count($count_by_location) > 1) {
        ?>
		<ul class="list-inline list-separated">
		<?php 
        foreach ($count_by_location as $lid => $count) {
            ?>
			<li>
				<a href="<?php 
            echo ci_site_url(array($this->conf['path'], 'index', 'display', 'pickup', 'location', $lid));
            ?>
" class="btn btn-default">
					<i class="fa fa-home"></i> <?php 
            echo $locations[$lid]->name;
            ?>
 [<?php 
            echo $count;
            ?>
]
					<?php 
            if ($locations[$lid]->description) {
                ?>
						<br>
						<span class="text-muted"><?php 
                echo $locations[$lid]->description;
<?php

if ($this->auth->logged_in() && $this->auth->is_admin()) {
    $userdata = $this->auth->get_userdata();
    ?>
<div>
	<small>
	<?php 
    echo lang('logged_in_as');
    ?>
: <a href="<?php 
    echo ci_site_url('auth/profile');
    ?>
"><?php 
    echo $userdata['identity'];
    ?>
</a>
	<a href="<?php 
    echo ci_site_url('auth/logout');
    ?>
"><?php 
    echo lang('menu_logout');
    ?>
</a>
	</small>
</div><!-- /profile -->
<?php 
}
Example #10
0
<?php 
echo form_open('auth/login', array('class' => 'form-horizontal form-condensed'));
?>

<?php 
echo Hc_html::wrap_input($identity_label, $this->hc_form->build_input($identity));
?>

<?php 
echo Hc_html::wrap_input(lang('common_password'), $this->hc_form->build_input($password));
?>

<?php 
echo Hc_html::wrap_input('', form_submit(array('name' => 'submit', 'class' => 'btn btn-default'), 'Login'));
?>

<?php 
echo form_close();
?>

<p>
	<a href="<?php 
echo ci_site_url('auth/forgot_password');
?>
">
		<?php 
echo lang('auth_login_form_forgot_password');
?>
	</a>
</p>
Example #11
0
		<?php 
    if ($this_method != 'login') {
        ?>
			<a href="<?php 
        echo ci_site_url('auth/login');
        ?>
">
				<i class="fa fa-sign-in"></i> <?php 
        echo lang('login');
        ?>
			</a>
		<?php 
    } else {
        ?>
			<a href="<?php 
        echo ci_site_url('');
        ?>
">
				<?php 
        echo lang('common_home');
        ?>
			</a>
		<?php 
    }
    ?>
		</li>
	</ul>
<?php 
}
?>
</div>
Example #12
0
">
			&lt;&lt;
		</a>
	</li>
	<li class="active">
		<?php 
$link_params = array('start', $start_date);
$link_params = array_merge($base_link_params, $link_params);
?>
		<a href="<?php 
echo ci_site_url($link_params);
?>
">
			<?php 
echo $nav_title;
?>
		</a>
	</li>
	<li>
		<?php 
$link_params = array('start', $next_date);
$link_params = array_merge($base_link_params, $link_params);
?>
		<a href="<?php 
echo ci_site_url($link_params);
?>
">
			&gt;&gt;
		</a>
	</li>
</ul>
Example #13
0
<?php

$status_params = array('admin/schedules/status', 'start', $start_date, 'end', $end_date);
if ($filter == 'staff') {
    $status_params[] = 'staff';
    $status_params[] = $current_staff->id;
} elseif ($filter == 'location') {
    $status_params[] = 'location';
    $status_params[] = $current_location->id;
}
?>
<div class="hc-page-status" data-src="<?php 
echo ci_site_url($status_params);
?>
">
	<?php 
echo call_user_func_array('Modules::run', $status_params);
?>
</div>
Example #14
0
<script type="text/javascript" src="<?php 
echo ci_site_url('load');
?>
"></script>
Example #15
0
 private function _prepare_menu()
 {
     $order = 1;
     $menu_keys = array_keys($this->menu);
     reset($menu_keys);
     $active_k = '';
     foreach ($menu_keys as $k) {
         if (!is_array($this->menu[$k])) {
             $this->menu[$k] = array('title' => $this->menu[$k]);
         }
         if (!isset($this->menu[$k]['order'])) {
             $this->menu[$k]['order'] = $order++;
         }
         if (!(isset($this->menu[$k]['external']) && $this->menu[$k]['external'] or isset($this->menu[$k]['href']) && $this->menu[$k]['href'])) {
             switch ($this->engine) {
                 case 'ci':
                     $this->menu[$k]['slug'] = $this->menu[$k]['link'];
                     $this->menu[$k]['href'] = ci_site_url($this->menu[$k]['link']);
                     break;
                 case 'nts':
                     if (!isset($this->menu[$k]['panel'])) {
                         $this->menu[$k]['panel'] = $k;
                     }
                     $this->menu[$k]['slug'] = $this->menu[$k]['panel'];
                     $this->menu[$k]['href'] = ntsLink::makeLink($this->menu[$k]['panel'], '', array(), FALSE, TRUE);
                     break;
             }
         }
         if ($this->disabled && !(isset($this->menu[$k]['external']) && $this->menu[$k]['external'])) {
             $this_slug = $this->menu[$k]['slug'];
             if (in_array($this_slug, $this->disabled)) {
                 //					echo "DISABLE " . $this->menu[$k]['slug'] . '<br>';
                 unset($this->menu[$k]);
             } else {
                 /* also check if a parent is disabled */
                 foreach ($this->disabled as $ds) {
                     if (substr($this_slug, 0, strlen($ds)) == $ds) {
                         unset($this->menu[$k]);
                         break;
                     }
                 }
             }
         }
         /* check if current */
         if ($this->current && !$active_k) {
             $slug = isset($this->menu[$k]['slug']) ? $this->menu[$k]['slug'] : '';
             $current = $this->current;
             if ($current == $slug or substr($current, 0, strlen($slug)) == $slug && substr($current, strlen($slug), 1) == '/') {
                 $active_k = $k;
             }
         }
     }
     /* set current */
     if ($active_k) {
         reset($menu_keys);
         foreach ($menu_keys as $k) {
             if ($k == $active_k or substr($active_k, 0, strlen($k)) == $k && substr($active_k, strlen($k), 1) == '/') {
                 $this->menu[$k]['active'] = TRUE;
             }
         }
     }
     uasort($this->menu, create_function('$a, $b', 'return ($a["order"] - $b["order"]);'));
 }
Example #16
0
if ($filter != 'all') {
    $dmenu[] = array('href' => ci_site_url($base_link_params), 'title' => '<i class="fa fa-sitemap"></i> ' . lang('common_overall'));
}
if ($location_count > 1) {
    $dmenu[] = array('title' => lang('location'));
    foreach ($locations as $location) {
        if ('location' == $filter && $location->id == $current_location->id) {
            continue;
        }
        $link_params = array('filter', 'location', 'id', $location->id);
        $link_params = array_merge($base_link_params, $link_params);
        $dmenu[] = array('href' => ci_site_url($link_params), 'title' => '<i class="fa fa-home"></i> ' . $location->title());
    }
}
if ($staff_count > 1) {
    $dmenu[] = array('title' => lang('user_level_staff'));
    foreach ($working_staff as $staff) {
        if ('staff' == $filter && $staff->id == $current_staff->id) {
            continue;
        }
        $link_params = array('filter', 'staff', 'id', $staff->id);
        $link_params = array_merge($base_link_params, $link_params);
        $dmenu[] = array('href' => ci_site_url($link_params), 'title' => '<i class="fa fa-user"></i> ' . $staff->title());
    }
}
?>
	<?php 
echo Hc_html::dropdown_menu($dmenu);
?>
 
</li>
Example #17
0
    echo ci_site_url(array($this->conf['path'], 'delete', $e->id));
    ?>
" title="<?php 
    echo lang('common_delete');
    ?>
">
		&times;
	</a>
<?php 
}
?>

<ul class="list-unstyled">
	<li>
		<a href="<?php 
echo ci_site_url(array($this->conf['path'], 'edit', $e->id));
?>
" title="<?php 
echo lang('common_edit');
?>
">
			<?php 
echo $e->name;
?>
		</a>
	</li>

	<li class="text-muted">
		id: <?php 
echo $e->id;
?>
 function redirect($to)
 {
     if ($this->input->is_ajax_request()) {
         //			if( $this->input->post() )
         //			{
         // clear flash
         $this->session->set_flashdata('message', NULL);
         $this->session->set_flashdata('error', NULL);
         //			}
         $to = ci_site_url($to);
         $out = array('redirect' => $to);
         $this->output->set_content_type('application/json');
         $this->output->enable_profiler(FALSE);
         echo json_encode($out);
         hc_ci_before_exit();
         exit;
         //			return;
     } else {
         ci_redirect($to);
         return;
     }
     return;
 }
Example #19
0
    function index($search = '', $search2 = '')
    {
        $html = '';
        $content_type = 'text/javascript';
        header("Content-type: {$content_type}");
        $app = $this->config->item('nts_app');
        $assets_dir = isset($GLOBALS['NTS_CONFIG'][$app]['ASSETS_DIR']) ? $GLOBALS['NTS_CONFIG'][$app]['ASSETS_DIR'] : ci_base_url('assets');
        $css = array($assets_dir . '/bootstrap/css/_bootstrap.css', $assets_dir . '/css/lpr.css');
        $js = array($assets_dir . '/bootstrap/js/bootstrap.min.js', 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true', 'http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js', $assets_dir . '/js/lpr.js', $assets_dir . '/js/hc-load.js');
        if (!(isset($GLOBALS['NTS_IS_PLUGIN']) && $GLOBALS['NTS_IS_PLUGIN'] == 'wordpress')) {
            array_unshift($js, $assets_dir . '/js/jquery-1.8.3.min.js');
        }
        if ($search2) {
            $target = ci_site_url(array('front/start', $search, $search2));
        } else {
            $target = ci_site_url(array('front/start', $search));
        }
        $html .= <<<EOT
var hc_target = "{$target}";

EOT;
        if (!$search) {
            $html .= <<<EOT
var lpr_search = hc_get_param('lpr-search');
var lpr_search2 = hc_get_param('lpr-search2');

if( lpr_search && lpr_search2 )
\thc_target = hc_target + '/' + lpr_search + '/' + lpr_search2;
else if( lpr_search )
\thc_target = hc_target + '/' + lpr_search;

EOT;
        }
        $html .= <<<EOT
function hc_get_param( name )
{
\tname = name.replace(/[\\[]/,"\\\\[").replace(/[\\]]/,"\\\\]");
\tvar regexS = "[\\?&]"+name+"=([^&#]*)";
\tvar regex = new RegExp( regexS );
\tvar results = regex.exec( window.location.href );
\tif( results == null )
\t\treturn "";
\telse
\t\treturn results[1];
}

function hc_if_loaded( src, targetelement, targetattr )
{
\tvar allsuspects = document.getElementsByTagName(targetelement);
\tvar skip_me = false;
\tfor( var i = allsuspects.length; i >= 0; i-- )
\t{
\t\tif( allsuspects[i] && (allsuspects[i].getAttribute(targetattr) != null) && (allsuspects[i].getAttribute(targetattr).indexOf(src) != -1) )
\t\t{
\t\t\tskip_me = true;
\t\t\tbreak;
\t\t}
\t}
\treturn skip_me;
}

function hc_get_js( src )
{
\tif( ! hc_if_loaded(src, 'script', 'src') )
\t{
\t\tdocument.writeln('<' + 'script src="' + src + '"' + ' type="text/javascript"><' + '/script>');
\t}
}

function hc_append_js( src )
{
\tif( ! hc_if_loaded(src, 'script', 'src') )
\t{
\t\tvar fileref=document.createElement('script')
\t\tfileref.setAttribute("type","text/javascript")
\t\tfileref.setAttribute("src", src)
\t\tdocument.getElementsByTagName('head')[0].appendChild( fileref );
\t}
}

function hc_get_css( src )
{
\tif( ! hc_if_loaded(src, 'link', 'href') )
\t{
\t\tvar fileref = document.createElement('link');
\t\tfileref.setAttribute( 'rel', 'stylesheet' );
\t\tfileref.setAttribute( 'type', 'text/css' );
\t\tfileref.setAttribute( 'href', src );
\t\tdocument.getElementsByTagName('head')[0].appendChild( fileref );
\t}
}

EOT;
        reset($css);
        foreach ($css as $f) {
            $html .= "hc_get_css('{$f}');\n";
        }
        foreach ($js as $f) {
            $html .= "hc_get_js('{$f}');\n";
        }
        $html .= <<<EOT
EOT;
        /* also include js init */
        $js_init = $this->load->view('front_js', '', true);
        $html .= $js_init;
        echo $html;
        exit;
    }
<?php 
$brand_title = $this->config->item('nts_app_title');
?>
<p>
Thank you for installing <strong><?php 
echo $brand_title;
?>
</strong>! Please now proceed to the <a href="<?php 
echo ci_site_url();
?>
">start page</a>.
</p>

<META http-equiv="refresh" content="5;URL=<?php 
echo ci_site_url();
?>
">

<?php 
$localhost = $this->input->server('SERVER_NAME') != 'localhost' ? FALSE : TRUE;
$track_setup = '';
$app = isset($GLOBALS['NTS_CONFIG']['_app_']) ? $GLOBALS['NTS_CONFIG']['_app_'] : 'lookuprunner';
switch ($app) {
    case 'locatoraid':
        $track_setup = '17:2';
        break;
    case 'lookuprunner':
        $track_setup = '4:2';
        break;
}
Example #21
0
        }
        ?>
			</a>
		</li>
	<?php 
    }
    ?>
	</ul>
	<?php 
    return;
}
?>

<?php 
foreach ($dates as $date) {
    ?>
	<?php 
    $this_day_slot = array('wall/day', $date);
    ?>
	<div class="thumbnail">
		<div class="_hc-target" data-src="<?php 
    echo ci_site_url($this_day_slot);
    ?>
">
			<?php 
    echo call_user_func_array('Modules::run', $this_day_slot);
    ?>
		</div>
	</div>
<?php 
}
Example #22
0
    $label = $this->{$this->model}->prop_text('status', FALSE, $t);
    $label .= ' [' . $count . ']';
    ?>
			<?php 
    echo ci_anchor(array($this->conf['path'], 'index', $t), $label, 'title="' . $this->{$this->model}->prop_text('status', FALSE, $t) . '"');
    ?>
		</li>
	<?php 
}
?>

	<li class="divider">&nbsp;</li>

	<li>
		<a href="<?php 
echo ci_site_url(array($this->conf['path'], 'add'));
?>
">
			<i class="fa fa-plus text-success"></i> <?php 
echo lang('common_add');
?>
		</a>
	</li>
</ul>

<?php 
require NTS_SYSTEM_APPPATH . 'views/_boilerplate/index.php';
?>

<?php 
echo form_close();
Example #23
0
$title = join('', $final_title);
?>
<div class="<?php 
echo $class;
?>
">
	<?php 
echo $title;
?>

	<?php 
if ($today <= $sh->date && $this->auth && $this->auth->user()) {
    ?>
		<?php 
    if (!$sh->user_id && $this->app_conf->get('staff_pick_shifts') or $sh->has_trade && $this->hc_modules->exists('shift_trades')) {
        ?>
			<a class="btn btn-default btn-sm" href="<?php 
        echo ci_site_url(array('staff/shifts', 'pickup', $sh->id));
        ?>
">
				<i class="fa fa-check text-success"></i> <?php 
        echo lang('shift_pick_up');
        ?>
			</a>
		<?php 
    }
    ?>
	<?php 
}
?>
</div>
Example #24
0
<?php

$menu = array();
if ($is_my) {
    if ($sh->has_trade) {
        $menu[] = array('title' => '<i class="fa fa-exchange text-danger"></i> ' . lang('trade_recall'), 'href' => ci_site_url(array('shift_trades/staff', 'recall', $sh->id)));
    } else {
        $menu[] = array('title' => '<i class="fa fa-exchange"></i> ' . lang('shift_list_trade'), 'href' => ci_site_url(array('shift_trades/staff', 'trade', $sh->id)));
    }
}
?>

<?php 
if (!$is_my) {
    ?>
	<li>
		<i class="fa-fw fa fa-user"></i> <?php 
    echo $sh->user->get()->title();
    ?>
	</li>
<?php 
}
?>

<?php 
if (count($menu) == 1) {
    ?>
	<?php 
    list($title, $title_icon) = Hc_lib::parse_icon($menu[0]['title']);
    ?>
	<li>
$menu = array();
/* MENU - EDIT */
$icon = $conflicts ? '<i class="fa fa-exclamation-circle text-danger" title="' . lang('shift_conflicts') . '"></i>' : '<i class="fa fa-edit"></i>';
$menu[] = array('href' => ci_site_url(array('admin/timeoffs/edit', $to->id)), 'title' => $icon . ' ' . lang('common_edit'), 'class' => 'hc-parent-loader');
/* MENU - STATUS */
$menu[] = '-divider-';
if ($to->status != TIMEOFF_MODEL::STATUS_ACTIVE) {
    $menu[] = array('href' => ci_site_url(array('admin/timeoffs/save', $to->id, 'status', TIMEOFF_MODEL::STATUS_ACTIVE)), 'title' => '<i class="fa fa-check-square-o text-success"></i> ' . lang('common_approve'));
} else {
    $menu[] = array('href' => ci_site_url(array('admin/timeoffs/save', $to->id, 'status', TIMEOFF_MODEL::STATUS_PENDING)), 'title' => '<i class="fa fa-eye text-warning"></i> ' . $to->prop_text('status', FALSE, TIMEOFF_MODEL::STATUS_PENDING));
}
/* MENU - DENY */
$menu[] = array('href' => ci_site_url(array('admin/timeoffs/save', $to->id, 'status', TIMEOFF_MODEL::STATUS_DENIED)), 'title' => '<i class="fa fa-thumbs-o-down text-muted"></i> ' . lang('common_reject'));
/* MENU - DELETE */
$menu[] = '-divider-';
$menu[] = array('href' => ci_site_url(array('admin/timeoffs/delete', $to->id)), 'title' => '<i class="fa fa-times text-danger"></i> ' . lang('common_delete'), 'class' => 'hc-confirm');
?>

<?php 
if (!isset($_skip_title)) {
    ?>
<a class="<?php 
    echo $class;
    ?>
" href="#" data-toggle="dropdown">
	<?php 
    echo $title;
    ?>
</a>
<?php 
}
        function front_view()
        {
            if ($this->load_by_js) {
                $target = ci_site_url('load');
                $html = <<<EOT
{$url}
<script type="text/javascript" src="{$target}"></script>
EOT;
                return $html;
            } else {
                if (isset($GLOBALS['NTS_CONFIG'][$this->app]['ACTION_STARTED']) && $GLOBALS['NTS_CONFIG'][$this->app]['ACTION_STARTED']) {
                    $ci =& ci_get_instance();
                    $output = $ci->output->get_output();
                    return $output;
                } else {
                    global $post;
                    $link = get_permalink($post);
                    $title = get_the_title($post->ID);
                    echo '<a href="' . $link . '">' . $title . '</a>';
                }
            }
        }
Example #27
0
	<?php 
    $tabs = array('week' => '' . lang('time_week'), 'month' => '' . lang('time_month'));
    ?>

	<ul class="nav nav-tabs">
	<?php 
    foreach ($tabs as $k => $l) {
        ?>
		<li<?php 
        if ($k == $display) {
            echo ' class="active"';
        }
        ?>
>
			<a href="<?php 
        echo ci_site_url(array($this->conf['path'], 'staff', $staff->id, $k));
        ?>
">
				<?php 
        echo $l;
        ?>
			</a>
		</li>
	<?php 
    }
    ?>
	</ul>

	<?php 
    krsort($dates);
    ?>
 function redirect($uri = '', $method = 'location', $http_response_code = 302)
 {
     if (!preg_match('#^https?://#i', $uri)) {
         $uri = ci_site_url($uri);
     }
     switch ($method) {
         case 'refresh':
             header("Refresh:0;url=" . $uri);
             break;
         default:
             header("Location: " . $uri, TRUE, $http_response_code);
             break;
     }
     exit;
 }
Example #29
0
<?php

$tabs = array('my' => lang('shift_next'));
$tabs['list'] = lang('stats');
if ($this->hc_modules->exists('shift_trades')) {
    $tabs['pickup'] = lang('shift_pick_up');
}
?>
<ul class="nav nav-tabs">
<?php 
foreach ($tabs as $k => $l) {
    ?>
	<li<?php 
    if ($k == $display) {
        echo ' class="active"';
    }
    ?>
>
		<a href="<?php 
    echo ci_site_url(array($this->conf['path'], 'index', 'display', $k));
    ?>
">
			<?php 
    echo $l;
    ?>
		</a>
	</li>
<?php 
}
?>
</ul>
Example #30
0
<?php 
foreach ($grouped_shifts as $key => $sha) {
    ?>
	<?php 
    list($this_start, $this_end) = explode('_', $key);
    ?>

	<?php 
    foreach ($sha as $lid => $shs) {
        ?>

		<?php 
        foreach ($shs as $sh) {
            ?>
			<?php 
            $delete_url = ci_site_url(array('admin/shifts/delete/' . $sh->id));
            ?>
			<li>
				<?php 
            $titles = array();
            if ($location_count > 1) {
                $titles[] = 'location';
            }
            $titles[] = 'staff';
            $titles[] = 'time';
            require dirname(__FILE__) . '/_shift_dropdown.php';
            ?>
			</li>
		<?php 
        }
        ?>