<?php

include("../includes/site_config.php");
include('../session_handler.inc');
include('../message.php');
require_once('../error.php');
require_once('../functions.php');
/*if ($Sess_UserType != "A") {
	exit;
}*/

if($_GET['psp_service'])
{
    $query = "  SELECT *
                FROM payment_service_params
                WHERE psp_service = '".$_GET['psp_service']."'";
    $res = mysql_query($query);
    $row = mysql_fetch_object($res);

    $type = ($row->psp_type == 'onetime') ? 'recurring' : 'onetime';
    $query = "UPDATE payment_service_params SET psp_type = '$type' WHERE psp_service='".$_GET['psp_service']."'";
	mysql_query($query) || die(mysql_error());
}

$query = "  SELECT *
            FROM payment_service_params ";
$service_res = mysql_query($query);

# retrieve the template
$area = 'member';

?>
<?php include("include/header.php"); ?>
<table width="<?php print("$CONST_TABLE_WIDTH"); ?>" align="<?php print("$CONST_TABLE_ALIGN"); ?>" border="0" cellspacing="<?php print("$CONST_TABLE_CELLSPACING"); ?>" cellpadding="<?php print("$CONST_TABLE_CELLPADDING"); ?>">
  <tr>
    <td align="right">
      <?php 	  //require_once("$CONST_INCLUDE_ROOT/user_status.inc.php");	  require_once("../user_status.inc.php");	  ?>
    </td>
  </tr>
  <tr>
    <td class="pageheader"><?php echo ADM_SERVICE_SECTION_NAME ?></td>
  </tr>
  <tr>
    <td>

    <form method="post" action="<?php echo $CONST_LINK_ROOT?>admin/admin_paysystems.php<?php print("?PHPSESSID=".session_id()); ?>" name="frmPremFunc">
            <table width="100%"  border="0" cellspacing="0" cellpadding="4">
                <tr>
                    <th width=70% class="tdtoprow"><?=ADM_SERVICES_TITLE?></td>
                    <th width=30% class="tdtoprow"><?=ADM_SERVICES_STATUS?></td>
                </tr>
                <?php

                while  ($service = mysql_fetch_object($service_res))
                {
                    ?>
                    <tr align=center>
                        <td class="tdodd"><?=$service->psp_title?></td>
                        <td class="tdodd"><a href="<?=$CONST_LINK_ROOT?>admin/admin_services.php?psp_service=<?=$service->psp_service?>"><?php echo $service->psp_type?></a></td>
                    </tr>
                    <?php
                }
                ?>
                </table>
        </form>
    </td>
  </tr>
	</table>
<?php mysql_close( $link ); ?>
<?php include("include/footer.php"); ?>