<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\CustomAuthController;

Route::resource("operation"             ,App\Http\Controllers\EndoCAPTURE\OperationController::class);
Route::resource("printpdf"              ,App\Http\Controllers\EndoCAPTURE\PrintPDFController::class);
Route::resource("pdfpacs"              ,App\Http\Controllers\EndoCAPTURE\PdfPacsController::class);

Route::resource("dicom"              ,App\Http\Controllers\DicomController::class);

Route::resource("adfs"                  ,App\Http\Controllers\ADFSController::class);
Route::resource("sendto"                ,App\Http\Controllers\SendtoController::class);
Route::resource("ocr"                   ,App\Http\Controllers\OCRController::class);
Route::resource("mongo"                 ,App\Http\Controllers\MongoController::class);


Route::resource("holiday"               ,App\Http\Controllers\HolidayController::class);
Route::resource("migratdata"            ,App\Http\Controllers\MigratdataController::class);
Route::resource("createcollection"      ,App\Http\Controllers\CreatecollectionController::class);

//screening
Route::resource("createmulticase"            ,App\Http\Controllers\Capture\CreatemulticaseController::class);
Route::resource("home"                  ,App\Http\Controllers\HomeController::class);
Route::resource("homehome"              ,App\Http\Controllers\HomeController::class);
Route::resource("/"                     ,App\Http\Controllers\HomeController::class);
Route::resource("procedure"             ,App\Http\Controllers\Capture\ProcedureController::class);
Route::resource("report"                ,App\Http\Controllers\Capture\ReportController::class);
Route::resource("login"                 ,App\Http\Controllers\Capture\LoginController::class);
Route::resource("history"               ,App\Http\Controllers\Capture\HistoryController::class);
Route::resource("analysis"              ,App\Http\Controllers\Capture\AnalysisController::class);
Route::resource("exportdata"            ,App\Http\Controllers\Capture\ExportdataController::class);
Route::resource("patient"               ,App\Http\Controllers\Capture\PatientController::class);
Route::resource("registration"          ,App\Http\Controllers\Capture\RegistrationController::class);
Route::resource("loadpic"               ,App\Http\Controllers\Capture\LoadpicController::class);
Route::resource("upload"                ,App\Http\Controllers\Capture\SelfuploadController::class);
Route::resource("imagesort"             ,App\Http\Controllers\Capture\ImageSortController::class);
Route::resource("photomove"             ,App\Http\Controllers\Capture\PhotomoveController::class);
Route::resource("crop"                  ,App\Http\Controllers\Capture\CropController::class);
Route::resource("cameracapvdo"          ,App\Http\Controllers\Capture\CameraCapVDOController::class);
Route::resource("esign"                 ,App\Http\Controllers\Capture\EsignController::class);
Route::resource("casehistory"           ,App\Http\Controllers\Capture\CasehistoryController::class);
Route::resource("loadpic2servercapture" ,App\Http\Controllers\Capture\LoadPic2ServerCaptureController::class);
Route::resource("photomove"            ,App\Http\Controllers\Capture\PhotomoveController::class);
Route::resource("dashboardscreening"            ,App\Http\Controllers\Capture\DashboardScreeningController::class);
Route::get('esign/create', [App\Http\Controllers\Capture\EsignController::class, 'create']);


Route::get('regisform',                  function () {return view('upload.regisform');});

Route::resource("uploadexcel", App\Http\Controllers\Capture\UploadController::class);
Route::post('upload/import', [App\Http\Controllers\Capture\UploadController::class, 'import'])->name('upload.import');
// Route::get("uploadexcel",                      function () {return view('upload.index');});

