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

  function ProcessFormDeleteFavorite() {

    // vars global configuration
    global $theme_path;

    // vars url & form
    global $id, $lid;

    // vars messages
    global $msg;

    // vars template
    global $error_msg;

    $link_id = $lid;
    
    // verify input

    $links_obj = new clsLink;
    $links_obj->favorite_table_name        = "idx_favorites";
    $links_obj->favorite_detail_table_name = "idx_favorites_detail";
    $remove_result                         = $links_obj->RemoveDetailFavorite($_COOKIE['COOKIE_USERNAME'], $id, $link_id);

    if ($remove_result == 0)
      DisplayTemplate($theme_path . "cp/favorite_detail_remove_ok.html");
    elseif ($remove_result == 1)
      DisplayTemplate($theme_path . "cp/not_allowed.html");
  }


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

  include "../application.php";

  RunPreFilter(__FILE__);

  ProcessFormDeleteFavorite();

  RunPostFilter(__FILE__);

?>