Exemple #1
0
<div class="row">
    <div id="breadcrumb" class="col-md-12">
        <ol class="breadcrumb">
            <?php 
foreach (\Fuel\Core\Uri::segments() as $k => $segment) {
    ?>
                <?php 
    $url = empty($url) ? 'admin' : $url . '/' . $segment;
    ?>
                <li><a href="/<?php 
    echo $url;
    ?>
"><?php 
    echo \Fuel\Core\Str::ucfirst($segment);
    ?>
</a></li>
            <?php 
}
?>
        </ol>
    </div>
</div>
<div class="row">
    <div class="col-xs-12 col-sm-12" id="add-category">
        <div class="box no-drop">
            <div class="box-header">
                <div class="box-name">
                    <i class="fa fa-arrows"></i>
                    <span><?php 
echo Fuel\Core\Lang::get('title.add_category');
?>
            <tr>
                <td>
                    <strong>Number of Tasks:</strong>
                </td>
                
                <td>
                    <?php 
echo count($project->project_tasks);
?>
                    
		    <?php 
$segment_title = \Fuel\Core\Uri::segment(1, 'user');
?>
		    
                    <?php 
if (\Fuel\Core\Str::lower($segment_title) == 'admin') {
    ?>
                    <span class="pull-right">
                        <?php 
    echo Html::anchor('admin/projects/addtask/' . $project->id, 'New Task', array('onclick' => "return confirm('Are you sure you want to create a new task?')"));
    ?>
 
                    </span>
		    <?php 
} else {
    ?>
		    <span class="pull-right">
                        <?php 
    echo Html::anchor('user/projects/addtask/' . $project->id, 'New Task', array('onclick' => "return confirm('Are you sure you want to create a new task?')"));
    ?>
 
 public function action_forgot()
 {
     \Auth\Auth::check() and \Fuel\Core\Response::redirect("user");
     $val = \Fuel\Core\Validation::forge('forgot');
     if (\Fuel\Core\Input::method() == "POST") {
         if ($val->run()) {
             try {
                 $username = \Fuel\Core\Input::post('email');
                 $user = Model_User::find('first', array('where' => array(array('username', 'LIKE', "{$username}"), 'or' => array(array('email', 'LIKE', "{$username}")))));
                 if (!$user) {
                     throw new \Auth\SimpleUserUpdateException("Invalid username or email");
                 }
                 $old_password = \Auth\Auth::reset_password($user->username);
                 $new_password = \Fuel\Core\Str::random();
                 \Auth\Auth::update_user(array('password' => $new_password, 'old_password' => $old_password), $user->username);
                 // Create an instance
                 $email = \Email\Email::forge();
                 // Set the from address
                 $email->from('*****@*****.**', 'ITNT Time Sheets');
                 // Set the to address
                 $email->to($user->email, $user->first_name . " " . $user->last_name);
                 // Set a subject
                 $email->subject('ITNT Time Sheets Password Reset');
                 // Set multiple to addresses
                 //                            $email->bcc(array(
                 //                                '*****@*****.**' => 'Gavin Murambadoro',
                 //                            ));
                 // Set a html body message
                 $email->html_body(\View::forge('includes/email/forgot', array('user' => $user, 'password' => $new_password)));
                 if ($email->send()) {
                     $this->template->set_global('login_success', "Your password has been reset and an email was sent to {$user->email}");
                 } else {
                     $this->template->set_global('login_error', "Your password was reset but we could not send you an email. Your new password is {$new_password}. Make sure that you copy this before leaving this page.");
                 }
             } catch (\SimpleUserUpdateException $exception) {
                 $this->template->set_global('login_error', "User Error: {$exception->getMessage()}");
             } catch (\EmailValidationFailedException $exception) {
                 $this->template->set_global('login_error', "Mail Validation Error: {$exception->getMessage()}");
             } catch (\EmailSendingFailedException $exception) {
                 $this->template->set_global('login_error', "Mail Error: {$exception->getMessage()}");
             } catch (Exception $exception) {
                 $this->template->set_global('login_error', "General Error: {$exception->getMessage()}");
             }
         } else {
             $this->template->set_global('login_error', $val->error());
         }
     }
     $this->template->set_global('val', $val, false);
     $this->template->title = 'Forgot Password';
     $this->template->content = View::forge('user/forgot');
 }
Exemple #4
0
 public function get_pkpass_name()
 {
     if (!empty($this->pkpass_name)) {
         return $this->pkpass_name;
     }
     $pkpass_name = \Fuel\Core\Str::random('alpha', 8) . '.pkpass';
     while (Model_Pass::find()->where(array('pkpass_name' => $pkpass_name))->get_one()) {
         $pkpass_name = \Fuel\Core\Str::random('alpha', 8) . '.pkpass';
     }
     $this->pkpass_name = $pkpass_name;
     $this->save();
     return $this->pkpass_name;
 }
<div class="row">
    <div class="span12">
        <div class="widget widget-nopad">
            <br>

            <div class="widget-header">
                <i class="icon-bell"></i>
                <h3> Timesheet &raquo; <?php 
echo \Fuel\Core\Str::truncate($task->project->name, 50) . ' &raquo; ' . \Fuel\Core\Str::truncate($task->project_task_description, 50, '...');
?>
  </h3>
                <span class="pull-right"><h3> <?php 
echo date('D d M Y', $timestamp);
?>
 </h3></span>
            </div>                
            <?php 
echo Fuel\Core\Form::open(array('action' => 'user/timesheets/logtimes/' . $timestamp), array('timestamp' => $timestamp, 'id' => $task->id));
?>
                <div class="widget-content">
                    <div class="well-large">
                        <p>
                            <strong>Instructions or Notes:</strong><br>
                            <?php 
echo trim($task->comment) != '' ? trim($task->comment) : 'N/A';
?>
                        </p>
                    </div>
                    <div class="table-responsive">
                        <table class="table table-hover">
                            <thead>