first commit

This commit is contained in:
franknstayn
2021-07-03 18:39:08 +08:00
commit 5483c9517d
1555 changed files with 417773 additions and 0 deletions

18
.env.example Normal file
View File

@@ -0,0 +1,18 @@
APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null

3
.gitattributes vendored Normal file
View File

@@ -0,0 +1,3 @@
* text=auto
*.css linguist-vendored
*.less linguist-vendored

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
/vendor
/node_modules
.env

14
.htaccess Normal file
View File

@@ -0,0 +1,14 @@
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$public /$1 [L,R=301]
RewriteCond %{SERVER_PORT} 80
#RewriteRule ^(.*)$ https://www.crewsportswear.com/beta/$1 [R,L]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

2
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,2 @@
{
}

7
app/Commands/Command.php Normal file
View File

@@ -0,0 +1,7 @@
<?php namespace App\Commands;
abstract class Command {
//
}

View File

@@ -0,0 +1,32 @@
<?php namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Foundation\Inspiring;
class Inspire extends Command {
/**
* The console command name.
*
* @var string
*/
protected $name = 'inspire';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Display an inspiring quote';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
}
}

29
app/Console/Kernel.php Normal file
View File

@@ -0,0 +1,29 @@
<?php namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel {
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
'App\Console\Commands\Inspire',
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('inspire')
->hourly();
}
}

7
app/Events/Event.php Normal file
View File

@@ -0,0 +1,7 @@
<?php namespace App\Events;
abstract class Event {
//
}

View File

@@ -0,0 +1,42 @@
<?php namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler {
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
'Symfony\Component\HttpKernel\Exception\HttpException'
];
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
return parent::report($e);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
return parent::render($request, $e);
}
}

View File

View File

View File

@@ -0,0 +1,149 @@
<?php
namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\ApiModel;
use ArrayObject;
use Carbon\Carbon;
use Illuminate\Support\Facades\Input;
class ApiController extends Controller
{
public function login(Request $request)
{
$ApiModel = new ApiModel;
$post = $request->all();
$response = $ApiModel->loginProductionUser($post['username'], $post['password']);
if (!$response) {
return response()->json(['status' => false, 'message' => "Invalid user"], 401);
}
$selectTrackingStepLabel = $ApiModel->selectTrackingStepLabel($response[0]->StepId);
$response[0]->AssignedStep = $selectTrackingStepLabel[0]->StepLabel;
return response()->json(['status' => true, 'data' => $response[0]], 200);
}
public function insert(Request $request)
{
$ApiModel = new ApiModel;
$post = $request->json()->all();
$data = array(
"StepId" => $post['StepId'],
"ScannedBy" => $post['ScannedBy'],
"InvoiceNumber" => $post['invoice'],
"OrdersId" => $post['ordersId'],
"ProductId" => $post['productId'],
"QuantityCounter" => $post['quantityCounter'],
"Timezone" => $post['timezone'],
"TimezoneOffset" => date('H:i:s', strtotime($post['timezoneOffset'])),
"DeviceId" => $post['deviceId'],
"created_at" => date('Y-m-d H:i:s', strtotime($post['datetime']))
);
$checkIfTrackExist = $ApiModel->checkIfTrackExist($post['StepId'], $post['productId'], $post['ordersId'], $post['invoice'], $post['quantityCounter']);
if ($checkIfTrackExist) {
return response()->json(['status' => false, 'message' => "Already scanned."], 500);
}
// $selectNextStep = $ApiModel->selectNextStep($post['invoice']);
// if(($selectNextStep->StepId + 1) != $post['StepId']){
// return response()->json(['status' => false, 'message' => "Your account is not allowed to update this item."], 401);
// }
$response = $ApiModel->insertTracking($data);
if (!$response) {
return response()->json(['status' => false, 'message' => "Something went wrong."], 500);
}
return response()->json(['status' => true, 'message' => 'Successfully updated.'], 201);
}
// public function getTrackingStatus()
// {
// $ApiModel = new ApiModel;
// $invoice = Input::get('invoice');
// $response = $ApiModel->getTrackingStatus($invoice);
// return response()->json(['status' => true, 'data' => $response], 200);
// }
public function getTrackingStatus()
{
$ApiModel = new ApiModel;
$invoice = Input::get('invoice');
$getStep = Input::get('step');
// $response = $ApiModel->getTrackingStatus($invoice);
$selectPaymentDetails = $ApiModel->selectPaymentDetails($invoice);
if (!$selectPaymentDetails) {
return response()->json(['status' => false, 'message' => "Not found."], 404);
}
$selectOrderList = $ApiModel->selectOrderList($selectPaymentDetails[0]->CartKey);
$getCurrentTrackingSteps = $ApiModel->getCurrentTrackingSteps($invoice);
$selectPaymentDetails[0]->tracking_steps = $getCurrentTrackingSteps;
$currentStep = $ApiModel->selectCurrentStep($invoice);
$selectPaymentDetails[0]->current_step = $currentStep;
$stp = ($getStep != "") ? $getStep : $currentStep->Order; // check if step
foreach ($selectOrderList as $k => $order) {
$table_fields[] = $ApiModel->selectOrderListTableFields($order->CartKey, $order->ProductId, $stp);
$product_images[] = $ApiModel->selectProductImages($order->ProductId);
$selectOrderList[$k]->table_fields = $table_fields[$k];
$selectOrderList[$k]->product_images = $product_images[$k];
}
return response()->json([
'status' => true,
'payment_details' => $selectPaymentDetails[0],
'order_list' => $selectOrderList
], 200);
}
public function getOrderStatus()
{
$ApiModel = new ApiModel;
$invoice = Input::get('invoice');
$productid = Input::get('productid');
$orderid = Input::get('orderid');
$qcounter = Input::get('qcounter');
$getStatus = $ApiModel->getStatus($invoice, $productid, $orderid, $qcounter);
if (!$getStatus) {
return response()->json(['status' => false, 'data' => ""], 404);
}
return response()->json([
'status' => true,
'data' => $getStatus[0]
], 200);
}
public function getSteps(){
$ApiModel = new ApiModel;
$selectSteps = $ApiModel->selectSteps();
if (!$selectSteps) {
return response()->json(['status' => false, 'data' => ""], 404);
}
return response()->json([
'status' => true,
'data' => $selectSteps
], 200);
}
}

View File

@@ -0,0 +1,40 @@
<?php namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\Registrar;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
class AuthController extends Controller {
/*
|--------------------------------------------------------------------------
| Registration & Login Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users, as well as the
| authentication of existing users. By default, this controller uses
| a simple trait to add these behaviors. Why don't you explore it?
|
*/
use AuthenticatesAndRegistersUsers;
protected $redirectTo = '/';
/**
* Create a new authentication controller instance.
*
* @param \Illuminate\Contracts\Auth\Guard $auth
* @param \Illuminate\Contracts\Auth\Registrar $registrar
* @return void
*/
public function __construct(Guard $auth, Registrar $registrar)
{
$this->auth = $auth;
$this->registrar = $registrar;
$this->middleware('guest', ['except' => 'getLogout']);
}
}

View File

@@ -0,0 +1,39 @@
<?php namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\PasswordBroker;
use Illuminate\Foundation\Auth\ResetsPasswords;
class PasswordController extends Controller {
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
protected $redirectPath = '/user';
/**
* Create a new password controller instance.
*
* @param \Illuminate\Contracts\Auth\Guard $auth
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
* @return void
*/
public function __construct(Guard $auth, PasswordBroker $passwords)
{
$this->auth = $auth;
$this->passwords = $passwords;
$this->middleware('guest');
}
}

View File

@@ -0,0 +1,11 @@
<?php namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesCommands;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
abstract class Controller extends BaseController {
use DispatchesCommands, ValidatesRequests;
}

View File

@@ -0,0 +1,109 @@
<?php namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Auth;
use App\Traits\CaptchaTrait;
use App\User;
use Validator;
use Illuminate\Http\Request;
class CustomAuthController extends Controller {
use CaptchaTrait;
public function authenticate(Request $request){
$post = $request->all();
$email = $post['email'];
$password = $post['password'];
if (Auth::attempt(['email' => $email, 'password' => $password])){
if (Auth::user()->role == 'admin') {
$message = '
<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-ban"></i> ERROR:</h4>
You are not allowed to enter to this site.
</div>';
return response()->json(array('success' => false, 'message'=>$message));
}
$message = "success";
$navbar = view('layout.navbar', compact('view'))->render();
$save_design_button = ' <button type="button" class="btn btn-lg btn-primary pull-right" data-toggle="modal" data-target="#modalDesignName"><i class="fa fa-floppy-o" aria-hidden="true"></i> Save Design</button>';
return response()->json(array(
'success' => true,
'message'=>$message,
'navbar'=>$navbar,
'save_design_button' => $save_design_button
));
}else{
$message = '
<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-ban"></i> ERROR:</h4>
Username or Password is incorrect.
</div>';
return response()->json(array('success' => false, 'message'=>$message));
}
}
public function postRegister(Request $request){
$post = $request->all();
$post['captcha'] = $this->captchaCheck();
$validator = Validator::make($post, [
'username' => 'unique:user_logins',
'email' => 'unique:user_logins',
'g-recaptcha-response' => 'required',
'captcha' => 'required|min:1'
],
[
'g-recaptcha-response.required' => 'Captcha is required',
'captcha.min' => 'Wrong captcha, please try again.'
]);
if ($validator->fails())
{
$errors = "";
foreach($validator->errors()->all() as $error){
$errors .= "<li>".$error."</li>";
}
$message = '
<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-ban"></i> ERROR:</h4>
'.$errors.
'</div>';
return response()->json(array(
'success' => false,
'message' => $message
));
}
User::create([
'name' => $post['name'],
'username' => $post['username'],
'email' => $post['email'],
'password' => bcrypt($post['password']),
'role' => 'user'
]);
Auth::attempt(['email' => $post['email'], 'password' => $post['password']]);
return response()->json(array(
'success' => true
));
}
}

View File

@@ -0,0 +1,36 @@
<?php namespace App\Http\Controllers;
class HomeController extends Controller {
/*
|--------------------------------------------------------------------------
| Home Controller
|--------------------------------------------------------------------------
|
| This controller renders your application's "dashboard" for users that
| are authenticated. Of course, you are free to change or remove the
| controller as you wish. It is just here to get your app started!
|
*/
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard to the user.
*
* @return Response
*/
public function index()
{
return view('home');
}
}

View File

@@ -0,0 +1,159 @@
<?php namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\MainModel;
// use Illuminate\Support\Facades\Request;
use Analytics;
use Illuminate\Support\Facades\Session;
class MainController extends Controller {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return view('sublayouts.index');
}
public function sports()
{
// if(Request::ajax()){
$m = new MainModel;
$fetchData = $m->selectAllSports();
//var_dump($fetchData);
foreach ($fetchData as $row) {
?>
<div class="col-md-3 col-sm-6 col-xs-12 list-sport">
<a href="<?php echo url('sports') . "/" . $row->URL; ?>"><img src="<?php echo config('site_config.uploads') . 'sports-thumbnails/' . $row->Thumbnail; ?>" alt="" class="img img-responsive product-center" /></a>
<h3 class="text-center sports-title"><?php echo $row->SportsName ?></h3>
</div>
<?php
}
// }else{
// return response()->view('errors/403');
// }
}
public function templatesCat($url)
{
$m = new MainModel;
$data = $m->selectSportsId($url);
$categoryids = array();
foreach($data as $row){
$categoryids[] = $row->Category;
}
$array_sports = $m->selectSportsByURL($url);
$array_category = $m->selectCategory($categoryids);
// $array_templateby_category = $m->selectTemplatesByCategory($url, $id);
// var_dump($array_category);
return view('sublayouts.sports-category')
->with('array_sports', $array_sports)
->with('row', $array_category);
}
public function templatesByCategory($url, $id)
{
$m = new MainModel;
$data = $m->selectTemplatesByCategory($url, $id);
$categoryids = array();
$categoryids[] = $id;
$array_category = $m->selectCategory($categoryids);
// var_dump($array_category);
return view('sublayouts.sports-styles')
->with('cat', $url)
->with('row', $data)
->with('array_category', $array_category);
// if(count($data) > 1){
// return view('sublayouts.sports-styles')
// ->with('cat', $url)
// ->with('row', $data);
// }else{
// $url = url('/designer'). '/'.$data[0]->HashTemplateCode; // desinger url
// return redirect()->to($url);
// }
}
public function fetchTemplates()
{
// if(Request::ajax()){
// $m = new MainModel;
//
// $data = $m->selectSportsId($url);
// echo $data[0]->id;
//$fetchData = $m->selectSportsTemplates();
//var_dump($fetchData);
// }else{
// return response()->view('errors/403');
// }
}
//call this from blade view
public static function getCountCart(){
$m = new MainModel;
if(Session::get('cartkey')){
$cartKey = Session::get('cartkey');
echo $i = $m->cartCount($cartKey);
}else{
echo 0;
}
}
public function countCart(Request $request){
$m = new MainModel;
if($request->session()->has('cartkey')){
$cartKey = $request->session()->get('cartkey');
echo $i = $m->cartCount($cartKey);
}else{
echo 0;
}
}
public function removeCartItem($id){
$m = new MainModel;
$row = $m->removeItem($id);
if($row > 0)
{
// \Session::flash('message', 'Record successfully deleted.');
echo '<script>
alert("Item removed");
</script>';
return redirect('cart');
}
}
}

View File

@@ -0,0 +1,53 @@
<?php namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Request1;
use Illuminate\Http\Request;
use App\Models\PatternsModel;
class PatternsController extends Controller {
public function getPatterns()
{
//if(Request::ajax()){
$m = new PatternsModel;
$data = $m->selectAllPattern();
foreach ($data as $row) {
if($row->PatternName == "None"){
echo '<option value="'.$row->PatternId.'" data-img="'.url("/public/images"). "/" .$row->PatternThumbnail.'" selected="selected" aria-disabled="true" disabled>'.$row->PatternName.'</option>';
}else{
echo '<option value="'.$row->PatternId.'" data-img="'.url("/public/images"). "/" .$row->PatternThumbnail.'">'.$row->PatternName.'</option>';
}
}
//}
}
public function getPatternsWithPostValue(Request $request)
{
$m = new PatternsModel;
$data = $m->selectAllPattern();
$post = $request->all();
$pattern_list = array();
foreach($post['patterns'] as $pt) {
$pattern_list[] = $pt;
//echo $pt;
}
foreach ($data as $row) {
if(in_array($row->PatternId, $pattern_list)) {
echo '<option value="'.$row->PatternId.'" data-img="'.url("/public/images"). "/" . $row->PatternThumbnail.'" selected="selected">'.$row->PatternName.'</option>';
}else{
echo '<option value="'.$row->PatternId.'" data-img="'.url("/public/images"). "/" . $row->PatternThumbnail.'" >'.$row->PatternName.'</option>';
}
}
}
}

View File

@@ -0,0 +1,79 @@
<?php namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Request1;
use Illuminate\Http\Request;
use App\Models\PrintPatternModel;
use App\Models\SizesModel;
class PrintPatternController extends Controller {
public function showPrintTemplate()
{
$m = new PrintPatternModel;
$data = $m->selectAllPrintTemplate();
return view('sub_pages.sports_details')->with('data', $data);
}
public function displayAddPrintTemplatePage($tempcode)
{
$m = new SizesModel;
$data = $m->selectAllSizes();
//var_dump($tempcode);
return view('sub_pages.add_print_template')->with('sizeslist', $data)->with('templatecode', $tempcode);
}
public function savePrintPattern (Request $request)
{
$m = new PrintPatternModel;
$post = $request->all();
$templatecode = $post['templatecode'];
$templateType = $post['templateType'];
$templateSize = $post['templateSize'];
$rawName = $request->file('preview_print_template')->getClientOriginalName();
$imageExt = $request->file('preview_print_template')->getClientOriginalExtension();
$custom_file_name = str_replace(' ','-',strtolower($rawName));
$custom_file_name = preg_replace("/\.[^.\s]{3,4}$/", "", $custom_file_name);
$NewImageName = $templateSize.'.'.$imageExt;
$thumbnail = "uniform-templates/".$templatecode."/".$templateType."/SIZES/" . $NewImageName;
$data = array(
'TemplateCode' => $templatecode,
'Path' => $thumbnail,
'Type' => $templateType,
'Size' => $templateSize
);
$i = $m->insertPrintPattern($data);
//var_dump($data);
if($i){
$r = $request->file('preview_print_template')->move(
base_path() . "/public/images/uniform-templates/".$templatecode."/".$templateType."/SIZES/", $NewImageName
);
echo '<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
Print Pattern is successfully uploaded.
</div>';
}else{
echo '<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-check"></i> Error!</h4>
Failed to upload.
</div>';
}
}
}

View File

@@ -0,0 +1,10 @@
<?php namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class SizesController extends Controller {
}

View File

@@ -0,0 +1,135 @@
<?php namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Request1;
use Illuminate\Http\Request;
use App\Models\SportsModel;
class SportsController extends Controller {
public function displayAllSports()
{
$m = new SportsModel;
$data = $m->selectAllSports();
return view('sub_pages.sports')->with('row', $data);
}
public function displayAddSportPage()
{
return view('sub_pages.add_sports');
}
public function saveNewSports(Request $request)
{
$m = new SportsModel;
$post = $request->all();
$rawName = date('Ymd') . "-" . time().'-'.$request->file('previewImg')->getClientOriginalName();
$imageExt = $request->file('previewImg')->getClientOriginalExtension();
$custom_file_name = str_replace(' ','-',strtolower($rawName));
$custom_file_name = preg_replace("/\.[^.\s]{3,4}$/", "", $custom_file_name);
$NewImageName = $custom_file_name.'.'.$imageExt;
$thumbnail = "images/sports-thumbnails/" . $NewImageName;
$data = array(
'SportsName' => $post['sportsName'],
'URL' => $post['generatedUrl'],
'Thumbnail' => $thumbnail,
'IsActive' => 'FALSE',
);
$i = $m->insertToSports($data);
if($i){
$request->file('previewImg')->move(
base_path() . '/public/images/sports-thumbnails', $NewImageName
);
echo '<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
Sports is successfully added.
</div>';
}else{
echo '<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-check"></i> Error!</h4>
Failed to saved new sports.
</div>';
}
}
public function sportsDetails($q)
{
$m = new SportsModel;
$data = $m->selectSports($q);
return view('sub_pages.sports_details')->with('data', $data);
}
public function updateSports(Request $request)
{
$m = new SportsModel;
$post = $request->all();
if(count($post) > 3){
$rawName = date('Ymd') . "-" . time().'-'.$request->file('previewImg')->getClientOriginalName();
$imageExt = $request->file('previewImg')->getClientOriginalExtension();
$custom_file_name = str_replace(' ','-',strtolower($rawName));
$custom_file_name = preg_replace("/\.[^.\s]{3,4}$/", "", $custom_file_name);
$NewImageName = $custom_file_name.'.'.$imageExt;
$thumbnail = "images/sports-thumbnails/" . $NewImageName;
$data = array(
'SportsName' => $post['sportsName'],
'URL' => $post['generatedUrl'],
'Thumbnail' => $thumbnail
);
$request->file('previewImg')->move(
base_path() . '/public/images/sports-thumbnails', $NewImageName
);
}else{
$data = array(
'SportsName' => $post['sportsName'],
'URL' => $post['generatedUrl']
);
}
$i = $m->upateSportsDetails($data, $post['_id']);
if($i){
echo '<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
Sports details is successfully updated.
</div>';
}else{
echo '<div class="alert alert-warning alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-check"></i> Warning!</h4>
No changes made.
</div>';
}
}
public function selectSportsName()
{
//if(Request1::ajax()){
$m = new SportsModel;
$data = $m->getSportsName();
?>
<option value="">--Select Sports--</option>
<?php
foreach ($data as $row) {
echo '<option value="'.$row->Id.'">'.$row->SportsName.'</option>';
}
?>
<?php
//}
}
}

View File

