forked from codeb1ooded/RTI_Automation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubmit_queries.php
More file actions
98 lines (90 loc) · 2.76 KB
/
submit_queries.php
File metadata and controls
98 lines (90 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
session_start();
$id=$_SESSION['id'];
$_SESSION['no_of_queries']=$_POST['ques'];
?>
<html>
<head>
<title>Queries</title>
<link rel="stylesheet" href="css/background.css">
<meta charset="utf-8">
</head>
<body>
<?php
include 'config_database.php';
$a=$_POST['ques'];
echo " <h3>RTI ID:".$id."</h3>";
echo "<table>
<tbody>
<tr>
<th>Query No</th>
<th>Query</th>
<th>Map To</th>
<th>Date Sent</th>
</tr>";
echo "<form action=save_queries.php method=post>";
?>
<script type="text/javascript">
function mailTo (a) {
var map = document.getElementById("dropdown"+a);
var no_select = "no_selection"+a;
var selected = map.options[map.selectedIndex].value;
if(no_select != selected){
var mailid;
if(selected == "Ac"){
mailid = "academics@igdtuw.com";
} else if(selected == "Ex"){
mailid = "examination@igdtuw.com";
} else if(selected == "Ad"){
mailid = "administrative@igdtuw.com";
} else{
mailid = "humaresource@igdtuw.com";
}
var subject="Please Send reply to the query of RTI Id: "+ <?php echo $id; ?>;
var ques = "ques"+a;
var body="Query: " + document.getElementById(ques).value + " \ndated on:" + document.getElementById("date_s"+a).value;
window.open('mailto:'+mailid+'?subject='+subject+'&body='+body);
}
else{
alert("Please select a department first");
}
}
</script>
<?php
$c=1;
while($a!=0)
{
$ques="ques".$a;
$map="map".$a;
$date_s="date_s".$a;
$no_selection="no_selection".$a;
$dropdown="dropdown".$a;
?>
<tr>
<th><input type=text name=<?php echo $c; ?> value=<?php echo $c; ?> readonly></th>
<th><input type=text name=<?php echo $ques; ?> id=<?php echo $ques; ?>></th>
<th><select name=<?php echo $map; ?> id=<?php echo $dropdown;?> >
<span>
<option value=<?php echo $no_selection; ?>>--Select--</option>
<option value=Ac>Academics</option>
<option value=Ex>Examination Division</option>
<option value=Ad>Administrative</option>
<option value=HR>Human Resource</option>
</span>
</select>
</th>
<th><input type=date name=<?php echo $date_s; ?> id=<?php echo $date_s; ?> placeholder=YYYY-MM-DD></th>
<th><button type="button" name="mail_button" class=btn onclick="mailTo(<?php echo $a; ?>);">Mail</button></th>
<?php
echo '</tr>';
$a--;
$c++;
}
echo "<th colspan=15></th><th><input class='btn' type=submit name=gen_pdf value='Generate Reply'><th>";
echo "<th colspan=15></th><th><input type=submit name=save class=btn value='Save and Exit' ></th>";
echo "</form>";
echo "<th colspan=15></th><th><a href='select_option.php' name=exit class=btn>Exit</a></th>";
mysqli_close($con);
?>
</body>
</html>