コード例 #1
0
 /**
  *This method creats a mailing list in the database in the database
  *@param null
  *@return void
  */
 public function postAddnew()
 {
     //upload the submitted file
     $upload_file = Upload::doUpload('list_csv', 'application/storage/mailing_list_csvs/');
     //proceed if file upload success
     if ($upload_file->success === true) {
         //compose data to save in table
         $list_info = array('name' => Input::get('list_name'), 'description' => Input::get('list_description'), 'recipients' => 0, 'campaigns' => 0, 'csv_file_path' => $upload_file->upload_path_relative);
         //call model to save this information into the database
         $create_list = ListsModel::create($list_info);
         if ($create_list->lastInsertId()) {
             //redirect to manage new list page
             $data = array('list_id' => $create_list->lastInsertId());
             Redirect::with($data)->to('lists/managenew');
         }
     }
 }