@ 2014-03-28T16:48:45Z <?php
$nameErr= $surnameErr = "";
$name= $surname = "";
$errors= "";
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
if(empty($_POST['customer_name'])){
$errors[] = "Please provide with name";
}
if(count($errors)>0) $errors = implode('<br />',$errors);
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta content="text/javascript"/>
<link rel="stylesheet" type="text/css" href="css/blitzer/backsty.css">
<script type="text/javascript">
window.onload=function(){
var tfrow = document.getElementById('tfhover').rows.length;
var tbRow=[];
for (var i=1;i<tfrow;i++) {
tbRow[i]=document.getElementById('tfhover').rows[i];
tbRow[i].onmouseover = function(){
this.style.backgroundColor = '#F6D4D4';
};
tbRow[i].onmouseout = function() {
this.style.backgroundColor = '#EB8686';
};
}
};
</script>
<script type="text/javascript">
function confirm_click(customer_name)
{
return confirm("Are you sure you want to delete "+ customer_name +" from the database ?");
}
/*
function validateEmail()
{
var emailID = document.userForm.customer_email.value;
atpos = emailID.indexOf("@");
dotpos = emailID.lastIndexOf(".");
if (atpos < 1 || ( dotpos - atpos < 2 ))
{
alert("Please provide correct email ID")
document.userForm.customer_email.focus() ;
return false;
}
return( true );
}
function validatePost()
{
var postID = document.userForm.customer_post.value; regPostcode = /^([a-zA-Z]){1}([0-9][0-9]|[0-9]|[a-zA-Z][0-9][a-zA-Z]|[a-zA-Z][0-9][0-9]|[a-zA-Z][0-9]){1}([ ])([0-9][a-zA-z][a-zA-z]){1}$/;
if(regPostcode.test(postID) == false)
{
alert("Please provide the correct Postcode");
document.userForm.customer_post.focus() ;
return false;
}
return ( true ) ;
}
function validate()
{
if( document.userForm.customer_name.value == "" )
{
alert("Please provide the customer name!");
document.userForm.customer_name.focus() ;
return false;
}
if( document.userForm.customer_surname.value == "" )
{
alert( "Please provide the customer surname!" );
document.userForm.customer_surname.focus() ;
return false;
}
if( document.userForm.customer_email.value == "" )
{
alert( "Please provide the correct Email!" );
document.userForm.customer_email.focus() ;
return false;
}else{
var ret = validateEmail();
if( ret == false )
{
return false;
}
}
if( document.userForm.address_line_1.value == "")
{
alert( "Please provide the correct address" );
document.userForm.address_line_1.focus() ;
return false;
}
if( document.userForm.customer_post.value == "" )
{
alert( "Please provide the correct postcode!" );
document.userForm.customer_post.focus() ;
return false;
}else{
var ret = validatePost();
if( ret == false )
{
return false;
}
}
if( document.userForm.customer_county.value == "0" )
{
alert( "Please provide your county!" );
document.userForm.customer_username.focus() ;
return false;
}
if( document.userForm.customer_username.value == "" )
{
alert( "Please provide a valid Username!" );
document.userForm.customer_username.focus() ;
return false;
}
var passw = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,20}$/;
if(document.userForm.customer_password.value.match(passw))
{
return true;
}
else
{
alert('Please provide a valid password which contains 6 to 20 characters which contain at least one numeric digit, one uppercase and one lowercase letter.')
return false;
}
} */
</script>
</head>
<body>
<form method="LINK" ACTION="index_mod.php">
<input type="submit" class="button2" value="Admin Home" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<h1>Customer Management</h1>
</form>
<div id="content">
<table>
<form onsubmit="return(validate());" name="userForm" method="post" autocomplete="off">
<tr>
<td>Name</td>
<td><input type="text" class="textbox" name="customer_name" /></td><td><span class="error">* <?php echo $errors;?></span> </td>
</tr><tr>
<td>Surname</td>
<td><input type="text" class="textbox" name="customer_surname" /></td>
</tr><tr>
<td>Email</td>
<td><input type="text" class="textbox" name="customer_email" /></td>
</tr><tr>
<td>Address1</td>
<td><input type="text" class="textbox" name="address_line_1" /></td>
</tr><tr>
<td>Address2</td>
<td><input type="text" class="textbox" name="address_line_2" /></td>
</tr><tr>
<td>Post code</td>
<td><input type="text" class="textbox" name="customer_post" /></td>
</tr><tr>
<td>County<td> <select class="textbox" name="customer_county">
<option value="0">Please select</option>
<option value="Aberdeenshire">Aberdeenshire</option>
<option value="Anglesey">Anglesey</option>
<option value="Angus (Forfarshire)">Angus (Forfarshire)</option>
<option value="Antrim">Antrim</option>
<option value="Argyll">Argyll</option>
<option value="Armagh">Armagh</option>
<option value="Avon">Avon</option>
<option value="Ayrshire">Ayrshire</option>
<option value="Banffshire">Banffshire</option>
<option value="Bedfordshire">Bedfordshire</option>
<option value="Berkshire">Berkshire</option>
<option value="Berwickshire">Berwickshire</option>
<option value="Brecknockshire">Brecknockshire</option>
<option value="Buckinghamshire">Buckinghamshire</option>
<option value="Bute">Bute</option>
<option value="Caernarfonshire">Caernarfonshire</option>
<option value="Caithness">Caithness</option>
<option value="Cambridgeshire and Isle of Ely">Cambridgeshire and Isle of Ely</option>
<option value="Cambridgeshire">Cambridgeshire</option>
<option value="Cardiganshire">Cardiganshire</option>
<option value="Carmarthenshire">Carmarthenshire</option>
<option value="Cheshire">Cheshire</option>
<option value="City of Aberdeen">City of Aberdeen</option>
<option value="City of Belfast">City of Belfast</option>
<option value="City of Bristol">City of Bristol</option>
<option value="City of Dundee">City of Dundee</option>
<option value="City of Edinburgh">City of Edinburgh</option>
<option value="City of Glasgow">City of Glasgow</option>
<option value="City of London">City of London</option>
<option value="City of Londonderry">City of Londonderry</option>
<option value="Clackmannanshire">Clackmannanshire</option>
<option value="Cleveland">Cleveland</option>
<option value="Clwyd">Clwyd</option>
<option value="Cornwall">Cornwall</option>
<option value="County">County</option>
<option value="Cromartyshire">Cromartyshire</option>
<option value="Cumberland">Cumberland</option>
<option value="Cumbria">Cumbria</option>
<option value="Denbighshire">Denbighshire</option>
<option value="Derbyshire">Derbyshire</option>
<option value="Devon">Devon</option>
<option value="Dorset">Dorset</option>
<option value="Down">Down</option>
<option value="Dumfriesshire">Dumfriesshire</option>
<option value="Dunbartonshire (Dumbarton)">Dunbartonshire (Dumbarton)</option>
<option value="Durham">Durham</option>
<option value="Dyfed">Dyfed</option>
<option value="East Lothian (Haddingtonshire)">East Lothian (Haddingtonshire)</option>
<option value="East Suffolk">East Suffolk</option>
<option value="East Sussex">East Sussex</option>
<option value="Essex">Essex</option>
<option value="Fermanagh">Fermanagh</option>
<option value="Fife">Fife</option>
<option value="Flintshire">Flintshire</option>
<option value="Glamorgan">Glamorgan</option>
<option value="Gloucestershire">Gloucestershire</option>
<option value="Greater London">Greater London</option>
<option value="Greater Manchester">Greater Manchester</option>
<option value="Gwent">Gwent</option>
<option value="Gwynedd">Gwynedd</option>
<option value="Hampshire (County of Southampton)">Hampshire (County of Southampton)</option>
<option value="Hereford and Worcester">Hereford and Worcester</option>
<option value="Herefordshire">Herefordshire</option>
<option value="Hertfordshire">Hertfordshire</option>
<option value="Humberside">Humberside</option>
<option value="Huntingdon and Peterborough">Huntingdon and Peterborough</option>
<option value="Huntingdonshire">Huntingdonshire</option>
<option value="Inverness-shire">Inverness-shire</option>
<option value="Isle of Ely">Isle of Ely</option>
<option value="Isle of Wight">Isle of Wight</option>
<option value="Kent">Kent</option>
<option value="Kincardineshire">Kincardineshire</option>
<option value="Kinross-shire">Kinross-shire</option>
<option value="Kirkcudbrightshire">Kirkcudbrightshire</option>
<option value="Lanarkshire">Lanarkshire</option>
<option value="Lancashire">Lancashire</option>
<option value="Leicestershire">Leicestershire</option>
<option value="Lincolnshire, Parts of Holland">Lincolnshire, Parts of Holland</option>
<option value="Lincolnshire, Parts of Kesteven">Lincolnshire, Parts of Kesteven</option>
<option value="Lincolnshire, Parts of Lindsey">Lincolnshire, Parts of Lindsey</option>
<option value="Lincolnshire">Lincolnshire</option>
<option value="London">London</option>
<option value="Londonderry">Londonderry</option>
<option value="Merionethshire">Merionethshire</option>
<option value="Merseyside">Merseyside</option>
<option value="Mid Glamorgan">Mid Glamorgan</option>
<option value="Middlesex">Middlesex</option>
<option value="Midlothian (County of Edinburgh)">Midlothian (County of Edinburgh)</option>
<option value="Monmouthshire">Monmouthshire</option>
<option value="Montgomeryshire">Montgomeryshire</option>
<option value="Moray (Elginshire)">Moray (Elginshire)</option>
<option value="Nairnshire">Nairnshire</option>
<option value="Norfolk">Norfolk</option>
<option value="North Humberside">North Humberside</option>
<option value="North Yorkshire">North Yorkshire</option>
<option value="Northamptonshire">Northamptonshire</option>
<option value="Northumberland">Northumberland</option>
<option value="Nottinghamshire">Nottinghamshire</option>
<option value="Orkney">Orkney</option>
<option value="Oxfordshire">Oxfordshire</option>
<option value="Peeblesshire">Peeblesshire</option>
<option value="Pembrokeshire">Pembrokeshire</option>
<option value="Perthshire">Perthshire</option>
<option value="Powys">Powys</option>
<option value="Radnorshire">Radnorshire</option>
<option value="Renfrewshire">Renfrewshire</option>
<option value="Ross and Cromarty">Ross and Cromarty</option>
<option value="Ross-shire">Ross-shire</option>
<option value="Roxburghshire">Roxburghshire</option>
<option value="Rutland">Rutland</option>
<option value="Selkirkshire">Selkirkshire</option>
<option value="Shetland (Zetland)">Shetland (Zetland)</option>
<option value="Shropshire (Salop)">Shropshire (Salop)</option>
<option value="Soke of Peterborough">Soke of Peterborough</option>
<option value="Somerset">Somerset</option>
<option value="South Glamorgan">South Glamorgan</option>
<option value="South Humberside">South Humberside</option>
<option value="South Yorkshire">South Yorkshire</option>
<option value="Staffordshire">Staffordshire</option>
<option value="Stirlingshire">Stirlingshire</option>
<option value="Suffolk">Suffolk</option>
<option value="Surrey">Surrey</option>
<option value="Sussex">Sussex</option>
<option value="Sutherland">Sutherland</option>
<option value="Tyne and Wear">Tyne and Wear</option>
<option value="Tyrone">Tyrone</option>
<option value="Warwickshire">Warwickshire</option>
<option value="West Glamorgan">West Glamorgan</option>
<option value="West Lothian (Linlithgowshire)">West Lothian (Linlithgowshire)</option>
<option value="West Midlands">West Midlands</option>
<option value="West Suffolk">West Suffolk</option>
<option value="West Sussex">West Sussex</option>
<option value="West Yorkshire">West Yorkshire</option>
<option value="Westmorland">Westmorland</option>
<option value="Wigtownshire">Wigtownshire</option>
<option value="Wiltshire">Wiltshire</option>
<option value="Worcestershire">Worcestershire</option>
<option value="Yorkshire, East Riding">Yorkshire, East Riding</option>
<option value="Yorkshire, North Riding">Yorkshire, North Riding</option>
<option value="Yorkshire, West Riding">Yorkshire, West Riding</option>
<option value="Yorkshire">Yorkshire</option>
</select>
</tr><tr>
<td>Username</td>
<td><input class="textbox" type="text" name="customer_username" id="customer_username" /><span id="user-result"></span></td>
</tr><tr>
<td>Password</td>
<td><input class="textbox" type="text" name="customer_password" /></td>
</tr><tr>
<td> </td>
<td><input type="submit" name="person" class="button1" value="add" /></td>
</tr></form> -
</table>
</div>
<script type="text/javascript" src="js/jquery-1.9.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#customer_username").keyup(function (e) {
//removes spaces from username
$(this).val($(this).val().replace(/\s/g, ''))
var customer_username = $(this).val();
if(customer_username.length < 4){$("#user-result").html('');return;}
if(customer_username.length >= 4){
$("#user-result").html('<img src="imgs/ajax-loader.gif" />');
$.post('check_username.php', {'customer_username':customer_username}, function(data) {
$("#user-result").html(data);
});
}
});
});
</script>
<?php
//
mysql_query("INSERT INTO `customers`(customer_name,customer_surname,customer_email,address_line_1,address_line_2,customer_post,customer_county,customer_username,customer_password)
VALUES ('$customer_name','$customer_surname','$customer_email','$address_line_1','$address_line_2','$customer_post','$customer_county','$customer_username','$customer_password')");
}
?>
</form>
<div id="stock">
<?php
include("db.php");
$result=mysql_query("SELECT * FROM customers");
echo "<table id='tfhover'class='tftable' border='1'>\n";
echo "<tr>\n";
echo "<th>ID</th>\n";
echo "<th>Name</th>\n";
echo "<th>Surname</th>\n";
echo "<th>Email</th>\n";
echo "<th>Adress1</th>\n";
echo "<th>Adress2</th>\n";
echo "<th>Post code</th>\n";
echo "<th>County</th>\n";
echo "<th>Username</th>\n";
echo "<th>Password</th>\n";
echo"<tr>\n";
while($test = mysql_fetch_array($result)){$id = $test['customer_id'];
echo"<tr align='left'>\n";
echo"<td><font color='black'>" .$test['customer_id']. "</font></td>\n";
echo"<td><font color='black'>" .$test['customer_name']. "</font></td>\n";
echo"<td><font color='black'>". $test['customer_surname']. "</font></td>\n";
echo"<td><font color='black'>". $test['customer_email']. "</font></td>\n";
echo"<td><font color='black'>". $test['address_line_1']. "</font></td>\n";
echo"<td><font color='black'>". $test['address_line_2']. "</font></td>\n";
echo"<td><font color='black'>". $test['customer_post']. "</font></td>\n";
echo"<td><font color='black'>". $test['customer_county']. "</font></td>\n";
echo"<td><font color='black'>". $test['customer_username']."</font></td>\n";
echo"<td><font color='black'>". $test['customer_password']."</font></td>\n";
echo"<td class='link'><a class='links' href ='custdata1.php?customer_id=$id'>Edit</a></td>\n";
echo"<td class=\"link\"><a onclick=\"return confirm_click('".$test['customer_name']."');\" class='links1' href='delcustdata.php?customer_id=$id'>Delete</a></td>\n";
echo "</tr>";}
echo"</table>";
mysql_close($conn);?>
</div>
</body>
</html>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 5.4.26 0.003 0.057 18.98 5.4.25 0.013 0.057 18.98 5.4.24 0.010 0.050 18.83 5.4.23 0.020 0.040 18.98 5.4.22 0.013 0.053 18.93 5.4.21 0.013 0.047 18.89 5.4.20 0.007 0.063 19.10 5.4.19 0.010 0.053 19.07 5.4.18 0.007 0.080 18.94 5.4.17 0.010 0.050 18.94 5.4.16 0.010 0.073 18.96 5.4.15 0.013 0.050 18.93 5.4.14 0.003 0.073 16.56 5.4.13 0.020 0.060 16.50 5.4.12 0.013 0.043 16.52 5.4.11 0.017 0.043 16.53 5.4.10 0.013 0.060 16.55 5.4.9 0.007 0.063 16.55 5.4.8 0.000 0.053 16.32 5.4.7 0.013 0.060 16.48 5.4.6 0.003 0.053 16.31 5.4.5 0.013 0.043 16.32 5.4.4 0.017 0.063 16.34 5.4.3 0.010 0.050 16.63 5.4.2 0.013 0.040 16.52 5.4.1 0.013 0.050 16.62 5.4.0 0.003 0.053 15.89 5.3.28 0.013 0.067 14.71 5.3.27 0.007 0.077 14.33 5.3.26 0.010 0.050 14.46 5.3.25 0.007 0.070 14.68 5.3.24 0.010 0.047 14.71 5.3.23 0.007 0.060 14.39 5.3.22 0.003 0.053 14.58 5.3.21 0.003 0.080 14.74 5.3.20 0.007 0.050 14.45 5.3.19 0.010 0.050 14.61 5.3.18 0.003 0.057 14.45 5.3.17 0.003 0.080 14.44 5.3.16 0.010 0.050 14.60 5.3.15 0.017 0.063 14.73 5.3.14 0.017 0.050 14.57 5.3.13 0.010 0.050 14.61 5.3.12 0.003 0.077 14.61 5.3.11 0.007 0.070 14.45 5.3.10 0.003 0.057 14.06 5.3.9 0.010 0.053 13.88 5.3.8 0.010 0.060 14.08 5.3.7 0.013 0.043 14.05 5.3.6 0.010 0.047 13.95 5.3.5 0.007 0.047 14.00 5.3.4 0.000 0.060 13.88 5.3.3 0.007 0.050 14.02 5.3.2 0.003 0.067 13.63 5.3.1 0.003 0.073 13.81 5.3.0 0.017 0.043 13.54 5.2.17 0.007 0.050 11.06 5.2.16 0.013 0.037 11.17 5.2.15 0.007 0.043 11.32 5.2.14 0.007 0.043 11.18 5.2.13 0.007 0.037 11.05 5.2.12 0.003 0.047 10.89 5.2.11 0.010 0.037 11.22 5.2.10 0.010 0.057 11.15 5.2.9 0.007 0.053 10.96 5.2.8 0.000 0.047 11.21 5.2.7 0.000 0.057 11.21 5.2.6 0.010 0.037 10.84 5.2.5 0.003 0.040 11.16 5.2.4 0.003 0.040 10.91 5.2.3 0.007 0.040 10.90 5.2.2 0.003 0.040 10.76 5.2.1 0.007 0.057 11.00 5.2.0 0.003 0.060 10.97 5.1.6 0.013 0.037 9.93 5.1.5 0.010 0.027 10.06 5.1.4 0.013 0.030 10.17 5.1.3 0.000 0.050 10.45 5.1.2 0.010 0.037 10.46 5.1.1 0.007 0.037 10.20 5.1.0 0.007 0.037 10.06 5.0.5 0.003 0.030 8.49 5.0.4 0.000 0.030 8.51 5.0.3 0.000 0.047 8.29 5.0.2 0.003 0.027 8.32 5.0.1 0.000 0.030 8.16 5.0.0 0.000 0.047 8.34 4.4.9 0.003 0.020 7.07 4.4.8 0.003 0.020 7.07 4.4.7 0.000 0.023 7.02 4.4.6 0.000 0.023 7.02 4.4.5 0.000 0.027 7.02 4.4.4 0.000 0.033 7.02 4.4.3 0.007 0.023 7.02 4.4.2 0.000 0.023 7.02 4.4.1 0.010 0.013 7.02 4.4.0 0.003 0.030 7.02 4.3.11 0.000 0.023 7.02 4.3.10 0.000 0.033 7.02 4.3.9 0.000 0.023 7.02 4.3.8 0.007 0.027 7.02 4.3.7 0.000 0.020 7.02 4.3.6 0.003 0.020 7.02 4.3.5 0.003 0.020 7.02 4.3.4 0.000 0.033 7.02 4.3.3 0.000 0.023 7.02 4.3.2 0.003 0.020 7.02 4.3.1 0.000 0.023 7.02 4.3.0 0.010 0.027 6.84
preferences:dark mode live preview
141.02 ms | 1394 KiB | 7 Q