From 9cad4b7a60f0ebdd143b42b0bdae4f0d2f5bedb9 Mon Sep 17 00:00:00 2001 From: prashant Date: Mon, 25 Apr 2016 09:27:57 +0530 Subject: reformated feedback mail content --- comment.php | 95 ++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 62 insertions(+), 33 deletions(-) mode change 100644 => 100755 comment.php diff --git a/comment.php b/comment.php old mode 100644 new mode 100755 index f2d2e57..ecd867b --- a/comment.php +++ b/comment.php @@ -1,37 +1,66 @@ - "Blank Code / Incorrect code", - 2 => "Output error", - 3 => "Execution error", - 4 => "Missing example(s)", - 6 => "Blank output", - 7 => "Any other" - ); - if(isset($_POST['type']) && isset($_POST['comment'])){ - $query = "insert into scilab_cloud_comment (type, comment, email,category,books,chapter,example) values(".$_POST['type'].", '".$_POST['comment']."', '".$_POST['email']."', '".$_POST['category']."', '".$_POST['books']."', '".$_POST['chapter']."', '".$_POST['example']."')"; - if(mysql_query($query)){ + "Blank Code / Incorrect code", + 2 => "Output error", + 3 => "Execution error", + 4 => "Missing example(s)", + 6 => "Blank output", + 7 => "Any other" +); +if (isset($_POST['type']) && isset($_POST['comment'])) + { + $query = "insert into scilab_cloud_comment (type, comment, email,category,books,chapter,example) values(" . $_POST['type'] . ", '" . $_POST['comment'] . "', '" . $_POST['email'] . "', '" . $_POST['category'] . "', '" . $_POST['books'] . "', '" . $_POST['chapter'] . "', '" . $_POST['example'] . "')"; + if (mysql_query($query)) + { + echo "
Thank you for your valuable feedback.
"; + $query_details = "SELECT tcp.book as book, tcp.author as author, tcp.publisher as publisher, + tcp.year as year,tcp.category as category, tce.chapter_id, tcc.number AS chapter_no, + tcc.name AS chapter_name, tce.number AS example_no, tce.caption AS example_caption + FROM textbook_companion_preference tcp + LEFT JOIN textbook_companion_chapter tcc ON tcp.id = tcc.preference_id + LEFT JOIN textbook_companion_example tce ON tce.chapter_id = tcc.id + WHERE tce.id = '" . $_POST['example'] . "'"; + $exmpale_id = $_POST['example']; + $result = mysql_query($query_details); + $row = mysql_fetch_object($result); + $category = _tbc_list_of_category($row->category); + $to = "email@email.in"; + $subject = "New Cloud Comment"; + $message = " + A new comment has been posted.Thank you for your valuable feedback.
"; + Type: {$types[$_POST['type']]}Sorry for the inconvience, please try again
"; - } - }else{ ?> - + $from = "textbook@scilab.in"; + $headers = "From: " . $from . "\r\n"; + $headers .= "MIME-Version: 1.0\r\n"; + $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; + mail($to, $subject, $message, $headers); + } + else + { + echo "Sorry for the inconvience, please try again
"; + } + } +else + { +?> +category_name; + return $category; + } +?> -- cgit