You are on page 1of 8

//EVENT MANAGEMENT

<html>
<body>
<table id="eventForm" style="border: 1px solid black;width: 80%;text-align:
center;background-color: #fe45e0">
<tr><td colspan="2"><h1>Event Management System</h1><hr></td></tr>
<div id="creationDiv" style="display: block;">
<form action="#" id="createEvent"
onsubmit="event.preventDefault();validateCreation();">
<tr><td colspan="2"><h2>Event Creation Form</h2></td></tr>
<tr>
<td>
<label for="eventId">Event Id</label>
</td>
<td>
<input type="number" id="eventId">
<span id="err1"></span>
</td>
</tr>
<tr>
<td>
<label for="department">Department</label>
</td>
<td>
<select id="department">
<option value="Admin">Admin</option>
<option value="HR">HR</option>
<option value="Finance">Finance</option>
<option value="Network">Network</option>
</select>
<span id="err2"></span>
</td>
</tr>
<tr>
<td>
<label for="status">Status</label>
</td>
<td>
<select id="status">
<option value="Open">Open</option>
<option value="In Progress">In Progress</option>
<option value="Rejected">Rejected</option>
<option value="Complete">Complete</option>
</select>
<span id="err3"></span>
</td>
</tr>
<tr>
<td>
<label for="description">Description</label>
</td>
<td>
<input type="text" id="description">
<span id="err4"></span>
</td>
</tr>
<tr>
<td>
<label for="raisedBy">Raised By</label>
</td>
<td>
<input type="text" id="raisedBy">
<span id="err5"></span>
</td>
</tr>
<tr>
<td>
<label for="contactPhone">Contact Phone</label>
</td>
<td>
<input type="text" id="contactPhone">
<span id="err6"></span>
</td>
</tr>
<tr>
<td colspan="2"><input id="create" type="submit" value="Create"><input id="cancel"
type="reset" value="Cancel"></td>
</tr>
</form>
</div>
<div id="resultDiv" style="display: none;">
<p>An event is created with id = <span id="eid"></span></p>
<p>Department :<span id="dep"></span></p>
<p>Status :<span id="sta"></span></p>
<p>Raised By :<span id="rai"></span></p>
<button id="close" onclick="show()">Close</button>
</div>
</table>
<script type="text/javascript">
function validateCreation() {
var err = false;
if(document.getElementById('eventId').value =="") {
document.getElementById('err1').innerText="This field is required";
err=true;
}
if(document.getElementById('department').value =="") {
document.getElementById('err2').innerText="This field is required";
err=true;
}
if(document.getElementById('status').value =="") {
document.getElementById('err3').innerText="This field is required";
err=true;
}
if(document.getElementById('description').value =="") {
document.getElementById('err4').innerText="This field is required";
err=true;
}
if(document.getElementById('raisedBy').value =="") {
document.getElementById('err5').innerText="This field is required";
err=true;
}
if(document.getElementById('contactPhone').value =="") {
document.getElementById('err6').innerText="This field is required";
err=true;
}
if(!err) {
document.getElementById('creationDiv').style.display = "none";
document.getElementById('resultDiv').style.display = "block";
document.getElementById('eid').innerText =
document.getElementById('eventId').value;
document.getElementById('dep').innerText =
document.getElementById('department').value;
document.getElementById('sta').innerText = document.getElementById('status').value;
document.getElementById('rai').innerText =
document.getElementById('raisedBy').value;
}
}
function show() {
document.getElementById('creationDiv').style.display = "block";
document.getElementById('resultDiv').style.display = "none";
}
</script>
</body>
</html>

//UNIX count employee count word

[11:30, 3/3/2019] Reaper: #!/bin/bash


#write your code here
if [ "$#" -ne 2 ]; then
echo "Pass appropriate number of command line arguments"
file=$1
if [ ! -e "$file" ]; then
echo "Input file does not exist"
if [ ! -f "$file" ]; then
echo "Input file is not an ordinary file"
if [ ! -r "$file" ]; then
echo "Input file does not have read permission"
else
grep -cwi $2 $file
fi
fi
fi
fi

//abc

<html>
<body>
<div id="message" style="display: block;">
</div>
<h1 style="text-align: center;">ABC Hotels</h1><hr>
<table align="center" id="contactTable" style="width: 20%;text-align: center;">
<form id="contactCustomer" name="contactCustomer" action="#"
onsubmit="event.preventDefault();validateCreation();">
<tr>
<td>
<input type="text" id="name" placeholder="Customer Name" maxlength="50" required>
<span id="err1"></span>
</td>
</tr>
<tr>
<td>
<input type="text" id="age" placeholder="Customer Age" min="20" max="65" required>
<span id="err2"></span>
</td>
</tr>
<tr>
<td>
<input type="email" id="email" placeholder="Customer Email" required>
</td>
</tr>
<tr><td><textarea rows="4" cols="22" id="address" placeholder="Customer Address"
required></textarea></td></tr>
<tr>
<td>
<input type="text" id="phone" placeholder="Customer Phone" required>
</td>
</tr>
<tr>
<td colspan="2"><input style="background-color: #fe45e4" id="create" type="submit"
value="Send"><input style="background-color: #fe45e4" id="cancel" type="reset"
value="Cancel"></td>
</tr>
</form>
</table>
<script type="text/javascript">
function validateCreation() {
document.getElementById('message').innerText = "Customer Contact Created";
}
</script>
</body>
</html>

