Exemplo n.º 1
0
 function init($mySql, $queries, $lang, $module, $module_dispatch, $idUrl, $categorie, $ss_categorie, $search, $sort, $order, $page)
 {
     $HelperOther = new HelperOther();
     $Updates = new Updates();
     $Action = new Action();
     $entry = $mySql->fetch_row($queries->selectById($mySql, $module_dispatch, $idUrl));
     $getColumn = $queries->selectAll($mySql, $module_dispatch);
     $layout = $Updates->debut($lang, $module, $module_dispatch, $idUrl, $categorie, $ss_categorie, $search, $sort, $order, $page);
     for ($i = 0; $i < $mySql->num_fields($getColumn); $i++) {
         // Boucle sur les colonnes
         $column = $mySql->fetch_field($getColumn);
         $column = $column->name;
         $update = $entry[$i];
         if ($Action->exclusion($module, $column)) {
             $field = $HelperOther->findField($column);
             @(!(include_once 'controller/fields/' . $field . '.class.php'));
             if (class_exists($field)) {
                 $getValue = new $field($lang, $module_dispatch, $update, $column, UPDATE);
                 $update = $getValue->update;
                 $layout .= $Updates->update($update);
             }
         }
     }
     $layout .= $Updates->fin($lang, $module_dispatch);
     return $layout;
 }
Exemplo n.º 2
0
 function init($module, $lang, $idURL, $categorie, $sscategorie, $type, $sort, $order, $page, $search)
 {
     $entry = Db::fetch_row(Query::selectById($idURL));
     $getColumn = Query::selectAll();
     $output = Updates::debut($module, $lang, $categorie, $sscategorie, $sort, $order, $page, $idURL, $search);
     for ($i = 0; $i < Db::num_fields($getColumn); $i++) {
         // Boucle sur les colonnes
         $column = Db::fetch_field($getColumn);
         $column = $column->name;
         $update = $entry[$i];
         $field = Utils::findField($column);
         @(!(include_once 'controller/fields/' . $field . '.class.php'));
         if (class_exists($field)) {
             if ($field == "date") {
                 $update = Utils::dateFr($update);
             }
             $getValue = new $field($lang, $update, $column, $type);
             $update = $getValue->update;
             if ($this->exclusion($sscategorie, $column)) {
                 $output .= Updates::update($update);
             }
         }
     }
     $output .= Updates::fin($module, $lang);
     return $output;
 }
Exemplo n.º 3
0
}
$access = $_SESSION['access'];
if (preg_match("/configurations.php/", $_SERVER['PHP_SELF'])) {
    if ($access != 100) {
        header("Location: index.php");
        echo "<h1>You have no permission</h1>";
    }
}
if ($_SESSION['action'] != "") {
    $allUpdates = Updates::get_updates();
    $index = 0;
    foreach ($allUpdates as $id => $value) {
        $index++;
        if ($index > 10) {
            $curUpdate = new Updates($id);
            if ($curUpdate->get_archived() == 0) {
                $curUpdate->set_archived(1);
                if (!$curUpdate->update()) {
                    echo 'update widget failed. Reason: ' . $curUpdate->get_error();
                }
            }
        }
    }
    $update = new Updates();
    $update->set_action($_SESSION['action']);
    $update->set_username($_SESSION['fullname']);
    $update->set_archived(0);
    if ($update->insert_update()) {
        $_SESSION['action'] = "";
    }
}