<?php

use Illuminate\Database\Seeder;

class UserTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
//        // 使用者
//        DB::table('User')->insert([
//            'name' => "Test123",
//            'password' => bcrypt('test123'),
//            'Auth_level' => "管理者",
//            'Status' => "測試用",
//            'Group_ID' => 1,
//        ]);

        // 設備群組
        DB::table('Device_Group')->insert([
            'Group_Name'=>'國道187km',
            'Point_A_Device'=>1,
            'Point_B_Device'=>2,
            'Distance'=>10000,
            'Speed_Limit'=>110,
            'Prohibited_Vehicles'=>"機車"
        ]);

        DB::table('Device_Group')->insert([
            'Group_Name'=>'雪隧222km',
            'Point_A_Device'=>3,
            'Point_B_Device'=>4,
            'Distance'=>9000,
            'Speed_Limit'=>110,
            'Prohibited_Vehicles'=>"機車"
        ]);

        DB::table('Device_Group')->insert([
            'Group_Name'=>'國道987km',
            'Point_A_Device'=>5,
            'Point_B_Device'=>6,
            'Distance'=>8900,
            'Speed_Limit'=>110,
            'Prohibited_Vehicles'=>"機車"
        ]);

        // 設備
        DB::table('Device')->insert([
            'ID'=>1,
            'Location'=>'國道0km',
            'GPS'=>'123.1234,456.4567',
            'Server_ID'=>1,
            'Device_Group_ID'=>1,
        ]);
        DB::table('Device')->insert([
            'ID'=>2,
            'Location'=>'國道187km',
            'GPS'=>'234.6789,345.2678',
            'Server_ID'=>1,
            'Device_Group_ID'=>1,
        ]);
        DB::table('Device')->insert([
            'ID'=>3,
            'Location'=>'國道333km',
            'GPS'=>'123.1234,456.4567',
            'Server_ID'=>1,
            'Device_Group_ID'=>2,
        ]);
        DB::table('Device')->insert([
            'ID'=>4,
            'Location'=>'國道444km',
            'GPS'=>'234.6789,345.2678',
            'Server_ID'=>1,
            'Device_Group_ID'=>2,
        ]);
        DB::table('Device')->insert([
            'ID'=>5,
            'Location'=>'國道555km',
            'GPS'=>'123.1234,456.4567',
            'Server_ID'=>1,
            'Device_Group_ID'=>3,
        ]);
        DB::table('Device')->insert([
            'ID'=>6,
            'Location'=>'國道666km',
            'GPS'=>'234.6789,345.2678',
            'Server_ID'=>1,
            'Device_Group_ID'=>3,
        ]);

//        // 使用者群組
//        DB::table('Group')->insert([
//            'Group_Name'=>'測試群1',
//            'Group_Detail'=>'Hi',
//        ]);
//
//        // 頁面
//        $routes=["admin/account/create","admin/account/update","admin/account/delete","admin/account/select/where","admin/account/group/create","admin/account/group/update","admin/account/group/delete","login","plates/select","plates/update","plates/delete","dashboard/select","device/create","device/select","device/update","device/delete","device/group/create","device/group/select","device/group/update","device/group/delete"];
//        $routes_name=["新增帳號","修改帳號","刪除帳號","查詢帳號","新增群組","修改群組","刪除群組","登錄","查詢舉發資料","修改舉發資料","註銷舉發資料","查詢日誌","新增設備","查詢設備","修改設備","刪除設備","新增設備群組","查詢設備群組","修改設備群組","刪除設備群組"];
//        for ($i =0;$i<count($routes);$i++){
//            DB::table('Pages')->insert([
//                'Page_Name'=>$routes_name[$i],
//                'Route'=>$routes[$i],
//            ]);
//        }
//        for($i =0 ;$i<=10;$i++){
//            // 車牌辨識測速結果
//            DB :: table('Alpr')->insert([
//                "Plate_Number"=>"8503-LX",
//                "Car_Type"=>"自小客車",
//                "Point_A_Enter_DateTime"=>"2020-09-02 05:55:01",
//                "Point_A_Device"=>1,
//                "Point_A_Image_Path"=>"nas/alpr/influxTest/8503-LX.jpg",
//                "Point_B_Enter_DateTime"=>"2020-09-02 05:56:20",
//                "Point_B_Device"=>2,
//                "Point_B_Image_Path"=>"nas/alpr/influxTest/8503-LX_0.jpg",
//                "Passing_Time"=>79,
//                "Distance"=>9000,
//                "Speed"=>113.9,
//                "Speed_Limit"=>110,
//                "Prohibited_Vehicles"=>"機車",
//                "Violation"=>"超速",
//                "Location"=>"國道187km",
//                "Status"=>"待審核",
//            ]);
//        }
    }
}
