<?php
define('_VALID_MOS', 1);
include "includes/definitions.php";
// Logging für diese Seite abschalten - da WebUser
$HBST_Config["Log_Actions"] = false;
include($mosConfig_absolute_path . "/includes/core.php");
include($mosConfig_absolute_path . "/includes/validation.php");
include($mosConfig_absolute_path . "/includes/database.php");
$db = new database($host, $user, $passwd, $db_name, '');
include($HBST_Config["AdminPathConf"] . "/!funcs_gui.php");
include($mosConfig_absolute_path . "/graphite/content/cd_class.php");
include($mosConfig_absolute_path . "/graphite/content/cdorder_class.php");
$front = new CG_cd($db);
$navi = get_nav_param();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>Clementine Gasser - Music / order CD</title>
  <meta name="robots" content="index,follow"/>
  <link rel="stylesheet" type="text/css" href="css/main.css"/>
  <link rel="shortcut icon" href="<? echo $mosConfig_live_site; ?>/favicon.ico" type="image/ico"/>
  <script type="text/javascript" src="js/core.js"></script>
  <!-- soundmanager -->
  <link rel="stylesheet" type="text/css" href="/js/soundmanager/demo/play-mp3-links/css/inlineplayer.css"/>
  <link rel="stylesheet" type="text/css" href="/js/soundmanager/demo/flashblock/flashblock.css"/>
  <script type="text/javascript" src="/js/soundmanager/script/soundmanager2-jsmin.js"></script>
  <script type="text/javascript" src="/js/soundmanager/demo/play-mp3-links/script/inlineplayer.js"></script>
</head>
<body>
<a name="top">
  <div class="bdy">
    <div class="head_bow">
      <h1><a href="index.php" rev="start">Clementine Gasser</a></h1>
      <div class="nav"><a href="aktuell.php4">Events</a> &nbsp;&nbsp; <a href="projekte.php4">Projects</a> &nbsp;&nbsp;
        <strong><a href="musik.php4">Musik</a></strong> &nbsp;&nbsp; <a href="vita.php4">Vita</a> &nbsp;&nbsp; <a
          href="presse.php4">Press</a> &nbsp;&nbsp; <a href="kontakt.php4">Contact</a><? core_client_lingo_change(); ?>
      </div>
    </div>
    <div class="cont">
      <h2>MUSIK</h2>
      <div class="navsub"><strong><a href="musik.php4">CDs</a></strong> / <a href="wilde-kammermusik.php4">Wilde
          Kammermusik</a> /
      </div>


      <div class="txt">
        <div class="line"></div>

        <?
        $txt = $front->frontend_nav($navi[1], 0, $navi[0]);
        if (isset($txt["html"])) echo $txt["html"];
        //
        $cd_info = $front->frontend_text($txt["nav"], $navi[0]);
        ?>


        <h3><? if (isset($cd_info["titel"])) echo $cd_info["titel"]; ?></h3>

        <table cellpadding="0" cellspacing="0" border="0">
          <tr>
            <td style="width: 230px"><img src="<? if (isset($cd_info["bild"])) echo $cd_info["bild"]; ?>"
                                          width="212" height="189"
                                          alt="<? if (isset($cd_info["titel"])) echo MakeHtmlSafe($cd_info["titel"]); ?>"
                                          title="<? if (isset($cd_info["titel"])) echo MakeHtmlSafe($cd_info["titel"]); ?>"/>
              <p></p>

              <?
              $names = array();
              $files = array();
              $max_tracks = 6;
              for ($i = 1; $i <= $max_tracks; $i++) {
                if ((isset($cd_info["s" . $i])) && (isset($cd_info["s" . $i . "mp3"])) && (trim($cd_info["s" . $i . "mp3"]) != "") && (trim($cd_info["s" . $i]) != "")) {
                  $names[] = $cd_info["s" . $i];
                  $files[] = $cd_info["s" . $i . "mp3"];
                }
              }
              if (sizeof($names) && sizeof($files)) {
                echo "Sample-Tracks from the CD:<br />";
                ?>
                <!-- Soundmanager area -->
                <div id="sm2-container">
                  <!-- SM2 flash goes here -->
                </div>

                <ul class="graphic">
                  <?php
                  foreach ($names as $key => $track_titel) {
                    if (isset($files[$key]) && $files[$key] != '') {
                      echo '<li><a href="/Image/' . $files[$key] . '">' . $track_titel . '</a></li>';
                    }
                  }
                  ?>
                </ul>
                <?
              }
              $order = new CG_cdorder($db);

              ?>
            </td>
            <td style="width: 507px">

              <form action="<? echo $PHP_SELF; ?>" method="post">
                <input type="hidden" name="n" value="<? echo $navi[0] . "|" . $navi[1] . "|" . $navi[2]; ?>"/>
                <input type="hidden" name="aktion" value="order"/>
                <input type="hidden" name="ID" value="<? echo $order->oid; ?>"/>
                <input type="hidden" name="Datum" value="<? echo date("Y-m-d H:i:s"); ?>"/>
                <div class="order_bg">
                  <h2>ORDER CD ~ <? echo $cd_info["titel"]; ?></h2>
                  <div class="line"></div>
                  <?php
                  $AKTION = get_param("aktion");

                  $ACTIONS_ALLOWED = "order";
                  if ($AKTION == "") $AKTION = get_action($ACTIONS_ALLOWED);
                  switch ($AKTION) {
                    case "order":
                      $order->bind($HTTP_POST_VARS);
                      if ($order->check()) {
                        $order->store();
                        $order->send_order_mail();
                        include("templates/cd_order_danke.php4");
                      } else {
                        dialog("error", $order->getError());
                        include("templates/cd_order_form.php4");
                      }
                      break;

                    default:

                      include("templates/cd_order_form.php4");
                      break;
                  }
                  ?>

                </div>
                <div class="order_bg_bottom"></div>
              </form>
              <? if (isset($cd_info["text"])) echo "<p>&nbsp;</p>" . $cd_info["text"]; ?>
            </td>
          </tr>
        </table>


      </div>
    </div>
    <div class="footer">
      <div class="footertxt"><br/><a href="#top">^Top^</a></div>
    </div>
  </div>
</a>
</body>
</html>