예제 #1
0
 public function testShortcutFilter()
 {
     $config = ['coverage' => ['include' => ['tests/*'], 'exclude' => ['tests/unit/CodeGuy.php']]];
     $this->filter->whiteList($config);
     $fileFilter = $this->filter->getFilter();
     $this->assertFalse($fileFilter->isFiltered(codecept_root_dir('tests/unit/c3Test.php')));
     $this->assertTrue($fileFilter->isFiltered(codecept_root_dir('tests/unit/CodeGuy.php')));
 }
예제 #2
0
 /**
  * Method description
  *
  * More detailed method description
  * @param    array $params
  * @return void
  */
 function parseParams(SimpleXMLElement $elem)
 {
     $i = 0;
     foreach ($elem as $c) {
         if ($c->getName() == "check") {
             if (!isset($c['rule'])) {
                 continue;
             }
             $this->rules[$i] = (string) $c['rule'];
             if (isset($c['value'])) {
                 $this->values[$i] = (string) $c['value'];
             }
             if (isset($c['message'])) {
                 $this->messages[$i] = (string) $c['message'];
             } else {
                 $this->messages[$i] = null;
             }
             //else $this->messages[$i] = self::def_message;
             $i++;
         } elseif ($c->getName() == 'filter') {
             if (Filter::getFilter((string) $c) == Filter::NONE) {
                 throw new FilterException('Filter ' . (string) $c . ' doesn\'t exists');
             }
             $this->filter = (string) $c;
         }
     }
     $controller = Controller::getInstance();
     $controller->addScript("jquery.validate.js");
     $controller->addScript("jquery.validate.messages_" . Language::currentName() . ".js");
 }
예제 #3
0
 public function indexation()
 {
     $filter = new Filter();
     $page = $filter->getFilter('page');
     $action = $filter->getFilter('action');
     $step = $filter->getFilter('s');
     if (!isset($page) && !isset($action)) {
         include 'template/bord/bord_bord.php';
     }
     if (isset($page) && !isset($action) && !isset($step)) {
         include 'template/' . $page . '/' . $page . '_' . $page . '.php';
     }
     if (isset($page) && isset($action) && !isset($step)) {
         include 'template/' . $page . '/' . $page . '_' . $action . '.php';
     }
     if (isset($page) && isset($action) && isset($step)) {
         include 'template/' . $page . '/' . $page . '_' . $action . '_' . $step . '.php';
     }
 }
예제 #4
0
<?php 
$db = new Database();
$filter = new Filter();
$index = new Index();
$getMonth = $filter->getFilter('m');
$getDay = $filter->getFilter('d');
$getYear = $filter->getFilter('y');
if ($getMonth || $getYear) {
    $month = $getMonth;
    $year = $getYear;
    $day = $getDay;
} else {
    $month = date("m");
    $year = date("y");
    $day = date("d");
}
$date = new DateTime($year . '-' . $month . '-' . $day);
$dbDate = $date->format('m/d/Y');
$displayDate = $date->format('d-M-Y');
$sessionUserId = $_SESSION[user_id];
$querySelectBalans = "SELECT * FROM `balans` WHERE user_id={$sessionUserId} AND  isDeleted=0 HAVING debet > 0 ORDER BY date DESC LIMIT 30";
$selectUsersBalans = $db->select($querySelectBalans);
?>
<div class='container-full'>

    <div class='panel panel-default'><div class='panel-heading'><b>Betalingen:</b></div>
        <div class='panel-body'>

            <table border="0" class="table table-striped margin: 0px;">
                <tr><td>
예제 #5
0
<div class='container-full'>

    <?php 