@@ -0,0 +1,380 @@
<?php namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\TemplatesModel;
use App\Models\SportsModel;
use App\Models\PrintPatternModel;
class TemplatesController extends Controller {
public function displayTemplates()
{
return view('sub_pages.templates');
}
public function displayEditTemplatePage($q)
{
//return view('sub_pages.edit_template');
$m = new TemplatesModel;
$m1 = new SportsModel;
$m2 = new PrintPatternModel;
$templateData = $m->selectTemplate($q);
$templatePathsData = $m->selectTemplatePaths($q); // plain svg for visualizer
$templateTypes = $m->selectTemplateTypes();
$sportsList = $m1->getSportsName();
$printPatternList = $m2->selectAllPrintTemplate($q);
return view('sub_pages.edit_template')->with('templatedata', $templateData)->with('templatepath', $templatePathsData)->with('sportsname', $sportsList)->with('templatetype', $templateTypes)->with('printpattern', $printPatternList);
}
public function getTemplates(Request $request)
{
$m = new TemplatesModel;
$post = $request->all();
$data = $m->selectTemplates($post['id']);
// /public/images/sports-thumbnails
if(!empty($data)){
foreach ($data as $row) {
?>
<div class="col-md-4 col-sm-4 col-xs-6">
<div style="" class="text-center">
<h3><?php echo $row->TemplateName ?></h3>
</div>
<div class="sports-border">
<a href=""><img src="<?php echo url('public') . "/" . $row->Thumbnail ?>" alt="Sports" height="400px;" class="img img-responsive product-center" /></a>
<div class="sport-edit-btn">
<a href="<?php echo url('admin/templates') . "/edit/" . $row->TemplateCode . "/" ?>" class="btn btn-primary btn-block"><i class="fa fa-edit"></i> Edit</a>
</div>
</div>
</div>
<?php
}
}else{
echo '<script>
alert("No available Template/s");
</script>';
}
}
public function displayAddTemplatePage()
{
return view('sub_pages.add_template');
}
public function getTemplateTypes()
{
//if(Request::ajax()){
$m = new TemplatesModel;
$data = $m->selectTemplateTypes();
?>
<option value="">--Select Type--</option>
<?php
foreach ($data as $row) {
echo '<option value="'.$row->TemplateType.'">'.$row->TemplateType.'</option>';
}
?>
<?php
//}
}
public function getLastId()
{
//if(Request::ajax()){
$m = new TemplatesModel;
$data = $m->selectTemplateLastId();
echo $templateCode = "TEMP-" . str_pad($data->Id + 1, 5,'0',STR_PAD_LEFT);
}
public function saveNewTemplates(Request $request)
{
$m = new TemplatesModel;
$post = $request->all();
$templateCode = $post['templateCode'];
$sportName = $post['sportName'];
$templateName = $post['templateName'];
$templateType = $post['templateType'];
$numberOfTrims = $post['numberOfTrims'];
$getSkins = $post['getSkins'];
$tempateImage = $post['tempateImage'];
$rawName = date('Ymd') . "-" . time().'-'.$request->file('tempateImage')->getClientOriginalName();
$imageExt = $request->file('tempateImage')->getClientOriginalExtension();
$custom_file_name = str_replace(' ','-',strtolower($rawName));
$custom_file_name = preg_replace("/\.[^.\s]{3,4}$/", "", $custom_file_name);
$NewImageName = $custom_file_name.'.'.$imageExt;
$thumbnail = "images/templates/thumbnail/" . $NewImageName;
$data = array(
'SportsId' => $sportName,
'TemplateCode' => $templateCode,
'Thumbnail' => $thumbnail,
'TemplateName' => $templateName,
'TemplateType' => $templateType,
'Trim' => $numberOfTrims,
'PatternId' => $getSkins,
'IsActive' => 'TRUE'
);
$i = $m->insertNewTempalte($data);
if($i){
$request->file('tempateImage')->move(
base_path() . '/public/images/templates/thumbnail', $NewImageName
);
//for front jersey
if(!empty($request->file('svgJerseyFront')->getClientOriginalName())){
$svgName = $request->file('svgJerseyFront')->getClientOriginalName();
$svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
//var_dump($svgThumbnail);
$Templatedata = array(
'TemplateCode' => $templateCode,
'Type' => 'Jersey',
'Side' => 'Front',
'Path' => $svgThumbnail,
'IsActive' => 'TRUE'
);
$i = $m->insertTempaltePaths($Templatedata);
if($i){
$request->file('svgJerseyFront')->move(
base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
);
}
}
if(!empty($request->file('svgJerseyBack')->getClientOriginalName())){
$svgName = $request->file('svgJerseyBack')->getClientOriginalName();
$svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
$Templatedata = array(
'TemplateCode' => $templateCode,
'Type' => 'Jersey',
'Side' => 'Back',
'Path' => $svgThumbnail,
'IsActive' => 'TRUE'
);
$i = $m->insertTempaltePaths($Templatedata);
if($i){
$request->file('svgJerseyBack')->move(
base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
);
}
}
if(!empty($request->file('svgShortRight')->getClientOriginalName())){
$svgName = $request->file('svgShortRight')->getClientOriginalName();
$svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
$Templatedata = array(
'TemplateCode' => $templateCode,
'Type' => 'Shorts',
'Side' => 'Right',
'Path' => $svgThumbnail,
'IsActive' => 'TRUE'
);
$i = $m->insertTempaltePaths($Templatedata);
if($i){
$request->file('svgShortRight')->move(
base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
);
}
}
if(!empty($request->file('svgShortLeft')->getClientOriginalName())){
$svgName = $request->file('svgShortLeft')->getClientOriginalName();
$svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
$Templatedata = array(
'TemplateCode' => $templateCode,
'Type' => 'Shorts',
'Side' => 'Left',
'Path' => $svgThumbnail,
'IsActive' => 'TRUE'
);
$i = $m->insertTempaltePaths($Templatedata);
if($i){
$request->file('svgShortLeft')->move(
base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
);
}
}
echo '<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
Sports is successfully added.
</div>';
}else{
echo '<div class="alert alert-danger alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-check"></i> Error!</h4>
Failed to saved new sports.
</div>';
}
}
public function updateTemplate(Request $request)
{
$m = new TemplatesModel;
$post = $request->all();
// var_dump($post);
// echo count($post);
// var_dump($post);
// var_dump(array_key_exists('svgShortRight', $post));
$templateCode = $post['templateCode'];
$sportName = $post['sportName'];
$templateName = $post['templateName'];
$templateType = $post['templateType'];
$numberOfTrims = $post['numberOfTrims'];
$getSkins = $post['getSkins'];
if (array_key_exists('tempateImage', $post)) {
$tempateImage = $post['tempateImage'];
$rawName = date('Ymd') . "-" . time().'-'.$request->file('tempateImage')->getClientOriginalName();
$imageExt = $request->file('tempateImage')->getClientOriginalExtension();
$custom_file_name = str_replace(' ','-',strtolower($rawName));
$custom_file_name = preg_replace("/\.[^.\s]{3,4}$/", "", $custom_file_name);
$NewImageName = $custom_file_name.'.'.$imageExt;
$thumbnail = "images/templates/thumbnail/" . $NewImageName;
$data = array(
'SportsId' => trim($sportName),
'TemplateCode' => $templateCode,
'Thumbnail' => $thumbnail,
'TemplateName' => $templateName,
'TemplateType' => trim($templateType),
'Trim' => $numberOfTrims,
'PatternId' => $getSkins
);
$request->file('tempateImage')->move(
base_path() . '/public/images/templates/thumbnail', $NewImageName
);
}else{
$data = array(
'SportsId' => trim($sportName),
'TemplateCode' => $templateCode,
//'Thumbnail' => $thumbnail,
'TemplateName' => $templateName,
'TemplateType' => trim($templateType),
'Trim' => $numberOfTrims,
'PatternId' => $getSkins
);
}
$i = $m->updateNewTemplate($data, $templateCode);
if (array_key_exists('svgJerseyFront', $post)) {
//echo 'meron jerset front';
$svgName = $request->file('svgJerseyFront')->getClientOriginalName();
$svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
$Templatedata = array(
'Type' => 'Jersey',
'Side' => 'Front',
'Path' => $svgThumbnail
);
$i = $m->updateTemplatePaths($Templatedata, $post['id_svgJerseyFront']);
if($i){
$request->file('svgJerseyFront')->move(
base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
);
//echo 'image move success';
}
}
if (array_key_exists('svgJerseyBack', $post)) {
$svgName = $request->file('svgJerseyBack')->getClientOriginalName();
$svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
$Templatedata = array(
'Type' => 'Jersey',
'Side' => 'Back',
'Path' => $svgThumbnail
);
$i = $m->updateTemplatePaths($Templatedata, $post['id_svgJerseyBack']);
if($i){
$request->file('svgJerseyBack')->move(
base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
);
}
}
if (array_key_exists('svgShortRight', $post)) {
$svgName = $request->file('svgShortRight')->getClientOriginalName();
$svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
$Templatedata = array(
'Type' => 'Shorts',
'Side' => 'Right',
'Path' => $svgThumbnail
);
$i = $m->updateTemplatePaths($Templatedata, $post['id_svgShortRight']);
if($i){
$request->file('svgShortRight')->move(
base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
);
}
}
if (array_key_exists('svgShortLeft', $post)) {
$svgName = $request->file('svgShortLeft')->getClientOriginalName();
$svgThumbnail = "uniform-templates/".$templateCode."/DISPLAY/".$svgName;
$Templatedata = array(
'Type' => 'Shorts',
'Side' => 'Left',
'Path' => $svgThumbnail
);
$i = $m->updateTemplatePaths($Templatedata, $post['id_svgShortLeft']);
if($i){
$request->file('svgShortLeft')->move(
base_path() . '/public/images/uniform-templates/'.$templateCode. '/DISPLAY' , $svgName
);
}
}
echo '<div class="alert alert-success alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
Template is successfully updated.
</div>';
}
}

View File

@@ -0,0 +1,36 @@
<?php namespace App\Http\Controllers;
class WelcomeController extends Controller {
/*
|--------------------------------------------------------------------------
| Welcome Controller
|--------------------------------------------------------------------------
|
| This controller renders the "marketing page" for the application and
| is configured to only allow guests. Like most of the other sample
| controllers, you are free to modify or remove it as you desire.
|
*/
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Show the application welcome screen to the user.
*
* @return Response
*/
public function index()
{
return view('welcome');
}
}

View File

@@ -0,0 +1,16 @@
<?php namespace App\Http\Controllers\cliparts;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class ClipartsController extends Controller {
public function index()
{
return view('cliparts.index');
}
}

View File

