<?php
include("../include/config.php");
include("../include/functions.php"); 
include("../include/simpleimage.php");
 validate_admin();
 
 
 
 $dir = "./grubhub_analtic/test/2025/";

function listFolderFiles2($dir){
    $ffs = scandir($dir);

    unset($ffs[array_search('.', $ffs, true)]);
    unset($ffs[array_search('..', $ffs, true)]);

    // prevent empty ordered elements
    if (count($ffs) < 1)
        return;

    echo '<ol>';
    foreach($ffs as $ff){
        echo '<li>'.$ff;
        if(is_dir($dir.'/'.$ff)) listFolderFiles($dir.'/'.$ff);
        echo '</li>';
    }
    echo '</ol>';
}

//listFolderFiles2($dir);

function listFolderFiles($dir)
{
	
    echo '<ol>';
    foreach (new DirectoryIterator($dir) as $fileInfo) {
		//echo "<pre>ddd";print_r($fileInfo);die;
        if (!$fileInfo->isDot()) {
            echo '<li><a href="'.$fileInfo->getPathname().'"'.$fileInfo->getFilename().'">' . $fileInfo->getFilename();
            if ($fileInfo->isDir()) {
                listFolderFiles($fileInfo->getPathname());
            }
            echo '</a></li>';
        }
    }
    echo '</ol>';
}
//listFolderFiles($dir);
 
 
 
 function fillArrayWithFileNodes( DirectoryIterator $dir )
{
  $data = array();
  foreach ( $dir as $node )
  {
    if ( $node->isDir() && !$node->isDot() )
    {
      $data[$node->getFilename()] = fillArrayWithFileNodes( new DirectoryIterator( $node->getPathname() ) );
    }
    else if ( $node->isFile() )
    {
      $data[] = $node->getFilename();
    }
  }
  return $data;
}
	$fileData = fillArrayWithFileNodes(new DirectoryIterator($dir));
	krsort($fileData);
	$cntFiles = count($fileData);