//EndoINDEX
Route::resource("screening"             ,App\Http\Controllers\EndoINDEX\ScreeningController::class);
Route::resource("sms"                   ,App\Http\Controllers\EndoINDEX\SMSController::class);
Route::resource("setup"                 ,App\Http\Controllers\EndoINDEX\SetupController::class);
Route::resource("git"                   ,App\Http\Controllers\EndoINDEX\VersionController::class);
Route::resource("socketio"              ,App\Http\Controllers\EndoINDEX\SocketIOController::class);
Route::resource("function"              ,App\Http\Controllers\EndoINDEX\FunctionController::class);
Route::resource("superadmin"            ,App\Http\Controllers\EndoINDEX\SuperadminController::class);
Route::resource("importexcel"           ,App\Http\Controllers\EndoINDEX\ImportexcelController::class);
Route::resource("department"            ,App\Http\Controllers\EndoINDEX\Department6Controller::class);
Route::resource("deletereport"          ,App\Http\Controllers\EndoINDEX\DelectReportController::class);
Route::resource("boxframework"          ,App\Http\Controllers\EndoINDEX\EndoindexHomeController::class);
Route::resource("exportindex2"          ,App\Http\Controllers\EndoINDEX\ExportIndexController::class);
Route::resource("summarydata"           ,App\Http\Controllers\EndoINDEX\SummaryDataController::class);
Route::resource("operatiodata"          ,App\Http\Controllers\EndoINDEX\OperationDataController::class);
Route::resource("checkphoto"            ,App\Http\Controllers\EndoINDEX\CheckphotoController::class);
//EndoCAPTURE
Route::resource("calendarcase"          ,App\Http\Controllers\EndoCAPTURE\CaseCalendarController::class);
Route::resource("vna"                   ,App\Http\Controllers\EndoCAPTURE\VNAController::class);
Route::resource("vip"                   ,App\Http\Controllers\EndoCAPTURE\VIPController::class);
Route::resource("emr"                   ,App\Http\Controllers\EndoCAPTURE\EMRController::class);
// Route::resource("crop"                  ,App\Http\Controllers\EndoCAPTURE\CropController::class); //Controller ของindex
Route::resource("pacs"                  ,App\Http\Controllers\EndoCAPTURE\PacsController::class);
Route::resource("live"                  ,App\Http\Controllers\EndoCAPTURE\LiveController::class);
// Route::resource("esign"                 ,App\Http\Controllers\EndoCAPTURE\EsignController::class); //Controller ของindex
Route::resource("expdf"                 ,App\Http\Controllers\EndoCAPTURE\ExPDFController::class);
Route::resource("hosxp"                 ,App\Http\Controllers\EndoCAPTURE\HosXPController::class);
Route::resource("jquery"                ,App\Http\Controllers\EndoCAPTURE\JqueryController::class);
Route::resource("income"                ,App\Http\Controllers\EndoCAPTURE\IncomeController::class);
Route::resource("autoit"                ,App\Http\Controllers\EndoCAPTURE\AutoitController::class);
Route::resource("camera"                ,App\Http\Controllers\EndoCAPTURE\CameraController::class);
Route::resource("expdf2"                ,App\Http\Controllers\EndoCAPTURE\ExPDF2Controller::class);
Route::resource("exportindex"           ,App\Http\Controllers\EndoCAPTURE\ExportController::class);
// Route::resource("exportdata"            ,App\Http\Controllers\EndoCAPTURE\ExportDataController::class); //Controller ของindex
// Route::resource("loadpic"               ,App\Http\Controllers\EndoCAPTURE\LoadPicController::class); //Controller ของindex
// Route::resource("patient"               ,App\Http\Controllers\EndoCAPTURE\PatientController::class); //Controller ของindex
Route::resource("addicd9"               ,App\Http\Controllers\EndoCAPTURE\AddICD9Controller::class);
Route::resource("summary"               ,App\Http\Controllers\EndoCAPTURE\SummaryController::class);
Route::resource("monitor"               ,App\Http\Controllers\EndoCAPTURE\MonitorController::class);
Route::resource("billing"               ,App\Http\Controllers\EndoCAPTURE\BillingController::class);
Route::resource("addicd10"              ,App\Http\Controllers\EndoCAPTURE\AddICD10Controller::class);
Route::resource("makeform"              ,App\Http\Controllers\EndoCAPTURE\MakeformController::class);
Route::resource("movecase"              ,App\Http\Controllers\EndoCAPTURE\MovecaseController::class);
Route::resource("multicrop"             ,App\Http\Controllers\EndoCAPTURE\MultiCropController::class);
Route::resource("endosmart"             ,App\Http\Controllers\EndoCAPTURE\EndosmartController::class);
// Route::resource("procedure"             ,App\Http\Controllers\EndoCAPTURE\ProcedureController::class); //Controller ของindex

Route::resource("dashboard"             ,App\Http\Controllers\EndoCAPTURE\DashboardController::class);
Route::resource("dashboardstation"      ,App\Http\Controllers\EndoCAPTURE\DashboardStationController::class);
Route::resource("chdashboard"           ,App\Http\Controllers\EndoCAPTURE\ChDashboardController::class);
Route::resource("allanalysis"           ,App\Http\Controllers\Capture\AllAnalysisController::class);
Route::resource("allhospital"           ,App\Http\Controllers\Capture\AllHospitalController::class);