$db = new Database();
$index = new Index();
$filter = new Filter();
$id = $filter->getFilter('id');
$querySelectSjaars = "SELECT * FROM sjaarspunt WHERE id='{$id}'";
$selectSjaarsResult = $db->select($querySelectSjaars);
foreach ($selectSjaarsResult as $sjaars) {
    $displayTime = date("H:i", strtotime($sjaars[time]));
    $displayDate = date("d M", strtotime($sjaars[date]));
    $punten = $sjaars[punten];
    $comment = $sjaars[comment];
    $querySelectUser = "******";
    $selectUserResult = $db->select($querySelectUser);
    foreach ($selectUserResult as $user) {
        $uitdeler = $user[naam];
    }
}
?>

    <div class="container-fluid">
        <table class='table table-striped'>
            <tr>
                <td><b><a href='index.php?page=sjaars&action=sjaars'><button class='btn btn-default'><span class='glyphicon glyphicon glyphicon-list-alt' style="color:black"></span></button></b></a></td>
                <td><b><a href='index.php?page=sjaars&action=overview'><button class='btn btn-default'><span class='glyphicon glyphicon-stats' style="color:black"></span></button></b></a></td>
                <td><b><a href='index.php?page=sjaars&action=add'><button class='btn btn-default'><span class='glyphicon glyphicon-plus-sign' style="color:black"></span></button></b></a></td>
                <td><b><a href='index.php?page=sjaars&action=delete'><button class='btn btn-default'><span class='glyphicon glyphicon-minus-sign' style="color:black"></span></button></b></a></td>
            </tr>
예제 #6
0
<div class='container-fluid'>

    <?php 
$db = new Database();
$filter = new Filter();
$index = new Index();
$getId = $filter->getFilter('id');
$submitBtn = $filter->postFilter('submitBtn');
$query = "SELECT * FROM balans WHERE id={$getId}";
$results = $db->select($query);
if ($submitBtn) {
    foreach ($results as $result) {
        $transactionID = $result[transactionID];
    }
    $query = "UPDATE balans SET isDeleted=1 WHERE transactionID={$transactionID}";
    $result = $db->update($query);
    echo "<div class='alert alert-success' role='alert'>Betaling verwijderd!</div>";
    $index->redirect('index.php?page=bord');
} else {
    ?>
        <form action='' method='post'>    
            <div class='alert alert-warning' role='alert'><b>Weet je het zeker?</b></div>
            <div><input type='submit' value='Verwijder' name='submitBtn' class='btn btn-default btn-block'></div>

        </form>
    </div>

    <?php 
}
?>
</div>
예제 #7
0
require_once "lib/DB.class.php";
require_once "lib/Template.class.php";
require_once "lib/Report.class.php";
require_once "lib/Resource.class.php";
require_once "lib/Filter.class.php";
require_once "lib/php-ofc-library/open-flash-chart.php";
$rs = new Resource();
$RS = $rs->enum(array('LIST_CATEGORY'));
if ($_GET['graph_filter']) {
    $plist = explode(";", $_GET['graph_filter']);
    for ($i = 0; $i <= count($plist); $i++) {
        list($k, $v) = explode("=", $plist[$i]);
        $param[$k] = $v;
    }
}
list($filter, $fwhere) = Filter::getFilter($param, '');
foreach ($fwhere as $w) {
    $where .= $w;
}
$categories =& Report::getCategoryDistribution($where);
$category = array();
foreach (array_keys($RS['LIST_CATEGORY']) as $s) {
    if ($categories[$s] && $s) {
        $category[] = new pie_value(intval($categories[$s]), $RS['LIST_CATEGORY'][intval($s)] . " ({$categories[$s]})");
    }
}
#$title = new title('Category Distribution');
$pie = new pie();
$pie->set_alpha(0.7);
$pie->set_start_angle(35);
$pie->add_animation(new pie_fade());
예제 #8
0
<?php

$date = date("d M, Y");
$year = date("Y");
$filter = new Filter();
$week = $filter->getFilter('week');
$getYear = $filter->getFilter('year');
if ($week) {
    $weeknr = $week;
    if ($getYear) {
        $year = $getYear;
    }
} else {
    $weeknr = date("W");
    $year = date("Y");
}
$countStatus[1] = 0;
$countStatus[2] = 0;
$countStatus[3] = 0;
$countStatus[4] = 0;
$countStatus[5] = 0;
$countStatus[6] = 0;
$countStatus[7] = 0;
$prevweek = $weeknr - 1;
$nextweek = $weeknr + 1;
$query1 = "SELECT * FROM user ORDER BY ancenniteit ASC";
$db = new Database();
$results = $db->select($query1);
?>

