Пример #1
0
 public function agregar()
 {
     $userid = Auth::user()->id;
     $curso = new Curso();
     $curso->nombre = Input::get('nombre');
     $curso->descripcion = Input::get('descripcion');
     //$file = Input::file('image');
     $curso->activo = Input::get('activo');
     $curso->tipo = Input::get('tipo');
     $curso->basefile = "";
     $curso->id_user = 1;
     $curso->save();
     $the_id = $curso->id;
     $curso = Curso::find($the_id);
     $file = Input::file('logo');
     $destinationPath = 'temp/';
     $filename = $userid . "" . $file->getClientOriginalName();
     Input::file('logo')->move($destinationPath, $filename);
     $file = ParseFile::createFromFile($destinationPath . "/" . $filename, $filename);
     $file->save();
     $url = $file->getURL();
     $curso->img = "" . $url;
     $jobApplication = new ParseObject("cursos");
     $jobApplication->set("myid", $the_id);
     $jobApplication->set("img", $file);
     $jobApplication->save();
     $curso->save();
     File::delete($destinationPath . "/" . $filename);
 }
Пример #2
0
 public function add($data)
 {
     $filePath = $data["uploadPhoto"]["tmp_name"];
     $ext = pathinfo($data["uploadPhoto"]["name"], PATHINFO_EXTENSION);
     $file = ParseFile::createFromFile($filePath, $data["username"] . "." . $ext);
     $file->save();
     $url = $file->getUrl();
     $cp = new ParseObject("_User");
     $cp->set("username", $data["username"]);
     $cp->set("password", 'leafblast');
     $cp->set("firstName", $data["firstName"]);
     $cp->set("lastName", $data["lastName"]);
     $cp->set("email", $data["email"]);
     $cp->set("homeAddress", $data["homeAddress"]);
     $cp->set("phoneNumber", $data["phoneNumber"]);
     $cp->set("operatorPicture", $file);
     $cp->set("isOperator", true);
     $cp->set("isRemoved", false);
     $cp->set("isSuspended", true);
     $cp->set("isFirstTime", true);
     $cp->set("isDeactivated", true);
     try {
         $cp->save();
         // die('<pre>'.print_r($cp, true));
         $cu = new ParseObject("UserData");
         $cu->set("user", $cp);
         $cu->save();
         return $cp->getObjectId();
     } catch (ParseException $ex) {
         die('<pre>' . print_r($ex->getMessage(), true));
     }
 }
Пример #3
0
 public function postVideo()
 {
     ini_set('max_execution_time', 300);
     $userid = Auth::user()->id;
     $idcurso = Input::get('idcurso');
     $recurso = new Recurso();
     $recurso->nombre = Input::get('nombre');
     $recurso->descripcion = Input::get('descripcion');
     //$file = Input::file('image');
     $recurso->activo = Input::get('activo');
     $recurso->id_user = 1;
     $recurso->id_curso = $idcurso;
     $recurso->save();
     $the_id = $recurso->id;
     $recurso = Recurso::find($the_id);
     $destinationPath = 'temp/';
     $file = Input::file('video');
     $filename = $userid . "" . $file->getClientOriginalName();
     Input::file('video')->move($destinationPath, $filename);
     $file = ParseFile::createFromFile($destinationPath . "/" . $filename, $filename);
     $file->save();
     $url = $file->getURL();
     $recurso->URL = "" . $url;
     $jobApplication = new ParseObject("recursos");
     $jobApplication->set("myid", $the_id);
     $jobApplication->set("res", $file);
     $jobApplication->save();
     $recurso->save();
     File::delete($destinationPath . "/" . $filename);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     try {
         ParseClient::initialize(env('PARSE_ID', 'f**k'), env('PARSE_REST', 'f**k'), env('PARSE_MASTER', 'f**k'));
         $data = Input::file('file');
         $path = $data->getRealPath();
         $mime = $data->getMimeType();
         $nomeOriginal = $data->getClientOriginalName();
         $nomeCorrigido = preg_replace('/\\s+/', '', $nomeOriginal);
         $file = ParseFile::createFromFile($path, $nomeCorrigido, $mime);
         $file->save();
         $nome = Input::get('nome');
         $especialidadeId = Input::get('especialidadeId');
         $especQuery = new ParseQuery("Especialidade");
         $especialidade = $especQuery->get($especialidadeId);
         $anexo = ParseObject::create("Anexo");
         $anexo->set('conteudo', $file);
         $anexo->set('nome', $nome);
         $anexo->set('especialidade', $especialidade);
         $anexo->save();
         return json_encode(['url' => $anexo->get('conteudo')->getURL(), 'Id' => $anexo->getObjectId()]);
     } catch (ParseException $error) {
         return $error;
     }
 }