@@ -0,0 +1,961 @@
<?php namespace App\Http\Controllers\designer;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\designer\DesignerModel;
use App\Models\teamstore\TeamStoreModel;
use App\Models\MainModel;
use Config;
Use Auth;
use DB;
class DesignerController extends Controller {
public function index($templateid)
{
$newDesignerModel = new DesignerModel;
$template_arrays = $newDesignerModel->selectTemplate($templateid);
// dd($template_arrays);
$patterns = explode(",", $template_arrays[0]->PatternId);
foreach($patterns as $patternId){
$pattern_arrays[] = $newDesignerModel->selectPatterns($patternId);
}
$templatepaths_arrays = $newDesignerModel->selectTemplatePaths($templateid);
$fonts_array = $newDesignerModel->selectFonts();
// var_dump($template_arrays);
return view('designer.designer')->with('template_arrays', $template_arrays)
->with('templatepaths_arrays', $templatepaths_arrays)
->with('pattern_arrays', $pattern_arrays)
->with('fonts_array', $fonts_array);
}
public function gradientAppend(Request $request)
{
$post = $request->all();
$gradientPrefix = $post['gradientPrefix'];
$TrimCount = $post['TrimCount'];
?>
<linearGradient id="<?php echo $gradientPrefix . 'Body_Gradient' ; ?>" gradientUnits="userSpaceOnUse" x1="0%" y1="100%" x2="0%" y2="0%">
<stop id="<?php echo $gradientPrefix . 'Body_Gradient_Color2' ; ?>" offset="0" stop-color="#FFFFFF" />
<stop id="<?php echo $gradientPrefix . 'Body_Gradient_Color1' ; ?>" offset="1" stop-color="#000000" />
</linearGradient>
<linearGradient id="<?php echo $gradientPrefix . 'Body_Pattern_Gradient' ; ?>" gradientUnits="userSpaceOnUse" x1="0%" y1="100%" x2="0%" y2="0%">
<stop id="<?php echo $gradientPrefix . 'Body_Pattern_Gradient_Color2' ; ?>" offset="0" stop-color="#FFFFFF" />
<stop id="<?php echo $gradientPrefix . 'Body_Pattern_Gradient_Color1' ; ?>" offset="1" stop-color="#000000" />
</linearGradient>
<?php
for($i = 1; $i <= $TrimCount; $i++ ){
?>
<linearGradient id="<?php echo $gradientPrefix . 'Trim_'.$i.'_Gradient' ; ?>" gradientUnits="userSpaceOnUse" x1="0%" y1="100%" x2="0%" y2="0%">
<stop id="<?php echo $gradientPrefix . 'Trim_'.$i.'_Gradient_Color2' ; ?>" offset="0" stop-color="#FFFFFF" />
<stop id="<?php echo $gradientPrefix . 'Trim_'.$i.'_Gradient_Color1' ; ?>" offset="1" stop-color="#000000" />
</linearGradient>
<linearGradient id="<?php echo $gradientPrefix . 'Trim_'.$i.'_Pattern_Gradient' ; ?>" gradientUnits="userSpaceOnUse" x1="0%" y1="100%" x2="0%" y2="0%">
<stop id="<?php echo $gradientPrefix . 'Trim_'.$i.'_Pattern_Gradient_Color2' ; ?>" offset="0" stop-color="#FFFFFF" />
<stop id="<?php echo $gradientPrefix . 'Trim_'.$i.'_Pattern_Gradient_Color1' ; ?>" offset="1" stop-color="#000000" />
</linearGradient>
<?php
}
}
public function setPattern(Request $request)
{
$newDesignerModel = new DesignerModel;
$post = $request->all();
$patternId = $post['patternId'];
$pattern_array = $newDesignerModel->selectPatterns($patternId);
$pattern_colors_array = $newDesignerModel->selectPatternColors($patternId);
$Opacity = $pattern_array[0]->Opacity;
$Gradient = $pattern_array[0]->Gradient;
if($pattern_array[0]->NoOFColor != 0){
$NoOFColor = $pattern_array[0]->NoOFColor;
echo '<div class="form-group col-md-12 col-sm-12 col-xs-12">';
echo 'Pattern Color';
echo '</div>';
echo '<div class="form-group col-md-12 col-sm-12 col-xs-12">';
for($i=1 ; $i <= $pattern_array[0]->NoOFColor ; $i++){
?>
<div class="btn-group">
<input type="text" class="patternColor" id="PatternColor<?php echo $i; ?>" value="<?php echo $pattern_colors_array[$i - 1]->PatternColor ?>" />
</div>
<?php
if($Gradient == "TRUE"){
?>
<button type="button" class="btn" id="btn-body-pattern-gradient" ></button>
<?php
}
}
echo '</div>';
?>
<div class="form-group col-md-12 col-sm-12 col-xs-12">
<div id="row-body-pattern-gradient" style="display:none;">
<div class="row">
<div class="form-group col-md-12 col-sm-12 col-xs-12">
Gradient Colors
</div>
</div>
<div class="row">
<div class="form-group col-md-2 col-sm-2 col-xs-2">
<input type="hidden" class="patternGradientColor pull-right" name="Body_Pattern_Gradient_Color1" id="Body_Pattern_Gradient_Color1" value="rgb(0, 0, 0)" />
</div>
<div class="form-group col-md-10 col-sm-10 col-xs-10">
<input type="range" id="Offset_Body_Pattern_Gradient_Color1" data-gradient-id="Body_Pattern_Gradient_Color1" class="offsetGradientPattern form-control input-sm" value="100" min="0" max="10" />
</div>
</div>
<div class="row">
<div class="form-group col-md-2 col-sm-2 col-xs-2">
<input type="hidden" class="patternGradientColor pull-right" name="Body_Pattern_Gradient_Color2" id="Body_Pattern_Gradient_Color2" value="rgb(255, 255, 255)" />
</div>
<div class="form-group col-md-10 col-sm-10 col-xs-10">
<input type="range" id="Offset_Body_Pattern_Gradient_Color2" data-gradient-id="Body_Pattern_Gradient_Color2" class="offsetGradientPattern form-control input-sm" value="0" min="0" max="10" />
</div>
</div>
</div>
</div>
<?php
if($Opacity == "TRUE"){
?>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<label>Opacity</label>
</div>
</div>
<div class="row">
<div class="form-group col-md-9 col-sm-9 col-xs-9">
<input type="range" id="opacityPattern" class="form-control input-sm" value="10" min="0" max="10" />
</div>
<div class="form-group col-md-3 col-sm-3 col-xs-3">
<input type="text" style="margin-top:5px;" class="form-control input-sm text-center" value="10" id="opacityPatternValue" />
</div>
</div>
<?php
}
}else{
/// no display..
$NoOFColor = 0;
}
?><input type="hidden" name="body-pattern-name" id="body-pattern-name" value="<?php echo $patternId . "," . $NoOFColor; ?>"><?php
}
public function setTrimPattern(Request $request)
{
$newDesignerModel = new DesignerModel;
$post = $request->all();
$patternId = $post['patternId'];
$trim = $post['trim'];
$pattern_array = $newDesignerModel->selectPatterns($patternId);
$pattern_colors_array = $newDesignerModel->selectPatternColors($patternId);
$Opacity = $pattern_array[0]->Opacity;
$Gradient = $pattern_array[0]->Gradient;
if($pattern_array[0]->NoOFColor != 0){
$NoOFColor = $pattern_array[0]->NoOFColor;
echo '<div class="form-group col-md-12 col-sm-12 col-xs-12">';
echo 'Pattern Color';
echo '</div>';
echo '<div class="form-group col-md-12 col-sm-12 col-xs-12">';
for($i=1 ; $i <= $pattern_array[0]->NoOFColor ; $i++){
?>
<div class="btn-group">
<input type="text" class="patternColor" data-trim-num="<?php echo $trim ?>" id="<?php echo 'Trim_' . $trim . '_PatternColor'.$i; ?>" value="<?php echo $pattern_colors_array[$i - 1]->PatternColor ?>" />
</div>
<?php
if($Gradient == "TRUE"){
?>
<!-- <button type="button" class="btn" id="btn-body-pattern-gradient" ></button> -->
<?php
}
}
echo '</div>';
?>
<div class="form-group col-md-12 col-sm-12 col-xs-12">
<div id="<?php echo 'row-trim-'.$trim.'-pattern-gradient' ?>" style="display:none;">
<div class="row">
<div class="form-group col-md-12 col-sm-12 col-xs-12">
Gradient Colors
</div>
</div>
<div class="row">
<div class="form-group col-md-2 col-sm-2 col-xs-2">
<input type="hidden" class="patternGradientColor pull-right" name="<?php echo 'Trim_' . $trim . '_Pattern_Gradient_Color1' ?>" id="<?php echo 'Trim_' . $trim . '_Pattern_Gradient_Color1' ?>" data-gradient-type="Pattern" data-trim-num="<?php echo $trim ?>" value="rgb(0, 0, 0)" />
</div>
<div class="form-group col-md-10 col-sm-10 col-xs-10">
<input type="range" id="<?php echo 'Offset_Trim_' . $trim . '_Pattern_Gradient_Color1' ?>" data-gradient-id="<?php echo 'Trim_' . $trim . '_Pattern_Gradient_Color1' ?>" class="offsetGradientPattern form-control input-sm" value="100" min="0" max="10" />
</div>
</div>
<div class="row">
<div class="form-group col-md-2 col-sm-2 col-xs-2">
<input type="hidden" class="patternGradientColor pull-right" name="<?php echo 'Trim_' . $trim . '_Pattern_Gradient_Color2' ?>" id="<?php echo 'Trim_' . $trim . '_Pattern_Gradient_Color2' ?>" data-gradient-type="Pattern" data-trim-num="<?php echo $trim ?>" value="rgb(255, 255, 255)" />
</div>
<div class="form-group col-md-10 col-sm-10 col-xs-10">
<input type="range" id="<?php echo 'Offset_Trim_' . $trim . '_Pattern_Gradient_Color2' ?>" data-gradient-id="<?php echo 'Trim_' . $trim . '_Pattern_Gradient_Color2' ?>" class="offsetGradientPattern form-control input-sm" value="0" min="0" max="10" />
</div>
</div>
</div>
</div>
<?php
if($Opacity == "TRUE"){
?>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<label>Opacity</label>
</div>
</div>
<div class="row">
<div class="form-group col-md-9 col-sm-9 col-xs-9">
<input type="range" id="opacityPattern" class="form-control input-sm" value="10" min="0" max="10" />
</div>
<div class="form-group col-md-3 col-sm-3 col-xs-3">
<input type="text" style="margin-top:5px;" class="form-control input-sm text-center" value="10" id="opacityPatternValue" />
</div>
</div>
<?php
}
}else{
/// no display..
$NoOFColor = 0;
}
?><input type="hidden" name="<?php echo 'Trim_'. $trim . '_patternName' ?>" id="<?php echo 'Trim_'. $trim . '_patternName' ?>" value="<?php echo $patternId . "," . $NoOFColor; ?>"><?php
}
public function getTemplateDefaultColors(Request $request)
{
$newDesignerModel = new DesignerModel;
$post = $request->all();
$templateCode = $post['templateCode'];
$default_template_color_array = $newDesignerModel->selectDefaultTemplateColor($templateCode);
// var_dump($default_template_color_array);
return response()->json(array(
'success' => true,
'default_template_color_array' => $default_template_color_array
));
}
public function getFontDisplay(Request $request){
$newDesignerModel = new DesignerModel;
$post = $request->all();
$getFontFamily = $post['fontFamily'];
$font_array = $newDesignerModel->selectFontsByFontFamily($getFontFamily);
foreach($font_array as $row){
$fontNameDisplay = $row->fontNameDisplay;
$additionalSize = $row->additionalSize;
}
$arr = array(
'fontNameDisplay' => $fontNameDisplay,
'additionalSize' => $additionalSize
);
echo json_encode($arr);
}
public function tabClipartContent()
{
$newDesignerModel = new DesignerModel;
$clipart_cat_array = $newDesignerModel->selectClipartCategories();
?>
<div class="row">
<div class="col-md-12">
<h4>Clipart</h4>
</div>
</div>
<hr>
<div id="show-clipart-content">
<div class="row">
<?php
foreach($clipart_cat_array as $row){
if($row->UserId != null){
if(!Auth::guest()){
if(Auth::user()->id == $row->UserId){
?>
<div class="form-group col-md-6">
<a href="#" class="clipart-category" data-id="<?php echo $row->Id ?>" data-type="category" data-title="<?php echo $row->CategoryName ?>">
<div style="height:100px; background-color:#f4f4f4; border-radius: 5px;" class="text-center">
<span style="position:absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 16px;"><?php echo $row->CategoryName ?></span>
</div>
</a>
</div>
<?php
}
}
}
}
foreach($clipart_cat_array as $row){
if($row->UserId == null){
?>
<div class="form-group col-md-6">
<a href="#" class="clipart-category" data-id="<?php echo $row->Id ?>" data-type="category" data-title="<?php echo $row->CategoryName ?>">
<div style="height:100px; background-color:#f4f4f4; border-radius: 5px;" class="text-center">
<span style="position:absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 16px;"><?php echo $row->CategoryName ?></span>
</div>
</a>
</div>
<?php
}
}
?>
</div>
</div>
<div class="display-flex" id="featured-cliparts"></div>
<?php
}
public function getCliparts(Request $request)
{
$newDesignerModel = new DesignerModel;
$post = $request->all();
$categoryId = $post['categoryId'];
$req_type = $post['req_type'];
$cat_name = $post['cat_name'];
$clipart_array = $newDesignerModel->selectClipartByCategory($categoryId);
?>
<div class="row">
<div class="col-md-6">
<h4><?php echo $cat_name ?></h4>
</div>
<div class="col-md-6">
<button class="btn btn-sm btn-default pull-right addMarginLeft" id="btn-close-clipart-properties" title="Close Clipart Properties"><i class="fa fa-remove" aria-hidden="true"></i> Close</button>
</div>
</div>
<br>
<?php
foreach($clipart_array as $row){
?>
<div class="form-group col-md-3">
<div class="thumbnail clipart-thumnail">
<a href="#" class="img-clipart" data-link="<?php echo $row->SVGFilename; ?>"><img src="<?php echo config('site_config.uploads') . 'cliparts/'. $row->SVGFilename; ?>" width="100%"></a>
</div>
</div>
<?php
}
}
public function clipartProperties(Request $request)
{
$newDesignerModel = new DesignerModel;
$post = $request->all();
?>
<div class="row">
<div class="col-md-12">
<h4>Clipart Properties</h4>
</div>
</div>
<hr>
<div class="row">
<div class="form-group col-md-12">
<button class="btn btn-sm btn-default pull-right addMarginLeft" id="btn-close-clipart-properties" title="Close Clipart Properties"><i class="fa fa-remove" aria-hidden="true"></i> Close</button>
<!-- <button type="button" class="btn btn-danger pull-right btn-sm remove addMarginLeft" title="Remove object"><i class="fa fa-trash" aria-hidden="true"></i></button> -->
<!-- <button type="button" class="btn btn-danger pull-right btn-sm addMarginLeft pasteObject" title="Paste object(s)"><i class="fa fa-paste" aria-hidden="true"></i></button> -->
<!-- <button type="button" class="btn btn-danger pull-right btn-sm addMarginLeft copyObject" title="Duplicate object"><i class="fa fa-copy" aria-hidden="true"></i></button> -->
</div>
</div>
<div class="row">
<div class="form-group col-md-3 col-sm-3 col-xs-3">
<label>Color(s)</label>
</div>
<div class="form-group col-md-9 col-sm-9 col-xs-9">
<?php
// var_dump($_POST['PathId']);
foreach($post['PathId'] as $key => $arrayData ){
// echo $arrayData['id'];
?>
<div class="btn-group">
<input type="text" data-number="<?php echo $arrayData['ran_num']; ?>" data-id="<?php echo $arrayData['id']; ?>" class="clipartColor" value="<?php echo $arrayData['fill']; ?>"/>
</div>
<?php
}
?>
</div>
</div>
<div class="row">
<div class="form-group col-md-3 col-sm-3 col-xs-3">
<label>Opacity</label>
</div>
<div class="form-group col-md-6 col-sm-6 col-xs-6">
<input type="range" class="form-control input-sm opacityTextSlider" value="1" min="0" max="10" />
</div>
<div class="form-group col-md-3 col-sm-3 col-xs-3">
<input type="text" style="margin-top:5px;" class="form-control input-sm text-center opacityTextValue" />
</div>
</div>
<div class="row">
<div class="form-group col-md-3 col-sm-3 col-xs-3">
<label>Rotate</label>
</div>
<div class="form-group col-md-6 col-sm-6 col-xs-6">
<input type="range" class="form-control input-sm rotateTextSlider" value="0" min="-180" max="180" />
</div>
<div class="form-group col-md-3 col-sm-3 col-xs-3">
<input type="text" style="margin-top:5px;" class="form-control input-sm text-center rotateTextValue"/>
</div>
</div>
<div class="row">
<div class="form-group col-md-5 col-sm-6 col-xs-6">
<label>Layer Order</label><br>
<button class="btn btn-sm btn-default sendSelectedObjectToFront" title="Bring Forward"></button>
<button class="btn btn-sm btn-default sendSelectedObjectBack" title="Send Backward"></button>
</div>
<div class="form-group col-md-7 col-sm-6 col-xs-6">
<label>Position</label><br>
<!-- <button class="btn btn-sm btn-default " style="margin:2px;" onclick="centerOnly();">Center</button>
<button class="btn btn-sm btn-default" style="margin:2px;" onclick="centerVer();"> <img src="images/align-v1.png" height="16px;" /> Center Vertical</button>
<button class="btn btn-sm btn-default" style="margin:2px;" onclick="centerHor();" > <img src="images/align-h1.png" height="16px;" /> Center Horizontal</button> -->
<!-- <button class="btn btn-sm btn-default btn-send-middle" style="margin:2px;" onclick="centerOnly();"></button>
<button class="btn btn-sm btn-default center-vertical" style="margin:2px;" onclick="centerVer();"></button>
<button class="btn btn-sm btn-default center-horizontal" style="margin:2px;" onclick="centerHor();" ></button> -->
<button class="btn btn-sm btn-default" style="min-width:35px;" title="Center Vertical" onclick="centerVer();"><i class="fa fa-arrows-v"></i></button>
<button class="btn btn-sm btn-default" style="min-width:35px;" title="Center Horizontal" onclick="centerHor();" ><i class="fa fa-arrows-h"></i></button>
<button class="btn btn-sm btn-default flip-vertically" style="min-width:35px;" title="Flip Vertically"><i class="fa fa-angle-double-up"></i></button>
<button class="btn btn-sm btn-default flip-horizontally" style="min-width:35px;" title="Flip Horizontally"><i class="fa fa-angle-double-right"></i></button>
</div>
</div>
<?php
}
public function saveDesign(Request $request)
{
$newDesignerModel = new DesignerModel;
$post = $request->all();
$clientId = Auth::user()->id;
$design_name = $post['design_name'];
$tempDecode = json_decode($_POST['templateDetails']);
$getTemPlateCode = $tempDecode[0]->templateCode;
$designCode = sha1(time() . "-" .date('ymd'));
if(isset($post['json_Front'])){
$json_Front = $post['json_Front'];
}else{
$json_Front = null;
}
if(isset($post['json_Back'])){
$json_Back = $post['json_Back'];
}else{
$json_Back = null;
}
if(isset($post['json_Left'])){
$json_Left = $post['json_Left'];
}else{
$json_Left = null;
}
if(isset($post['json_Right'])){
$json_Right = $post['json_Right'];
}else{
$json_Right = null;
}
// if(isset($post['json_Shirts_Front'])){
// $json_Jersey_Front = $post['json_Shirts_Front'];
// }
// if(isset($post['json_Shirts_Back'])){
// $json_Jersey_Back = $post['json_Shirts_Back'];
// }
try {
$design_info = array(
'ClientId' => $clientId,
'DesignName' => $design_name,
'TemplateCode' => $getTemPlateCode,
'DesignCode' => $designCode,
'TemplateDesign'=> $post['templateDetails'],
'ContentFront' => $json_Front,
'ContentBack' => $json_Back,
'ContentLeft' => $json_Left,
'ContentRight' => $json_Right
);
}
catch (\Exception $e) {
return $e->getMessage();
}
$res = $newDesignerModel->insertClientDesign($design_info);
if($res){
// dd(Uuid::generate());
return redirect('/designer/preview/'.$designCode);
// return redirect('http://localhost/crew-designer/mydesign/'.$designCode.'/');
}
// else{
// dd($res);
// }
// dd($design_info);
}
public function getDesign($designCode){
$newDesignerModel = new DesignerModel;
$newTeamStoreModel = new TeamStoreModel;
$newMainModel = new MainModel;
$client_design_array = $newDesignerModel->selectClientDesign($designCode);
$teamstore_array = array();
$clientrole = Auth::user()->role;
if($clientrole == "store_owner"){
$store_id = Auth::user()->store_id;
$teamstore_array = $newTeamStoreModel->selectTeamStore('Id', $store_id);
// var_dump(str_slug($teamstore_array[0]->StoreName, '-'));
// var_dump($this->createSlug('shorts-white-1'));
}
// var_dump($this->getProductCode());
$templatepaths_arrays = $newDesignerModel->selectTemplatePathsByTemplateCode($client_design_array[0]->TemplateCode);
$array_cat_name = $newMainModel->selectCategoryName($client_design_array[0]->TemplateCode);
// $array_cat_name = $newMainModel->selectCategoryName($client_design_array[0]->TemplateCode);
$array_templates = $newDesignerModel->selectTemplate(md5($client_design_array[0]->TemplateCode));
// var_dump($array_templates);
return view('designer.design_preview')
->with('client_design_array', $client_design_array)
->with('templatepaths_arrays', $templatepaths_arrays)
->with('teamstore_array', $teamstore_array)
->with('array_cat_name', $array_cat_name)
->with('array_templates', $array_templates);
}
protected function getProductCode()
{
//if(Request::ajax()){
$m = new DesignerModel;
$data = $m->selectTeamStoreProductLastId();
if($data){
$id = $data->Id;
}else{
$id = 0;
}
return $templateCode = date('y') .'-' . str_pad($id + 1, 10, '0',STR_PAD_LEFT);
}
public function saveDesignDetails(Request $request)
{
$newTeamStoreModel = new TeamStoreModel;
$newDesignerModel = new DesignerModel;
$clientrole = Auth::user()->role;
$post = $request->all();
// var_dump($post);
if($clientrole == "store_owner"){
if(isset($post['sale_chk'])){
$designName = $post['designName'];
$designCode = $post['designCode'];
$templateCode = $post['templateCode'];
$itemName = $post['itemName'];
$itemDescription = $post['itemDescription'];
$storeId = $post['storeId'];
$randomChar = str_random(5);
$producturl = str_slug($itemName .'-'. $randomChar, '-');
$item_price = str_replace('$ ', '', $post['item_price']);
$item_details = array(
'TeamStoreId' => $storeId,
'ProductCode' => $this->getProductCode(),
'ProductName' => $itemName,
'ProductPrice' => $item_price,
'ProductDescription' => $itemDescription,
'ProductURL' => $producturl,
'ProductForm' => 'jersey-form',
'PrivacyStatus' => 'private'
);
$newDesignerModel->updateClientDesign($designName, $designCode);
$res = $newTeamStoreModel->insertTeamStoreProduct($item_details);
if($res['i']){
$templatepaths_array = $newDesignerModel->selectTemplatePathsByTemplateCode($templateCode);
foreach($templatepaths_array as $row){
$imageClass = null;
if($row->Side == 'Front'){
$imageClass = 'active';
}
$productId = $res['lastId'];
$thumbnail = $designCode . '-' . strtolower($row->Side) . '-' . 'thumbnail.png';
$thumbnail_array[] = array(
'ProductId' => $productId,
'Image' => $thumbnail,
'ImageClass' => $imageClass
);
}
$k = $newTeamStoreModel->insertTeamStoreProductThumbnails($thumbnail_array);
if($k = "true"){
$i = 1;
}else{
$i = 0;
}
}
return $i;
}else{
$designName = $post['designName'];
$designCode = $post['designCode'];
$templateCode = $post['templateCode'];
$i = $newDesignerModel->updateClientDesign($designName, $designCode);
return $i;
}
}else{
$designName = $post['designName'];
$designCode = $post['designCode'];
$templateCode = $post['templateCode'];
$i = $newDesignerModel->updateClientDesign($designName, $designCode);
return $i;
}
}
public function saveRoster(Request $request)
{
$post = $request->all();
$newDesignerModel = new DesignerModel;
$newTeamStoreModel = new TeamStoreModel;
// var_dump($post);
$design_code = $post['designCode'];
$order_names = $post['order_names'];
$order_number = $post['order_number'];
$design_name = $post['design_name'];
$order_jersey_size = $post['order_jersey_size'];
$order_shorts_size = $post['order_shorts_size'];
foreach($order_names as $key => $val){
if($order_jersey_size[$key] != "none" && $order_shorts_size[$key] != "none"){
$order = "Both";
$array_default_price_jersey = $newDesignerModel->getDefaultPrice($order_jersey_size[$key], 'JERSEY');
$array_default_price_shorts = $newDesignerModel->getDefaultPrice($order_shorts_size[$key], 'SHORTS');
$price = $array_default_price_jersey[0]->Price + $array_default_price_shorts[0]->Price;
//var_dump($price);
}else if($order_jersey_size[$key] == "none" && $order_shorts_size[$key] != "none"){
$order = "Shorts";
$array_default_price_jersey = 0;
$array_default_price_shorts = $newDesignerModel->getDefaultPrice($order_shorts_size[$key], 'SHORTS');
$price = $array_default_price_jersey + $array_default_price_shorts[0]->Price;
//var_dump($price);
}else if($order_jersey_size[$key] != "none" && $order_shorts_size[$key] == "none"){
$order = "Jersey";
$array_default_price_jersey = $newDesignerModel->getDefaultPrice($order_jersey_size[$key], 'JERSEY');
$array_default_price_shorts = 0;
$price = $array_default_price_jersey[0]->Price + $array_default_price_shorts;
// var_dump($price);
}
if($request->session()->has('cartkey')){
$cartKey = $request->session()->get('cartkey');
}else{
$request->session()->put('cartkey', sha1(time() . str_random(6)));
$cartKey = $cartKey = $request->session()->get('cartkey');
}
$items[] = array(
'Order' => $order,
'CartKey' => $cartKey,
'DesignCode' => $design_code,
'ProductName' => $design_name,
'Name' => $order_names[$key],
'Number' => $order_number[$key],
'JerseySize' => $order_jersey_size[$key],
'ShortsSize' => $order_shorts_size[$key],
'Price' => $price,
'Quantity' => 1
);
}
$i = $newTeamStoreModel->insertToCart($items);
return redirect('cart');
}
public function editDesign($designcode)
{
$newDesignerModel = new DesignerModel;
$client_design_array = $newDesignerModel->selectClientDesign($designcode);
$template_arrays = $newDesignerModel->selectTemplate(md5($client_design_array[0]->TemplateCode));
// var_dump($template_arrays);
$patterns = explode(",", $template_arrays[0]->PatternId);
foreach($patterns as $patternId){
$pattern_arrays[] = $newDesignerModel->selectPatterns($patternId);
}
$templatepaths_arrays = $newDesignerModel->selectTemplatePaths(md5($client_design_array[0]->TemplateCode));
$fonts_array = $newDesignerModel->selectFonts();
// var_dump($client_design_array);
return view('designer.designer_edit')
->with('client_design_array', $client_design_array)
->with('template_arrays', $template_arrays)
->with('templatepaths_arrays', $templatepaths_arrays)
->with('pattern_arrays', $pattern_arrays)
->with('fonts_array', $fonts_array);
}
public function editGradientAppend(Request $request)
{
$post = $request->all();
$gradientFor = $post['gradientFor'];
$gradientPrefix = $post['gradientPrefix'];
$TrimCcount = $post['trimCount'];
$stop_color_1 = $post['stop_color_1'];
$stop_color_2 = $post['stop_color_2'];
$offset_1 = $post['offset_1'];
$offset_2 = $post['offset_2'];
if($gradientFor == "Body"){
?>
<linearGradient id="<?php echo $gradientPrefix . 'Body_Gradient' ; ?>" gradientUnits="userSpaceOnUse" x1="0%" y1="100%" x2="0%" y2="0%">
<stop id="<?php echo $gradientPrefix . 'Body_Gradient_Color2' ; ?>" offset="<?php echo $offset_2 ?>" stop-color="<?php echo $stop_color_2 ?>" />
<stop id="<?php echo $gradientPrefix . 'Body_Gradient_Color1' ; ?>" offset="<?php echo $offset_1 ?>" stop-color="<?php echo $stop_color_1 ?>" />
</linearGradient>
<?php
}
if($gradientFor == "Body_Pattern"){
?>
<linearGradient id="<?php echo $gradientPrefix . 'Body_Pattern_Gradient' ; ?>" gradientUnits="userSpaceOnUse" x1="0%" y1="100%" x2="0%" y2="0%">
<stop id="<?php echo $gradientPrefix . 'Body_Pattern_Gradient_Color2' ; ?>" offset="<?php echo $offset_2 ?>" stop-color="<?php echo $stop_color_2 ?>" />
<stop id="<?php echo $gradientPrefix . 'Body_Pattern_Gradient_Color1' ; ?>" offset="<?php echo $offset_1 ?>" stop-color="<?php echo $stop_color_1 ?>" />
</linearGradient>
<?php
}
if($gradientFor == "Trim"){
?>
<linearGradient id="<?php echo $gradientPrefix . 'Trim_'.$TrimCcount.'_Gradient' ; ?>" gradientUnits="userSpaceOnUse" x1="0%" y1="100%" x2="0%" y2="0%">
<stop id="<?php echo $gradientPrefix . 'Trim_'.$TrimCcount.'_Gradient_Color2' ; ?>" offset="<?php echo $offset_2 ?>" stop-color="<?php echo $stop_color_2 ?>" />
<stop id="<?php echo $gradientPrefix . 'Trim_'.$TrimCcount.'_Gradient_Color1' ; ?>" offset="<?php echo $offset_1 ?>" stop-color="<?php echo $stop_color_1 ?>" />
</linearGradient>
<?php
}
if($gradientFor == "Trim_Pattern"){
?>
<linearGradient id="<?php echo $gradientPrefix . 'Trim_'.$TrimCcount.'_Pattern_Gradient' ; ?>" gradientUnits="userSpaceOnUse" x1="0%" y1="100%" x2="0%" y2="0%">
<stop id="<?php echo $gradientPrefix . 'Trim_'.$TrimCcount.'_Pattern_Gradient_Color2' ; ?>" offset="<?php echo $offset_2 ?>" stop-color="<?php echo $stop_color_2 ?>" />
<stop id="<?php echo $gradientPrefix . 'Trim_'.$TrimCcount.'_Pattern_Gradient_Color1' ; ?>" offset="<?php echo $offset_1 ?>" stop-color="<?php echo $stop_color_1 ?>" />
</linearGradient>
<?php
}
}
public function editPatternProperties(Request $request)
{
$newDesignerModel = new DesignerModel;
$post = $request->all();
$patternId = $post['patternId'];
$pattern_array = $newDesignerModel->selectPatterns($patternId);
foreach($pattern_array as $row){
$small = $row->SVGPath;
$large = $row->SVGPath_Actual;
}
$arr = array(
'small' => config('site_config.uploads') . $small ,
'large' => config('site_config.uploads') . $large
);
return json_encode($arr);
// var_dump($arr);
}
public function editSetPattern(Request $request)
{
$newDesignerModel = new DesignerModel;
$post = $request->all();
$patternId = $post['patternId'];
$patternType = $post['patternType'];
$patternFor = $post['patternFor'];
$pcolors = $post['pcolors'];
$gradientColor = $post['gradientColor'];
if($patternType == "Custom"){
$table = "client_patterns";
}else{
$table = "patterns";
}
foreach($gradientColor as $p){
foreach($p as $key => $val){
${$key} = $val;
}
}
$pattern_array = $newDesignerModel->selectPatternsByTable($table, $patternId);
foreach($pattern_array as $row){
$Opacity = $row->Opacity;
$Gradient = $row->Gradient;
if($row->NoOFColor != 0){
$NoOFColor = $row->NoOFColor;
echo '<div class="form-group col-md-12 col-sm-12 col-xs-12">';
echo 'Pattern Color';
echo '</div>';
echo '<div class="form-group col-md-12 col-sm-12 col-xs-12">';
foreach($pcolors as $p){
foreach($p as $key => $val){
?>
<div class="btn-group">
<input type="text" class="patternColor" id="<?php echo $key ?>" value="<?php echo $val ?>" />
</div>
<?php
}
}
if($Gradient == "TRUE"){
?>
<button type="button" style="<?php echo ($patternFor == 'Gradient') ? 'background: linear-gradient('.$gradientColor1.','.$gradientColor2.')' : '' ?>" class="btn" id="btn-body-pattern-gradient"><?php echo ($patternFor == 'Gradient') ? '<i class="fa fa-2 fa-check" aria-hidden="true"></i>' : '' ?></button>
<?php
}
echo '</div>';
?>
<div class="form-group col-md-12 col-sm-12 col-xs-12">
<div id="row-body-pattern-gradient" style="display:<?php echo ($patternFor == 'Gradient') ? 'block' : 'none' ?>;">
<div class="row">
<div class="form-group col-md-12 col-sm-12 col-xs-12">
Gradient Colors
</div>
</div>
<div class="row">
<div class="form-group col-md-2 col-sm-2 col-xs-2">
<input type="hidden" class="patternGradientColor pull-right" data-gradient-type="Body" name="Body_Pattern_Gradient_Color1" id="Body_Pattern_Gradient_Color1" value="<?php echo ($patternFor == 'Gradient') ? $gradientColor1 : 'rgb(0, 0, 0)' ?>" />
</div>
<div class="form-group col-md-10 col-sm-10 col-xs-10">
<input type="range" id="Offset_Body_Pattern_Gradient_Color1" data-gradient-id="Body_Pattern_Gradient_Color1" class="offsetGradientPattern form-control input-sm" value="<?php echo ($patternFor == 'Gradient') ? $gradientColorOffset1 / 10 : '100' ?>" min="0" max="10" />
</div>
</div>
<!-- gradientColorOffset1 -->
<div class="row">
<div class="form-group col-md-2 col-sm-2 col-xs-2">
<input type="hidden" class="patternGradientColor pull-right" data-gradient-type="Body" name="Body_Pattern_Gradient_Color2" id="Body_Pattern_Gradient_Color2" value="<?php echo ($patternFor == 'Gradient') ? $gradientColor2 : 'rgb(255, 255, 255)' ?>" />
</div>
<div class="form-group col-md-10 col-sm-10 col-xs-10">
<input type="range" id="Offset_Body_Pattern_Gradient_Color2" data-gradient-id="Body_Pattern_Gradient_Color2" class="offsetGradientPattern form-control input-sm" value="<?php echo ($patternFor == 'Gradient') ? $gradientColorOffset2 / 10 : '0' ?>" min="0" max="10" />
</div>
</div>
</div>
</div>
<?php if($Opacity == "TRUE"){ ?>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<label>Opacity</label>
</div>
</div>
<div class="row">
<div class="form-group col-md-9 col-sm-9 col-xs-9">
<input type="range" id="opacityPattern" class="form-control input-sm" value="10" min="0" max="10" />
</div>
<div class="form-group col-md-3 col-sm-3 col-xs-3">
<input type="text" style="margin-top:5px;" class="form-control input-sm text-center" value="10" id="opacityPatternValue" />
</div>
</div>
<?php }
}else{
/// no display..
$NoOFColor = 0;
}
}
?>
<input type="hidden" name="body-pattern-name" id="body-pattern-name" value="<?php echo $patternId . "," . $NoOFColor; ?>">
<?php
}
public function buyForm(Request $request){
$post = $request->all();
// echo $post['temp_code'];
$newDesignerModel = new DesignerModel;
$jersey_sizes = $newDesignerModel->getAvailableSizes($post['temp_code'], 'JERSEY');
$shorts_sizes = $newDesignerModel->getAvailableSizes($post['temp_code'], 'SHORTS');
return view("designer.buy_form")->with('jersey_sizes', $jersey_sizes)
->with('shorts_sizes', $shorts_sizes);
}
}

View File

