Skip to content

Commit 9dd728f

Browse files
committed
initial commit
1 parent 915862f commit 9dd728f

File tree

1,681 files changed

+539254
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,681 files changed

+539254
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2

.env.bak

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
APP_NAME=QRCode
2+
APP_ENV=local
3+
APP_KEY=base64:q1U1XjNvEq/ApGFXrBqGoNOIAgjfMjuGQVRlwLt+ErY=
4+
APP_DEBUG=true
5+
APP_LOG_LEVEL=debug
6+
APP_URL=http://68.183.59.229
7+
8+
DB_CONNECTION=mysql
9+
DB_HOST=localhost
10+
DB_PORT=3306
11+
DB_DATABASE=qrcode
12+
DB_USERNAME=dbuser
13+
DB_PASSWORD=WWE3kk3kd2
14+
15+
BROADCAST_DRIVER=log
16+
CACHE_DRIVER=file
17+
SESSION_DRIVER=file
18+
QUEUE_DRIVER=sync
19+
20+
REDIS_HOST=127.0.0.1
21+
REDIS_PASSWORD=null
22+
REDIS_PORT=6379
23+
24+
MAIL_DRIVER=smtp
25+
MAIL_HOST=mail.ernic.co.za
26+
MAIL_PORT=587
27+
28+
MAIL_PASSWORD=
29+
MAIL_ENCRYPTION=null
30+
MAIL_FROM_NAME=Server
31+
32+
PUSHER_APP_ID=
33+
PUSHER_APP_KEY=
34+
PUSHER_APP_SECRET=

.env.example

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
APP_NAME=Laravel
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_URL=http://localhost
6+
7+
LOG_CHANNEL=stack
8+
9+
DB_CONNECTION=mysql
10+
DB_HOST=127.0.0.1
11+
DB_PORT=3306
12+
DB_DATABASE=laravel
13+
DB_USERNAME=root
14+
DB_PASSWORD=
15+
16+
BROADCAST_DRIVER=log
17+
CACHE_DRIVER=file
18+
QUEUE_CONNECTION=sync
19+
SESSION_DRIVER=file
20+
SESSION_LIFETIME=120
21+
22+
REDIS_HOST=127.0.0.1
23+
REDIS_PASSWORD=null
24+
REDIS_PORT=6379
25+
26+
MAIL_MAILER=smtp
27+
MAIL_HOST=smtp.mailtrap.io
28+
MAIL_PORT=2525
29+
MAIL_USERNAME=null
30+
MAIL_PASSWORD=null
31+
MAIL_ENCRYPTION=null
32+
MAIL_FROM_ADDRESS=null
33+
MAIL_FROM_NAME="${APP_NAME}"
34+
35+
AWS_ACCESS_KEY_ID=
36+
AWS_SECRET_ACCESS_KEY=
37+
AWS_DEFAULT_REGION=us-east-1
38+
AWS_BUCKET=
39+
40+
PUSHER_APP_ID=
41+
PUSHER_APP_KEY=
42+
PUSHER_APP_SECRET=
43+
PUSHER_APP_CLUSTER=mt1
44+
45+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
46+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/node_modules
2+
/public/hot
3+
/public/storage
4+
/storage/*.key
5+
/vendor
6+
/.idea
7+
.env
8+
.env.backup
9+
.phpunit.result.cache
10+
Homestead.json
11+
Homestead.yaml
12+
npm-debug.log
13+
yarn-error.log

.styleci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
php:
2+
preset: laravel
3+
disabled:
4+
- unused_use
5+
finder:
6+
not-name:
7+
- index.php
8+
- server.php
9+
js:
10+
finder:
11+
not-name:
12+
- webpack.mix.js
13+
css: true

app/Campaign.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class Campaign extends Model
8+
{
9+
protected $fillable = [
10+
'qrcode', 'url', 'user_id'
11+
];
12+
}

app/Campaignhit.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace App;
4+
5+
use Illuminate\Database\Eloquent\Model;
6+
7+
class Campaignhit extends Model
8+
{
9+
protected $fillable = [
10+
'campaignid', 'gpslat', 'gpslng', 'browser', 'location'
11+
];
12+
}

app/Console/Kernel.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
namespace App\Console;
4+
5+
use Illuminate\Console\Scheduling\Schedule;
6+
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7+
8+
class Kernel extends ConsoleKernel
9+
{
10+
/**
11+
* The Artisan commands provided by your application.
12+
*
13+
* @var array
14+
*/
15+
protected $commands = [
16+
//
17+
];
18+
19+
/**
20+
* Define the application's command schedule.
21+
*
22+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
23+
* @return void
24+
*/
25+
protected function schedule(Schedule $schedule)
26+
{
27+
// $schedule->command('inspire')->hourly();
28+
}
29+
30+
/**
31+
* Register the commands for the application.
32+
*
33+
* @return void
34+
*/
35+
protected function commands()
36+
{
37+
$this->load(__DIR__.'/Commands');
38+
39+
require base_path('routes/console.php');
40+
}
41+
}

