se agrega modelo de asistencias, correcciones de codigo qr y procesador de unsubscribes
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
/.zed
|
||||
/auth.json
|
||||
/node_modules
|
||||
/public/build
|
||||
/public/hot
|
||||
/public/storage
|
||||
/storage/*.key
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\AreaCode;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class AreaCodeController extends Controller
|
||||
{
|
||||
|
||||
public function __construct() {
|
||||
$this->middleware('can:areacode.index')->only('index','show');
|
||||
$this->middleware('can:areacode.create')->only('create','store');
|
||||
$this->middleware('can:areacode.edit')->only('edit','update');
|
||||
$this->middleware('can:areacode.destroy')->only('destroy');
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
$areacodes = AreaCode::all();
|
||||
return view('areacode.index',compact('areacodes'));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('areacode.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name'=>'required'
|
||||
]);
|
||||
|
||||
$areacode = AreaCode::create($request->all());
|
||||
|
||||
return redirect()->route('areacode.edit',$areacode)->with('info','El código se creo correctamente');
|
||||
}
|
||||
|
||||
|
||||
public function show(AreaCode $areacode)
|
||||
{
|
||||
return view('areacode.show',compact('areacode'));
|
||||
}
|
||||
|
||||
|
||||
public function edit(AreaCode $areacode)
|
||||
{
|
||||
return view('areacode.edit',compact('areacode'));
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, AreaCode $areacode)
|
||||
{
|
||||
$request->validate([
|
||||
'name'=>'required'
|
||||
]);
|
||||
|
||||
$areacode->update($request->all());
|
||||
return redirect()->route('areacode.edit',$areacode)->with('info','El código se actualizo correctamente');
|
||||
}
|
||||
|
||||
|
||||
public function destroy(AreaCode $areacode)
|
||||
{
|
||||
$areacode->delete();
|
||||
session()->flash('swal',[
|
||||
'icon'=>'success',
|
||||
'title'=>'Eliminado!',
|
||||
'text'=>'Se ha eliminado el registro correctamente'
|
||||
]);
|
||||
return redirect()->route('areacode.index');
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Code;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class CodeController extends Controller
|
||||
{
|
||||
@@ -14,7 +15,12 @@ class CodeController extends Controller
|
||||
public function index()
|
||||
{
|
||||
// $conceptos = Concepto::where('tipo','=','3')->get();
|
||||
return view('code.index');
|
||||
$user = Auth::user();
|
||||
$codes= Code::where('user_id', $user->id)
|
||||
->whereDate('registro', today())
|
||||
->get();
|
||||
$registros=$codes->count();
|
||||
return view('code.index',compact('codes','registros'));
|
||||
}
|
||||
|
||||
public function show()
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Horario;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HorarioController extends Controller
|
||||
{
|
||||
|
||||
public function __construct() {
|
||||
$this->middleware('can:areacode.index')->only('index','show');
|
||||
$this->middleware('can:areacode.create')->only('create','store');
|
||||
$this->middleware('can:areacode.edit')->only('edit','update');
|
||||
$this->middleware('can:areacode.destroy')->only('destroy');
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
$areacodes = Horario::all();
|
||||
return view('areacode.index',compact('areacodes'));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('areacode.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
'name'=>'required'
|
||||
]);
|
||||
|
||||
$areacode = AreaCode::create($request->all());
|
||||
|
||||
return redirect()->route('areacode.edit',$areacode)->with('info','El código se creo correctamente');
|
||||
}
|
||||
|
||||
|
||||
public function show(Horario $horario)
|
||||
{
|
||||
return view('areacode.show',compact('areacode'));
|
||||
}
|
||||
|
||||
|
||||
public function edit(Horario $horario)
|
||||
{
|
||||
return view('areacode.edit',compact('areacode'));
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, Horario $horario)
|
||||
{
|
||||
$request->validate([
|
||||
'name'=>'required'
|
||||
]);
|
||||
|
||||
$areacode->update($request->all());
|
||||
return redirect()->route('areacode.edit',$areacode)->with('info','El código se actualizo correctamente');
|
||||
}
|
||||
|
||||
|
||||
public function destroy(Horario $horario)
|
||||
{
|
||||
$areacode->delete();
|
||||
session()->flash('swal',[
|
||||
'icon'=>'success',
|
||||
'title'=>'Eliminado!',
|
||||
'text'=>'Se ha eliminado el registro correctamente'
|
||||
]);
|
||||
return redirect()->route('areacode.index');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class IncidenciaController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*/
|
||||
public function show(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy(string $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UnsubscribeController extends Controller
|
||||
{
|
||||
public function handle(Request $request)
|
||||
{
|
||||
$token = $request->token;
|
||||
|
||||
$user = User::where('unsubscribe_token', $token)->first();
|
||||
|
||||
if ($user) {
|
||||
$user->subscribed = false;
|
||||
$user->save();
|
||||
}
|
||||
|
||||
return response('Unsubscribed', 200);
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\AreaCode;
|
||||
use App\Models\User;
|
||||
use App\Models\Plantel;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Spatie\Permission\Models\Role;
|
||||
|
||||
class UserController extends Controller
|
||||
@@ -30,7 +30,7 @@ class UserController extends Controller
|
||||
public function create()
|
||||
{
|
||||
$plantels = Plantel::where('status','=','1')->get();
|
||||
$codigos = DB::table('area_code')->get();
|
||||
$codigos = AreaCode::all();
|
||||
$roles= Role::all();
|
||||
return view('user.create',compact('roles','plantels','codigos'));
|
||||
}
|
||||
@@ -53,7 +53,7 @@ class UserController extends Controller
|
||||
public function edit(User $user)
|
||||
{
|
||||
$plantels=Plantel::all();
|
||||
$codigos = DB::table('area_code')->get();
|
||||
$codigos = AreaCode::all();
|
||||
$roles= Role::all();
|
||||
return view('user.edit',compact('user','roles','plantels','codigos'));
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\AreaCode;
|
||||
use Carbon\Carbon;
|
||||
use App\Models\Code;
|
||||
use Livewire\Component;
|
||||
use Livewire\Attributes\On;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class CodeScanner extends Component
|
||||
@@ -16,11 +16,7 @@ class CodeScanner extends Component
|
||||
public function qrLeido($texto, $lat, $lng)
|
||||
{
|
||||
|
||||
$dia = now()->translatedFormat('l');
|
||||
//dd($dia);
|
||||
|
||||
$codigo = DB::table('area_code')
|
||||
->where('name', $texto)
|
||||
$codigo = AreaCode::where('name', $texto)
|
||||
->first();
|
||||
|
||||
if($codigo){
|
||||
@@ -60,8 +56,7 @@ class CodeScanner extends Component
|
||||
return;
|
||||
}
|
||||
|
||||
$corps = DB::table('area_code')
|
||||
->where('name', 'LIKE','%COR%')
|
||||
$corps = AreaCode::where('name', 'LIKE','%COR%')
|
||||
->get();
|
||||
|
||||
$cor=false;
|
||||
@@ -153,7 +148,9 @@ class CodeScanner extends Component
|
||||
title: 'Código inexistente',
|
||||
text: 'Este codigo no es institucional',
|
||||
confirm: false,
|
||||
closeModal: true
|
||||
closeModal: true,
|
||||
reload: true,
|
||||
timer: 3000
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ class Area extends Model
|
||||
return $this->belongsToMany(Role::class);
|
||||
}
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function existe($request = null)
|
||||
{
|
||||
if (!$request) {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AreaCode extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
}
|
||||
@@ -7,4 +7,5 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Campan extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
class Carrera extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
public $timestamps = false;
|
||||
|
||||
public function carreraMaterial() : BelongsToMany
|
||||
{
|
||||
|
||||
@@ -13,6 +13,8 @@ class Code extends Model
|
||||
'registro' => 'datetime',
|
||||
];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
|
||||
@@ -9,6 +9,8 @@ class Concepto extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function planConceptos() : BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Plane::class);
|
||||
|
||||
@@ -7,4 +7,5 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Duration extends Model
|
||||
{
|
||||
protected $guarded=[];
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Horario extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Incidencia extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
}
|
||||
@@ -10,6 +10,7 @@ class Material extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function carreraMaterial() : BelongsToMany
|
||||
{
|
||||
|
||||
@@ -7,4 +7,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Medio extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ class Nivel extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function nivelPlantel() : BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Plantel::class)->withPivot('plantel_id');
|
||||
|
||||
@@ -13,6 +13,7 @@ class Plan extends Model
|
||||
{
|
||||
return $this->belongsToMany(Plantel::class)->withPivot('plantel_id');
|
||||
}
|
||||
public $timestamps = false;
|
||||
|
||||
public function existe($plantelId = null)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,8 @@ class Plane extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function planPlantel() : BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Plantel::class)->withPivot('plantel_id');
|
||||
|
||||
@@ -9,6 +9,8 @@ class Plantel extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function planesPlantel() : BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Plan::class);
|
||||
|
||||
@@ -10,6 +10,7 @@ class Prospecto extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
|
||||
public function plantelUsuarios(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Plantel::class);
|
||||
|
||||
@@ -7,4 +7,6 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class TipoConcepto extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ class Turno extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
public function turnoPlantel() : BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Plantel::class)->withPivot('plantel_id');
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Mail\Events\MessageSending;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -19,6 +20,17 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
Event::listen(MessageSending::class, function ($event) {
|
||||
|
||||
$event->message->getHeaders()->addTextHeader(
|
||||
'List-Unsubscribe',
|
||||
'<mailto:bajas@tudominio.com>, <https://tudominio.com/unsubscribe>'
|
||||
);
|
||||
|
||||
$event->message->getHeaders()->addTextHeader(
|
||||
'List-Unsubscribe-Post',
|
||||
'List-Unsubscribe=One-Click'
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ return new class extends Migration
|
||||
$table->string('longitud')->nullable();
|
||||
$table->bigInteger('telefono');
|
||||
$table->boolean('status');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ return new class extends Migration
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->boolean('status');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ return new class extends Migration
|
||||
$table->string('name');
|
||||
$table->unsignedBigInteger('nivel');
|
||||
$table->boolean('status');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ return new class extends Migration
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->boolean('status');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ return new class extends Migration
|
||||
$table->unsignedBigInteger('duration_id');
|
||||
$table->unsignedBigInteger('nivel');
|
||||
$table->unsignedBigInteger('carrera');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ return new class extends Migration
|
||||
$table->string('clave');
|
||||
$table->string('serial');
|
||||
$table->boolean('status');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ return new class extends Migration
|
||||
$table->foreign('carrera_id')->references('id')->on('carreras');
|
||||
$table->unsignedBigInteger('material_id');
|
||||
$table->foreign('material_id')->references('id')->on('materials');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ return new class extends Migration
|
||||
$table->foreign('prospecto_id')->references('id')->on('prospectos');
|
||||
$table->unsignedBigInteger('user_id');
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ return new class extends Migration
|
||||
Schema::create('areas', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ return new class extends Migration
|
||||
$table->foreign('area_id')->references('id')->on('areas');
|
||||
$table->unsignedBigInteger('role_id');
|
||||
$table->foreign('role_id')->references('id')->on('roles');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ return new class extends Migration
|
||||
Schema::create('prospecto_status', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ return new class extends Migration
|
||||
$table->date('periodoInicial');
|
||||
$table->date('periodoFinal');
|
||||
$table->boolean('status');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ return new class extends Migration
|
||||
$table->foreign('nivel_id')->references('id')->on('nivels');
|
||||
$table->unsignedBigInteger('plantel_id');
|
||||
$table->foreign('plantel_id')->references('id')->on('plantels');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ return new class extends Migration
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->boolean('status');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ return new class extends Migration
|
||||
$table->foreign('plantel_id')->references('id')->on('plantels');
|
||||
$table->unsignedBigInteger('turno_id');
|
||||
$table->foreign('turno_id')->references('id')->on('turnos');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ return new class extends Migration
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->boolean('status');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ return new class extends Migration
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->boolean('status');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ return new class extends Migration
|
||||
$table->decimal('monto', 8, 2);
|
||||
$table->integer('tipo');
|
||||
$table->boolean('recargo');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ return new class extends Migration
|
||||
$table->foreign('plane_id')->references('id')->on('planes');
|
||||
$table->unsignedBigInteger('concepto_id');
|
||||
$table->foreign('concepto_id')->references('id')->on('conceptos');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ return new class extends Migration
|
||||
Schema::create('tipo_conceptos', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ return new class extends Migration
|
||||
$table->dateTime('registro')->nullable();
|
||||
$table->string('latitud');
|
||||
$table->string('longitud');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -11,10 +11,10 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('area_code', function (Blueprint $table) {
|
||||
Schema::create('area_codes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
$table->string('description');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -23,6 +23,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('area_code');
|
||||
Schema::dropIfExists('area_codes');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('incidencias', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->dateTime('dia');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('incidencias');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('horarios', function (Blueprint $table) {
|
||||
$table->id();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('horarios');
|
||||
}
|
||||
};
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class AreaCodeSeeder extends Seeder
|
||||
{
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
DB::table('area_code')->insert([
|
||||
'name' => 'COR-DSIS'
|
||||
]);
|
||||
|
||||
DB::table('area_code')->insert([
|
||||
'name' => 'COR-PROG'
|
||||
]);
|
||||
|
||||
DB::table('area_code')->insert([
|
||||
'name' => 'COR-CSIS'
|
||||
]);
|
||||
|
||||
DB::table('area_code')->insert([
|
||||
'name' => 'COR-RECU'
|
||||
]);
|
||||
|
||||
DB::table('area_code')->insert([
|
||||
'name' => 'COR-COMP'
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\AreaCode;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class AreaCodesSeeder extends Seeder
|
||||
{
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
AreaCode::create([
|
||||
'name' => 'COR-DSIS',
|
||||
'description' => 'Dirección de sistemas'
|
||||
]);
|
||||
|
||||
AreaCode::create([
|
||||
'name' => 'COR-PROG',
|
||||
'description' => 'Programador institucional'
|
||||
]);
|
||||
|
||||
AreaCode::create([
|
||||
'name' => 'COR-CSIS',
|
||||
'description' => 'Coordinador de sistemas'
|
||||
]);
|
||||
|
||||
AreaCode::create([
|
||||
'name' => 'COR-RECU',
|
||||
'description' => 'Recursos humanos'
|
||||
]);
|
||||
|
||||
AreaCode::create([
|
||||
'name' => 'COR-COMP',
|
||||
'description' => 'Dirección compras'
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ class DatabaseSeeder extends Seeder
|
||||
{
|
||||
$this->call(RoleSeeder::class);
|
||||
$this->call(PlantelSeeder::class);
|
||||
$this->call(AreaCodeSeeder::class);
|
||||
$this->call(AreaCodesSeeder::class);
|
||||
$this->call(UserSeeder::class);
|
||||
$this->call(NivelSeeder::class);
|
||||
$this->call(DurationSeeder::class);
|
||||
|
||||
@@ -103,6 +103,11 @@ class RoleSeeder extends Seeder
|
||||
Permission::create(['name'=>'concepto.edit','description'=>'Editar conceptos'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'concepto.destroy','description'=>'Eliminar conceptos'])->syncRoles([$role1]);
|
||||
|
||||
Permission::create(['name'=>'areacode.index','description'=>'Ver códigos qr'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'areacode.create','description'=>'Crear códigos qr'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'areacode.edit','description'=>'Editar códigos qr'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'areacode.destroy','description'=>'Eliminar códigos qr'])->syncRoles([$role1]);
|
||||
|
||||
Permission::create(['name'=>'code.index','description'=>'Ver asistencia digital'])->syncRoles([$role1]);
|
||||
Permission::create(['name'=>'code.create','description'=>'Asistencia digital'])->syncRoles([$role1]);
|
||||
|
||||
|
||||
@@ -11,27 +11,19 @@ class prospectoStatusSeeder extends Seeder
|
||||
public function run(): void
|
||||
{
|
||||
DB::table('prospecto_status')->insert([
|
||||
'name' => 'activo',
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
'name' => 'activo'
|
||||
]);
|
||||
|
||||
DB::table('prospecto_status')->insert([
|
||||
'name' => 'aspirante',
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
'name' => 'aspirante'
|
||||
]);
|
||||
|
||||
DB::table('prospecto_status')->insert([
|
||||
'name' => 'inscrito',
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
'name' => 'inscrito'
|
||||
]);
|
||||
|
||||
DB::table('prospecto_status')->insert([
|
||||
'name' => 'baja',
|
||||
'created_at' => now(),
|
||||
'updated_at' => now(),
|
||||
'name' => 'baja'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,3 +269,22 @@ button:hover {
|
||||
text-align:center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
.sidebar{
|
||||
transition: transform .3s ease;
|
||||
}
|
||||
|
||||
|
||||
#wrapper{
|
||||
min-height:100vh;
|
||||
}
|
||||
|
||||
#content-wrapper{
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
}
|
||||
|
||||
#content{
|
||||
flex:1;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
@extends('layouts.landing')
|
||||
|
||||
@section('title',"Crear")
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<div class="d-sm-flex align-items-center justify-content-between">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Crear códgio qr</h6>
|
||||
<a href="{{route('areacode.index')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Regresar</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form action="{{route('areacode.store')}}" method="POST">
|
||||
@csrf
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Nombre</label>
|
||||
<input class="form-control" name="name">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Descripción</label>
|
||||
<input class="form-control" name="description">
|
||||
</div>
|
||||
<input class="btn btn-primary" type="submit" value="Crear">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,39 @@
|
||||
@extends('layouts.landing')
|
||||
|
||||
@section('title',"Edit")
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<div class="d-sm-flex align-items-center justify-content-between">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Editar código qr</h6>
|
||||
<a href="{{route('areacode.index')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Regresar</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('info'))
|
||||
<div class="alert alert-success">
|
||||
<strong>{{session('info')}}</strong>
|
||||
</div>
|
||||
@endif
|
||||
<form action="{{route('areacode.update',$areacode->id)}}" method="POST">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Nombre</label>
|
||||
<input class="form-control" name="name" value="{{$areacode->name}}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="small mb-1">Descripción</label>
|
||||
<input class="form-control" name="description" value="{{$areacode->description}}">
|
||||
</div>
|
||||
<input class="btn btn-primary" type="submit" value="Update">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,72 @@
|
||||
@extends('layouts.landing')
|
||||
|
||||
@section('head')
|
||||
@include('layouts._partials.tablaStyle')
|
||||
@endsection
|
||||
@section('title',"Inicio")
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<div class="d-sm-flex align-items-center justify-content-between">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Códigos qr</h6>
|
||||
@can('areacode.create')
|
||||
<a href="{{route('areacode.create')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Crear código qr</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="container-fluid">
|
||||
<table id="tcont" class="table table-striped table-bordered nowrap table-hover" style="width:100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Nombre</th>
|
||||
<th>Descripción</th>
|
||||
<th>Opciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($areacodes as $areacode)
|
||||
<tr style="width:100%">
|
||||
<td>{{$areacode->id}}</td>
|
||||
<td><a href="{{route('areacode.show',$areacode->id)}}">{{$areacode->name}}</a></td>
|
||||
<td>{{$areacode->description}}</td>
|
||||
<td class="row mx-auto">
|
||||
@can('areacode.edit')
|
||||
<div class="col-sm-6 col-md-6"><a class="btn btn-primary" href="{{route('areacode.edit',$areacode->id)}}">Edit</a></div>
|
||||
@endcan
|
||||
|
||||
@can('areacode.destroy')
|
||||
<div class="col-sm-6 col-md-6">
|
||||
<form class="delete-form" action="{{route('areacode.destroy',$areacode->id)}}" method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<input type="submit" value="DELETE" class="btn btn-danger">
|
||||
</form>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<p>Sin códigos qr.</p>
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
@section('scripts')
|
||||
@include('layouts._partials.tablaScript')
|
||||
@include('layouts._partials.delete')
|
||||
@endsection
|
||||
@@ -0,0 +1,23 @@
|
||||
@extends('layouts.landing')
|
||||
|
||||
@section('title',"show")
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<div class="d-sm-flex align-items-center justify-content-between">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Datos del código qr</h6>
|
||||
<a href="{{route('areacode.index')}}" class="d-sm-inline-block btn btn-sm btn-primary shadow-sm"><i class="fas fa-download fa-sm text-white-50"></i> Regresar</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h1>{{$areacode->name}}</h1>
|
||||
<p>Descripción: {{ $areacode->description}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@@ -11,13 +11,27 @@
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if ($registros <= 3)
|
||||
|
||||
<div style="min-height:300px">
|
||||
@livewire('code-scanner')
|
||||
@push('scripts')
|
||||
<script src="https://unpkg.com/html5-qrcode" defer></script>
|
||||
@endpush
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
<div class=" text-center">
|
||||
<h2 class="mb-3">Registros del dia {{ ucfirst(now()->locale('es')->translatedFormat('l d \d\e F \d\e Y')) }}</h2>
|
||||
@foreach ($codes as $code)
|
||||
<p>{{$code->registro->format('h:i A')}}</p>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@section('scripts')
|
||||
<script src="https://unpkg.com/html5-qrcode"></script>
|
||||
@endsection
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
|
||||
|
||||
<div class="sidebar bg-primary" id="sidebar">
|
||||
<!-- Sidebar -->
|
||||
<ul class="navbar-nav sidebar sidebar-dark accordion" id="accordionSidebar">
|
||||
<ul class="navbar-nav bg-primary sidebar sidebar-dark accordion" id="accordionSidebar">
|
||||
<!-- Sidebar - Brand -->
|
||||
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="">
|
||||
<div class="sidebar-brand-icon">
|
||||
@@ -95,6 +93,14 @@
|
||||
@can('mail.index')
|
||||
<a class="collapse-item" href="{{ route('mail.index') }}" style="color:#85888e">Mail</a>
|
||||
@endcan
|
||||
|
||||
@can('areacode.index')
|
||||
<a class="collapse-item" href="{{ route('areacode.index') }}" style="color:#85888e">Códigos QR</a>
|
||||
@endcan
|
||||
|
||||
@can('horario.index')
|
||||
<a class="collapse-item" href="{{ route('horario.index') }}" style="color:#85888e">Horarios</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
@@ -177,4 +183,3 @@
|
||||
<button class="rounded-circle border-0" id="sidebarToggle"></button>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -7,9 +7,10 @@
|
||||
|
||||
{{-- Livewire styles --}}
|
||||
@livewireStyles
|
||||
|
||||
</head>
|
||||
|
||||
<body id="page-top">
|
||||
<body id="page-top" class="sidebar-toggled">
|
||||
<div id="wrapper">
|
||||
|
||||
@include('layouts._partials.menu')
|
||||
@@ -83,6 +84,23 @@ window.addEventListener('close-modal', () => {
|
||||
);
|
||||
modal?.hide();
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
function toggleSidebarByScreen() {
|
||||
if (window.innerWidth < 768) {
|
||||
document.body.classList.add("sidebar-toggled");
|
||||
document.querySelector(".sidebar").classList.add("toggled");
|
||||
} else {
|
||||
document.body.classList.remove("sidebar-toggled");
|
||||
document.querySelector(".sidebar").classList.remove("toggled");
|
||||
}
|
||||
}
|
||||
|
||||
toggleSidebarByScreen();
|
||||
window.addEventListener("resize", toggleSidebarByScreen);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
<div wire:ignore>
|
||||
<div id="reader"></div>
|
||||
|
||||
<div class="d-none">
|
||||
<p>Latitud: <span id="latitud">Esperando GPS...</span></p>
|
||||
<p>Longitud: <span id="longitud">Esperando GPS...</span></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
|
||||
+18
-13
@@ -1,30 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use App\Http\Controllers\AreaCodeController;
|
||||
use App\Http\Controllers\AreaController;
|
||||
use App\Http\Controllers\NoteController;
|
||||
use App\Http\Controllers\PagoController;
|
||||
use App\Http\Controllers\PlanController;
|
||||
use App\Http\Controllers\RoleController;
|
||||
use App\Http\Controllers\UserController;
|
||||
use App\Http\Controllers\MedioController;
|
||||
use App\Http\Controllers\NivelController;
|
||||
use App\Http\Controllers\PlaneController;
|
||||
use App\Http\Controllers\TurnoController;
|
||||
use App\Http\Controllers\CampanController;
|
||||
use App\Http\Controllers\StripeController;
|
||||
use App\Http\Controllers\CarreraController;
|
||||
use App\Http\Controllers\CodeController;
|
||||
use App\Http\Controllers\PlantelController;
|
||||
use App\Http\Controllers\ConceptoController;
|
||||
use App\Http\Controllers\DurationController;
|
||||
use App\Http\Controllers\MailController;
|
||||
use App\Http\Controllers\MaterialController;
|
||||
use App\Http\Controllers\ProspectoController;
|
||||
use App\Http\Controllers\MedioController;
|
||||
use App\Http\Controllers\NivelController;
|
||||
use App\Http\Controllers\NoteController;
|
||||
use App\Http\Controllers\PagoController;
|
||||
use App\Http\Controllers\PermissionController;
|
||||
use App\Http\Controllers\PlanController;
|
||||
use App\Http\Controllers\PlaneController;
|
||||
use App\Http\Controllers\PlantelController;
|
||||
use App\Http\Controllers\ProspectoController;
|
||||
use App\Http\Controllers\RoleController;
|
||||
use App\Http\Controllers\StripeController;
|
||||
use App\Http\Controllers\StripeWebhookController;
|
||||
use App\Http\Controllers\TurnoController;
|
||||
use App\Http\Controllers\UnsubscribeController;
|
||||
use App\Http\Controllers\UserController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Laravel\Jetstream\Http\Controllers\Livewire\UserProfileController;
|
||||
|
||||
Route::match(['GET','POST'],'/unsubscribe', [UnsubscribeController::class,'handle']);
|
||||
|
||||
Route::get('/',function(){return view('auth.login');});
|
||||
Route::get('/prueba',function(){return view('prueba.index');});
|
||||
Route::post('/stripe/webhook', [StripeWebhookController::class, 'handle']);
|
||||
@@ -35,6 +39,7 @@ Route::middleware(['auth:sanctum',config('jetstream.auth_session'),'verified',
|
||||
Route::middleware(['auth'])->group(function () {
|
||||
|
||||
Route::resource('/area',AreaController::class);
|
||||
Route::resource('/areacode',AreaCodeController::class);
|
||||
Route::get('/dashboard', function () {return view('dashboard');})->name('dashboard');
|
||||
Route::resource('/campan',CampanController::class);
|
||||
Route::resource('/carrera',CarreraController::class);
|
||||
|
||||
Reference in New Issue
Block a user