$formList->where .= " AND jj='" . $F__jour . "'"; $groupby = ""; } if ($groupby == "") { $formList->fields = "jj AS element, count(id) AS cpt, sum(nb_aff) AS cpt_nb_aff, sum(nb_click) AS cpt_nb_click"; $formList->orderby = $orderby; } else { $formList->fields = "{$groupby} AS element, count(id) AS cpt, sum(nb_aff) AS cpt_nb_aff, sum(nb_click) AS cpt_nb_click"; $formList->groupby = $groupby; $listCols[0]["label"] = $label; } // // // Filtres /////////////////////////////////////// ???? // $formList->clause_where(); $count_datas = $formList->get_datas(); //echoa($formList->datasList); $barmax = 600; $affmax = 0; if (count($formList->datasList) > 0) { foreach ($formList->datasList as $keyId => $datas) { if ($datas["cpt_nb_aff"] > $affmax) { $affmax = $datas["cpt_nb_aff"]; } } include DOS_INCPAGES_ADMIN . "list-beforeLoop.php"; $listRow = array(); foreach ($formList->datasList as $keyId => $datas) { $valeurs = array(); include DOS_INCPAGES_ADMIN . "list-inLoop.php";
public function maj_media_inside($idParent) { global $myAdmin; global $__POST; global $idCurrent; global $thisSite; $copy__POST = $__POST; $copy__POST2 = $__POST; foreach ($copy__POST as $field => $val) { // on cherche les champs commencant par fieldMedia__ qui indique qu'il y a des champs médias if (strpos($field, "fieldMedia__") === 0) { $liste = unserialize($val); if ($liste["type"] == "video") { $type = $liste["type"] . "-" . $copy__POST["typeVideo"]; } else { $type = $liste["type"]; } //echoa("<hr>"); //echoa($type); //echoa($liste["field_media"]); //echoa($__POST); $field_media = $liste["field_media"]; $idMedia = $liste["idMedia"]; $prefixe = substr($field, strlen("fieldMedia__"), 100) . "__"; $len_prefixe = strlen($prefixe); // on vide avant de remplir avec les données d'un nouveau média $__POST["fichier_media"] = ""; $__POST["titre_media"] = ""; $__POST["fichier_destination"] = ""; $__POST["lien_destination"] = ""; $__POST["cible_destination"] = ""; if (count($myAdmin->LIST_LANG_DATAS) > 1) { foreach ($myAdmin->LIST_LANG_DATAS as $clg => $nlg) { $__POST["fichier_media_" . $clg] = ""; $__POST["titre_media_" . $clg] = ""; $__POST["fichier_destination_" . $clg] = ""; $__POST["lien_destination_" . $clg] = ""; $__POST["cible_destination_" . $clg] = ""; } } // echoa($copy__POST2); $emptyControl = array(); foreach ($copy__POST2 as $field2 => $val2) { // on cherche les champs médias correspondant if (strpos($field2, $prefixe) === 0) { // echoa($field2." : ".$val2); $fieldOk = substr($field2, $len_prefixe, 100); // on ajoute des éléments avec un nom de champs que set_datas pourra exploiter $__POST[$fieldOk] = $val2; foreach ($myAdmin->LIST_LANG_DATAS as $clg => $nlg) { $__POST[$fieldOk . "_" . $clg] = $val2; } //echoa("." . $fieldOk . " : " . $val2); if ($liste["type"] == "link" && strpos($fieldOk, "lien_destination") === 0) { $emptyControl[] = $fieldOk; } if ($liste["type"] != "link" && strpos($fieldOk, "fichier_media") === 0) { $emptyControl[] = $fieldOk; } } } //$__POST 2 //echoa($emptyControl); // echoa($__POST); $empty = 0; foreach ($emptyControl as $fieldOk) { // echoa("-" . $liste["field_media"]."__" . $fieldOk); if ($copy__POST2[$liste["field_media"] . "__" . $fieldOk] == "") { $empty++; } } // echoa($empty); if ($empty == count($emptyControl)) { if ($idMedia != "") { // on supprime le media $myDeleteM = new myDelete(__FILE__); $myDeleteM->table = $thisSite->PREFIXE_TBL_GEN . "medias"; $myDeleteM->where = "id=:id"; $myDeleteM->whereValue["id"] = array($idMedia, PDO::PARAM_STR); $result = $myDeleteM->execute(); } continue; } $idCurrent = 0; // attention, on remet à blanc l'IdCurrent du parent. (on le remet à jour à la fin) $formMaj2 = new formMaj(); $formMaj2->maj_media_inside = true; $formMaj2->tables = $thisSite->PREFIXE_TBL_GEN . "medias"; $formMaj2->fields = "*"; $formMaj2->where = "id=:id"; $formMaj2->whereValue["id"] = array($idMedia, PDO::PARAM_INT); $formMaj2->multiLang = true; $formMaj2->clause_where(); // attribution par défaut si première image de l'Id_parent $formList2 = new formList(); $formList2->tables = $thisSite->PREFIXE_TBL_GEN . "medias"; $formList2->fields = "id"; $formList2->where = "lg='" . $myAdmin->LANG_DATAS . "' AND field_media='" . $field_media . "' AND type='" . $type . "'"; if ($idParent > 0) { $formList2->where .= " AND id_parent=" . $idParent; } $formList2->clause_where(); $count_datas = $formList2->get_datas(); if ($count_datas == 0) { if ($type == "image" || $type == "video") { $__POST["image_principale"] = 1; } } if (!isset($__POST["actif"])) { $__POST["actif"] = 1; } $__POST["type"] = $type; $__POST["field_media"] = $field_media; //$this->tables . "." . $__POST["id_parent"] = $idParent; $formMaj2->set_datas(); $idCurrent = $idParent; // on remet à jour l'IdCurrent du parent. } // if(strpos($field, "fieldMedia__")===0) } //$__POST }