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

  function ShowMyListing() {

    // vars global configuration
    global $dbConn, $theme_path, $category_separator;

    // vars messages
    global $msg;

    // vars template
    global $link, $err, $error_msg;

    if ($err) {
      $error_msg = $msg['20191'];
    }
    
    $links_obj                      = new clsLink;

    // get active listing
    $query  = "select b.* 
               from idx_link_user a 
                    inner join idx_link b on (a.link_id = b.link_id)
               where username = '$_COOKIE[COOKIE_USERNAME]'";
    $links_obj->query               = $query;
    $links_obj->table_name          = "idx_link";
    $links_obj->category_table_name = "idx_category";
    $links_obj->template_file       = $theme_path . "cp/mylisting_rows.html";
    $links_obj->date_format         = $msg["10151"];
    $links_obj->max_rows            = 100;
    $link                           = $links_obj->Display();

    // get pending listing
    $query  = "select b.* 
               from idx_link_temp_user a 
                    inner join idx_link_temp b on (a.vid = b.vid)
               where username = '$_COOKIE[COOKIE_USERNAME]'";
    $links_obj->query               = $query;
    $links_obj->table_name          = "idx_link_temp";
    $links_obj->category_table_name = "idx_category";
    $links_obj->template_file       = $theme_path . "cp/mylisting_pending_rows.html";
    $links_obj->date_format         = $msg["10151"];
    $links_obj->max_rows            = 100;
    $links_obj->custom_field_offset++;
    $link                          .= $links_obj->Display();

    DisplayTemplate($theme_path . "cp/mylisting.html", "\$link,\$error_msg");
  }
  

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

  include "../application.php";

  RunPreFilter(__FILE__);

  ShowMyListing();

  RunPostFilter(__FILE__);

?>