@@ -0,0 +1,444 @@
<?php
namespace App\Http\Controllers\paypal;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
// use Paypal;
use Netshell\Paypal\Facades\Paypal;
use App\Models\teamstore\TeamStoreModel;
use App\Models\user\UserModel;
use App\Models\ApiModel;
use App\Models\paypal\PayPalModel;
// use Auth;
use Illuminate\Support\Facades\Auth;
// use Session;
use Illuminate\Support\Facades\Session;
// use Redirect;
use Illuminate\Support\Facades\Redirect;
// use Mail;
use Illuminate\Support\Facades\Mail;
class PaypalController extends Controller
{
private $_apiContext;
public function __construct()
{
$this->_apiContext = PayPal::ApiContext(
config('services.paypal.client_id'),
config('services.paypal.secret')
);
// $this->_apiContext->setConfig(array(
// 'mode' => 'sandbox',
// 'service.EndPoint' => 'https://api.sandbox.paypal.com',
// 'http.ConnectionTimeOut' => 30,
// 'log.LogEnabled' => true,
// 'log.FileName' => storage_path('logs/paypal.log'),
// 'log.LogLevel' => 'FINE'
// ));
// live
$this->_apiContext->setConfig(array(
'mode' => 'live',
'service.EndPoint' => 'https://api.paypal.com',
'http.ConnectionTimeOut' => 30,
'log.LogEnabled' => true,
'log.FileName' => storage_path('logs/paypal.log'),
'log.LogLevel' => 'FINE'
));
}
public function payPremium()
{
return view('payPremium');
}
public function getCheckout(Request $request)
{
if (Auth::guest()) {
$message = 'Please <a href="' . url('auth/login') . '">Sign in</a> to your account to proceed.';
Session::flash('msg', $message);
return Redirect::back();
}
// $request->session()->forget('cartkey');
if(!$request->session()->has('cartkey')){
$message = 'Your cart is empty';
Session::flash('cartkeyError', $message);
return Redirect::back();
}
$payer = PayPal::Payer();
$payer->setPaymentMethod('paypal');
$m = new TeamStoreModel;
$paypal_model = new PayPalModel;
$last_id = $paypal_model->getLastIdPaymentDetails();
$invoice_num = str_pad($last_id[0]->Id, 4, '0', STR_PAD_LEFT);
$cartKey = $request->session()->get('cartkey');
$items = $m->myCart($cartKey);
$getSubtotal = $m->getSubtotal($cartKey);
$grouped_item = $m->selectTeamStoreGroupByCartKey($cartKey);
$store_array = $m->selectTeamStore('Id', $grouped_item[0]->StoreId);
$getSmallItemQty = 0;
$getBulkyItemQty = 0;
$getMaskItemQty = 0;
$getDGSItemQty = 0;
$shippingFee = 0;
foreach ($items as $item) {
if ($item->VoucherId != null) {
$voucherIds[] = $item->VoucherId;
$voucher = $m->selectVoucherWhereIn($voucherIds);
$item_id = $item->Id;
$totalValue = $voucher[0]->VoucherValue;
if ($voucher[0]->VoucherType == "Percentage") {
$getPercentageValue = $totalValue / 100;
$getDiscountValue = ($getSubtotal[0]->Subtotal * $getPercentageValue);
$data = array(
'Price' => round($getDiscountValue * -1, 2)
);
$m->updateVoucherValueInCart($data, $item_id);
} else {
$voucherData = array(
'totalValue' => $totalValue,
'type' => 'Flat'
);
}
}
if($item->ShippingCostId == 1){
$getSmallItemQty += $item->Quantity;
}else if($item->ShippingCostId == 2){
$getBulkyItemQty += $item->Quantity;
}else if($item->ShippingCostId == 3){
$getMaskItemQty += $item->Quantity;
}else if($item->ShippingCostId == 4){
$getDGSItemQty += $item->Quantity;
}
}
$getSmallItemQty = ceil($getSmallItemQty / 3) * 8;
$getBulkyItemQty = ceil($getBulkyItemQty / 1) * 8;
$getMaskItemQty = ceil($getMaskItemQty / 25) * 8;
$getMaskItemQty = ceil($getMaskItemQty / 4) * 5;
$shippingFee = $getSmallItemQty + $getBulkyItemQty + $getMaskItemQty + $getDGSItemQty;
// var_dump($shippingFee);
$order_items = array();
$updated_items = $m->myCart($cartKey);
$updated_getSubtotal = $m->getSubtotal($cartKey);
// $order_subtotal = $updated_getSubtotal[0]->Subtotal;
$order_grandtotal = $updated_getSubtotal[0]->Subtotal;
if ($grouped_item[0]->StoreId == 76 || $grouped_item[0]->StoreId == 78 || $grouped_item[0]->StoreId == 111 || $grouped_item[0]->StoreId == 131 || $grouped_item[0]->StoreId == 30 || $grouped_item[0]->StoreId == 141 || $grouped_item[0]->StoreId == 162 || $grouped_item[0]->StoreId == 185) {
$tax_value = 0;
} else {
$tax_value = 0.10;
}
$tax = $order_grandtotal * $tax_value;
foreach ($updated_items as $key => $item) {
// $descriptions = "Name: " . $item->Name . " Number: " . $item->Number . " Size: " . $item->Size;"?"
$order_items[$key] = PayPal::Item();
$order_items[$key]->setName($item->ProductName);
$order_items[$key]->setCurrency($store_array[0]->StoreCurrency);
$order_items[$key]->setQuantity($item->Quantity);
// $order_items[$key]->setDescription($descriptions);
// $order_items[$key]->setTax(10);
$order_items[$key]->setPrice($item->Price);
}
$item_list = PayPal::ItemList();
$item_list->setItems($order_items);
$amount_details = PayPal::Details();
$amount_details->setSubtotal($order_grandtotal);
$amount_details->setTax($tax);
$amount_details->setShipping($shippingFee);
$amount = PayPal::Amount();
$amount->setCurrency($store_array[0]->StoreCurrency);
$amount->setDetails($amount_details);
$amount->setTotal($order_grandtotal + $tax + $shippingFee);
$transaction = PayPal::Transaction();
$transaction->setAmount($amount);
$transaction->setItemList($item_list);
// $transaction->setDescription('Your transaction description');
$transaction->setInvoiceNumber(date('Ymd') . '-' . $invoice_num);
$redirectUrls = PayPal::RedirectUrls();
$redirectUrls->setReturnUrl(route('getDone'));
$redirectUrls->setCancelUrl(route('getCancel'));
$payment = PayPal::Payment();
$payment->setIntent('sale');
$payment->setPayer($payer);
$payment->setRedirectUrls($redirectUrls);
$payment->setTransactions(array($transaction));
$response = $payment->create($this->_apiContext);
$redirectUrl = $response->links[1]->href;
return redirect()->to($redirectUrl);
}
public function getDoneTest()
{
// $paymentId= "PAY-66Y799521H279203PLOP2X4Y";
// $payment = PayPal::getById($paymentId, $this->_apiContext);
// $obj = json_decode($payment);
// // var_dump($obj);
// $total = $obj->transactions[0]->amount->total;
// $currency = $obj->transactions[0]->amount->currency;
// $invoice_number = $obj->transactions[0]->invoice_number;
// return view('paypal.get_done')
// ->with('currency', $currency)
// ->with('total', $total);
// try {
// $invoice = PayPal::Invoice();
// echo $number = $invoice->generateNumber($this->_apiContext);
// } catch (Exception $ex) {
// echo $ex;
// }
}
public function getDone(Request $request)
{
$id = $request->get('paymentId');
$token = $request->get('token');
$payer_id = $request->get('PayerID');
$payment = PayPal::getById($id, $this->_apiContext);
$paymentExecution = PayPal::PaymentExecution();
$paymentExecution->setPayerId($payer_id);
$executePayment = $payment->execute($paymentExecution, $this->_apiContext);
// print_r($executePayment);
// if ($executePayment->getState() == 'approved') {
// /** it's all right **/
// /** Here Write your database logic like that insert record or value in database if you want **/
// // \Session::put('success','Payment success');
// // return Redirect::route('paywithpaypal');
// echo 'Payment success';
// }
$obj = json_decode($executePayment);
$line2 = null;
//details
$total = $obj->transactions[0]->amount->total;
$sub_total = $obj->transactions[0]->amount->details->subtotal;
$tax = $obj->transactions[0]->amount->details->tax;
$shipping = $obj->transactions[0]->amount->details->shipping;
$relatedResources = $obj->transactions[0]->related_resources[0];
$saleId = $relatedResources->sale->id; // transaction_id
$currency = $obj->transactions[0]->amount->currency;
$invoice_number = $obj->transactions[0]->invoice_number;
//shipping address details
$recipient_name = $obj->transactions[0]->item_list->shipping_address->recipient_name;
$line1 = $obj->transactions[0]->item_list->shipping_address->line1;
if (isset($obj->transactions[0]->item_list->shipping_address->line2)) {
$line2 = $obj->transactions[0]->item_list->shipping_address->line2;
}
$city = $obj->transactions[0]->item_list->shipping_address->city;
$state = $obj->transactions[0]->item_list->shipping_address->state;
$postal_code = $obj->transactions[0]->item_list->shipping_address->postal_code;
$country_code = $obj->transactions[0]->item_list->shipping_address->country_code;
// payer info
$payment_method = $obj->payer->payment_method;
$email = $obj->payer->payer_info->email;
$first_name = $obj->payer->payer_info->first_name;
$last_name = $obj->payer->payer_info->last_name;
$_payer_id = $obj->payer->payer_info->payer_id;
/// end paypal codes
$paypal_model = new PayPalModel;
$m = new TeamStoreModel;
$cartKey = $request->session()->get('cartkey');
$userId = Auth::user()->id;
$user_email = Auth::user()->email;
$items = $m->myCart($cartKey); // item from cart_tmp
$getSubtotal = $m->getSubtotal($cartKey);
$payment_details = array(
'UserId' => $userId,
'CartKey' => $cartKey,
'PaymentId' => $id,
'Token' => $token,
'PayerId' => $payer_id,
'InvoiceNumber' => $invoice_number,
'Currency' => $currency,
'Total' => $total,
'SubTotal' => $sub_total,
'Tax' => $tax,
'Payer_Email' => $email,
'Payer_Firstname' => $first_name,
'Payer_Lastname' => $last_name,
'PaymentMethod' => $payment_method,
'ShippingCost' => $shipping,
'TransactionId' => $saleId
);
$p_id = $paypal_model->insertToPaypalDetails($payment_details);
$shipping_address = array(
'PaymentDetail_Id' => $p_id,
'recipient_name' => $recipient_name,
'line1' => $line1,
'line2' => $line2,
'city' => $city,
'state' => $state,
'postal_code' => $postal_code,
'country_code' => $country_code,
);
// iinsert shipping address
$paypal_model->insertShippingAddress($shipping_address);
// insert order from cart_tmp to orders table
$l = $paypal_model->insertToOrders($cartKey); // insert to orders table
//email sending
$newUserModel = new UserModel;
$order_item_array = $newUserModel->selectOrderItem($cartKey);
$item_goup_array = $newUserModel->itemGroup($cartKey);
$item_thumbs = $newUserModel->selectDisplayItemThumb();
$array_payment_details = $newUserModel->selectPaymentDetails('CartKey', $cartKey);
$array_storename = $newUserModel->selectTeamStoreName($cartKey); // email subject
foreach ($array_storename as $storname) {
$sName[] = $storname->StoreName;
$sid[] = $storname->Id;
}
$sName = implode(", ", $sName);
$user_loginsArray = $newUserModel->selectUserLoginsWhereIn($sid);
foreach ($user_loginsArray as $userdata) {
$other_email[] = $userdata->other_email;
}
if ($other_email[0] != null) {
$other_email = implode(", ", $other_email);
$email_cc = "orders@crewsportswear.com" . "," . $other_email;
} else {
$email_cc = "orders@crewsportswear.com";
}
$explode_other_email = explode(",", $email_cc);
$data = array(
'order_item_array' => $order_item_array,
'item_goup_array' => $item_goup_array,
'img_thumb' => $item_thumbs,
'array_payment_details' => $array_payment_details,
'receiver' => $user_email,
'email_cc' => $explode_other_email,
'subject' => $sName . ' ORDERS',
);
Mail::send('emails.orders', $data, function ($message) use ($data) {
$message->from('no-reply@crewsportswear.com', 'CREW Sportswear');
$message->bcc($data['email_cc'], 'Orders From CREW Sportswear');
$message->to($data['receiver'])->subject($data['subject']);
});
// end email sending
$insertTracking = array(
"StepId" => 1,
"ScannedBy" => 1,
"InvoiceNumber" => $invoice_number,
"created_at" => date('Y-m-d H:i:s')
);
$ApiModel = new ApiModel;
$ApiModel->insertTracking($insertTracking);
$request->session()->forget('cartkey'); // clear session for cartkey
// redirect to thank you page.
return view('paypal.get_done')
->with('currency', $currency)
->with('total', $total);
}
public function getCancel(Request $request)
{
$m = new TeamStoreModel;
$cartKey = $request->session()->get('cartkey');
$items = $m->myCart($cartKey);
$getSubtotal = $m->getSubtotal($cartKey);
foreach ($items as $item) {
if ($item->VoucherId != null) {
$voucherIds[] = $item->VoucherId;
$voucher = $m->selectVoucherWhereIn($voucherIds);
$item_id = $item->Id;
$totalValue = $voucher[0]->VoucherValue;
if ($voucher[0]->VoucherType == "Percentage") {
$data = array(
'Price' => '00.00'
);
$m->updateVoucherValueInCart($data, $item_id);
} else {
$voucherData = array(
'totalValue' => $totalValue,
'type' => 'Flat'
);
}
}
}
return redirect()->route('cart');
}
}

View File

