<?php 
$pageName = 'Website Themes';

require_once('config/config.php');
require_once(CLASS_DIR.'dbClass.php');
require_once(INCLUDES_DIR.'header.php');

include('checklogin.php');
include('hitCounter.php');

$obj = new DBClass();
$obj9 = new DBClass();

$memberID = ($_SESSION['memberID']=='')?$_COOKIE['memberID']:$_SESSION['memberID'];

if(isset($_GET['code']) && ($_GET['code'] != '')){

		$sql9 = "SELECT * FROM ".TBL_THEME." WHERE memberID = '".$memberID."'";
		$rs9 = $obj9->executeQry($sql9,$link);
		$rownum9 = $obj9->getRow();
		$row9 = $obj9->fetchrow();
		if($rownum9 < 1){
			$sqll = "INSERT INTO ".TBL_THEME." (themeID,memberID) VALUES ('0005','".$memberID."')";
			$rs2 = $obj->executeQry($sqll,$link);	
		}
		else {
		$sqll = "UPDATE ".TBL_THEME." SET themeID = '".trim($_GET['code'])."' WHERE memberID = '".$memberID."'";
		$rs2 = $obj->executeQry($sqll,$link);
		}
		if($rs2){
			@header('Location: web.php?msg=edit');
		}
}

?>


<script type="text/javascript" src="lib/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="lib/jquery.mousewheel-3.0.6.pack.js"></script>
<script type="text/javascript" src="source/jquery.fancybox.js?v=2.1.4"></script>
<link rel="stylesheet" type="text/css" href="source/jquery.fancybox.css?v=2.1.4" media="screen" />
<link rel="stylesheet" type="text/css" href="source/helpers/jquery.fancybox-buttons.css?v=1.0.5" />
<script type="text/javascript" src="source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
<script type="text/javascript" src="js/show.js"></script>

<style type="text/css">
<!--
.style8 {
	font-family: "Times New Roman", Times, serif; 
	color: #000000; 
	font-size: 18px;
}

-->
</style>


<!--workarea start------------------------->
<div class="workarea">
	<div class="workareatop">
		<img src="images/workareatopcorner_03.PNG" alt="" />
	</div>
	<!--workareamid start--------------------->
	<div class="workareamid">
		<div id="floatleft" style="width:590px; float:left;">
			<div class="welcomediv">

                        <h2>Website themes</h2>
						
<?php
if(isset($_GET['msg']) && ($_GET['msg'] == 'edit')) {
echo '<br><b class="style8">Your Selected theme successfully apply</b><br><br><br>';
}
?>
<br /><h3>Click image to view the theme</h3>
 <table align="center">
 		<tr>
				<td>
						<table>
								<tr>
										<td colspan="2"><a class="fancybox-buttons" data-fancybox-group="button" href="images/img_4.PNG"><img src="images/img_4.PNG" alt=""  width="100" height="100"/></a></td>
								</tr>
								<tr>
										<td align="center" colspan="2"><a href="web.php?code=0001">Apply theme</a></td>
								</tr>
						</table>
				</td>
				<td>
						<table>
								<tr>
										<td colspan="2"><a class="fancybox-buttons" data-fancybox-group="button" href="images/img_5.PNG"><img src="images/img_5.PNG" alt=""  width="100" height="100"/></a></td>
								</tr>
								<tr>
										<td align="center" colspan="2"><a href="web.php?code=0002">Apply theme</a></td>
								</tr>
						</table>
				</td>
				<td>
						<table>
								<tr>
										<td colspan="2"><a class="fancybox-buttons" data-fancybox-group="button" href="images/img_1.PNG"><img src="images/img_1.PNG" alt=""  width="100" height="100"/></a></td>
								</tr>
								<tr>
										<td align="center" colspan="2"><a href="web.php?code=0003">Apply theme</a></td>
								</tr>
						</table>
				</td>
				<td>
						<table>
								<tr>
										<td colspan="2"><a class="fancybox-buttons" data-fancybox-group="button" href="images/img_2.PNG"><img src="images/img_2.PNG" alt=""  width="100" height="100"/></a></td>
								</tr>
								<tr>
										<td align="center" colspan="2"><a href="web.php?code=0004">Apply theme</a></td>
								</tr>
						</table>
				</td>
				<td>
						<table>
								<tr>
										<td colspan="2"><a class="fancybox-buttons" data-fancybox-group="button" href="images/img_3.PNG"><img src="images/img_3.PNG" alt=""  width="100" height="100"/></a></td>
								</tr>
								<tr>
										<td align="center" colspan="2"><a href="web.php?code=0005">Apply theme</a></td>
								</tr>
						</table>
				</td>
		</tr>
 </table>
 


						</div>
				</div>
				<?php require_once(INCLUDES_DIR.'left_bar.php');?>
                <!--floatright close-------------------->
                <div style="clear:both;"></div>
            </div>
            <!--workareamid close--------------------->
            <div class="workareabottom">
                <img src="images/workareabottomcorner_03.PNG" alt="" />
            </div>
        </div>
    <!--workarea close------------------------->
<?php require_once(INCLUDES_DIR.'footer.php');?>