Esempio n. 1
0
function prepare_text($row, $reply = 0)
{
    global $pt_l, $ptaction, $lang, $AllowToSend, $send_error;
    $text = ereg_replace(""", "\"", $row[text]);
    $text = prepare_text_form($text);
    //echo $text;
    $res = $text;
    if ($ptaction) {
        $email = $row[f10];
        if (count($email) > 1) {
            $email = join("", $email);
        }
        $email = split("\n", $email);
        $f10 = $email;
        $res = $email[1];
        $email = trim($email[0]);
        $table = prepare_text_table($text);
        if ($AllowToSend) {
            if (ereg("Итого:", $pt_l[1])) {
                $table = $pt_l[1] . "<p>" . $table;
            }
            prepare_text_send($email, $table, $reply);
        } else {
            $etext = trim($f10[2]);
            if (!$etext) {
                switch ($lang) {
                    case "ru":
                        $etext = "Пожалуйста, заполните обязательные поля, отмеченные звездочкой.";
                        break;
                    default:
                        $etext = "Please fill all required fields.";
                }
            }
            $etext = "<font color=red>" . $etext . "</font>";
            $res = $etext . $text;
        }
    }
    //echo $table;
    return $res;
}
Esempio n. 2
0
function prepare_text($row, $reply = 0)
{
    global $pt_l, $ptaction;
    $text = ereg_replace("&quot;", "\"", $row[text]);
    $text = ereg_replace("&#39;", "'", $text);
    $text = ereg_replace("&#92;", "\"", $text);
    //$text=prepare_text_form($text);
    $res = $text;
    if ($ptaction) {
        $email = $row[f10];
        if (count($email) > 1) {
            $email = join("", $email);
        }
        $email = split("\n", $email);
        $res = $email[1];
        $email = trim($email[0]);
        $table = prepare_text_table($text);
        prepare_text_send($email, $table, $reply);
    }
    //echo $table;
    return $res;
}
Esempio n. 3
0
function prepare_text($row, $reply = 0)
{
    global $pt_l, $ptaction, $lang, $AllowToSend, $module_filepath;
    $text = ereg_replace("&quot;", "\"", $row[text]);
    $text = ereg_replace("\\<\\/modifiedtime\\>", "", $text);
    $r = preg_match_all("/\\<modifiedtime\\>([^]+)/U", $text, $res, PREG_PATTERN_ORDER);
    $text = ereg_replace("\\<modifiedtime\\>[^]+", "", $text);
    $text = split("", $text);
    for ($o = 0; $o < count($res[1]); $o++) {
        //	$res[1][$o]=ereg_replace("","\?\>",$res[1][$o]);
        //	eval(ereg_replace("echo ","\$row[\$i][$o].=",$res[1][$o]));
        $filename = trim(ereg_replace(".*lichba\\.by", "", $res[1][$o]));
        $filename = $module_filepath . $filename;
        if (file_exists($filename)) {
            $last_modified = filemtime($filename);
            $text[$o] .= date("d.m.Y", $last_modified);
        }
    }
    $text = join("", $text);
    $text = prepare_text_form($text);
    //echo "00";
    $res = $text;
    if ($ptaction) {
        $email = $row[f10];
        if (count($email) > 1) {
            $email = join("", $email);
        }
        $email = split("\n", $email);
        $f10 = $email;
        $res = $email[1];
        $email = trim($email[0]);
        $table = prepare_text_table($text);
        if ($AllowToSend) {
            prepare_text_send($email, $table, $reply);
        } else {
            $etext = trim($f10[2]);
            if (!$etext) {
                switch ($lang) {
                    case "ru":
                        $etext = "Пожалуйста, заполните обязательные поля, отмеченные звездочкой.";
                        break;
                    default:
                        $etext = "Please fill all required fields.";
                }
            }
            $etext = "<font color=red>" . $etext . "</font>";
            $res = $etext . $text;
        }
    }
    //echo $table;
    return $res;
}