@@ -0,0 +1,797 @@
<?php
namespace App\Http\Controllers\teamstore;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
// use Auth;
use Illuminate\Support\Facades\Auth;
use App\Models\teamstore\TeamStoreModel;
use App\Models\user\UserModel;
// use Mail;
use Illuminate\Support\Facades\Mail;
use Analytics;
class TeamStoreController extends Controller
{
public function index(Request $request, $teamStoreURL)
{
// var_dump($teamStoreURL);
$m = new TeamStoreModel;
$UserModel = new UserModel;
$store_array = $m->selectTeamStore('StoreUrl', $teamStoreURL);
$product_array = $m->selectTeamStoreProducts('TeamStoreId', $store_array[0]->Id);
$user_role = '';
if (Auth::check()) {
$user_role = Auth::user()->role;
$store_id = Auth::user()->store_id;
} else {
$user_role = null;
$store_id = null;
}
if ($store_array[0]->Password != null) {
if ($request->session()->get('teamstore_data_array') == null) {
if ($store_id != $store_array[0]->Id) {
return redirect('teamstore');
}
} else {
if ($user_role != "store_owner") {
if ($request->session()->get('teamstore_data_array')[0]->StoreUrl != $store_array[0]->StoreUrl) {
return redirect()->back();
}
}
}
}
foreach ($product_array as $p => $pr_arr) {
$thumbnails_array = $m->getProductThumbnails($pr_arr->Id);
if (!empty($thumbnails_array)) {
foreach ($thumbnails_array as $t => $thumb) {
if ($thumb->ImageClass == 'custom') {
$displayThumbnails = $thumb->Image;
break;
}
if ($thumb->ImageClass == 'active') {
$displayThumbnails = $thumb->Image;
break;
}
}
$thumbnails[] = array(
'folder' => $store_array[0]->ImageFolder,
'product_id' => $pr_arr->Id,
'thumb' => $displayThumbnails
);
} else {
$thumbnails[] = array(
'folder' => $store_array[0]->ImageFolder,
'product_id' => $pr_arr->Id,
'thumb' => "product-image-placeholder.png"
);
}
}
$getAnnouncement = $UserModel->getAnnouncement($store_array[0]->Id);
if (count($getAnnouncement) > 0) {
$data = $getAnnouncement[0];
} else {
$data = (object) array(
'Id' => 0,
'StoreId' => "",
'Announcement' => "",
'IsActive' => 0,
'DateCreated' => ""
);
}
return view('teamstore-sublayouts.index')
->with('store_array', $store_array)
->with('product_array', $product_array)
->with('announcement', $data)
->with('thumbnails', $thumbnails);
}
public function storelist(Request $request)
{
// $analyticsData = Analytics::getMostVisitedPages(14, 50);
// foreach($analyticsData as $key => $val){
// if (strpos($val['url'], 'teamstore') !== false) {
// $teamstore[] = $val['url'];
// }
// }
// foreach($teamstore as $t){
// $sad = explode('/', $t);
// if(count($sad) == 4){
// $arr_teamstore[] = explode('?', $sad['3'])['0'];
// }
// }
// var_dump(array_unique($arr_teamstore));
$m = new TeamStoreModel;
$q = $request->input('q');
$sort = $request->input('s');
if (isset($q) && isset($sort)) {
if ($sort == "latest") {
$field = "Id";
$sort_value = "DESC";
} elseif ($sort == "al-desc") {
$field = "StoreName";
$sort_value = "DESC";
} elseif ($sort == "oldest") {
$field = "Id";
$sort_value = "ASC";
} else {
$field = "StoreName";
$sort_value = "ASC";
}
if ($q != "") {
// keyword and sort
$stores_array = $m->selectTeamstoreSearch($field, $sort_value, $q);
} else {
// sort only
$stores_array = $m->selectTeamstoreFilter($field, $sort_value);
}
} else {
$field = "StoreName";
$sort_value = "ASC";
$sort = "al-asc";
$stores_array = $m->selectTeamstoreFilter($field, $sort_value);
}
return view('merchbay.index')
->with('stores_array', $stores_array)
->with('keyword', $q)
->with('filter', $sort);
}
public function checkTeamStorePassword(Request $request)
{
$m = new TeamStoreModel;
$post = $request->all();
$store_array = $m->checkStorePassword($post['store_id'], $post['password']);
if ($store_array) {
$request->session()->put('teamstore_data_array', $store_array);
return redirect('teamstore/' . $store_array[0]->StoreUrl);
} else {
return redirect()->back()->with('errors', 'Invalid Password.');
}
}
private $teams_array;
public function productDetails($teamStoreURL, $productURL)
{
$m = new TeamStoreModel;
$teams_array = array();
$store_array = $m->selectTeamStore('StoreUrl', $teamStoreURL);
$product_array = $m->selectTeamStoreProducts('ProductURL', $productURL);
$thumbnails_array = $m->getThumbnails($product_array[0]->Id);
$teams_array = $m->getTeams($product_array[0]->Id);
// $sizes_array = $m->getSizes();
if (empty($thumbnails_array)) {
$data = (object) array(
'Image' => 'product-image-placeholder.png',
'ImageClass' => 'active'
);
$thumbnails_array[] = $data;
}
$x = explode(",", $product_array[0]->AvailableSizes);
foreach ($x as $s) {
$h[] = $m->getSizesByBracket($s);
}
foreach ($h as $d) {
foreach ($d as $g) {
$sizes_array[] = $g;
}
}
if ($product_array[0]->ProductAvailableQty != null) {
$soldQty = $m->getSoldQty($product_array[0]->Id);
$availableQty = $product_array[0]->ProductAvailableQty - $soldQty[0]->SoldQty;
} else {
// echo 'no qty';
$availableQty = null;
}
// $product_array[0]->ProductAvailableQty
return view('teamstore-sublayouts.product-details')
->with('store_array', $store_array)
->with('product_array', $product_array)
->with('thumbnails_array', $thumbnails_array)
->with('teams_array', $teams_array)
->with('sizes_array', $sizes_array)
->with('available_qty', $availableQty);
}
public function login(Request $request)
{
return view('teamstore-sublayouts.login');
}
public function clearSession(Request $request)
{
$request->session()->forget('teamstore_data_array');
return redirect("{{ url('/') }}");
}
public function addNewRow(Request $request)
{
$post = $request->all();
$TeamStoreModel = new TeamStoreModel;
$item = $TeamStoreModel->selectTeamStoreProductByIdHash($post['p_id']);
$x = explode(",", $item[0]->AvailableSizes);
foreach ($x as $s) {
$h[] = $TeamStoreModel->getSizesByBracket($s);
}
foreach ($h as $d) {
foreach ($d as $g) {
$sizes_array[] = $g;
}
}
if ($item[0]->ProductAvailableQty != null) {
$soldQty = $TeamStoreModel->getSoldQty($item[0]->Id);
$availableQty = $item[0]->ProductAvailableQty - $soldQty[0]->SoldQty;
} else {
// echo 'no qty';
$availableQty = null;
}
$handle_form = view('teamstore-sublayouts.forms.' . $item[0]->ProductForm)
->with('sizes_array', $sizes_array)
->with('availableQty', $availableQty)
->render();
return $handle_form;
}
public function addToCart(Request $request)
{
$post = $request->all();
$m = new TeamStoreModel;
$hash_product_id = $post['p_id'];
if ($request->session()->has('cartkey')) {
$cartKey = $request->session()->get('cartkey');
} else {
$request->session()->put('cartkey', sha1(time() . str_random(6)));
$cartKey = $cartKey = $request->session()->get('cartkey');
}
$product_array = $m->selectTeamStoreProductByIdHash($hash_product_id);
$product_id = $product_array[0]->Id;
$TeamStoreId = $product_array[0]->TeamStoreId;
$ProductPrice = $product_array[0]->ProductPrice;
$ProductURL = $product_array[0]->ProductURL;
$product_form = $product_array[0]->ProductForm;
$design_code = $product_array[0]->DesignCode;
$product_name = $product_array[0]->ProductName;
$shipping_cost_id = $product_array[0]->ShippingCostId;
$teamstore_array = $m->selectTeamStore('Id', $TeamStoreId);
$store_url = $teamstore_array[0]->StoreUrl;
$store_id = $teamstore_array[0]->Id;
if ($product_form == "jersey-and-shorts-form") {
$order_names = $post['order_names'];
$order_number = $post['order_number'];
$order_jersey_size = $post['order_jersey_size'];
$order_shorts_size = $post['order_shorts_size'];
foreach ($order_names as $key => $val) {
if ($order_jersey_size[$key] == "none" || $order_shorts_size[$key] == "none") {
$final_price = $ProductPrice / 2;
} else {
$final_price = $ProductPrice;
}
$items[] = array(
'ProductId' => $product_id,
'StoreURL' => $store_url,
'StoreId' => $store_id,
'FormUsed' => $product_form,
'CartKey' => $cartKey,
'DesignCode' => $design_code,
'ProductURL' => $ProductURL,
'ProductName' => $product_name,
'Name' => $order_names[$key],
'Number' => $order_number[$key],
'JerseySize' => $order_jersey_size[$key],
'ShortsSize' => $order_shorts_size[$key],
'Price' => $final_price,
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
} elseif ($product_form == "tshirt-form") {
$items[] = array(
'ProductId' => $product_id,
'StoreURL' => $store_url,
'StoreId' => $store_id,
'FormUsed' => $product_form,
'CartKey' => $cartKey,
'DesignCode' => $design_code,
'ProductURL' => $ProductURL,
'ProductName' => $product_name,
'Size' => $post['uniformSize'],
'Price' => $ProductPrice,
'Quantity' => $post['quantity'],
'ShippingCostId' => $shipping_cost_id
);
} elseif ($product_form == "quantity-form") {
$items[] = array(
'ProductId' => $product_id,
'StoreURL' => $store_url,
'StoreId' => $store_id,
'FormUsed' => $product_form,
'CartKey' => $cartKey,
'DesignCode' => $design_code,
'ProductURL' => $ProductURL,
'ProductName' => $product_name,
'Price' => $ProductPrice,
'Quantity' => $post['quantity'],
'ShippingCostId' => $shipping_cost_id
);
} elseif ($product_form == "name-number-form") {
$order_names = $post['order_names'];
$order_number = $post['order_number'];
foreach ($order_names as $key => $val) {
$items[] = array(
'ProductId' => $product_id,
'StoreURL' => $store_url,
'StoreId' => $store_id,
'FormUsed' => $product_form,
'CartKey' => $cartKey,
'DesignCode' => $design_code,
'ProductURL' => $ProductURL,
'ProductName' => $product_name,
'Name' => $order_names[$key],
'Number' => $order_number[$key],
'Price' => $ProductPrice,
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
} elseif ($product_form == "name-number-size-form") {
$order_names = $post['order_names'];
$order_number = $post['order_number'];
$order_size = $post['order_size'];
foreach ($order_names as $key => $val) {
$items[] = array(
'ProductId' => $product_id,
'StoreURL' => $store_url,
'StoreId' => $store_id,
'FormUsed' => $product_form,
'CartKey' => $cartKey,
'DesignCode' => $design_code,
'ProductURL' => $ProductURL,
'ProductName' => $product_name,
'Name' => $order_names[$key],
'Size' => $order_size[$key],
'Number' => $order_number[$key],
'Price' => $ProductPrice,
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
} elseif ($product_form == "number-form") {
$order_number = $post['order_number'];
foreach ($order_number as $key => $val) {
$items[] = array(
'ProductId' => $product_id,
'StoreURL' => $store_url,
'StoreId' => $store_id,
'FormUsed' => $product_form,
'CartKey' => $cartKey,
'DesignCode' => $design_code,
'ProductURL' => $ProductURL,
'ProductName' => $product_name,
'Number' => $order_number[$key],
'Price' => $ProductPrice,
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
} elseif ($product_form == "name-name2-size-form") {
$order_names = $post['order_names'];
$order_names2 = $post['order_names2'];
$order_size = $post['order_size'];
foreach ($order_names as $key => $val) {
$items[] = array(
'ProductId' => $product_id,
'StoreURL' => $store_url,
'StoreId' => $store_id,
'FormUsed' => $product_form,
'CartKey' => $cartKey,
'DesignCode' => $design_code,
'ProductURL' => $ProductURL,
'ProductName' => $product_name,
'Name' => $order_names[$key],
'Name2' => $order_names2[$key],
'Size' => $order_size[$key],
'Price' => $ProductPrice,
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
} elseif ($product_form == "name-size-form") {
$order_names = $post['order_names'];
$order_size = $post['order_size'];
foreach ($order_names as $key => $val) {
$items[] = array(
'ProductId' => $product_id,
'StoreURL' => $store_url,
'StoreId' => $store_id,
'FormUsed' => $product_form,
'CartKey' => $cartKey,
'DesignCode' => $design_code,
'ProductURL' => $ProductURL,
'ProductName' => $product_name,
'Name' => $order_names[$key],
'Size' => $order_size[$key],
'Price' => $ProductPrice,
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
} elseif ($product_form == "jersey-and-shorts-quantity-form") {
$order_shorts_size = $post['order_shorts_size'];
$order_jersey_size = $post['order_jersey_size'];
$quantity = $post['quantity'];
foreach ($order_jersey_size as $key => $val) {
if ($order_jersey_size[$key] != "none" || $order_shorts_size[$key] != "none") {
if ($order_jersey_size[$key] == "none" || $order_shorts_size[$key] == "none") {
$final_price = $ProductPrice / 2;
} else {
$final_price = $ProductPrice;
}
$items[] = array(
'ProductId' => $product_id,
'StoreURL' => $store_url,
'StoreId' => $store_id,
'FormUsed' => $product_form,
'CartKey' => $cartKey,
'DesignCode' => $design_code,
'ProductURL' => $ProductURL,
'ProductName' => $product_name,
'JerseySize' => $order_jersey_size[$key],
'ShortsSize' => $order_shorts_size[$key],
'Price' => $final_price,
'Quantity' => $quantity[$key],
'ShippingCostId' => $shipping_cost_id
);
}
}
} elseif ($product_form == "number-jersey-shorts-form") {
$order_number = $post['order_number'];
$order_jersey_size = $post['order_jersey_size'];
$order_shorts_size = $post['order_shorts_size'];
foreach ($order_number as $key => $val) {
if ($order_jersey_size[$key] == "none" || $order_shorts_size[$key] == "none") {
$final_price = $ProductPrice / 2;
} else {
$final_price = $ProductPrice;
}
$items[] = array(
'ProductId' => $product_id,
'StoreURL' => $store_url,
'StoreId' => $store_id,
'FormUsed' => $product_form,
'CartKey' => $cartKey,
'DesignCode' => $design_code,
'ProductURL' => $ProductURL,
'ProductName' => $product_name,
'Number' => $order_number[$key],
'JerseySize' => $order_jersey_size[$key],
'ShortsSize' => $order_shorts_size[$key],
'Price' => $final_price,
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
}
$i = $m->insertToCart($items);
if ($i['i']) {
return response()->json(array(
'success' => true
));
}
return response()->json(array(
'success' => false,
'message' => "Something went wrong. Please refresh the page."
));
}
public function cart(Request $request)
{
$m = new TeamStoreModel;
$cartKey = $request->session()->get('cartkey');
$items = $m->myCart($cartKey);
$getSubtotal = $m->getSubtotal($cartKey);
$items_group = $m->myCartGroup($cartKey);
//var_dump($items_group);
$grouped_item = $m->selectTeamStoreGroupByCartKey($cartKey);
if ($grouped_item) {
$defId = $grouped_item[0]->StoreId;
} else {
$defId = 0;
}
$item_thumbs = $m->selectDisplayCartThumb();
$store_array = $m->selectTeamStore('Id', $defId);
if ($items) {
$voucherIds = array();
foreach ($items as $item) {
if ($item->VoucherId != null) {
$voucherIds[] = $item->VoucherId;
}
}
$vouchers = $m->selectVoucherWhereIn($voucherIds);
}
$totalValue = 0;
if (!empty($vouchers)) {
foreach ($vouchers as $voucher) {
$totalValue = $totalValue + $voucher->VoucherValue;
if ($voucher->VoucherType == "Percentage") {
$voucherData = array(
'totalValue' => $totalValue,
'type' => 'Percentage'
);
} else {
$voucherData = array(
'totalValue' => $totalValue,
'type' => 'Flat'
);
}
}
if ($voucherData['type'] == "Percentage") {
$getPercentageValue = $voucherData['totalValue'] / 100;
$getDiscountValue = ($getSubtotal[0]->Subtotal * $getPercentageValue);
$finalSubTotal = $getSubtotal[0]->Subtotal - $getDiscountValue;
} else {
//Flat voucher computation here..
}
} else {
$finalSubTotal = $getSubtotal[0]->Subtotal;
}
return view('sublayouts.cart')
->with('item_group', $items_group)
->with('row', $items)
->with('img_thumb', $item_thumbs)
->with('getSubtotal', $finalSubTotal)
->with('store_array', $store_array);
}
public function addVoucher(Request $request)
{
$cartKey = $request->session()->get('cartkey');
if ($cartKey == "") {
return false;
}
$TeamStoreModel = new TeamStoreModel;
$post = $request->all();
$grouped_item = $TeamStoreModel->selectTeamStoreGroupByCartKey($cartKey);
$store_id = $grouped_item[0]->StoreId;
$vocher = $post['voucher'];
$store_array = $TeamStoreModel->selectTeamStore('Id', $grouped_item[0]->StoreId);
$getSubtotal = $TeamStoreModel->getSubtotal($cartKey);
$data = array(
'store_id' => $store_id,
'voucher' => $vocher
);
$getVoucher = $TeamStoreModel->selectVoucher($data);
if ($getVoucher) {
$items = $TeamStoreModel->myCart($cartKey);
// check if if voucher is already in used;
foreach ($items as $item) {
if ($getVoucher[0]->Id == $item->VoucherId) {
return response()->json(array(
'success' => false,
'message' => 'This voucher is already in used.'
));
}
}
// insert vocuher to cart_tmp
$voucherData = array(
'VoucherId' => $getVoucher[0]->Id,
'StoreURL' => $store_array[0]->StoreUrl,
'StoreId' => $store_array[0]->Id,
'CartKey' => $cartKey,
'ProductName' => $getVoucher[0]->VoucherCode,
'Price' => '00.00',
'Quantity' => 1
);
$i = $TeamStoreModel->insertToCart($voucherData);
$lastId = $i['lastId'];
$removeItemURL = url('removeitem') . '/' . $lastId;
//get all voucher used.
$updated_items = $TeamStoreModel->myCart($cartKey);
foreach ($updated_items as $item) {
if ($item->VoucherId != null) {
$voucherIds[] = $item->VoucherId;
}
}
$vouchers = $TeamStoreModel->selectVoucherWhereIn($voucherIds);
$totalValue = 0;
if (!empty($vouchers)) {
foreach ($vouchers as $voucher) {
$totalValue = $totalValue + $voucher->VoucherValue;
if ($voucher->VoucherType == "Percentage") {
$voucherData = array(
'totalValue' => $totalValue,
'type' => 'Percentage'
);
} else {
$voucherData = array(
'totalValue' => $totalValue,
'type' => 'Flat'
);
}
}
if ($voucherData['type'] == "Percentage") {
$getPercentageValue = $voucherData['totalValue'] / 100;
$getDiscountValue = ($getSubtotal[0]->Subtotal * $getPercentageValue);
$finalSubTotal = $getSubtotal[0]->Subtotal - $getDiscountValue;
} else {
//Flat voucher computation here..
}
} else {
$finalSubTotal = $getSubtotal[0]->Subtotal;
}
if ($getVoucher[0]->VoucherType == "Percentage") {
$offData = $getVoucher[0]->VoucherValue . '%';
} else {
$offData = $getVoucher[0]->VoucherValue . ' ' . $store_array[0]->StoreCurrency;
}
$message = '<div class="btn-group">
<button type="button" class="btn btn-default btn-xs">' . $getVoucher[0]->VoucherCode . ' ' . $offData . ' OFF</button>
<button type="button" class="btn btn-default dropdown-toggle btn-xs" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only"></span>
</button>
<ul class="dropdown-menu">
<li><a href="' . $removeItemURL . '"><i class="fa fa-times"></i> Remove</a></li>
</ul>
</div>';
// return success
return response()->json(array(
'success' => true,
'message' => $message,
'subtotal' => $finalSubTotal
));
} else {
return response()->json(array(
'success' => false,
'message' => "Sorry, the voucher code is invalid. Please try again."
));
}
}
public function checkout(Request $request)
{
$m = new TeamStoreModel;
$cartKey = $request->session()->get('cartkey');
$usermodel = new UserModel;
$userId = Auth::user()->id;
$array_address_book = $usermodel->selectAddresBook('UserId', $userId);
// var_dump($array_address_book);
$items = $m->myCart($cartKey);
$getSubtotal = $m->getSubtotal($cartKey);
return view('sublayouts.checkout')
->with('row', $items)
->with('getSubtotal', $getSubtotal)
->with('array_address_book', $array_address_book);
}
public function mail()
{
// $user = User::find(1)->toArray();
// var_dump($user);
// Mail::send('emails.mailExample', $user, function($message) use ($user) {
// $message->to($user->email);
// $message->subject('E-Mail Example');
// });
// dd('Mail Send Successfully');
Mail::raw('Text to e-mail', function ($message) {
$message->from('us@example.com', 'Laravel');
$message->to('frank.begornia@yahoo.com')->subject('sample email');
});
}
}

File diff suppressed because it is too large Load Diff

37
app/Http/Kernel.php Normal file
View File

@@ -0,0 +1,37 @@
<?php namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel {
/**
* The application's global HTTP middleware stack.
*
* @var array
*/
protected $middleware = [
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
'Illuminate\Cookie\Middleware\EncryptCookies',
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
'Illuminate\Session\Middleware\StartSession',
'Illuminate\View\Middleware\ShareErrorsFromSession',
'App\Http\Middleware\VerifyCsrfToken',
];
/**
* The application's route middleware.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => 'App\Http\Middleware\Authenticate',
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
'teamstoresession' => 'App\Http\Middleware\CheckTeamStorePassword',
'admin' => '\App\Http\Middleware\IsAdmin',
'normaluser' => '\App\Http\Middleware\IsUser',
'isAuthorized' => '\App\Http\Middleware\isAuthorized',
'cors' => 'App\Http\Middleware\Cors',
];
}

View File

@@ -0,0 +1,50 @@
<?php namespace App\Http\Middleware;
use Closure;
use Illuminate\Contracts\Auth\Guard;
class Authenticate {
/**
* The Guard implementation.
*
* @var Guard
*/
protected $auth;
/**
* Create a new filter instance.
*
* @param Guard $auth
* @return void
*/
public function __construct(Guard $auth)
{
$this->auth = $auth;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($this->auth->guest())
{
if ($request->ajax())
{
return response('Unauthorized.', 401);
}
else
{
return redirect()->guest('auth/login');
}
}
return $next($request);
}
}

View File

@@ -0,0 +1,25 @@
<?php namespace App\Http\Middleware;
use Closure;
class CheckTeamStorePassword {
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (!$request->session()->has('teamstore_data_array')) {
// user value cannot be found in session
// return redirect('/teamstore');
}
return $next($request);
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Http\Middleware;
use Closure;
class Cors
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
header("Access-Control-Allow-Origin: *");
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
header("Access-Control-Allow-Headers: *");
// header('Access-Control-Allow-Credentials: true');
if (!$request->isMethod('options')) {
return $next($request);
}
}
}

View File

@@ -0,0 +1,23 @@
<?php namespace App\Http\Middleware;
use Closure;
use Auth;
class IsAdmin {
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (Auth::user() && Auth::user()->role == 'admin') {
return $next($request);
}
return redirect('/');
}
}

View File

@@ -0,0 +1,22 @@
<?php namespace App\Http\Middleware;
use Closure;
use Auth;
class IsUser {
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (Auth::user() && (Auth::user()->role == 'user' || Auth::user()->role == 'store_owner' )) {
return $next($request);
}
return redirect('/');
}
}

View File

@@ -0,0 +1,44 @@
<?php namespace App\Http\Middleware;
use Closure;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\RedirectResponse;
class RedirectIfAuthenticated {
/**
* The Guard implementation.
*
* @var Guard
*/
protected $auth;
/**
* Create a new filter instance.
*
* @param Guard $auth
* @return void
*/
public function __construct(Guard $auth)
{
$this->auth = $auth;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($this->auth->check())
{
return new RedirectResponse(url('/'));
}
return $next($request);
}
}

View File

@@ -0,0 +1,35 @@
<?php namespace App\Http\Middleware;
use Closure;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
class VerifyCsrfToken extends BaseVerifier {
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
protected $except = [
"api/*",
];
// public function handle($request, Closure $next)
// {
// return parent::handle($request, $next);
// }
public function handle($request, Closure $next)
{
foreach($this->except as $route) {
if ($request->is($route)) {
return $next($request);
}
}
return parent::handle($request, $next);
}
}

View File

@@ -0,0 +1,23 @@
<?php namespace App\Http\Middleware;
use Closure;
class isAuthorized {
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if(isset(getallheaders()['token']) && getallheaders()['token']=="1HHIaIsT4pvO2S39vMzlVfGWi3AhAz6F5xGBNKil") {
return $next($request);
}else{
return response()->json(['status' => false,'error' => "Invalid request"], 503);
}
}
}

View File

@@ -0,0 +1,9 @@
<?php namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
abstract class Request extends FormRequest {
//
}

193
app/Http/routes.php Normal file
View File

@@ -0,0 +1,193 @@
<?php
use Illuminate\Support\Facades\Route;
// use Spatie\LaravelAnalytics\LaravelAnalytics;
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
// Route::get('/', 'WelcomeController@index');
// Route::get('home', 'HomeController@index');
Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
]);
Route::get('/', 'MainController@index');
Route::get('/sportslist', 'MainController@sports');
Route::get('/sports/{url}', 'MainController@templatesCat');
Route::get('/sports/{url}/{id}', 'MainController@templatesByCategory');
Route::get('/templatelist', 'MainController@fetchTemplates');
Route::get('/cartcount', 'MainController@countCart');
Route::get('/removeitem/{id}', 'MainController@removeCartItem');
Route::post('/custom/auth', 'CustomAuthController@authenticate');
Route::post('/custom/register', 'CustomAuthController@postRegister');
// Route::get('/cart', 'teamstore\TeamStoreController@cart');
Route::get('cart', ['as' => 'cart', 'uses' => 'teamstore\TeamStoreController@cart']);
Route::get('/checkout', 'teamstore\TeamStoreController@checkout');
Route::get('/mail', 'teamstore\TeamStoreController@mail');
Route::get('/designer/{templateid}', 'designer\DesignerController@index');
Route::get('/designer/preview/{designCode}', 'designer\DesignerController@getDesign');
Route::post('/designer/a/buy-form', 'designer\DesignerController@buyForm');
//edit routes//
Route::get('/designer/edit/{designCode}', 'designer\DesignerController@editDesign');
//end edit routes//
// CUSTOMIZER DISPLAY
Route::post('/designer/a/save-roster', 'designer\DesignerController@saveRoster');
//END CUSTOMIZER DISPLAY
// Route::post('/designer/a/gradient-append', 'designer\DesignerController@gradientAppend');
// Route::post('/designer/a/set-pattern', 'designer\DesignerController@setPattern');
// Route::post('/designer/a/set-trim-pattern', 'designer\DesignerController@setTrimPattern');
// Route::post('/designer/a/get-template-default-colors', 'designer\DesignerController@getTemplateDefaultColors');
// Route::post('/designer/a/get-font-display', 'designer\DesignerController@getFontDisplay');
// Route::post('/designer/a/get-cliparts', 'designer\DesignerController@getCliparts');
// Route::post('/designer/a/clipart-properties', 'designer\DesignerController@clipartProperties');
// Route::post('/designer/a/save-design', 'designer\DesignerController@saveDesign');
// Route::post('/designer/edit/a/edit-gradient-append', 'designer\DesignerController@editGradientAppend');
// Route::post('/designer/edit/a/edit-pattern-properties', 'designer\DesignerController@editPatternProperties');
// Route::post('/designer/edit/a/edit-set-pattern', 'designer\DesignerController@editSetPattern');
// Route::get('/designer/a/tab-clipart-content', 'designer\DesignerController@tabClipartContent');
// Route::post('/designer/a/save-design-details', 'designer\DesignerController@saveDesignDetails');
// teamstore
Route::get('/', 'teamstore\TeamStoreController@login'); // old
Route::get('/', 'teamstore\TeamStoreController@storelist'); // old
// Route::group(['middleware' => 'teamstoresession'], function () {
Route::get('/store/{storename}', 'teamstore\TeamStoreController@index');
Route::get('/store/{storename}/product/{producurl}', 'teamstore\TeamStoreController@productDetails');
// Route::post('/teamstore/q/addnewrow', 'teamstore\TeamStoreController@addNewRow');
Route::post('/teamstore/q/add-to-cart', 'teamstore\TeamStoreController@addToCart');
Route::get('/teamstore/q/clearsession', 'teamstore\TeamStoreController@clearSession');
Route::post('/teamstore/q/add-voucher', 'teamstore\TeamStoreController@addVoucher');
Route::post('/teamstore/q/add-new-row', 'teamstore\TeamStoreController@addNewRow');
// });
Route::post('/teamstore/checkpassword', 'teamstore\TeamStoreController@checkTeamStorePassword');
// end teamstore
// user and store owner
Route::group(['middleware' => 'normaluser'], function () {
Route::get('user', 'user\UserController@index');
Route::get('user/address-book', 'user\UserController@addressBook');
Route::get('user/address-book/create', 'user\UserController@createAddressBook');
Route::post('user/address-book/save', 'user\UserController@saveAddressBook');
Route::get('user/address-book/edit/{id}', 'user\UserController@editAddressBook');
Route::post('user/address-book/update', 'user\UserController@updateAddressBook');
Route::get('user/profile', 'user\UserController@profile');
Route::get('user/profile/edit', 'user\UserController@editProfile');
Route::post('user/profile/update', 'user\UserController@updateProfile');
Route::get('user/profile/change-password', 'user\UserController@changePassword');
Route::post('user/profile/update-password', 'user\UserController@updatePassword');
Route::get('user/orders', 'user\UserController@orders');
Route::get('user/orders/view/{ck}', 'user\UserController@orderDetails');
Route::get('user/my-designs', 'user\UserController@myDesigns');
Route::get('user/my-designs/view/{id}', 'user\UserController@viewDesign');
Route::post('user/my-designs/update', 'user\UserController@updateDesignDetails');
Route::get('user/store', 'user\UserController@store');
Route::get('user/store-items', 'user\UserController@storeItems');
Route::get('user/store-items/item/{url}', 'user\UserController@viewStoreItem');
Route::post('user/store-items/update', 'user\UserController@storeItemUpdate');
Route::get('user/store-settings', 'user\UserController@storeSetting');
Route::post('user/store-settings/update', 'user\UserController@storeSettingUpdate');
Route::get('user/email-verify', 'user\UserController@emailVerify');
Route::post('user/post/resend-verification', 'user\UserController@resendVericationCode');
Route::post('user/post/verify-code', 'user\UserController@verifyCode');
Route::get('user/store-items/add-item', 'user\UserController@addStoreItem');
Route::post('user/store-items/save-new-item', 'user\UserController@saveNewItem');
Route::post('user/update-active-thumbnail', 'user\UserController@updateActiveThumbnail');
Route::post('user/post/save-thumbnail-ordering', 'user\UserController@saveThumbnailOrdering');
Route::post('user/post/save-item-ordering', 'user\UserController@saveItemOrdering');
Route::post('user/post/show-store-order-details', 'user\UserController@showStoreOrderDetails');
Route::post('user/post/delete-image-thumb', 'user\UserController@deleteImageThumb');
Route::post('user/store-items/save-new-item-image', 'user\UserController@saveNewItemImage');
Route::get('user/store-items/re-arrange', 'user\UserController@itemStoreReArrange');
Route::post('user/store-items/delete', 'user\UserController@deleteStoreItem');
Route::get('user/my-designs/sell-design/{designCode}', 'user\UserController@sellDesign');
Route::post('user/my-designs/addstoreitem', 'user\UserController@saveNewStoreItem');
Route::get('user/my-designs/buy-design/{designCode}', 'user\UserController@buyDesign');
Route::get('user/store-orders', 'user\UserController@storeOrders');
Route::get('user/announcement', 'user\UserController@announcementIndex');
Route::post('user/announcement/updateSave', 'user\UserController@announcementUpdateSave');
Route::post('user/announcement/status/update', 'user\UserController@announcementUpdateStatus');
});
Route::group(['middleware' => 'auth'], function () {
// PAYPAL ROUTES
Route::get('payPremium', ['as' => 'payPremium', 'uses' => 'paypal\PaypalController@payPremium']);
Route::get('getCheckout', ['as' => 'getCheckout', 'uses' => 'paypal\PaypalController@getCheckout']);
Route::get('getDone', ['as' => 'getDone', 'uses' => 'paypal\PaypalController@getDone']);
Route::get('getCancel', ['as' => 'getCancel', 'uses' => 'paypal\PaypalController@getCancel']);
Route::get('getDoneTest', ['as' => 'getDoneTest', 'uses' => 'paypal\PaypalController@getDoneTest']);
// END PAYPAL ROUTES
});
Route::group(['middleware' => 'admin'], function () {
Route::get('admin', function () {
return view('sub_pages.index');
});
Route::get('admin/sports/', 'SportsController@displayAllSports');
Route::get('admin/sports/add', 'SportsController@displayAddSportPage');
Route::post('admin/sports/save', 'SportsController@saveNewSports');
Route::get('admin/sports/edit/{sportsname}', 'SportsController@sportsDetails');
Route::post('admin/sports/update', 'SportsController@updateSports');
Route::get('admin/sports/sportsname', 'SportsController@selectSportsName');
Route::get('admin/templates/', 'TemplatesController@displayTemplates');
Route::post('admin/templates/id/{id}', 'TemplatesController@getTemplates');
Route::get('admin/templates/add', 'TemplatesController@displayAddTemplatePage');
Route::get('admin/templates/type', 'TemplatesController@getTemplateTypes');
Route::get('admin/templates/getlastid', 'TemplatesController@getLastId');
Route::post('admin/templates/save', 'TemplatesController@saveNewTemplates');
Route::get('admin/templates/edit/{tempcode}', 'TemplatesController@displayEditTemplatePage');
Route::post('admin/templates/update', 'TemplatesController@updateTemplate');
Route::get('admin/templates/edit/{tempcode}/p-add', 'PrintPatternController@displayAddPrintTemplatePage');
Route::get('admin/pattern/get', 'PatternsController@getPatterns');
Route::post('admin/pattern/get/withvalue', 'PatternsController@getPatternsWithPostValue');
Route::post('admin/print-template/save', 'PrintPatternController@savePrintPattern');
});
Route::get('cliparts/index', 'cliparts\ClipartsController@index');
// Route::get('analytics', function (){
// $analyticsData = LaravelAnalytics::getVisitorsAndPageViews(7);
// });
Route::group(array('middleware' => ['isAuthorized', 'cors'], 'prefix' => 'api'), function () {
Route::post('login', 'ApiController@login');
Route::post('insert', 'ApiController@insert');
Route::get('tracking', 'ApiController@getTrackingStatus');
Route::get('order-status', 'ApiController@getOrderStatus');
Route::get('steps', 'ApiController@getSteps');
});

152
app/Models/ApiModel.php Normal file
View File

@@ -0,0 +1,152 @@
<?php
namespace App\models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class ApiModel extends Model
{
function loginProductionUser($username, $password)
{
$i = DB::table('production_user')
->where('Username', $username)
->where('Password', $password)
->get();
return $i;
}
function selectTrackingStepLabel($id)
{
$i = DB::table('tracking_steps')->select('StepLabel')
->where('Id', $id)
->get();
return $i;
}
function getTrackingStatus($invoice)
{
$i = DB::table('tracking')->select('tracking.Id', 'tracking.InvoiceNumber', 'tracking_steps.StepLabel', 'production_user.Name', DB::raw('DATE_FORMAT(tracking.created_at, "%b %d, %Y") AS date'), DB::raw('DATE_FORMAT(tracking.created_at, "%H:%i") AS time'))
->leftjoin('tracking_steps', 'tracking_steps.Id', '=', 'tracking.StepId')
->leftjoin('production_user', 'production_user.Id', '=', 'tracking.ScannedBy')
->where('tracking.InvoiceNumber', '=', $invoice)
->orderBy('tracking.created_at', 'DESC')
->get();
return $i;
}
function selectPaymentDetails($invoice)
{
$i = DB::table('payment_details')
->where('InvoiceNumber', $invoice)
->get();
return $i;
}
function selectOrderList($cartKey)
{
$i = DB::table('orders')->select('ProductId', 'ProductName', 'CartKey')
->where('CartKey', $cartKey)
->groupBy('ProductId')
->get();
return $i;
}
function selectProductImages($productId)
{
$i = DB::table('teamstore_product_thumbnails')
->where('ProductId', $productId)
->get();
return $i;
}
function selectOrderListTableFields($cartKey, $productId, $stepid)
{
// $i = DB::table('orders')->select('Id', 'Name', 'Name2', 'Number', 'Size', 'JerseySize', 'ShortsSize', 'Quantity')
// ->where('CartKey', $cartKey)
// ->where('ProductId', $productId)
// ->get();
// return $i;
$i = DB::table('orders')->select('orders.Id', 'orders.Name', 'orders.Name2', 'orders.Number', 'orders.Size', 'orders.JerseySize',
'orders.ShortsSize', 'orders.Quantity', DB::raw('(SELECT COUNT(*) FROM tracking WHERE StepId = '.$stepid.' AND OrdersId = orders.Id) AS Status'))
// ->leftjoin('tracking', 'orders.Id', '=', 'tracking.OrdersId')
// ->where('tracking.StepId', $stepid)
->where('orders.CartKey', $cartKey)
->where('orders.ProductId', $productId)
->groupBy('orders.Id')
->get();
return $i;
}
function insertTracking($data)
{
$i = DB::table('tracking')->insert($data);
return $i;
}
// function selectNextStep($invoice)
// {
// $i = DB::table('tracking')->select('StepId')
// ->where('InvoiceNumber', $invoice)
// ->orderBy('StepId', 'DESC')->first();
// return $i;
// }
function checkIfTrackExist($stepid, $productid, $orderid, $invoice, $qcounter)
{
$i = DB::table('tracking')
->where('StepId', $stepid)
->where('ProductId', $productid)
->where('OrdersId', $orderid)
->where('InvoiceNumber', $invoice)
->where('QuantityCounter', $qcounter)
->get();
return $i;
}
function getCurrentTrackingSteps($invoice){
$i = DB::table('tracking')->select('StepId')
->where('InvoiceNumber', $invoice)
->groupBy('StepId')
->orderBy('StepId', 'ASC')
->get();
return $i;
}
function getStatus($invoice, $productid, $orderid, $qcounter){
$i = DB::table('tracking')->select('production_user.Name', DB::raw('DATE_FORMAT(tracking.created_at, "%b %d, %Y - %H:%i") AS datetime'))
->leftjoin('production_user', 'production_user.Id', '=', 'tracking.ScannedBy')
->where('tracking.InvoiceNumber', $invoice)
->where('tracking.ProductId', $productid)
->where('tracking.OrdersId', $orderid)
->where('tracking.QuantityCounter', $qcounter)
->get();
return $i;
}
function selectSteps(){
$i = DB::table('tracking_steps')
->orderBy('Order', 'ASC')
->get();
return $i;
}
function selectCurrentStep($invoice){
$i = DB::table('tracking')->select('tracking_steps.*')
->leftjoin('tracking_steps', 'tracking_steps.Id', '=', 'tracking.StepId')
->where('tracking.InvoiceNumber', $invoice)
->orderBy('tracking.StepId', 'DESC')
->first();
return $i;
}
function selectCurrentStepOrder($stepOrder){
$i = DB::table('tracking_steps')
->where('Order', $stepOrder)
->get();
return $i;
}
}

169
app/Models/MainModel.php Normal file
View File

@@ -0,0 +1,169 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class MainModel extends Model {
//
function selectAllSports() // display all data from database
{
$i = DB::table('sports')->get();
return $i;
}
function selectSportsByURL($url) // display all data from database
{
$i = DB::table('sports')
->where('URL', $url)
->get();
return $i;
}
function selectSportsTemplates($id) //
{
$i = DB::table('templates')->where('SportsId', '=', $id)->get();
return $i;
}
function selectSportsId($url) //
{
$i = DB::table('sports')->where('URL', '=', $url)->get();
$id = $i[0]->Id;
$k = DB::table('templates')->where('SportsId', '=', $id)
->where('IsActive','=', "TRUE")
->get();
return $k;
}
function selectStates() // display all data from database
{
$i = DB::table('states')->get();
return $i;
}
function selectAvailableNumbers($id) //
{
$i = DB::table('orders')->where('TeamId', '=', $id)->get();
return $i;
}
function selectSizes() //
{
$i = DB::table('sizes')->select('Size')->orderby('Ordering', 'ASC')->get();
return $i;
}
function selectProducts() //
{
$i = DB::table('products')->orderby('Ordering', 'ASC')->get();
return $i;
}
function insertToCart($data){
$i = DB::table('cart_tmp')->insert($data);
return $i;
}
function cartCount($cartkey){ //
$i = DB::table('cart_tmp')
->whereNull('VoucherId')
->where('CartKey', '=', $cartkey)
->sum('Quantity');
return $i;
}
function getProduct($ProductURL)
{
$i = DB::table('products')->where('ProductURL', $ProductURL)->first();
return $i;
}
function myCart($cartKey){
if($cartKey != ""){
$i = DB::table('cart_tmp')->select('cart_tmp.Id', 'cart_tmp.CartKey', 'teams.GradeLevel', 'teams.Team', 'cart_tmp.Name', 'cart_tmp.Number', 'cart_tmp.Size', 'cart_tmp.Quantity', 'products.ProductImage', 'products.ProductName', 'products.ProductPrice', 'products.ProductURL')
->leftjoin('products', 'cart_tmp.ProductURL','=','products.ProductURL')
->leftjoin('teams', 'cart_tmp.TeamId','=','teams.Id')
->where('cart_tmp.CartKey','=',$cartKey)
->get();
return $i;
}
}
function removeItem($id){
$i = DB::table('cart_tmp')->where('Id', $id)->delete();
return $i;
}
function insertRegistrantInfo($info){
$i = DB::table('registrant_info')->insert($info);
return $i;
}
function selectPurchaseProduct($cartKey){
$i = DB::table('cart_tmp')->select('cart_tmp.CartKey', 'products.ProductCategory', 'products.ProductImage', 'products.ProductName', 'products.ProductPrice', DB::raw('CONCAT(teams.GradeLevel," - ", teams.GradeLevel) AS Team'), 'cart_tmp.TeamId','cart_tmp.Name', 'cart_tmp.Number', 'sizes.Ordering', 'cart_tmp.Size')
->leftjoin('products', 'cart_tmp.ProductURL','=','products.ProductURL')
->leftjoin('teams', 'cart_tmp.TeamId','=','teams.Id')
->leftjoin('sizes', 'cart_tmp.Size','=','sizes.Size')
->orderby('sizes.Ordering', 'ASC')
->orderby('cart_tmp.Number', 'ASC')
->orderby('cart_tmp.Name', 'ASC')
->where('cart_tmp.CartKey','=',$cartKey)
->get();
return $i;
}
function insertPurchaseProduct($orders){
$i = DB::table('orders')->insert($orders);
return $i;
}
function flushCart($cartKey){
$i = DB::table('cart_tmp')->where('CartKey', $cartKey)->delete();
return $i;
}
function selectCategory($id){
$i = DB::table('template_categories')
->whereIn('Id', $id)
->get();
return $i;
}
function selectTemplatesByCategory($url, $cat) //
{
$i = DB::table('sports')->where('URL', '=', $url)->get();
$id = $i[0]->Id;
$k = DB::table('templates')->where('SportsId', '=', $id)
->where('Category','=', $cat)
->where('IsActive','=', "TRUE")
->get();
return $k;
}
function selectCategoryName($tempCode){
$i = DB::table('templates')->select('templates.TemplateCode', 'template_categories.Category','category_ports.Port')
->leftjoin('template_categories', 'templates.Category','=','template_categories.Id')
->leftjoin('category_ports', 'template_categories.Id','=','category_ports.CategoryId')
->where('templates.TemplateCode','=',$tempCode)
->get();
return $i;
}
}

View File

@@ -0,0 +1,14 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use DB;
class PatternsModel extends Model {
function selectAllPattern() // display all data from database
{
$i = DB::table('patterns')->orderBy('Id', 'ASC')->get();
return $i;
}
}

View File

@@ -0,0 +1,31 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use DB;
class PrintPatternModel extends Model {
function selectAllPrintTemplate($q) // display all data from database
{
// $i = DB::table('print_pattern_list')
// ->where('TemplateCode', $q)
// ->get();
$i = DB::table('print_pattern_list')->select('print_pattern_list.Id', 'print_pattern_list.TemplateCode', 'print_pattern_list.Path', 'print_pattern_list.Type', 'print_pattern_list.Size', 'print_pattern_list.DateCreated')
->leftjoin('sizes', 'sizes.Size','=','print_pattern_list.Size')
->where('print_pattern_list.TemplateCode','=',$q)
->orderBy('sizes.Ordering', 'ASC')
->get();
return $i;
}
function insertPrintPattern($data){
$i = DB::table('print_pattern_list')->insert($data);
return $i;
}
}

15
app/Models/SizesModel.php Normal file
View File

@@ -0,0 +1,15 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class SizesModel extends Model {
function selectAllSizes() // display all data from database
{
$i = DB::table('jersey_sizes')->get();
return $i;
}
}

View File

@@ -0,0 +1,35 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use DB;
class SportsModel extends Model {
//
function selectAllSports() // display all data from database
{
$i = DB::table('sports')->get();
return $i;
}
function insertToSports($data){
$i = DB::table('sports')->insert($data);
return $i;
}
function selectSports($q){
$i = DB::table('sports')->where('URL', '=', $q)->get();
return $i;
}
function upateSportsDetails($data, $id){
$i = DB::table('sports')->where('Id', $id)->update($data);
return $i;
}
function getSportsName() // display all data from database
{
$i = DB::table('sports')->select('Id', 'SportsName')->get();
return $i;
}
}

View File

@@ -0,0 +1,60 @@
<?php namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use DB;
class TemplatesModel extends Model {
function selectTemplates($id){
$i = DB::table('templates')->where('SportsId', '=', $id)->get();
return $i;
}
function selectTemplateTypes(){
$i = DB::table('template_types')->get();
return $i;
}
function selectTemplateLastId(){
$i = DB::table('templates')->orderBy('Id', 'DESC')->first();
return $i;
}
function insertNewTempalte($data){
$i = DB::table('templates')->insert($data);
return $i;
}
function insertTempaltePaths($data){
$i = DB::table('template_paths')->insert($data);
return $i;
}
function selectTemplate($tempCode){
$i = DB::table('templates')->where('TemplateCode', '=', $tempCode)->get();
return $i;
}
function selectTemplatePaths($tempCode){
$i = DB::table('template_paths')->where('TemplateCode', '=', $tempCode)->get();
return $i;
}
function updateNewTemplate($data, $templatecode){
$i = DB::table('templates')->where('TemplateCode', $templatecode)->update($data);
return $i;
}
function updateTemplatePaths($data, $Id){
// $i = DB::table('template_paths')->where([
// ['TemplateCode', '=', $templatecode],
// ['Type', '=', $data['Type']],
// ['Side', '=', $data['Side']]
// ])->update($data);
$i = DB::table('template_paths')->where('Id', '=', $Id)->update($data);
return $i;
}
}

View File

@@ -0,0 +1,9 @@
<?php namespace App\Models\cliparts;
use Illuminate\Database\Eloquent\Model;
class ClipartsModel extends Model {
//
}

View File

@@ -0,0 +1,144 @@
<?php namespace App\Models\designer;
use Illuminate\Database\Eloquent\Model;
use DB;
class DesignerModel extends Model {
function selectTemplate($templateid){
$i = DB::table('templates')->where('HashTemplateCode', $templateid)
->get();
return $i;
}
function selectTemplatePaths($templateid){
$i = DB::table('template_paths')
->where('HashTemplateCode', $templateid)
->where('IsActive', 'TRUE')
->get();
return $i;
}
function selectTemplatePathsByTemplateCode($templateid){
$i = DB::table('template_paths')->where('TemplateCode', $templateid)
->where('IsActive', 'TRUE')
->get();
return $i;
}
function selectPatterns($patternId){
$i = DB::table('patterns')->where('PatternId', $patternId)
->get();
return $i;
}
function selectPatternColors($patternId){
$i = DB::table('pattern_colors')->where('PatternId', $patternId)
->get();
return $i;
}
function selectDefaultTemplateColor($templateCode){
$pdo = DB::connection()->getPdo();
$query = $pdo->prepare("SELECT NULL AS RGBIndex, RGBColor AS default_Color, DisplayName FROM template_body_colors WHERE TemplateCode = '$templateCode' UNION SELECT TrimNumber, RGBColor AS default_Color, DisplayName FROM template_trim_colors WHERE TemplateCode = '$templateCode'");
$query->execute();
while($row=$query->fetch(\PDO::FETCH_OBJ)) {
if($row->RGBIndex == NULL){
$IndexName = "default_mainColor";
}else{
$IndexName = $row->RGBIndex;
}
$arr_default_mainColor[] = array(
$IndexName => $row->default_Color,
'h4_Trim_' . $IndexName => $row->DisplayName,
);
}
return $arr_default_mainColor;
}
function selectFontsByFontFamily($fontFamily){
$i = DB::table('fonts')->where('fontFamily', $fontFamily)
->get();
return $i;
}
function selectFonts(){
$i = DB::table('fonts')->get();
return $i;
}
function selectClipartCategories(){
$i = DB::table('clipart_categories')
->orderby('Ordering', 'ASC')
->get();
return $i;
}
function selectClipartByCategory($categortId){
$i = DB::table('cliparts')
->where('CategoryId', $categortId)
->get();
return $i;
}
function insertClientDesign($design_info){
$i = DB::table('client_designs')->insert($design_info);
return $i;
}
function selectClientDesign($designCode){
$i = DB::table('client_designs')
->where('DesignCode', $designCode)
->get();
return $i;
}
function selectProductURL($str){
$i = DB::table('teamstore_products')->select('ProductURL')
->get();
return $i;
}
function selectTeamStoreProductLastId(){
$i = DB::table('teamstore_products')->orderBy('Id', 'DESC')->first();
return $i;
}
function updateClientDesign($designName, $designCode){
$i = DB::table('client_designs')->where('DesignCode', $designCode)
->update(['DesignName' => $designName]);
return $i;
}
function selectPatternsByTable($table, $patternId){
$i = DB::table($table)->where('PatternId', $patternId)
->get();
return $i;
}
function getAvailableSizes($templateCode, $type){
$pdo = DB::connection()->getPdo();
$query = $pdo->prepare("SELECT ppl.Id, ppl.TemplateCode, ppl.Path, ppl.Type, ppl.Size, ppl.DateCreated, js.Size FROM print_pattern_list AS ppl LEFT JOIN sizes AS js ON js.Size = ppl.Size WHERE ppl.TemplateCode = '$templateCode' AND ppl.Type = '$type' ORDER BY js.Ordering ASC");
$query->execute();
while($row=$query->fetch(\PDO::FETCH_OBJ)) {
$arr_size[] = $row->Size;
}
return $arr_size;
}
function getDefaultPrice($size, $type){
$i = DB::table('default_prices')
->where('Size', $size)
->where('Type', $type)
->get();
return $i;
}
}

View File

@@ -0,0 +1,41 @@
<?php namespace App\Models\paypal;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class PayPalModel extends Model {
function insertToPaypalDetails($data){
$i = DB::table('payment_details')->insertGetId($data);
return $i;
}
function insertToOrders($ck){
// $i = DB::table('orders')->insert($data);
$pdo = DB::connection()->getPdo();
$query = $pdo->prepare("INSERT INTO orders SELECT * FROM cart_tmp where CartKey = '$ck'");
$i = $query->execute();
return $i;
}
function insertShippingAddress($data){
$i = DB::table('shipping_addresses')->insert($data);
return $i;
}
function getLastIdPaymentDetails(){
$i = DB::table('payment_details')
->orderby('Id', 'DESC')
->take(1)
->get();
// var_dump($i);
return $i;
}
}

View File

@@ -0,0 +1,231 @@
<?php namespace App\Models\teamstore;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class TeamStoreModel extends Model {
function selectAllTeamStore() // display all data from database
{
$i = DB::table('teamstores')
->where("IsActive", "true")
->orderBy('Id', 'DESC')
->paginate(16);
return $i;
}
function selectTeamStoreProducts($field, $teamstoreId) // display all data from database
{
$i = DB::table('teamstore_products')
->where($field, $teamstoreId)
->orderBy('Ordering', 'ASC')
->orderBy('Ordering', 'ASC')->get();
return $i;
}
function selectTeamStoreProductByIdHash($id)
{
$i = DB::table('teamstore_products')
->where(DB::raw('md5(Id)') , $id)
->get();
return $i;
}
function selectTeamStore($field, $teamstoreURL)
{
$i = DB::table('teamstores')
->where($field, $teamstoreURL)
->get();
return $i;
}
function checkStorePassword($storeid, $password)
{
$i = DB::table('teamstores')
->where('Id', $storeid)
->where('Password', $password)
->get();
return $i;
}
function selectTeamStoreGroupByCartKey($cartKey)
{
$i = DB::table('cart_tmp')
->where('CartKey', $cartKey)
->groupby('CartKey')
->get();
return $i;
}
function getProductThumbnails($productId){
$i = DB::table('teamstore_product_thumbnails')
->where('ProductId', $productId)
->orderby('Ordering', 'ASC')
->get();
return $i;
}
function insertTeamStoreProduct($item_details){
$i = DB::table('teamstore_products')->insert($item_details);
$id = DB::getPdo()->lastInsertId();
return array(
'i' => $i,
'lastId' => $id
);
}
function insertTeamStoreProductThumbnails($item_details){
$i = DB::table('teamstore_product_thumbnails')->insert($item_details);
return $i;
}
function getThumbnails($productId){
$i = DB::table('teamstore_product_thumbnails')
->where('ProductId', $productId)
->orderby('Ordering', 'ASC')
->get();
return $i;
}
function getTeams($productId){
$i = DB::table('teams')->where('ProductId', $productId)->get();
return $i;
}
function getSizes(){
$i = DB::table('sizes')
->where('IsActive', 'TRUE')
->orderby('Ordering', 'ASC')
->get();
return $i;
}
function getSizesByBracket($bracket){
$i = DB::table('sizes')->select('Size', 'SizeDisplay')
->where('Bracket', $bracket)
->where('IsActive', 'TRUE')
->orderby('Ordering', 'ASC')
->get();
return $i;
}
function insertToCart($data){
$i = DB::table('cart_tmp')->insert($data);
$id = DB::getPdo()->lastInsertId();
return array(
'i' => $i,
'lastId' => $id
);
// return $i;
}
function selectDisplayCartThumb(){
$i = DB::table('teamstore_product_thumbnails')
->where('ImageClass', 'active')
->get();
return $i;
}
function myCart($cartKey){
// echo $cartKey;
if($cartKey != ""){
$i = DB::table('cart_tmp')
->leftjoin('teamstore_voucher', 'cart_tmp.VoucherId', '=', 'teamstore_voucher.Id')
->select('cart_tmp.*', 'teamstore_voucher.VoucherCode', 'teamstore_voucher.VoucherType', 'teamstore_voucher.VoucherValue', 'teamstore_voucher.VoucherExpiryDate', 'teamstore_voucher.Status')
->where('cart_tmp.CartKey', $cartKey)
->get();
// var_dump($i);
return $i;
}
}
function myCartGroup($cartKey){
if($cartKey != ""){
$pdo = DB::connection()->getPdo();
$query = $pdo->prepare("SELECT *, COUNT(Id) AS qty, Price * SUM(Quantity) AS total_price FROM cart_tmp WHERE CartKey = :ck GROUP BY ProductId");
$query->execute([':ck'=>$cartKey]);
$row = $query->fetchAll(\PDO::FETCH_OBJ);
return $row;
}
}
function getSubtotal($cartKey){
$i = DB::table('cart_tmp')->select(DB::raw('SUM(Quantity * Price) AS Subtotal'))
->where('CartKey','=',$cartKey)
->get();
return $i;
}
function updateStoreItem($data, $url){
$i = DB::table('teamstore_products')->where('ProductURL', $url)
->update($data);
return $i;
}
function getSoldQty($productId){
$i = DB::table('orders')->select(DB::raw('SUM(Quantity) AS SoldQty'))
->where('ProductId', $productId)
->get();
return $i;
}
function selectVoucher($data){
$i = DB::table('teamstore_voucher')
->where(DB::raw('BINARY `VoucherCode`'), $data['voucher'])
->where('TeamStoreId', $data['store_id'])
->get();
return $i;
}
function selectVoucherWhereIn($data){
$i = DB::table('teamstore_voucher')
->whereIn('Id', $data)
->get();
return $i;
}
function updateVoucherValueInCart($data, $id){
$i = DB::table('cart_tmp')
->where('Id', $id)
->update($data);
return $i;
}
function selectTeamstoreSearch($field, $value, $keyword){
$i = DB::table('teamstores')
->where("StoreName", "LIKE","%$keyword%")
->where("IsActive", "true")
->orderby($field, $value)
->paginate(16);
return $i;
}
function selectTeamstoreFilter($field, $value){
$i = DB::table('teamstores')
->where("IsActive", "true")
->orderby($field, $value)
->paginate(16);
return $i;
}
}

View File

@@ -0,0 +1,384 @@
<?php namespace App\Models\user;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class UserModel extends Model {
function insertAddressBook($data){
$i = DB::table('user_address_book')->insert($data);
return $i;
}
function selectAddresBook($field, $userId){
$i = DB::table('user_address_book')
->where($field,'=',$userId)
->get();
return $i;
}
function saveUpdateAddressBook($data, $id){
$i = DB::table('user_address_book')->where('Id', $id)
->update($data);
return $i;
}
function selectProfileInfo($id){
$i = DB::table('user_logins')->select('user_logins.name', 'user_logins.username', 'user_logins.email', 'user_logins.email_is_verified','user_logins.other_email', 'user_logins.role', 'user_logins.store_id', 'user_info.ContactNumber', 'user_info.Gender', 'user_info.Birthday')
->leftjoin('user_info', 'user_info.UserId','=','user_logins.id')
->where('user_logins.id','=',$id)
->get();
return $i;
}
function saveUpdateUserLogins($data, $id){
$i = DB::table('user_logins')->where('id', $id)
->update($data);
return $i;
}
function saveUpdateUserInfo($data, $id){
$exists = DB::table('user_info')->where('UserId', $id)->first();
if(!$exists){
$i = DB::table('user_info')->insert($data);
}else{
$i = DB::table('user_info')
->where('UserId', $id)
->update($data);
}
return $i;
}
function saveUpdatePassword($password, $id){
$i = DB::table('user_logins')->where('id', $id)
->update(['password' => $password]);
return $i;
}
function selectPaymentDetails($field, $val){
$i = DB::table('payment_details')
->where($field, $val)
->get();
return $i;
}
function selectClientDesigns($userid){
$i = DB::table('client_designs')->where('ClientId', $userid)
->orderBy('Id', 'DESC')
->paginate(12) ;
return $i;
}
function selectClientDesignsbyCode($code){
$i = DB::table('client_designs')->where('DesignCode', $code)
->get();
return $i;
}
function selectTemplatePaths($field, $templateid){
$i = DB::table('template_paths')
->where($field, $templateid)
->where('IsActive', 'TRUE')
->get();
return $i;
}
function updateClientDesign($data, $id){
$i = DB::table('client_designs')->where('DesignCode', $id)
->update($data);
return $i;
}
function selectStoreInfo($storeId){
$i = DB::table('teamstores')->where('Id', $storeId)
->get();
return $i;
}
function saveResendCode($data){
$res = DB::table('email_verification_codes')->where("EmailAddress", $data['EmailAddress'])
->get();
if($res){
$i = DB::table('email_verification_codes')->where('EmailAddress', $data['EmailAddress'])
->update($data);
return $i;
}else{
$i = DB::table('email_verification_codes')->insert($data);
return $i;
}
}
function validateCode($data){
$i = DB::table('email_verification_codes')->where('EmailAddress', $data['EmailAddress'])
->where('VerCode', $data['Code'])
->get();
return $i;
}
function selectOrderItem($ck){
$i = DB::table('orders')
->where('CartKey', $ck)
->get();
return $i;
}
function selectOrderItemWithStoreId($store_id, $ck){
$i = DB::table('orders')
->where('StoreId', $store_id)
->where('CartKey', $ck)
->get();
return $i;
}
function selectOrder($field, $value){
$i = DB::table('orders')
->where($field, $value)
->get();
return $i;
}
// function selectStoreOrders($store_id){
// $i = DB::table('orders')->select('orders.*', 'orders.Id as Order_Id', 'payment_details.InvoiceNumber', 'payment_details.Currency', 'payment_details.Payer_Email', 'payment_details.Payer_Firstname', 'payment_details.Payer_Lastname', 'shipping_addresses.*', 'tracking_steps.StepLabel')
// ->leftjoin('payment_details', 'payment_details.CartKey','=','orders.CartKey')
// ->leftjoin('shipping_addresses', 'shipping_addresses.PaymentDetail_Id','=','payment_details.Id')
// ->leftjoin('tracking', 'tracking.InvoiceNumber','=','payment_details.InvoiceNumber')
// ->leftjoin('tracking_steps', 'tracking_steps.Id','=','tracking.StepId')
// ->where('orders.StoreId', $store_id)
// ->orderby('orders.DateCreated', 'DESC')
// ->get();
// return $i;
// }
function selectStoreOrders($store_id){
$i = DB::table('orders')->select('orders.*', 'orders.Id as Order_Id', 'payment_details.InvoiceNumber', 'payment_details.Currency', 'payment_details.Payer_Email', 'payment_details.Payer_Firstname', 'payment_details.Payer_Lastname', 'shipping_addresses.*', DB::raw('(SELECT tracking_steps.StepLabel FROM tracking LEFT JOIN tracking_steps ON tracking_steps.Id = tracking.StepId WHERE tracking.InvoiceNumber = payment_details.InvoiceNumber ORDER BY tracking.Id DESC LIMIT 1 ) AS StepLabel'))
->leftjoin('payment_details', 'payment_details.CartKey','=','orders.CartKey')
->leftjoin('shipping_addresses', 'shipping_addresses.PaymentDetail_Id','=','payment_details.Id')
->where('orders.StoreId', $store_id)
->orderby('orders.DateCreated', 'DESC')
->get();
return $i;
}
function itemGroup($cartKey){
$pdo = DB::connection()->getPdo();
$query = $pdo->prepare("SELECT *, COUNT(Id) AS qty, Price * SUM(Quantity) AS total_price FROM orders WHERE CartKey = :ck GROUP BY ProductId");
$query->execute([':ck'=>$cartKey]);
$row = $query->fetchAll(\PDO::FETCH_OBJ);
return $row;
}
function itemGroupWithStoreId($store_id, $cartKey){
$pdo = DB::connection()->getPdo();
$query = $pdo->prepare("SELECT *, COUNT(Id) AS qty, Price * SUM(Quantity) AS total_price FROM orders WHERE StoreId= :si AND CartKey = :ck GROUP BY ProductId");
$query->execute(array(':si'=>$store_id, ':ck'=>$cartKey));
$row = $query->fetchAll(\PDO::FETCH_OBJ);
return $row;
}
function selectDisplayItemThumb(){
$i = DB::table('teamstore_product_thumbnails')
->where('ImageClass', 'active')
->orderby('Ordering', 'ASC')
->get();
return $i;
}
function selectDisplayItemThumbById($id){
$i = DB::table('teamstore_product_thumbnails')
->where('ProductId', $id)
->where('ImageClass', 'active')
->get();
return $i;
}
function deleteImageThumb($field, $id){
$i = DB::table('teamstore_product_thumbnails')
->where($field, $id)
->delete();
return $i;
}
function deleteStoreItem($id){
$i = DB::table('teamstore_products')
->where('Id', $id)
->delete();
$this->deleteImageThumb('ProductId', $id);
return $i;
}
function selectItemsStoreId($ck){
$i = DB::table('cart_tmp')
->select(DB::raw('StoreId'))
->where('CartKey', $ck)
->groupby('StoreId')
->get();
return $i;
}
function selectUserLogins($field, $value){
$i = DB::table('user_logins')
->where($field, $value)
->get();
return $i;
}
function insertNewProduct($data){
$pdo = DB::connection()->getPdo();
$i = DB::table('teamstore_products')->insert($data);
$id = DB::getPdo()->lastInsertId();
return $id;
}
function insertNewProductThumbnails($data){
$i = DB::table('teamstore_product_thumbnails')->insert($data);
return $i;
}
function updateProductCode($data, $id){
$i = DB::table('teamstore_products')->where('Id', $id)
->update($data);
return $i;
}
function selectTeamStoreName($ck){
$pdo = DB::connection()->getPdo();
$query = $pdo->prepare("SELECT t.Id, t.StoreName FROM orders AS o INNER JOIN teamstores AS t ON t.Id = o.StoreId WHERE o.CartKey = :ck GROUP BY o.StoreId ORDER BY t.StoreName ASC");
$query->execute(array(':ck'=>$ck));
$row = $query->fetchAll(\PDO::FETCH_OBJ);
return $row;
}
function updateActiveThumb($id, $product_id){
DB::table('teamstore_product_thumbnails')->where('ProductId', $product_id)
->update(['ImageClass' => null]);
$i = DB::table('teamstore_product_thumbnails')->where('Id', $id)
->update(['ImageClass' => 'active']);
}
function updateThumbnailOrdering($order, $id){
$i = DB::table('teamstore_product_thumbnails')->where('Id', $id)
->update(['Ordering' => $order]);
}
function updateItemOrdering($order, $id){
$i = DB::table('teamstore_products')->where('Id', $id)
->update(['Ordering' => $order]);
}
function updateTeamstore($id, $data){
$i = DB::table('teamstores')
->where("Id", $id)
->update($data);
return $i;
}
function selectShippingAddress($field, $value){
$i = DB::table('shipping_addresses')
->where($field, $value)
->get();
return $i;
}
function selectUserLoginsWhereIn($ids){
$i = DB::table('user_logins')
->whereIn('store_id', $ids)
->get();
return $i;
}
function selectShippingCost(){
$i = DB::table('shipping_cost')
->get();
return $i;
}
function countStoreOrder($storeId){
$pdo = DB::connection()->getPdo();
$query = $pdo->prepare("SELECT SUM(o.Quantity) AS count_order FROM orders AS o WHERE o.StoreId = :storeId");
$query->execute([':storeId'=>$storeId]);
$row = $query->fetchAll(\PDO::FETCH_OBJ);
return $row;
}
function storeIncome($storeId){
$pdo = DB::connection()->getPdo();
$query = $pdo->prepare("SELECT SUM(o.Price) AS store_income FROM orders AS o WHERE o.StoreId = :storeId");
$query->execute([':storeId'=>$storeId]);
$row = $query->fetchAll(\PDO::FETCH_OBJ);
return $row;
}
function countStoreProduct($storeId){
$pdo = DB::connection()->getPdo();
$query = $pdo->prepare("SELECT COUNT(Id) AS store_product_count FROM teamstore_products AS tp WHERE tp.TeamStoreId = :storeId");
$query->execute([':storeId'=>$storeId]);
$row = $query->fetchAll(\PDO::FETCH_OBJ);
return $row;
}
function countStorePublishedProduct($storeId){
$pdo = DB::connection()->getPdo();
$query = $pdo->prepare("SELECT COUNT(Id) AS store_published_product FROM teamstore_products AS tp WHERE tp.TeamStoreId = :storeId AND PrivacyStatus = 'public'");
$query->execute([':storeId'=>$storeId]);
$row = $query->fetchAll(\PDO::FETCH_OBJ);
return $row;
}
function getAnnouncement($storeId){
$i = DB::table('store_announcement')
->where('StoreId', $storeId)
->get();
return $i;
}
function saveNewAnnouncement($data){
$i = DB::table('store_announcement')
->insert($data);
return $i;
}
function updateAnnouncement($id, $data){
$i = DB::table('store_announcement')
->where('Id', $id)
->update($data);
return $i;
}
}

View File

@@ -0,0 +1,44 @@
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Storage;
use League\Flysystem\Filesystem;
use League\Flysystem\Sftp\SftpAdapter;
class AppServiceProvider extends ServiceProvider {
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
\Blade::extend(function($value) {
return preg_replace('/\@define(.+)/', '<?php ${1}; ?>', $value);
});
Storage::extend('sftp', function ($app, $config) {
return new Filesystem(new SftpAdapter($config));
});
}
/**
* Register any application services.
*
* This service provider is a great spot to register your various container
* bindings with the application. As you can see, we are registering our
* "Registrar" implementation here. You can add your own bindings too!
*
* @return void
*/
public function register()
{
$this->app->bind(
'Illuminate\Contracts\Auth\Registrar',
'App\Services\Registrar'
);
}
}

View File

@@ -0,0 +1,34 @@
<?php namespace App\Providers;
use Illuminate\Bus\Dispatcher;
use Illuminate\Support\ServiceProvider;
class BusServiceProvider extends ServiceProvider {
/**
* Bootstrap any application services.
*
* @param \Illuminate\Bus\Dispatcher $dispatcher
* @return void
*/
public function boot(Dispatcher $dispatcher)
{
$dispatcher->mapUsing(function($command)
{
return Dispatcher::simpleMapping(
$command, 'App\Commands', 'App\Handlers\Commands'
);
});
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}

View File

@@ -0,0 +1,23 @@
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class ConfigServiceProvider extends ServiceProvider {
/**
* Overwrite any vendor / package configuration.
*
* This service provider is intended to provide a convenient location for you
* to overwrite any "vendor" or package configuration that you may want to
* modify before the application handles the incoming request / command.
*
* @return void
*/
public function register()
{
config([
//
]);
}
}

View File

@@ -0,0 +1,32 @@
<?php namespace App\Providers;
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider {
/**
* The event handler mappings for the application.
*
* @var array
*/
protected $listen = [
'event.name' => [
'EventListener',
],
];
/**
* Register any other events for your application.
*
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
*/
public function boot(DispatcherContract $events)
{
parent::boot($events);
//
}
}

View File

@@ -0,0 +1,44 @@
<?php namespace App\Providers;
use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider {
/**
* This namespace is applied to the controller routes in your routes file.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function boot(Router $router)
{
parent::boot($router);
//
}
/**
* Define the routes for the application.
*
* @param \Illuminate\Routing\Router $router
* @return void
*/
public function map(Router $router)
{
$router->group(['namespace' => $this->namespace], function($router)
{
require app_path('Http/routes.php');
});
}
}

View File

@@ -0,0 +1,54 @@
<?php namespace App\Services;
use App\User;
use Validator;
use Illuminate\Contracts\Auth\Registrar as RegistrarContract;
use App\Traits\CaptchaTrait;
class Registrar implements RegistrarContract {
use CaptchaTrait;
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
public function validator(array $data)
{
$data['captcha'] = $this->captchaCheck();
return Validator::make($data, [
'name' => 'required|max:255',
'username' => 'required|max:255|unique:user_logins',
'email' => 'required|email|max:255|unique:user_logins',
'password' => 'required|confirmed|min:6',
'g-recaptcha-response' => 'required',
'captcha' => 'required|min:1'
],
[
'g-recaptcha-response.required' => 'Captcha is required',
'captcha.min' => 'Wrong captcha, please try again.'
]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return User
*/
public function create(array $data)
{
return User::create([
'name' => $data['name'],
'username' => $data['username'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
'role' => 'user'
]);
}
}

View File

@@ -0,0 +1,25 @@
<?php namespace App\Traits;
use Input;
use ReCaptcha\ReCaptcha;
trait CaptchaTrait {
public function captchaCheck()
{
$response = Input::get('g-recaptcha-response');
$remoteip = $_SERVER['REMOTE_ADDR'];
$secret = env('CAPTCHA_SECRET_KEY');
$recaptcha = new ReCaptcha($secret);
$resp = $recaptcha->verify($response, $remoteip);
if ($resp->isSuccess()) {
return 1;
} else {
return 0;
}
}
}

34
app/User.php Normal file
View File

@@ -0,0 +1,34 @@
<?php namespace App;
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract {
use Authenticatable, CanResetPassword;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'user_logins';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['name', 'username', 'email', 'password', 'role'];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = ['password', 'remember_token'];
}

51
artisan Normal file
View File

@@ -0,0 +1,51 @@
#!/usr/bin/env php
<?php
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/
$kernel = $app->make('Illuminate\Contracts\Console\Kernel');
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);
/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running. We will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
*/
$kernel->terminate($input, $status);
exit($status);

55
bootstrap/app.php Normal file
View File

@@ -0,0 +1,55 @@
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/
$app = new Illuminate\Foundation\Application(
realpath(__DIR__.'/../')
);
/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
$app->singleton(
'Illuminate\Contracts\Http\Kernel',
'App\Http\Kernel'
);
$app->singleton(
'Illuminate\Contracts\Console\Kernel',
'App\Console\Kernel'
);
$app->singleton(
'Illuminate\Contracts\Debug\ExceptionHandler',
'App\Exceptions\Handler'
);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
return $app;

35
bootstrap/autoload.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Composer Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Include The Compiled Class File
|--------------------------------------------------------------------------
|
| To dramatically increase your application's performance, you may use a
| compiled class file which contains all of the classes commonly used
| by a request. The Artisan "optimize" is used to create this file.
|
*/
$compiledPath = __DIR__.'/../vendor/compiled.php';
if (file_exists($compiledPath))
{
require $compiledPath;
}

51
composer.json Normal file
View File

@@ -0,0 +1,51 @@
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"laravel/framework": "5.0.*",
"webpatser/laravel-uuid": "^2.0",
"netshell/paypal": "dev-master",
"guzzlehttp/guzzle": "~5.0",
"google/recaptcha": "~1.1",
"spatie/laravel-analytics": "^1.4",
"league/flysystem-sftp": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php -r \"copy('.env.example', '.env');\"",
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}

3913
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

210
config/app.php Normal file
View File

@@ -0,0 +1,210 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => env('APP_DEBUG'),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => 'http://localhost',
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY', 'SomeRandomString'),
'cipher' => MCRYPT_RIJNDAEL_128,
/*
|--------------------------------------------------------------------------
| Logging Configuration
|--------------------------------------------------------------------------
|
| Here you may configure the log settings for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Settings: "single", "daily", "syslog", "errorlog"
|
*/
'log' => 'daily',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
'Illuminate\Bus\BusServiceProvider',
'Illuminate\Cache\CacheServiceProvider',
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
'Illuminate\Routing\ControllerServiceProvider',
'Illuminate\Cookie\CookieServiceProvider',
'Illuminate\Database\DatabaseServiceProvider',
'Illuminate\Encryption\EncryptionServiceProvider',
'Illuminate\Filesystem\FilesystemServiceProvider',
'Illuminate\Foundation\Providers\FoundationServiceProvider',
'Illuminate\Hashing\HashServiceProvider',
'Illuminate\Mail\MailServiceProvider',
'Illuminate\Pagination\PaginationServiceProvider',
'Illuminate\Pipeline\PipelineServiceProvider',
'Illuminate\Queue\QueueServiceProvider',
'Illuminate\Redis\RedisServiceProvider',
'Illuminate\Auth\Passwords\PasswordResetServiceProvider',
'Illuminate\Session\SessionServiceProvider',
'Illuminate\Translation\TranslationServiceProvider',
'Illuminate\Validation\ValidationServiceProvider',
'Illuminate\View\ViewServiceProvider',
/*
* Application Service Providers...
*/
'App\Providers\AppServiceProvider',
'App\Providers\BusServiceProvider',
'App\Providers\ConfigServiceProvider',
'App\Providers\EventServiceProvider',
'App\Providers\RouteServiceProvider',
/*
* Paypal
*/
'Netshell\Paypal\PaypalServiceProvider',
/*
* Google analytics
*/
'Spatie\LaravelAnalytics\LaravelAnalyticsServiceProvider',
],
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'App' => 'Illuminate\Support\Facades\App',
'Artisan' => 'Illuminate\Support\Facades\Artisan',
'Auth' => 'Illuminate\Support\Facades\Auth',
'Blade' => 'Illuminate\Support\Facades\Blade',
'Bus' => 'Illuminate\Support\Facades\Bus',
'Cache' => 'Illuminate\Support\Facades\Cache',
'Config' => 'Illuminate\Support\Facades\Config',
'Cookie' => 'Illuminate\Support\Facades\Cookie',
'Crypt' => 'Illuminate\Support\Facades\Crypt',
'DB' => 'Illuminate\Support\Facades\DB',
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
'Event' => 'Illuminate\Support\Facades\Event',
'File' => 'Illuminate\Support\Facades\File',
'Hash' => 'Illuminate\Support\Facades\Hash',
'Input' => 'Illuminate\Support\Facades\Input',
'Inspiring' => 'Illuminate\Foundation\Inspiring',
'Lang' => 'Illuminate\Support\Facades\Lang',
'Log' => 'Illuminate\Support\Facades\Log',
'Mail' => 'Illuminate\Support\Facades\Mail',
'Password' => 'Illuminate\Support\Facades\Password',
'Queue' => 'Illuminate\Support\Facades\Queue',
'Redirect' => 'Illuminate\Support\Facades\Redirect',
'Redis' => 'Illuminate\Support\Facades\Redis',
'Request' => 'Illuminate\Support\Facades\Request',
'Response' => 'Illuminate\Support\Facades\Response',
'Route' => 'Illuminate\Support\Facades\Route',
'Schema' => 'Illuminate\Support\Facades\Schema',
'Session' => 'Illuminate\Support\Facades\Session',
'Storage' => 'Illuminate\Support\Facades\Storage',
'URL' => 'Illuminate\Support\Facades\URL',
'Validator' => 'Illuminate\Support\Facades\Validator',
'View' => 'Illuminate\Support\Facades\View',
'Paypal' => 'Netshell\Paypal\Facades\Paypal',
'Analytics' => 'Spatie\LaravelAnalytics\LaravelAnalyticsFacade',
],
];

67
config/auth.php Normal file
View File

@@ -0,0 +1,67 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Authentication Driver
|--------------------------------------------------------------------------
|
| This option controls the authentication driver that will be utilized.
| This driver manages the retrieval and authentication of the users
| attempting to get access to protected areas of your application.
|
| Supported: "database", "eloquent"
|
*/
'driver' => 'eloquent',
/*
|--------------------------------------------------------------------------
| Authentication Model
|--------------------------------------------------------------------------
|
| When using the "Eloquent" authentication driver, we need to know which
| Eloquent model should be used to retrieve your users. Of course, it
| is often just the "User" model but you may use whatever you like.
|
*/
'model' => 'App\User',
/*
|--------------------------------------------------------------------------
| Authentication Table
|--------------------------------------------------------------------------
|
| When using the "Database" authentication driver, we need to know which
| table should be used to retrieve your users. We have chosen a basic
| default value but you may easily change it to any table you like.
|
*/
'table' => 'users',
/*
|--------------------------------------------------------------------------
| Password Reset Settings
|--------------------------------------------------------------------------
|
| Here you may set the options for resetting passwords including the view
| that is your password reset e-mail. You can also set the name of the
| table that maintains all of the reset tokens for your application.
|
| The expire time is the number of minutes that the reset token should be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/
'password' => [
'email' => 'emails.password',
'table' => 'password_resets',
// 'expire' => 60,
],
];

79
config/cache.php Normal file
View File

@@ -0,0 +1,79 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
*/
'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
*/
'stores' => [
'apc' => [
'driver' => 'apc'
],
'array' => [
'driver' => 'array'
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
],
'file' => [
'driver' => 'file',
'path' => storage_path().'/framework/cache',
],
'memcached' => [
'driver' => 'memcached',
'servers' => [
[
'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
|
*/
'prefix' => 'laravel',
];

41
config/compile.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Additional Compiled Classes
|--------------------------------------------------------------------------
|
| Here you may specify additional classes to include in the compiled file
| generated by the `artisan optimize` command. These should be classes
| that are included on basically every request into the application.
|
*/
'files' => [
realpath(__DIR__.'/../app/Providers/AppServiceProvider.php'),
realpath(__DIR__.'/../app/Providers/BusServiceProvider.php'),
realpath(__DIR__.'/../app/Providers/ConfigServiceProvider.php'),
realpath(__DIR__.'/../app/Providers/EventServiceProvider.php'),
realpath(__DIR__.'/../app/Providers/RouteServiceProvider.php'),
],
/*
|--------------------------------------------------------------------------
| Compiled File Providers
|--------------------------------------------------------------------------
|
| Here you may list service providers which define a "compiles" function
| that returns additional files that should be compiled, providing an
| easy way to get common files from any packages you are utilizing.
|
*/
'providers' => [
//
],
];

125
config/database.php Normal file
View File

@@ -0,0 +1,125 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| PDO Fetch Style
|--------------------------------------------------------------------------
|
| By default, database results will be returned as instances of the PHP
| stdClass object; however, you may desire to retrieve records in an
| array format for simplicity. Here you can tweak the fetch style.
|
*/
'fetch' => PDO::FETCH_CLASS,
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => 'mysql',
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => storage_path().'/database.sqlite',
'prefix' => '',
],
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'custom_design'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'public',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'prefix' => '',
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer set of commands than a typical key-value systems
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'cluster' => false,
'default' => [
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
],
],
];

91
config/filesystems.php Normal file
View File

@@ -0,0 +1,91 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. A "local" driver, as well as a variety of cloud
| based drivers are available for your choosing. Just store away!
|
| Supported: "local", "s3", "rackspace"
|
*/
'default' => 'local',
/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/
'cloud' => 's3',
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path().'/app',
],
'localdir' => [
'driver' => 'local',
'root' => '/var/www/html/uploads/images',
],
's3' => [
'driver' => 's3',
'key' => 'your-key',
'secret' => 'your-secret',
'region' => 'your-region',
'bucket' => 'your-bucket',
],
'rackspace' => [
'driver' => 'rackspace',
'username' => 'your-username',
'key' => 'your-key',
'container' => 'your-container',
'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/',
'region' => 'IAD',
'url_type' => 'publicURL'
],
'sftp' => [
'driver' => 'sftp',
'host' => '35.232.234.8',
'port' => 22,
'username' => 'root',
'password' => '',
'privateKey' => '/var/www/html/_key/instance2/root.ppk',
'root' => '/var/www/html/images',
'timeout' => 10
],
'uploads' => [
'driver' => 'local',
'root' => '/var/www/html/uploads/images',
],
],
];

View File

@@ -0,0 +1,48 @@
<?php
return
[
/*
* The siteId is used to retrieve and display Google Analytics statistics
* in the admin-section.
*
* Should look like: ga:xxxxxxxx.
*/
'siteId' => env('ANALYTICS_SITE_ID'),
/*
* Set the client id
*
* Should look like:
* xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
*/
'clientId' => env('ANALYTICS_CLIENT_ID'),
/*
* Set the service account name
*
* Should look like:
* xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@developer.gserviceaccount.com
*/
'serviceEmail' => env('ANALYTICS_SERVICE_EMAIL'),
/*
* You need to download a p12-certifciate from the Google API console
* Be sure to store this file in a secure location.
*/
'certificatePath' => storage_path('laravel-analytics/hardy-beach-228905-7755a62c7a35.p12'),
/*
* The amount of minutes the Google API responses will be cached.
* If you set this to zero, the responses won't be cached at all.
*/
'cacheLifetime' => 60 * 24 * 2,
/*
* The amount of seconds the Google API responses will be cached for
* queries that use the real time query method. If you set this to zero,
* the responses of real time queries won't be cached at all.
*/
'realTimeCacheLifetimeInSeconds' => 5,
];

127
config/mail.php Normal file
View File

@@ -0,0 +1,127 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "log"
|
*/
// 'driver' => env('MAIL_DRIVER', 'smtp'),
'driver' => env('MAIL_DRIVER'),
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
|
*/
// 'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
'host' => env('MAIL_HOST'),
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
|
*/
// 'port' => env('MAIL_PORT', 587),
'port' => env('MAIL_PORT'),
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => ['address' => 'noreply@crewsportswear.com', 'name' => 'no-reply'],
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => 'tls',
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => env('MAIL_USERNAME'),
/*
|--------------------------------------------------------------------------
| SMTP Server Password
|--------------------------------------------------------------------------
|
| Here you may set the password required by your SMTP server to send out
| messages from your application. This will be given to the server on
| connection so that the application will be able to send messages.
|
*/
'password' => env('MAIL_PASSWORD'),
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Mail "Pretend"
|--------------------------------------------------------------------------
|
| When this option is enabled, e-mail will not actually be sent over the
| web and will instead be written to your application's logs files so
| you may inspect the message. This is great for local development.
|
*/
'pretend' => false,
];

92
config/queue.php Normal file
View File

@@ -0,0 +1,92 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Queue Driver
|--------------------------------------------------------------------------
|
| The Laravel queue API supports a variety of back-ends via an unified
| API, giving you convenient access to each back-end using the same
| syntax for each one. Here you may set the default queue driver.
|
| Supported: "null", "sync", "database", "beanstalkd",
| "sqs", "iron", "redis"
|
*/
'default' => env('QUEUE_DRIVER', 'sync'),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
|
*/
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'expire' => 60,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'ttr' => 60,
],
'sqs' => [
'driver' => 'sqs',
'key' => 'your-public-key',
'secret' => 'your-secret-key',
'queue' => 'your-queue-url',
'region' => 'us-east-1',
],
'iron' => [
'driver' => 'iron',
'host' => 'mq-aws-us-east-1.iron.io',
'token' => 'your-token',
'project' => 'your-project-id',
'queue' => 'your-queue-name',
'encrypt' => true,
],
'redis' => [
'driver' => 'redis',
'queue' => 'default',
'expire' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish.
|
*/
'failed' => [
'database' => 'mysql', 'table' => 'failed_jobs',
],
];

