Beispiel #1
0
            // always modified
            header("Cache-Control: no-cache, must-revalidate");
            // HTTP/1.1
            header("Pragma: no-cache");
            // HTTP/1.0
            //header("Content-Type: application/json");
            echo htmlentities(mysql_result($Q_tpl, 0, 'template'), ENT_QUOTES, 'ISO-8859-1', false);
        }
    }
    exit;
} elseif (isset($_GET['attSearch'])) {
    // Searching for an attachment
    $Q_att = mysql_query("select * from `entry_confirm_attachment` where att_filename_orig like '%" . addslashes($_GET['attSearch']) . "%' order by `att_filename_orig`");
    $dynamicPrint = true;
    while ($R_att = mysql_fetch_assoc($Q_att)) {
        $aResults[] = array('att_id' => $R_att['att_id'], 'att_displayname' => $R_att['att_filename_orig'] . ' (' . smarty_modifier_file_size($R_att['att_filesize']) . ')', 'att_filetype_icon' => iconFiletypeFilename($R_att['att_filetype']) . '.gif');
    }
} else {
    exit;
    // DIE DIE DIE MY DARLING!
}
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// always modified
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Pragma: no-cache");
// HTTP/1.0
header("Content-Type: application/json");
/* */
						<input type="hidden" name="did" value="<?php 
            echo $this->_tpl_vars['demos']['id'];
            ?>
" />
						<input type="hidden" name="details_x" value="1" />
						<tr>
							<td><?php 
            echo is_array($_tmp = $this->_tpl_vars['demos']['upload_time']) ? $this->_run_mod_handler('date_format', true, $_tmp, "%d. %b %Y - %T") : smarty_modifier_date_format($_tmp, "%d. %b %Y - %T");
            ?>
</td> 
							<td><?php 
            echo $this->_tpl_vars['demos']['demo_real'];
            ?>
</td> 
							<td><?php 
            echo is_array($_tmp = $this->_tpl_vars['demos']['file_size']) ? $this->_run_mod_handler('file_size', true, $_tmp) : smarty_modifier_file_size($_tmp);
            ?>
</td> 
							<td><?php 
            if ($this->_tpl_vars['demos']['comment']) {
                echo is_array($_tmp = $this->_tpl_vars['demos']['comment']) ? $this->_run_mod_handler('bbcode2html', true, $_tmp) : smarty_modifier_bbcode2html($_tmp);
            } else {
                echo is_array($_tmp = '_NOCOMMENT') ? $this->_run_mod_handler('lang', true, $_tmp) : smarty_modifier_lang($_tmp);
            }
            ?>
</td> 
							<td><?php 
            echo $this->_tpl_vars['demos']['name'];
            ?>
