From 20a1808c6dce9ee019ae8f1c3e8a53577a00e712 Mon Sep 17 00:00:00 2001
From: Jayaram R Pai
Date: Sat, 21 Jun 2014 19:46:02 +0530
Subject: added feature to populate selects using eid in
---
comment.php | 4 +--
get_elements.php | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
index.php | 72 ++++++++++++++++++++++++++++++++----------------
3 files changed, 133 insertions(+), 26 deletions(-)
create mode 100644 get_elements.php
diff --git a/comment.php b/comment.php
index f4197d6..75af061 100755
--- a/comment.php
+++ b/comment.php
@@ -14,8 +14,8 @@
echo "
Thank you for your valuable feedback.
";
- $to = "rush2jrp@gmail.com, mukulrkulkarni@gmail.com, lavitha89@gmail.com, kannan@iitb.ac.in, kiran@fossee.in, manasdas17@gmail.com";
- // $to = "rush2jrp@gmail.com, jayaram@iitb.ac.in";
+ // $to = "rush2jrp@gmail.com, mukulrkulkarni@gmail.com, lavitha89@gmail.com, kannan@iitb.ac.in, kiran@fossee.in, manasdas17@gmail.com";
+ $to = "rush2jrp@gmail.com, jayaram@iitb.ac.in";
$subject = "New Cloud Comment";
$message = "
A new comment has been posted.
diff --git a/get_elements.php b/get_elements.php
new file mode 100644
index 0000000..80078c9
--- /dev/null
+++ b/get_elements.php
@@ -0,0 +1,83 @@
+';
+ $data .= '';
+ while($row = mysql_fetch_object($result)) {
+ if($example_id == $row->id) $selected = "selected"; else $selected="";
+ $data .= "';
+ $chapter_id = $row->chapter_id;
+ }
+ $data .= '';
+ $data .= ' Download Example';
+ $elements["examples"] = $data;
+
+ /* retreving chapters */
+ $query = "
+ SELECT id, name, number, preference_id FROM textbook_companion_chapter
+ WHERE cloud_chapter_err_status=0 AND preference_id = (
+ SELECT preference_id FROM textbook_companion_chapter WHERE id = {$chapter_id}
+ )
+ ORDER BY number ASC
+ ";
+ $result = mysql_query($query);
+ $data = '';
+ $data .= ' Download Chapter';
+ $elements["chapters"] = $data;
+
+ /* retreving books*/
+ $query = "
+ SELECT pre.id, pre.book, author, category FROM textbook_companion_preference pre
+ WHERE pre.approval_status=1 AND pre.category = (
+ SELECT category FROM textbook_companion_preference WHERE id = {$preference_id}
+ ) AND cloud_pref_err_status=0 and pre.proposal_id IN (
+ SELECT id from textbook_companion_proposal where proposal_status=3
+ ) ORDER BY pre.book ASC
+ ";
+ $result = mysql_query($query);
+ $data = '';
+ $data .= ' Download Book';
+ $elements["books"] = $data;
+ $elements["category"] = $category_id;
+
+ return $elements;
+ }
+?>
diff --git a/index.php b/index.php
index 45a6b87..64ea634 100755
--- a/index.php
+++ b/index.php
@@ -1,6 +1,10 @@
window.location="under-maintenance.html"; ';*/
+ require "get_elements.php";
+ $eid = 0;
+ if(isset($_GET["eid"]) && $_GET["eid"] != '') {
+ $eid = $_GET["eid"];
+ $elements = get_elements($eid);
+ }
?>
@@ -12,8 +16,8 @@