public function search()
 {
     $kata_kunci = Request::input('kata_kunci');
     if ($kata_kunci == '') {
         \Session::Flash('error', 'Keywords tidak boleh kosong');
         return redirect('/getData');
     } else {
         $employees = employees::where('nama', 'like', '%' . $kata_kunci . '%')->orWhere('nip', 'like', '%' . $kata_kunci . '%')->orWhere('unit_kerja', 'like', '%' . $kata_kunci . '%')->paginate(9);
         $employees->setPath('search');
         return View('books.search')->with('employees', $employees);
     }
 }
 /**
  * Handle a POST request to reset a user's password.
  *
  * @return Response
  */
 public function postReset()
 {
     $credentials = Input::only('email', 'password', 'password_confirmation', 'token');
     $response = Password::reset($credentials, function ($user, $password) {
         $user->password = Hash::make($password);
         $user->save();
     });
     switch ($response) {
         case Password::INVALID_PASSWORD:
         case Password::INVALID_TOKEN:
         case Password::INVALID_USER:
             return Redirect::back()->with('error', Lang::get($response));
         case Password::PASSWORD_RESET:
             Session::Flash('message', 'Password has been successfully reset.');
             return Redirect::to('/');
     }
 }
Example #3
0
 public static function CheckForUpdate()
 {
     $user = new user();
     if ($user->HasPermission('admin')) {
         // check if already checked for update
         if (Cookie::exists("app_version")) {
             $check = Cookie::get("app_version");
         } else {
             $check = Curl::get("http://kingposter.net/update_test/?source=" . Options::get('siteurl'));
             Cookie::put("app_version", $check, 60 * 60 * 24 * 15);
         }
         $update = json_decode($check);
         if (isset($update->version)) {
             if (VERSION < $update->version) {
                 if (!defined("update")) {
                     define('UPDATE', true);
                 }
                 if (isset($update->message)) {
                     Session::Flash("home", "warning", $update->message, true);
                 }
             }
         }
     }
 }
Example #4
0
            $_POST['postType'] = "image";
            $_POST['image'] = escape($post->image);
        }
        // Set Post type
        if (Posts::PostType($getPost->content) == "video") {
            $_POST['postType'] = "video";
            $_POST['video'] = escape($post->video);
            $_POST['description'] = isset($post->description) ? escape($post->description) : "";
        }
    }
} else {
    $_POST['postType'] = "message";
}
$template->header("Home");
if (Session::exists('home')) {
    foreach (Session::Flash('home') as $error) {
        echo "<div class='alert alert-" . $error['type'] . "' role='alert'>";
        echo "<a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a>";
        echo "<span class='glyphicon glyphicon-exclamation-sign' aria-hidden='true'></span>";
        echo "&nbsp;" . $error['message'];
        echo "</div>";
    }
}
?>
<div class="homeMessageBox"></div>
<!-- Save post dialog -->
<div id="postTitleModal" class="modal fade" role="dialog" data-backdrop="static">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">&times;</button>
Example #5
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     Cuit::destroy($id);
     \Session::Flash('message', 'Cuit deleted!');
     return redirect('cuits');
 }
Example #6
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $operacion = Operacion::FindOrFail($id);
     $operacion->delete();
     $delmov = $operacion->movimientos()->delete();
     \Session::Flash('message', 'La Operacion fue eliminada');
     return redirect()->route('operacion.index');
 }
Example #7
0
include 'core/init.php';
$template = new Template();
$logs = new Logs();
if (Input::get("action", "GET") == "clear") {
    try {
        Logs::Clear();
        Session::Flash("logs", "success", lang('LOGS_CLEARED'), true);
    } catch (Exception $ex) {
        Session::Flash("logs", "danger", $ex->GetMessage(), true);
    }
    Redirect::To("logs.php");
}
$template->header("Logs");
if (Session::exists('logs')) {
    foreach (Session::Flash('logs') as $error) {
        echo "<div class='alert alert-" . $error['type'] . "' role='alert'>";
        echo "<a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a>";
        echo "<span class='glyphicon glyphicon-exclamation-sign' aria-hidden='true'></span>";
        echo "&nbsp;" . $error['message'];
        echo "</div>";
    }
}
?>

<div class="messageBox"></div>
<div class="panel panel-default">
	<div class="panel-heading">
		<h3 class="panel-title"><span class="glyphicon glyphicon-alert"></span> <?php 
