<?php

/**
 *
 * INDEXU
 * Copyright(C), Nicecoder, 2000-2006, All Rights Reserved.
 *
 * INDEXU(tm) is protected by Indonesia and International copyright laws.
 * Unauthorized use or distribution of INDEXU(tm) is strictly prohibited,
 * violators will be prosecuted. To obtain a license for using INDEXU(tm),
 * please register at Nicecoder home page at http://www.nicecoder.com
 *
 * Author:
 *    Dody Rachmat Wicaksono (dody@nicecoder.com)
 *    M. Zuber (zubby@nicecoder.com)
 *
 */

  /*===================================================
    ShowFormConfigPayment()
  ===================================================*/

  function ShowFormConfigPayment() {

    // vars global configuration
    global $admin_template_path, $base_path;

    // vars url & form

    // vars messages

    // vars template
    global $m, $file, $content;
    
    $file = $base_path . "payment/" . $m . ".inc.php";
    $content = chop(file_get_contents($file));
      
    DisplayTemplate($admin_template_path . "inv_config_payment_form.html",
      "\$file,\$content,\$m");
  }


  /*===================================================
    ProcessFormConfigPayment()
  ===================================================*/

  function ProcessFormConfigPayment() {

    // vars global configuration
    global $admin_template_path;

    // vars url & form
    global $file,$content,$m;

    // vars messages
    global $msg;

    // vars template
    global $message, $back;

    $fp = fopen($file, 'w');
    fwrite($fp, stripslashes($content));
    fclose($fp);  

    $message = $msg['20485'];

    $back = "<a href=inv_config.php>Back</a>";

    DisplayTemplate($admin_template_path . "message.html", "\$message,\$back");
  }


  /*===================================================
    main
  ===================================================*/

  include "../application.php";
  
  RunPreFilter(__FILE__);
  
  DisplayTemplate($admin_template_path . "header.html");
  if (empty($pflag)) {
    ShowFormConfigPayment();
  }
  elseif ($pflag == 'config') {
    ProcessFormConfigPayment();
  }
  DisplayTemplate($admin_template_path . "footer.html");

  RunPostFilter(__FILE__);

?>