Пример #5
0
 public function testParseFileFactories()
 {
     $file = ParseFile::_createFromServer("hi.txt", "http://");
     $file2 = ParseFile::createFromData("hello", "hi.txt");
     $file3 = ParseFile::createFromFile("ParseFileTest.php", "file.php");
     $this->assertEquals("http://", $file->getURL());
     $this->assertEquals("hi.txt", $file->getName());
     $this->assertEquals("hello", $file2->getData());
     $this->assertEquals("hi.txt", $file2->getName());
     $this->assertTrue(strpos($file3->getData(), 'i am looking for myself') !== false);
 }
Пример #6
0
 public function testParseFileFactories()
 {
     $file = ParseFile::_createFromServer('hi.txt', 'http://');
     $file2 = ParseFile::createFromData('hello', 'hi.txt');
     $file3 = ParseFile::createFromFile('ParseFileTest.php', 'file.php');
     $this->assertEquals('http://', $file->getURL());
     $this->assertEquals('hi.txt', $file->getName());
     $this->assertEquals('hello', $file2->getData());
     $this->assertEquals('hi.txt', $file2->getName());
     $this->assertTrue(strpos($file3->getData(), 'i am looking for myself') !== false);
 }
Пример #7
0
function upload_to_parse($name, $image, $description, $archive)
{
    $obj = ParseObject::create("News");
    try {
        $file_image = ParseFile::createFromFile($image, basename($image));
        $obj->set("image", $file_image);
        $obj->set("caption", $name);
        $obj->save();
    } catch (\Parse\ParseException $e) {
        print $e;
    }
}
    $uploadOk = 0;
}*/
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
    $errMsg = $errMsg . "Sorry, your file was not uploaded.<br>";
    $success = false;
    // if everything is ok, try to upload file
} else {
    if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
        $errMsg = $errMsg . "The file " . basename($_FILES["fileToUpload"]["name"]) . " has been uploaded.<br>";
    } else {
        $errMsg = $errMsg . "Sorry, there was an error uploading your file.";
        $success = false;
    }
}
$file = ParseFile::createFromFile($target_file, basename($_FILES["fileToUpload"]["name"]));
echo "still ok";
$file->save();
$url = $file->getURL();
$application->set("resumeFile", $file);
$application->set("resumeURL", $url);
try {
    $application->save();
    //echo 'New object created with objectId: ' . $application->getObjectId();
} catch (ParseException $ex) {
    // Execute any logic that should take place if the save fails.
    // error is a ParseException object with an error code and message.
    //echo 'Failed to create new object, with error message: ' . $ex->getMessage();
    $success = false;
    $errMsg = $errMsg . 'Failed to create new object, with error message: ' . $ex->getMessage() . '<br>';
}
Пример #9
0
<?php

