forked from Anupama-Github/rasi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeanings.php
167 lines (136 loc) · 4.61 KB
/
meanings.php
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php
session_start();
// dBase file
include "dbConfig.php";
$DB = new DBConfig();
$DB -> config();
$dbhandle =$DB -> conn();
$q = "SELECT * FROM `meanings` "
."WHERE `wordid`='".$_GET["wordid"]."' ";
$qLlanguages="SELECT * FROM `languages` ";
//execute the SQL query and return records
$resultLanguages = mysql_query($qLlanguages);
//execute the SQL query and return records
if(isset($_GET["Save"]))
{
if($_GET["Save"]!="")
{
$q = "INSERT INTO `temp_meanings` (`meaning`,`languageid`,`word_id`) "
."VALUES ('".$_POST["txtMeaning"]."', "
."'".$_POST["cmbLanguage"]."', "
."'".$_POST["hidWordId"]."')";
// Run query
$r = mysql_query($q);
$q = "SELECT * FROM `meanings` "
."WHERE `wordid`='".$_POST["hidWordId"]."' ";
}
}
$result = mysql_query($q);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
Name : Modelling
Description: A two-column, fixed-width design with dark color scheme.
Version : 1.0
Released : 20120617
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>rasi</title>
<link href="http://fonts.googleapis.com/css?family=Abel" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript">
function fnAddNew()
{
document.getElementById("td1").style.display="";
document.getElementById("td2").style.display="";
document.getElementById("td2a").style.display="";
document.getElementById("td2b").style.display="";
document.getElementById("td3").style.display="";
document.getElementById("td4").style.display="";
}
function fnCancel()
{
document.getElementById("td1").style.display="none";
document.getElementById("td2").style.display="none";
document.getElementById("td3").style.display="none";
document.getElementById("td4").style.display="none";
}
function fnSave()
{
frmMeanings.action="?Save=Yes&wordid="+document.getElementById("hidWordId").value;
frmMeanings.method="post";
frmMeanings.submit();
}
</script>
</head>
<body >
<form action="" method="POST" id="frmMeanings"">
<div id="wrapper">
<div id="wrapper2">
<!-- end #header -->
<div id="page">
<div id="content">
<div class="post">
<h2 class="title"><a href="#">Available word meaning(s)</a></h2>
</div>
</div>
</div>
<!-- end #content -->
<div style="clear: both;"> </div>
</div>
<!-- end #page -->
</div>
</div>
<div id="footer-content-wrapper">
<div id="footer-content">
<div id="column1">
<h2><?php if(isset($_GET["word"])) echo $_GET["word"] ?></h2>
<ul>
<?php while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){
echo "<li>".$row['meaning']."</li>";
}
?>
</ul>
</div>
</div>
</div>
<div id="footerlink">
<ul>
<?php
echo "<table border=\"0\"/><tr>";
echo "<td><a href=\"#\" onclick=\"fnAddNew();\">Add New</a></td>";
echo "<td style=\"display:none\" id=\"td1\"><input type=\"text\" name=\"txtMeaning\" size=\"15\" placeholder=\"Meaning\"></td>";
echo "<td style=\"display:none\" id=\"td2\"><select id=\"cmbLanguage\"";
echo "name=\"cmbLanguage\">";
?>
<?php while ($row = mysql_fetch_array($resultLanguages, MYSQL_ASSOC)){
echo "<option value=".$row['id'].">".$row['language']."</option>";
}
?>
<?php
echo "</select></td>";
echo "<td style=\"display:none\" id=\"td2a\"><input type=\"text\" name=\"txtComment\" size=\"15\" placeholder=\"Comment\"></td>";
echo "<td style=\"display:none\" id=\"td2b\"><input type=\"text\" name=\"txtReference\" size=\"15\" placeholder=\"Reference\"></td>";
echo "<td style=\"display:none\" id=\"td3\"><a href=\"#\" onclick=\"fnSave();\">Save</a></td>";
echo "<td style=\"display:none\" id=\"td4\"><a href=\"#\" id=\"action\" onclick=\"fnCancel();\">Cancel</a></td>";
echo "</tr>";
echo "</table>";
?>
</ul>
</div>
<!-- end #footer -->
<input type="hidden" value="<?php echo $_GET['wordid'] ?>" id="hidWordId" name="hidWordId">
<input type="hidden" value="<?php echo $_GET['word'] ?>" id="hidWord" name="hidWord">
</form>
</body>
</html>
<?php
mysql_free_result($result);
?>