<?php

/***************************************************************************

 m_subcontent.php
 -----------------
 copyright : (C) 2002-2003 The ezContents Development Team

 ***************************************************************************/

/***************************************************************************
 The ezContents Development Team offers no warranties on this script.
 The owner/licensee of the script is solely responsible for any problems
 caused by installation of the script or use of the script.

 All copyright notices regarding ezContents must remain intact on the
 scripts and in the HTML for the scripts.

 For more info on ezContents,
 visit http://www.ezcontents.org/

/***************************************************************************

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the License which can be found within the
 *   zipped package.
 *
 ***************************************************************************/

include_once ("rootdatapath.php");
require_once ($GLOBALS["rootdp"]."include/config.php");
require_once ($GLOBALS["rootdp"]."include/db.php");
require_once ($GLOBALS["rootdp"]."include/session.php");

include ($GLOBALS["rootdp"]."include/access.php");

$GLOBALS["form"] = 'subcontent';
$GLOBALS["validaccess"] = VerifyAdminLogin();


include ($GLOBALS["rootdp"]."include/settings.php");
include ($GLOBALS["rootdp"]."include/functions.php");
include ("adminfunctions.php");
include ("adminbutton.php");
includeLanguageFiles('admin','subcontent');


force_page_refresh();
frmSpecialContents();


