WRENCH_FILE_FAMILYBANNER
This commit is contained in:
@@ -270,6 +270,7 @@ define('WRENCHBOARD_ACCOUNT_NOTIFICATIONS', 11205);
|
|||||||
|
|
||||||
const WRENCHBOARD_PICTURE_PROFILE = 11300;
|
const WRENCHBOARD_PICTURE_PROFILE = 11300;
|
||||||
const WRENCHBOARD_PICTURE_JOB = 11303;
|
const WRENCHBOARD_PICTURE_JOB = 11303;
|
||||||
|
const WRENCHBOARD_PICTURE_FAMBANNER= 11304;
|
||||||
const WRENCHBOARD_PICTURE_FAMMEMBER = 11305;
|
const WRENCHBOARD_PICTURE_FAMMEMBER = 11305;
|
||||||
const WRENCHBOARD_RESOURCE_MYFILES = 11307;
|
const WRENCHBOARD_RESOURCE_MYFILES = 11307;
|
||||||
const WRENCHBOARD_MYFILES_LIST = 11309;
|
const WRENCHBOARD_MYFILES_LIST = 11309;
|
||||||
|
|||||||
@@ -34,6 +34,52 @@ class UploadManager extends Model
|
|||||||
|
|
||||||
switch ($action){
|
switch ($action){
|
||||||
|
|
||||||
|
case WRENCHBOARD_PICTURE_FAMBANNER:
|
||||||
|
|
||||||
|
if ( trim($in["uid"]) == ''){
|
||||||
|
$out["error_msg"] = "invalid_upload_call";
|
||||||
|
$out["call_backend"] = false; // something went bad
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
// MAKE SURE FOLDER AS PER PROCESS IS AVAILABLE
|
||||||
|
$thisProfileFolder = $this->savePath.'PROFILE/'.$in["uid"];
|
||||||
|
if (!file_exists($thisProfileFolder)) {
|
||||||
|
mkdir($thisProfileFolder, 0777, true);
|
||||||
|
}
|
||||||
|
if (!file_exists($thisProfileFolder."/FAMBANNER")) {
|
||||||
|
mkdir($thisProfileFolder."/FAMBANNER", 0777, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$myFilesFolder = $thisProfileFolder."/FAMBANNER";
|
||||||
|
|
||||||
|
if (file_exists($myFilesFolder)) {
|
||||||
|
//$tt_d = date('hisjmy');
|
||||||
|
$out["message"] = "completed";
|
||||||
|
$pieces = explode(".", $in['file_name']);
|
||||||
|
$in['profile'] = "profile.".$pieces[1];
|
||||||
|
$myFilesFolderFileName = $myFilesFolder.'/'. $in['profile'];
|
||||||
|
$myfile = fopen($myFilesFolderFileName, "w") or die("Unable to open file!");
|
||||||
|
$file_data = base64_decode($in["file_data"]);
|
||||||
|
fwrite($myfile, $file_data);
|
||||||
|
fclose($myfile);
|
||||||
|
$out["call_backend"] = false; // flag ready to save data entry
|
||||||
|
$data['uid'] =$in["uid"];
|
||||||
|
$data['sessionid'] =$in["sessionid"];
|
||||||
|
$data['profile'] = $in["profile"];
|
||||||
|
$data['member_id'] = $in["member_id"];
|
||||||
|
$data['file_section'] = WRENCH_FILE_FAMILYBANNER;
|
||||||
|
$out['upload_result'] = $this->specififBackendCall(WRENCHBOARD_SAVE_MEDIA,$data);
|
||||||
|
/*
|
||||||
|
* public function specififBackendCall($action,$data){
|
||||||
|
$in["action"] = $action;
|
||||||
|
$wrenchboard = new \App\Models\BackendModel();
|
||||||
|
$ret = $wrenchboard->wrenchboard_api($data, $out);
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case WRENCHBOARD_PICTURE_PROFILE:
|
case WRENCHBOARD_PICTURE_PROFILE:
|
||||||
|
|
||||||
if ( trim($in["uid"]) == ''){
|
if ( trim($in["uid"]) == ''){
|
||||||
|
|||||||
Reference in New Issue
Block a user