app/Exceptions/Handler.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
namespace App\Exceptions;
4+
5+
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
6+
use Throwable;
7+
8+
class Handler extends ExceptionHandler
9+
{
10+
/**
11+
* A list of the exception types that are not reported.
12+
*
13+
* @var array
14+
*/
15+
protected $dontReport = [
16+
//
17+
];
18+
19+
/**
20+
* A list of the inputs that are never flashed for validation exceptions.
21+
*
22+
* @var array
23+
*/
24+
protected $dontFlash = [
25+
'password',
26+
'password_confirmation',
27+
];
28+
29+
/**
30+
* Report or log an exception.
31+
*
32+
* @param \Throwable $exception
33+
* @return void
34+
*
35+
* @throws \Exception
36+
*/
37+
public function report(Throwable $exception)
38+
{
39+
parent::report($exception);
40+
}
41+
42+
/**
43+
* Render an exception into an HTTP response.
44+
*
45+
* @param \Illuminate\Http\Request $request
46+
* @param \Throwable $exception
47+
* @return \Symfony\Component\HttpFoundation\Response
48+
*
49+
* @throws \Throwable
50+
*/
51+
public function render($request, Throwable $exception)
52+
{
53+
return parent::render($request, $exception);
54+
}
55+
}

app/Helpers/Helpers.php

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
<?php
2+
namespace App\Helpers;
3+
use App\Lookup;
4+
use App\User;
5+
use App\Account;
6+
7+
class Helpers
8+
{
9+
public static function fp()
10+
{
11+
if (isset($_POST['fp']))
12+
return true;
13+
else
14+
return false;
15+
}
16+
17+
public static function get($fieldname, $default = '')
18+
{
19+
if (isset($_POST[$fieldname]))
20+
return $_POST[$fieldname];
21+
else
22+
return $default;
23+
}
24+
25+
public static function get_lookup_options($lookuptype, $default = null)
26+
{
27+
$html = '';
28+
29+
$lookups = Lookup::where('lookuptype', $lookuptype)->get();
30+
31+
foreach ($lookups as $row) {
32+
if (($default != '') && ($default == $row->id))
33+
$html .= '<option value="' . $row->id . '" selected="selected">' . $row->lookupvalue . '</option>';
34+
else
35+
$html .= '<option value="' . $row->id . '">' . $row->lookupvalue . '</option>';
36+
}
37+
echo $html;
38+
}
39+
40+
public static function get_lookup_value($lookupid)
41+
{
42+
$val = Lookup::where('id', $lookupid)->get();
43+
if (count($val) > 0)
44+
return $val[0]->lookupvalue;
45+
else
46+
return '';
47+
}
48+
49+
public static function showdate($value)
50+
{
51+
if (empty($value))
52+
return '';
53+
else
54+
return date('Y-m-d', strtotime($value));
55+
}
56+
57+
public static function showtime($value)
58+
{
59+
if (empty($value))
60+
return '';
61+
else
62+
return date('H:i:s', strtotime($value));
63+
}
64+
65+
public static function showdatetime($value)
66+
{
67+
if (empty($value))
68+
return '';
69+
else
70+
return date('Y-m-d H:i:s', strtotime($value));
71+
}
72+
73+
public static function mysqltime()
74+
{
75+
return date('Y-m-d H:i:s');
76+
}
77+
78+
public static function url_get_contents($Url)
79+
{
80+
if (!function_exists('curl_init')) {
81+
die('CURL is not installed!');
82+
}
83+
$ch = curl_init();
84+
curl_setopt($ch, CURLOPT_URL, $Url);
85+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
86+
$output = curl_exec($ch);
87+
curl_close($ch);
88+
return $output;
89+
}
90+
91+
public static function nullie($value)
92+
{
93+
if ($value == '')
94+
return null;
95+
else
96+
return $value;
97+
}
98+
99+
public static function guid()
100+
{
101+
mt_srand((double)microtime() * 10000);
102+
$charid = strtoupper(md5(uniqid(rand(), true)));
103+
$hyphen = chr(45);// "-"
104+
$uuid = substr($charid, 0, 8) . $hyphen
105+
. substr($charid, 8, 4) . $hyphen
106+
. substr($charid, 12, 4) . $hyphen
107+
. substr($charid, 16, 4) . $hyphen
108+
. substr($charid, 20, 12);
109+
return strtolower($uuid);
110+
}
111+
112+
public static function time_lapsed ($time)
113+
{
114+
115+
$time = time() - $time; // to get the time since that moment
116+
$time = ($time<1)? 1 : $time;
117+
$tokens = array (
118+
31536000 => 'year',
119+
2592000 => 'month',
120+
604800 => 'week',
121+
86400 => 'day',
122+
3600 => 'hour',
123+
60 => 'minute',
124+
1 => 'second'
125+
);
126+
127+
foreach ($tokens as $unit => $text) {
128+
if ($time < $unit) continue;
129+
$numberOfUnits = floor($time / $unit);
130+
return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':'');
131+
}
132+
}
133+
}

0 commit comments

Comments
 (0)