3 Replies - 541 Views - Last Post: 30 April 2011 - 03:47 AM Rate Topic: -----

#1 carmelraj  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 50
  • Joined: 28-April 11

passing values

Posted 30 April 2011 - 03:30 AM

Passing values from one page to another page through url. Its working values is sended and it is printed.But i want to print inside the text box.I tried it but its not working.... i need help now...
Is This A Good Question/Topic? 1
  • +

Replies To: passing values

#2 sas1ni69  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 81
  • View blog
  • Posts: 430
  • Joined: 04-December 08

Re: passing values

Posted 30 April 2011 - 03:34 AM

Hi there,

What have you tried so far? Why don't you give us that part of your code so we could help you. Please remember to post them within the code tags.
Was This Post Helpful? 0
  • +
  • -

#3 carmelraj  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 50
  • Joined: 28-April 11

Re: passing values

Posted 30 April 2011 - 03:38 AM

<?php 
setcookie("userid", $id, time()-60*60*24*30);
session_start();
//session_register("id");
require_once("dbconn.php");

$id=$_GET['coid'];
$_SESSION['id']=$_GET['coid'];
$idd=$_SESSION['id'];
$base_url = basename($_SERVER['REQUEST_URI']);

if(isset($_SESSION['User']))
{

 if (isset($_POST['Submit']) && $_POST['Submit'] == 'Submit')
{
$today = mktime(0,0,0,date("m"),date("d"),date("Y"));
$today=date("Y-m-d", $today);


$query="select company_name from companies where co_id=$idd";

mysql_query($query) or die(mysql_error()); 


}



?>
<html>
<head>
<title>ksi-crm</title>
<link href="admin/styles.css" rel="stylesheet" type="text/css" />
<link href="admin/styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="calender/calendar.js"></script>
<script type="text/javascript" src="calender/calendar-en.js"></script>
<link href="calender/calendar-system.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" media="all" href="calender/skins/aqua/theme.css" 
title="Aqua" />



<script type="text/javascript">

var oldLink = null;
// code to change the active stylesheet
function setActiveStyleSheet(link, title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
  if (oldLink) oldLink.style.fontWeight = 'normal';
  oldLink = link;
  link.style.fontWeight = 'bold';
  return false;
}

// This function gets called when the end-user clicks on some date.
function selected(cal, date) {
  cal.sel.value = date; // just update the date in the input field.
  if (cal.dateClicked && (cal.sel.id == "sel1" || cal.sel.id == "sel3"))
    // if we add this call we close the calendar on single-click.
    // just to exemplify both cases, we are using this only for the 1st
    // and the 3rd field, while 2nd and 4th will still require double-click.
    cal.callCloseHandler();
}

// And this gets called when the end-user clicks on the _selected_ date,
// or clicks on the "Close" button.  It just hides the calendar without
// destroying it.
function closeHandler(cal) {
  cal.hide();                        // hide the calendar
//  cal.destroy();
  _dynarch_popupCalendar = null;
}

// This function shows the calendar under the element having the given id.
// It takes care of catching "mousedown" signals on document and hiding the
// calendar if the click was outside.
function showCalendar(id, format, showsTime, showsOtherMonths) {
  var el = document.getElementById(id);
  if (_dynarch_popupCalendar != null) {
    // we already have some calendar created
    _dynarch_popupCalendar.hide();                 // so we hide it first.
  } else {
    // first-time call, create the calendar.
    var cal = new Calendar(1, null, selected, closeHandler);
    // uncomment the following line to hide the week numbers
    // cal.weekNumbers = false;
    if (typeof showsTime == "string") {
      cal.showsTime = true;
      cal.time24 = (showsTime == "24");
    }
    if (showsOtherMonths) {
      cal.showsOtherMonths = true;
    }
    _dynarch_popupCalendar = cal;                  // remember it in the global var
    cal.setRange(1900, 2070);        // min/max year allowed.
    cal.create();
  }
  _dynarch_popupCalendar.setDateFormat(format);    // set the specified date format
  _dynarch_popupCalendar.parseDate(el.value);      // try to parse the text in field
  _dynarch_popupCalendar.sel = el;                 // inform it what input field we use

  // the reference element that we pass to showAtElement is the button that
  // triggers the calendar.  In this example we align the calendar bottom-right
  // to the button.
  _dynarch_popupCalendar.showAtElement(el, "Br");        // show the calendar

  return false;
}

var MINUTE = 60 * 1000;
var HOUR = 60 * MINUTE;
var DAY = 24 * HOUR;
var WEEK = 7 * DAY;

// If this handler returns true then the "date" given as
// parameter will be disabled.  In this example we enable
// only days within a range of 10 days from the current
// date.
// You can use the functions date.getFullYear() -- returns the year
// as 4 digit number, date.getMonth() -- returns the month as 0..11,
// and date.getDate() -- returns the date of the month as 1..31, to
// make heavy calculations here.  However, beware that this function
// should be very fast, as it is called for each day in a month when
// the calendar is (re)constructed.
function isDisabled(date) {
  var today = new Date();
  return (Math.abs(date.getTime() - today.getTime()) / DAY) > 10;
}

function flatSelected(cal, date) {
  var el = document.getElementById("preview");
  el.innerHTML = date;
}

function showFlatCalendar() {
  var parent = document.getElementById("display");

  // construct a calendar giving only the "selected" handler.
  var cal = new Calendar(0, null, flatSelected);

  // hide week numbers
  cal.weekNumbers = false;

  // We want some dates to be disabled; see function isDisabled above
  cal.setDisabledHandler(isDisabled);
  cal.setDateFormat("%A, %B %e");

  // this call must be the last as it might use data initialized above; if
  // we specify a parent, as opposite to the "showCalendar" function above,
  // then we create a flat calendar -- not popup.  Hidden, though, but...
  cal.create(parent);

  // ... we can show it here.
  cal.show();
}
</script>






<style type="text/css">
<!--
.style3 {
	color: #FF3300;
	font-weight: bold;
	font-size: 24px;
}
.style7 {color: #FF0000}
.style8 {color: #0000FF}
.style9 {
	color: #FF0000;
	font-weight: bold;
	font-size: 18px;
}
-->
</style>
</head>

<body onload="SessionCookieCheck();">
<form name="order detail" method="get">
<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="3" bgcolor="#CCCCCC">
<tr>
    <td width="100%" height="57" align="center" valign="middle"><table width="714" border="0" align="left" cellpadding="0" cellspacing="0">
      <tr>
        <td width="239" align="left"></td>
        <td width="475" align="center"><span class="style3">KARNATAKA STATE INDUSTRIAL TIMES</span></td>
      </tr>
    </table></td>
    <td width="0%" align="center" valign="bottom" ></td>
</tr>
  <tr align="center">
    <td height="27" colspan="2" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="19%"><span class="style7">Welcome</span> <span class="style8"><?php echo $_SESSION['User']; ?></span></td>
    <td width="37%">&nbsp;</td>
    <td width="19%">&nbsp;</td>
    <td width="25%" align="left" class="style7"><a href="change_password.php" class="style7">Change Password</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="logout.php" class="style7">Logout</a></td>
  </tr>
</table>
</td>
  </tr>
  <tr>
  <td height="94" valign="middle" align="center"><?php include_once("menu.php");?></td>
  </tr>
  <tr>
    <td height="115" colspan="2" align="center" class="text">
		<table width="50%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><span class="style9">ORDER DETAILS </span></td>
  </tr>
</table>
<form name="order" method="post" action="#" style="padding:5px;" enctype="multipart/form-data">
      <table width="55%" border="1" bgcolor="#f4f4f4" cellpadding="0" cellspacing="0" bordercolor="#003E45">
        <tr>
          <td height="284" align="center" valign="top">
		  <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="4" style="font:Arial, Helvetica, sans-serif; font-size:12px; font-weight:500; color:#005761;">



<tr>
              <td width="36%" height="22" align="right">COMPANY ID : </td>
              <td width="53%">
                <input type="text" name="company_id" disabled="disabled" value="<?php echo $idd; ?>"   >
              </td> 
            </tr>
        
           <tr>
              <td><?php echo $coid;?>   <?php foreach ($coid as $id) {echo $id;

}  
 ?> <?php echo $coid; ?> </td>  <?php echo $_POST['coid']; ?> <?php echo $substr; ?> <?php echo $id; ?> <?echo $company_id; ?> <?php echo $_SESSION[id]; ?>
 <?php echo $base_url?>
            </tr>          

            <tr>
              <td width="36%" height="22" align="right">COMPANY NAME : </td>
              <td width="53%">
                <input type="text" name="company_name" disabled="disabled" value="<?php echo $query; ?>">  
              </td>
            </tr>


<tr>
        <td><?php echo $idd; ?></td> <?php echo $row;?> <?php echo $a; ?> <?php echo $sql; ?>
</tr>



            <tr>
              <td height="35" align="right">BOOKING  FORM NO :</td>
              <td>
                <input type="text" name="bookingf_no" value="">
              </td>
            </tr>
            <tr>
              <td height="22" align="right">AMOUNT : </td>
              <td><input type="text" name="amount" value=""></td>
            </tr>
            <tr>
              <td height="22" align="right">DISCOUNT : </td>
              <td><input type="text" name="discount" value=""></td>
            </tr>
            <tr>
              <td height="22" align="right">AMOUNY  PAYABLE : </td>
              <td><input type="text" name="amount_payable" value=""></td>
            </tr>
            <tr>
              <td height="22" align="right">AMOUNT COLLECTED : </td>
              <td><input type="text" name="amount_collected" value=""></td>
            </tr>
			<tr>
              <td height="22" align="right">BALANCE PAYABLE ON :  </td>
              <td><label>
       <input type="text" name="balance_payable_on" id="balance_payable_on" />
          <img src="calender.jpg" width="20" height="18" onclick="return showCalendar('balance_payable_on', '%Y-%m-%d ', '12');"/>
          </label></td>
            </tr>
			<tr>
              <td height="22" align="right">BALANCE PAYED : </td>
              <td><input type="text" name="balance_payed" value=""></td>
            </tr>
            <tr>
              <td height="22" align="right">EXECUTIVE : </td>
              <td><input type="text" name="executive" value="<?php echo $_SESSION['User']; ?>" disabled="disabled"></td>
            </tr>
			  <tr>
              <td align="right">RECEIPT NO : </td>
              <td><input type="text" name="receipt_no" value="" ></td>
            </tr>


               <tr>
              <td align="right">RECEIPT DATE : </td>
              <td><label>
       <input type="text" name="receipt_date" id="receipt_date" />
          <img src="calender.jpg" width="20" height="18" onclick="return showCalendar('receipt_date', '%Y-%m-%d ', '12');"/>
          </label></td>
            </tr>



            <tr>
              <td align="right">REMARKS : </td>
              <td><input type="text" name="remarks" value="" ></td>
            </tr>

			 
			 <tr>
              <td height="37" align="right"><label>
                <input type="submit" name="Submit" value="Submit" onclick="return val();">
              </label></td>
              <td><input type="Reset" name="Reset" value="Reset"></td>
            </tr>
          </table></td>
        </tr>
      </table>
    </form>
		
	</td>
  </tr>
  <tr>
             <td><?php echo session_id(); ?> <?php echo session_name(); ?></td> 
  </tr>
 
  <tr>
    <td colspan="2">
    

  
</table>



</form>
</body>
</html>
<?php
}
else 
{
echo "<br><a href='index.php'>Click here to Login</a><br>";

}
?>



javascript also there skip that....
Was This Post Helpful? 1
  • +
  • -

#4 sas1ni69  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 81
  • View blog
  • Posts: 430
  • Joined: 04-December 08

Re: passing values

Posted 30 April 2011 - 03:47 AM

Hi Carmel,

What is the error you're getting right now? Do you have Firebug installed on your machine?

Just a point to make, you shouldn't mix PHP and HTML within the same page. It creates a lot of unnecessary problems.

If you look at line 2, you're making a call to $id but you have not defined it at any point in your code.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1