echo lang("logs");
?>
Example #8
0
include 'core/init.php';
$posts = new Posts();
$template = new Template();
if (Input::get("action", "GET") == "delete" && Input::Get("id", "GET")) {
    try {
        $posts->delete(Input::Get("id", "GET"));
        Session::Flash("posts", "success", lang('POST_DELETED_SUCCESS'), true);
    } catch (Exception $ex) {
        Session::Flash("posts", "danger", $ex->GetMessage(), true);
    }
    Redirect::To("posts.php");
}
$template->header("Posts");
if (Session::exists('posts')) {
    foreach (Session::Flash('posts') as $error) {
        echo "<div class='alert alert-" . $error['type'] . "' role='alert'>";
        echo "<a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a>";
        echo "<span class='glyphicon glyphicon-exclamation-sign' aria-hidden='true'></span>";
        echo "&nbsp;" . $error['message'];
        echo "</div>";
    }
}
?>

<div class="messageBox"></div>

<div class="panel panel-default">
	<div class="panel-heading">
		<h3 class="panel-title"><span class="glyphicon glyphicon-duplicate"></span>  <?php 
echo lang("POSTS");
 public function postLogin()
 {
     $email = Input::get('email');
     $password = Input::get('password');
     if (Auth::attempt(array('email' => $email, 'password' => $password), true)) {
         if (Auth::user()->confirmed == 0) {
             Auth::logout();
             Session::Flash('errorMessage', 'You have to confirm your account by clicking on the confirmation code in your email.');
         } else {
             $userId = Auth::user()->id;
             $user = User::find($userId);
             $groups = Group::where('user_id', '=', $user->id)->get();
             $events = CalendarEvent::where('user_id', '=', $user->id)->get();
             return View::make('users.show')->with(array('user' => $user, 'groups' => $groups, 'events' => $events));
         }
     } else {
         Session::Flash('errorMessage', 'Login Failed!!!');
     }
     return Redirect::action('HomeController@showHome');
 }
Example #10
0
        Session::Flash("usersPage", "danger", $ex->GetMessage(), true);
    }
}
if (Input::get("deactivate") && $user->hasPermission("admin") && Input::get("checkbox")) {
    try {
        foreach (Input::get("checkbox") as $checkbox) {
            $user->deactivate($checkbox);
        }
        Session::Flash("usersPage", "success", lang('USERS_ACCOUNT_DEACTIVE_SUCCESS'), true);
    } catch (Exception $ex) {
        Session::Flash("usersPage", "danger", $ex->GetMessage(), true);
    }
}
$template->header("Users");
if (Session::exists('usersPage')) {
    foreach (Session::Flash('usersPage') as $error) {
        echo "<div class='alert alert-" . $error['type'] . "' role='alert'>";
        echo "<a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a>";
        echo "<span class='glyphicon glyphicon-exclamation-sign' aria-hidden='true'></span>";
        echo "&nbsp;" . $error['message'];
        echo "</div>";
    }
}
?>
<div class="messageBox"></div>
	<script>
	$(document).ready(function(){
		var editUserModel = $('#editUser');
		var userId;
		var reload = false;
						
Example #11
0
            // Update password
            if (Input::Get("password")) {
                $salt = Hash::salt(32);
                $user->update(array('password' => Hash::make(Input::get('password'), $salt), "salt" => $salt), $user->data()->id);
            }
            Session::Flash("settings", "success", lang('SETTINGS_UPDATED_SUCCESS'), true);
        } catch (Exception $e) {
            echo $e->getMessage();
        }
    } else {
        Session::Flash("settings", "danger", "<ul><li>" . implode("</li><li>", $validation->errors()) . "</li></ul>", false);
    }
}
$template->header("Settings");
if (Session::exists('settings')) {
    foreach (Session::Flash('settings') as $error) {
        echo "<div class='alert alert-" . $error['type'] . "' role='alert'>";
        echo "<a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a>";
        echo $error['message'];
        echo "</div>";
    }
}
?>
<div class="messageBox"></div>
<form method='POST' action='' class="settings">
	<div class="row">
		<div class="tabbable tabs-left">
			<div class="col-xs-3">
				<ul class="nav nav-tabs">

					<li class="active">
Example #12
0
 public function doFeedback()
 {
     $body = Input::get('body');
     Mail::send('emails.feedback', compact('body'), function ($message) {
         $subject = Input::get('subject');
         $message->to('*****@*****.**', 'Well Basically')->subject($subject);
     });
     Session::Flash('message', 'Thanks for leaving feedback!');
     return Redirect::action('HomeController@index');
 }
Example #13
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $user = User::FindOrFail($id);
     $user->delete();
     \Session::Flash('message', 'El Usuario: ' . $user->name . ' fue Eliminado');
     return redirect()->route('Admin.user.index');
 }