<?php
if (file_exists('install.php'))
 {
 print 'Delete install.php file for security reason please!';
 exit();
 }
include('include/config.inc.php');
$post     = $_POST;
$frm      = array_merge($get, $post);
$frm_orig = $frm;
$gpc      = ini_get('magic_quotes_gpc');
reset($frm);
while (list($kk, $vv) = each($frm))
 {
 if (is_array($vv))
  {
  }
 else
  {
  if ($gpc == '1')
   {
   $vv = str_replace('\'', '\'', $vv);
   $vv = str_replace('\"', '"', $vv);
   $vv = str_replace('\\', '\\', $vv);
   }
  $vv      = trim($vv);
  $vv_orig = $vv;
  $vv      = strip_tags($vv);
  }
 $frm[$kk]      = $vv;
 $frm_orig[$kk] = $vv_orig;
 }
define('HotHyip_Lister_2010', 'answer');
global $frm;
session_start();
if ($frm['a'] == 'logout')
 {
 setcookie('admin_name', '', time() + 630720000);
 setcookie('admin_pswd', '', time() + 630720000);
 $frm_cookie['admin_name'] = '';
 $frm_cookie['admin_pswd'] = '';
 }
$username = ($frm['admin_name'] ? $frm['admin_name'] : $frm_cookie['admin_name']);
$password = ($frm['admin_pswd'] ? md5($frm['admin_pswd']) : $frm_cookie['admin_pswd']);
if (($username == $settings['admin_login'] && $password == $settings['admin_password']))
 {
 $dbconn = db_open();
 if (!$dbconn)
  {
  print 'Cannot connect mysql';
  exit();
  }
 if ($frm['a'] == 'do_login')
  {
  $q = 'delete from hl_traffic where date + interval ' . $settings['traffic_count_days'] . ' day < now()';
  if (!(mysql_query($q)))
   {
   exit(mysql_error());
   }
  $q = 'delete from hl_votes where confirm != 0 and date + interval ' . $settings['delete_ncvotes_days'] . ' day < now()';
  if (!(mysql_query($q)))
   {
   exit(mysql_error());
   }
  setcookie('admin_name', $username);
  setcookie('admin_pswd', $password);
  header('Location: admin.php');
  exit();
  }
 }
else
 {
 include('include/admin/login_form.inc.php');
 exit();
 }

/*
$mddomain = $frm_env['HTTP_HOST'];
$mddomain = preg_replace('/^www\./', '', $mddomain);
$key      = strtoupper(md5($mddomain . 'h6en65#$p1%^&tfdts9j') . 'HHL' . md5('hhlpro' . $mddomain));
$flag     = 0;
$skey     = substr($settings['key'], 36, 0 - 68);
if ($key == $skey)
 {
 $flag = 1;
 }
if ($flag != 1)
 {
 db_close($dbconn);
 exit();
 }
*/

include('include/admin/silent_actions.inc.php');
if ($frm['a'] == 'edit_statistics')
 {
 include('include/admin/edit_statistics.inc.php');
 exit();
 }
if ($frm['a'] == 'edit_votes')
 {
 include('include/admin/edit_votes.inc.php');
 exit();
 }
if ($frm['a'] == 'manage_votes_edit')
 {
 include('include/admin/edit_manage_votes.inc.php');
 exit();
 }
if ($frm['a'] == 'edit_cat')
 {
 include('include/admin/edit_cat.inc.php');
 exit();
 }
include('include/admin/html.header.inc.php');
echo '<tr><td valign="top">
	 <table cellspacing=0 cellpadding=1 border=0 width="100%" bgcolor="#E4CD9C">
	   <tr><td>
           <table width="100%" border="0" cellpadding="0" cellspacing="0">
             <tr bgcolor="#FFFFFF" valign="top"><td align=center>';
include('include/admin/menu.inc.php');
echo '<br></td><td bgcolor="#E4CD9C" valign="top" width="1">&nbsp;</td>
<td bgcolor="#FFFFFF" valign="top" width="99%">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="forTexts">
<tr><td width="100%" valign="top">';
if ($frm['a'] == 'listings')
 {
 include('include/admin/listings.inc.php');
 }
