<?php 	include_once('../../config.php');   	
		include_once(ABS_PATH.'/admin/login_check.php');    
		//require(ABS_PATH.'/admin/Bidding/fpdf/fpdf.php');
		
        /*if(isset($_POST['submit']))
        {
            class PDF extends FPDF
            {
                // Page header
                function Header()
                {
                    $this->SetFont('Arial','B',13);
                    // Move to the right
                    $this->Cell(50);
                    // Title
                    $this->Cell(80,10,'Bazzar Details',0,0,'C');
                    // Line break
                    $this->Ln(15);
                }
            }
        	$pdf = new PDF();
        	
        	//$pdf = new FPDF();	
        	$pdf->AddPage();
        	$pdf->SetFont('Arial','',10);
        	$pdf->Cell(65,6,'Open Single',0,0);
        	
        	$datepicker = date("d-M-Y");
			$result1 = mysql_query("select * from  biddings where bazarId=$_REQUEST[id] and gametype=1 and optionType=1 and adminDate='$datepicker'");
			$sr=1;
			while($row1 = mysql_fetch_object($result1))
			{
			    $res1=$row1->BidNo."=".$row1->Points;
			    echo $res1.'<br>';
        	    $pdf->Cell(95,6, $res1,0,1);
        	    $pdf->Ln();
			}
        	$pdf->Ln();
            $pdf->Output();
            
        }   */
?>  
<?php  include ABS_PATH.'/admin/header.php';	?>  

<script>
function del_record(val)
{

	var r = confirm("Do you really want to delete record !");
	if (r == true) {    
	$.ajax({
	type: 'POST',
	url: "../ajax/default.php",
	//async: false,			 
	data: {del_city_names:1,val:val},	  
	success: function(ajaxresult){	     
		location.reload();	 	
	},
	error: function(XMLHttpRequest, textStatus, errorThrown) { 
	alert('Error');
	}
	});
	
	}	
	
}