49
config/services.php Normal file
View File

@@ -0,0 +1,49 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, Mandrill, and others. This file provides a sane
| default location for this type of information, allowing packages
| to have a conventional place to find your various credentials.
|
*/
'mailgun' => [
'domain' => '',
'secret' => '',
],
'mandrill' => [
'secret' => '',
],
'ses' => [
'key' => '',
'secret' => '',
'region' => 'us-east-1',
],
'stripe' => [
'model' => 'App\User',
'secret' => '',
],
// sandbox
// 'paypal' => [
// 'client_id' => 'AQuz-HKzQiL7FygkG8skSekaWf-RP6Rgj4f1XeX1Ghp86bUFj7tQXVT1xbpluu5_WCGRbQpOVGtlJKVB',
// 'secret' => 'EJAMKxQsl-mFkL_4J_90cvTamYfcsgswqgIxz9wQPiRAwJ6sy_wNsttMlmrXIpxI96JpYzdMXkLCHAPz'
// ],
// live
'paypal' => [
'client_id' => 'AUqBUFW5lfyYmrlBtFZA3RNw45sttM3ltbvS_d4qCVBMrkcMG9rEeivGvtNFSy8XTiEp50YyQ6khKxbq',
'secret' => 'ELlnuiupoFKwGUSc2g5j-sD1EmsvKpdhth1gFV7njpfvyNtKsK8WwIKUMOS0ehJcRatV865eMhfgsnd_'
],
];

