-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsessiontest.php
49 lines (47 loc) · 1.54 KB
/
sessiontest.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
<!DOCTYPE HTML>
<html>
<head>
<title>Print page</title>
<?php
include ('temp.php');
include('config.php');
$sqlGetPID; // SQL Get printing shop ID
$dataRetrievePID; //dbconnection
$pid;
if(isset($_POST['printnow'])){
$sqlGetPID = "SELECT P_ID_G FROM printer WHERE PS_ID = " . $_POST['pname'] . " LIMIT 1";
$dataRetrievePID = mysqli_query($dbcon,$sqlGetPID);
$pid = mysqli_fetch_row($dataRetrievePID);
echo "$pid[0]\n";
}
?>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
<script src="http://malsup.github.com/jquery.form.js"></script>
</head>
<body>
<form id="submitprint" action="https://www.google.com/cloudprint/submit" method="post" enctype="multipart/form-data">
<input type ="hidden" name="xsrf" value="<?php echo $xsrf;?>"/>
<input type="hidden" name="printerid" value="<?php echo $pid[0]?>"/>
<input type="hidden" name="title" value="Test print"/>
<input type="hidden" name="contentType"/>
<textarea rows="15" cols="40" name="ticket" id="submit_ticket"/>{
"version": "1.0",
"print": {}
}
}</textarea>
<input type="file" name="content" id="submit_content" />
<input type="hidden" name="jobid"/>
<input type="submit" id="submit" value="Confirm?">
</form>
<script>
$('#myForm')
.ajaxForm({
url : 'https://www.google.com/cloudprint/submit', // or whatever
dataType : 'json',
success : function (response) {
alert("The server says: " + response);
}
});
</script>
</body>
</html>