ee
Showing
4 changed files
with
9 additions
and
7 deletions
| ... | @@ -107,6 +107,7 @@ class ApiController extends Controller | ... | @@ -107,6 +107,7 @@ class ApiController extends Controller |
| 107 | $json = json_encode($json); | 107 | $json = json_encode($json); |
| 108 | $json = json_decode($json); | 108 | $json = json_decode($json); |
| 109 | $pdfLocation = $json->pdf[0]->pdfLocation; | 109 | $pdfLocation = $json->pdf[0]->pdfLocation; |
| 110 | $cust_id = $json->pdf[0]->custId; | ||
| 110 | 111 | ||
| 111 | 112 | ||
| 112 | 113 | ||
| ... | @@ -144,7 +145,7 @@ class ApiController extends Controller | ... | @@ -144,7 +145,7 @@ class ApiController extends Controller |
| 144 | $response = $pdfId; | 145 | $response = $pdfId; |
| 145 | $statusCode = 200; | 146 | $statusCode = 200; |
| 146 | $UploaqdPdf = new GoogledriveuploadpdfController(); | 147 | $UploaqdPdf = new GoogledriveuploadpdfController(); |
| 147 | $UploaqdPdf->google_drive_upload($folder, 'new_'.$pdfLocation,$pdfId); | 148 | $UploaqdPdf->google_drive_upload($folder, 'new_'.$pdfLocation,$pdfId,$cust_id); |
| 148 | return Response::json( $response, $statusCode); | 149 | return Response::json( $response, $statusCode); |
| 149 | 150 | ||
| 150 | 151 | ||
| ... | @@ -183,7 +184,7 @@ public function getpdfgoogle($json) | ... | @@ -183,7 +184,7 @@ public function getpdfgoogle($json) |
| 183 | $rows = new pdfModel(); | 184 | $rows = new pdfModel(); |
| 184 | $id = $rows->getpdfid($json)->get(); | 185 | $id = $rows->getpdfid($json)->get(); |
| 185 | 186 | ||
| 186 | // $rows = new pdfModel(); | 187 | |
| 187 | $rows = $rows->getpdf($id[0]->pdfid)->get(); | 188 | $rows = $rows->getpdf($id[0]->pdfid)->get(); |
| 188 | $response = $rows; | 189 | $response = $rows; |
| 189 | $statusCode = 200; | 190 | $statusCode = 200; | ... | ... |
| ... | @@ -26,14 +26,14 @@ use Imagick; | ... | @@ -26,14 +26,14 @@ use Imagick; |
| 26 | class GoogledriveuploadpdfController extends Controller | 26 | class GoogledriveuploadpdfController extends Controller |
| 27 | { | 27 | { |
| 28 | 28 | ||
| 29 | public function google_drive_upload($folder, $filename,$PdfId) | 29 | public function google_drive_upload($folder, $filename,$PdfId,$cust_id) |
| 30 | { | 30 | { |
| 31 | session_start(); | 31 | session_start(); |
| 32 | $pdffile = new FileEntryController(); | 32 | $pdffile = new FileEntryController(); |
| 33 | $pdfFile = $pdffile->getPDF($folder, $filename); | 33 | $pdfFile = $pdffile->getPDF($folder, $filename); |
| 34 | 34 | ||
| 35 | $user = new pdfModel(); | 35 | $user = new pdfModel(); |
| 36 | $user = $user->getGoogleUserOath('2')->get();; | 36 | $user = $user->getGoogleUserOath($cust_id)->get();; |
| 37 | 37 | ||
| 38 | 38 | ||
| 39 | 39 | ... | ... |
| ... | @@ -120,7 +120,7 @@ class pdfModel extends Model | ... | @@ -120,7 +120,7 @@ class pdfModel extends Model |
| 120 | $fileName = explode('.', $fileName); | 120 | $fileName = explode('.', $fileName); |
| 121 | 121 | ||
| 122 | $pdfId = DB::table('PDF')->insertGetId( | 122 | $pdfId = DB::table('PDF')->insertGetId( |
| 123 | array('name' => $json->pdf[0]->name, 'folder' => $folder, 'file' => end($file), 'apiCallId' => $apiCallId, 'image'=> $fileName[0].'.jpg','pheight' => $json->pdf[0]->pageHeight, 'pwidth' => $json->pdf[0]->pageWidth) | 123 | array('name' => $json->pdf[0]->name, 'folder' => $folder, 'file' => end($file), 'custId' => $json->pdf[0]->custId, 'image'=> $fileName[0].'.jpg','pheight' => $json->pdf[0]->pageHeight, 'pwidth' => $json->pdf[0]->pageWidth) |
| 124 | ); | 124 | ); |
| 125 | 125 | ||
| 126 | foreach($json->changes as $change) { | 126 | foreach($json->changes as $change) { | ... | ... |
| ... | @@ -34,7 +34,7 @@ function getAuth() { | ... | @@ -34,7 +34,7 @@ function getAuth() { |
| 34 | 34 | ||
| 35 | $.ajax(settings).done(function(response) { | 35 | $.ajax(settings).done(function(response) { |
| 36 | console.log(response); | 36 | console.log(response); |
| 37 | token = response; | 37 | |
| 38 | }); | 38 | }); |
| 39 | }); | 39 | }); |
| 40 | } | 40 | } |
| ... | @@ -136,6 +136,7 @@ function getJson(user_id) { | ... | @@ -136,6 +136,7 @@ function getJson(user_id) { |
| 136 | // Get the element with id summary and set the inner text to the result. | 136 | // Get the element with id summary and set the inner text to the result. |
| 137 | var json = JSON.stringify(data); | 137 | var json = JSON.stringify(data); |
| 138 | pickPdfFromList(json); | 138 | pickPdfFromList(json); |
| 139 | |||
| 139 | }); | 140 | }); |
| 140 | }); | 141 | }); |
| 141 | } | 142 | } |
| ... | @@ -480,7 +481,7 @@ function returnOptions(form) { | ... | @@ -480,7 +481,7 @@ function returnOptions(form) { |
| 480 | 481 | ||
| 481 | 482 | ||
| 482 | 483 | ||
| 483 | var jsonReturn = '{"pdf":[{"name":"' + json[0].name + '", "folder":"' + json[0].folder + '", "pdfLocation":"' + json[0].file + '","pageWidth":"' + json[0].pwidth + '","pageHeight":"' + json[0].pheight + '"}],"changes":[' | 484 | 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":[' |
| 484 | var e = 1; | 485 | var e = 1; |
| 485 | for (i = 0; i < json.length; ++i) { | 486 | for (i = 0; i < json.length; ++i) { |
| 486 | 487 | ... | ... |
-
Please register or sign in to post a comment