Skip to content

Commit

Permalink
Opensource it
Browse files Browse the repository at this point in the history
  • Loading branch information
ajitbohra committed Mar 6, 2018
0 parents commit 45f86d6
Show file tree
Hide file tree
Showing 1,043 changed files with 146,828 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text=auto
*.css linguist-vendored
*.less linguist-vendored
101 changes: 101 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
### Laravel ###
vendor/
node_modules/
npm-debug.log

# Laravel 4 specific
bootstrap/compiled.php
app/storage/

# Laravel 5 & Lumen specific
public/assets/img/
public/storage
public/hot
storage/*.key
.env.*.php
.env.php
.env
Homestead.yaml
Homestead.json

# Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer
.rocketeer/

### PhpStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/

# CMake
cmake-build-debug/

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### PhpStorm Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
.idea/sonarlint

### SublimeText ###
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache

# workspace files are user-specific
*.sublime-workspace

# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
# *.sublime-project

# sftp configuration file
sftp-config.json

# Package control specific files
Package Control.last-run
Package Control.ca-list
Package Control.ca-bundle
Package Control.system-ca-bundle
Package Control.cache/
Package Control.ca-certs/
Package Control.merged-ca-bundle
Package Control.user-ca-bundle
oscrypto-ca-bundle.crt
bh_unicode_properties.cache

# Sublime-github package stores a github token in this file
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings

# Media Libaray Package Image storage
media/
42 changes: 42 additions & 0 deletions app/Cheque_detail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Sofa\Eloquence\Eloquence;

class Cheque_detail extends Model
{
protected $table = 'trn_cheque_details';

protected $fillable = [
'payment_id',
'number',
'date',
'status',
'created_by',
'updated_by',
];

//Eloquence Search mapping
use Eloquence;

protected $searchableColumns = [
'number' => 20,
];

public function createdBy()
{
return $this->belongsTo('App\User','created_by');
}

public function updatedBy()
{
return $this->belongsTo('App\User','updated_by');
}

public function Payment()
{
return $this->belongsTo('App\Payment_detail','payment_id');
}
}
57 changes: 57 additions & 0 deletions app/Console/Commands/BirthdaySms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Member;
use App\Sms_trigger;
use Carbon\Carbon;

class BirthdaySms extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'birthday:sms';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Send birthday wishes to gym members';

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$birthdays = Member::whereMonth('DOB','=',Carbon::today()->month)->whereDay('DOB','=',Carbon::today()->day)->where('status','=',\constStatus::Active)->get();
$sender_id = \Utilities::getSetting('sms_sender_id');
$gym_name = \Utilities::getSetting('gym_name');

$sms_trigger = Sms_trigger::where('alias','=','member_birthday')->first();
$message = $sms_trigger->message;
$sms_status = $sms_trigger->status;

foreach($birthdays as $birthday)
{
$sms_text = sprintf($message,$birthday->name,$gym_name);
\Utilities::Sms($sender_id,$birthday->contact,$sms_text,$sms_status);
}
}
}
57 changes: 57 additions & 0 deletions app/Console/Commands/ExpenseAlert.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Expense;
use App\Sms_trigger;
use Carbon\Carbon;

class ExpenseAlert extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'expense:alert';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Triggers an expense alert sms to the primary contact number';

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$expenseAlerts = Expense::where('due_date','=',Carbon::today()->addDays(1))->where('paid','=',0)->get();
$contact = \Utilities::getSetting('primary_contact');
$sender_id = \Utilities::getSetting('sms_sender_id');

$sms_trigger = Sms_trigger::where('alias','=','expense_alert')->first();
$message = $sms_trigger->message;
$sms_status = $sms_trigger->status;

foreach ($expenseAlerts as $expenseAlert)
{
$sms_text = sprintf($message,$expenseAlert->name,$expenseAlert->amount,$expenseAlert->due_date);
\Utilities::Sms($sender_id,$contact,$sms_text,$sms_status);
}
}
}
57 changes: 57 additions & 0 deletions app/Console/Commands/FollowupSms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Followup;
use App\Sms_trigger;
use Carbon\Carbon;

class FollowupSms extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'followup:sms';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Triggers sms for followups scheduled for the day';

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$followups = Followup::where('due_date','=',Carbon::today())->get();

$sms_trigger = Sms_trigger::where('alias','=','followup')->first();
$message = $sms_trigger->message;
$sms_status = $sms_trigger->status;
$sender_id = \Utilities::getSetting('sms_sender_id');
$gym_name = \Utilities::getSetting('gym_name');

foreach ($followups as $followup)
{
$sms_text = sprintf($message,$followup->enquiry->name,$gym_name);
\Utilities::Sms($sender_id,$followup->enquiry->contact,$sms_text,$sms_status);
}
}
}
33 changes: 33 additions & 0 deletions app/Console/Commands/Inspire.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Foundation\Inspiring;

class Inspire extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = '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);
}
}
Loading

0 comments on commit 45f86d6

Please sign in to comment.