else
 {
 if ($frm['a'] == 'new_listings')
  {
  include('include/admin/new_listings.inc.php');
  }
 else
  {
  if ($frm['a'] == 'add_listing')
   {
   include('include/admin/add_listing.inc.php');
   }
  else
   {
   if ($frm['a'] == 'edit_listing')
    {
    include('include/admin/edit_listing.inc.php');
    }
   else
    {
    if ($frm['a'] == 'approve_listing')
     {
     include('include/admin/approve_listing.inc.php');
     }
    else
     {
     if ($frm['a'] == 'decline_listing')
      {
      include('include/admin/decline_listing.inc.php');
      }
     else
      {
      if ($frm['a'] == 'manual_sort_listings')
       {
       include('include/admin/manual_sort_listings.inc.php');
       }
      else
       {
       if ($frm['a'] == 'groups')
        {
        include('include/admin/groups.inc.php');
        }
       else
        {
        if ($frm['a'] == 'edit_group')
         {
         include('include/admin/edit_group.inc.php');
         }
        else
         {
         if ($frm['a'] == 'banners')
          {
          include('include/admin/banners.inc.php');
          }
         else
          {
          if ($frm['a'] == 'bannermanagement')
           {
           include('include/admin/bannermanagement.inc.php');
           }
          else
           {
           if ($frm['a'] == 'edit_emails')
            {
            include('include/admin/emails.inc.php');
            }
           else
            {
            if ($frm['a'] == 'set_rcb')
             {
             include('include/admin/set_rcb.inc.php');
             }
            else
             {
             if ($frm['a'] == 'edit_rcb')
              {
              include('include/admin/edit_rcb.inc.php');
              }
             else
              {
              if ($frm['a'] == 'rcb')
               {
               include('include/admin/rcb.inc.php');
               }
              else
               {
               if ($frm['a'] == 'pay_refback')
                {
                include('include/admin/process_refback.inc.php');
                }
               else
                {
                if ($frm['a'] == 'decline_refback')
                 {
                 include('include/admin/decline_refback.inc.php');
                 }
                else
                 {
                 if (($frm['a'] == 'mass' && $frm['action2'] == 'masspay'))
                  {
                  include('include/admin/prepare_mass_pay.inc.php');
                  }
                 else
                  {
                  if ($frm['a'] == 'pay_settings')
                   {
                   include('include/admin/pay_settings.inc.php');
                   }
                  else
                   {
                   if ($frm['a'] == 'settings')
                    {
                    include('include/admin/settings.inc.php');
                    }
                   else
                    {
                    if ($frm['a'] == 'news')
                     {
                     include('include/admin/news.inc.php');
                     }
                    else
                     {
                     if ($frm['a'] == 'manage_votes')
                      {
                      include('include/admin/manage_votes.inc.php');
                      }
                     else
                      {
                      if ($frm['a'] == 'partners')
                       {
                       include('include/admin/partners.inc.php');
                       }
                      else
                       {
                       if ($frm['a'] == 'add_partner')
                        {
                        include('include/admin/add_partner.inc.php');
                        }
                       else
                        {
                        if ($frm['a'] == 'edit_partner')
                         {
                         include('include/admin/edit_partner.inc.php');
                         }
                        else
                         {
                         if ($frm['a'] == 'sections')
                          {
                          include('include/admin/sections.inc.php');
                          }
                         else
                          {
                          if ($frm['a'] == 'maillist')
                           {
                           include('include/admin/maillist.inc.php');
                           }
                          else
                           {
                           if ($frm['a'] == 'import_maillist')
                            {
                            include('include/admin/import_maillist.inc.php');
                            }
                           else
                            {
                            if ($frm['a'] == 'newsletter')
                             {
                             include('include/admin/newsletter.inc.php');
                             }
                            else
                             {
                             if ($frm['a'] == 'directory')
                              {
                              include('include/admin/directory.inc.php');
                              }
                             else
                              {
                              if ($frm['a'] == 'users')
                               {
                               include('include/admin/user_manage.inc.php');
                               }
                              else
                               {
                               if ($frm['a'] == 'edit_user')
                                {
                                include('include/admin/edit_user.inc.php');
                                }
                               else
                                {
                                if ($frm['a'] == 'scam_reports')
                                 {
                                 include('include/admin/scam_reports.inc.php');
                                 }
                                else
                                 {
                                 if ($frm['a'] == 'import_transactions')
                                  {
                                  include('include/admin/import_transactions.inc.php');
                                  }
                                 else
                                  {
                                  if ($frm['a'] == 'license')
                                   {
                                   echo '<table cellspacing="2" cellpadding="3" border="0" width="90%">
<tr><td colspan=2><b>License Information:</b></td></tr>
<tr><td colspan="2"><br>';
                                   echo start_info_table('90%');
                                   echo '';
                                   echo end_info_table('90%');
                                   echo '<br></td></tr>
<tr><td width="30%">Your Domain: </td><td><b>' . $mddomain . '</b></td></tr>
<tr><td>Your License Code: </td><td><b>' . $settings['license'] . '</b></td></tr>
</table>';
                                   }
                                  else
                                   {
                                   include('include/admin/main.inc.php');
                                   }
                                  }
                                 }
                                }
                               }
                              }
                             }
                            }
                           }
                          }
                         }
                        }
                       }
                      }
                     }
                    }
                   }
                  }
                 }
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     }
    }
   }
  }
 }
echo '</td></tr></table>
</td></tr></table>
</td></tr></table>
</td></tr>';
include('include/admin/html.footer.inc.php');
db_close($dbconn);
?>