<?php
/*********************************************************
* PROJECT: pfister und parter, 2004 businex, mannheim
* FILE:    service/index.php
* TASK:    Presseartikel anzeigen
* -----------------------------------------------------
* 10.02.2003    mtidona Erstellung
* 24.12.2005    mtidona lange links verhindert
**********************************************************/

/* -------------------------------------------- */
/* Head                                         */
/* -------------------------------------------- */
$template_title = "Treffsicher kleiden - Stilberatung, Imageberatung, Seminare, Workshops für Firmen und Unternehmen";
include("../includes/t_press_head.php");
?>

<table width="100%" border="0" cellspacing="10" cellpadding="0">
  <tr>
    <td>
    <span style="font: bold 11pt Verdana, Arial, Helvetica, sans-serif; color: #052D55">Presse</span>
    </td>
  </tr>
</table>


<table width="100%" border="0" cellspacing="10" cellpadding="0">

<?php /** zeige alle inhalte f&uuml;r diesen bereich an **/ ?>
<?php $count_mitrubrics = db_count_tablerows("SELECT * FROM press WHERE rubric_id>0"); ?>
<?php $count_ohnerubrics = db_count_tablerows("SELECT * FROM press WHERE rubric_id='0'"); ?>
<?php if ($count_mitrubrics || $count_ohnerubrics) { ?>

    <?php /*handle rubriclose eintr&auml;ge, rubric_id=0*/ ?>
    <?php if ($count_ohnerubrics) { ?>

        <br>
        <?php $alle_rubriclosen_ids = db_select("SELECT press_id FROM press WHERE rubric_id='0' ORDER BY sortorder DESC"); ?>
        <?php foreach ($alle_rubriclosen_ids as $the_id) { ?>
            <?php $dat = db_query_onerecord("SELECT * FROM press WHERE press_id=$the_id[press_id]"); ?>
            <tr>
              <td>
                <?php /*zeige einen eintrag*/ ?>
                <table width=100% border=0 cellspacing=0 cellpadding=0>
                    <tr>
                       <td valign="top">
                         <b><?php echo $dat[title]; ?></b><br>
                         <?php if ($dat[text]) { ?><span class="mini"><?php echo nl2br($dat[text]); ?></span><?php } ?>
                         <?php if ($dat[link]) { ?><br><br><a href="<?=$dat[link]?>" target="_blank" title="Link: <?=$dat[link]?>"><img src="../images/link.gif" border="0">&nbsp;<?=display_long_weblink($dat[link])?></a><?php } ?>
                         <?php if ($dat[file]) { ?><br><br><a href="<?=$config[www_root]?>service/media/<?=$dat[file]?>" target="_blank" title="Download"><img src="../images/download.gif" border="0">&nbsp;<?=$dat[file]?></a><?php } ?>
                       </td>
                    </tr>
                </table>
                <hr>
              </td>
            </tr>
        <?php } //each eintrag ohne rubric ?>

    <?php } //rubriclose eintr&auml;ge vorhanden ?>


    <?php /*handle rubrizierte eintr&auml;ge, rubric_id>0*/ ?>
    <?php if ($count_mitrubrics) { ?>

        <?php /*alle rubrics hier drin loopen*/ ?>
        <?php $alle_rubric_ids = db_select("SELECT DISTINCT press.rubric_id FROM press, rubrics WHERE press.rubric_id>0 AND rubrics.rubric_id=press.rubric_id ORDER BY rubrics.sortorder DESC"); ?>
        <?php foreach ($alle_rubric_ids as $the_id) { ?>

            <?php /*alle eintr&auml;ge aus dieser rubric loopen*/ ?>
            <?php $r_name = db_query_onerecord("SELECT descr FROM rubrics WHERE rubric_id=$the_id[rubric_id]"); ?>

            <tr>
              <td>
                <hr><h2><?=$r_name[descr]; ?></h2>
              </td>
            </tr>

            <?php $alle_diese_rubric_ids = db_select("SELECT press_id FROM press WHERE rubric_id=$the_id[rubric_id] ORDER BY sortorder DESC"); ?>
            <?php foreach ($alle_diese_rubric_ids as $the_one_id) { ?>
                <?php $dat = db_query_onerecord("SELECT * FROM press WHERE press_id=$the_one_id[press_id]"); ?>
                <tr>
                  <td>
                    <?php /*zeige einen eintrag*/ ?>
                    <table width=100% border=0 cellspacing=0 cellpadding=0>
                        <tr>
                           <td valign="top">
                             <b><?php echo $dat[title]; ?></b><br>
                             <?php if ($dat[text]) { ?><span class="mini"><?php echo nl2br($dat[text]); ?></span><?php } ?>
                             <?php if ($dat[link]) { ?><br><br><a href="<?=$dat[link]?>" target="_blank" title="Link: <?=$dat[link]?>"><img src="../images/link.gif" border="0">&nbsp;<?=display_long_weblink($dat[link])?></a><?php } ?>
                             <?php if ($dat[file]) { ?><br><br><a href="<?=$config[www_root]?>service/media/<?=$dat[file]?>" target="_blank" title="Download"><img src="../images/download.gif" border="0">&nbsp;<?=$dat[file]?></a><?php } ?>
                           </td>
                        </tr>
                    </table>
                    <br>
                  </td>
                </tr>
            <?php } //each eintrag in this rubric ?>

        <?php } //each rubric ?>

    <?php } //liste mit rubrics ?>


<?php } else { //keine Inhalte f&uuml;r diesen Bereich vorhanden ?>

    <tr>
      <td colspan="3"><br><br><b>Entschuldigung!</b><br><br><i>Zur Zeit sind keine Presse-Artikel verf&uuml;gbar!</i><br><br></td>
    </tr>

<?php } //Inhalte f&uuml;r diesen Bereich? ?>


</table>



<?php
/* -------------------------------------------- */
/* Foot                                         */
/* -------------------------------------------- */
include ($config[doc_root]."includes/t_press_foot.php");
?>