// Route::resource("imagesort"             ,App\Http\Controllers\EndoCAPTURE\ImageSortController::class); //Controller ของindex
Route::resource("accessory"             ,App\Http\Controllers\EndoCAPTURE\AccessoryController::class);
Route::resource("library"               ,App\Http\Controllers\EndoCAPTURE\VDOLibraryController::class);
Route::resource("send2cloud"            ,App\Http\Controllers\EndoCAPTURE\Send2CloudController::class);
Route::resource("selfupload"            ,App\Http\Controllers\EndoCAPTURE\SelfuploadController::class);
Route::resource("hisconnect"            ,App\Http\Controllers\EndoCAPTURE\HISconnectController::class);
Route::resource("appointment"           ,App\Http\Controllers\EndoCAPTURE\AppointmentController::class);
Route::resource("synchronize"           ,App\Http\Controllers\EndoCAPTURE\SynchronizeController::class);
Route::resource("casemonitor"           ,App\Http\Controllers\EndoCAPTURE\CaseMonitorController::class);
// Route::resource("cameracapvdo"          ,App\Http\Controllers\EndoCAPTURE\CameraCapVDOController::class); //Controller ของindex
// Route::resource("registration"          ,App\Http\Controllers\EndoCAPTURE\RegistrationController::class); //Controller ของindex
Route::resource("loadpic2server"        ,App\Http\Controllers\EndoCAPTURE\LoadPic2ServerController::class);
Route::resource("scopeinformation"      ,App\Http\Controllers\EndoCAPTURE\ScopeinformationController::class);
Route::resource("reportendocapture"     ,App\Http\Controllers\EndoCAPTURE\ReportEndocaptureController::class);
Route::resource('fileexport'            ,App\Http\Controllers\EndoCAPTURE\FileExportController::class);
Route::resource("procedureadvance"      ,App\Http\Controllers\EndoCAPTURE\ProcedureAdvanceController::class);
Route::resource("cal"                   ,App\Http\Controllers\Mobile\CalController::class);
Route::resource("notepdf"               ,App\Http\Controllers\EndoNOTE\NotepdfController::class);
Route::resource("c"                     ,App\Http\Controllers\Short\CShortController::class);
Route::resource("b"                     ,App\Http\Controllers\Short\BShortController::class);
Route::resource("v"                     ,App\Http\Controllers\Short\VShortController::class);
Route::resource("q"                     ,App\Http\Controllers\Short\QShortController::class);
Route::resource("track"                 ,App\Http\Controllers\EndoTRACK\TrackController::class);
Route::resource("track_list"            ,App\Http\Controllers\EndoTRACK\TracklistController::class);
Route::resource("trackchart"            ,App\Http\Controllers\EndoTRACK\TrackchartController::class);
Route::resource("track_search"          ,App\Http\Controllers\EndoTRACK\SearchtrackController::class);
Route::resource("track_detail"          ,App\Http\Controllers\EndoTRACK\TrackdetailController::class);
Route::resource("billhomc"              ,App\Http\Controllers\EndoBILLING\BillingHOMCController::class);
Route::resource("queue"                 ,App\Http\Controllers\EndoQUEUE\QueueController::class);
Route::resource("queuedisplay"          ,App\Http\Controllers\EndoQUEUE\QueueDisplayController::class);
Route::resource("authnew"               ,App\Http\Controllers\CustomAuthController::class);
Route::resource("server"                ,App\Http\Controllers\Endocapture\ServerController::class);
Route::resource("about"                 ,App\Http\Controllers\Endoindex\AboutProjectController::class);
Route::resource('scopemanagement'       ,App\Http\Controllers\EndoTRACK\ScopeManagementController::class);
Route::resource('overall'               ,App\Http\Controllers\OverallController::class);
Route::resource("migrate"               ,App\Http\Controllers\MysqlToMongoController::class);
Route::resource("capsuleupload"         ,App\Http\Controllers\CapsuleUploadController::class);
Route::resource("cookie"         ,App\Http\Controllers\CookieController::class);


Route::resource("selectphoto"         ,App\Http\Controllers\SelectPhotoController::class);
Route::resource("qfile"         ,App\Http\Controllers\QfileController::class);

Route::resource("test"         ,App\Http\Controllers\Endocapture\TestController::class);

Route::resource("exportpdf"         ,App\Http\Controllers\Endocapture\ExportPdfController::class);


Route::get('fullscreenvdo',               function () {return view('Endocapture.cameracapvdo.fullscreen');});

Route::resource("equipment"             ,App\Http\Controllers\EquipmentController::class);

Route::resource("storemanage"             ,App\Http\Controllers\Endocapture\StoremanageController::class);


Route::resource("store"             ,App\Http\Controllers\Endocapture\StoreController::class);

