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 ' <th>' . _('Comment') . '</th>' . chr(10); echo ' <td>' . $confirm['confirm_comment'] . '</td>' . chr(10); echo ' </tr>' . chr(10) . chr(10); echo ' <tr>' . chr(10); echo ' <th>Antall vedlegg:</th>' . chr(10); echo ' <td>'; if ($confirm['confirm_pdf'] == '1' && $confirm['confirm_pdffile'] != '') { echo count($confirm['confirm_usedatt']) + 1; } else { echo count($confirm['confirm_usedatt']); } echo '</td>' . chr(10); echo ' </tr>' . chr(10) . chr(10); echo '</table>' . chr(10); if ($confirm['confirm_pdf'] != '1') { echo '<h2>' . _('E-mail that was sent') . ':</h2>' . chr(10); echo '<textarea cols="85" rows="15">' . $confirm['confirm_txt'] . '</textarea>' . chr(10); echo '<br><br>' . chr(10); } else { echo '<h2>Følgende vedlegg var med bekreftelsen:</h2>'; echo '<ul>'; if ($confirm['confirm_pdffile'] != '') { echo '<li>' . '<a href="' . $entry_confirm_pdf_path . '/' . $confirm['confirm_pdffile'] . '">' . iconFiletype('pdf') . ' ' . $confirm['confirm_pdffile'] . '</a></li>'; } foreach ($confirm['confirm_usedatt'] as $att) { echo '<li>' . '<a href="' . $entry_confirm_att_path . '/' . $att['att_filename'] . '">' . iconFiletype($att['att_filetype']) . ' ' . $att['att_filename_orig'] . '</a></li>'; } echo '</ul>'; } echo '<h2>' . _('Template that was sent') . ':</h2>' . chr(10); echo '<textarea cols="85" rows="15">' . $confirm['confirm_tpl'] . '</textarea>' . chr(10);
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'] . '&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&id=' . $ROW['entry_type_id'] . '">' . iconHTML('page_white_edit') . ' ' . __('Edit') . ' -:- '; } echo '</td>' . chr(10); echo ' </tr>' . chr(10) . chr(10); } }
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>'; /* ## Template fields ## */ echo '<h2>' . _h('Change the templates') . '</h2>' . chr(10); echo '<div style="margin-left: 20px;">'; echo '<span id="txt_heading1">' . iconFiletype('pdf') . ' ' . _h('Content of PDF file') . ' (' . _h('can be edited here') . ')<br></span>' . chr(10); echo '<span id="txt_heading1_pdf" style="display:none;">' . _h('Content of PDF file') . ' (' . _h('can be edited here') . ')<br></span>' . chr(10); echo '<span id="txt_heading1_nopdf" style="display:none;">' . _h('Content of the e-mail') . ' (' . _h('can be edited here') . ')<br></span>' . chr(10); echo '<textarea cols="85" rows="10" name="confirm_tpl" id="confirm_tpl"></textarea><br><br>' . chr(10); //echo '<label><input type="radio" name="emailTypePDF" value="1" checked="checked"> - '. iconFiletype('pdf').' Send som PDF-vedlegg (andre vedlegg også mulig)</label><br>'; //echo '<label><input type="radio" name="emailTypePDF" value="0"> - Send som ren tekst direkte i e-posten (vedlegg ikke mulig)</label><br>'; //echo '<br><br>'.chr(10); echo '<input type="hidden" name="emailTypePDF" value="1">' . chr(10); // Only PDF enabled echo '<div id="pdf_mailbody">'; echo _h('Content of the e-mail') . ' (' . _h('can be edited here') . ')<br>'; echo '<textarea cols="85" rows="10" name="confirm_tpl_mainbody" id="confirm_tpl_mainbody">' . htmlentities(file_get_contents('templates/mail-entry-confirm-pdfbody.tpl'), ENT_QUOTES) . '</textarea><br>' . chr(10); echo '<br><br>' . chr(10); echo '</div>'; echo '</div>' . chr(10) . chr(10); echo '<input type="submit" value="' . __('Send confirmation') . '" style="font-size: 18px;"
while ($R_invoiced = mysql_fetch_assoc($Q_invoiced)) { // Emails $sendto = ''; if ($R_invoiced['emailed'] == '1') { $Q_emails = mysql_query("select * from `invoiced_emails` where `invoiced_id` = '" . $R_invoiced['invoiced_id'] . "'"); $sendto = array(); while ($R_emails = mysql_fetch_assoc($Q_emails)) { $sendto[] = $R_emails['email_addr']; } $sendto = implode($sendto, ',<br />'); } // Entries $Q_entries = mysql_query("\n\t\t\tSELECT entry . *\n\t\t\t\tFROM \n\t\t\t\t\t`entry_invoiced`\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t`entry`\n\t\t\t\tON\n\t\t\t\t\t`entry_invoiced`.entry_id = `entry`.entry_id\n\t\t\t\tWHERE\n\t\t\t\t\t`entry_invoiced`.invoiced_id = '" . $R_invoiced['invoiced_id'] . "';\n\t\t\t"); $entries = array(); while ($R_entry = mysql_fetch_assoc($Q_entries)) { $entries[] = '<a href="entry.php?entry_id=' . $R_entry['entry_id'] . '">' . iconHTML('page_white_star') . ' (' . $R_entry['entry_id'] . ') ' . $R_entry['entry_title'] . '</a>'; } $entries = implode($entries, ',<br />'); $pdf_link = ''; if ($R_invoiced['pdf_name'] != '') { $pdf_link = '<a href="' . $invoice_location . $R_invoiced['pdf_name'] . '">' . iconFiletype('pdf') . ' ' . $R_invoiced['pdf_name'] . '</a>'; } // Highlight $highlighted = ''; if (isset($_GET['highlight']) && $_GET['highlight'] == $R_invoiced['invoiced_id']) { $highlighted = ' class="notice"'; } echo '<tr' . $highlighted . '>' . '<td>' . date('d-m-Y H:i:s', $R_invoiced['created']) . '</td>' . '<td>' . $entries . '</td>' . '<td>' . $pdf_link . '</td>' . '<td>' . $sendto . '</td>' . '</tr>' . chr(10); } echo '</table>'; }
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ // Include the datagetting (also used by charts.php) require "include/entry_stat.php"; echo '<script src="js/jquery-1.3.2.js" type="text/javascript"></script>'; echo '<script src="js/jquery.blockUI.js" type="text/javascript"></script>'; echo '<script src="js/entry-stat.js" type="text/javascript"></script>'; echo '<div class="hiddenprint">'; echo '<a href="export_excel.php?filters=' . filterSerialized($filters) . '">' . iconFiletype('xls') . ' Eksporter til Excel</a><br><br>'; echo '</div>' . chr(10); echo '<div style="display: none;" id="filters">' . filterSerialized($filters) . '</div>'; echo '<div class="hiddenprint"><h2>Kommunefordelt</h2>'; echo '<a id="switchlink1" href="javascript:switchView(1, \'kommunefordelt\');">Vis kommunefordelt</a><br><br>'; echo '</div>'; echo '<div style="display:none;" id="switch1">'; //echo ' <h2 class="print">Kommunefordelt</h2>'; echo ' <table cellspacing="0" style="border-collapse: collapse;">' . chr(10); echo ' <caption>Kommunefordelt statistikk</caption>' . chr(10); echo ' <tr>' . chr(10); echo ' <td class="border">' . __('Municipal') . '</th>' . chr(10); echo ' <th class="border" headers="children">' . '<img src="./img/icons/user_small.png" style="border: 0px solid black; vertical-align: middle;"> ' . __('Children') . '</th>' . chr(10); echo ' <th class="border" headers="adults">' . '<img src="./img/icons/user_suit.png" style="border: 0px solid black; vertical-align: middle;"> ' . __('Adults') . '</th>' . chr(10); echo ' <th class="border">' . __('Total') . '</th>' . chr(10); echo ' <th class="border">' . '<img src="./img/icons/page_white.png" style="border: 0px solid black; vertical-align: middle;"> ' . __('Entries') . '</th>' . chr(10);
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>