<commit_before>var express    = require("express");
 var mysql      = require('mysql');
 var connection = mysql.createConnection({
   host     : 'localhost',
   user     : 'root',
   password : '<PASSWORD>',
   database : 'transport'
 });
var bodyParser = require('body-parser');
 var app = express();

app.use(express.static('app'));
var urlencodedParser = bodyParser.urlencoded({ extended: false })

app.get('/', function (req, res) {
   res.sendFile("app/index.html" );
})
//select the username and password from login table
app.post('/login-card',  urlencodedParser,function (req, res)
{

	var username={"username":req.query.username};
    var password={"password":<PASSWORD>};
       connection.query('SELECT role_name  from role where id=(select role_id from employee where ? and ? )',[username,password],
       	function(err, rows)
       	{
		if(!err)
		{
		if(rows.length>0)
		{
      	//console.log(rows);
			res.status(200).json({'returnval': rows});
		}
		else
		{
			res.status(200).json({'returnval': 'invalid'});
		}
	}
});
	});

//select the route

app.post('/getroute' ,  urlencodedParser,function (req, res)
{	
	    connection.query('select route_name from route',
       	function(err, rows)
       	{
      	if(!err)
		{
			if(rows.length>0)
			{
				//console.log(rows);
			res.status(200).json({'returnval': rows});
			}
			else
			{
			res.status(200).json({'returnval': 'invalid'});
			}
		}
		else
		{
			console.log('No data Fetched'+err);
		}
});
	});



app.post('/getroutedetail' ,  urlencodedParser,function (req, res)
{
	var routename={"route_name":req.query.routename};
	var trip={"trip":req.query.tripnos};
	//console.log('in server...');
	//console.log('hello route'+routename);
	//console.log('hello trip...'+trip);
	connection.query('select * from point where route_id=(select id from route where ?) and ?',[routename,trip],
   	function(err, rows){
		if(!err){
			if(rows.length>0){
				//console.log(rows);
				res.status(200).json({'returnval': rows});
			} else {
				res.status(200).json({'returnval': 'invalid'});
			}
		} else{
				console.log('No data Fetched'+err);
			}
		});
});


app.post('/insertpoint' ,  urlencodedParser,function (req, res)
{
		
		var rouname={"id":req.query.id,"point_name":req.query.points,"route_id":req.query.routes,"trip":req.query.trip,"pickup_time":req.query.pick,"drop_time":req.query.drop};
		//console.log('in server...'+routename);
		//console.log(rouname);
	    connection.query('insert into point set ?',[rouname],
       	function(err, rows)
       	{
		if(!err)
		{
			console.log('inserted');
			res.status(200).json({'returnval': 'success'});
		}
		else
		{
			console.log("error");
			console.log(err);
			res.status(200).json({'returnval': 'invalid'});
		}
		
	
});
	});


app.post('/routeid' ,  urlencodedParser,function (req, res)
{
		
		 var routename={"route_name":req.query.routename};
		 console.log(routename);
	    connection.query('select * from route where ?',[routename], 
       	function(err, rows)
       	{
		if(!err)
		{
			if(rows.length>0)
			{
				console.log(rows);
			res.status(200).json({'returnval': rows});
			}
			else
			{
			res.status(200).json({'returnval': 'invalid'});
			}
		}
		else
		{
			console.log('No data Fetched'+err);
		}
		
		
	
});
	});


app.post('/gradediscount' ,  urlencodedParser,function (req, res)
{
		
		 var gradename={"grade_type":req.query.grade};
		 console.log(gradename);
	    connection.query('select discount_percent from md_discount where ?',[gradename], 
       	function(err, rows)
       	{
		if(!err)
		{
			if(rows.length>0)
			{
				console.log(rows);
			res.status(200).json({'returnval': rows});
			}
			else
			{
			res.status(200).json({'returnval': 'invalid'});
			}
		}
		else
		{
			console.log('No data Fetched'+err);
		}
		
		
	
});
	});






