Ejemplo n.º 1
0
function prContent_Menu($spojeni)
{
    $idhmenu = $_SESSION["idhmenu"];
    $nahoru = $_POST["nahoru_x"];
    $dolu = $_POST["dolu_x"];
    $prejmenovat = $_POST["prejmenovat_x"];
    $novy = $_POST["novy_x"];
    $smazat = $_POST["smazat_x"];
    $id = $_POST["idmenu"];
    $novynazev = $_POST["nazev" . $id];
    if ($novy) {
        $nazevn = $_POST["nazevn"];
        $poradi = $_POST["poradi"];
        $sql = "INSERT INTO content_Menu (nazev,poradi,id_hlavni_Menu) VALUES ('{$nazevn}',{$poradi},{$idhmenu})";
        $res = PrSql($spojeni, $sql);
    }
    if ($prejmenovat) {
        $sql = "UPDATE content_Menu SET nazev='{$novynazev}' where id_content_Menu={$id}";
        $res = PrSql($spojeni, $sql);
    }
    if ($smazat) {
        $sql = "DELETE from content_Menu where id_content_Menu={$id}";
        $res = PrSql($spojeni, $sql);
    }
    if ($nahoru || $dolu) {
        $poradi = $_POST["poradi"];
        if ($nahoru) {
            $sql = "SELECT * from content_Menu where poradi<{$poradi} order by poradi DESC LIMIT 1";
        } else {
            $sql = "SELECT * from content_Menu where poradi>{$poradi} order by poradi ASC LIMIT 1";
        }
        $res = PrSQL($spojeni, $sql);
        $pocet = mysqli_num_rows($res);
        if ($pocet > 0) {
            $zaznam = mysqli_fetch_array($res);
            $idvrchni = $zaznam["id_content_Menu"];
            $porvrchni = $zaznam["poradi"];
            $sql = "UPDATE content_Menu SET poradi='{$porvrchni}' where id_content_Menu={$id}";
            $res = PrSql($spojeni, $sql);
            $sql = "UPDATE content_Menu SET poradi='{$poradi}' where id_content_Menu={$idvrchni}";
            $res = PrSql($spojeni, $sql);
        }
    }
    zobrazContent_Menu($spojeni);
}
Ejemplo n.º 2
0
        $iddum = $_GET["iddum"];
        $_SESSION["iddum"] = $iddum;
        zobrazDomyMenu($spojeni);
        break;
    case "editdata_Domy":
        $iddum = $_GET["idm"];
        $_SESSION["iddomy_Menu"] = $iddum;
        editData_Domy($spojeni);
        break;
    case "zobrazLDolniMenu":
        zobrazLDolniMenu($spojeni);
        break;
    case "zobrazcontent_Menu":
        $idm = $_GET["idm"];
        $_SESSION["idhmenu"] = $idm;
        zobrazContent_Menu($spojeni);
        break;
    case "zobrazhlavni_Menu":
        zobrazHlavni_Menu($spojeni);
        break;
    case "edithlavni_Data":
        $idm = $_GET["idm"];
        $_SESSION["idhmenu"] = $idm;
        editHlavni_Data($spojeni);
        break;
    case "zobrazUvodniText":
        edit_Uvodni_Text($spojeni);
        break;
    default:
        zobrazAdministraci($spojeni);
}