<? 

include("../includes/site_config.php");
include('../session_handler.inc');

include("../languages/english_admin.php");
include("include/header.php");
include("../includes/tab_functions.js");

if(isset($_REQUEST['active_id']) && $_REQUEST['active_id']!=''){

$statusChange=strtolower($_REQUEST['active_id']);
$field=$statusChange;
$adchangevalue=$_REQUEST['adchangevalue'];
$query="UPDATE active_dropdown SET $field='$adchangevalue'";
$result=mysql_query($query,$link) or die(mysql_error());

}




 $sql="SELECT DISTINCT lst_type,name from vlistbox";
		$resultvalue=mysql_query($sql) or die(mysql_error());
		$countrow=mysql_num_rows($resultvalue);
		
?>
<? include("admin_tabs.php");?>
<div class="mainwidth">
<div class="admin-page-header"><div class="admin-page-heading">&nbsp;&nbsp;<?=ADM_SETTING_MATCHES?></div></div>
<div class="clear"></div>
<div class="admin-page">
<form action="<?=$_SERVER['PHP_SELF']?>" name="sms" method="post">
<table width="315" align="<?php print("$CONST_TABLE_ALIGN"); ?>" border="0" cellspacing="<?php print("$CONST_TABLE_CELLSPACING"); ?>" cellpadding="<?php print("$CONST_TABLE_CELLPADDING"); ?>">
<? //while($rowValue=mysql_fetch_object($resultvalue)){

if(!(mysql_query("SELECT * FROM active_dropdown")))
{
echo "<a href=\"$CONST_LINK_ROOT/query.php\">Update Table</a>";
}

$query=mysql_query("SELECT * FROM active_dropdown");

$fetch= mysql_fetch_object($query); 
$i = 0; 
while ($i < mysql_num_fields($query)){ 
  $fieldname = mysql_field_name($query, $i);
  
  //echo str_replace($fieldname, '', 'adv_');
  $name = ucfirst(substr($fieldname,4));
  //echo $fieldname; 
  
  //echo $fetch->$fieldname;
  


//$retval=mysql_query($query,$link) or die(mysql_error());

//$got_photo = mysql_fetch_object($retval);


if ($fetch->$fieldname == 'Y') {

	$adstatus=ADM_BANNERS_ACTIVE;

	$adpausedval='N'; // opposite value for updating

} else{//if  ($got_photo->adv_paused == 'N') {


	$adstatus=ADM_PAYMENTS_ACTIVATE;

	$adpausedval='Y'; // opposite value for updating

} 



?>
<tr>
<td width="35%" align="left" class="normal"><?=$name?></td>
<? if($DEMO==false){?><td width="24%"><a href="<?=$_SERVER['PHP_SELF']?>?active_id=<?=$fieldname?>&adchangevalue=<?=$adpausedval?>" class="text11"><?=$adstatus?>

                        </a></td><? } else{?>
<td width="24%">Demo</td><? }?>

</tr>

<? $i++; } ?>

</table>

<table width="100%">
<tr><td>&nbsp;</td></tr>
<tr><td><?=MY_MATCHES_ADMIN_TEXT?></td></tr>
<tr><td>&nbsp;</td></tr>
</table>
  </form>


</div><div class="admin-page-bottom"></div></div>
<?php include("include/footer.php"); ?>