Route::get('2camera',                     function () {return view('Endocapture.camera.2camera');});
Route::get('servererror',               function () {return view('Endocapture.errorserver.index');});
Route::get('m-book',                    function () {return view('Endoindex.mobile.calendar.caselist');});
Route::get('m-cancel',                  function () {return view('Endoindex.mobile.calendar.cancel');});
Route::get('m-event',                   function () {return view('Endoindex.mobile.calendar.event');});
Route::get('m-viewer',                  function () {return view('EndoINDEX.Mobile.viewver_history.index');});
Route::get('m-viewer-caselist',         function () {return view('EndoINDEX.Mobile.viewver_history.case_history');});
Route::get('m-viewer-show',             function () {return view('EndoINDEX.Mobile.viewver_history.case_pdf');});
Route::get('m-register',                function () {return view('EndoINDEX.Mobile.register.index');});
Route::get('m-confirm',                 function () {return view('EndoINDEX.Mobile.register.confirm');});
Route::get('m-usernotfound',            function () {return view('EndoINDEX.Mobile.register.usernotfound');});
Route::get('m-pdpa',                    function () {return view('EndoINDEX.Mobile.register.pdpa');});
//EndoNOTE
Route::get('benz3',                     function () {return view('benz.banktest');});
Route::get('benz',                      function () {return view('benz.index');});
Route::get('benz1',                     function () {return view('benz.test');});
Route::get('benz2',                     function () {return view('benz.test2');});
Route::get('disconnect',                function () {return view('EndoCAPTURE.errorserver.connectlost');});
Route::get('newreport',                 function () {return view('Endoindex.newreport');});
Route::get('queue_record',              function () {return view('queue.record');});
Route::get('qrcode',                    function () {return view('queue.qrcode');});
Route::get('genqrcode',                 function () {return view('queue.genqrcode');});
Route::get('queue_showdetail',          function () {return view('queue.showdetail');});
Route::get('overall',                   function () {return view('overall');});
Route::get('scopeipad',                 function () {return view('EndoCAPTURE.home.Mockup.scope.index');});
Route::get('scopeshow',                 function () {return view('EndoCAPTURE.home.Mockup.scope.show');});
Route::get('overall',                   function () {return view('overall');});
Route::get('login2',                    function () {return view('auth.login2');});
Route::get('showup',                    function () {return view('Endoindex.showup.index');});
Route::get('equitment',                 function () {return view('Endotrack.equitment');});
Route::get('e-sign',                    function () {return view('e-sign');});
Route::get('e-sign3',                   function () {return view('e-sign3');});
Route::get('kiosk_new',                 function () {return view('kiosk.show');});
Route::get('pichn',                     function () {return view('extra.pichn');});
Route::get('endo_index',                function () {return view('index.endo_index');});
Route::get('note_analytic',             function () {return view('EndoNOTE.mockup.analytic');});
Route::get('library_show',              function () {return view('endolibrary.library.show');});
Route::get('nurse_mornitor_control',    function () {return view('EndoCAPTURE.nurse_monitor.control');});
Route::get('newcrop',                   function () {return view('endocapture.crop.newcrop');});
Route::get('nursemonitor2',             function () {return view('EndoCAPTURE.nurse_monitor.newcontrol');});



Route::get('pagenotfound',             function () {return view('blank');});

// Endo6.0
Route::get('endocapture6.0',            function () {return view('Endocapture6.index');});
Route::get('testbank',                  function () {return view('Endocapture.testbank');});
Route::get('lineredirect',              function () {return view('Endoindex.mobile.lineredirect');});
Route::get('schedulesum',               function () {return view('EndoBook.bookingviewer.schedulesum');});



Route::get('bookingview/{id}/edit', [App\Http\Controllers\EndoBOOK\BookingViewController::class, 'edit'])->name('booking.edit');


// Route::get('useraddnew',                [MemberController::class,'useraddnew']);
// Route::get('pdfendosmart',              [PDFController::class,'pdfendosmart']);
// Route::get('login',                     [CustomAuthController::class, 'index'])->name('login');
// Route::post('custom-login',             [CustomAuthController::class, 'customLogin'])->name('login.custom');
// Route::get('registration',              [CustomAuthController::class, 'registration'])->name('register-user');
// Route::post('custom-registration',      [CustomAuthController::class, 'customRegistration'])->name('register.custom');
// Route::get('signout',                   [CustomAuthController::class, 'signOut'])->name('signout');
Route::post('logoutcapture',                   [CustomAuthController::class, 'logoutcapture'])->name('logoutcapture');
Route::post('logout',                   [CustomAuthController::class, 'logout'])->name('logout');

Route::resource('lumina_home',          App\Http\Controllers\Lumina\HomeController::class);


use Livewire\Livewire;

Livewire::setUpdateRoute(function ($handle) {

    // if (file_exists('D:/laragon/htdocs/livewire.txt')) {
    //     $text   = file_get_contents('D:/laragon/htdocs/livewire.txt');
    //     $json   = json_decode($text);
    //     $location = $json->location;
    //     if($location == "local"){
    //         $project = "/".basename(base_path());
    //     }else{
    //         $project = "";
    //     }
    // }else{

    // }
// $project = "";
$project = "/".basename(base_path());
    return Route::post("{$project}/livewire/update", $handle);
});