require './parse-php-sdk/autoload.php';
date_default_timezone_set('Asia/Tokyo');
use Parse\ParseClient;
use Parse\ParseObject;
use Parse\ParseFile;
ParseClient::initialize('rLfiUPlbIE5orN0Al07gpotnvIpqwTUpoQlkhjO0', 'LnIgqdYSz8krs6iKBdH5XtGqglkyjzuSEHTnNbEC', 'jtNDkVGTpaVeregAuvlTYOUCErbKnSMgE7F6x9Fo');
for ($count = 102; $count <= 120; $count++) {
    $obj = ParseObject::create("Countdown");
    try {
        $file_image = ParseFile::createFromFile("./{$count}.jpg", "{$count}.jpg");
        $obj->set("image", $file_image);
        $obj->set("title", "{$count}");
        $obj->save();
    } catch (\Parse\ParseException $e) {
        print $e;
    }
}
Пример #10
0
    }
}
$file_name_array = array();
ParseClient::setServerURL($source_url);
foreach ($results_src as $object) {
    $id = $object->getObjectId();
    $file = $object->get("image");
    $name = $file->getName();
    $url = $file->getURL();
    // Download the contents:
    $contents = $file->getData();
    $p = strrpos($name, "-");
    $short_name = substr($name, $p + 1);
    $image_path = "c/" . $short_name;
    array_push($file_name_array, $short_name);
    file_put_contents($image_path, $contents);
    echo $id . ":" . $short_name . "\n";
}
ParseClient::setServerURL($dest_url);
for ($i = 0; $i < count($results_dst); $i++) {
    $obj = $results_dst[$i];
    $file_name = $file_name_array[$i];
    $file_image = ParseFile::createFromFile("c/" . $file_name, "{$file_name}");
    try {
        $obj->set("image", $file_image);
        $obj->save();
        echo "Wrote " . $file_name . ".\n";
    } catch (\Parse\ParseException $e) {
        print $e;
    }
}
Пример #11
0
 /**
  * Like ParseFile::createFromFile member function.
  * Added: sanitize the file name and build file name
  * (if $name missing) from basename of $path
  *
  * @param      $path
  * @param null $name
  * @param null $mimeType
  *
  * @return ParseFile
  */
 public static function File_createFromFile($path, $name = null, $mimeType = null)
 {
     return ParseFile::createFromFile($path, static::SanitizeFileName($name ?: basename($path)), $mimeType);
 }
