fixed shortcode edit issues plus refactoring
This commit is contained in:
@@ -23,7 +23,6 @@ class LoginController extends Controller
|
||||
return redirect(url('login'))->withErrors("No session found. You need to be logged in!");
|
||||
}
|
||||
$otp_code = Str::random(6);
|
||||
\Log::info($otp_code);
|
||||
request()->session()->put('current_otpuser.otp', $otp_code);
|
||||
$otp_user = session('current_otpuser');
|
||||
|
||||
@@ -33,6 +32,7 @@ class LoginController extends Controller
|
||||
'auth_name' => $otp_user['name']
|
||||
];
|
||||
dispatch(new SendOtpEmailAlert($otp_set));
|
||||
\Log::info($otp_code);
|
||||
$data = [
|
||||
'otp_user_id' => $otp_user['id'],
|
||||
'page_title' => 'Login OTP',
|
||||
@@ -46,6 +46,9 @@ class LoginController extends Controller
|
||||
return redirect(url('login'))->withErrors("$random | You need to be logged in ");
|
||||
}
|
||||
$otp_user = session('current_otpuser');
|
||||
|
||||
// dump(session('current_otpuser.otp'));
|
||||
\Log::info(session('current_otpuser.otp'));
|
||||
$data = [
|
||||
'otp_user_id' => $otp_user['id'],
|
||||
'page_title' => 'Login OTP',
|
||||
|
||||
@@ -353,6 +353,7 @@ class NetworkOperatorsController extends Controller
|
||||
$status_bg = "danger";
|
||||
}
|
||||
$rate_types = ['flat_rate' => 'Flat Rate', 'sliding' => 'Sliding Scale'];
|
||||
$contract_types = ['Bilateral' => 'Bilateral', 'Unilateral' => 'Unilateral'];
|
||||
$data = [
|
||||
'page_title' => 'Edit Network Operator',
|
||||
'network_arr' => $network_arr,
|
||||
@@ -375,7 +376,8 @@ class NetworkOperatorsController extends Controller
|
||||
'ip_addresses' => $ip_addresses,
|
||||
'notes_arr' => $notes_arr,
|
||||
'recent_payments' => $recent_payments,
|
||||
'service_type_names' => $service_type_names
|
||||
'service_type_names' => $service_type_names,
|
||||
'contract_types' => $contract_types
|
||||
];
|
||||
return view('network_ops.edit', $data);
|
||||
}
|
||||
|
||||
@@ -98,9 +98,24 @@ class ShortCodesController extends Controller{
|
||||
->select('code_type', \DB::raw('count(*) as total'))
|
||||
->groupBy('code_type')
|
||||
->get();
|
||||
$networks_raw = [
|
||||
'AirtelTigo GH' => 'AirtelTigo GH',
|
||||
'MTN GH' => 'MTN GH',
|
||||
'Airtel MW' => 'Airtel MW',
|
||||
'Airtel Zambia' => 'Airtel Zambia',
|
||||
'TNM MW' => 'TNM MW',
|
||||
'Airtel MW' => 'Airtel MW',
|
||||
'Safaricom Kenya' => 'Safaricom Kenya',
|
||||
'Airtel Kenya' => 'Airtel Kenya',
|
||||
'Telkom Kenya' => 'Telkom Kenya',
|
||||
'Orange Kenya' => 'Orange Kenya'
|
||||
];
|
||||
sort($networks_raw);
|
||||
|
||||
$data = [
|
||||
'page_title' => 'Short Codes',
|
||||
'type' => 'USSD',
|
||||
'networks_raw' => array_combine($networks_raw, $networks_raw),
|
||||
'codes_data' => $codes_data,
|
||||
'country_network_arr' => $country_networks,
|
||||
'client_arr' => $client_arr,
|
||||
@@ -145,9 +160,23 @@ class ShortCodesController extends Controller{
|
||||
->select('code_type', \DB::raw('count(*) as total'))
|
||||
->groupBy('code_type')
|
||||
->get();
|
||||
$networks_raw = [
|
||||
'AirtelTigo GH' => 'AirtelTigo GH',
|
||||
'MTN GH' => 'MTN GH',
|
||||
'Airtel MW' => 'Airtel MW',
|
||||
'Airtel Zambia' => 'Airtel Zambia',
|
||||
'TNM MW' => 'TNM MW',
|
||||
'Airtel MW' => 'Airtel MW',
|
||||
'Safaricom Kenya' => 'Safaricom Kenya',
|
||||
'Airtel Kenya' => 'Airtel Kenya',
|
||||
'Telkom Kenya' => 'Telkom Kenya',
|
||||
'Orange Kenya' => 'Orange Kenya'
|
||||
];
|
||||
sort($networks_raw);
|
||||
$data = [
|
||||
'page_title' => 'Short Codes',
|
||||
'type' => 'Voice',
|
||||
'networks_raw' => array_combine($networks_raw, $networks_raw),
|
||||
'codes_data' => $codes_data,
|
||||
'country_network_arr' => $country_networks,
|
||||
'client_arr' => $client_arr,
|
||||
@@ -181,6 +210,10 @@ class ShortCodesController extends Controller{
|
||||
}
|
||||
return response()->json($shortcode_arr);
|
||||
}
|
||||
public function handle_delete($id){
|
||||
$result = Models\ClientShortCode::destroy($id);
|
||||
return response()->json(['code' => 1, 'msg' => $result]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ use App\Models;
|
||||
use Spatie\Activitylog\Models\Activity;
|
||||
use Illuminate\Contracts\Mail\Mailer;
|
||||
use App\Jobs\SendTestEmail;
|
||||
use App\Notifications\EmailNotification;
|
||||
|
||||
|
||||
class UtilityController extends Controller
|
||||
{
|
||||
@@ -247,5 +249,16 @@ class UtilityController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function sendEmailNotification(Request $request){
|
||||
$user = Models\StaffMember::find(1);
|
||||
|
||||
// Create a new instance of your notification
|
||||
$notification = new EmailNotification('This is a test notification.', 'https://example.com');
|
||||
|
||||
// Send the notification
|
||||
$user->notify($notification);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
// https://www.tokyvideo.com/video/sheena-the-queen-of-the-jungle-1984-movie-with-tanya-roberts-ted-wass-donovan-scott
|
||||
|
||||
Reference in New Issue
Block a user