私は抽象的な投稿フォームを持っています。クライアントは要約を提出し、データベースに収集します。このフォームには、確認メールで生成されたリンクを使用して、送信された要約をクライアントが変更できるオプションがあります。彼らが要約を再提出するとき、私は自分のデータベースで "submission id = 1a、またはsubmission id = 1bとなるように受け取るsubmission idを再提出する必要があります。だから私は番号が同じである必要がありますが、彼らが再提出するたびにそれの隣に手紙があります。抽象的なID番号を提出して再提出する
ここでは、抽象的な要素に加えられた変更の数に関係なく、サブミットID番号は変わりません。
<?php
require_once './lib.php';
include_once 'lib/swift_required.php';
function reSendSubmissions() {
$ids = array(108, 117, 142, 170, 171, 154, 153, 146, 159, 255, 109, 185, 250, 257, 151, 235, 234, 233, 273, 275, 281, 355, 366, 373, 231, 365, 384, 425, 234, 290, 303, 153, 154, 391, 388);
foreach ($ids as $id) {
$sql = 'SELECT a.`title`, a.`speaker`, a.`submisssion_timestampt`, a.`submissionid`, a.`pincode`, b.`email` '
. 'FROM `submissions` a INNER JOIN `personaldata` b ON(b.`pdataid`=a.`pdata_id`) '
. 'WHERE a.`submissionid`="' . (int) $id . '" '
. 'LIMIT 1';
$db = new dbrequest();
$data = array();
if ($submission = $db->generalSelect($sql)) {
if (!$submission[0])
continue;
$submission = $submission[0];
$data['title'] = $submission['title'];
$data['speaker'] = $submission['speaker'];
$data['date'] = date('d-m-Y', strtotime($submission['submisssion_timestampt']));
$data['time'] = date('H:i', strtotime($submission['submisssion_timestampt']));
$data['no'] = $submission['submissionid'];
$data['link'] = 'http://www.e-bass.org/22ndcongress/form/edit.php?pcode=' . $submission['pincode'];
// maildata::mailSenderTest($submission['email'], $data);
echo $id.'-'.$submission['email'].'<br/>';
}
}
}
reSendSubmissions();
エンド提出フォームのPHPコード:
<?php
if ((isset($_POST['firstname'])) && (isset($_POST['email']))) {
require_once 'lib.php';
(isset($_POST['poster'])) ? $poster = $_POST['poster'] : $poster = null;
(isset($_POST['contestant'])) ? $contestant = $_POST['contestant'] : $contestant = null;
$newdata = new dbrequest();
$pdata = array(
'firstname' => filter_input(INPUT_POST, 'firstname', FILTER_SANITIZE_STRING),
'lastname' => filter_input(INPUT_POST, 'lastname', FILTER_SANITIZE_STRING),
'address' => $_POST['address'],
'city' => $_POST['city'],
'poc' => $_POST['poc'],
'country' => $_POST['country'],
'workingplace' => $_POST['workingplace'],
'specialization' => $_POST['specialization'],
'email' => $_POST['email'],
'cellphone' => $_POST['cellphone'],
'phone' => $_POST['phone'],
'fax' => $_POST['fax']);
$authors = $_POST['authors1'] . '-' . $_POST['title1'] . '-' . $_POST['university1'] . ';' . $_POST['authors2'] . '-' . $_POST['title2'] . '-' . $_POST['university2'] . ';' . $_POST['authors3'] . '-' . $_POST['title3'] . '-' . $_POST['university3'] . ';' . $_POST['authors4'] . '-' . $_POST['title4'] . '-' . $_POST['university4'] . ';' . $_POST['authors5'] . '-' . $_POST['title5'] . '-' . $_POST['university5'];
if ((isset($_POST['update'])) && ($_POST['update'] == 'true')) {
$updateSubData = array(
'authors' => $authors,
'speaker' => trim(filter_input(INPUT_POST, 'speaker_firstname', FILTER_SANITIZE_STRING)) . ' ' . trim(filter_input(INPUT_POST, 'speaker_lastname', FILTER_SANITIZE_STRING)),
'title' => $_POST['title'],
'presentation_id' => $_POST['presentation'],
'topic_id' => $_POST['topic'],
'poster' => $poster,
'contestant' => $contestant,
'summary' => $_POST['summary']);
$newdata->updatePersonalData($pdata, $_POST['pdata_id']);
$newdata->updateSumission($updateSubData, $_POST['submissionid']);
$html = <<<EOD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Paper Submited</title>
</head>
<body style="margin:0; padding:0">
<div style="width:600px;height:auto; margin:0 auto;">
<div id="header"></div>
<div id="content">
<h3>The processing of your paper is done successfully.</h3>
<p style="text-align:center">Thank you for your participation.</p>
</div>
</div>
</body>
</html>
EOD;
print $html;
} else {
$speakerPost = trim(filter_input(INPUT_POST, 'speaker_firstname', FILTER_SANITIZE_STRING)) . ' ' . trim(filter_input(INPUT_POST, 'speaker_lastname', FILTER_SANITIZE_STRING));
$speakerDB = $newdata->metriseOmilites($speakerPost);
$speakerDB = $speakerDB[0]['single_speaker'];
if ($speakerDB >= 1) {
$html = <<<EOD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SUBMISSION FORM</title>
</head>
<body style="margin:0; padding:0">
<div style="width:600px;height:auto; margin:0 auto;">
< <div style="width:600px;height:auto; margin:0 auto;background-color:#4F6B92">
<h3>There was an error in your application.</h3>
<p style="text-align:center">The presenter chosen is already registered in 1 paper.</p>
<p style="text-align:center"><a href="javascript:history.back(1)">Click here to return to the Submission Form.</a></p>
</div>
</div>
</body>
</html>
EOD;
print $html;
exit();
}
$newdata->insertPersonalData($pdata);
$pdata_id = $newdata->selectLastInsert('personaldata', 'pdataid');
$pdata_id = $pdata_id[0]['pdataid'];
$pcode = mt_rand(1, 99999);
$pcode = md5(time() . $pcode);
$pcode = substr($pcode, 0, 22);
$submission = array(
'pincode' => $pcode,
'pdata_id' => $pdata_id,
'authors' => $authors,
'speaker' => trim(filter_input(INPUT_POST, 'speaker_firstname', FILTER_SANITIZE_STRING)) . ' ' . trim(filter_input(INPUT_POST, 'speaker_lastname', FILTER_SANITIZE_STRING)),
'title' => $_POST['title'],
'presentation_id' => $_POST['presentation'],
'topic_id' => $_POST['topic'],
'poster' => $poster,
'contestant' => $contestant,
'summary' => $_POST['summary']);
$newdata->insertSubmission($submission);
$submissionNo = $newdata->selectLastInsert('submissions', 'submissionid');
$submissionNo = $submissionNo[0]['submissionid'];
$neoMail = new maildata();
$datamail = array(
'title' => $_POST['title'],
'speaker' => $_POST['speaker_firstname'] . ' ' . $_POST['speaker_lastname'],
'date' => date('d-m-Y'),
'time' => date('H:i'),
'no' => $submissionNo,
'link' => 'http://' . $newdata->domainURL . '/edit.php?pcode=' . $pcode);
$neoMail->mailSender($_POST['email'], $datamail);
$html = <<<EOD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SUBMISSION OF PAPER</title>
</head>
<body style="margin:0; padding:0">
<div style="width:600px;height:auto; margin:0 auto;">
<div id="header"></div>
<div id="content">
<h3>Submitting your work done successfully.</h3>
<p>You receive the relevant proof of submission to the email address you provided in the application form.</p>
<p style="text-align:center">Thank you for your participation.</p>
</div>
</div>
</body>
</html>
EOD;
print $html;
}
}
は、あなたが私を助けることができます(数字のみ)ここで
は、再送信フォームのPHPコードですか?
あなたのデータベースに 'id'と' version'のための別々の列があります。サブミットが更新されると、バージョンのみを変更します。それと同じくらい簡単です。これを答えとして投稿するのは簡単すぎですね。 –
私はちょうど学び始めたので、残念なことに私のために簡単ではありません。もっと具体的にすることは可能でしょうか?コードに正確に何を追加すればいいですか? –
さて、ここで私たちは行く、以下の答えを参照してください。かなり具体的でなければならない。コードがあなたの仕事であるかどうかを尋ねるか、既成の作品を微調整しているかどうか尋ねてください。 –