<?php echo $header; ?><?php echo $column_right; ?>
<style type="text/css"> 
.container { position:relative; }
.imgA1 {   z-index: 1; } 
.imgB1 {   z-index: 3;position: absolute;margin-top: 146px;margin-left: -132px; } 
.imgC1 {   z-index: 3;position: absolute;margin-top: 164px;margin-left: -118px;color: #EB6C32;font-weight: bold;} 
.imgD1 {   z-index: 7;position: absolute;margin-top: 69px;margin-left: -142px;font-weight: bold;font-size: 24px;}
.img-with {   z-index: 7;position: absolute; margin-left: -45px;font-weight: bold;margin-top: 174px;font-size: 24px;}
.imgE1 {   z-index: 1; } 
.imgF1 {   z-index: 3;position: absolute;margin-top: -35px;margin-left: 49px; } 
.imgG1 {   z-index: 3;position: absolute;margin-top: -14px;margin-left: 63px;color: #EB6C32;font-weight: bold;} 
.imgH1 {   z-index: 7;position: absolute;margin-top: -113px;margin-left: 32px;font-weight: bold;font-size: 24px;color: black;}
</style> 
     <script>

    // This is the first thing we add ------------------------------------------
    $(document).ready(function() {
        $('.rate_widget').each(function(i) {
            var widget = this;
            var out_data = {
                widget_id : $(widget).attr('id'),
                fetch: 1
            };
            $.post(
                'ratings.php',
                out_data,
                function(INFO) {
                    $(widget).data( 'fsr', INFO );
                    set_votes(widget);
                },
                'json'
            );
        });
        $('.ratings_stars').hover(
            // Handles the mouseover
            function() {
                $(this).prevAll().andSelf().addClass('ratings_over');
                $(this).nextAll().removeClass('ratings_vote'); 
            },
            // Handles the mouseout
            function() {
                $(this).prevAll().andSelf().removeClass('ratings_over');
                // can't use 'this' because it wont contain the updated data
				var c=$(this).parent();
				var d=$(this).attr('style');
                set_votes(c,d);
            }
        );
        
        
        // This actually records the vote
        $('.ratings_stars').bind('click', function() {
            var star = this;
            var widget = $(this).parent();
            
            var clicked_data = {
                clicked_on : $(star).attr('class'),
                widget_id : $(star).parent().attr('id')
            };
            $.post(
                'ratings.php',
                clicked_data,
                function(INFO) {
                    widget.data( 'fsr', INFO );
                    set_votes(widget);
                },
                'json'
            ); 
        });
    });

    function set_votes(widget,avg) {
        $(widget).find('.star_' + avg).prevAll().andSelf().addClass('ratings_vote');
        $(widget).find('.star_' + avg).nextAll().removeClass('ratings_vote');  
    }
    // END FIRST THING
    </script>
    <style>
        .rate_widget1 {
            border:     1px solid #CCC;
            overflow:   visible;
            padding:    10px;
            position:   relative;
            width:      180px;
            height:     32px;
        }
        .ratings_stars {
            background: url('nostar.png') no-repeat;
            float:      left;
            height:     18px;
            width:      18px;
			cursor: pointer;
        }
        .ratings_vote {
            background: url('single.png') no-repeat;
        }
        .ratings_over {
            background: url('marked.png') no-repeat;
        }
        .total_votes {
            background: #eaeaea;
            top: 58px;
            left: 0;
            padding: 5px;
            position:   absolute;  
        } 
        .movie_choice {
            font: 10px verdana, sans-serif;
            margin: 0 auto 40px auto;
            width: 180px;
        }
        h1 {
            text-align: center;
            width: 400px;
            margin: 20px auto;
        }
    </style>	  

<div id="content"><?php echo $content_top; ?>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="edit"> 
  <?php $idd = $con_name.'(Contest # '. $con_id .')'?>
    <h3><?php echo $idd; ?></h3>
	<hr>
	
	
	 <div>
	  <div id="tabs" class="htabs">
			<a href="#tab-designers" style="font-family:calibri;">ENTRIES</a>
			<a href="#tab-designbrief" style="font-family:calibri;">DESIGN BRIEF</a>
	  </div>
	  
		<div class="content" id="tab-designers">	 
			<div style="width:962px;margin-left:10px;"> 
			<div style="position:relative;margin-top:10px;color:#808080;">
				<span style="margin-right:127px;position:relative;left:30px;">	Designer </span>
				<span style="margin-right:10px;">	Submitted Designs </span>
			</div>
		  </div>
		   <hr>  <?php if ($sketch_ids) { ?>
		  <div style="width:962px;margin-left:10px;">  
			 <?php $designerid=0; ?>
				<?php foreach ($sketch_ids as $sketch_id) { ?>
					<?php if ($sketch_id['designer_id'] != $designerid) { ?> 
					   <?php if ($designerid!=0) { ?></div> <hr><?php } else { ?> </div>   <?php } ?>
						<?php $designerid=$sketch_id['designer_id']  ; ?> 
							<div class="image" style="width:150px;float:left;font-weight:bold;margin-right:30px;position:relative;top:20px;left:10px;font-family:calibri;color:#808080;">
								<img src="<?php echo $sketch_id['designerimage']; ?>"  /> <br>
								<?php echo $sketch_id['designer_name']; ?>
							</div>
							<div class="image" style="width:800px;margin-left:180px;">
							<?php }	?>	 
							<a href="index.php?route=desaccount/feedback&sid=<?php echo $sketch_id['sketch_id']; ?>"><img class="imgA1" style="border:2px solid #EBEAEA;margin-bottom:25px;" src="<?php echo $sketch_id['sketchimage']; ?>"  /> </a>
							<?php if($sketch_id['rating']) { ?>
							<img class="imgB1" width="85px" src="catalog/view/theme/default/image/newimage/<?php echo $sketch_id['rating'];?>_star.png" />
							<?php } ?>
							<?php if($sketch_id['winner'] == 'y') { ?>
							<span class="imgC1" width="85px" >WINNER ! </span>
							<?php } ?>
							<?php if($sketch_id['withdrawn'] == 'y') { ?>
							<span class="imgD1" width="85px" >Withdrawn </span>
							<?php } ?>
							<?php if($sketch_id['eliminated'] == 'y') { ?>
							<span class="imgD1" width="85px" >Eliminated </span>
							<?php } ?> 
							 <span style="cursor:pointer;position:relative;right:40px;z-index:7;" >
								<a href="index.php?route=desaccount/feedback&sid=<?php echo $sketch_id['sketch_id']; ?>">
									<img width="15px" height="15px" title="Respond to Feedback" src="catalog/view/theme/default/image/newimage/fi1.png" />
								</a>
								<?php if($sketch_id['withdrawn'] != 'y') { ?>
									<img width="15px" height="15px" title="withdrawn" class="<?php echo $sketch_id['sketch_assignment_id']; ?>" alt="<?php echo $sketch_id['designer_name']; ?>" style="<?php echo $sketch_id['designer_id']; ?>" id="item" src="catalog/view/theme/default/image/newimage/ei1.png" />
								<?php }else{ ?> 
								<div width="15px" height="15px" ></div>
								<?php }?> 
							</span>   
						<?php } ?><br><br><hr style="position:relative;left:-176px;width:972px;">
					</div>
				<?php } ?>
				
				  <div style="width:962px;margin-left:10px;">  
			 <?php $designerid=0; ?>
				<?php foreach ($notdesigner_ids as $sketch_id) { ?>
					<?php if ($sketch_id['designer_id'] != $designerid) { ?> 
					   <?php if ($designerid!=0) { ?></div> <hr><?php } ?> 
						<?php $designerid=$sketch_id['designer_id']  ; ?> 
							<div class="image" style="width:120px;float:left;font-weight:bold;margin-right:30px;position:relative;top:20px;left:10px;font-family:calibri;color:#808080;">
								<img src="<?php echo $sketch_id['designerimage']; ?>"  /><br>
								<?php echo $sketch_id['designer_name']; ?>
							</div>
							<div class="image" style="width:800px;margin-left:168px;">
							<?php }	?>	
							<img class="imgA1" style="border:2px solid #EBEAEA;margin-bottom:25px;" src="<?php echo $sketch_id['sketchimage']; ?>"  />
							<?php if($sketch_id['rating']) { ?>
							<img class="imgB1" width="85px" src="catalog/view/theme/default/image/newimage/<?php echo $sketch_id['rating'];?>_star.png" />
							<?php } ?>
							<?php if($sketch_id['winner'] == 'y') { ?>
							<span class="imgC1" width="85px" >WINNER ! </span>
							<?php } ?>
							<?php if($sketch_id['reported'] == 'y') { ?>
							<span class="imgD1" width="85px" >Reported </span>
							<?php } ?>
							<?php if($sketch_id['withdrawn'] == 'y') { ?>
							<span class="imgD1" width="85px" >Withdrawn </span>
							<?php } ?>
							<?php if($sketch_id['eliminated'] == 'y') { ?>
							<span class="imgD1" width="85px" >Eliminated </span>
							<?php } ?>
							
							
							<span style="cursor:pointer;margin-left:-22px;" class="img-with"  >
							 <img width="15px" height="15px" title="reported" class="<?php echo $sketch_id['sketch_assignment_id']; ?>" lang="<?php echo $sketch_id['sketch_id']; ?>" alt="<?php echo $sketch_id['designer_name']; ?>" style="<?php echo $sketch_id['designer_id']; ?>" id="item1" src="catalog/view/theme/default/image/newimage/exi1.png" />
<!--							 <img width="15px" height="15px" title="Report Design" src="catalog/view/theme/default/image/newimage/exi1.png" /> -->
							</span>   
							
						<?php } ?><br><br><hr style="position:relative;left:-176px;width:972px;">
					</div> 
		  
		</div>
		</div>
		</form>
		<div class="content" id="tab-designbrief">	 
		
		<?php if($customers) { ?>
			<?php foreach ($customers as $customer) { ?>
			<br>
			<b> Customer Details :</b>
				<div style="background:#F2F2F2;width:978px;">
				<hr>
				<b>Name : </b><?php echo $customer['name']; ?><br>
				<b> Birthday : </b>
				<?php if($customer['born'] ==0000-00-00) { ?>
				Not Available
				<?php } else { ?>
				<?php echo $customer['born']; ?>
				<?php } ?>
				<br><b> Country : </b>Australia
				<hr>
				</div>
				<?php } ?>
				<?php } ?>
			
				
				
				
				<div style="width:978px;">
					<div style="width:510px;float:left;">
						<b>Design Brief :</b> <br>
							<?php if($customers) { ?>
								<?php foreach ($customers as $customer) { ?>
									<textarea style="width:450px;" name="about_yourself" cols="90" rows="11" readonly><?php echo $customer['description']; ?></textarea>
								<?php } ?>
							<?php } ?>
					</div>
	  
	  <div style="width:460px;float:left;position:relative;top:-30px;">
	  <br><br>
	  <?php foreach ($customers as $customer) { ?>
	  <input type="hidden" id="ma1" value="<?php echo $customer['masculine_feminine']; ?>" >
	  <input type="hidden" id="ma2" value="<?php echo $customer['youthful_mature']; ?>" >
	  <input type="hidden" id="ma3" value="<?php echo $customer['funky_graceful']; ?>" >
	  <input type="hidden" id="ma4" value="<?php echo $customer['bold_subtle']; ?>" >
	  <input type="hidden" id="ma5" value="<?php echo $customer['simple_intricate']; ?>" >
	  <input type="hidden" id="ma6" value="<?php echo $customer['classic_contemporary']; ?>" >
	<?php } ?>
	
	   <b> Design Preferences :</b> <br><br>
	   <?php foreach ($customers as $customer) { ?>
	  	<ul id="logo-values">
   <li>
    <input size="1" type="hidden" id="amount" name="masculine_feminine" style="border: 0; color: #f6931f; font-weight: bold;" /><span style="font-family:calibri;font-size:14px;">Masculine</span>
    <div id="slider-range-min" style="width:100px;margin-top: -13px;margin-left: 120px;pointer-events: none;"><span style="margin-left:135px;position:relative;top:-5px;font-family:calibri;font-size:14px;">Feminine</span></div> 
	<input type="hidden" id="amount" value="<?php echo $customer['masculine_feminine']; ?>" />
   </li>
    <br> 
   <li>
    <input size="1" type="hidden" id="amount2" name="youthful_mature" style="border: 0; color: #f6931f; font-weight: bold;" /><span style="font-family:calibri;font-size:14px;">Youthful</span>
    <div id="slider-range-min2" style="width:100px;margin-top: -13px;margin-left: 120px;pointer-events: none;"><span style="margin-left:135px;position:relative;top:-5px;font-family:calibri;font-size:14px;">Mature</span></div> 
	<input type="hidden" id="amount2" value="<?php echo $customer['youthful_mature']; ?>" />
   </li>
   <br>
     <li>
    <input size="1" type="hidden" id="amount3" name="funky_graceful" style="border: 0; color: #f6931f; font-weight: bold;" /><span style="font-family:calibri;font-size:14px;">Funky</span>
    <div id="slider-range-min3" style="width:100px;margin-top: -13px;margin-left: 120px;pointer-events: none;"><span style="margin-left:135px;position:relative;top:-5px;font-family:calibri;font-size:14px;">Graceful</span></div> 
	<input type="hidden" id="amount3" value="<?php echo $customer['funky_graceful']; ?>" />
   </li>
   <br>
      <li>
    <input size="1" type="hidden" id="amount4" name="bold_subtle" style="border: 0; color: #f6931f; font-weight: bold;" /><span style="font-family:calibri;font-size:14px;">Bold</span>
    <div id="slider-range-min4" style="width:100px;margin-top: -13px;margin-left: 120px;pointer-events: none;"><span style="margin-left:135px;position:relative;top:-5px;font-family:calibri;font-size:14px;">Subtle</span></div> 
	<input type="hidden" id="amount4" value="<?php echo $customer['bold_subtle']; ?>" />
   </li>
   <br>
      <li>
    <input size="1" type="hidden" id="amount5" name="simple_intricate" style="border: 0; color: #f6931f; font-weight: bold;" /><span style="font-family:calibri;font-size:14px;">Simple</span>
    <div id="slider-range-min5" style="width:100px;margin-top: -13px;margin-left: 120px;pointer-events: none;"><span style="margin-left:135px;position:relative;top:-5px;font-family:calibri;font-size:14px;">Intricate</span></div> 
	<input type="hidden" id="amount5" value="<?php echo $customer['simple_intricate']; ?>" />
   </li>
   <br>
      <li>
    <input size="1" type="hidden" id="amount6" name="classic_contemporary" style="border: 0; color: #f6931f; font-weight: bold;" /><span style="font-family:calibri;font-size:14px;">Classic</span>
    <div id="slider-range-min6" style="width:100px;margin-top: -13px;margin-left: 120px;pointer-events: none;"><span style="margin-left:135px;position:relative;top:-5px;font-family:calibri;font-size:14px;">Contemporary</span></div> 
	<input type="hidden" id="amount6" value="<?php echo $customer['classic_contemporary']; ?>" /> 
   </li>
   </ul>
	 <?php } ?> 
	</div>
	</div>
	
	<div style="width:970px;">
	<div style="width:300px;float:left;">
	 <b>  The Inspiration :</b><br><br>
		<?php $linki = 'image/myowndesign/';?>
			<div class="image"><img width="175px" height="175px" src="<?php echo $linki; ?><?php echo $customers_uploads_img; ?>" /></div>
			</div>
			<div style="width:660px;float:left;">
			<div style="position:absolute;"> <b> Other designs/themes liked by the customer : </b> </div> <br><br>
			<?php foreach ($multi_images as $multi_image) { ?>
				<div style="float:left;margin-bottom:20px;"><img src="<?php echo $multi_image['selectedimage']; ?>" /></div>
			<?php } ?>
			</div>
	</div>
	
	<br><br>
	<div style="width:970px;">
	 <b> Message from Customer : </b><br><br>
	 <?php foreach ($cus_comments as $cus_comment) { ?>
	<textarea style="width:460px;" cols="90" rows="3" readonly><?php echo $cus_comment['comment']; ?></textarea>
	<?php $originalDate = $cus_comment['creation_date_time']; ?>
	<?php $newDate = date("d-M-Y H:i", strtotime($originalDate)); ?>
	<div style="text-align:right;width:460px;">
	<i><span style="font-size: 12px;color:#3381FF;"><?php echo $cus_comment['customername']; ?> <span></i>&nbsp; on &nbsp; <?php echo $newDate; ?></div>
		
	<?php } ?>
	</div>
		
		</div>
  <?php echo $content_bottom; ?></div>
<?php echo $footer; ?>
<!-- <script>
document.getElementById("slider-range-min").value.readOnly=true;
</script> -->
<script type="text/javascript"><!--
$('#tabs a').tabs();
//--></script> 
<script>
    $(function() {
	var cc1 = document.getElementById("ma1").value;
        $( "#slider-range-min" ).slider({
            range: "min",
            value: cc1,
            min: 0,
            max: 100,
            slide: function( event, ui ) {
                $( "#amount" ).val(ui.value );
            }
        });
        $( "#amount" ).val($( "#slider-range-min" ).slider( "value" ) );
    });
    </script>
	    <script>
    $(function() {
	var cc2 = document.getElementById("ma2").value;
        $( "#slider-range-min2" ).slider({
            range: "min",
            value: cc2,
            min: 0,
            max: 100,
            slide: function( event, ui ) {
                $( "#amount2" ).val(ui.value );
            }
        });
        $( "#amount2" ).val( $( "#slider-range-min2" ).slider( "value" ) );
    });
    </script>
		    <script>
    $(function() {
	var cc3 = document.getElementById("ma3").value;
        $( "#slider-range-min3" ).slider({
            range: "min",
            value: cc3,
            min: 0,
            max: 100,
            slide: function( event, ui ) {
                $( "#amount3" ).val(ui.value );
            }
        });
        $( "#amount3" ).val( $( "#slider-range-min3" ).slider( "value" ) );
    });
    </script>
		    <script>
    $(function() {
	var cc4 = document.getElementById("ma4").value;
        $( "#slider-range-min4" ).slider({
            range: "min",
            value: cc4,
            min: 0,
            max: 100,
            slide: function( event, ui ) {
                $( "#amount4" ).val( ui.value );
            }
        });
        $( "#amount4" ).val( $( "#slider-range-min4" ).slider( "value" ) );
    });
    </script>
		    <script>
    $(function() {
	var cc5 = document.getElementById("ma5").value;
        $( "#slider-range-min5" ).slider({
            range: "min",
            value: cc5,
            min: 0,
            max: 100,
            slide: function( event, ui ) {
                $( "#amount5" ).val( ui.value );
            }
        });
        $( "#amount5" ).val( $( "#slider-range-min5" ).slider( "value" ) );
    });
    </script>
		    <script>
    $(function() {
	var cc6 = document.getElementById("ma6").value;
        $( "#slider-range-min6" ).slider({
            range: "min",
            value: cc6,
            min: 0,
            max: 100,
            slide: function( event, ui ) {
                $( "#amount6" ).val( ui.value );
            }
        });
        $( "#amount6" ).val($( "#slider-range-min6" ).slider( "value" ) );
    });
    </script>
	
	
<script type="text/javascript"><!--
$('div[id="rate"]').click(function(){
var sketchvalue=$(this).attr('lang');
var rateval=$(this).attr('value');
$.ajax({
		url: 'index.php?route=account/overall/rating&rate='+rateval,
		type: 'post',
		dataType: 'json',	
		data: 'sketch_id='+ encodeURIComponent(sketchvalue),		
		success: function (json) {
			alert('Rating : '+rateval+' Submitted Successfully');
			window.location.reload(true);
		}
	});
});
//--></script> 

<script type="text/javascript"><!--
$('img[id="item"]').click(function(){
var sketchvalue=$(this).attr('class');
var title=$(this).attr('title');
var designid=$(this).attr('style');
var dname=$(this).attr('alt');
if(title == 'reported') 
{
	var url = 'http://www.tresorjewellery.com.au/index.php?route=account/mail&did='+designid+'&dname='+dname+'&sketch='+sketchvalue;
	window.open(url,'popUpWindow','height=300,width=500,left=260,top=160,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}else{
if (confirm('Do you wish to withdraw this design?')) { 
$.ajax({
		url: 'index.php?route=account/overall/item&title='+title,
		type: 'post',
		dataType: 'json',	
		data: 'sketch_id='+ encodeURIComponent(sketchvalue),		
		success: function (json) {
			window.location.reload(true);

		}
	});
	}
});
//--></script>

<script type="text/javascript"><!--
$('img[id="item1"]').click(function(){
var sketchassignment=$(this).attr('class');
var sketchid=$(this).attr('lang');
var title=$(this).attr('title');
var did=$(this).attr('style');
var dname=$(this).attr('alt');
var reporter='<?php echo $reporter; ?>';
var reporter_id='<?php echo $reporter_id; ?>';
if(title == 'reported') 
{
	var url = 'http://www.tresorjewellery.com.au/index.php?route=account/mail&designer=y&reporter='+reporter+'&sketchid='+sketchid+'&reporter_id='+reporter_id+'&did='+did+'&dname='+dname+'&sketch='+sketchassignment;
	window.open(url,'popUpWindow','height=300,width=500,left=260,top=160,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
});
//--></script>
 
<script type="text/javascript"><!--
/* $('#mainall').click(function() {
document.getElementById("mainall").style.underline="none";
document.getElementById("all").style.display="block";
document.getElementById("active").style.display="none";
document.getElementById("unrated").style.display="none";
document.getElementById("rated").style.display="none";
document.getElementById("eliminated").style.display="none";
document.getElementById("withdrawn").style.display="none";
});
//--></script> 
<script type="text/javascript"><!--
$('#mainactive').click(function() {
document.getElementById("mainactive").style.underline="none";
document.getElementById("all").style.display="none";
document.getElementById("active").style.display="block";
document.getElementById("unrated").style.display="none";
document.getElementById("rated").style.display="none";
document.getElementById("eliminated").style.display="none";
document.getElementById("withdrawn").style.display="none";
});
//--></script> 
<script type="text/javascript"><!--
$('#mainunrated').click(function() {
document.getElementById("mainunrated").style.underline="none";
document.getElementById("all").style.display="none";
document.getElementById("active").style.display="none";
document.getElementById("unrated").style.display="block";
document.getElementById("rated").style.display="none";
document.getElementById("eliminated").style.display="none";
document.getElementById("withdrawn").style.display="none";
});
//--></script> 
<script type="text/javascript"><!--
$('#mainrated').click(function() {
document.getElementById("mainrated").style.underline="none";
document.getElementById("all").style.display="none";
document.getElementById("active").style.display="none";
document.getElementById("unrated").style.display="none";
document.getElementById("rated").style.display="block";
document.getElementById("eliminated").style.display="none";
document.getElementById("withdrawn").style.display="none";
});
//--></script> 
<script type="text/javascript"><!--
$('#maineliminated').click(function() {
document.getElementById("maineliminated").style.underline="none";
document.getElementById("all").style.display="none";
document.getElementById("active").style.display="none";
document.getElementById("unrated").style.display="none";
document.getElementById("rated").style.display="none";
document.getElementById("eliminated").style.display="block";
document.getElementById("withdrawn").style.display="none";
});
//--></script> 
<script type="text/javascript"><!--
$('#mainwithdrawn').click(function() {
//document.getElementById("mainwithdrawn").style.underline="none";
$('#mainwithdrawn').parent().css('text-decoration','none')
document.getElementById("all").style.display="none";
document.getElementById("active").style.display="none";
document.getElementById("unrated").style.display="none";
document.getElementById("rated").style.display="none";
document.getElementById("eliminated").style.display="none";
document.getElementById("withdrawn").style.display="block";
}); */
//--></script> 