function myFunction() 
{
  window.print();
}
function goback()
{
    window.location.href = "<?php echo ROOTPATH?>/admin/Bidding/download_pdf.php?id="+<?php echo $_REQUEST['id']; ?>;   
}
</script>
		 
		<div class="col-md-10">  
  			<div class="content-box-large">
  				<div class="panel-heading">
					<div class="panel-title"><h3>Bazzar  </h3></div>
					
					<div align="right">
					    <!--a class="btn btn-warning">Download PDF</a-->
					    <form method="post">
                            <input type="button" name="submit" value="Download PDF"  class="btn btn-warning" onclick="goback()"/><!-- onclick="myFunction()"   -->
                            <input type="hidden" name="req_id" value="<?php echo $_REQUEST['id'];?>" />
                    	   
                	    </form>
					</div>
					<!--div align="right">  <input type="button"    class="btn btn-warning" name="btnback" id="btnback" value=" Add New User " onClick="javascript:location.href='add_new.php';" />
					</div-->
					
				</div>
				
  				<div class="panel-body">
					<?php
					// Open Single start
					    $datepicker = date("d-M-Y");
					    
						$result = mysql_query("select * from  biddings where bazarId=$_REQUEST[id] and gametype=1 and optionType=1 and adminDate='$datepicker'");
						$sr=1; 
					    
					?>
					<table>
					    <tr>
					        <th>Sr</th>
					        <th>Open Single</th>
					    </tr>
					    
					<?php
					    $sr=1;
					    while($row = mysql_fetch_object($result))
					    {
					        $opensingle_total+=$row->Points;
					  ?>
					    <tr>
					       <td><?php echo $sr++; ?></td>
                           <td><?php echo $row->BidNo; ?> = <?php echo $row->Points; ?></td>
                        </tr>
                        <?php
					    }   
				       ?>
					</table><br>
					<?php // Open Single end ?>
					
					<?php
					// Close Single start
					    $datepicker = date("d-M-Y");
					    
						$result = mysql_query("select * from  biddings where bazarId=$_REQUEST[id] and gametype=2 and optionType=1 and adminDate='$datepicker'");
						$sr=1; 
					    
					?>
					<table>
					    <tr>
					        <th>Sr</th>
					        <th>Close Single</th>
					    </tr>
					    
					<?php
					    $sr=1;
					    while($row = mysql_fetch_object($result))
					    {
					        $closesingle_total+=$row->Points;
					  ?>
					    <tr>
					       <td><?php echo $sr++; ?></td>
                           <td><?php echo $row->BidNo; ?> = <?php echo $row->Points; ?></td>
                        </tr>
                        <?php
					    }   
				       ?>
					</table><br>
					<?php // Close Single end ?>
					
					<?php
					// Open Patti start
					
					    $datepicker = date("d-M-Y");
					    
						$result = mysql_query("select * from  biddings where bazarId=$_REQUEST[id] and gametype=1 and optionType=3 and adminDate='$datepicker'");
						$sr=1; 
					    
					?>
					<table>
					    <tr>
					        <th>Sr</th>
					        <th>Open Patti</th>
					    </tr>
					    
					<?php
					    $sr=1;
					    while($row = mysql_fetch_object($result))
					    {
					        $openpatti_total+=$row->Points;
					  ?>
					    <tr>
					       <td><?php echo $sr++; ?></td>
                           <td><?php echo $row->BidNo; ?> = <?php echo $row->Points; ?></td>
                        </tr>
                        <?php
					    }   
				       ?>
					</table><br>
					<?php // Open Patti end ?>
					
					<?php
					// Close Patti start
					
					    $datepicker = date("d-M-Y");
					    
						$result = mysql_query("select * from  biddings where bazarId=$_REQUEST[id] and gametype=2 and optionType=3 and adminDate='$datepicker'");
						$sr=1; 
					    
					?>
					<table>
					    <tr>
					        <th>Sr</th>
					        <th>Close Patti</th>
					    </tr>
					    
					<?php
					    $sr=1;
					    while($row = mysql_fetch_object($result))
					    {
					        $closepatti_total+=$row->Points;
					  ?>
					    <tr>
					       <td><?php echo $sr++; ?></td>
                           <td><?php echo $row->BidNo; ?> = <?php echo $row->Points; ?></td>
                        </tr>
                        <?php
					    }   
				       ?>
					</table><br>
					<?php // Close Patti end ?>
					
					<?php
					// Jodi start
					
					    $datepicker = date("d-M-Y");
					    
						$result = mysql_query("select * from  biddings where bazarId=$_REQUEST[id] and optionType=2 and adminDate='$datepicker'");
						$sr=1; 
					    
					?>
					<table>
					    <tr>
					        <th>Sr</th>
					        <th>Jodi</th>
					    </tr>
					    
					<?php
					    $sr=1;
					    while($row = mysql_fetch_object($result))
					    {
					        $jodi_total+=$row->Points;
					  ?>
					    <tr>
					       <td><?php echo $sr++; ?></td>
                           <td><?php echo $row->BidNo; ?> = <?php echo $row->Points; ?></td>
                        </tr>
                        <?php
					    }   
				       ?>
					</table><br>
					<?php // Jodi end ?>
					
					<span><b>Open Single Total : </b> <?php echo $opensingle_total; ?></span><br>
					<span><b>Close Single Total : </b><?php echo $closesingle_total; ?></span><br>
					<span><b>Open Patti Total : </b><?php echo $openpatti_total; ?></span><br>
					<span><b>Close Patti Total : </b><?php echo $closepatti_total; ?></span><br>
					<span><b>Jodi Total :</b> <?php echo $jodi_total; ?></span><br><br>
					<span><b>Total :</b> <?php echo $opensingle_total + $closesingle_total + $openpatti_total + $closepatti_total + $jodi_total; ?></span><br>
  				</div>
  			</div>



		  </div>
		</div>
    </div>

<?php  include ABS_PATH.'/admin/footer.php';	?>    