session_start();
$document = array();
$script = "";
$init = "";
require "../lib/getnpost.php";
require "../lib/config.php";
require "../lib/dbconnect.php";
require "../lib/auth.php";
require "../lib/common.php";
require "../lib/PHPMailer/class.phpmailer.php";
require "info_common.php";
function mkCooperation(&$document, &$script, &$init) {
$document['main'] .= <<
|
|
Ȩ
> »ç¾÷Á¦ÈÞ¹®ÀÇ |
|
EOS;
$script .= <<$cpname
EOS;
} else {
$cpnstring = $cpname;
}
if ($cpprop) {
$cppstring = <<$cpprop
EOS;
} else {
$cppstring = "¾øÀ½";
}
if ($cpintro) {
$cpistring = <<$cpintro
EOS;
} else {
$cpistring = "¾øÀ½";
}
$cptext = nl2br($cptext);
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->Host = "localhost";
$mailer->CharSet = "euc-kr";
$mailer->IsHTML(true);
$mailer->From = $ADMIN_MAIL;
$mailer->FromName = "ÇÁ½ÃÄÉ";
$mailer->AddAddress($ADMIN_MAIL, "ÇÁ·ÎÀÚÀ̳Ê");
$mailer->Subject = "[ÇÁ½ÃÄÉ] »ç¾÷ Á¦ÈÞ ¹®ÀÇ";
$mailer->Body = <<ȨÆäÀÌÁö¸¦ ÅëÇØ ´ÙÀ½°ú °°ÀÌ »ç¾÷ Á¦¾ÈÀÌ µî·ÏµÇ¾ú½À´Ï´Ù.
ȸ»ç¸í |
$cpnstring |
´ã´çÀÚ |
$cename $cepos |
ÀüȹøÈ£ |
$cptel |
Á¦¾ÈºÐ¾ß |
$cptype |
Á¦¾È°³¿ä |
$cptext
|
Á¦¾È¼ |
$cppstring |
¼Ò°³¼ |
$cpistring |
µî·ÏÀϽà |
$thistime |
EOS;
return $mailer->Send();
}
## Start
if ($coopsubmit) {
mysql_query("insert into coop
(cpname, cphome, cename, cepos, cptel, cptype, cptext) values
('$cpname', '$cphome', '$cename', '$cepos', '$cptel', '$cptype', '$cptext')");
$coid = mysql_insert_id();
// ÷ºÎ: cpprop, cpintro
if ($_FILES['cpprop']['size']) {
$cpprop = str_replace("\\'", "", $_FILES['cpprop']['name']);
mysql_query("update coop set
cpprop = '$cpprop', cpptype = '{$_FILES['cpprop']['type']}'
where coid = '$coid'");
$coatpath = $BOARD_ATTACHPATH . "/CO_" . $coid . "_" . $cpprop;
move_uploaded_file(
$_FILES['cpprop']['tmp_name'], $coatpath
);
} else {
$cpprop = "";
}
if ($_FILES['cpintro']['size']) {
$cpintro = str_replace("\\'", "", $_FILES['cpintro']['name']);
mysql_query("update coop set
cpintro = '$cpintro', cpitype = '{$_FILES['cpintro']['type']}'
where coid = '$coid'");
$coatpath = $BOARD_ATTACHPATH . "/CO_" . $coid . "_" . $cpintro;
move_uploaded_file(
$_FILES['cpintro']['tmp_name'], $coatpath
);
} else {
$cpintro = "";
}
sendCoopMail(
$coid, $cpname, $cphome, $cename, $cepos, $cptel,
$cptype, $cptext, $cpprop, $cpintro
);
header("Location: $PHP_SELF?cook=1");
return;
}
mkCooperation($document, $script, $init);
if ($cook) {
$init .= <<