//echo "<pre>==rrrrrr";
//print_r($fileData); // print the result.
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php echo SITE_TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript">
function validate(obj)
{
	
	if(obj.qusr_emailid.value==''){
alert("Please enter email id");
obj.qusr_emailid.focus();
return false;
}
if(obj.qusr_wamt.value==''){
alert("Please enter  amount");
obj.qusr_wamt.focus();
return false;
}
}
</script>
<style> 
body {
	background-color: #FFFFFF;

	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	color: #2f2f2f;
font: 12px/1.5em Arial, Helvetica, sans-serif;
}
.header {
background: url(../images/header_top_bg.gif) repeat-x #425e66;
text-align: right;

}
.nav-bar {
border-top: 1px solid #2d444f;
border-bottom: 1px solid #2d444f;
background: url(images/nav1_bg.gif) repeat-x 0 100% #666e73;
padding: 0 30px;
}
/*-------------- All Padding Classes Starts --------------*/
.paddRt{ padding-right:18px;}
.padd10{ padding:10px;}
.paddTop10{ padding-top:10px;}
.paddRtLt13{ padding-right:13px; padding-left:13px;}
.paddRtLt70{ padding-top:10px; padding-bottom:50px;}
.paddTopLt13{ padding-top:20px; padding-left:20px;}
.paddTopBot20{ padding-top:20px; padding-bottom:20px;}
.paddRt14{ padding-right:14px;}
.paddLt15{ padding-left:15px;}
.paddLt30{ padding-left:30px;}
.paddLt10{ padding-left:10px;}
.paddLt11{ padding-left:11px;}
.paddLt25{ padding-left:25px;}
.paddLt6{ padding-left:6px;}
.paddTop6{ padding-top:6px;}
.paddTop11{ padding-top:11px;}
.paddTop5{ padding-top:5px;}
.paddTop30{ padding-top:30px;}
.paddTop60{ padding-top:60px;}
.paddTop70{ padding-top:70px;}
.paddBot11{ padding-bottom:11px;}
.paddBot5{ padding-bottom:5px;}
.padd5{padding:5px; border:1px solid #CCC;}
.paddRt10{ padding-right:10px;}
.padding10{padding:10px;}
/*-------------- All Links Classes Starts --------------*/



.bottonbg{ background-image:url(../images/logoutbg.gif); background-repeat:repeat-x; background-position:left top;}
.boxbg{ background-image:url(../images/boxbg.gif); background-repeat:repeat-x; background-position:left top;}
.headingbg{ background-image:url(../images/headingbg.gif); background-repeat:repeat-x; background-position:left top; height:37px;}
.loginLt{ background-image:url(../images/loginlt.gif); background-repeat:no-repeat; background-position:left top;}
.footerbg{ clear: both;
background: url(../images/footer_bg.gif) repeat-x ;
padding: 105px 2.8em 2.8em 2.8em;
font-size: .95em;
text-align: center;}
.lik12:link, .lik12:visited{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #fcce77;
	text-decoration: none;
}
.lik12:hover{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #fcce77;
	text-decoration: underline;
}
td{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	/*! color: #827788; */
	text-decoration: none;
}
.mainTable{
	background:#fafdfc;
	
}
a:link, a:visited{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #827788;
	text-decoration: none;
}
a:hover{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #827788;
	text-decoration: underline;
}
.org{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #ef6409;
	text-decoration: none;
}
.inp{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #827788;
	text-decoration: none;
	padding-left: 3px;
	border:1px solid #bebdbf;
}
.text18{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 18px;
	color: #2982ec;
	font-weight:bold;
	text-decoration: none;
}
.text14{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	color: #2982ec;
	font-weight:bold;
	text-decoration: none;
}
.bodrBot{ border-bottom:1px solid #d7d7d7;}
.bodr{ border:1px solid #ebf7f3;}

.paging{font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
color:#FF6600;
font-weight:normal;
}
.submit {
	background-color: #0971a2;
	color: #FFFFFF;
	font-family:Verdana, Arial, Helvetica, sans-serif;
	font-size:12px;	
	font-weight:bold;
	height:30px; 
	text-align:center;
	border:double;
	cursor:pointer;
border-radius:5px;
	
}

.OKmessegeBody {
	background: #f3f4f6 url(../images/correct.gif) no-repeat 5px;
	background-position:left middle;
	height:auto;
	font-family: Arial, sans-serif;
	font-size:14px;
	font-weight:bold;
	color:#000000;
	border:1px solid #adadb0;
	margin:10px;
	padding:8px 5px 5px 35px;
	vertical-align:middle;
	text-align:left;
}

.ErrormessegeBody {
	background: #f3f4f6 url(../images/warning.gif) no-repeat 5px;
	background-position:left middle;
	height:auto;
	font-family: Arial, sans-serif;
	font-size:14px;
	font-weight:bold;
	color:#000000;
	border:1px solid #adadb0;
	margin:10px;
	padding:8px 5px 5px 35px;
	vertical-align:middle;
	text-align:left;
}
.lik12blu:link, .lik12blu:visited{
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #1890c0;
text-decoration: none;
}
.lik12blu:hover{
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #1890c0;
text-decoration: underline;
}

.error {
	background:transparent url(../images/aero_up.gif) no-repeat scroll 0 0;
	font-weight:bold;
	padding-bottom:15px;
	padding-right:15px;
}

.error_msg {
	color:#990000;
	margin-left:30px;
}
.success {
	background:transparent url(../images/right.jpg) no-repeat scroll 0 0;
	padding-bottom:15px;
	padding-right:15px;
}
.success_msg {
	color:#009933;
	font-weight:bold;
	margin-left:19px;
}
.logoutbutton{
	font:12px arial;
	background:#2982ec;
	color:#FFF;
	font-weight:bold;
	border:1px solid #000;
	border-radius:4px;
	cursor:pointer;
	padding:5px;
	
	
}
.logoutbutton:hover{
	font:12px arial;
	background:#faa369;
	color:#FFF;
	font-weight:bold;
	border-radius:4px;
	border:1px solid #000;
	cursor:pointer;
}
.button{
	font:12px arial;
	background:#fb8a01;
	color:#FFF;
	font-weight:bold;
	border:1px solid #000;
	border-radius:4px;
	cursor:pointer;
}
.button:hover{
	font:12px arial;
	background:#faa369;
	color:#FFF;
	font-weight:bold;
	border-radius:4px;
	border:1px solid #000;
	cursor:pointer;
}
.show {background:url(../images/select-bg.jpg) no-repeat left bottom; width:243px; height:20px; display:block}
.hide {background-color:#F7F7F7; padding: 5px 10px; z-index:1000; position:absolute; top:20px; left: 0px; border:1px #CCCCCC solid; height:150px; overflow:auto; font-family:Arial, Helvetica, sans-serif; color:#666666; font-size:12px; line-height:19px; border-top:none; display:none;}
.dashbox{
	border: 1px solid #E1E1E1;
	}
.dashboxleftback {
    background: url(../images/searchboxleftback.jpg) repeat-y left;
}

.dashboxrightback {
    background: url(../images/searchboxrightback.jpg) repeat-y right;
	padding:10px;
}
.dashcontainer{
	padding:10px;
	}
.dashcontainer1{
	padding:10px;
	}
.dashcontainer1 h4{
	font-size:14px;
	}

.dashcontainer1 h4 {
    background: url(../images/purplebullet1.jpg) no-repeat left;
    color: #A72E8D;
    font-size: 13px;
    line-height: 20px;
    padding-left: 30px;
	margin:0px;
	padding-bottom:4px;
	border-bottom:1px solid #F4F4F4;
	margin-bottom:4px;
}

.dashcontainer1 ul{
	margin:0px;
	padding-left:10px;
	}
.dashcontainer1 ul li{
	list-style:none;
	width:50%;
	float:left;
	}

.dashcontainer1 ul li a {
    background: url(../images/blackbullet.jpg) no-repeat left;
    color: #000000;
    display: block;
    font-size: 13px;
    padding: 6px 6px 6px 20px;
    text-decoration: none;
}

.dashcontainer1 ul li a:hover {
    background:url(../images/purplebullet.jpg) no-repeat left;
	color:#901e78;
}

.prod-color{
	color:#FC9C81;
}
</style>
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<?php include("header.php") ?>



<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td align="left" valign="middle" class="headingbg bodr text14">
					<em><img src="images/arrow2.gif" width="21" height="21" hspace="10" align="absmiddle" /></em>Dowmload Grubhub Report
					<?php echo $_REQUEST['order_id']; ?></td>
						</tr>
                      <tr><td>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0"  bgcolor="#f7faf9" class="bodr">
  
	
						<?php 
						$reuserIdWa=$_REQUEST['id'];
						$commentArr=$obj->query("select wa.*, u.id,u.email from tbl_wallet wa join tbl_user as u on wa.user_id=u.id where wa.user_id='$reuserIdWa' and wa.type='Cr' order by wa.id desc; ");
	if($cntFiles >0){?>
     <tr><td><table width="100%" border="0" cellspacing="4" cellpadding="4"  >
    <tr>
    <td width="21%"><strong>Date</strong></td>
	 <td width="21%"><strong>Download</strong></td>
     <td width="21%"><strong>Download</strong></td>
     <td width="21%"><strong>Download</strong></td>
       <td width="21%"><strong>Download</strong></td>
    
  </tr>
  
   <?php   foreach($fileData as $key1=>$valuearr) { ?>                   
  <tr>
    <td style="font-weight: bold"><?php 
//echo $key;

//$myDateTime = DateTime::createFromFormat('d', $key1);
//echo $newDateString = $myDateTime->format('M, Y');
	if($key1=='12') {
echo "December , 2025"; 
	}else
	if($key1=='11') {
echo "November , 2025"; 
	}else
	if($key1=='10') {
echo "October , 2025"; 
	}else
	if($key1=='09') {
echo "September , 2025"; 
	}else
	if($key1=='08') {
echo "August , 2025"; 
	}else
	if($key1=='07') {
echo "July , 2025"; 
	}else
	if($key1=='06') {
echo "June , 2025"; 
	}else
	if($key1=='05') {
echo "May , 2025"; 
	}else
	if($key1=='04') {
echo "April , 2025"; 
	}else
	if($key1=='03') {
echo "March , 2025"; 
	}else if($key1=='02') {
echo "Feb , 2025"; 
	}else if($key1=='01') {
		echo "Jan , 2025"; 
	}
?></td>
   <td><?php //echo print_r($value); ?></td>
   
    <td><?php echo $resultComment->user_id; ?></td>
    
    <td><?php echo stripslashes($resultComment->wallet_balance); ?></td>
  <td><?php echo stripslashes($resultComment->type); ?></td>
  </tr>
  <?php   foreach($valuearr as $key=>$valueFarr) { ?> 
  <tr>
    <td><?php   //$date = strtotime(date);
				if($key1=='12') {
echo "Decemebr , ".$key.' 2025'; 
$mnname = '12';
	}else
				if($key1=='11') {
echo "November , ".$key.' 2025'; 
$mnname = '11';
	}else
				if($key1=='10') {
echo "October , ".$key.' 2025'; 
$mnname = '10';
	}else
				if($key1=='09') {
echo "September , ".$key.' 2025'; 
$mnname = '09';
	}else
				if($key1=='08') {
echo "August , ".$key.' 2025'; 
$mnname = '08';
	}else
				if($key1=='07') {
echo "July , ".$key.' 2025'; 
$mnname = '07';
	}else
				if($key1=='06') {
echo "June , ".$key.' 2025'; 
$mnname = '06';
	}else
				if($key1=='05') {
echo "May , ".$key.' 2025'; 
$mnname = '05';
	}else
				if($key1=='04') {
echo "April , ".$key.' 2025'; 
$mnname = '04';
	}else
			if($key1=='03') {
echo "March , ".$key.' 2025'; 
$mnname = '03';
	}else
		if($key1=='02') {
echo "Feb , ".$key.' 2025'; 
$mnname = '02';
	}else if($key1=='01') {
		echo "Jan, ".$key.' 2025'; 
		$mnname = '01';
	}
	
//echo $key; 
//$myDateTime2 = DateTime::createFromFormat('d', $key1);
//echo $newDateString2 = $myDateTime2->format('M, Y');

?></td>
   <td><a href="grubhub_analtic/test/2025/<?php echo $mnname.'/'.$key;?>/<?php echo $valueFarr[0];?>">Download <?php echo $valueFarr[0];?></a> </td>
   
    <td><a href="grubhub_analtic/test/2025/<?php echo $mnname.'/'.$key;?>/<?php echo $valueFarr[1];?>">Download <?php echo $valueFarr[1];?></a></td>
    
    <td><a href="grubhub_analtic/test/2025/<?php echo $mnname.'/'.$key;?>/<?php echo $valueFarr[2];?>">Download <?php echo $valueFarr[2];?></a></td>
  <td><a href="grubhub_analtic/test/2025/<?php echo $mnname.'/'.$key;?>/<?php echo $valueFarr[3];?>">Download <?php echo $valueFarr[3];?></a></td>
  </tr>
  
  <?php } }?>
</table>
</td></tr>
           <?php }else{ ?>
           <tr><td  align="center"  ><strong>No Record Found.</strong></td></tr>
           <?php } ?>      
						<tr><td align="center"> </td></tr></table>
</td></tr>
					
					</table>
<?php include('footer.php'); ?>
</table>
</body>
</html>


