-- phpMyAdmin SQL Dump
-- version 4.7.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 02, 2018 at 08:15 AM
-- Server version: 5.6.38
-- PHP Version: 5.6.30

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `jmdesign_samsung`
--

-- --------------------------------------------------------

--
-- Table structure for table `log`
--

CREATE TABLE `log` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tag_id` varchar(50) NOT NULL,
  `time_in` timestamp NULL DEFAULT NULL,
  `time_out` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `route_details`
--

CREATE TABLE `route_details` (
  `id` int(11) NOT NULL,
  `route_id` int(11) NOT NULL,
  `route_details` varchar(255) NOT NULL,
  `route_status` enum('A','D') NOT NULL DEFAULT 'D'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_admin`
--

CREATE TABLE `tbl_admin` (
  `admin_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `user_name` varchar(50) NOT NULL,
  `password` varchar(50) NOT NULL,
  `email` varchar(150) NOT NULL,
  `last_login` date NOT NULL,
  `login_time` time NOT NULL,
  `loginip` varchar(20) NOT NULL,
  `admin_type` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_cab_shift`
--

CREATE TABLE `tbl_cab_shift` (
  `shift_id` int(11) NOT NULL,
  `tag_cab_id` varchar(11) DEFAULT NULL,
  `shift` varchar(25) NOT NULL,
  `date_of_entry` datetime NOT NULL,
  `status` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_driver`
--

CREATE TABLE `tbl_driver` (
  `driver_id` int(11) NOT NULL,
  `bus_id` int(11) NOT NULL,
  `route_id` int(11) NOT NULL,
  `driver_name` varchar(255) DEFAULT NULL,
  `contact_number` varchar(255) DEFAULT NULL,
  `emergency_contact_person` varchar(255) DEFAULT NULL,
  `emergency_number` varchar(255) DEFAULT NULL,
  `relationship` varchar(255) DEFAULT NULL,
  `license_number` varchar(255) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `state` varchar(255) DEFAULT NULL,
  `pincode` int(11) NOT NULL,
  `country` varchar(255) DEFAULT NULL,
  `status` varchar(4) DEFAULT NULL,
  `date` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_master`
--

CREATE TABLE `tbl_master` (
  `id` int(20) DEFAULT NULL,
  `tag_no` bigint(20) NOT NULL,
  `tag_id` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_monthly_round`
--

CREATE TABLE `tbl_monthly_round` (
  `id` int(10) NOT NULL,
  `year` int(10) NOT NULL,
  `month` int(10) NOT NULL,
  `round` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_penalty`
--

CREATE TABLE `tbl_penalty` (
  `id` int(10) NOT NULL,
  `vehicle_id` int(10) NOT NULL,
  `tag_id` varchar(50) NOT NULL,
  `vehicle_number` varchar(50) NOT NULL,
  `reason` varchar(300) NOT NULL,
  `amount` varchar(150) NOT NULL,
  `pdate` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_route`
--

CREATE TABLE `tbl_route` (
  `id` int(10) NOT NULL,
  `vehicle_id` int(10) NOT NULL,
  `route_no` varchar(10) NOT NULL,
  `change_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `new_route_no` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_route_master`
--

CREATE TABLE `tbl_route_master` (
  `route_id` int(11) NOT NULL,
  `route_bus_id` int(11) DEFAULT NULL,
  `route_tag_id` varchar(255) DEFAULT NULL,
  `route_no` int(11) DEFAULT NULL,
  `route_zone` varchar(255) DEFAULT NULL,
  `route_fuel_type` varchar(255) DEFAULT NULL,
  `route_kms_to_fro` int(11) DEFAULT NULL,
  `date_of_entry` datetime DEFAULT NULL,
  `status` varchar(4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_tag_daynight`
--

CREATE TABLE `tbl_tag_daynight` (
  `id` int(11) NOT NULL,
  `tag_cab_id` int(11) NOT NULL,
  `tag_no` int(11) NOT NULL,
  `shift` varchar(25) NOT NULL,
  `date_of_entry` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_tag_master`
--

CREATE TABLE `tbl_tag_master` (
  `id` int(11) NOT NULL,
  `route_bus_id` int(11) NOT NULL,
  `route_tag_id` varchar(255) NOT NULL,
  `route_id` int(11) DEFAULT NULL,
  `date_of_entry` varchar(255) NOT NULL,
  `v_status` varchar(4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_tag_master_cab`
--

CREATE TABLE `tbl_tag_master_cab` (
  `cab_id` int(11) NOT NULL,
  `tag_cab_id` varchar(11) DEFAULT NULL,
  `tag_id` varchar(255) DEFAULT NULL,
  `date_of_entry` datetime NOT NULL,
  `cab_status` enum('D','N') NOT NULL DEFAULT 'D'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tbl_vehicle_master`
--

CREATE TABLE `tbl_vehicle_master` (
  `vehicle_id` int(10) NOT NULL,
  `tag_no` int(20) NOT NULL,
  `tag_id` varchar(50) NOT NULL,
  `shift` enum('D','N') NOT NULL DEFAULT 'D',
  `alias_tag` varchar(50) DEFAULT NULL,
  `alias_tag1` varchar(25) DEFAULT NULL,
  `alias_tag2` varchar(25) DEFAULT NULL,
  `alias_tag3` varchar(25) DEFAULT NULL,
  `vehicle_type` enum('Bus','Cab') DEFAULT NULL,
  `vehicle_number` varchar(20) NOT NULL,
  `insurance_expiry_date` date NOT NULL,
  `pollution_expiry_date` date NOT NULL,
  `charges` varchar(50) NOT NULL,
  `route_no` int(10) DEFAULT NULL,
  `route_name` varchar(150) DEFAULT NULL,
  `zone` varchar(150) DEFAULT NULL,
  `fuel_type` varchar(100) DEFAULT NULL,
  `km_to_fro` int(10) DEFAULT NULL,
  `seating_capacity` varchar(200) DEFAULT NULL,
  `acutal_seating_capacity` varchar(200) DEFAULT NULL,
  `cab_type` varchar(150) DEFAULT NULL,
  `vender` varchar(100) DEFAULT NULL,
  `Vehicle_model` varchar(200) DEFAULT NULL,
  `registration_date` date NOT NULL,
  `fitness` varchar(200) NOT NULL,
  `permit` varchar(200) NOT NULL,
  `remark` varchar(350) NOT NULL,
  `driver_name` varchar(100) DEFAULT NULL,
  `contact_number` varchar(20) DEFAULT NULL,
  `emergency_contact_person` varchar(200) DEFAULT NULL,
  `emergency_number` varchar(20) DEFAULT NULL,
  `relationship` varchar(150) DEFAULT NULL,
  `license_number` varchar(20) DEFAULT NULL,
  `address` varchar(200) DEFAULT NULL,
  `city` varchar(50) DEFAULT NULL,
  `state` varchar(50) DEFAULT NULL,
  `pincode` int(10) DEFAULT NULL,
  `country` varchar(30) DEFAULT NULL,
  `status` enum('A','D') NOT NULL DEFAULT 'A',
  `date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `unknowntag`
--

CREATE TABLE `unknowntag` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `tag_id` varchar(50) NOT NULL,
  `time_in` timestamp NULL DEFAULT NULL,
  `time_out` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `log`
--
ALTER TABLE `log`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `route_details`
--
ALTER TABLE `route_details`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `tbl_admin`
--
ALTER TABLE `tbl_admin`
  ADD PRIMARY KEY (`admin_id`);

--
-- Indexes for table `tbl_cab_shift`
--
ALTER TABLE `tbl_cab_shift`
  ADD PRIMARY KEY (`shift_id`);

--
-- Indexes for table `tbl_driver`
--
ALTER TABLE `tbl_driver`
  ADD PRIMARY KEY (`driver_id`);

--
-- Indexes for table `tbl_monthly_round`
--
ALTER TABLE `tbl_monthly_round`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `id` (`id`);

--
-- Indexes for table `tbl_penalty`
--
ALTER TABLE `tbl_penalty`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `tbl_route`
--
ALTER TABLE `tbl_route`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `id` (`id`);

--
-- Indexes for table `tbl_route_master`
--
ALTER TABLE `tbl_route_master`
  ADD PRIMARY KEY (`route_id`);

--
-- Indexes for table `tbl_tag_daynight`
--
ALTER TABLE `tbl_tag_daynight`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `tbl_tag_master`
--
ALTER TABLE `tbl_tag_master`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `tbl_tag_master_cab`
--
ALTER TABLE `tbl_tag_master_cab`
  ADD PRIMARY KEY (`cab_id`);

--
-- Indexes for table `tbl_vehicle_master`
--
ALTER TABLE `tbl_vehicle_master`
  ADD PRIMARY KEY (`vehicle_id`);

--
-- Indexes for table `unknowntag`
--
ALTER TABLE `unknowntag`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `log`
--
ALTER TABLE `log`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32835;
--
-- AUTO_INCREMENT for table `route_details`
--
ALTER TABLE `route_details`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT for table `tbl_admin`
--
ALTER TABLE `tbl_admin`
  MODIFY `admin_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `tbl_cab_shift`
--
ALTER TABLE `tbl_cab_shift`
  MODIFY `shift_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `tbl_driver`
--
ALTER TABLE `tbl_driver`
  MODIFY `driver_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `tbl_monthly_round`
--
ALTER TABLE `tbl_monthly_round`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `tbl_penalty`
--
ALTER TABLE `tbl_penalty`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `tbl_route`
--
ALTER TABLE `tbl_route`
  MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;
--
-- AUTO_INCREMENT for table `tbl_route_master`
--
ALTER TABLE `tbl_route_master`
  MODIFY `route_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `tbl_tag_daynight`
--
ALTER TABLE `tbl_tag_daynight`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `tbl_tag_master`
--
ALTER TABLE `tbl_tag_master`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `tbl_tag_master_cab`
--
ALTER TABLE `tbl_tag_master_cab`
  MODIFY `cab_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `tbl_vehicle_master`
--
ALTER TABLE `tbl_vehicle_master`
  MODIFY `vehicle_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `unknowntag`
--
ALTER TABLE `unknowntag`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25661;COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
