forked from shivangg66/ERP-Module
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform.php
More file actions
245 lines (244 loc) · 7.85 KB
/
form.php
File metadata and controls
245 lines (244 loc) · 7.85 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
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Research Form</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<link rel="stylesheet" href="./css/form.css">
<script>
function back(){
window.parent.$("#frame").html("");
window.parent.$("#frame").load('edit.php');
}
</script>
</head>
<body>
<?php
require('connection.php');
session_start();
$month=array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
$category=array("Journal","Conference","Book Chapter","Book","Magazine","News Paper","White Paper","Patent","Transaction");
$indexed=array("SCI","Scopus","eSCI","UGC Approved","Other");
$department=array("Informatics","Systemics","Cybernetics","Virtualization","Computer Application");
$sap_id = $_SESSION['sapid'];
#$title = $_GET['title'];
?>
<form method="POST" action"" onsubmit="submit_form();">
<fieldset style="background-color:#AFEEEE">
<legend class= "bfont">General Information</legend>
<div class="centerdiv">
 Title:   
<textarea required rows="2" cols="100" name="title" id="title" onchange="validate();"></textarea>
</div>
<div class="aligndiv author">
List of Authors:
<span class="tooltiptext">List of Authors should be typed as they appear in the paper</span>
<input size="16" type="text" name = "authors" id="authors">
</div>
<div class="aligndiv">Department:
<select name="department" id="department">
<?php
foreach($department as $dep)
{
echo "<option value=\"$dep\">".$dep."</option>";
}
?>
</select>
</div>
<div class="aligndiv">
Affiliation:
<input size="16" type="text" name="affiliation" id="affiliation">
</div>
</fieldset>
<fieldset style="background-color:#AFEEEE">
<legend class= "bfont">Publication Information</legend>
<div class="aligndiv">
Publisher: 
<input size="16" type="text" name="publisher" id="publisher">
</div>
<div class="aligndiv">
Identifier:
<select name="identifier" id="identifier">
<option value="ISSN">ISSN</option>
<option value="ISBN">ISBN</option>
<option value="ISSP">ISSP</option>
</select>
</div>
<div class="aligndiv">
Number:
<input size="16" type="text" name="number" id="number">
</div>
<div class="aligndiv">Indexed in:
<select name="indexed" id="indexed">
<?php
foreach($indexed as $ind)
{
echo "<option value=\"$ind\">".$ind."</option>";
}
?>
</select>
</div>
<div class="aligndiv">
Volume:  
<input size="16" type="text" name="value" id="volume">
</div>
<div class="aligndiv">
Issue:    
<input size="16" type="text" name="issue" id="issue">
</div>
<div class="aligndiv">
Page No.:  
<input size="16" type="text" name="pageno" id="pageno">
</div>
<div class="aligndiv">
DOI:   
<input size="16" type="text" name="doi" id="doi">
</div>
<div class="aligndiv">
URL:   
<input size="16" type="text" name="url" id="url">
</div>
<div class="aligndiv">
Month:   
<select name="month" id="month">
<option value="<?php echo date("M");?>" select="selected"><?php echo date("M");?></option>
<?php
foreach($month as $mon)
{
if($mon == date("M"))
continue;
echo "<option value=\"$mon\">".$mon."</option>";
}
?>
</select>
</div>
<div class="aligndiv">
Year:    
<input size="16" type="text" id="year" name="year" value="<?php echo date("Y");?>">
</div>
<div class="aligndiv">
Category:
<select name="category" id="category">
<?php
foreach($category as $cat)
{
echo "<option value=\"$cat\">".$cat."</option>";
}
?>
</select>
</div>
</fieldset>
<fieldset style="background-color:#AFEEEE">
<legend class= "bfont">Submission Information</legend>
<div class="aligndiv">Verification Document:
<select name="verification" id="verification">
<option value="Certificate">Certificate</option>
<option value=""></option>
<option value=""></option>
</select>
</div>
<div class="aligndiv">
Paper Status:
<select name="status" id="status">
<option value="Submitted">Submitted</option>
<option value="Accepted">Accepted</option>
<option value="In-print">In-print</option>
<option value="Published">Published</option>
</select>
</div>
<div class="aligndiv">
<input size="16" type="button" onclick = "submit_form()" value="Submit" name="submit" id="submit" disabled="disabled">
<input size="16" type = "button" onclick = "back()" value = "Back">
</div>
</fieldset>
</form>
<script>
function validate()
{
var title= $("#title").val();
$.ajax({
data: {title: title},
url:"validate.php",
complete: function (response){
var exist = response.responseText;
if(exist=="y")
{
$("#submit").removeAttr('disabled');
}
else {
{
alert("Duplicate Title");
}
}
}
});
}
function submit_form()
{
var sap= "<?php echo $sap_id; ?>";
var title= $("#title").val();
var authors= $("#authors").val();
if(authors.length==0)
{var authors=null;}
var department= $("#department").val();
if(department.length==0)
{var department=null;}
var affiliation= $("#affiliation").val();
if(affiliation.length==0)
{var affiliation=null;}
var publisher= $("#publisher").val();
if(publisher.length==0)
{var publisher=null;}
var identifier= $("#identifier").val();
if(identifier.length==0)
{var identifier=null;}
var number= $("#number").val();
if(number.length==0)
{var number=null;}
var indexed= $("#indexed").val();
if(indexed.length==0)
{var indexed=null;}
var volume= $("#volume").val();
if(volume.length==0)
{var volume=null;}
var issue= $("#issue").val();
if(issue.length==0)
{var issue=null;}
var pageno= $("#pageno").val();
if(pageno.length==0)
{var pageno=null;}
var doi= $("#doi").val();
if(doi.length==0)
{var doi=null;}
var url= $("#url").val();
if(url.length==0)
{var url=null;}
var month= $("#month").val();
if(month.length==0)
{var month=null;}
var year= $("#year").val();
if(year.length==0)
{var year=null;}
var category= $("#category").val();
if(category.length==0)
{var category=null;}
var verification= $("#verification").val();
if(verification.length==0)
{var verification=null;}
var status= $("#status").val();
if(status.length==0)
{var status=null;}
var remarks= "Pending";
var query= "INSERT INTO data (sap_id,title,authors,department,affiliation,category,publisher,month,year,identifier,number,doi,indexed,volume,issue,page_no,url,verification_document,status,remarks) VALUES("+sap+",'"+title+"','"+authors+"','"+department+"','"+affiliation+"','"+category+"','"+publisher+"','"+month+"',"+year+",'"+identifier+"','"+number+"','"+doi+"','"+indexed+"',"+volume+","+issue+",";
var query= query+"'"+pageno+"','"+url+"','"+verification+"','"+status+"','"+remarks+"')";
$.ajax({
data: {query: query},
url:"insert.php",
complete: function (response){
alert(response.responseText);
}
});
}
</script>
</body>
</html>