forked from codeb1ooded/RTI_Automation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_reply.php
More file actions
90 lines (75 loc) · 2.22 KB
/
generate_reply.php
File metadata and controls
90 lines (75 loc) · 2.22 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
<html>
<head>
<title>Generate Reply</title>
<link rel="stylesheet" href="css/background.css">
<meta charset="utf-8">
</head>
<body>
<?php
$id=$_GET['id'];
include 'config_database.php';
$data1 = "SELECT * FROM t2 WHERE id=".$id.";";
$query = mysqli_query($con,$data1);
$data2 = mysqli_num_rows($query);
$a = $data2;
$data3 = "SELECT * FROM add_rti WHERE id=".$id.";";
$query2 = mysqli_query($con,$data3);
$data4 = mysqli_num_rows($query2);
$b = $data4;
$add_rtirows = mysqli_fetch_array($query2);
$data5 = "SELECT * FROM reply_queries WHERE id=".$id.";";
$query3 = mysqli_query($con, $data5);
$data6 = mysqli_num_rows($query3);
$data7 = "SELECT map, ques, ans, t2.q_no FROM t2, reply_queries WHERE t2.id=".$id." AND reply_queries.id=".$id." AND t2.q_no = reply_queries.qno;";
$query4 = mysqli_query($con, $data7);
if($data2 == $data6){
echo"
Ref.: CPIO/ </br> Dated:
</br></br></br>
To </br></br> Name: ".$add_rtirows['name']."</br></br>Address: ".$add_rtirows['address']."</br></br></br>
Subject:- Information required under Section 6(1) of the Right to Information Act, 2005.
Sir/Madam,
Please refer to your application dated ".$add_rtirows['date_of_receipt'].", on the subject mentioned above.
2. The information sought by you is enclosed.
3. You are requested to acknowledge the receipt of this letter.
Yours faithfully,
";
echo"<table>";
echo"<tr>
<th>Query no:</th>
<th>Query</th>
<th>Reply</th>
</tr>";
while( $a!=0)
{
$t2rows = mysqli_fetch_array($query4);
//$qno="q_no".$a;
//$ques="ques".$a;
$ans="ans".$a;
?>
<tr>
<th>"<?php echo $t2rows['q_no']?></th>
<th><?php echo $t2rows['ques']?></th>
<th><?php echo $t2rows['ans']?></th>
</tr>
<?php
$a--;
}
echo"Name :</br></br>
Designation/CPIO
Encl.: As above.";
echo"</table>";
echo "<button class='btn' onclick='myFuction()'>Print the reply</button>";
?>
<script>
function myFuction(){
window.print();
}
</script>
<?php } else{
echo "<h1> First reply all queries </h1>";
}
echo "<br><br><a class='btn' href='ongoing_rti_option.php?id=".$id."''>Back</a>";
?>
</body>
</html>