<?php session_start(); ?>
<?php require_once('../Connections/Dubey.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$colname_COLLECTION = "-1";
if (isset($_GET['COL'])) {
  $colname_COLLECTION = $_GET['COL'];
}
mysql_select_db($database_Dubey, $Dubey);
$query_COLLECTION = sprintf("SELECT * FROM COLLECTION WHERE C_NAME = %s ORDER BY C_ORDRE ASC", GetSQLValueString($colname_COLLECTION, "text"));
$COLLECTION = mysql_query($query_COLLECTION, $Dubey) or die(mysql_error());
$row_COLLECTION = mysql_fetch_assoc($COLLECTION);
$totalRows_COLLECTION = mysql_num_rows($COLLECTION);

$colname_COLLECTION2 = "-1";
if (isset($_GET['COL2'])) {
  $colname_COLLECTION2 = $_GET['COL2'];
}
mysql_select_db($database_Dubey, $Dubey);
$query_COLLECTION2 = sprintf("SELECT * FROM COLLECTION WHERE C_REF = %s", GetSQLValueString($colname_COLLECTION2, "text"));
$COLLECTION2 = mysql_query($query_COLLECTION2, $Dubey) or die(mysql_error());
$row_COLLECTION2 = mysql_fetch_assoc($COLLECTION2);
$totalRows_COLLECTION2 = mysql_num_rows($COLLECTION2);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/base.dwt.php" codeOutsideHTMLIsLocked="false" -->
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="apple-touch-icon" href="sources/apple.png" />
        <!-- InstanceBeginEditable name="head" -->
        <title><?php echo $row_COLLECTION['C_NAME']; ?> - Dubey &amp; Schaldenbrand</title>
        
        <meta name="distribution" content="global" />
        <meta name="robots" content="follow, all" />
        <meta name="language" content="en" />
        <meta name="googlebot" content="index, follow" />
        <meta name="Description" content="dubey &amp; schaldenbrand" />
        <!--<meta name="Content" content="a remplir" />//-->
        <meta name="Keywords" content="dubey, schaldenbrand, dubey &amp; schaldenbrand, dubey and schaldenbrand, dubeywatch, dubeywatch.com, watch, la chaux-de-fonds, jonatan gil" />
        
        <!-- Balises OG (Open Graph Facebook) -->
        <meta property="og:image" content="collections/<?php echo $row_COLLECTION2['C_IMAGE']; ?>"/>
        <meta property="og:title" content="<?php echo $row_COLLECTION['C_NAME']; ?> - Dubey & Schaldenbrand"/>
        <meta property="og:site_name" content="Dubey & Schaldenbrand - Official Website"/>
        <meta property="og:description" content="<?php echo $row_COLLECTION2['C_TEXT']; ?>"/>

        
        <link href="../en/base.css" rel="stylesheet" type="text/css" />
        <link rel="icon" href="../en/sources/favicon.ico" />
        
        <link rel="stylesheet" type="text/css" href="skins2/tango/skin.css" />
        <link rel="stylesheet" type="text/css" href="slider.css" />
        <link rel="stylesheet" type="text/css" href="css/jquery.jqzoom.css" />  
              
        <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
        <script type="text/javascript">stLight.options({publisher: "ur-6d5aec6a-c9e6-4f29-7fb1-3d4de2a6bf14"});</script>
        <script src="http://code.jquery.com/jquery-latest.js"></script>
        <script type="text/javascript" src="js/mootools.js"></script>  
        <script type="text/javascript" src="js/menu.js"></script>
        <script type="text/javascript" src="js/jquery-cycle-all.js"></script>
        <script type="text/javascript" src="js/background.js"></script>
        <script type="text/javascript" src="js/slider.js"></script>
        <script type="text/javascript" src="js/jquery.jqzoom-core-pack.js"></script>
        <script type="text/javascript" src="js/detail.js"></script>
        <script type="text/javascript" src="js/collection_mini.js"></script>
        
        
    <!-- InstanceEndEditable -->
    </head>
    
    <body>
        <!-- Effet dégradé  -->
        <img id="jpgbg" src="sources/glow.png" width="100%" height="50px" style="position:absolute; left:0px; top:120px;" border="0" />
    
        <!-- Boutons: Facebook / Register my watch / login -->
        <a title="register my watch" href="http://www.dubeywatch.com/en/registration.php" class="register"></a>
        <a title="login" href="http://www.dubeywatch.com/en/login.php" class="login"></a>
        <a target="_blank" title="dubey &amp; schaldenbrand facebook" href="http://en-gb.facebook.com/pages/Dubey-Schaldenbrand/122199537791849" class="facebook"></a>
    
        <!-- Full Screen Background -->
        <?php include('str/background.php'); ?>
    
        <div id="global">
            <!-- Entete -->
            <div id="entete">
                <a href="http://www.dubeywatch.com/en/"><img src="sources/dubey.png" /></a>
            </div>
            
            <!-- Menu -->
            <div id="contmenu">
                <div id="menu">
                    <?php include('str/menu.php'); ?>
                </div>
            </div>
        
            <!-- Contenu -->
            <div id="content" class="large detail" style="" class="CTtexte"><!-- InstanceBeginEditable name="content" -->
                <h1>
                    <a class="back" href="collections.php?COL2=<?php echo $row_COLLECTION2['C_MASTER']; ?>">
                        <img src="sources/back.gif" width="20" height="20" />
                    </a>
                    <?php echo $row_COLLECTION2['C_WATCH_NAME']; ?>
                </h1>

                <div id="CTleft" class="detail">
                    <div id="ref"> Ref. No: <?php echo $row_COLLECTION2['C_REF']; ?></div>  
                    <div id="imgzoom">
                        <?php
                        if($row_COLLECTION2['C_MASTER'] == 'new')
                        {
                            ?>
                            <a href="collections/big/<?php echo $row_COLLECTION2['C_IMAGE']; ?>" class="MYCLASS">  
                                <img src="collections/<?php echo $row_COLLECTION2['C_IMAGE']; ?>" title="<?php echo $row_COLLECTION2['C_WATCH_NAME']; ?>" width="360px" height="480px"/>
                            </a>
                            <?php
                        }
                        else
                        {
                            ?>
                                <img src="collections/<?php echo $row_COLLECTION2['C_IMAGE']; ?>" title="<?php echo $row_COLLECTION2['C_WATCH_NAME']; ?>" width="360px" height="480px"/>
                            <?php
                        }
                        ?>
                    </div>  
                   
                    
                    <!-- Test de création maison d'un mini slider -->
                    <?php $slider_width = 'width:'.($totalRows_COLLECTION*76).'px'; ?>
                    <div style="clear: both;"></div>
                    <h2 style="text-align: center;margin: 25px 0px 15px 0;">MODELS</h2> 
                    <div class="collection mini">
                        <div style="<?php echo $slider_width; ?>;" class="slider mini">
                            <?php
                                $i = 1;
                                do {
                                    if($i == $_GET['flag'])
                                        $actif = 'open';
                                    else
                                        $actif = '';
                                        
                                    echo '<a href="detail.php?COL='.$row_COLLECTION['C_NAME'].'&amp;COL2='.$row_COLLECTION['C_REF'].'&flag='.$i.'">';
                                        echo    '<div id="id'.$i.'" class="cadre mini">
                                                    <img class="thumbs mini '.$actif.'" src="vignettes/'.$row_COLLECTION['C_IMAGE'].'" />
                                                </div>';
                                    echo '</a>';
                                
                                $i++;     
                                } while ($row_COLLECTION= mysql_fetch_assoc($COLLECTION)); ?>
                        </div>
                        <div class="next mini">
                            <div id="nbTotItem" class="nb<?php echo $totalRows_COLLECTION; ?>"></div>    
                        </div> 
                    </div>
                    
                </div>
                <div id="CTright" class="detail">




                    <div id="CTdescription" class="detail">
                        <div class="social" style="width: 180px; float: right; text-align: right;">
                            <!-- <span class='st_googleplus_large' displayText='Google +'></span> -->
                            <span class='st_facebook_large' displayText='Facebook'></span>
                            <span class='st_twitter_large' displayText='Tweet'></span>
                            <span class='st_linkedin_large' displayText='LinkedIn'></span>
                        </div>
                        
                        <h2>Technical data</h2>
                        <div id="CTdownload">
                            <?php    if ($row_COLLECTION2['C_TECH_DATA'] >"") {
                            ?>
                                <a title="Download the technical data" href="tdata/<?php echo $row_COLLECTION2['C_TECH_DATA']; ?>"><img src="content/pdf.png" alt="download - technical data" height="28" /></a>
                            <?php 
                            }
                            ?>
                            <?php    if ($row_COLLECTION2['C_USER_MAN'] >"") {
                            ?>
                                <a title="Download the user manual" href="tdata/<?php echo $row_COLLECTION2['C_USER_MAN']; ?>"><img src="content/pdf.jpg" alt="download - user manual"  height="28" /></a>
                            <?php 
                            }
                            ?>
                        </div>
                        
                        
                        <?php echo $row_COLLECTION2['C_TEXT']; ?>
                    <div id="CTespace"></div>    
  
                    </div>
                </div>
                <!-- InstanceEndEditable -->
            </div>
         
            <?php $l960 = 1; ?>
            <?php include('str/piedpage.php'); ?>
        
        </div>
    </body>
    <!-- InstanceEnd -->
</html>
<?php
mysql_free_result($COLLECTION);
mysql_free_result($COLLECTION2);
?>