I have the following view to List all products, and in that you can delete or edit a particular product, onclick of delete or edit it will call the controller,
<?php
$this->load->helper('url');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>diluks eCommerce - Home</title>
<link href="<?php
echo base_url();
?>Public/scripts/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form action="<?php echo base_url();?>index.php/productlist_controller" method="post">
<div class="container">
<?php
include 'header-adminpanel.php';
?>
<div class="level3 clearfix">
<?php
include 'product-sidebar.php';
?>
<div class="body-content">
<div class="items">
<h2>Product List</h2>
<table class="CSSTable" cellspacing="0px" cellpadding="0px">
<tr>
<td>Item Code</td><td>Item Name</td><td>Item Price</td><td>Edit</td><td>Delete</td>
</tr>
<?php foreach($products as $row): ?>
<form method="POST" action="<?php echo base_url();?>index.php/productlist_controller">
<tr>
<td><?php echo $row->itemcode; ?></td><td><?php echo $row->itemname; ?></td><td>$<?php echo $row->itemprice; ?></td><td><center><button name="btn_edit" class="link-button" value="<?php echo $row->itemcode; ?>" type="submit">Edit</button></center></td><td><center><button name="btn_delete" class="link-button" value="<?php echo $row->itemcode; ?>" type="submit">Delete</button></center></td>
</tr>
</form>
<?php endforeach ?>
</table>
</div>
</div>
</div>
<div style="clear:both"></div>
<div class="level4">
<div class="footer-area">
<div class="lined-space"></div>
<div class="site-map" align="left">
<table>
<tr>
<td class="footer-text">About Us</td>
<td class="footer-text">Facebook</td>
</tr>
<tr>
<td class="footer-text">Contact Us</td>
<td class="footer-text">Twitter</td>
</tr>
<tr>
<td class="footer-text">FAQs</td>
<td class="footer-text">Terms & Conditions</td>
</tr>
<tr>
<td class="footer-text">Help</td>
</tr>
</table>
</div>
<div class="developer-info">
<a class="developers-text">Designed & Developed By Diluks Software Solutions.</a>
</div>
</div>
</div>
</div>
</form>
</body>
</html>
So the controller to the above view look like belo
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Productlist_controller extends CI_Controller {
function __construct(){
parent::__construct();
}
public function index()
{
if(isset($_POST["btn_delete"])){
$pid = $_POST["btn_delete"];
$this->load->model('product_model');
$result = $this->product_model->deleteProduct($pid);
if($result==true){
$data = array();
$this->load->model('product_model');
$data['products'] = $this->product_model->availableProductList();
$this->load->view('admin_product_list_view',$data);
}
else{
echo "Oops! Error occured..!";
}
}
else if(isset($_POST["btn_edit"])){
$pid = $_POST["btn_edit"];
$data = array();
$this->load->model('product_model');
$data['product'] = $this->product_model->readProduct($pid);
//$this->load->model('category_model');
//$data['categories'] = $this->category_model->getCategories();
$this->load->view('admin_product_edit_view', $data);
}
}
}
"admin_product_edit_view" which the user will be redirected onclick of edit for an particular item is as follows,
<?php
$this->load->helper('url');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>diluks eCommerce - Home</title>
<link href="<?php
echo base_url();
?>Public/scripts/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form enctype="multipart/form-data" action="<?php
echo base_url();
?>index.php/addproduct_controller" method="post">
<div class="container">
<?php
include 'header-adminpanel.php';
?>
<div class="level3 clearfix">
<?php
include 'product-sidebar.php';
?>
<div class="body-content">
<div class="items">
<h2>Edit Product</h2>
<?php foreach($product as $row){ ?>
<table>
<tr>
<td class="captions">Product Code</td>
<td><input name="txt_pcode" type="text" readonly="true" value="<?php echo $row->itemcode; ?>"/></td>
</tr>
<tr>
<td class="captions">Product Name</td>
<td><input name="txt_pname" type="text" size="40" value="<?php echo $row->itemname; ?>" /></td>
</tr>
<tr>
<td class="captions">Product Price</td>
<td><input name="txt_pprice" type="text" value="<?php echo $row->itemprice; ?>" /></td>
</tr>
<tr>
<td class="captions">Product Category</td>
<td><select name="txt_pcategory">
<?php
foreach($categories as $row)
{
echo '<option value="'.$row->catname.'">'.$row->catname.'</option>';
}
?>
</select></td>
</tr>
<tr>
<td class="captions">Product Description</td>
<td><textarea name="txt_pdesc" style="width:300px;height:100px;"><?php echo $row->itemdesc; ?></textarea></td>
</tr>
<tr>
<td class="captions">Product Image</td>
<td><input type="file" name="userfile" size="20" /></td>
</tr>
<tr>
<td class="captions">Product Options</td>
<td><input name="txt_poptions" size="40" type="text" /><a class="hint"> (Separate by a "," comma)</a></td>
</tr>
<tr><td><input name="btn_add" class="grey-button" type="submit" value="Update" /></td></tr>
</table>
<?php } ?>
<br />
</div>
</div>
</div>
<div style="clear:both"></div>
<div class="level4">
<div class="footer-area">
<div class="lined-space"></div>
<div class="site-map" align="left">
<table>
<tr>
<td class="footer-text">About Us</td>
<td class="footer-text">Facebook</td>
</tr>
<tr>
<td class="footer-text">Contact Us</td>
<td class="footer-text">Twitter</td>
</tr>
<tr>
<td class="footer-text">FAQs</td>
<td class="footer-text">Terms & Conditions</td>
</tr>
<tr>
<td class="footer-text">Help</td>
</tr>
</table>
</div>
<div class="developer-info">
<a class="developers-text">Designed & Developed By Diluks Software Solutions.</a>
</div>
</div>
</div>
</div>
</form>
</body>
</html>
Now the problem is in the controller i need to load up categories (which I have commented) in order to show them in the edit view, but when I un-commented it, categories are loading, but Gives an Error in Item Description textarea saying
Message: Undefined property: stdClass::$itemdesc
With the category model loading line commented, it works fine except no categories will load up in the dropdownlist,Please someone suggest me a way to get rid of this.
Please use this in your view
if(isset($row->itemdesc)) echo $row->itemdesc;
I think this will solve your problem
I saw that you got an answer but i have a few suggestions for your code:
1. in your controller you load the model 3 times: you should load it once; you could do something like this:
if(!empty($_POST)){
$this->load->model('product_model');
if(isset($_POST["btn_delete"])){
//some code
}elseif(isset($_POST["btn_edit"])){
//some other code
}
}
2. in your views you load a helper: this should be loaded into the controller, right after the first verification from point 1.
3. in views you should check your variable for content, especially the ones that you are going to use in a loop, like $products
Related
i want to print post data in my login function with $this->input->post['username'];
I have a home controller given below :
<?php
class Home extends CI_Controller{
public function index(){
$this->load->view("home/home_view");
}
public function Login(){
echo $this->input->post['username'];
}
}
?>
but its showing me null result but if i write print_r($_POST) instead of $this->input->post['username'] its showing me all data
this is my home view code
<!DOCTYPE html>
<html>
<head>
<title>Home Page</title>
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/bootstrap.css">
</head>
<body>
<div class="col-lg-2"></div>
<div class="col-lg-8" style="min-height: 500px;box-shadow: 5px 5px 15px #000; margin-top: 50px;">
<form method="post" action="<?php echo base_url(); ?>index.php/Home/Login">
<table class="table table-stripped">
<tr>
<th colspan="2">Login form</th>
</tr>
<tr>
<td>Username</td>
<td><input type="text" class="form-control" name="username"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password" class="form-control"></td>
</tr>
<tr>
<th colspan="2"><input type="submit" value="Submit" class="btn btn-primary"></th>
</tr>
</table>
</form>
</div>
<div class="col-lg-2"></div>
</body>
</html>
i had auto loaded form helper and url helper
Hope this will help you :
Use $this->input->post('username'); instead of $this->input->post['username'] :
Your Login function should be like this :
public function Login()
{
/* to print all field name do like this*/
print_r($this->input->post());
/* to print a particular field name do like this*/
echo $this->input->post('username');
echo $this->input->post('password');
}
Use site_url or base_url in form like this ( good practice) :
<form method="post" action="<?php echo site_url('Home/Login'); ?>">
........
</form>
for more : https://www.codeigniter.com/user_guide/libraries/input.html
Convert your HTML from into CI form helper way although i have updated your view file for your reference see form helper [https://www.codeigniter.com/userguide3/helpers/form_helper.html][1]
<!DOCTYPE html>
<html>
<head>
<title>Home Page</title>
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/bootstrap.css">
</head>
<body>
<div class="col-lg-2"></div>
<div class="col-lg-8" style="min-height: 500px;box-shadow: 5px 5px 15px #000; margin-top: 50px;">
<?php
echo form_open('home/login');
?>
<table class="table table-stripped">
<tr>
<th colspan="2">Login form</th>
</tr>
<tr>
<td>Username</td>
<td>
<?php
$data = array(
'name' => 'username',
'id' => 'username'
);
echo form_input($data);
?>
<input type="text" class="form-control" name="username">
</td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password" class="form-control">
<?php
$pwd = array(
'name' => 'password',
'id' => 'password'
);
echo form_password($pwd);
?>
</td>
</tr>
<tr>
<?php echo form_submit('submit', 'Submit'); ?>
</th>
</tr>
</table>
<?php echo form_close();?>
</div>
<div class="col-lg-2"></div>
</body>
</html>
I want to update record in php using GET method but whenever i click on "update button" it does not change anything and just refresh the page.and data remains the same.Here are the codes. Kindly tell me where i m doing it wrong. Thanks
<?php
include_once"dbconfig.php";
if(isset($_GET['edit']))
{
$id=$_GET['edit'];
echo $id;
$sql_query="SELECT * FROM users WHERE user_id='$id' ";
$result_set=mysql_query($sql_query);
$fetched_row=mysql_fetch_array($result_set);
}
if(isset($_POST['btn-update']))
{
// variables for input data
$first_name=$_POST['first_name'];
$last_name=$_POST['last_name'];
$city_name=$_POST['city_name'];
//sql query to update into database
$sql_query="UPDATE users SET first_name='$first_name',last_name='$last_name',user_city='$city_name' WHERE user_id='$id' ";
mysql_query($sql_query);
//if(!$sql_query)
//die('data can not update'.mysql_error());
//else
//echo 'data updated successfully';
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<center>
<form method="post">
<table align="center">
<tr>
<td><input type="text" name="first_name" placeholder="First Name" value="<?php echo $fetched_row['first_name']; ?>"required /> </td>
</tr>
<tr>
<td><input type="text" name="last_name" placeholder="Last Name" value="<?php echo $fetched_row['last_name']; ?>" required /> </td>
</tr>
<tr>
<td><input type="text" name="city_name" placeholder="City" value="<?php echo $fetched_row['user_city']; ?>" required /> </td>
</tr>
<tr>
<td>
<button type="submit" name="btn-update"><strong>UPDATE</strong></button>
</td>
</tr>
</table>
</form>
</center>
</body>
</html>
Second File
<?php
include_once"dbconfig.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>CRUD Operations With php and MySql </title>
<link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
<center>
<div id="body">
<div id="content">
<table align="center">
<table align="center">
<tr>
<th colspan="9">Add data Here ! </th>
</tr>
<tr>
<th colspan="2">FirstName </th>
<th colspan="8">LastName</th>
<th colspan="4">CityName </th>
<th>Operations</th>
<!--<th colspan="2">Operations</th> -->
</tr>
<?php
$sql_query="SELECT * FROM users";
$result_set=mysql_query($sql_query);
while($row=mysql_fetch_row($result_set))
{
?>
<tr>
<td><?php echo $row[0]; ?> </td>
<td colspan="4"><?php echo $row[1]; ?></td>
<td colspan="6"><?php echo $row[2];?></td>
<td colspan="4"><?php echo $row[3];?></td>
<td> <a href='edit_data.php?edit=$row[0]'>EDIT</a> </td>
<!--<td align="center"><a href="javascript edt_id('<//?php echo $row[0]; ?><img src="b_edit.png" align="EDIT" /></a></td>
<td align="center"><a href="javascript:delete_id('<//?php echo $row[0];?><img src="b_drop.png" align="DELETE" /></a></td>
</tr> -->
<?php
}
?>
</table>
</div>
</div>
</center>
</body>
</html>
Change
mysql_query($sql_query);
To
mysql_query($sql_query) or die (mysql_error()) ;
You're not sending the id (the form action property is missing
I am creating android app of my website.I want to know which changes are necessary to make in my php files in order to connect my android app to my website's database as these files have no echo statement or I have to make another php files for these purpose.Please help as I am new to android.My first file is login.php
<?php require_once('Connection/cnn.php'); ?>
<?php
session_start();
if((isset($_POST['admin_login'])) && ($_POST['admin_login']=="form99"))
{
$_SESSION['username']=$_POST['txt_email'];
$_SESSION['password']=$_POST['txt_password'];
header('Location: login-pass.php');
}
if($_SESSION['verified']=='Y')
{
header('Location: transporter-account.php');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Transporteazy</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/main.js"></script>
</head>
<body>
<!-- MAIN BODY WRAPPER START -->
<div id="main-Body-Wrapper">
<!-- HEADER PART START -->
<div id="header-con">
<?php include ('header.php'); ?>
</div>
<!-- HEADER PART END -->
<!-- MIDDLE PART START -->
<div class="how-it-work">
<div class="left-part">
<?php if($_GET['msg']=='error') {?>
<h1>Please login below to see posted loads or click here to register with us.</h1>
<?php } else {?>
<h1>Login Area</h1>
<?php } ?>
<div class="login">
<?php $page=$_SERVER['QUERY_STRING'];
if ($page!="") { ?>
<div class="error">
<?php if ($_GET['error']=="empty") { ?>
<p class="alert">Please enter user name & password.</p>
<?php } else if ($_GET['error']=="name") {?>
<p class="alert">Please enter user name.</p>
<?php } else if ($_GET['error']=="pass") {?>
<p class="alert">Please enter password.</p>
<?php } else if ($_GET['error']=="nouser") {?>
<p class="alert">Something is wrong.</p>
<?php } else if ($_GET['error']=="pend") {?>
<p class="alert">You are not a authorize person to access further pages.</p>
<?php }?>
</div>
<?php }?>
<h3>If you are already registered, please login here.</h3>
<div class="loginBox">
<form name="login-form" id="login-form" method="post">
<table width="420" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" align="right" valign="middle">Email Address :</td>
<td align="left" valign="top"><input name="txt_email" type="email" class="input" id="txt_email" value="" required placeholder="abc#xyz.com"/></td>
</tr>
<tr>
<td align="right" valign="middle">Password:</td>
<td align="left" valign="top"><input name="txt_password" type="password" class="input" id="txt_password" value="" required placeholder="*********"/></td>
</tr>
<tr>
<td align="right" valign="middle"> </td>
<td align="left" valign="top"><input name="Submit" type="submit" class="loginBtn" value="" />
<input type="hidden" name="admin_login" value="form99"/></td>
</tr>
<tr>
<td align="right" valign="top"> </td>
<td align="left" valign="top"> </td>
</tr>
<tr>
<td align="right" valign="top"> </td>
<td align="left" valign="top">Forgot Password? <font color="#FF0000">|</font> Register here</td>
</tr>
</table>
</form>
</div>
</div>
</div>
<!-- RIGHT PART -->
<div class="right-part">
<?php include('benefits.php');?>
</div>
<!-- RIGHT PART -->
</div>
<!-- MIDDLE PART END -->
<!-- FOOTER PART STRAT -->
<div class="footerCon">
<?php include ('footer.php'); ?>
</div>
<!-- FOOTER PART END -->
</div>
<!-- MAIN BODY WRAPPER END -->
</body>
</html>
Hi I have the following code and the browser is commenting out the php. The file is saved .php however nothing helps. I've searched this forum and nothing works.
<html>
<head>
<!--<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>-->
<title>
Golden Acres
</title>
<link href="css/mystyle.css" rel="stylesheet" type="text/css"/>
</head>
<body class="center">
<table class="main_tables">
<tr>
<td rowspan="2" >
<img class="main_logo" src="images/logo2.gif" alt="logo"/>
</td>
<td id="main_nav_menu" valign="bottom">
<table cellspacing="2" >
<tr>
<td id="slogan_home" colspan="6" valign="middle">
"delivering fresh close to your home"
</td>
</tr>
<tr id="extra_row"><td></td></tr>
<tr>
<td class="main_nav_menu" align="center">
<a class="main_nav_menu_links" href="index.html">home</a>
</td>
<td class="main_nav_menu">
<a class="main_nav_menu_links" href="about_us.html">about us</a>
</td>
<td class="main_nav_menu" >
<a class="main_nav_menu_links" href="boxes.html">boxes</a>
</td>
<td class="main_nav_menu">
<a class="main_nav_menu_links" href="shop.html">Shop</a>
</td>
<td class="main_nav_menu">
<a class="main_nav_menu_links" href="events.html">events</a>
</td>
<td class="main_nav_menu">
<a class="main_nav_menu_links" href="contact.html">Contact Us</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php
if(isset($_POST['submit'])){
$submit = $_POST['submit'];
if(isset($_POST['register_fname'])&&($_POST['register_lname'])&&($_POST['register_uname'])&&($_POST['register_password'])){
$firstname = $_POST['register_fname'];
$lastname = $_POST['register_lname'];
$username = $_POST['register_uname'];
$password = $_POST['register_password'];
if(isset($firstname)&&isset($lastname)&&isset($username)&&isset($password)){
echo 'Isset is ok';
}
else
{
echo 'Isset is not ok';
}
}
}
?>
<form action="register.php" method="POST">
<input type="submit" name="submit">
</form>
</body>
</html>
The when I inspect element in the browser it's displayed as : <!-- php .... ?-->
Help would be appreciated.
add at the begins of the page before Html and even DOCTYPE declaration tag :
<?php include "register.php"; ?>
<!DOCTYPE html>
<html lang="en">
and move your code to this file < register.php >
then use the form like this:
<form id="" name="" method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>" role="form">
<input type="submit" name="submit" value="Send" >
</form>
i hope this will help
Sorry this was a silly mistake of mine.
i have a table named as item_request and it has twofields named as projectmanager and createddate which has the Timestamp format as 2012-09-11 17:46:25.
Now i want to call these two fields in another form which count the user entry between 2 different dates.and the date field is fetched from the timestamp.with this form i m sending the value through datetime picker having the format 10-12-2012 but the value in databse is in different format and the value i m sending is in diffferent format.how is it possible plzzz help me guys.
Here is the code for my form:
<?php
include("config.php");
ob_start();
error_reporting(0);
if(!isset($_SESSION[username]))
header("location: index.php");
if(isset($_POST[submit]))
{
$projectmanager=mysql_real_escape_string($_POST['projectmanager']);
$date=mysql_real_escape_string($_POST['date']);
$dateexp = explode("-",$date);
$date = mysql_real_escape_string($dateexp[0]."/".$dateexp[1]."/".$dateexp[2]);
$date1=mysql_real_escape_string($_POST['date1']);
$dateexp1 = explode("-",$date1);
$date1 = mysql_real_escape_string($dateexp1[0]."/".$dateexp1[1]."/".$dateexp1[2]);
echo $queryuser= "select * from item_request where projectmanager=$projectmanager AND (requireddate>=$date AND requireddate<=$date1)";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Project Managers Registrarion</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<script language="javascript" type="text/javascript" src="js/datetimepicker.js">
//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
//For this script, visit http://www.javascriptkit.com
</script>
</head>
<body>
<div class="container">
<div class="header"><img src="images/cherry-new.jpg" width="79" height="93" />
<!-- end .header --></div>
<?php include("rightMenu.php");?>
<div class="content">
<h1>PR Count</h1>
<div style="padding:10px 0px; text-align:center; color:#990000;">
</div>
<form action="" method="post" name="loginform">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td>Project Managers</td>
<td><select name="projectmanager" style="width:145px;" id="projectmanager" onChange="showUser(this.options[this.selectedIndex].id)">
<option value="">Select</option>
<?php $queryuser= "select * from projectmanagers";
$fetuser1user = mysql_query($queryuser);
while($fetuser = mysql_fetch_array($fetuser1user)){
?>
<option id="<?php echo $fetuser['id']?>" value="<?php echo $fetuser['id']?>"><?php echo $fetuser['projectmanager']?></option>
<?php }
?>
</select></td>
</tr>
<tr>
<td>Date From</td>
<td>
<input id="date" type="text" size="20" name="date" /><img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date"></td>
</tr>
<tr>
<td>Date To</td>
<td>
<input id="date1" type="text" size="20" name="date1"><img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date"></td>
</tr>
<tr>
<td> </td>
<td>
<input type="submit" name="submit" id="submit" value="Submit" onClick="return formvalidate();"/>
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<table width="100%" border="1"><tr>
<td width="18%" valign="middle" class="tableheading">PI.No.</td>
<td width="18%" valign="middle" class="tableheading">Project Manager</td>
<td width="18%" valign="middle" class="tableheading">Date Created</td>
<td width="15%" valign="middle" class="tableheading">Action</td>
</tr>
<?php
// to print the records
$select = "select * from item_request";
$query1 = mysql_query($select);
while($value = mysql_fetch_array($query1)){ ?>
<tr>
<td class="tabletext"><?php echo $value[id];?></td>
<td class="tabletext"><?php echo $value[projectmanager];?></td>
<td class="tabletext"><?php echo $value[datefrom];?></td>
<td class="tabletext"><img src="images/edit.png" width="25" height="25" border="0" title="Edit" />
<img src="images/deleteBtn.png" width="25" height="25" border="0" title="Edit" /></td>
</tr><?php }?>
</table>
</form>
<!-- end .content --></div>
<?php include("footer.php");?>
<!-- end .container --></div>
</body>
</html>
Replace this function call...
javascript:NewCal('date','ddmmyyyy');
with this one...
javascript:NewCal('date','ddmmyyyy',true,24);
Hope it helps.