Esempio n. 1
0
		$QRID = $db->insert('qr_codes', $data);
		if(!$QRID){
			$log->error('Failed to update database for ' . $key['First Name'] . ' ' . $key['Last Name']);
		}
	}
}
*/
$image = new \NMC\ImageWithText\Image('test.jpg');
/*******************************************************************************************************************************
********************************************************************************************************************************
														Upload to Dropbox
********************************************************************************************************************************
*******************************************************************************************************************************/
$log->info('Starting Dropbox Upload');
$accessToken = "mcWxFEgcVbIAAAAAAAACgctpLBLkmojYc8kXY4IJDgQvtBdKiPXaUBT5bRDoj9Mu";
$appInfo = dbx\AppInfo::loadFromJsonFile($includes . "dropbox-sdk/Dropbox/app-info.json");
$webAuth = new dbx\WebAuthNoRedirect($appInfo, "PHP-Example/1.0");
$dbxClient = new dbx\Client($accessToken, "PHP-Example/1.0");
$accountInfo = $dbxClient->getAccountInfo();
$log->info('Starting CSV File Upload');
$dropbox_student_list = "/Apps/Attendance2/student_list.csv";
$log->info('Starting Dropbox Upload');
$CVSFileHandle = fopen($CVSFilePath, "rb");
if (!$CVSFileHandle) {
    $log->error('Could not Open CSV file');
    failed();
    exit;
}
$DropboxFileUploadResult = $dbxClient->uploadFile("/Apps/Attendance2/student_list.csv", dbx\WriteMode::force(), $CVSFileHandle);
if (!$DropboxFileUploadResult) {
    $log->error('Could not Upload CSV file to Dropbox');
Esempio n. 2
0
         $validated = 0;
     }
 }
 /*if (!empty($birthday)){
 			$regex = "/\d{2}\-\d{2}-\d{4}\/"; //format 00-00-0000
 			if (!preg_match($regex,$birthday)){
 				$birthdayErr = "Invalid Format (DD-MM-YYYY)";
 				$validated = 0;
 			}
 		}*/
 if (!$validated) {
     $pass = 0;
 }
 //Dropbox Stuff
 $accessToken = "mcWxFEgcVbIAAAAAAAACgctpLBLkmojYc8kXY4IJDgQvtBdKiPXaUBT5bRDoj9Mu";
 $appInfo = dbx\AppInfo::loadFromJsonFile("/home/clohs15/dropbox-sdk/Dropbox/app-info.json");
 $webAuth = new dbx\WebAuthNoRedirect($appInfo, "PHP-Example/1.0");
 $dbxClient = new dbx\Client($accessToken, "PHP-Example/1.0");
 $accountInfo = $dbxClient->getAccountInfo();
 //	All photo upload code here except file type and name
 if (is_uploaded_file($_FILES['uploadedFile']['tmp_name'])) {
     //Grab filetype extension
     $imageFileType = image_type_to_extension(exif_imagetype($_FILES['uploadedFile']['tmp_name']));
     // Allow certain file formats
     if ($imageFileType != ".jpg" && $imageFileType != ".png" && $imageFileType != ".jpeg" && $imageFileType != ".gif") {
         echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
         $uploadOk = 0;
         $dropxboxImageFlag = 0;
         $error = 0;
     }
     //Write custom filename when it gets uploaded