<?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)
 *
 */

  /*===================================================
    ProcessMarkAsUnpaid()
  ===================================================*/

  function ProcessMarkAsUnpaid() {

    // vars global configuration
    global $dbConn, $admin_template_path, $site_url;

    // vars messages
    global $msg;

    // vars url & form
    global $id;

    // vars template
    global $message;

    $query = "update idx_invoice set paid = '0' where invoice_id = '$id'";
    $result = $dbConn->execute($query);

    $message = $msg['20488'];

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


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

  include "../application.php";
  
  RunPreFilter(__FILE__);

  DisplayTemplate($admin_template_path . "header.html");
  ProcessMarkAsUnpaid();
  DisplayTemplate($admin_template_path . "footer.html");

  RunPostFilter(__FILE__);

?>