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
9c61715e
authored
2016-09-15 20:27:04 -0400
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix
1 parent
fb9792bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
app/Http/Controllers/GoogledriveuploadpdfController.php
app/pdfModel.php
app/Http/Controllers/GoogledriveuploadpdfController.php
View file @
9c61715
...
...
@@ -109,9 +109,11 @@ public function isGoogleFolderCreated($cust_id)
$saveFolderId
=
new
pdfModel
();
$saveFolderId
=
$saveFolderId
->
checkIsGoogleFolderCreated
(
$group_id
);
if
(
empty
(
$saveFolderId
)){
$this
->
createFolderGoogle
(
$cust_ids
);
$saveFolderId
=
$saveFolderId
->
checkIsGoogleFolderCreated
(
$group_id
);
if
(
count
(
$saveFolderId
)
<
1
){
$newgroup_id
=
$this
->
createFolderGoogle
(
$cust_ids
);
$saveFolderId
=
new
pdfModel
();
$saveFolderId
=
$saveFolderId
->
checkIsGoogleFolderCreated
(
$newgroup_id
);
return
$saveFolderId
;
}
else
{
...
...
@@ -175,7 +177,7 @@ public function isGoogleFolderCreated($cust_id)
$createdFile
=
$service
->
files
->
insert
(
$file
,
array
(
'mimeType'
=>
'application/vnd.google-apps.folder'
,
));
$saveFolderId
=
new
pdfModel
();
$saveFolderId
->
saveFolderId
(
$group_id
,
$folderId
,
$createdFile
->
id
);
...
...
app/pdfModel.php
View file @
9c61715
...
...
@@ -32,16 +32,17 @@ class pdfModel extends Model
$rows
=
DB
::
table
(
'googleFolderIds'
)
->
select
(
'*'
)
->
where
(
'googleFolderIds.group_id'
,
'='
,
$id
)
->
get
();
error_log
(
print_r
(
$rows
,
true
));
return
$rows
;
}
public
function
saveFolderId
(
$group_id
,
$folderId
,
$createdFile
){
$
apiCall
Id
=
DB
::
table
(
'googleFolderIds'
)
->
insertGetId
(
$
folder
Id
=
DB
::
table
(
'googleFolderIds'
)
->
insertGetId
(
array
(
'group_id'
=>
$group_id
,
'folder_id'
=>
$folderId
,
'subfolder_id'
=>
$createdFile
)
);
return
$folderId
;
}
...
...
Please
register
or
sign in
to post a comment