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; }
function init($mySql, $queries, $lang, $module, $idUrl) { $HelperOther = new HelperOther(); $Details = new Details(); $Action = new Action(); $entry = $mySql->fetch_row($queries->selectById($mySql, $module, $idUrl)); $getColumn = $queries->selectAll($mySql, $module); $layout = $Details->debut($lang, $module); for ($i = 0; $i < $mySql->num_fields($getColumn); $i++) { $column = $mySql->fetch_field($getColumn); $column = $column->name; $details = $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, $details, $column, DETAIL); $details = $getValue->details; $layout .= $Details->detail($details); } } } $layout .= $Details->fin(); return $layout; }
public function init($mySql, $queries, $lang, $module, $module_dispatch, $categorie, $ss_categorie) { $HelperOther = new HelperOther(); $Adds = new Adds(); $getColumn = $queries->selectAll($mySql, $module_dispatch); $layout = $Adds->debut($lang, $module, $module_dispatch, $categorie, $ss_categorie); for ($i = 0; $i < $mySql->num_fields($getColumn); $i++) { $column = $mySql->fetch_field($getColumn); $column = $column->name; $add = ""; $field = $HelperOther->findField($column); @(!(include_once 'controller/fields/' . $field . '.class.php')); if (class_exists($field)) { $getValue = new $field($lang, $module_dispatch, $add, $column, ADD); $add = $getValue->add; $layout .= $Adds->add($add); } } $layout .= $Adds->fin($lang, $module_dispatch); return $layout; }
function date($lang, $module, $val, $column, $type) { $HelperOther = new HelperOther(); if ($module == TRANSACTION) { $val = $HelperOther->dateFrTime($val); } else { $val = $HelperOther->datefr($val); } $this->liste = stripslashes($val); if ($type == DETAIL || $type == DELETE || $type == ARCHIVE) { $this->details = '<div class="label">' . $lang[$module][$column] . '</div> <input type="text" class="text-small" name="' . $column . '" value="' . $this->liste . '" disabled/>'; } elseif ($type == UPDATE) { $this->update = '<div class="label">' . $lang[$module][$column] . '</div> <input type="text" class="tcal" name="' . $column . '" value="' . $this->liste . '" readonly="readonly"/> <script language="JavaScript"> new tcal ({ "formname": "validateForm", // form name "controlname": "' . $column . '" // input name }); </script> <div class="clear"></div> <div id="validateForm_' . $column . '_errorloc" class="form_error"></div>'; } elseif ($type == ADD) { $this->add = '<div class="label">' . $lang[$module][$column] . '</div> <input type="text" class="tcal" name="' . $column . '" value="" readonly="readonly"/> <script language="JavaScript"> new tcal ({ "formname": "validateForm", // form name "controlname": "' . $column . '" // input name }); </script> <div class="clear"></div> <div id="validateForm_' . $column . '_errorloc" class="form_error"></div>'; } }
public function delete($queries, $module, $id) { $HelperOther = new HelperOther(); $getColumns = $queries->selectAll($this, $module); $column = mysql_fetch_field($getColumns); while ($column) { $column = $column->name; if (isset($_POST[$column])) { $HelperOther->manipulateValues($column); //Mise en forme des donn�es pour la BD $field = $HelperOther->findField($column); if ($field != "txtbox" && $field != "photo") { // Exception sur les injections pour les txtbox, car contenu illimit� $fields[] = "`" . $column . "` = '" . $this->escape($_POST[$column]) . "'"; } else { $fields[] = "`" . $column . "` = '" . mysql_real_escape_string($_POST[$column]) . "'"; } } $column = mysql_fetch_field($getColumns); } // Sauvegarde de la transaction $this->add_transaction_execute(DELETE, $_POST['categorie'], $_POST['ss_categorie']); return $this->executeQuery("UPDATE `" . DB_PREFIX . $module . "` SET `delete_logical` = '1' WHERE `id` = '" . $this->escape($id) . "'"); }
include_once 'model/queries.class.php'; include_once 'view/helper/helper_data.class.php'; include_once 'view/helper/helper_header.class.php'; include_once 'view/helper/helper_layout.class.php'; include_once 'view/helper/helper_pagination.class.php'; include_once 'view/wrapper/classes/listing.class.php'; include_once 'controller/helper/helper_pagination.class.php'; include_once 'controller/helper/helper_other.class.php'; include_once 'controller/helper/helper_mail.class.php'; include_once 'controller/action/action.class.php'; include_once 'controller/action/action_add.class.php'; // Déclarartion des variables $mySql = new MySql(); $queries = new Queries(); $HelperPagination = new HelperPagination(); $HelperOther = new HelperOther(); $HelperLayout = new HelperLayout(); $Action = new Action(); $ActionAdd = new ActionAdd(); $HelperMail = new HelperMail(); if (!empty($var->categorie)) { // Test si une catégorie a été choisie $module_dispatch = $var->module; if ($Action->init($lang, $mySql, $queries, $module_dispatch, $var->submit, $var->action, $var->idUrl)) { // Save, update, delete record $var->module_output .= $Action->output; $var->type = $Action->type; $var->idUrl = $Action->idInsert; } else { $Action->sendNewsletters($lang, $mySql, $queries, $module_dispatch, $HelperMail, $var->sujetSend, $var->contenuSend, $var->groupeSend); $var->module_output .= $Action->output;