%PDF- %PDF-
Direktori : /home/alliance/domains/congress-eldw.eu/public_html/ |
Current File : /home/alliance/domains/congress-eldw.eu/public_html/a-monter.php |
<?php include_once("inc/config.php"); include_once("inc/functions.php"); include_once("inc/init.php"); include_once("inc/session.php"); include_once("inc/classes/Hotpage.php"); //verif_get($_GET['avant']); $db = new BaseOps; if($_GET['table'] == "categorie") { verif_co_admin(); $query = "SELECT ordre FROM `categorie` WHERE id = ".$_GET['id']; $data = $db->select_array($query); $query = "SELECT ordre FROM `categorie` WHERE id = ".$_GET['avant']; $dataavant = $db->select_array($query); $where = "id = ".$_GET['id']; $values = array( "ordre" => $dataavant['ordre'] ); $db->update("categorie", $values, $where); $where = "id = ".$_GET['avant']; $values = array( "ordre" => $data['ordre'] ); $db->update("categorie", $values, $where); //recalculer $db->recalcordre("categorie"); header("Location: liste_cat.php"); } if($_GET['table'] == "section") { verif_co_admin(); $query = "SELECT ordre FROM `section` WHERE id = ".$_GET['id']; $data = $db->select_array($query); $query = "SELECT ordre FROM `section` WHERE id = ".$_GET['avant']; $dataavant = $db->select_array($query); $where = "id = ".$_GET['id']; $values = array( "ordre" => $dataavant['ordre'] ); $db->update("section", $values, $where); $where = "id = ".$_GET['avant']; $values = array( "ordre" => $data['ordre'] ); $db->update("section", $values, $where); //recalculer $db->recalcordre("section", "categorie = ".$_GET['cat']); header("Location: liste_cat.php"); } if($_GET['table'] == "page") { $query = "SELECT ordre FROM `page_theme` WHERE id_section=".$_GET['id_section']." AND id_page = ".$_GET['id_page']; $data = $db->select_array($query); $query = "SELECT ordre FROM `page_theme` WHERE id_section=".$_GET['id_section']." AND id_page = ".$_GET['avant']; $dataavant = $db->select_array($query); $where = "id_section=".$_GET['id_section']." AND id_page = ".$_GET['id_page']; $values = array( "ordre" => $dataavant['ordre'] ); $db->update("page_theme", $values, $where); $where = "id_section=".$_GET['id_section']." AND id_page = ".$_GET['avant']; $values = array( "ordre" => $data['ordre'] ); $db->update("page_theme", $values, $where); //recalculer $db->recalcordre("page_theme", "`type`='page' AND id_section = ".$_GET['id_section']); header("Location: liste_pages.php?id_section=".$_GET['id_section']); } if($_GET['table'] == "hotpage") { $hotpage=new Hotpage; $this_hotpage=$hotpage->getHotpage($_GET['id_hotpage']); $query="SELECT * FROM `hotpage` WHERE type = '".$this_hotpage['type']."' AND ordre=".($this_hotpage['ordre']-1); $prev_hotpage=$db->select_array($query); $values = array( "ordre" => $prev_hotpage['ordre'] ); $db->update("hotpage", $values, "id_hotpage=".$this_hotpage['id_hotpage']); $values = array( "ordre" => $this_hotpage['ordre'] ); $db->update("hotpage", $values, "id_hotpage=".$prev_hotpage['id_hotpage']); //recalculer $db->recalcordre("hotpage", "type = '".$this_hotpage['type']."'"); header("Location: hotpage.php?msg=yes"); } if($_GET['table'] == "encart") { verif_co_admin(); $query = "SELECT ordre FROM `encart` WHERE id_encart = ".$_GET['id']; $data = $db->select_array($query); $query = "SELECT ordre FROM `encart` WHERE id_encart = ".$_GET['avant']; $dataavant = $db->select_array($query); $where = "id_encart = ".$_GET['id']; $values = array( "ordre" => $dataavant['ordre'] ); $db->update("encart", $values, $where); $where = "id_encart = ".$_GET['avant']; $values = array( "ordre" => $data['ordre'] ); $db->update("encart", $values, $where); //recalculer $db->recalcordre("encart"); header("Location: liste_infos.php?msg=yes"); } if($_GET['table'] == "homepage") { verif_co_admin(); $query = "SELECT ordre FROM `homepage` WHERE id_homepage = ".$_GET['id']; $data = $db->select_array($query); $query = "SELECT ordre FROM `homepage` WHERE id_homepage = ".$_GET['avant']; $dataavant = $db->select_array($query); $where = "id_homepage = ".$_GET['id']; $values = array( "ordre" => $dataavant['ordre'] ); $db->update("homepage", $values, $where); $where = "id_homepage = ".$_GET['avant']; $values = array( "ordre" => $data['ordre'] ); $db->update("homepage", $values, $where); //recalculer $db->recalcordre("homepage"); header("Location: liste_homepage.php?msg=yes"); } if($_GET['table'] == "offre") { verif_co_admin(); $query = "SELECT ordre FROM `offre` WHERE id = ".$_GET['id']; $data = $db->select_array($query); $query = "SELECT ordre FROM `offre` WHERE id = ".$_GET['avant']; $dataavant = $db->select_array($query); $where = "id = ".$_GET['id']; $values = array( "ordre" => $dataavant['ordre'] ); $db->update("offre", $values, $where); $where = "id = ".$_GET['avant']; $values = array( "ordre" => $data['ordre'] ); $db->update("offre", $values, $where); //recalculer $db->recalcordre("offre"); header("Location: offres_avantages.php"); } if($_GET['table'] == "barre") { verif_co_admin(); $query = "SELECT ordre FROM `barre` WHERE id_barre = ".$_GET['id']; $data = $db->select_array($query); $query = "SELECT ordre FROM `barre` WHERE id_barre = ".$_GET['avant']; $dataavant = $db->select_array($query); $where = "id_barre = ".$_GET['id']; $values = array( "ordre" => $dataavant['ordre'] ); $db->update("barre", $values, $where); $where = "id_barre = ".$_GET['avant']; $values = array( "ordre" => $data['ordre'] ); $db->update("barre", $values, $where); //recalculer $db->recalcordre("barre"); header("Location: liste_barre.php"); } if($_GET['table'] == "top_accueil") { verif_co_admin(); $query = "SELECT ordre FROM `top_accueil` WHERE id_top_accueil = ".$_GET['id']; $data = $db->select_array($query); $query = "SELECT ordre FROM `top_accueil` WHERE id_top_accueil = ".$_GET['avant']; $dataavant = $db->select_array($query); $where = "id_top_accueil = ".$_GET['id']; $values = array( "ordre" => $dataavant['ordre'] ); $db->update("top_accueil", $values, $where); $where = "id_top_accueil = ".$_GET['avant']; $values = array( "ordre" => $data['ordre'] ); $db->update("top_accueil", $values, $where); //recalculer $db->recalcordre("top_accueil"); header("Location: liste_top_accueil.php"); } ?>