Advertisement
Guest User

Untitled

a guest
Apr 15th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. public function add()
  2. {
  3. $message = null;
  4. if(Request::isMethod('POST'))
  5. {
  6. // add bulk accounts
  7. $string = Input::get('accounts');
  8.  
  9. $accounts = explode("\n", $string);
  10.  
  11. foreach($accounts as $account)
  12. {
  13. $info = explode(",", $account);
  14.  
  15. $act = new Accounts();
  16. $act->username = $info[0];
  17. $act->password = $info[1];
  18. $act->package_id = Input::get('package');
  19. unset($info[0]);
  20. unset($info[1]);
  21. $act->info = implode(" , ", $info);
  22. $act->save();
  23. }
  24. $message = 'accounts added successfully.';
  25. }
  26.  
  27. return View::make('admin/addaccounts')->with('message', $message);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement