function render_Input($formname, $name)
 {
     $Return = false;
     if ($this->check_FormExists($formname)) {
         //all inputs:
         if (!isset($this->INPUT[$formname][$name]['id'])) {
             $this->INPUT[$formname][$name]['id'] = $this->INPUT[$formname][$name]['name'];
         }
         //ausser hidden!!!
         if ($this->INPUT[$formname][$name]['type'] != "hidden") {
             $this->INPUT[$formname][$name]['html'] = $this->INPUT[$formname][$name]['tag_pre'];
             $this->INPUT[$formname][$name]['html'] .= "<label for=\"" . $this->INPUT[$formname][$name]['name'] . "\" class=\"mFormFieldLabel\"><span class=\"mFormFieldLabel\">\n";
             $this->INPUT[$formname][$name]['html'] .= $this->INPUT[$formname][$name]['label'] . "</span>\n";
             //<span class=\"mFormFieldLabelDesc\">".$this->INPUT[$formname][$name]['desc']."</span>";
             $this->INPUT[$formname][$name]['html'] .= "</label>\n";
         }
         $InputStyleClass = "";
         $InputOnAction = $this->INPUT[$formname][$name]['js'];
         //1st use the assigned class
         if (!empty($this->INPUT[$formname][$name]['class'])) {
             $InputStyleClass .= " class=\"" . $this->INPUT[$formname][$name]['class'] . "\"";
             $InputOnAction .= " onFocus=\"document.getElementById('" . $this->INPUT[$formname][$name]['name'] . "').className = '" . $this->INPUT[$formname][$name]['class_active'] . "';\"";
             $InputOnAction .= " onBlur=\"document.getElementById('" . $this->INPUT[$formname][$name]['name'] . "').className = '" . $this->INPUT[$formname][$name]['class'] . "';\"";
         } else {
             //2nd: try to get assigned style if no class is set or empty
             if (!empty($this->INPUT[$formname][$name]['style'])) {
                 $InputStyleClass .= " style=\"" . $this->INPUT[$formname][$name]['style'] . "\"";
                 $InputOnAction .= " onFocus=\"document.getElementById('" . $this->INPUT[$formname][$name]['name'] . "').style = '" . $this->INPUT[$formname][$name]['style_active'] . "';\"";
                 $InputOnAction .= " onBlur=\"document.getElementById('" . $this->INPUT[$formname][$name]['name'] . "').style = '" . $this->INPUT[$formname][$name]['style'] . "';\"";
             } else {
                 //if no sepcific class or style for input has assigned or is empty, use the default class defined for the inputs
                 if (!empty($this->FORM[$formname]['class_input'])) {
                     $InputStyleClass .= " class=\"" . $this->FORM[$formname]['class_input'] . "\"";
                     $InputOnAction .= " onFocus=\"document.getElementById('" . $this->INPUT[$formname][$name]['name'] . "').className = '" . $this->FORM[$formname]['class_active_input'] . "';\"";
                     $InputOnAction .= " onBlur=\"document.getElementById('" . $this->INPUT[$formname][$name]['name'] . "').className = '" . $this->FORM[$formname]['class_input'] . "';\"";
                 } else {
                     //if theres no default class at all and no styles and classes , use the default input style assigned to form if not empty
                     if (!empty($this->FORM[$formname]['style_input'])) {
                         $InputStyleClass .= " style=\"" . $this->FORM[$formname]['style_input'] . "\"";
                         $InputOnAction .= " onFocus=\"document.getElementById('" . $this->INPUT[$formname][$name]['name'] . "').style = '" . $this->FORM[$formname]['style_active_input'] . "';\"";
                         $InputOnAction .= " onBlur=\"document.getElementById('" . $this->INPUT[$formname][$name]['name'] . "').style = '" . $this->FORM[$formname]['style_input'] . "';\"";
                     }
                 }
             }
         }
         //hidden
         if ($this->INPUT[$formname][$name]['type'] == "hidden") {
             $this->INPUT[$formname][$name]['html'] .= "<input";
             $this->INPUT[$formname][$name]['html'] .= " type=\"" . $this->INPUT[$formname][$name]['type'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " name=\"" . $this->INPUT[$formname][$name]['name'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " id=\"" . $this->INPUT[$formname][$name]['id'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " value=\"" . $this->INPUT[$formname][$name]['value'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= ">\n";
         }
         //file
         if ($this->INPUT[$formname][$name]['type'] == "file") {
             $this->INPUT[$formname][$name]['html'] .= "<input";
             $this->INPUT[$formname][$name]['html'] .= " type=\"" . $this->INPUT[$formname][$name]['type'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " name=\"" . $this->INPUT[$formname][$name]['name'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " id=\"" . $this->INPUT[$formname][$name]['id'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " tabindex=\"" . $this->INPUT[$formname][$name]['order'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " title=\"" . clear_text($this->INPUT[$formname][$name]['desc']) . "\"";
             $this->INPUT[$formname][$name]['html'] .= " " . $InputStyleClass;
             $this->INPUT[$formname][$name]['html'] .= " " . $InputOnAction;
             $this->INPUT[$formname][$name]['html'] .= ">\n\n";
         }
         //text || password
         if ($this->INPUT[$formname][$name]['type'] == "text" || $this->INPUT[$formname][$name]['type'] == "password") {
             $this->INPUT[$formname][$name]['html'] .= "<input";
             $this->INPUT[$formname][$name]['html'] .= " type=\"" . $this->INPUT[$formname][$name]['type'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " name=\"" . $this->INPUT[$formname][$name]['name'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " id=\"" . $this->INPUT[$formname][$name]['id'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " value=\"" . $this->INPUT[$formname][$name]['value'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " size=\"" . $this->INPUT[$formname][$name]['sizeX'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " maxlength=\"" . $this->INPUT[$formname][$name]['sizeY'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " tabindex=\"" . $this->INPUT[$formname][$name]['order'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " title=\"" . clear_text($this->INPUT[$formname][$name]['desc']) . "\"";
             if ($this->INPUT[$formname][$name]['readonly']) {
                 $this->INPUT[$formname][$name]['html'] .= " readonly disabled";
             }
             $this->INPUT[$formname][$name]['html'] .= " " . $InputStyleClass;
             $this->INPUT[$formname][$name]['html'] .= " " . $InputOnAction;
             $this->INPUT[$formname][$name]['html'] .= ">\n\n";
         }
         //textarea
         if ($this->INPUT[$formname][$name]['type'] == "textarea") {
             $this->INPUT[$formname][$name]['html'] .= "<" . $this->INPUT[$formname][$name]['type'];
             $this->INPUT[$formname][$name]['html'] .= " name=\"" . $this->INPUT[$formname][$name]['name'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " id=\"" . $this->INPUT[$formname][$name]['id'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " cols=\"" . $this->INPUT[$formname][$name]['sizeX'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " rows=\"" . $this->INPUT[$formname][$name]['sizeY'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " tabindex=\"" . $this->INPUT[$formname][$name]['order'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " title=\"" . clear_text($this->INPUT[$formname][$name]['desc']) . "\"";
             if ($this->INPUT[$formname][$name]['readonly']) {
                 $this->INPUT[$formname][$name]['html'] .= " readonly disabled";
             }
             $this->INPUT[$formname][$name]['html'] .= " " . $InputStyleClass;
             $this->INPUT[$formname][$name]['html'] .= " " . $InputOnAction;
             $this->INPUT[$formname][$name]['html'] .= ">";
             $this->INPUT[$formname][$name]['html'] .= $this->INPUT[$formname][$name]['value'];
             $this->INPUT[$formname][$name]['html'] .= "</" . $this->INPUT[$formname][$name]['type'] . ">\n";
         }
         //checkbox
         if ($this->INPUT[$formname][$name]['type'] == "checkbox") {
             $this->INPUT[$formname][$name]['html'] .= "<input";
             $this->INPUT[$formname][$name]['html'] .= " type=\"" . $this->INPUT[$formname][$name]['type'] . "\"";
             if ($this->INPUT[$formname][$name]['multiple']) {
                 $this->INPUT[$formname][$name]['html'] .= " name=\"" . $this->INPUT[$formname][$name]['name'] . "[]\"";
             } else {
                 $this->INPUT[$formname][$name]['html'] .= " name=\"" . $this->INPUT[$formname][$name]['name'] . "\"";
             }
             $this->INPUT[$formname][$name]['html'] .= " id=\"" . $this->INPUT[$formname][$name]['id'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " value=\"" . $this->INPUT[$formname][$name]['value'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " tabindex=\"" . $this->INPUT[$formname][$name]['order'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " title=\"" . clear_text($this->INPUT[$formname][$name]['desc']) . "\"";
             if ($this->INPUT[$formname][$name]['value'] == $this->INPUT[$formname][$name]['default']) {
                 $this->INPUT[$formname][$name]['html'] .= " checked=\"checked\"";
             }
             if ($this->INPUT[$formname][$name]['readonly']) {
                 $this->INPUT[$formname][$name]['html'] .= " readonly disabled";
             }
             $this->INPUT[$formname][$name]['html'] .= " " . $InputStyleClass;
             $this->INPUT[$formname][$name]['html'] .= " " . $InputOnAction;
             $this->INPUT[$formname][$name]['html'] .= ">\n";
             #$this->INPUT[$formname][$name]['html'] .= ">\n</div>\n";
         }
         //submit || reset
         if ($this->INPUT[$formname][$name]['type'] == "submit" || $this->INPUT[$formname][$name]['type'] == "reset") {
             $this->INPUT[$formname][$name]['html'] .= "<input";
             if (!empty($this->INPUT[$formname][$name]['source']) && $this->INPUT[$formname][$name]['type'] == "submit") {
                 $this->INPUT[$formname][$name]['html'] .= " type=\"image\"";
                 $this->INPUT[$formname][$name]['html'] .= " src=\"" . $this->INPUT[$formname][$name]['source'] . "\"";
             } else {
                 $this->INPUT[$formname][$name]['html'] .= " type=\"" . $this->INPUT[$formname][$name]['type'] . "\"";
             }
             $this->INPUT[$formname][$name]['html'] .= " name=\"" . $this->INPUT[$formname][$name]['name'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " id=\"" . $this->INPUT[$formname][$name]['id'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " tabindex=\"" . $this->INPUT[$formname][$name]['order'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " title=\"" . clear_text($this->INPUT[$formname][$name]['desc']) . "\"";
             if ($this->INPUT[$formname][$name]['readonly']) {
                 $this->INPUT[$formname][$name]['html'] .= " readonly disabled";
             }
             $this->INPUT[$formname][$name]['html'] .= " " . $InputStyleClass;
             $this->INPUT[$formname][$name]['html'] .= " " . $InputOnAction;
             $this->INPUT[$formname][$name]['html'] .= " value=\"" . $this->INPUT[$formname][$name]['value'] . "\">";
         }
         //select
         if ($this->INPUT[$formname][$name]['type'] == "select") {
             $this->INPUT[$formname][$name]['html'] .= "<";
             $this->INPUT[$formname][$name]['html'] .= $this->INPUT[$formname][$name]['type'];
             if ($this->INPUT[$formname][$name]['multiple']) {
                 $this->INPUT[$formname][$name]['html'] .= " name=\"" . $this->INPUT[$formname][$name]['name'] . "[]\"";
             } else {
                 $this->INPUT[$formname][$name]['html'] .= " name=\"" . $this->INPUT[$formname][$name]['name'] . "\"";
             }
             $this->INPUT[$formname][$name]['html'] .= " id=\"" . $this->INPUT[$formname][$name]['id'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " tabindex=\"" . $this->INPUT[$formname][$name]['order'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " size=\"" . $this->INPUT[$formname][$name]['sizeY'] . "\"";
             $this->INPUT[$formname][$name]['html'] .= " title=\"" . clear_text($this->INPUT[$formname][$name]['desc']) . "\"";
             if ($this->INPUT[$formname][$name]['readonly']) {
                 $this->INPUT[$formname][$name]['html'] .= " disabled";
             }
             if ($this->INPUT[$formname][$name]['multiple']) {
                 $this->INPUT[$formname][$name]['html'] .= " multiple";
             }
             $this->INPUT[$formname][$name]['html'] .= " " . $InputStyleClass;
             $this->INPUT[$formname][$name]['html'] .= " " . $InputOnAction;
             $this->INPUT[$formname][$name]['html'] .= ">\n";
             if (!empty($this->INPUT[$formname][$name]['value'])) {
                 $this->INPUT[$formname][$name]['html'] .= "<option value=\"" . $this->INPUT[$formname][$name]['value'] . "\">" . $this->INPUT[$formname][$name]['value'] . "</option>\n";
             }
             if (isset($this->OPTION[$formname][$name])) {
                 $count = count($this->OPTION[$formname][$name]);
                 $group_open = false;
                 for ($counter = 0; $counter < $count; $counter++) {
                     if (!empty($this->OPTION[$formname][$name][$counter]['group']) && !$group_open) {
                         if ($counter == 0 || $counter >= 1 && $this->OPTION[$formname][$name][$counter - 1]['group'] != $this->OPTION[$formname][$name][$counter]['group']) {
                             $this->INPUT[$formname][$name]['html'] .= "<optgroup label=\"" . $this->OPTION[$formname][$name][$counter]['group'] . "\">\n";
                             $group_open = true;
                         }
                     }
                     $this->INPUT[$formname][$name]['html'] .= "<option value=\"" . $this->OPTION[$formname][$name][$counter]['value'] . "\"";
                     //is array, multiple select!
                     if ($this->INPUT[$formname][$name]['multiple']) {
                         //echo 	"pt_register(".$this->FORM[$formname]['method'].",".$this->INPUT[$formname][$name]['name'].")";
                         //hack! need ptregister, sets global var....umpf
                         pt_register($this->FORM[$formname]['method'], $this->INPUT[$formname][$name]['name']);
                         $tmp = $this->INPUT[$formname][$name]['name'];
                         global ${$tmp};
                         $tmp_a = ${$tmp};
                         //echo $tmp_a;
                         if (is_array($tmp_a)) {
                             //print_r($tmp_a);
                             $tmp_c = count($tmp_a);
                             for ($tmp_cc = 0; $tmp_cc < $tmp_c; $tmp_cc++) {
                                 if ($this->OPTION[$formname][$name][$counter]['value'] == $tmp_a[$tmp_cc]) {
                                     $this->INPUT[$formname][$name]['html'] .= " selected=\"selected\"";
                                 }
                             }
                         }
                     } else {
                         //einfacher wert
                         if ($this->INPUT[$formname][$name]['default'] == $this->OPTION[$formname][$name][$counter]['value']) {
                             $this->INPUT[$formname][$name]['html'] .= " selected=\"selected\" ";
                         }
                     }
                     if (!empty($this->OPTION[$formname][$name][$counter]['style'])) {
                         $this->INPUT[$formname][$name]['html'] .= " style=\"" . $this->OPTION[$formname][$name][$counter]['style'] . "\"";
                     }
                     $this->INPUT[$formname][$name]['html'] .= ">" . $this->OPTION[$formname][$name][$counter]['desc'] . "</option>\n";
                     if (!empty($this->OPTION[$formname][$name][$counter]['group']) && $group_open) {
                         if (!isset($this->OPTION[$formname][$name][$counter + 1]) || $this->OPTION[$formname][$name][$counter + 1]['group'] != $this->OPTION[$formname][$name][$counter]['group']) {
                             //$counter == 0 || ($counter >= 1 &&  )
                             $this->INPUT[$formname][$name]['html'] .= "</optgroup>\n";
                             $group_open = false;
                         }
                     }
                 }
             }
             $this->INPUT[$formname][$name]['html'] .= "</select>\n";
         }
         //radio
         if ($this->INPUT[$formname][$name]['type'] == "radio") {
             if (isset($this->OPTION[$formname][$name])) {
                 $count = count($this->OPTION[$formname][$name]);
                 for ($counter = 0; $counter < $count; $counter++) {
                     $this->INPUT[$formname][$name]['html'] .= $this->OPTION[$formname][$name][$counter]['desc'] . ":";
                     $this->INPUT[$formname][$name]['html'] .= "<input ";
                     $this->INPUT[$formname][$name]['html'] .= " type=\"" . $this->INPUT[$formname][$name]['type'] . "\"";
                     $this->INPUT[$formname][$name]['html'] .= " name=\"" . $this->INPUT[$formname][$name]['name'] . "\"";
                     $this->INPUT[$formname][$name]['html'] .= " id=\"" . $this->INPUT[$formname][$name]['id'] . "\"";
                     $this->INPUT[$formname][$name]['html'] .= " tabindex=\"" . $this->INPUT[$formname][$name]['order'] . "\"";
                     $this->INPUT[$formname][$name]['html'] .= " title=\"" . clear_text($this->INPUT[$formname][$name]['desc']) . "\"";
                     if ($this->INPUT[$formname][$name]['readonly']) {
                         $this->INPUT[$formname][$name]['html'] .= " readonly disabled";
                     }
                     $this->INPUT[$formname][$name]['html'] .= " value=\"" . $this->OPTION[$formname][$name][$counter]['value'] . "\"";
                     if ($this->INPUT[$formname][$name]['default'] == $this->OPTION[$formname][$name][$counter]['value']) {
                         $this->INPUT[$formname][$name]['html'] .= " checked=\"checked\"";
                     }
                     $this->INPUT[$formname][$name]['html'] .= " " . $InputStyleClass;
                     $this->INPUT[$formname][$name]['html'] .= " " . $InputOnAction;
                     $this->INPUT[$formname][$name]['html'] .= ">\n";
                 }
             }
         }
         $this->INPUT[$formname][$name]['html'] .= $this->INPUT[$formname][$name]['tag_post'];
         $Return = true;
     }
     return $Return;
 }
         $SubscriptionMail_Subject = "Tellmatic: Abmeldung / Unsubscribe";
         $SubscriptionMail_HTML = "";
         $SubscriptionMail_HTML .= "<br><b>" . $created . "</b>\n" . "<br>'<b>" . $memo . "</b>'\n" . "<br>AID: <b>" . $ADR[0]['id'] . "</b>\n" . "<br>\n" . "<br>Folgender Benutzer hat sich aus der Verteilerliste ausgetragen und moechte kein Newsletter mehr erhalten:\n" . "<br>The following user has unsubscribed:\n" . "<ul>Daten:\n" . "<li>e-Mail: <b>" . $ADR[0]['email'] . "</b></li>\n" . "<li>F0: <b>" . $ADR[0]['f0'] . "</b></li>\n" . "<li>F1: <b>" . $ADR[0]['f1'] . "</b></li>\n" . "<li>F2: <b>" . $ADR[0]['f2'] . "</b></li>\n" . "<li>F3: <b>" . $ADR[0]['f3'] . "</b></li>\n" . "<li>F4: <b>" . $ADR[0]['f4'] . "</b></li>\n" . "<li>F5: <b>" . $ADR[0]['f5'] . "</b></li>\n" . "<li>F6: <b>" . $ADR[0]['f6'] . "</b></li>\n" . "<li>F7: <b>" . $ADR[0]['f7'] . "</b></li>\n" . "<li>F8: <b>" . $ADR[0]['f8'] . "</b></li>\n" . "<li>F9: <b>" . $ADR[0]['f9'] . "</b></li>\n" . "</ul>\n" . "<br>\n" . "Code: <b>" . $code . "</b>\n" . "<br>\n" . "<br>\n" . "Der Datensatz wurde de-aktiviert und markiert (Unsubscribed) und wurde ab sofort aus der Empfaengerliste ausgeschlossen.\n" . "<br>The Address has been deactivated and marked as unsubscribed and will be excluded from recipients list.\n";
         @SendMail_smtp($HOST[0]['sender_email'], $HOST[0]['sender_name'], $C[0]['notify_mail'], $HOST[0]['sender_name'], $SubscriptionMail_Subject, clear_text($SubscriptionMail_HTML), $SubscriptionMail_HTML, array(), $HOST);
         //fixed, now uses defaulthost
         //now use smtp directly
         //sendmail_smtp[0]=true/false [1]=""/errormessage
         if ($C[0]['unsubscribe_sendmail'] == 1) {
             //unsubscribe mail to subscriber
             $UnsubscribeMail_Subject = "Tellmatic: Abmeldung / Unsubscribe";
             $_Tpl_UnsubscribeMail = new tm_Template();
             $_Tpl_UnsubscribeMail->setTemplatePath(TM_TPLPATH);
             $_Tpl_UnsubscribeMail->setParseValue("EMAIL", $email);
             $_Tpl_UnsubscribeMail->setParseValue("DATE", date(TM_NL_DATEFORMAT));
             $UnsubscribeMail_HTML = $_Tpl_UnsubscribeMail->renderTemplate("Unsubscribe_mail.html");
             @SendMail_smtp($HOST[0]['sender_email'], $HOST[0]['sender_name'], $email, "<__" . $email . "__>", $UnsubscribeMail_Subject, clear_text($UnsubscribeMail_HTML), $UnsubscribeMail_HTML, array(), $HOST);
             //fixed, now uses defaulthost
             //now use smtp directly
             //sendmail_smtp[0]=true/false [1]=""/errormessage
         }
         $email = "";
     }
     //send notify
     $FMESSAGE .= ___("Ihre Adresse wurde aus unserem Verteiler entfernt.");
 } else {
     //unsubscribe()
     //sonstiger fehler
     $email = "";
     $FMESSAGE .= ___("Ein Fehler ist aufgetreten");
 }
 /*
    $InputName_F3 = "f3";
    ${$InputName_F3} = getVar($InputName_F3);
    $InputName_F4 = "f4";
    ${$InputName_F4} = getVar($InputName_F4);
    $InputName_F5 = "f5";
    ${$InputName_F5} = getVar($InputName_F5);
    $InputName_F6 = "f6";
    ${$InputName_F6} = getVar($InputName_F6);
    $InputName_F7 = "f7";
    ${$InputName_F7} = getVar($InputName_F7);
    $InputName_F8 = "f8";
    ${$InputName_F8} = getVar($InputName_F8);
    $InputName_F9 = "f9";
    ${$InputName_F9} = getVar($InputName_F9);
    $InputName_Memo = "memo";
    ${$InputName_Memo} = clear_text(getVar($InputName_Memo));
    //public groups the subscriber can choose....
    $InputName_GroupPub = "adr_grp_pub";
    pt_register("POST", $InputName_GroupPub);
    if (!isset(${$InputName_GroupPub})) {
        ${$InputName_GroupPub} = array();
    }
}
//use form, no doptin
//kein doptin, form ok, set=save == abgeschickt
if ($use_form && !$doptin_check && $set == "save") {
    $created = date("Y-m-d H:i:s");
    //$date_sub=strftime("%d-%m-%Y %H:%M:%S",mk_microtime($created));
    #$date_sub=$created;
    $author = $FRM[0]['id'];
    //double optin
Beispiel #4
0
                }
                if ($H[$hcc]['status'] == 4) {
                    $hc_fail++;
                }
            }
            //$hc==0, no (more) entries
            //report
            //should use a template..... :P
            $G = $ADDRESS->getGroup($Q[$qcc]['grp_id']);
            $ReportMail_Subject = "Tellmatic: Q finished (QId: " . $Q[$qcc]['id'] . " / " . $Q[$qcc]['created'] . ") " . display($NL[0]['subject']) . " an " . display($G[0]['name']);
            $ReportMail_HTML = "";
            $created_date = $Q[$qcc]['created'];
            $sent_date = $created;
            $ReportMail_HTML .= "<br><b>" . $sent_date . "</b>" . "<br>Der Versand des Newsletter <b>" . display($NL[0]['subject']) . "</b> an die Gruppe <b>" . display($G[0]['name']) . "</b> ist abgeschlossen." . "<br>The Mailing for Newsletter <b>" . display($NL[0]['subject']) . "</b> to Group <b>" . display($G[0]['name']) . "</b> is finished." . "<br><ul>" . "Adressen/s:" . $hc . "<br>Gesendet/Sent: " . $hc_ok . "<br>Fehler/Errors:" . $hc_fail . "<br>versendet am/sent at: " . $sent_date . "<br>erstellt (nur versand vorbereitet)/created (prepared): " . $created_date . "<br>Log: " . $tm_URL_FE . "/" . $tm_logdir . "/" . $logfilename . "</ul>";
            if (!DEMO) {
                @SendMail_smtp($HOST[0]['sender_email'], $HOST[0]['sender_name'], $HOST[0]['sender_email'], $HOST[0]['sender_name'], $ReportMail_Subject, clear_text($ReportMail_HTML), $ReportMail_HTML, array(), $HOST);
            }
            //sendmail_smtp[0]=true/false [1]=""/errormessage
        }
        //hc==0
        //	}//q status 2 o 3
        send_log($qcc + 1 . " of {$qc} Qs");
        send_log("end");
    }
    //isset HOST[0]!!!!
    #send_log("write Log to ".$tm_URL_FE."/".$tm_logdir."/".$logfilename);
}
//$qcc
/*
QCC
*/
function SendMail_mail($From, $FromName, $To, $ToName, $Subject, $Text, $Html, $AttmFiles)
{
    /*
    $From      ... sender mail address like "*****@*****.**"
    $FromName  ... sender name like "My Name"
    $To        ... recipient mail address like "*****@*****.**"
    $ToName    ... recipients name like "Your Name"
    $Subject   ... subject of the mail like "This is my first testmail"
    $Text      ... text version of the mail
    $Html      ... html version of the mail
    $AttmFiles ... array containing the filenames to attach like array("file1","file2")
    
    $TEXT="This is the first test\n in text format\n.";
    $HTML="<font color=red>This is the first test in html format.</font>";
    $ATTM=array("/home/myself/test/go.jpg",
    					"/home/myself/test/SomeDoc.pdf");
    
    SendMail(
    "*****@*****.**","PHP Apache Webmailer", //sender
    "*****@*****.**","Recipients Name",    //recipient
    "Testmail",                               //subject
    $TEXT,$HTML,$ATTM);                      //body and attachment(s)
    */
    //Name darf nicht = email sein und auch kein komma enthalten, plaintext!
    $ToName = str_replace($To, "", $ToName);
    $ToName = clear_text($ToName);
    $ToName = str_replace(",", "", $ToName);
    $OB = "----=_OuterBoundary_000" . md5(rand());
    $IB = "----=_InnerBoundery_001" . md5(rand());
    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Return-Path: <" . $From . ">\r\n";
    $headers .= "From: " . $FromName . " <" . $From . ">\r\n";
    $headers .= "To: " . $ToName . " <" . $To . ">\r\n";
    $headers .= "Reply-To: " . $FromName . " <" . $From . ">\r\n";
    $headers .= "X-Mailer: " . TM_APPTEXT . "\r\n";
    $headers .= "Content-Type: multipart/mixed;\n\t";
    $headers .= "boundary=\"" . $OB . "\"\r\n";
    //Messages start with text/html alternatives in OB
    $Msg = "This is a multi-part message in MIME format.\n";
    $Msg .= "\n--" . $OB . "\n";
    $Msg .= "Content-Type: multipart/alternative;\n\tboundary=\"" . $IB . "\"\n\n";
    //plaintext section
    $Msg .= "\n--" . $IB . "\n";
    $Msg .= "Content-Type: text/plain;\n\tcharset=\"iso-8859-1\"\n";
    $Msg .= "Content-Transfer-Encoding: quoted-printable\n\n";
    // plaintext goes here
    $Msg .= $Text . "\n\n";
    // html section
    $Msg .= "\n--" . $IB . "\n";
    $Msg .= "Content-Type: text/html;\n\tcharset=\"iso-8859-1\"\n";
    $Msg .= "Content-Transfer-Encoding: base64\n\n";
    // html goes here
    $Msg .= chunk_split(base64_encode($Html)) . "\n\n";
    // end of IB
    $Msg .= "\n--" . $IB . "--\n";
    // attachments
    if ($AttmFiles) {
        foreach ($AttmFiles as $AttmFile) {
            $patharray = explode("/", $AttmFile);
            $FileName = $patharray[count($patharray) - 1];
            $Msg .= "\n--" . $OB . "\n";
            $Msg .= "Content-Type: application/octetstream;\n\tname=\"" . $FileName . "\"\n";
            $Msg .= "Content-Transfer-Encoding: base64\n";
            $Msg .= "Content-Disposition: attachment;\n\tfilename=\"" . $FileName . "\"\n\n";
            //file goes here
            $fd = fopen($AttmFile, "r");
            $FileContent = fread($fd, filesize($AttmFile));
            fclose($fd);
            $FileContent = chunk_split(base64_encode($FileContent));
            $Msg .= $FileContent;
            $Msg .= "\n\n";
        }
    }
    //message ends
    $Msg .= "\n--" . $OB . "--\n";
    ini_set('sendmail_from', $From);
    if (mail($To, $Subject, $Msg, $headers)) {
        //send syslog message
        syslog(LOG_INFO, "Mail sent from {$From}  to {$ToName} <{$To}> ");
        ini_restore('sendmail_from');
        return true;
    } else {
        ini_restore('sendmail_from');
        return false;
    }
}
 $_MAIN_OUTPUT .= "</div>";
 $_MAIN_OUTPUT .= "</td>";
 $_MAIN_OUTPUT .= "<td valign=\"top\">";
 $_MAIN_OUTPUT .= "<div>";
 $_MAIN_OUTPUT .= "<a href=\"javascript:switchSection('tt_bouncemail_head_" . $mcc . "')\" title=\"" . ___("Text und Details anzeigen") . "\">" . tm_icon("page_white.png", ___("Text und Details anzeigen")) . "</a>";
 $_MAIN_OUTPUT .= "&nbsp;";
 $_MAIN_OUTPUT .= "<a href=\"javascript:switchSection('tt_bouncemail_text_" . $mcc . "')\" title=\"" . ___("E-Mail Header") . "\">" . tm_icon("page.png", ___("E-Mail Header")) . "</a>";
 $_MAIN_OUTPUT .= "<font size=-1>";
 $_MAIN_OUTPUT .= "" . $Mail[$mcc]['subject'] . "";
 $_MAIN_OUTPUT .= "</font>";
 $_MAIN_OUTPUT .= "</div>";
 //div fuer mailheader
 $_MAIN_OUTPUT .= "<div id=\"tt_bouncemail_head_" . $mcc . "\">";
 $_MAIN_OUTPUT .= "<br><b>" . ___("E-Mail-Header") . ":</b>";
 #$_MAIN_OUTPUT.= "<br><br><font size=-2>".str_replace("\n","<br>",clear_text(substr(str_replace("<br>","\n",$Mail[$mcc]['header']),0,1024)))." ...............etc.</font>";
 $_MAIN_OUTPUT .= "<br><font size=-2>" . str_replace("\n", "<br>", clear_text(str_replace("<br>", "\n", display($Mail[$mcc]['header'])))) . "</font>";
 $_MAIN_OUTPUT .= "</div>";
 $_MAIN_OUTPUT .= "<script type=\"text/javascript\">switchSection('tt_bouncemail_head_" . $mcc . "');</script>";
 //div fuer mailtext
 $_MAIN_OUTPUT .= "<div id=\"tt_bouncemail_text_" . $mcc . "\">";
 $_MAIN_OUTPUT .= "<br><b>" . ___("E-Mail-Body") . ":</b>";
 $_MAIN_OUTPUT .= "<br>" . $Mail[$mcc]['date'] . "";
 $_MAIN_OUTPUT .= "<br>Von: " . $Mail[$mcc]['from'] . "";
 $_MAIN_OUTPUT .= "<br>An: " . $Mail[$mcc]['to'] . "";
 #$_MAIN_OUTPUT.= "<br><br><font size=-2>".str_replace("\n","<br>",clear_text(substr(str_replace("<br>","\n",$Mail[$mcc]['body']),0,1024)))."...............</font>";
 $_MAIN_OUTPUT .= "<br><font size=-2><em>" . str_replace("\n", "<br>", display(substr(str_replace("<br>", "\n", $Mail[$mcc]['body']), 0, 1024))) . "</em>     ...etc</font>";
 $_MAIN_OUTPUT .= "</div>";
 $_MAIN_OUTPUT .= "<script type=\"text/javascript\">switchSection('tt_bouncemail_text_" . $mcc . "');</script>";
 $_MAIN_OUTPUT .= "</td>";
 $_MAIN_OUTPUT .= "<td valign=\"top\">";
 //wenn bounces .....
/* Besuchen Sie die Homepage fuer Updates und weitere Infos                     */
/********************************************************************************/
$_MAIN_DESCR = ___("Adressen exportieren (CSV-Export)");
$_MAIN_MESSAGE = "";
//status
$InputName_Status = "status";
//
${$InputName_Status} = getVar($InputName_Status);
//trennzeichen
$InputName_Delimiter = "delimiter";
//
${$InputName_Delimiter} = getVar($InputName_Delimiter);
//export dateiname
$InputName_File = "filename";
//
${$InputName_File} = clear_text(getVar($InputName_File));
//status
$InputName_Status = "status";
//
${$InputName_Status} = getVar($InputName_Status);
//blacklist
$InputName_Blacklist = "check_blacklist";
//
${$InputName_Blacklist} = getVar($InputName_Blacklist);
//usr limit
$InputName_Limit = "export_limit_user";
//
${$InputName_Limit} = getVar($InputName_Limit);
if (empty(${$InputName_Limit})) {
    ${$InputName_Limit} = 0;
}