Saturday, January 11, 2014

PHP code To upgrade any data with css in it

<?php
$company = $_POST["company"];
if(isset($_POST['submit']))
{
$result = mysql_query("SELECT * FROM detail WHERE company_name=$company");

    while($row = mysql_fetch_array($result))
{
echo $row['premise_name']."<br />";
echo $row['company_name']."<br />";
echo $row['address']."<br />";
echo $row['owner_name']."<br />";
echo $row['phone_num']."<br />";
echo $row['date_start']."<br />";
echo $row['date_end']."<br />";
echo $row['contract']."<br />";
echo $row['rent']."<br />";
echo $row['category']."<br />";
echo $row['status']."<br /.";
} // TODO: better error handling
}
mysql_close();
?>
<html>
<head>
<style type="text/css">

    ul {
    list-style: none;
    margin: 0;
    }
    li {
    float: left;
    }
    a {
    background: #404853;
    background: linear-gradient(#687587, #404853);
    border-left: 1px solid rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: block;
    font-size: 18px;
    font-weight: bold;
    padding: 0 23px;
    line-height: 44px;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
    }
   
    a:link {
    text-decoration:none;
    color:#000000;
    }

    a:active {
    text-decoration:none;
    color:#FFF;
    background:21B9FF;
    }

    a:visited {
    text-decoration:none;
    color:#000000;
    }

    a {
    text-decoration:none;
    color:#000000;
    }

    a:hover, a.current {  
    color:#FFF;            
    background-color:#21B9FF;
    }
</style>
</head>

<body bgcolor = "#33CCFF">

<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("test") or die(mysql_error());

$startNew = $_POST["startNew"];
$endNew = $_POST["endNew"];
$contractNew = $_POST["contractNew"];

if($_SERVER['REQUEST_METHOD']=="POST")
{
if($company
mysql_query("INSERT INTO premis (startNew,endNew,contractNew)
VALUES('$startNew','$endNew','$contractNew')")
or die(mysql_error());

echo '<p><H2>Data has been update to MySQL</H2>';
echo '</p>';

echo '<p><H3>THE INFORMATION OF PREMISE</H3></p>';
echo '<br />';

echo '<ul>';
echo '<b>NEW START DATE OF CONTRACT :  </b>' . $startNew;
echo '<p>';
echo '<br />';

echo '<b>NEW END DATE OF CONTRACT :  </b>' . $endNew;
echo '<p>';
echo '<br />';

echo '<b>RENEWAL OF CONTRACT(YEAR) :  </b>' . $contractNew;
echo '</ul>';
}
else
echo "PLEASE FULFILL THE FORM";
?>
</body>
</html>

0 comments:

Post a Comment