Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
pdf-customizer
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
7dbc1e0c
authored
2016-07-21 12:08:25 -0400
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
ee
1 parent
78d5bd03
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
7 deletions
app/Http/Controllers/ApiController.php
app/Http/Controllers/GoogledriveuploadpdfController.php
app/pdfModel.php
public/files/js/interfaceGdrive.js
app/Http/Controllers/ApiController.php
View file @
7dbc1e0
...
...
@@ -107,6 +107,7 @@ class ApiController extends Controller
$json
=
json_encode
(
$json
);
$json
=
json_decode
(
$json
);
$pdfLocation
=
$json
->
pdf
[
0
]
->
pdfLocation
;
$cust_id
=
$json
->
pdf
[
0
]
->
custId
;
...
...
@@ -144,7 +145,7 @@ class ApiController extends Controller
$response
=
$pdfId
;
$statusCode
=
200
;
$UploaqdPdf
=
new
GoogledriveuploadpdfController
();
$UploaqdPdf
->
google_drive_upload
(
$folder
,
'new_'
.
$pdfLocation
,
$pdfId
);
$UploaqdPdf
->
google_drive_upload
(
$folder
,
'new_'
.
$pdfLocation
,
$pdfId
,
$cust_id
);
return
Response
::
json
(
$response
,
$statusCode
);
...
...
@@ -183,7 +184,7 @@ public function getpdfgoogle($json)
$rows
=
new
pdfModel
();
$id
=
$rows
->
getpdfid
(
$json
)
->
get
();
// $rows = new pdfModel();
$rows
=
$rows
->
getpdf
(
$id
[
0
]
->
pdfid
)
->
get
();
$response
=
$rows
;
$statusCode
=
200
;
...
...
app/Http/Controllers/GoogledriveuploadpdfController.php
View file @
7dbc1e0
...
...
@@ -26,14 +26,14 @@ use Imagick;
class
GoogledriveuploadpdfController
extends
Controller
{
public
function
google_drive_upload
(
$folder
,
$filename
,
$PdfId
)
public
function
google_drive_upload
(
$folder
,
$filename
,
$PdfId
,
$cust_id
)
{
session_start
();
$pdffile
=
new
FileEntryController
();
$pdfFile
=
$pdffile
->
getPDF
(
$folder
,
$filename
);
$user
=
new
pdfModel
();
$user
=
$user
->
getGoogleUserOath
(
'2'
)
->
get
();;
$user
=
$user
->
getGoogleUserOath
(
$cust_id
)
->
get
();;
...
...
app/pdfModel.php
View file @
7dbc1e0
...
...
@@ -120,7 +120,7 @@ class pdfModel extends Model
$fileName
=
explode
(
'.'
,
$fileName
);
$pdfId
=
DB
::
table
(
'PDF'
)
->
insertGetId
(
array
(
'name'
=>
$json
->
pdf
[
0
]
->
name
,
'folder'
=>
$folder
,
'file'
=>
end
(
$file
),
'
apiCallId'
=>
$apiCall
Id
,
'image'
=>
$fileName
[
0
]
.
'.jpg'
,
'pheight'
=>
$json
->
pdf
[
0
]
->
pageHeight
,
'pwidth'
=>
$json
->
pdf
[
0
]
->
pageWidth
)
array
(
'name'
=>
$json
->
pdf
[
0
]
->
name
,
'folder'
=>
$folder
,
'file'
=>
end
(
$file
),
'
custId'
=>
$json
->
pdf
[
0
]
->
cust
Id
,
'image'
=>
$fileName
[
0
]
.
'.jpg'
,
'pheight'
=>
$json
->
pdf
[
0
]
->
pageHeight
,
'pwidth'
=>
$json
->
pdf
[
0
]
->
pageWidth
)
);
foreach
(
$json
->
changes
as
$change
)
{
...
...
public/files/js/interfaceGdrive.js
View file @
7dbc1e0
...
...
@@ -34,7 +34,7 @@ function getAuth() {
$
.
ajax
(
settings
).
done
(
function
(
response
)
{
console
.
log
(
response
);
token
=
response
;
});
});
}
...
...
@@ -136,6 +136,7 @@ function getJson(user_id) {
// Get the element with id summary and set the inner text to the result.
var
json
=
JSON
.
stringify
(
data
);
pickPdfFromList
(
json
);
});
});
}
...
...
@@ -480,7 +481,7 @@ function returnOptions(form) {
var
jsonReturn
=
'{"pdf":[{"name":"'
+
json
[
0
].
name
+
'", "folder":"'
+
json
[
0
].
folder
+
'", "pdfLocation":"'
+
json
[
0
].
file
+
'","pageWidth":"'
+
json
[
0
].
pwidth
+
'","pageHeight":"'
+
json
[
0
].
pheight
+
'"}],"changes":['
var
jsonReturn
=
'{"pdf":[{"name":"'
+
json
[
0
].
name
+
'", "folder":"'
+
json
[
0
].
folder
+
'", "pdfLocation":"'
+
json
[
0
].
file
+
'","pageWidth":"'
+
json
[
0
].
pwidth
+
'","pageHeight":"'
+
json
[
0
].
pheight
+
'"
, "custId":"'
+
user_id
+
'"
}],"changes":['
var
e
=
1
;
for
(
i
=
0
;
i
<
json
.
length
;
++
i
)
{
...
...
Please
register
or
sign in
to post a comment