$file = $_FILES['logo'];
         $path = IMAGE_PATH;
         $data['logo'] = time() . '_' . $file['name'];
         $data['logo_type'] = $file['type'];
         $data['logo_size'] = $file['size'];
         $ext = strtolower(pathinfo($data['logo'], PATHINFO_EXTENSION));
         if (move_uploaded_file($file['tmp_name'], "{$path}{$data['logo']}") && isValidImageExt($ext)) {
             $resize = new ResizeImage("{$path}{$data['logo']}");
             $resize->resizeTo(LOGO_H, LOGO_W);
             $resize->saveImage("{$path}thumb_{$data['logo']}");
         }
     } else {
         $data['logo'] = $job->logo;
     }
     $data['step'] = 3;
     $j->jobCreateUpdate($data, ACTIVE);
     $app->redirect(ADMIN_URL . "jobs/{$id}/publish/{$token}");
 });
 // get publish job details
 $app->get('/:id/publish/:token', 'validateUser', function ($id, $token) use($app) {
     $j = new Jobs($id);
     $job = $j->getJobFromToken($token);
     $title = $j->getSlugTitle();
     $city = $j->getJobCity($job->city);
     $category = $j->getJobCategory($job->category);
     if (isset($job) && $job->id) {
         $app->render(ADMIN_THEME . 'job.publish.php', array('job' => $job, 'city' => $city, 'category' => $category));
     } else {
         $app->redirect(ADMIN_URL . "jobs/{$id}/{$title}");
     }
 });
         $data['logo'] = time() . '_' . $file['name'];
         $data['logo_type'] = $file['type'];
         $data['logo_size'] = $file['size'];
         $ext = strtolower(pathinfo($data['logo'], PATHINFO_EXTENSION));
         if (move_uploaded_file($file['tmp_name'], "{$path}{$data['logo']}") && isValidImageExt($ext)) {
             $resize = new ResizeImage("{$path}{$data['logo']}");
             $resize->resizeTo(LOGO_H, LOGO_W);
             $resize->saveImage("{$path}thumb_{$data['logo']}");
         } else {
             $data['logo'] = '';
         }
     } else {
         $data['logo'] = $job->logo;
     }
     $data['step'] = 3;
     $j->jobCreateUpdate($data);
     if (!$j->getStatus()) {
         $app->flash('success', $lang->t('alert|activation_email', $job->email));
     } else {
         $app->flash('success', $lang->t('alert|edit_successful'));
     }
     $app->redirect(BASE_URL . "jobs/{$id}/publish/{$token}");
 });
 // get publish job details
 $app->get('/:id/publish/:token', 'isJobPostAllowed', 'isBanned', 'isValidReferrer', function ($id, $token) use($app) {
     global $lang;
     $j = new Jobs($id);
     $job = $j->getJobFromToken($token);
     $title = $j->getSlugTitle();
     $city = $j->getJobCity($job->city);
     $category = $j->getJobCategory($job->category);