Пример #12
0
 $email = $_POST['email'];
 $name = $_POST['name'];
 $pass = $_POST['pass'];
 //make sure all fields are set
 if (!empty($email) && !empty($pass) && !empty($name) && isset($_POST['submit'])) {
     /* strip of any sketchy characters */
     $email = htmlspecialchars($email);
     $company_name = htmlspecialchars($name);
     $pass = htmlspecialchars($pass);
     $target_dir = "assets/uploads/";
     $name = $_FILES['file']['name'];
     $tempFile = $_FILES['file']['tmp_name'];
     if (isset($name)) {
         move_uploaded_file($tempFile, $target_dir . $name);
     }
     $file = ParseFile::createFromFile($target_dir . $name, "logo");
     $file->save();
     // create new user object
     $user = new ParseUser();
     $user->set("username", $email);
     $user->set("password", $pass);
     $user->set("email", $email);
     $user->set("corporate", true);
     $user->set("name", $company_name);
     $user->set("logo", $file);
     $user->set("logo_url", $file->getURL());
     unlink($target_dir . $name);
     // try signup
     try {
         $user->signUp();
         // Hooray! Let them use the app now.
Пример #13
0
use Parse\ParseUser;
use Parse\ParseFile;
$query = new ParseQuery("surveys");
$survey_id = $_SESSION['survey'];
$survey = $query->get($survey_id);
$i = 1;
while ($survey->get("img" . $i) != null) {
    $i++;
}
//look for empty space
$ds = DIRECTORY_SEPARATOR;
//1
$storeFolder = 'assets/';
//2
if (!empty($_FILES)) {
    $tempFile = $_FILES['file']['tmp_name'];
    //3
    $targetPath = dirname(__FILE__) . $ds . $storeFolder . $ds;
    //4
    $targetFile = $targetPath . $_FILES['file']['name'];
    //5
    move_uploaded_file($tempFile, $targetFile);
    //6
    $file = ParseFile::createFromFile($targetFile, "img" . $i);
    $file->save();
    $survey->set("file_url" . $i, $file->getURL());
    //$survey->add("images", $file);
    $survey->set("img" . $i, $file);
    $survey->save();
    unlink($targetFile);
}
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update()
 {
     try {
         ParseClient::initialize(env('PARSE_ID', 'f**k'), env('PARSE_REST', 'f**k'), env('PARSE_MASTER', 'f**k'));
         $sobreData = Input::file('sobreFile');
         if ($sobreData) {
             $path = $sobreData->getRealPath();
             $mime = $sobreData->getMimeType();
             $nomeOriginal = $sobreData->getClientOriginalName();
             $nomeCorrigido = preg_replace('/\\s+/', '', $nomeOriginal);
             $sobreFile = ParseFile::createFromFile($path, $nomeCorrigido, $mime);
             $sobreFile->save();
         }
         $iconeData = Input::file('iconeFile');
         if ($iconeData) {
             $path = $iconeData->getRealPath();
             $size = getimagesize($path);
             if ($size[0] == 40 && $size[1] == 40) {
                 $mime = $iconeData->getMimeType();
                 $nomeOriginal = $iconeData->getClientOriginalName();
                 $nomeCorrigido = preg_replace('/\\s+/', '', $nomeOriginal);
                 $iconeFile = ParseFile::createFromFile($path, $nomeCorrigido, $mime);
                 $iconeFile->save();
             } else {
                 throw new Exception("Imagem inválida. Tamanho necessário 40x40", 199);
             }
         }
         $especialidadeId = Input::get('especialidadeId');
         $nome = Input::get('nome');
         $origem = Input::get('origem');
         $especQuery = new ParseQuery("Especialidade");
         $especialidade = $especQuery->get($especialidadeId);
         $especialidade->set('origem', $origem);
         $especialidade->set('nome', $nome);
         if ($sobreData) {
             $especialidade->set('pdfSobre', $sobreFile);
         }
         if ($iconeData) {
             $especialidade->set('imagem', $iconeFile);
         }
         $especialidade->save();
         return 200;
     } catch (ParseException $error) {
         dd($error);
         return $error;
     }
 }
Пример #15
0
date_default_timezone_set('Asia/Tokyo');
use Parse\ParseClient;
use Parse\ParseObject;
use Parse\ParseFile;
ParseClient::initialize('rLfiUPlbIE5orN0Al07gpotnvIpqwTUpoQlkhjO0', 'LnIgqdYSz8krs6iKBdH5XtGqglkyjzuSEHTnNbEC', 'jtNDkVGTpaVeregAuvlTYOUCErbKnSMgE7F6x9Fo');
$obj = ParseObject::create("Quiz");
$obj->set("title", $text_param1);
$obj->set("difficulty", $text_param2);
$obj->set("quiz", $text_param3);
$file1 = ParseFile::createFromFile($file_param1_uploaded_path, basename($file_param1_uploaded_path));
$obj->set("quiz_image", $file1);
$obj->set("choice1", $text_param4);
$obj->set("choice2", $text_param5);
$obj->set("choice3", $text_param6);
$obj->set("answer", $text_param7);
$file2 = ParseFile::createFromFile($file_param2_uploaded_path, basename($file_param2_uploaded_path));
$obj->set("answer_image", $file2);
$obj->set("description", $text_param8);
$obj->save();
$upload_success = true;
require_once "header.php";
?>

<body>
<div class="main">
<div id="contactInfo">

<?php 
if ($upload_success) {
    ?>
	<h1>投稿完了</h1>
Пример #16
0
     break;
 case 'gallery':
     $gallery = new ParseQuery("gallery");
     $gallery->limit(1000);
     $results = $gallery->find();
     $returnData = json_encode(array("success" => true, "data" => $results));
     break;
 case 'uploadFile':
     $file = ParseFile::createFromData(file_get_contents("php://input"), str_replace(" ", "", $_REQUEST['name']));
     $file->save();
     $url = $file->getURL();
     $name = $file->getName();
     $returnData = '{"name":"' . $name . '","url":"' . $url . '"}';
     break;
 case 'uploadFileImg':
     $file = ParseFile::createFromFile($_FILES['pic']['tmp_name'], str_replace(" ", "", $_FILES['pic']['name']));
     $file->save();
     $url = $file->getURL();
     $name = $file->getName();
     echo '{"name":"' . $name . '","url":"' . $url . '"}';
     exit;
     break;
 case 'updateEmployee':
     $dataObject = json_decode(file_get_contents("php://input"), true);
     $updateEmp = new ParseObject('Employers', $_GET['objectId']);
     $updateEmp->set("name", $dataObject['name']);
     $updateEmp->set("primaryColor", $dataObject['primaryColor']);
     $updateEmp->set("secondaryColor", $dataObject['secondaryColor']);
     $updateEmp->set("agencyId", $dataObject['agencyId']);
     $updateEmp->set("loginCode", $dataObject['loginCode']);
     $updateEmp->setArray("logo", $dataObject['logo']);
 public function save_event($features, $event_content, $credentials)
 {
     ParseClient::initialize($credentials->app_id, $credentials->rest_key, $credentials->master_key);
     $iconPath = 'uploads/tmp/' . $features['icon_name'];
     $icon = ParseFile::createFromFile($iconPath, $features['icon_name']);
     $icon->save();
     $thumbnailPath = 'uploads/tmp/' . $features['thumbnail_name'];
     $thumbnail = ParseFile::createFromFile($thumbnailPath, $features['thumbnail_name']);
     $thumbnail->save();
     $event = new ParseObject('Events');
     $event->set("name", $features['event-name']);
     $event->set('description', $features['event-description']);
     $event->set("order", intval($features['order']));
     $event->set("accentColor", substr($features['accent-color'], 5, -3));
     $event->set("primaryColor", substr($features['primary-color'], 5, -3));
     $event->set('image', $icon);
     $event->set('thumbnail', $thumbnail);
     try {
         $event->save();
         $sidebarOrderFlag = 0;
         $sidebarLastbiggestOrder = 0;
         $switchEvent = false;
         foreach ($features['features'] as $feature) {
             if ($feature != "0") {
                 $featureArray = explode("-", $feature);
                 $featureType = $featureArray[0];
                 $featureOrder = intval($featureArray[1]);
                 if ($featureOrder > $sidebarLastbiggestOrder) {
                     $sidebarLastbiggestOrder = $featureOrder;
                 }
                 if ($featureType == 'Speakers') {
                     $featureName = "Speakers";
                 } elseif ($featureType == "Messages") {
                     $featureName = "Messages";
                 } elseif ($featureType == "internalMap") {
                     $featureName = "Internal Map";
                 } elseif ($featureType == "externalMap") {
                     $featureName = "External Map";
                 } elseif ($featureType == "QR Code") {
                     $featureName = "QR Code";
                 } elseif ($featureType == "Agenda") {
                     $featureName = "Agenda";
                     $featureOrder = 0;
                     $sidebarOrderFlag = 1;
                 } elseif ($featureType == "Surveys") {
                     $featureName = "Surveys";
                 } elseif ($featureType == "Events") {
                     $switchEvent = true;
                     continue;
                 } elseif ($featureType == "Exhibitors") {
                     $featureName = "Exhibitors";
                 } elseif ($featureType == "Ask question") {
                     $featureName = "Ask question";
                 } elseif ($featureType == "People") {
                     $featureName = "People";
                 } elseif ($featureType == "Photos") {
                     $featureName = "Photos";
                 } elseif ($featureType == "Ideas") {
                     $featureName = "Wall of ideas";
                 } elseif ($featureType == "My profile") {
                     $featureName = "My profile";
                 }
                 $sidebarMenu = new ParseObject('SidebarMenu');
                 $sidebarMenu->set("event", $event);
                 $sidebarMenu->set("name", $featureName);
                 $sidebarMenu->set("type", $featureType);
                 if ($featureType == "Agenda") {
                     $sidebarMenu->set("order", $featureOrder);
                 } else {
                     $sidebarMenu->set("order", $featureOrder + $sidebarOrderFlag);
                 }
                 try {
                     $sidebarMenu->save();
                 } catch (ParseException $ex) {
                     $result = $ex->getMessage();
                 }
             }
         }
         if ($switchEvent == true) {
             $sidebarMenu = new ParseObject('SidebarMenu');
             $sidebarMenu->set("event", $event);
             $sidebarMenu->set("name", "Switch Event");
             $sidebarMenu->set("type", "Events");
             $sidebarMenu->set("order", $sidebarLastbiggestOrder + $sidebarOrderFlag + 1);
             $sidebarLastbiggestOrder++;
             try {
                 $sidebarMenu->save();
             } catch (ParseException $ex) {
                 $result = $ex->getMessage();
             }
         }
         $sidebarMenu = new ParseObject('SidebarMenu');
         $sidebarMenu->set("event", $event);
         $sidebarMenu->set("name", "Logout");
         $sidebarMenu->set("type", "Logout");
         $sidebarMenu->set("order", $sidebarLastbiggestOrder + $sidebarOrderFlag + 1);
         try {
             $sidebarMenu->save();
         } catch (ParseException $ex) {
             $result = $ex->getMessage();
         }
     } catch (ParseException $ex) {
         $result = $ex->getMessage();
     }
     unlink($thumbnailPath);
     unlink($iconPath);
     /* Add features content */
     if ($features['features']['speakers'] != "0") {
         if (count($event_content['speakers']) != 0) {
             foreach ($event_content['speakers'] as $speaker) {
                 if ($speaker['name'] != "") {
                     $speakerImagePath = 'uploads/tmp/' . $speaker['image'];
                     $speakerImage = ParseFile::createFromFile($speakerImagePath, $speaker['image']);
                     $speakerImage->save();
                     $speakerObj = new ParseObject('Speaker');
                     $speakerObj->set('name', $speaker['name']);
                     $speakerObj->set('facebook', $speaker['facebook']);
                     $speakerObj->set('order', intval($speaker['order']));
                     $speakerObj->set('twitter', $speaker['twitter']);
                     $speakerObj->set('title', $speaker['title']);
                     $speakerObj->set('event', $event);
                     $speakerObj->set('image', $speakerImage);
                     $speakerObj->set('email', $speaker['email']);
                     $speakerObj->set('company', $speaker['company']);
                     $speakerObj->set('linkedIn', $speaker['linkedin']);
                     $speakerObj->set('introduction', $speaker['introduction']);
                     $speakerObj->save();
                     unlink($speakerImagePath);
                 } else {
                     $result = "Speaker name is required";
                     return $result;
                 }
             }
         }
     }
     if ($features['features']['agenda'] != "0") {
         if (count($event_content['agenda']) != 0) {
             foreach ($event_content['agenda'] as $agenda_day) {
                 if ($agenda_day['date'] != "") {
                     $eventDayObject = new ParseObject("EventDays");
                     $eventDayObject->set("date", $agenda_day['date']);
                     $eventDayObject->set("day", $agenda_day['day']);
                     $eventDayObject->set('order', intval($agenda_day['dayorder']));
                     $eventDayObject->set('event', $event);
                     $eventDayObject->save();
                     //$agenda_day_id = $eventDayObject->getObjectId();
                     foreach ($agenda_day['items'] as $item) {
                         if ($item['title'] != "") {
                             $itemImagePath = 'uploads/tmp/' . $item['image'];
                             $itemImage = ParseFile::createFromFile($itemImagePath, $item['image']);
                             $itemImage->save();
                             $agendaObject = new ParseObject('Agenda');
                             $agendaObject->set("sessionTitle", $item['title']);
                             $agendaObject->set("from", $item['from']);
                             $agendaObject->set("to", $item['to']);
                             $agendaObject->set("order", intval($item['order']));
                             $agendaObject->set("day", $eventDayObject);
                             $agendaObject->set("description", $item['description']);
                             $agendaObject->set("image", $itemImage);
                             if ($item['speaker'] != "") {
                                 $speakerQuery = new ParseQuery('Speaker');
                                 $speakerQuery->equalTo("name", $item['speaker']);
                                 $speakerQuery->equalTo("event", $event);
                                 $itemSpeakerQuery = $speakerQuery->find();
                                 $itemSpeaker = $itemSpeakerQuery[0];
                                 $agendaObject->set("speaker", $itemSpeaker);
                             }
                             $agendaObject->save();
                             unlink($itemImagePath);
                         } else {
                             $result = "Please fill the required information";
                             return $result;
                         }
                     }
                 } else {
                     $result = "Please fill the required information";
                     return $result;
                 }
             }
         }
     }
     if ($features['features']['exhibitors'] != "0") {
         if (count($event_content['exhibitors']) != 0) {
             foreach ($event_content['exhibitors'] as $exhibitor) {
                 if ($exhibitor['name'] != "") {
                     $exhibitorImagePath = 'uploads/tmp/' . $exhibitor['image'];
                     $exhibitorImage = ParseFile::createFromFile($exhibitorImagePath, $exhibitor['image']);
                     $exhibitorImage->save();
                     $exhibitorObj = new ParseObject("Exhibitors");
                     $exhibitorObj->set("actionName", $exhibitor['action']);
                     $exhibitorObj->set('facebook', $exhibitor['facebook']);
                     $exhibitorObj->set("name", $exhibitor['name']);
                     $exhibitorObj->set('about', $exhibitor['about']);
                     $exhibitorObj->set('order', intval($exhibitor['order']));
                     $exhibitorObj->set('url', $exhibitor['url']);
                     $exhibitorObj->set('twitter', $exhibitor['twitter']);
                     $exhibitorObj->set('event', $event);
                     $exhibitorObj->set('image', $exhibitorImage);
                     $exhibitorObj->set('linkedin', $exhibitor['linkedin']);
                     $exhibitorObj->save();
                     unlink($exhibitorImagePath);
                 } else {
                     $result = "Exhibitor name is required";
                     return $result;
                 }
             }
         }
     }
     if ($features['features']['surveys'] != "0") {
         if (count($event_content['surveys']) != 0) {
             foreach ($event_content['surveys'] as $survey) {
                 if ($survey['name'] != "") {
                     $surveyObj = new ParseObject('Surveys');
                     $surveyObj->set('name', $survey['name']);
                     $surveyObj->set('order', intval($survey['order']));
                     $surveyObj->set('description', $survey['description']);
                     $surveyObj->set('event', $event);
                     $surveyObj->save();
                     if (count($survey['questions']) != 0) {
                         if ($survey['questions'][0] != "") {
                             $order = 0;
                             foreach ($survey['questions'] as $question) {
                                 $questionObj = new ParseObject('SurveyQuestions');
                                 $questionObj->set('order', $order);
                                 $questionObj->set('questionText', $question);
                                 $questionObj->set('surveyId', $surveyObj);
                                 $order++;
                                 $questionObj->save();
                             }
                         } else {
                             $result = "Question is required";
                             return $result;
                         }
                     }
                 } else {
                     $result = "Survey name is required";
                     return $result;
                 }
             }
         }
     }
     if ($features['features']['exmap'] != "0") {
         if (count($event_content['exmapPoints']) != 0) {
             foreach ($event_content['exmapPoints'] as $point) {
                 if ($point['pin_name'] != "") {
                     $exmapPoint = new ParseObject("ExternalMap");
                     $exmapPoint->set("pinName", $point['pin_name']);
                     $exmapPoint->set("latitude", $point['lat']);
                     $exmapPoint->set('order', intval($point['order']));
                     $exmapPoint->set('longitude', $point['long']);
                     $exmapPoint->set('address', $point['address']);
                     $exmapPoint->set('event', $event);
                     $exmapPoint->save();
                 } else {
                     $result = "Pin name is required";
                     return $result;
                 }
             }
         }
     }
     if ($features['features']['inmap'] != "0") {
         if (count($event_content['inmapSections']) != 0) {
             foreach ($event_content['inmapSections'] as $section) {
                 if ($section['header'] != "") {
                     $sectionImagePath = 'uploads/tmp/' . $section['image'];
                     $sectionImage = ParseFile::createFromFile($sectionImagePath, $section['image']);
                     $sectionImage->save();
                     $sectionObj = new ParseObject('InternalMaps');
                     $sectionObj->set('event', $event);
                     $sectionObj->set('header', $section['header']);
                     $sectionObj->set('image', $sectionImage);
                     $sectionObj->save();
                     unlink($sectionImagePath);
                 } else {
                     $result = "header is required";
                     return $result;
                 }
             }
         }
     }
     $result = $event_content;
     return $result;
 }