app.post('/sequence' ,  urlencodedParser,function (req, res)
{
	
	    connection.query('select count(id) as count from point',
       	function(err, rows)
       	{
      	if(!err)
		{
			if(rows.length>0)
			{
				
			res.status(200).json({'returnval': rows});
			}
			else
			{
			res.status(200).json({'returnval': 'invalid'});
			}
		}
		else
		{
			console.log('No data Fetched'+err);
		}
});<commit_msg>test 1<commit_after>var express    = require("express");
 var mysql      = require('mysql');
 var connection = mysql.createConnection({
   host     : 'localhost',
   user     : 'root',
   password : '<PASSWORD>',
   database : 'transport'
 });
var bodyParser = require('body-parser');
 var app = express();

app.use(express.static('app'));
var urlencodedParser = bodyParser.urlencoded({ extended: false })

app.get('/', function (req, res) {
   res.sendFile("app/index.html" );
})
//select the username and password from login table
app.post('/login-card',  urlencodedParser,function (req, res)
{

	var username={"username":req.query.username};
    var password={"password":<PASSWORD>};
       connection.query('SELECT role_name  from role where id=(select role_id from employee where ? and ? )',[username,password],
       	function(err, rows)
       	{
		if(!err)
		{
		if(rows.length>0)
		{
      	//console.log(rows);
			res.status(200).json({'returnval': rows});
		}
		else
		{
			res.status(200).json({'returnval': 'invalid'});
		}
	}
});
	});

//select the route

app.post('/getroute' ,  urlencodedParser,function (req, res)
{	
	    connection.query('select route_name from route',
       	function(err, rows)
       	{
      	if(!err)
		{
			if(rows.length>0)
			{
				//console.log(rows);
			res.status(200).json({'returnval': rows});
			}
			else
			{
			res.status(200).json({'returnval': 'invalid'});
			}
		}
		else
		{
			console.log('No data Fetched'+err);
		}
});
	});



app.post('/getroutedetail' ,  urlencodedParser,function (req, res)
{
	var routename={"route_name":req.query.routename};
	var trip={"trip":req.query.tripnos};
	//console.log('in server...');
	//console.log('hello route'+routename);
	//console.log('hello trip...'+trip);
	connection.query('select * from point where route_id=(select id from route where ?) and ?',[routename,trip],
   	function(err, rows){
		if(!err){
			if(rows.length>0){
				//console.log(rows);
				res.status(200).json({'returnval': rows});
			} else {
				res.status(200).json({'returnval': 'invalid'});
			}
		} else{
				console.log('No data Fetched'+err);
			}
		});
});


app.post('/insertpoint' ,  urlencodedParser,function (req, res)
{
		
		var rouname={"id":req.query.id,"point_name":req.query.points,"route_id":req.query.routes,"trip":req.query.trip,"pickup_time":req.query.pick,"drop_time":req.query.drop};
		//console.log('in server...'+routename);
		//console.log(rouname);
	    connection.query('insert into point set ?',[rouname],
       	function(err, rows)
       	{
		if(!err)
		{
			console.log('inserted');
			res.status(200).json({'returnval': 'success'});
		}
		else
		{
			console.log("error");
			console.log(err);
			res.status(200).json({'returnval': 'invalid'});
		}
		
	
});
	});


app.post('/routeid' ,  urlencodedParser,function (req, res)
{
		
		 var routename={"route_name":req.query.routename};
		 console.log(routename);
	    connection.query('select * from route where ?',[routename], 
       	function(err, rows)
       	{
		if(!err)
		{
			if(rows.length>0)
			{
				console.log(rows);
			res.status(200).json({'returnval': rows});
			}
			else
			{
			res.status(200).json({'returnval': 'invalid'});
			}
		}
		else
		{
			console.log('No data Fetched'+err);
		}
		
		
	
});
	});


app.post('/gradediscount' ,  urlencodedParser,function (req, res)
{
		
		 var gradename={"grade_type":req.query.grade};
		 console.log(gradename);
	    connection.query('select discount_percent from md_discount where ?',[gradename], 
       	function(err, rows)
       	{
		if(!err)
		{
			if(rows.length>0)
			{
				console.log(rows);
			res.status(200).json({'returnval': rows});
			}
			else
			{
			res.status(200).json({'returnval': 'invalid'});
			}
		}
		else
		{
			console.log('No data Fetched'+err);
		}
		
		
	
});
	});
app.post('/sequence' ,  urlencodedParser,function (req, res)
{
	
	    connection.query('select count(id) as count from point',
       	function(err, rows)
       	{
      	if(!err)
		{
			if(rows.length>0)
			{
				
			res.status(200).json({'returnval': rows});
			}
			else
			{
			res.status(200).json({'returnval': 'invalid'});
			}
		}
		else
		{
			console.log('No data Fetched'+err);
		}
});
{'fraction_non_alphanumeric': 0.19261370383564896, 'fraction_numerical': 0.011518821992637453, 'mean_word_length': 3.177579365079365, 'pattern_counts': {'":': 24, '<': 7, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3125076', 'n_tokens_mistral': 3477, 'n_tokens_neox': 2985, 'n_words': 475}