</td> 
							<td><?php 
        echo '		<td>';
        echo '<div class="showButton" id="buttonId' . $ROW['entry_type_id'] . '">';
        //<a href="javascript:switchView('.$ROW['entry_type_id'].');">vis</a>';
        echo '<a href="javascript:void();">Vis / ikke vis</a>' . '</div>';
        echo '<div class="showField" id="fieldId' . $ROW['entry_type_id'] . '" style="display:none;">';
        $Q_area = mysql_query("select id as area_id, area_name from `mrbs_area` order by area_name");
        while ($area = mysql_fetch_assoc($Q_area)) {
            echo '<ul style="padding-left: 20px; "><li>';
            echo '<b>' . $area['area_name'] . '</b>';
            echo ' (<a href="' . $_SERVER['PHP_SELF'] . '?entry_type_id=' . $ROW['entry_type_id'] . '&amp;area_id=' . $area['area_id'] . '">' . iconHTML('page_white_stack_link', '.png', 'height: 12px;') . ' ' . 'Endre</a>)';
            echo '<br><ul style="padding-left: 10px; ">';
            $Q_att = mysql_query("\n\t\t\tSELECT\n\t\t\t\ta.att_filetype, a.att_filename_orig, a.att_filesize, a.att_id, e.area_id\n\t\t\tFROM `entry_type_defaultattachment` e LEFT JOIN `entry_confirm_attachment` a \n\t\t\t\tON e.att_id = a.att_id\n\t\t\tWHERE\n\t\t\t\te.entry_type_id = '" . $ROW['entry_type_id'] . "' AND\n\t\t\t\te.area_id = '" . $area['area_id'] . "'\n\t\t\tORDER BY a.att_filename_orig");
            if (!mysql_num_rows($Q_att)) {
                echo '<li><i>Ingen vedlegg koblet til</i></li>';
            } else {
                while ($att = mysql_fetch_assoc($Q_att)) {
                    echo '<li><a href="admin_attachment.php?att_id=' . $att['att_id'] . '">' . iconFiletype($att['att_filetype']) . ' ' . $att['att_filename_orig'] . '</a>' . ' (' . smarty_modifier_file_size($att['att_filesize']) . ')</li>';
                }
            }
            echo '</ul></li></ul>';
        }
        echo '</div>';
        echo '</td>';
        echo '		<td>';
        if ($login['user_access_entrytypeadmin']) {
            echo '<a href="' . $_SERVER['PHP_SELF'] . '?editor=1&amp;id=' . $ROW['entry_type_id'] . '">' . iconHTML('page_white_edit') . ' ' . __('Edit') . ' -:- ';
        }
        echo '</td>' . chr(10);
        echo '	</tr>' . chr(10) . chr(10);
    }
}
Beispiel #4
0
    if (!isset($atts[$att['att_id']])) {
        $atts[$att['att_id']] = $att['att_filename_orig'];
    }
}
$Q_att = mysql_query("\nSELECT\ta.att_id, a.att_filename_orig\nFROM\t`entry_confirm_attachment` a, `entry_type_defaultattachment` e\nWHERE\n\ta.att_id = e.att_id\tAND\n\te.entry_type_id = '" . $entry['entry_type_id'] . "' AND\n\te.area_id = '" . $entry['area_id'] . "'\n;\n\t\t");
while ($att = mysql_fetch_assoc($Q_att)) {
    if (!isset($atts[$att['att_id']])) {
        $atts[$att['att_id']] = $att['att_filename_orig'];
    }
}
natcasesort($atts);
echo '<ul id="vedlegg">';
foreach ($atts as $att_id => $a) {
    $att = getAttachment($att_id);
    if (count($att)) {
        echo '<li id="vedleggValgt' . $att['att_id'] . '">' . '<input type="hidden" value="' . $att['att_id'] . '" name="attachment[]"/>' . iconFiletype($att['att_filetype']) . ' ' . $att['att_filename_orig'] . ' (' . smarty_modifier_file_size($att['att_filesize']) . ')' . '<input type="button" class="attSelected" style="font-size: 10px;" value="Fjern" onclick="removeAttachment(' . $att['att_id'] . ');"/>' . '</li>';
    }
}
echo '</ul>';
echo '</div>';
echo '<input type="button" id="velgVedlegg" class="ui-button ui-state-default ui-corner-all" value="Velg fil(er)">';
echo '</div>';
// Disabled:
echo '<div style="width: 400px; margin-left: 20px; display:none; font-size: 14px;" class="error" id="emailAttachmentDisabled">' . 'Vedlegg er ikke mulig når sendingstype er ren tekst.<br>Velg PDF for vedlegg.</div>';
/* ## SEND BEKREFTELSE ## */
echo '<h2>Send bekreftelse</h2>';
echo '<div style="margin-left: 20px;">';
echo '<div class="notice" id="noPDF" style="display:none;">' . '<h2>Ingen mal valgt</h2>' . 'Du har ikke valgt mal og PDF-vedlegg blir da ikke sendt (eller e-posten blir tom).<br>' . 'Er du sikker på at du vil fortsette?<br><br>' . '<label><input type="checkbox" id="nopdf_confirm"> Ja, jeg vil fortsette</label>' . '</div>' . chr(10) . chr(10);
echo '<div class="notice" id="failedEmail" style="display:none;">' . '<h2>Feil med en eller flere e-poster</h2>' . 'Du har en eller flere e-post-adressene med feil. Sjekk disse over.<br>' . '</div>' . chr(10) . chr(10);
echo '<input type="text" name="confirm_comment" size="20"> - ' . _('Internal comment') . ' (vil ligge i loggen)<br><br><br>' . chr(10);
echo '<input type="submit" value="' . _('Send confirmation') . '" style="font-size: 18px;"
    echo '<h2 style="font-weight: bold; font-size: 14px; padding: 5px; margin-bottom: 0">10 sist brukte vedlegg:</h2>';
    echo '	<ul style="padding-left: 0px; margin-top: 0px; list-style-image:none; list-style-position:outside; list-style-type:none;">';
    while ($R_att = mysql_fetch_assoc($Q_att)) {
        $att = getAttachment($R_att['att_id']);
        if (count($att)) {
            echo '		<li class="attSelector attid' . $att['att_id'] . '" id="attId-' . $att['att_id'] . '">' . iconFiletype($att['att_filetype']) . ' ' . $att['att_filename_orig'] . ' (' . smarty_modifier_file_size($att['att_filesize']) . ')';
        }
    }
    echo '	</ul>';
}
$Q_att = mysql_query("\n\tSELECT att.att_id\n\tFROM `entry_confirm_attachment` att\n\tORDER BY att.att_uploadtime desc LIMIT 10");
if (mysql_num_rows($Q_att)) {
    echo '<h2 style="font-weight: bold; font-size: 14px; padding: 5px; margin-bottom: 0">10 sist opplastet vedlegg:</h2>';
    echo '	<ul style="padding-left: 0px; margin-top: 0px; list-style-image:none; list-style-position:outside; list-style-type:none;">';
    while ($R_att = mysql_fetch_assoc($Q_att)) {
        $att = getAttachment($R_att['att_id']);
        if (count($att)) {
            echo '		<li class="attSelector attid' . $att['att_id'] . '" id="attId-' . $att['att_id'] . '">' . iconFiletype($att['att_filetype']) . ' ' . $att['att_filename_orig'] . ' (' . smarty_modifier_file_size($att['att_filesize']) . ')';
        }
    }
    echo '	</ul>';
}
?>

	<h2 style="font-weight: bold; font-size: 14px; padding: 5px; margin-bottom: 0">Søk etter andre vedlegg:</h2>
	<form id="attSearchForm">
	Filnavn: <input type="text" value="" id="attSearch"> <input type="button" value="Søk" id="attSearchButton">
	</form>
	<ul style="padding-left: 0px; margin-top: 0px; list-style-image:none; list-style-position:outside; list-style-type:none;" id="attSearchResult">
	</ul>
</div>