154
config/session.php Normal file
View File

@@ -0,0 +1,154 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "array"
|
*/
'driver' => 'database',
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => 120,
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it is stored. All encryption will be run
| automatically by Laravel and you can use the Session like normal.
|
*/
'encrypt' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path().'/framework/sessions',
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => null,
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
// 'cookie' => 'laravel_session',
'cookie' => 'crewsportswear_laravel_session',
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => null,
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
|
*/
'secure' => false,
];

24
config/site_config.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| User Defined Variables
|--------------------------------------------------------------------------
|
| This is a set of variables that are made specific to this application
| that are better placed here rather than in .env file.
| Use config('your_key') to get the values.
|
*/
// 'company_name' => env('COMPANY_NAME','Acme Inc'),
// 'company_email' => env('COMPANY_email','contact@acme.inc'),
'prod_private_server_ip' => env('https://crewsportswear.app', 'https://crewsportswear.app'),
'images_url' => env('https://crewsportswear.app:5955', 'https://crewsportswear.app:5955'),
'uploads' => env('https://crewsportswear.com/uploads/images/', 'https://crewsportswear.com/uploads/images/'), // local
];

33
config/view.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
realpath(base_path('resources/views'))
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => realpath(storage_path().'/framework/views'),
];

1
database/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.sqlite

