first commit, after modifying client section

This commit is contained in:
Kwesi Banson
2023-02-22 07:48:50 +00:00
commit ad0dd6a6e1
1880 changed files with 538494 additions and 0 deletions

13
app/Models/Account.php Executable file
View File

@@ -0,0 +1,13 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Account extends Model
{
protected $guarded = array('id');
public $table = "auth_users";
}

26
app/Models/ClickApps.php Executable file
View File

@@ -0,0 +1,26 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ClickApps extends Model
{
protected $guarded = array('id');
public $table = "apps";
protected $fillable = [
'app_name',
'app_type',
'client',
'code',
'country',
'operator',
'tollfree',
'app_path',
'launch_date',
'status',
'other_info',
];
}

11
app/Models/ClickFile.php Executable file
View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ClickFile extends Model
{
protected $guarded = array('id');
public $table = "click_files";
}

33
app/Models/ClickServer.php Executable file
View File

@@ -0,0 +1,33 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ClickServer extends Model
{
protected $guarded = array('id');
public $table = "click_servers";
protected $appends = ['root_password'];
public function direct_connections_info(){
return $this->hasMany('App\Models\DirectConnection', 'server_id', 'id');
}
public function credentials_info(){
return $this->hasMany('App\Models\ServerCredential', 'server_id', 'id');
}
public function modified_by_info(){
return $this->hasOne('App\Models\Account', 'id', 'last_modified_by_id');
}
public function getRootPasswordAttribute(){
$credentials = $this->credentials_info;
foreach ($credentials as $value) {
if ($value->username == 'root') {
return $value->password;
}
}
}
}

48
app/Models/Client.php Executable file
View File

@@ -0,0 +1,48 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Models;
class Client extends Model
{
protected $guarded = array('id');
public $table = "clients";
protected $appends = ['client_services'];
public function country_info(){
return $this->hasOne('App\Models\Country', 'alpha_2_code', 'country');
}
public function payment_type_info(){
return $this->hasOne('App\Models\PaymentType', 'id', 'pay_mode');
}
public function service_info(){
#return $this->hasMany('App\Comment', 'foreign_key', 'local_key');
return $this->hasMany('App\Models\ClientCategory', 'client_id', 'id');
}
public function report_info(){
return $this->hasMany('App\Models\MeetingReport', 'client', 'id');
}
public function auth_user_info(){
return $this->hasOne('App\Models\Account', 'id', 'auth_user_id');
}
public function created_by_info(){
return $this->hasOne('App\Models\Account', 'id', 'created_by');
}
public function modified_by_info(){
return $this->hasOne('App\Models\Account', 'id', 'last_modified_by');
}
public function getClientServicesAttribute(){
$services = $this->service_info;
$service_name_arr = [];
foreach ($services as $value) {
$service_name = Models\Service::find($value['category_id']);
$service_name_arr[] = $service_name->name;
}
return $service_name_arr;
}
}

16
app/Models/ClientCategory.php Executable file
View File

@@ -0,0 +1,16 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ClientCategory extends Model
{
protected $guarded = array('id');
public $table = "client_categories";
public function client_info(){
return $this->hasOne('App\Models\Client', 'id', 'client_id');
}
}

18
app/Models/ClientNote.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ClientNote extends Model
{
protected $guarded = array('id');
public function client_info(){
return $this->hasOne('App\Models\Client', 'id', 'client_id');
}
public function created_by_info(){
return $this->hasOne('App\Models\Account', 'id', 'auth_user_id');
}
}

11
app/Models/Country.php Executable file
View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Country extends Model
{
protected $guarded = array('id');
public $table = "countries";
}

13
app/Models/Currency.php Executable file
View File

@@ -0,0 +1,13 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Currency extends Model
{
protected $guarded = array('id');
public $table = "currencies";
}

11
app/Models/Designation.php Executable file
View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Designation extends Model
{
protected $guarded = array('id');
public $table = "designations";
}

11
app/Models/DirectConnection.php Executable file
View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class DirectConnection extends Model
{
protected $guarded = array('id');
public $table = "direct_connections";
}

24
app/Models/MarketReport.php Executable file
View File

@@ -0,0 +1,24 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class MarketReport extends Model
{
protected $guarded = array('id');
public $table = "market_reports";
public function client_info(){
return $this->hasOne('App\Models\Client', 'id', 'client');
}
public function payment_info(){
return $this->hasOne('App\Models\PaymentType', 'id', 'payment_type');
}
public function auth_user_info(){
return $this->hasOne('App\Models\Account', 'id', 'auth_user_id');
}
public function sam_comment_info(){
return $this->hasMany('App\Models\SamComment', 'report_id', 'id');
}
}

21
app/Models/MeetingReport.php Executable file
View File

@@ -0,0 +1,21 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class MeetingReport extends Model
{
protected $guarded = array('id');
public $table = "meeting_reports";
public function client_info(){
return $this->hasOne('App\Models\Client', 'id', 'client');
}
public function auth_user_info(){
return $this->hasOne('App\Models\Account', 'id', 'auth_user_id');
}
public function sam_comment_info(){
return $this->hasMany('App\Models\SamComment', 'report_id', 'id');
}
}

19
app/Models/NetworkOps.php Executable file
View File

@@ -0,0 +1,19 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class NetworkOps extends Model
{
protected $guarded = array('id');
public $table = "network_operators";
public function country_info(){
return $this->hasOne('App\Models\Country', 'alpha_2_code', 'country');
}
public function account_manager_info(){
return $this->hasOne('App\Models\SystemUser', 'id', 'account_manager_id');
}
}

11
app/Models/Networkstatus.php Executable file
View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Networkstatus extends Model
{
protected $guarded = array('id');
public $table = "network_status_responses";
}

11
app/Models/PaymentType.php Executable file
View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class PaymentType extends Model
{
protected $guarded = array('id');
public $table = "payment_type";
}

13
app/Models/SamComment.php Executable file
View File

@@ -0,0 +1,13 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SamComment extends Model
{
protected $guarded = array('id');
public $table = "sam_comments";
}

16
app/Models/ServerCredential.php Executable file
View File

@@ -0,0 +1,16 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ServerCredential extends Model
{
protected $guarded = array('id');
public $table = "server_credentials";
public function server_info(){
return $this->hasOne('App\Models\ClickServer', 'id', 'server_id');
}
}

11
app/Models/Service.php Executable file
View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Service extends Model
{
protected $guarded = array('id');
public $table = "services";
}

14
app/Models/SystemUser.php Executable file
View File

@@ -0,0 +1,14 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SystemUser extends Model
{
protected $guarded = array('id');
public $table = "auth_users";
public function designation_info(){
return $this->hasOne('App\Models\Designation', 'id', 'designation');
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class UssdClientPayment extends Model
{
protected $guarded = array('id');
public $table = "ussd_client_payments";
public function client_info(){
return $this->hasOne('App\Models\Client', 'id', 'client_id');
}
}