Esempio n. 1
0
            $error = $lang_module['error_part'];
        } elseif (!nv_capcha_txt($fcode)) {
            $error = $lang_module['error_captcha'];
        } else {
            $fcon = nv_nl2br($fcon);
            $sender_id = intval(defined('NV_IS_USER') ? $user_info['userid'] : 0);
            $sql = "INSERT INTO `" . NV_PREFIXLANG . "_" . $module_data . "_send` VALUES \n            (NULL , " . $fpart . ", " . $db->dbescape($ftitle) . ", " . $db->dbescape($fcon) . ", \n            " . NV_CURRENTTIME . ", " . $sender_id . ", " . $db->dbescape($fname) . ", " . $db->dbescape($femail) . ", \n            " . $db->dbescape($fphone) . ", " . $db->dbescape($client_info['ip']) . ", 0, 0, '', 0, 0);";
            $db->sql_query($sql);
            $website = "<a href=\"" . $global_config['site_url'] . "\">" . $global_config['site_name'] . "</a>";
            $fcon .= "<br /><br />----------------------------------------<br /><br />";
            if (empty($fphone)) {
                $fcon .= sprintf($lang_module['sendinfo'], $website, $fname, $femail, $client_info['ip'], $array_rows[$fpart]['full_name']);
            } else {
                $fcon .= sprintf($lang_module['sendinfo2'], $website, $fname, $femail, $fphone, $client_info['ip'], $array_rows[$fpart]['full_name']);
            }
            nv_SendMail2User($fpart, $fcon, $ftitle, $femail, $fname);
            $url = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA;
            $contents .= call_user_func("sendcontact", $url);
            include NV_ROOTDIR . "/includes/header.php";
            echo nv_site_theme($contents);
            include NV_ROOTDIR . "/includes/footer.php";
            exit;
        }
    }
}
$bodytext = "";
$content_file = NV_ROOTDIR . '/' . NV_DATADIR . '/' . NV_LANG_DATA . '_' . $module_data . 'Content.txt';
if (isset($array_rows[$fpart]) and !empty($array_rows[$fpart]['note'])) {
    $bodytext = $array_rows[$fpart]['note'];
} elseif (file_exists($content_file)) {
    $bodytext = file_get_contents($content_file);
Esempio n. 2
0
         $sth = $db->prepare("INSERT INTO " . NV_PREFIXLANG . "_" . $module_data . "_send\n\t\t\t\t(cid, title, content, send_time, sender_id, sender_name, sender_email, sender_phone, sender_ip, is_read, is_reply) VALUES\n\t\t\t\t(" . $array_department[$fpart]['id'] . ", :title, :content, " . NV_CURRENTTIME . ", " . $sender_id . ", :sender_name, :sender_email, :sender_phone, :sender_ip, 0, 0)");
         $sth->bindParam(':title', $ftitle, PDO::PARAM_STR);
         $sth->bindParam(':content', $fcon, PDO::PARAM_STR, strlen($fcon));
         $sth->bindParam(':sender_name', $fname, PDO::PARAM_STR);
         $sth->bindParam(':sender_email', $femail, PDO::PARAM_STR);
         $sth->bindParam(':sender_phone', $fphone, PDO::PARAM_STR);
         $sth->bindParam(':sender_ip', $client_info['ip'], PDO::PARAM_STR);
         if ($sth->execute()) {
             $website = '<a href="' . $global_config['site_url'] . '">' . $global_config['site_name'] . '</a>';
             $fcon .= '<br /><br />----------------------------------------<br /><br />';
             if (empty($fphone)) {
                 $fcon .= sprintf($lang_module['sendinfo'], $website, $fname, $femail, $client_info['ip'], $array_department[$fpart]['full_name']);
             } else {
                 $fcon .= sprintf($lang_module['sendinfo2'], $website, $fname, $femail, $fphone, $client_info['ip'], $array_department[$fpart]['full_name']);
             }
             nv_SendMail2User($array_department[$fpart]['id'], $fcon, $ftitle, $femail, $fname);
             nv_insert_notification($module_name, 'contact_new', array('title' => $ftitle), 0, $sender_id, 1);
             $url = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA;
             $contents .= call_user_func('sendcontact', $url);
             include NV_ROOTDIR . '/includes/header.php';
             echo nv_site_theme($contents);
             include NV_ROOTDIR . '/includes/footer.php';
             exit;
         }
     }
 } else {
     $base_url_rewrite = $base_url;
     if (isset($array_op[0]) and isset($array_department[$fpart])) {
         $array_department_i = $array_department[$fpart];
         $array_department = array($fpart => $array_department_i);
         $base_url_rewrite .= '&amp;' . NV_OP_VARIABLE . '=' . $fpart;