function frmSpecialContents()
{
   global $HTTP_GET_VARS, $EzAdmin_Style;

   adminheader();
   admintitle(6,$GLOBALS["tFormTitle"]);
   adminbuttons('',$GLOBALS["tAddNew"],'','');

   $strQuery = "SELECT scid FROM ".$GLOBALS["eztbSpecialcontents"];
   $result = dbRetrieve($strQuery,true,0,0);
   $rs     = dbFetch($result);
   $lRecCount = dbRowsReturned($result);
   dbFreeResult($result);

   $nCurrentPage = 0;
   if ($HTTP_GET_VARS["page"] != '') { $nCurrentPage = $HTTP_GET_VARS["page"]; }
   $nPages = intval(($lRecCount - 0.5) / $GLOBALS["RECORDS_PER_PAGE"]) + 1;
   if ($nCurrentPage >= $nPages) { $nCurrentPage = 0; }
   $lStartRec = $nCurrentPage * $GLOBALS["RECORDS_PER_PAGE"];

   adminHdFt('subcontent',6,$nCurrentPage,$nPages,'');
   ?>
   <tr class="teaserheadercontent">
       <?php
       adminlistitem(10,$GLOBALS["tEdit"],'');
       adminlistitem(18,$GLOBALS["tModuleName"],'');
       adminlistitem(38,$GLOBALS["tModuleTitle"],'');
       adminlistitem(11,$GLOBALS["tAnonPosting"],'');
       adminlistitem(10,$GLOBALS["tValReq"],'');
       adminlistitem(13,$GLOBALS["tTablename"],'');
       ?>
   </tr>
   <?php

   $strQuery = "SELECT * FROM ".$GLOBALS["eztbSpecialcontents"]." ORDER BY scname";
   $result = dbRetrieve($strQuery,true,$lStartRec,$GLOBALS["RECORDS_PER_PAGE"]);
   while ($rsContent = dbFetch($result))
   {
      ?>
      <tr class="teasercontent">
          <td align="center" valign="top" class="content">
              <?php
              $iEditCfg = lsimagehtmltag($GLOBALS["theme_home"],$EzAdmin_Style["EditIcon"],$GLOBALS["gsLanguage"],$GLOBALS["tEdit"].' '.$rsContent["scname"].' '.$GLOBALS["tConfig"],0);
				if ($iEditCfg == '') $iEditCfg = lsimagehtmltag($GLOBALS["style_home"],$EzAdmin_Style["EditIcon"],$GLOBALS["gsLanguage"],$GLOBALS["tEdit"].' '.$rsContent["scname"].' '.$GLOBALS["tConfig"],0);
              $iEdit    = lsimagehtmltag($GLOBALS["theme_home"],$EzAdmin_Style["FolderIcon"],$GLOBALS["gsLanguage"],$GLOBALS["tEdit"].' '.$rsContent["scname"],0);
				if ($iEdit == '') $iEdit = lsimagehtmltag($GLOBALS["style_home"],$EzAdmin_Style["FolderIcon"],$GLOBALS["gsLanguage"],$GLOBALS["tEdit"].' '.$rsContent["scname"],0);
              $iEditCat = lsimagehtmltag($GLOBALS["theme_home"],$EzAdmin_Style["CatIcon"],$GLOBALS["gsLanguage"],$GLOBALS["tEdit"].' '.$rsContent["scname"].' '.$GLOBALS["tCategories"],0);
				if ($iEditCat == '') $iEditCat = lsimagehtmltag($GLOBALS["style_home"],$EzAdmin_Style["CatIcon"],$GLOBALS["gsLanguage"],$GLOBALS["tEdit"].' '.$rsContent["scname"].' '.$GLOBALS["tCategories"],0);
				 ?>
              <a href="<?php echo BuildLink($GLOBALS["rootdp"].$GLOBALS["modules_home"].$rsContent["scname"].'/m_'.$rsContent["scname"].'.php'); ?>"<?php echo BuildLinkMouseOver($GLOBALS["tEdit"].' '.$rsContent["scname"]); ?>>
              <?php echo $iEdit; ?></a>&nbsp;
              <a href="<?php echo BuildLink('m_subcontentform.php'); ?>&SCID=<?php echo $rsContent["scid"]; ?>"<?php echo BuildLinkMouseOver($GLOBALS["tEdit"].' '.$rsContent["scname"].' '.$GLOBALS["tConfig"]); ?>>
              <?php echo $iEditCfg; ?></a>&nbsp;
              <?php
              if ($rsContent["scusecategories"] == 'Y')
              {
                 ?>
                 <a href="<?php echo BuildLink('m_subcontentcats.php'); ?>&SCID=<?php echo $rsContent["scdb"]; ?>"<?php echo BuildLinkMouseOver($GLOBALS["tEdit"].' '.$rsContent["scname"].' '.$GLOBALS["tCategories"]); ?>>
                 <?php echo $iEditCat; ?></a>&nbsp;
                 <?php
              }
              else { echo $GLOBALS["iBlank"]; }
              ?>
          </td>
          <td valign="top" class="content">
              <?php echo $rsContent["scname"]; ?>
          </td>
          <td valign="top" class="content">
              <?php echo $rsContent["sctitle"]; ?>
          </td>
          <td valign="top" align="center">
              <?php
              if (($rsContent["stextdisplay"] == 'Y') || ($rsContent["sgraphicdisplay"] == 'Y'))
              {
                 $regonly = $rsContent["screg"];
                 if ($regonly == 'Y') { echo $GLOBALS["tNo"]; }
                 else { echo $GLOBALS["tYes"]; }
              }
              else { echo '--'; }
              ?>
          </td>
          <td align="center" valign="top" class="content">
              <?php
              if (($rsContent["stextdisplay"] == 'Y') || ($rsContent["sgraphicdisplay"] == 'Y'))
              {
	         $validate = $rsContent["scvalid"];
                 if ($validate == 'Y') { echo $GLOBALS["tYes"]; }
                 else { echo $GLOBALS["tNo"]; }
              }
              else { echo '--'; }
              ?>
          </td>
          <td valign="top" class="content">
              <?php echo $rsContent["scdb"]; ?>
          </td>
      </tr>
      <?php
   }
   dbFreeResult($result);

   adminHdFt('subcontent',6,$nCurrentPage,$nPages,'');
   ?>
   </table>
   </form>
   </body>
   </html>
   <?php
}

?>