View File

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
class CreateSessionTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sessions', function($t)
{
$t->string('id')->unique();
$t->text('payload');
$t->integer('last_activity');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('sessions');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateApiModelsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('api_models', function(Blueprint $table)
{
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('api_models');
}
}

0
database/seeds/.gitkeep Normal file
View File

View File

@@ -0,0 +1,20 @@
<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class DatabaseSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
// $this->call('UserTableSeeder');
}
}

16
gulpfile.js Normal file
View File

@@ -0,0 +1,16 @@
var elixir = require('laravel-elixir');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
| for your Laravel application. By default, we are compiling the Less
| file for our application, as well as publishing vendor resources.
|
*/
elixir(function(mix) {
mix.less('app.less');
});

57
index.php Normal file
View File

@@ -0,0 +1,57 @@
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <taylorotwell@gmail.com>
*/
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax.
|
*/
require __DIR__.'/bootstrap/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can simply call the run method,
| which will execute the request and send the response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app->make('Illuminate\Contracts\Http\Kernel');
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);

7
package.json Normal file
View File

@@ -0,0 +1,7 @@
{
"private": true,
"devDependencies": {
"gulp": "^3.8.8",
"laravel-elixir": "*"
}
}

5
phpspec.yml Normal file
View File

@@ -0,0 +1,5 @@
suites:
main:
namespace: App
psr4_prefix: App
src_path: app

23
phpunit.xml Normal file
View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="bootstrap/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
<testsuites>
<testsuite name="Application Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
</php>
</phpunit>

15
public/.htaccess Normal file
View File

@@ -0,0 +1,15 @@
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

23909
public/api/usaCities.json Normal file

File diff suppressed because it is too large Load Diff

587
public/assets/css/bootstrap-theme.css vendored Normal file
View File

@@ -0,0 +1,587 @@
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
.btn-default,
.btn-primary,
.btn-success,
.btn-info,
.btn-warning,
.btn-danger {
text-shadow: 0 -1px 0 rgba(0, 0, 0, .2);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
}
.btn-default:active,
.btn-primary:active,
.btn-success:active,
.btn-info:active,
.btn-warning:active,
.btn-danger:active,
.btn-default.active,
.btn-primary.active,
.btn-success.active,
.btn-info.active,
.btn-warning.active,
.btn-danger.active {
-webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
}
.btn-default.disabled,
.btn-primary.disabled,
.btn-success.disabled,
.btn-info.disabled,
.btn-warning.disabled,
.btn-danger.disabled,
.btn-default[disabled],
.btn-primary[disabled],
.btn-success[disabled],
.btn-info[disabled],
.btn-warning[disabled],
.btn-danger[disabled],
fieldset[disabled] .btn-default,
fieldset[disabled] .btn-primary,
fieldset[disabled] .btn-success,
fieldset[disabled] .btn-info,
fieldset[disabled] .btn-warning,
fieldset[disabled] .btn-danger {
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-default .badge,
.btn-primary .badge,
.btn-success .badge,
.btn-info .badge,
.btn-warning .badge,
.btn-danger .badge {
text-shadow: none;
}
.btn:active,
.btn.active {
background-image: none;
}
.btn-default {
text-shadow: 0 1px 0 #fff;
background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%);
background-image: -o-linear-gradient(top, #fff 0%, #e0e0e0 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#e0e0e0));
background-image: linear-gradient(to bottom, #fff 0%, #e0e0e0 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-color: #dbdbdb;
border-color: #ccc;
}
.btn-default:hover,
.btn-default:focus {
background-color: #e0e0e0;
background-position: 0 -15px;
}
.btn-default:active,
.btn-default.active {
background-color: #e0e0e0;
border-color: #dbdbdb;
}
.btn-default.disabled,
.btn-default[disabled],
fieldset[disabled] .btn-default,
.btn-default.disabled:hover,
.btn-default[disabled]:hover,
fieldset[disabled] .btn-default:hover,
.btn-default.disabled:focus,
.btn-default[disabled]:focus,
fieldset[disabled] .btn-default:focus,
.btn-default.disabled.focus,
.btn-default[disabled].focus,
fieldset[disabled] .btn-default.focus,
.btn-default.disabled:active,
.btn-default[disabled]:active,
fieldset[disabled] .btn-default:active,
.btn-default.disabled.active,
.btn-default[disabled].active,
fieldset[disabled] .btn-default.active {
background-color: #e0e0e0;
background-image: none;
}
.btn-primary {
background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%);
background-image: -o-linear-gradient(top, #337ab7 0%, #265a88 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#265a88));
background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-color: #245580;
}
.btn-primary:hover,
.btn-primary:focus {
background-color: #265a88;
background-position: 0 -15px;
}
.btn-primary:active,
.btn-primary.active {
background-color: #265a88;
border-color: #245580;
}
.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary,
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled.focus,
.btn-primary[disabled].focus,
fieldset[disabled] .btn-primary.focus,
.btn-primary.disabled:active,
.btn-primary[disabled]:active,
fieldset[disabled] .btn-primary:active,
.btn-primary.disabled.active,
.btn-primary[disabled].active,
fieldset[disabled] .btn-primary.active {
background-color: #265a88;
background-image: none;
}
.btn-success {
background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);
background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641));
background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-color: #3e8f3e;
}
.btn-success:hover,
.btn-success:focus {
background-color: #419641;
background-position: 0 -15px;
}
.btn-success:active,
.btn-success.active {
background-color: #419641;
border-color: #3e8f3e;
}
.btn-success.disabled,
.btn-success[disabled],
fieldset[disabled] .btn-success,
.btn-success.disabled:hover,
.btn-success[disabled]:hover,
fieldset[disabled] .btn-success:hover,
.btn-success.disabled:focus,
.btn-success[disabled]:focus,
fieldset[disabled] .btn-success:focus,
.btn-success.disabled.focus,
.btn-success[disabled].focus,
fieldset[disabled] .btn-success.focus,
.btn-success.disabled:active,
.btn-success[disabled]:active,
fieldset[disabled] .btn-success:active,
.btn-success.disabled.active,
.btn-success[disabled].active,
fieldset[disabled] .btn-success.active {
background-color: #419641;
background-image: none;
}
.btn-info {
background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2));
background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-color: #28a4c9;
}
.btn-info:hover,
.btn-info:focus {
background-color: #2aabd2;
background-position: 0 -15px;
}
.btn-info:active,
.btn-info.active {
background-color: #2aabd2;
border-color: #28a4c9;
}
.btn-info.disabled,
.btn-info[disabled],
fieldset[disabled] .btn-info,
.btn-info.disabled:hover,
.btn-info[disabled]:hover,
fieldset[disabled] .btn-info:hover,
.btn-info.disabled:focus,
.btn-info[disabled]:focus,
fieldset[disabled] .btn-info:focus,
.btn-info.disabled.focus,
.btn-info[disabled].focus,
fieldset[disabled] .btn-info.focus,
.btn-info.disabled:active,
.btn-info[disabled]:active,
fieldset[disabled] .btn-info:active,
.btn-info.disabled.active,
.btn-info[disabled].active,
fieldset[disabled] .btn-info.active {
background-color: #2aabd2;
background-image: none;
}
.btn-warning {
background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316));
background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-color: #e38d13;
}
.btn-warning:hover,
.btn-warning:focus {
background-color: #eb9316;
background-position: 0 -15px;
}
.btn-warning:active,
.btn-warning.active {
background-color: #eb9316;
border-color: #e38d13;
}
.btn-warning.disabled,
.btn-warning[disabled],
fieldset[disabled] .btn-warning,
.btn-warning.disabled:hover,
.btn-warning[disabled]:hover,
fieldset[disabled] .btn-warning:hover,
.btn-warning.disabled:focus,
.btn-warning[disabled]:focus,
fieldset[disabled] .btn-warning:focus,
.btn-warning.disabled.focus,
.btn-warning[disabled].focus,
fieldset[disabled] .btn-warning.focus,
.btn-warning.disabled:active,
.btn-warning[disabled]:active,
fieldset[disabled] .btn-warning:active,
.btn-warning.disabled.active,
.btn-warning[disabled].active,
fieldset[disabled] .btn-warning.active {
background-color: #eb9316;
background-image: none;
}
.btn-danger {
background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a));
background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-color: #b92c28;
}
.btn-danger:hover,
.btn-danger:focus {
background-color: #c12e2a;
background-position: 0 -15px;
}
.btn-danger:active,
.btn-danger.active {
background-color: #c12e2a;
border-color: #b92c28;
}
.btn-danger.disabled,
.btn-danger[disabled],
fieldset[disabled] .btn-danger,
.btn-danger.disabled:hover,
.btn-danger[disabled]:hover,
fieldset[disabled] .btn-danger:hover,
.btn-danger.disabled:focus,
.btn-danger[disabled]:focus,
fieldset[disabled] .btn-danger:focus,
.btn-danger.disabled.focus,
.btn-danger[disabled].focus,
fieldset[disabled] .btn-danger.focus,
.btn-danger.disabled:active,
.btn-danger[disabled]:active,
fieldset[disabled] .btn-danger:active,
.btn-danger.disabled.active,
.btn-danger[disabled].active,
fieldset[disabled] .btn-danger.active {
background-color: #c12e2a;
background-image: none;
}
.thumbnail,
.img-thumbnail {
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
background-color: #e8e8e8;
background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
background-repeat: repeat-x;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover,
.dropdown-menu > .active > a:focus {
background-color: #2e6da4;
background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
background-repeat: repeat-x;
}
.navbar-default {
background-image: -webkit-linear-gradient(top, #fff 0%, #f8f8f8 100%);
background-image: -o-linear-gradient(top, #fff 0%, #f8f8f8 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f8f8f8));
background-image: linear-gradient(to bottom, #fff 0%, #f8f8f8 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 5px rgba(0, 0, 0, .075);
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .active > a {
background-image: -webkit-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
background-image: -o-linear-gradient(top, #dbdbdb 0%, #e2e2e2 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#dbdbdb), to(#e2e2e2));
background-image: linear-gradient(to bottom, #dbdbdb 0%, #e2e2e2 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdbdbdb', endColorstr='#ffe2e2e2', GradientType=0);
background-repeat: repeat-x;
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
box-shadow: inset 0 3px 9px rgba(0, 0, 0, .075);
}
.navbar-brand,
.navbar-nav > li > a {
text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
}
.navbar-inverse {
background-image: -webkit-linear-gradient(top, #3c3c3c 0%, #222 100%);
background-image: -o-linear-gradient(top, #3c3c3c 0%, #222 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#3c3c3c), to(#222));
background-image: linear-gradient(to bottom, #3c3c3c 0%, #222 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
background-repeat: repeat-x;
border-radius: 4px;
}
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .active > a {
background-image: -webkit-linear-gradient(top, #080808 0%, #0f0f0f 100%);
background-image: -o-linear-gradient(top, #080808 0%, #0f0f0f 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#080808), to(#0f0f0f));
background-image: linear-gradient(to bottom, #080808 0%, #0f0f0f 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff080808', endColorstr='#ff0f0f0f', GradientType=0);
background-repeat: repeat-x;
-webkit-box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
box-shadow: inset 0 3px 9px rgba(0, 0, 0, .25);
}
.navbar-inverse .navbar-brand,
.navbar-inverse .navbar-nav > li > a {
text-shadow: 0 -1px 0 rgba(0, 0, 0, .25);
}
.navbar-static-top,
.navbar-fixed-top,
.navbar-fixed-bottom {
border-radius: 0;
}
@media (max-width: 767px) {
.navbar .navbar-nav .open .dropdown-menu > .active > a,
.navbar .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #fff;
background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
background-repeat: repeat-x;
}
}
.alert {
text-shadow: 0 1px 0 rgba(255, 255, 255, .2);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .05);
}
.alert-success {
background-image: -webkit-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
background-image: -o-linear-gradient(top, #dff0d8 0%, #c8e5bc 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#c8e5bc));
background-image: linear-gradient(to bottom, #dff0d8 0%, #c8e5bc 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);
background-repeat: repeat-x;
border-color: #b2dba1;
}
.alert-info {
background-image: -webkit-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
background-image: -o-linear-gradient(top, #d9edf7 0%, #b9def0 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#b9def0));
background-image: linear-gradient(to bottom, #d9edf7 0%, #b9def0 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);
background-repeat: repeat-x;
border-color: #9acfea;
}
.alert-warning {
background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
background-image: -o-linear-gradient(top, #fcf8e3 0%, #f8efc0 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#f8efc0));
background-image: linear-gradient(to bottom, #fcf8e3 0%, #f8efc0 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);
background-repeat: repeat-x;
border-color: #f5e79e;
}
.alert-danger {
background-image: -webkit-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
background-image: -o-linear-gradient(top, #f2dede 0%, #e7c3c3 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#e7c3c3));
background-image: linear-gradient(to bottom, #f2dede 0%, #e7c3c3 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);
background-repeat: repeat-x;
border-color: #dca7a7;
}
.progress {
background-image: -webkit-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
background-image: -o-linear-gradient(top, #ebebeb 0%, #f5f5f5 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#ebebeb), to(#f5f5f5));
background-image: linear-gradient(to bottom, #ebebeb 0%, #f5f5f5 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0);
background-repeat: repeat-x;
}
.progress-bar {
background-image: -webkit-linear-gradient(top, #337ab7 0%, #286090 100%);
background-image: -o-linear-gradient(top, #337ab7 0%, #286090 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#286090));
background-image: linear-gradient(to bottom, #337ab7 0%, #286090 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff286090', GradientType=0);
background-repeat: repeat-x;
}
.progress-bar-success {
background-image: -webkit-linear-gradient(top, #5cb85c 0%, #449d44 100%);
background-image: -o-linear-gradient(top, #5cb85c 0%, #449d44 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#449d44));
background-image: linear-gradient(to bottom, #5cb85c 0%, #449d44 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0);
background-repeat: repeat-x;
}
.progress-bar-info {
background-image: -webkit-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
background-image: -o-linear-gradient(top, #5bc0de 0%, #31b0d5 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#31b0d5));
background-image: linear-gradient(to bottom, #5bc0de 0%, #31b0d5 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0);
background-repeat: repeat-x;
}
.progress-bar-warning {
background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
background-image: -o-linear-gradient(top, #f0ad4e 0%, #ec971f 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#ec971f));
background-image: linear-gradient(to bottom, #f0ad4e 0%, #ec971f 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0);
background-repeat: repeat-x;
}
.progress-bar-danger {
background-image: -webkit-linear-gradient(top, #d9534f 0%, #c9302c 100%);
background-image: -o-linear-gradient(top, #d9534f 0%, #c9302c 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c9302c));
background-image: linear-gradient(to bottom, #d9534f 0%, #c9302c 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0);
background-repeat: repeat-x;
}
.progress-bar-striped {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
}
.list-group {
border-radius: 4px;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
}
.list-group-item.active,
.list-group-item.active:hover,
.list-group-item.active:focus {
text-shadow: 0 -1px 0 #286090;
background-image: -webkit-linear-gradient(top, #337ab7 0%, #2b669a 100%);
background-image: -o-linear-gradient(top, #337ab7 0%, #2b669a 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2b669a));
background-image: linear-gradient(to bottom, #337ab7 0%, #2b669a 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2b669a', GradientType=0);
background-repeat: repeat-x;
border-color: #2b669a;
}
.list-group-item.active .badge,
.list-group-item.active:hover .badge,
.list-group-item.active:focus .badge {
text-shadow: none;
}
.panel {
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
.panel-default > .panel-heading {
background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
background-image: -o-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#e8e8e8));
background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);
background-repeat: repeat-x;
}
.panel-primary > .panel-heading {
background-image: -webkit-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
background-image: -o-linear-gradient(top, #337ab7 0%, #2e6da4 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#2e6da4));
background-image: linear-gradient(to bottom, #337ab7 0%, #2e6da4 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff2e6da4', GradientType=0);
background-repeat: repeat-x;
}
.panel-success > .panel-heading {
background-image: -webkit-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
background-image: -o-linear-gradient(top, #dff0d8 0%, #d0e9c6 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#dff0d8), to(#d0e9c6));
background-image: linear-gradient(to bottom, #dff0d8 0%, #d0e9c6 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0);
background-repeat: repeat-x;
}
.panel-info > .panel-heading {
background-image: -webkit-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
background-image: -o-linear-gradient(top, #d9edf7 0%, #c4e3f3 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#d9edf7), to(#c4e3f3));
background-image: linear-gradient(to bottom, #d9edf7 0%, #c4e3f3 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0);
background-repeat: repeat-x;
}
.panel-warning > .panel-heading {
background-image: -webkit-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
background-image: -o-linear-gradient(top, #fcf8e3 0%, #faf2cc 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#fcf8e3), to(#faf2cc));
background-image: linear-gradient(to bottom, #fcf8e3 0%, #faf2cc 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0);
background-repeat: repeat-x;
}
.panel-danger > .panel-heading {
background-image: -webkit-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
background-image: -o-linear-gradient(top, #f2dede 0%, #ebcccc 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#f2dede), to(#ebcccc));
background-image: linear-gradient(to bottom, #f2dede 0%, #ebcccc 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0);
background-repeat: repeat-x;
}
.well {
background-image: -webkit-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
background-image: -o-linear-gradient(top, #e8e8e8 0%, #f5f5f5 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e8e8), to(#f5f5f5));
background-image: linear-gradient(to bottom, #e8e8e8 0%, #f5f5f5 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);
background-repeat: repeat-x;
border-color: #dcdcdc;
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 1px 0 rgba(255, 255, 255, .1);
}
/*# sourceMappingURL=bootstrap-theme.css.map */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

6757
public/assets/css/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

6
public/assets/css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More