//Average salary Unix


#!/bin/bash
#write your code here

sum=0
count=0
firstLine=0
found=0

if [ $# -ne 2 ] ; then
echo "Pass appropriate number of command line arguments"
elif [ -d $1 ]; then
echo "Input file is not an ordinary file"
elif [ ! -f $1 ] ; then
echo "Input file does not exist"
elif [ ! -r $1 ]; then
echo "Input file does not have read permission"
else
while read -r line; do
if [ $firstLine -eq 0 ] ; then
firstLine=1
else
while IFS=',' read -r a b c; do
if [ $b = $2 ] ; then
found=1
sum="$(($sum + $c))"
count="$(($count + 1))"
fi
done <<< "$line"
fi
done < "$1"
avg="$(($sum / $count))"

if [ $found -eq 0] ; then


echo "Given designation not found"
else
echo $avg
fi
fi

//Vehicle registration

<html>
<head>
<title>Vehicle Registration</title>
<script type="text/javascript" scr="index.js" ></script>
</head>
<body>
<form id="registerVehicle">
<h1>Motor Vehicle Department of Kerala</h1>
<div id="registerDiv">
<h2>Vehicle Registration Form</h2>
</div>
<table style="border:; 1px solid black; width: 80%; text-align: center;
background-color:#EF45E0;" id="vehicle">
<tr>
<td>Full name of Applicant</td>
<td>
<input type="text" required id="fullName" />
<span id="err1"></span>
</td>
</tr>
<tr>
<td>Age</td>
<td>
<input type="number" required id="age" />
<span id="err2"></span>
</td>
</tr>
<tr>
<td>Permanent Address</td>
<td>
<textarea required id="address"></textarea>
<span id="err3"></span>
</td>
</tr>
<tr>
<td>Contact Phone</td>
<td>
<input required type="text" id="phone" />
<span id="err4"></span>
</td>
</tr>
<tr>
<td>Class of vehicle</td>
<td>
<select id="vehClass">
<option value="Motorcycle With out Gear">Motorcycle
With out Gear</option>
<option value="Motorcycle With Gear">Motorcycle With
Gear</option>
<option value="Motor Car">Motor Car</option>
<option value="Light Motor Vehicle-Transport">Light
Motor Vehicle-Transport</option>
</select>
<span id="err5"></span>
</td>
</tr>
<tr>
<td>Engine No</td>
<td>
<input type="number" id="engineNo"/>
<span id="err6"></span>
</td>
</tr>
<tr>
<td colspan="2">
<button type="submit" id="register">Register</button>
<button type="reset" id="cancel">Cancel</button>
</td>
</tr>
</table>
</form>

<div id="resultDiv">Close</div>
</body>
</html>

//Contact list
<html>
<head>
<script type="text/javascript" src="index.js"></script>
</head>
<body>
<table id="contactList" border="1ps" width="80%" align="center">
<tr style="background-color:#42aaf4">
<th>Phone No.</th>
<th>Name</th>
<th>Gender</th>
<th>City</th>
<th>Action</th> </tr>

<tr>
<td>9874563210</td>
<td>Akshay Kumar</td>
<td>Male</td>
<td>Chennai</td>
<td><input id="delete1" type="Button" value="delete"
onclick="confirmDelete(this)"></td>
</tr>
<tr>
<td>9632587410</td>
<td>Shyama P</td>
<td>Female</td>
<td>Trivandrum</td>
<td><input id="delete2" type="Button" value="delete"
onclick="confirmDelete(this)"></td>
</tr>
<tr>
<td>7896541230</td>
<td>Malini Kumar</td>
<td>Female</td>
<td>Bangalore</td>
<td><input id="delete3" type="Button" value="delete"
onclick="confirmDelete(this)"></td>
</tr>
<tr>
<td>9513571233</td>
<td>Raj Shyam</td>
<td>Male</td>
<td>Chennai</td>
<td><input id="delete4" type="Button" value="delete"
onclick="confirmDelete(this)"></td>
</tr>
<tr>
<td>8745632109</td>
<td>Sundar G</td>
<td>Male</td>
<td>Manglore</td>
<td><input id="delete5" type="Button" value="delete"
onclick="confirmDelete(this)"></td>
</tr>
<tr>
<td>9874563210</td>
<td>Kishore P</td>
<td>Male</td>
<td>Calicut</td>
<td><input id="delete6" type="Button" value="delete"
onclick="confirmDelete(this)"></td>
</tr>
</table>
</body>
<script type="text/javascript">
function confirmDelete(x) {
var r = confirm("Press a button!");
if (r == true) {
deleteContact(x);
}
}
function deleteContact(x) {
var l = x.id.slice(-1);
document.getElementById("contactList").deleteRow(parseInt(l));
}
</script>
</html>

//AVERAGE salary

if [ "$#" -ne 2 ]; then


echo "Pass appropriate number of command line arguments"
exit 0
fi
echo $file
if [ ! -d "$file" ]; then
echo "Input file is not an ordinary file"
exit 0
fi
if [ ! -e "$file" ]; then
echo "Input file does not exist"
exit 0
fi
if [ ! -r "$file" ]; then
echo "Input file does not have read permission"
exit 0
fi
res = `grep -ci $2 $1`
if [ $res -ne 0]; then
echo "Given designation not found"
exit 0
if
grep -i $2 $1 | awk -F, '{sum+=$3} END {print sum}'

You might also like