<?php 
	ini_set('display_errors', '1');
	//error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE & ~E_WARNING);
	error_reporting(E_ALL);
	require (CONFIG.'dbconnect.php');
	require (PAGE_CONTENT.$PageContent);
	//echo session_id();

	//20190617 - Change Sell KR and Buy KR pages to use new table web_retail_pricing. -Gael
	//$pdo = $SA->query("SELECT GoldPriceZARPerOz FROM web_gold_pricing ORDER BY ID DESC LIMIT 1");
	$pdo = $SA->query("SELECT GoldPriceZARPerOz, SellToUsSpread FROM web_retail_pricing ORDER BY ID DESC LIMIT 1");
	$pdo->execute();
	$results = $pdo->fetch();
	$KrugerRandTotalPriceZAR = number_format((float)$results['GoldPriceZARPerOz'] + ((float)$results['GoldPriceZARPerOz'] * ((float)$results['SellToUsSpread']/100)) , 2);
	//var_dump($KrugerRandTotalPriceZAR);
	$sellPrice = str_replace(",", "", $KrugerRandTotalPriceZAR);

	$oneOunce = number_format($sellPrice, 2, ".", ",");
	$oneHalfOunce = number_format(($sellPrice/2), 2, ".", ",");
	$oneQuarterOunce = number_format(($sellPrice/4), 2, ".", ",");
	$oneTenthOunce = number_format(($sellPrice/10), 2, ".", ",");

	$strOneOunce = "R ".$oneOunce." one oz";
	$strOneHalfOunce = "R ".$oneHalfOunce."  one half oz";
	$strOneQuarterOunce = "R ".$oneQuarterOunce."  one quarter oz";
	$strOneTenthOunce = "R ".$oneTenthOunce."  one tenth oz";
?>

<style type="text/css">
	.SellPrice p {
      padding:0; 
      margin:0;
      font-size: 16px;
      color:#B09068;
  	}
  	.tabs .tab a {
  		color: grey;
  	}
  	.tabs .tab a:hover {
  		color: #3b1c5f;
  	}

  	.tabs .tab a {
  		color: #3b1c5f;
  	}
</style>

<div id="<?php echo $pageID;?>" class="page-wrapper row">
	<div class="investment-comparison col s12" style="background-color: #f8f7fb;">
		<div class="content-wrap">
				<div class="row">
			    	<div class="col s12">
				      <ul class="tabs">
				        <li class="tab col s3" style="border-bottom: 2px solid #3b1c5f;"><span>Sell To Us</span></li>
				        <li class="tab col s3"><span>Seller Details</span></li>
				        <li class="tab col s3"><span>Review & Submit</span></li>
				      </ul>
			    	</div>
			  	</div>
			<h3 class="center-align intro-head-type alrightsansmedium"><?php echo $bao_headCompare ;?></h3>
			<span class="krugerrand-info" style="display:inline-flex;padding-left: 97px;">
				<?php echo file_get_contents(TEMPLATES_ASSETS."/svgs/sab_home_tick.svg"); ?> 
				<p><?php echo $bao_txtOffering1 ;?></p>
			</span>

			<span class="krugerrand-info" style="display:inline-flex;padding-left: 97px;">
				<?php echo file_get_contents(TEMPLATES_ASSETS."/svgs/sab_home_tick.svg"); ?> 
				<p><?php echo $bao_txtOffering2 ;?></p>
			</span>
			<span class="krugerrand-info" style="display:inline-flex;padding-left: 97px;">
				<?php echo file_get_contents(TEMPLATES_ASSETS."/svgs/sab_home_tick.svg"); ?> 
				<p><?php echo $bao_txtOffering3 ;?></p>
			</span>

			<div>
				<span style="float:left;">
				<img id="back_krugerrand" style="float:left;width:70px;padding-top:160px;visibility: hidden;" src="https://sabullion.co.za/Krugerrand Coin/back.png" >
				<img id="main_image" style="float:left;width:430px;" src="https://sabullion.co.za/Krugerrand Coin/Kruger_back.png">
				<img id="next_krugerrand" style="float:left;width:70px;padding-top:160px;" src="https://sabullion.co.za/Krugerrand Coin/next.png">
				</span>
			
				<span class="krugerrand-cost-container" style="float:left;padding-left:35px;font-size: 23px;color:#B09068;">
					<p style="padding-left: 20px;">Sell Price:</p>
					<p style="padding-left: 20px;">
						<div class="input-field col s12" style="width:100%;margin-left:12px;">
				      	<div class='sellPrice'>
		                  <p id='strOneOunce' style="font-size: 20px;"><?php echo $strOneOunce ;?></p>
		                  <p id='strOneHalfOunce' style="font-size: 20px;"><?php echo $strOneHalfOunce ;?></p>
		                  <p id='strOneQuarterOunce' style="font-size: 20px;"><?php echo $strOneQuarterOunce ;?></p>
		                  <p id='strOneTenthOunce' style="font-size: 20px;"><?php echo $strOneTenthOunce ;?></p>
		               </div>
				    	</div>
		 			</p>
				</span>
			</div>
			<span class="krugerrand-price-info" style="padding: 0 20px 5px 106px;clear: both;float:right;">
				<a href="<?php echo $SiteUrl ;?>/krugerrand/sell/index.php?seller-details" class="btn btn-success" style="background-color: #3b1c5f;">Next</a>
			</span>
		</div><!-- content wrap -->
		
		
	</div><!-- investment-comparison -->

</div><!--  page-wrapper  -->