<div class='container-fluid'>
예제 #9
0
<div class='container-fluid'>
    <?php 
$filter = new Filter();
$title = "Log in";
if ($filter->getFilter('action') == 'forgotpass') {
    include 'template/login_forgotpass.php';
} else {
    $user = $filter->postFilter('user');
    $pass = $filter->postFilter('pass');
    $submit = $filter->postFilter('submit');
    if ($_SESSION['loggedin'] == 1) {
        echo 'Al ingelogd';
    } else {
        if ($submit) {
            $login = new Login();
            $login->checklogIn($user, $pass);
            $url = 'index.php?page=bord';
            $index = new Index();
            $index->redirect($url);
            echo "</div>";
        } else {
            ?>
                <body class="login-bg">

                    <div class="login-card" >
                        <h1>Log-in</h1><br>
                        <form method='post' action=''>
                            <input type="text" required='required' name="user" placeholder="Username">
                            <input type="password" required='required' name="pass" placeholder="Password">
                            <input type="submit" name="submit" class='btn btn-default' value="Login">
                        </form>
예제 #10
0
파일: reports.php 프로젝트: AviMoto/webekci
function rule_report($tmp, $page)
{
    global $RS;
    list($filter, $fwhere) = Filter::getFilter($_POST, $_GET);
    $filters = Filter::getFilters();
    foreach ($fwhere as $w) {
        $where .= $w;
    }
    $total_row =& Report::countRuleRecords($where);
    $navigation = new Navigation($_POST['start'], $_POST['rows'], $_POST['begin'], $_POST['first'], $total_row);
    $start = $navigation->getNavigationStart();
    $rows = $navigation->getNavigationRows();
    $begin = $navigation->getNavigationBegin();
    $first = $navigation->getNavigationFirst();
    $wlimit .= $navigation->getNavigationWhere();
    $audits_a =& Report::getRuleRecords($where, $wlimit);
    $audit_logs = array();
    $total_rows = 0;
    foreach ($audits_a as $alog) {
        $audit_logs[] = array('rule_id' => $alog->getRuleID(), 'rule_id_count' => $alog->getRuleIDCount());
        $total_rows++;
    }
    $tmp->assign('rows', $rows);
    $tmp->assign('ceil', ceil($total_row / $rows));
    $tmp->assign('total_row', $total_row);
    $tmp->assign('begin', $begin);
    $tmp->assign('start', $start);
    $tmp->assign('filters', $filters);
    $tmp->assign('filter', $filter);
    $tmp->assign('data', $audit_logs);
    $tmp->assign('tab_page', $page);
    $tmp->assign('tab', 'rule');
    $tmp->display('reports.tpl');
}
예제 #11
0
 /**
  * Binds filter to the value with given key. 
  * All stored data, snapped to the key will be immediately filtered
  * upon specified type of filter.
  *
  * @param string name of the value to filter
  * @param mixed string or numeric, representing type of the filter
  * @see Filter
  */
 function bindFilter($var_name, $type)
 {
     if (!isset($this->checked_vars[$var_name])) {
         return;
     }
     $this->checked_vars[$var_name] = Filter::apply($this->checked_vars[$var_name], Filter::getFilter($type));
 }
예제 #12
0
<?php

$filter = new Filter();
if ($_SESSION['loggedin'] == 1) {
    $logBtn = '<li><a href="index.php?page=account&id=' . $_SESSION['user_id'] . '"><span class="glyphicon glyphicon-user"></span> ' . $_SESSION['naam'] . '</a></li>' . '<li class="divider"></li>' . '<li><a href="index.php?page=account"><span class="glyphicon glyphicon-wrench"></span> Instellingen</a></li>' . '<li><a href="index.php?page=login&action=logout"><span class="glyphicon glyphicon-log-out"></span> Log uit</a></li>';
} else {
    $logBtn = '<li class="divider"></li>' . '<li><a href="index.php?page=login"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>';
}
$activeBord = '<li><a href="index.php?page=bord"><span class="glyphicon glyphicon-cutlery"></span> Bord</a></li>';
$activeTeken = '<li><a href="index.php?page=bord&action=inteken"><span class="glyphicon glyphicon-pencil"></span> Intekenen</a></li>';
$activeBalans = '<li><a href="index.php?page=balans"><span class="glyphicon glyphicon-euro"></span> Balans</a></li>';
$activeSjaars = '<li><a href="index.php?page=sjaars"><span class="glyphicon glyphicon-thumbs-up"></span> Sjaarzenpunten</a></li>';
if ($filter->getFilter('page')) {
    $page = $filter->getFilter('page');
    $action = $filter->getFilter('action');
    if ($page == 'bord' && !isset($action)) {
        $activeBord = '<li class="active"><a href="index.php?page=bord"><span class="glyphicon glyphicon-cutlery"></span> Bord</a></li>';
    } else {
        $activeBord = '<li><a href="index.php?page=bord"><span class="glyphicon glyphicon-cutlery"></span> Bord</a></li>';
    }
    if ($page == 'bord' && $action == 'inteken') {
        $activeTeken = '<li class="active"><a href="index.php?page=bord&action=inteken"><span class="glyphicon glyphicon-pencil"></span> Intekenen</a></li>';
    } else {
        $activeTeken = '<li><a href="index.php?page=bord&action=inteken"><span class="glyphicon glyphicon-pencil"></span> Intekenen</a></li>';
    }
    if ($page == 'balans') {
        $activeBalans = '<li class="active"><a href="index.php?page=balans"><span class="glyphicon glyphicon-euro"></span> Balans</a></li>';
    } else {
        $activeBalans = '<li><a href="index.php?page=balans"><span class="glyphicon glyphicon-euro"></span> Balans</a></li>';
    }
    if ($page == 'sjaars') {
예제 #13
0
<div class='container-fluid'>

    <?php 
$index = new Index();
$db = new Database();
$filter = new Filter();
$db->connect();
$days = array("Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag", "Zondag");
$days_abbr = array("M", "D", "W", "D", "V", "Z", "Z");
$date = date("d M, Y");
$user_id = $_SESSION['user_id'];
$user_naam = $_SESSION['naam'];
if ($filter->getFilter('week')) {
    $weeknr = $filter->getFilter('week');
    $year = date("Y");
} else {
    if ($filter->getFilter('year')) {
        $year = $filter->getFilter('year');
        $weeknr = date("W");
    } else {
        $weeknr = date("W");
        $year = date("Y");
    }
}
$prevweek = $weeknr - 1;
$nextweek = $weeknr + 1;
if ($filter->postFilter('submit')) {
    for ($day = 1; $day <= 7; $day++) {
        $insertStatus[$day] = $filter->postFilter('radio_' . $day);
        $insertGuests[$day] = $filter->postFilter('select_' . $day);
        $date = date('m/d/Y', strtotime($year . "W" . $weeknr . $day));
예제 #14
0
<div class="container-full">

    <?php 
$filter = new Filter();
$db = new Database();
$date = date("d M, Y");
$year = date("Y");
$sessionUserId = $_SESSION['user_id'];
$balansId = $filter->getFilter('id');
$querySelectBalans = "SELECT * FROM balans WHERE id={$balansId}";
$results = $db->select($querySelectBalans);
foreach ($results as $result) {
    $transactionId = $result['transactionID'];
    $transactionDate = $result['date'];
}
$querySelectBalansCounts = "SELECT COUNT(user_id) as userCount FROM balans WHERE date='{$transactionDate}'";
$results3 = $db->select($querySelectBalansCounts);
foreach ($results3 as $result3) {
    $personCount = $result3['userCount'];
}
$querySelectEntryGuests = "SELECT SUM(guest) as guestCount FROM entry WHERE date='{$transactionDate}'";
$results4 = $db->select($querySelectEntryGuests);
foreach ($results4 as $result4) {
    $guestCount = $result4['guestCount'];
}
$totalCount = $personCount + $guestCount;
$time = strtotime($transactionDate);
$easyDate = date('j F Y', $time);
?>

    <table border ="0" class="table table-striped">