Advertisement
Guest User

Untitled

a guest
Mar 21st, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.54 KB | None | 0 0
  1. <?
  2. ini_set('session.gc_maxlifetime', 1*30*60);
  3. session_start();
  4. include "db/conn.php";
  5. if($_SESSION["logged_in"] == 1)
  6.  {
  7.    $userQuery = mysql_query("SELECT * FROM brugere WHERE id='$_SESSION[user_id]'");
  8.    $userArray = mysql_fetch_array($userQuery);
  9.    
  10.  
  11. ?>
  12. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  13. <html xmlns="http://www.w3.org/1999/xhtml">
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  16. <title>ANPOmedia - Bestilling af website</title>
  17. <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
  18. <link href="style.css" rel="stylesheet" type="text/css" />
  19.     <script type="text/javascript" src="js/prototype.js"></script>
  20. <script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
  21. <script type="text/javascript" src="js/lightbox.js"></script>
  22. <script type="text/javascript" src="js/jquery-latest.js"></script>
  23. <script type="text/javascript">
  24.     jQuery.noConflict();
  25.     (function($){
  26.         // Din jQuery kode her!
  27.     })(jQuery);
  28. </script>
  29. </head>
  30.  
  31. <body>
  32. <form name="index1" id="index1" method="post" action="index3.php">
  33. <table width="1000" border="0" cellpadding="0" cellspacing="0" align="center">
  34.   <tr>
  35.     <td colspan="2" align="center" valign="top" class="header"><?
  36.        // Eksempel på indhold
  37.  
  38.    echo "Hej " . $userArray["brugernavn"] . "!
  39.   <br>
  40.   <img src='img/2.png' border='0'>";
  41.    
  42. if($_GET['msg'])
  43. {
  44. ?>
  45. <h1> <? echo $_GET['msg']?></h1>
  46. <?
  47. }
  48. ?></td>
  49.   </tr>
  50.   <tr>
  51.     <td valign="top" class="menu">
  52.         <h3 align="center">Vælg branche</h3>
  53.          <? if($_GET['id']!='' && $_GET['id']!=NULL)
  54.       {
  55.           $where=" and cat_id=$_GET[id]";
  56.       }
  57.       ?>
  58.         <ul class="sidemenu">
  59.          <? $r=mysql_query("select * from category where enable='Yes' order by sorting");
  60.          while($row=mysql_fetch_array($r))
  61.          {
  62.       ?>
  63.             <li><a class="<?if($_GET['id']==$row['cat_id']){ echo active;}?>" href="index.php?id=<? echo $row['cat_id'];?>" title="<? echo $row['cat_name'];?>"><? echo $row['cat_name'];?></a></li>
  64.               <?
  65.          }
  66.         ?>
  67.         </ul>
  68.         <br />
  69.     </td>
  70.     <td valign="top" class="content"><? $r=mysql_query("select * from product where suspend='No' $where");
  71.       $i=1;
  72.       if(mysql_num_rows($r)>0)
  73.       {
  74.          while($product=mysql_fetch_array($r))
  75.          {
  76.       ?>
  77.      <div style="width:50%;float:left;" class="<?if($i%4!=0) {?>devider<?}?>" >
  78.      <table width="100%"  border="0" cellspacing="0" cellpadding="3">
  79.       <tr valign="top">
  80.         <td class="phone-title"><div align="center"><h2><?echo $product['title'];?></h2></div></td>
  81.         </tr>
  82.       <tr>
  83.         <td width="90%"><div align="center"><a href="proimgs/th/<? echo $product['pro_thumb'];?>" rel="lightbox"><img src="proimgs/th/<?echo $product['pro_thumb'];?>" height="240" border="0"></a></div></td>
  84.        </tr>
  85.        <tr>
  86.         <td width="24%" height="60" align="center" class="phone-price">
  87.          <input type="radio" name="price" id="<? echo $product['prod_id']?>" <? if($_SESSION['price']==6 && $_SESSION['product']==$product['prod_id']){ echo checked;}?>  value="6"/></td>
  88.       </tr>
  89.      
  90.       <tr>
  91.         <td colspan="2">Farve:
  92.           <table width="90%" border="0" align="right" cellpadding="0" cellspacing="0">
  93.             <tr>
  94.             <?$colors=explode(',',$product['color']);
  95.             foreach($colors as $key=>$value)
  96.             {
  97.             ?>
  98.               <td align="center"><img src="img/colors/<?echo $value?>.png" width="18" height="8" alt="Sort"></td>
  99.               <? }?>
  100.  
  101.              
  102.             </tr>
  103.             <tr>
  104.             <?
  105.              foreach($colors as $key=>$value)
  106.             {
  107.             ?>
  108.             <td align="center"><input type="radio" name="color" id="<? echo $product['prod_id']?>" value="<? echo $value?>" <? if($_SESSION['color']==$value && $_SESSION['product']==$product['prod_id']){ echo checked;}?> ></td>
  109.               <? }?>
  110.               </tr>
  111.           </table></td>
  112.         </tr>
  113.     </table>
  114.     </div>
  115.       <?
  116.       $i++;
  117.          }
  118.       }
  119.       else{
  120.         echo "Der er ingen designs i denne kategori.";
  121.       }
  122.         ?>
  123.        
  124.  
  125.     </td>
  126.   </tr>
  127. <div style="visibility:hidden">
  128. <input type="text" name="product" id="product" value="<? echo $_SESSION['product'];?>">
  129. </div>
  130. </div>    
  131. </div>
  132.  
  133. <script>
  134.    
  135. $('#index1').submit(function() {
  136.   var color=$('input[name=color]:checked').attr('id');
  137.    var price=$('input[name=price]:checked').attr('id');
  138.  
  139.    if(color!=undefined && price!=undefined)
  140.    {
  141.          if(color==price )
  142.        {
  143.          return true;
  144.        }
  145.        else
  146.        {
  147.        alert('Vælg venligst et design og en farve, af samme slags!')    ;
  148.        return false;
  149.        }
  150.     }
  151.    else
  152.    {
  153.    alert('Vælg venligst et design!')    ;
  154.    return false;
  155.    }
  156.  
  157. });
  158.  $('input[name=color]').click(function() {
  159.    var value = $('input[name=color]:checked').attr('id');
  160.  
  161.    $('#product').attr('value', value);
  162.  
  163. });
  164.  
  165.  
  166. </script>
  167.  
  168.   <tr>
  169.     <td valign="top" class="footer" colspan="2">
  170.     <a href="logud.php"><img src="img/logud.png" / border="0"></a>
  171.     <div align="right">
  172.     <input name="submit" type="submit" value="" style="background:url(img/next.png); width:90px; height:32px; border:0; cursor:pointer;"  />
  173.     </div>
  174.     </td>
  175.   </form>
  176.   </td>  
  177.     </tr>
  178.   </tr>
  179. </table>
  180. <?php
  181.  }
  182.  else
  183.  {
  184.     include "login.html";
  185.  }
  186.  ?>
  187. </body>
  188. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement