/**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $option = Option::findOrFail($id);
     $option->delete();
     Flash('Option Deleted');
     return Redirect()->route('options');
 }
Пример #2
0
 /**
  * @param ContactRequest $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function postContact(ContactRequest $request)
 {
     $data = $request->all();
     $this->mailer->contact($data);
     Flash('Mensaje enviado correctamente');
     return Redirect()->route('contact_path');
 }
Пример #3
0
 public function import(Excel $excel, ImportRequest $request)
 {
     $file = $request->file('excel');
     //Input::file('excel');
     //dd($file);
     if (!$file) {
         Flash('Seleccione un archivo!!');
         return Redirect()->route('clients');
     }
     $excel->load($file, function ($reader) {
         foreach ($reader->get() as $client) {
             // para evitar en los campos que no se permiten null poner en blanco
             $data = array_map(function ($v) {
                 return is_null($v) ? "" : $v;
             }, $client->toArray());
             /* $data = [
                    'name' => $client->title,
                    'author' =>$client->author,
                    'year' =>$client->publication_year
                ];*/
             $this->clientRepo->store($data);
         }
     });
     //return Book::all();
     Flash('Imported !!');
     return Redirect()->route('clients');
 }
Пример #4
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $this->sellerRepo->destroy($id);
     Flash('Seller Deleted');
     return Redirect()->route('sellers');
 }
Пример #5
0
        $url_params['url'] = $page['info']['url'];
        $url_params['title'] = $title;
        $url_valid = true;
    }
    if ($url_valid) {
        //Pre($url_params);
        // Actually create the URL
        $url_response = $c->sendRequest('go/url/create', $url_params, 'post', true);
        // If returned successfully
        if (isset($url_response['response']['url'])) {
            Flash('URL Created: <a href="http://go.wayne.edu/' . $url_response['response']['url']['short_url'] . '" target="_blank">http://go.wayne.edu/' . $url_response['response']['url']['short_url'] . '</a>', 'success');
        } else {
            Flash('Something went wrong in the API. Please check with a systems administrator.', 'error');
        }
    } else {
        Flash('The URL you entered is not valid, please try again', 'error');
    }
}
// Get the list of social URL's
include_once ROOT . '/_header.php';
?>
<div class="row-fluid" id="content">
	<div class="span8">
		<div class="list-view">
			<div class="list-header well">
				<form id="search" class="form-search" method="post" action="">
				<input type="text" class="query input-large search-query " name="search" value="" placeholder="Search URL's" autocomplete="off" maxlength="50">
				</form>
			</div>
			<form method="post" class="well">
			<fieldset>
Пример #6
0
    if (isset($login_response['response']['auth']['sessionid'])) {
        $_SESSION['sessionid'] = $login_response['response']['auth']['sessionid'];
        // Get the users information
        $user_details = $c->sendRequest('api/user/info', array('accessid' => $_POST['accessid']));
        // Save the basic information about this user
        $_SESSION['user_details'] = $user_details['response']['user'];
        // Set the user message
        Flash('Welcome back ' . $_SESSION['user_details']['first_name'] . '!', 'success');
    } else {
        // Set the user error message
        Flash('Incorrect AccessID/password. Please try again', 'error');
    }
    //Pre($login_response);
}
// if trying to logout
if (isset($_GET['logout'])) {
    // Set the user message
    Flash('See you next time ' . $_SESSION['user_details']['first_name'] . '!', 'success');
    // Unset the session
    unset($_SESSION['sessionid']);
    unset($_SESSION['user_details']);
    // Redirect to homepage
    header('Location:' . PATH);
    die;
}
// Set the sessionID if in the session
if (isset($_SESSION['sessionid'])) {
    $c->setSession($_SESSION['sessionid']);
}
// Setup defaults
$page_title = 'Home';
Пример #7
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $task = $this->taskRepo->destroy($id);
     Flash('Task Deleted');
     return Redirect()->route('clients.edit', $task->client->id);
 }
Пример #8
0
if (!isset($_SESSION['sessionid'])) {
    ?>
                        <form class="navbar-form pull-right" method="post">
                            <input class="span2" type="text" placeholder="AccessID" name="accessid" value="<?php 
    echo isset($_POST['accessid']) ? $_POST['accessid'] : '';
    ?>
">
                            <input class="span2" type="password" placeholder="Password" name="password">
                            <button type="submit" class="btn">Sign in</button>
                        </form>
                        <?php 
} else {
    ?>
                            <ul class="nav pull-right">
                                <li><a href="?logout">(<?php 
    echo h($_SESSION['user_details']['accessid']);
    ?>
) Logout <i class="icon-white icon-off"></i></a></li>
                            </ul>
                        <?php 
}
?>
                    </div><!--/.nav-collapse -->
                </div>
            </div>
        </div>

        <div class="container">
        	<?php 
echo Flash();
Пример #9
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $this->propertyRepo->destroy($id);
     Flash('Property Deleted');
     return Redirect()->route('properties');
 }
Пример #10
0
            // Create the params array
            $tweet_params = array('message' => $_POST['new_message'], 'account_id' => $account, 'user_id' => $_SESSION['user_details']['user_id'], 'date_scheduled' => $date_scheduled);
            Pre($tweet_params);
            // Get a list of all the account this user has access to
            $tweet_status[] = $c->sendRequest('socialy/tweet/schedule', $tweet_params, 'post');
        }
        Pre($tweet_status);
        foreach ($tweet_status as $tweeted) {
            if (array_key_exists('error', $tweeted['response'])) {
                Flash('Error posting to [account name].', 'error');
            } else {
                Flash('Successfully tweeted from [account name] account.');
            }
        }
    } else {
        Flash('Please select an account.', 'error');
    }
}
// Get a list of all the account this user has access to
$account_list = $c->sendRequest('socialy/account/access', array(), 'get');
include_once ROOT . '/_header.php';
?>
	
<div class="row-fluid" id="content">
	<form accept-charset="UTF-8" action="" method="post">
	<div class="span9">
		<div class="list-view">
			<div class="list-header well">
				<h2>Add Tweet</h2>
			</div>
			<div class="row-fluid">
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $this->paymentRepository->destroy($id);
     Flash('Payment Deleted');
     return Redirect()->route('payments');
 }
Пример #12
0
function access_token($tmhOAuth)
{
    global $c;
    $params = uri_params();
    if ($params['oauth_token'] !== $_SESSION['oauth']['oauth_token']) {
        Flash('The oauth token you started with doesn\'t match the one you\'ve been redirected with. do you have multiple tabs open?');
        unset($_SESSION['oauth']);
        //session_unset();
        return;
    }
    if (!isset($params['oauth_verifier'])) {
        Flash('The oauth verifier is missing so we cannot continue. did you deny the appliction access?');
        unset($_SESSION['oauth']);
        //session_unset();
        return;
    }
    // update with the temporary token and secret
    $tmhOAuth->reconfigure(array_merge($tmhOAuth->config, array('token' => $_SESSION['oauth']['oauth_token'], 'secret' => $_SESSION['oauth']['oauth_token_secret'])));
    $code = $tmhOAuth->user_request(array('method' => 'POST', 'url' => $tmhOAuth->url('oauth/access_token', ''), 'params' => array('oauth_verifier' => trim($params['oauth_verifier']))));
    if ($code == 200) {
        $oauth_creds = $tmhOAuth->extract_params($tmhOAuth->response['response']);
        // Save the credentials in the DB
        $socialy_params = $oauth_creds;
        $socialy_params['owner_id'] = $_SESSION['user_details']['user_id'];
        $socialy_params['type'] = 'twitter';
        $socialy_params['is_active'] = '1';
        $social_response = $c->sendRequest('socialy/account/add', $socialy_params, 'post', true);
        // If there was an error saving the account to the API
        if (array_key_exists('error', $social_response['response']) && is_array($social_response['response']['error'])) {
            Flash($social_response['response']['error']['message'], 'error');
        }
        // Try to get the info for the account
        $tmhOAuth->config['user_token'] = $oauth_creds['oauth_token'];
        $tmhOAuth->config['user_secret'] = $oauth_creds['oauth_token_secret'];
        $code = $tmhOAuth->request('GET', $tmhOAuth->url('1.1/account/verify_credentials'));
        Pre($code);
        // If this user is valid
        if ($code == 200) {
            // Get the response
            $resp = json_decode($tmhOAuth->response['response'], true);
            Pre($resp);
            // Update it in the twitter account table
            $account_params = $resp;
            $account_params['account_id'] = $social_response['response']['account']['account_id'];
            $account_params['owner_id'] = $_SESSION['user_details']['user_id'];
            unset($account_params['status']);
            $account_response = $c->sendRequest('socialy/twitterinfo/add', $account_params, 'post', true);
            Pre($account_response);
            // If there was an error saving the account to the API
            if (is_array($account_response['response']['error'])) {
                Flash($account_response['response']['error']['message'], 'error');
            } else {
                Flash('Account "' . $account_response['response']['twitter']['screen_name'] . '" added successfully!');
            }
        }
        //header('Location: ' . php_self());
        //die();
    }
}
 /**
  * Remove the specified resource from storage.
  *
  * @param  int $id
  * @return Response
  */
 public function destroy($id)
 {
     $this->productRepository->destroy($id);
     Flash('Producto Eliminado');
     return Redirect()->route('profile.show', Auth()->user()->username);
 }