-
Notifications
You must be signed in to change notification settings - Fork 2
/
process.php
46 lines (42 loc) · 1.25 KB
/
process.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
<?php
include('settings.php');
if($_POST['action'] == "voclist_add") {
if(isset($_POST['name'])){
if (!mysql_query("insert into voclists values('', '', '".$sessionid."', '".$_POST['name']."')")){
echo "false";
} else {
echo mysql_fetch_array(mysql_query("SELECT LAST_INSERT_ID()"))['LAST_INSERT_ID()'];
}
}
}
if($_POST['action'] == "voclist_del") {
if(isset($_POST['id'])){
if(!mysql_query("delete from voclists where listid='".$_POST['id']."'")){
echo "false";
die(mysql_error());
} else {
echo "true";
}
if(!mysql_query("delete from voclists_content where listid='".$_POST['id']."'")){
echo "false";
die(mysql_error());
} else {
echo "true";
}
}
}
if($_POST['action'] == "voclist_item_add") {
if(isset($_POST['items']) and isset($_POST['id'])){
$trans = json_decode($_POST['items']);
$result_voclists = mysql_query("insert into voclists_content values(".$_POST['id'].", '".$trans[0]."', '".$trans[2]."', '".$trans[1]."', '".$trans[3]."')") or die(mysql_error());
echo $result_voclists;
}
}
if($_POST['action'] == "export_pdf") {
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();
}
?>