<?php ob_start();
require_once("auth.php");
include("config.php");
$obj = new kamran();
$connection = $obj->connection();
include("connector.php");
if(isset($_SESSION['resid'])){
$resellerid=$_SESSION['resid'];
}
if(isset($_SESSION['userEmail'])){
$resellerEmail=$_SESSION['userEmail'];
}
if(isset($_GET['oid']))
{
}
$orderid=$_GET['oid'];
$pagename="order";
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Order Details</title>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/font-awesome.min.css" rel="stylesheet">
<link href="../css/datepicker3.css" rel="stylesheet">
<link href="../css/styles.css" rel="stylesheet">
这是我的HTML,这对我来说似乎很完美 &LT; /脚本&GT; &LT; /脚本&GT;
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="../proposal/reseller/js/ddsmoothmenu.js">
/***********************************************
* Smooth Navigational Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<script type="text/javascript">
ddsmoothmenu.init({
mainmenuid: "smoothmenu1", //menu DIV id
orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
classname: 'ddsmoothmenu', //class added to menu's outer DIV
//customtheme: ["#1c5a80", "#18374a"],
contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
ddsmoothmenu.init({
mainmenuid: "smoothmenu2", //Menu DIV id
orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
//customtheme: ["#804000", "#482400"],
contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
</script>
<link rel="stylesheet" type="text/css" href="../proposal/reseller/ddsmoothmenu.css"/>
<link rel="stylesheet" href="themes/ui-lightness/jquery.ui.all.css">
<script src="js/jquery-1.7.2.js"></script>
<script src="ui/jquery.ui.core.js"></script>
<script src="ui/jquery.ui.widget.js"></script>
<script src="ui/jquery.ui.datepicker.js"></script>
<link rel="stylesheet" href="demos.css">
<script>
$(function() {
$( ".datepicker" ).datepicker({ dateFormat: 'yy-mm-dd' });
});
</script>
</head>
<body>
<nav class="navbar navbar-custom navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#sidebar-collapse"><span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span></button>
<a class="navbar-brand" href="#"><span>AirOMCC</span>.com</a>
<ul class="nav navbar-top-links navbar-right">
<?php
$results = mysqli_query($connection,"select count(cmmstatus) as total1 from comission where comission_name = 'one time' and cmmstatus = 1");
foreach($results as $result){
echo '
<li class="dropdown"><a class="dropdown-toggle count-info" data-toggle="dropdown" href="onetime_comission.php">
<em class="fa fa-bell"></em><span class="label label-info">'.$result['total1'].'</span>
</a>
</li>';
}
$results = mysqli_query($connection,"select count(rsalert) as total2 from comission where comission_name = 'residual commission' and rsalert = 1");
foreach($results as $result){
echo '
<li class="dropdown"><a class="dropdown-toggle count-info" data-toggle="dropdown" href="residual_comission.php">
<em class="fa fa-bell"></em><span class="label label-info">'.$result['total2'].'</span>
</a>
</li>';
}
?>
</ul>
</div>
</div><!-- /.container-fluid -->
</nav>
<div id="sidebar-collapse" class="col-sm-3 col-lg-2 sidebar">
<div class="profile-sidebar">
<div class="profile-usertitle">
<div class="profile-usertitle-name">Welcome <?php echo $supercreator; ?></div>
<div class="profile-usertitle-status"><span class="indicator label-success"></span>Online</div>
</div>
<div class="clear"></div>
</div>
<div class="divider"></div>
<form role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
</form>
<?php include("menu.php");?>
</div><!--/.sidebar-->
<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
<div class="row">
<ol class="breadcrumb">
<li><a href="#">
<em class="fa fa-home"></em>
</a></li>
<li class="active">Order Details</li>
</ol>
</div><!--/.row-->
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel panel-default">
<div class="panel-body">
<div class="col-md-12">
<br />
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="orange-heading"><strong>Order Details</strong></td>
<td align="right">
</td>
</tr>
</table>
<form action="view-order-details.php?oid=<?php echo $orderid; ?>" method="post">
<br />
<br />
<?php
$orderdetails=mysql_fetch_array(mysql_query("select * from orders where orderid='".$orderid."'"));
$orderstatus=mysql_fetch_array(mysql_query("select * from orderstatus where orderid='".$orderid."'"));
$productqry=mysql_query("select * from orderproductsdetails where orderid='".$orderid."'");
?>
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="700">
<table width="700" border="0" style="border:solid 1px #CCC; border-top:0;" cellspacing="0" cellpadding="0">
<tr>
<td width="180" height="28" class="types">Order reference #:</td>
<td width="518" class="values"><?php echo $orderdetails['orderid']; ?></td>
</tr>
<tr>
<td width="180" height="28" class="types">Customer ID:</td>
<td width="518" class="values"><input type="text" name="cid" id="cid" onblur="updateorder(this,'<?php echo $orderid; ?>','CustomerID'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['CustomerID']; ?>" /> <img src="images/loading.gif" alt="loading" id="cidload" class="hider" /> <a href="javascript:void(0);" onclick="document.getElementById('cid').readOnly=''; document.getElementById('cid').className='border-blue'; document.getElementById('cid').focus();" class="edit">Edit</a></td>
</tr>
<tr>
<td height="28" class="types">First Name:</td>
<td class="values"><input type="text" name="fname" id="fname" onblur="updateorder(this,'<?php echo $orderid; ?>','FirstName'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['FirstName']; ?>" /> <img src="images/loading.gif" alt="loading" id="fnameload" class="hider" /> <a href="javascript:void(0);" onclick="document.getElementById('fname').readOnly=''; document.getElementById('fname').className='border-blue'; document.getElementById('fname').focus();" class="edit">Edit</a></td>
</tr>
<tr>
<td height="28" class="types">Last Name:</td>
<td class="values"><input type="text" name="lname" id="lname" onblur="updateorder(this,'<?php echo $orderid; ?>','LastName'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['LastName']; ?>" /><img src="images/loading.gif" alt="loading" id="lnameload" class="hider" /><a href="javascript:void(0);" onclick="document.getElementById('lname').readOnly=''; document.getElementById('lname').className='border-blue'; document.getElementById('lname').focus();" class="edit">Edit</a></td>
</tr>
<tr>
<td height="28" class="types">Company Name:</td>
<td class="values">
<input type="text" name="companyname" id="companyname" onblur="updateorder(this,'<?php echo $orderid; ?>','companyname'); this.readOnly='readonly';" readonly="readonly" style="border:0; width:430px;" value="<?php echo $orderdetails['companyname']; ?>" /><img src="images/loading.gif" alt="loading" id="companynameload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('companyname').readOnly=''; document.getElementById('companyname').className='border-blue'; document.getElementById('companyname').focus();" class="edit">Edit</a>
</td>
</tr>
<tr>
<td height="28" class="types">Company Contact Name:</td>
<td class="values">
<input type="text" name="company_contact_name" id="company-contact-name" onblur="updateorder(this,'<?php echo $orderid; ?>','company_contact_name'); this.readOnly='readonly';" readonly="readonly" style="border:0; width:430px;" value="<?php echo $orderdetails['company_contact_name']; ?>" /><img src="images/loading.gif" alt="loading" id="company-contact-nameload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('company-contact-name').readOnly=''; document.getElementById('company-contact-name').className='border-blue'; document.getElementById('company-contact-name').focus();" class="edit">Edit</a>
</td>
</tr>
<tr>
<td height="28" class="types">Primary Address:</td>
<td class="values"><input type="text" name="paddress" id="paddress" onblur="updateorder(this,'<?php echo $orderid; ?>','Paddress'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['Paddress']; ?>" /><img src="images/loading.gif" alt="loading" id="paddressload" class="hider" /><a href="javascript:void(0);" onclick="document.getElementById('paddress').readOnly=''; document.getElementById('paddress').className='border-blue'; document.getElementById('paddress').focus();" class="edit">Edit</a></td>
</tr>
<tr>
<td height="28" class="types">Secondry Address:</td>
<td class="values">
<input type="text" name="saddress" id="saddress" onblur="updateorder(this,'<?php echo $orderid; ?>','Saddress'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['Saddress']; ?>" /><img src="images/loading.gif" alt="loading" id="saddressload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('saddress').readOnly=''; document.getElementById('saddress').className='border-blue'; document.getElementById('saddress').focus();" class="edit">Edit</a></td>
</tr>
<tr>
<td height="28" class="types">City:</td>
<td class="values"><input type="text" name="City" id="City" onblur="updateorder(this,'<?php echo $orderid; ?>','City'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['City']; ?>" /><img src="images/loading.gif" alt="loading" id="Cityload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('City').readOnly=''; document.getElementById('City').className='border-blue'; document.getElementById('City').focus();" class="edit">Edit</a></td>
</tr>
<tr>
<td height="28" class="types">State:</td>
<td class="values">
<input type="text" name="State" id="State" onblur="updateorder(this,'<?php echo $orderid; ?>','State'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['State']; ?>" /><img src="images/loading.gif" alt="loading" id="Stateload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('State').readOnly=''; document.getElementById('State').className='border-blue'; document.getElementById('State').focus();" class="edit">Edit</a>
</td>
</tr>
<tr>
<td height="28" class="types">Zipcode:</td>
<td class="values">
<input type="text" name="Zipcode" id="Zipcode" onblur="updateorder(this,'<?php echo $orderid; ?>','Zipcode'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['Zipcode']; ?>" /><img src="images/loading.gif" alt="loading" id="Zipcodeload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('Zipcode').readOnly=''; document.getElementById('Zipcode').className='border-blue'; document.getElementById('Zipcode').focus();" class="edit">Edit</a>
</td>
</tr>
<tr>
<td height="28" class="types">Email:</td>
<td class="values">
<input type="text" name="Email" id="Email" onblur="updateorder(this,'<?php echo $orderid; ?>','Email'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['Email']; ?>" /><img src="images/loading.gif" alt="loading" id="Emailload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('Email').readOnly=''; document.getElementById('Email').className='border-blue'; document.getElementById('Email').focus();" class="edit">Edit</a>
</td>
</tr>
<tr>
<td height="28" class="types">Phone:</td>
<td class="values">
<input type="text" name="Phone" id="Phone" onblur="updateorder(this,'<?php echo $orderid; ?>','Phone'); this.readOnly='readonly';" readonly="readonly" style="border:0;width:430px;" value="<?php echo $orderdetails['Phone']; ?>" /><img src="images/loading.gif" alt="loading" id="Phoneload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('Phone').readOnly=''; document.getElementById('Phone').className='border-blue'; document.getElementById('Phone').focus();" class="edit">Edit</a>
</td>
</tr>
<tr>
<td height="28" class="types" style="color:#F00;">Sales Person Name:</td>
<td class="values">
<input type="text" name="spname" id="spname" onblur="updateorder(this,'<?php echo $orderid; ?>','SalesPerson'); this.readOnly='readonly';" readonly="readonly" style="border:0; color:#F00; width:430px;" value="<?php echo $orderdetails['SalesPerson']; ?>" /><img src="images/loading.gif" alt="loading" id="spnameload" class="hider" />
<a href="javascript:void(0);" onclick="document.getElementById('spname').readOnly=''; document.getElementById('spname').className='border-blue'; document.getElementById('spname').focus();" class="edit">Edit</a>
</td>
</tr>
<tr>
<td height="28" class="types borderbot">Order Date:</td>
<td class="values borderbot"><?php echo $orderdetails['Order_Date']; ?></td>
</tr>
<tr>
<td class="values borderbot"></td>
<td class="values borderbot"><input name="btnosave" class="btn btn-primary" type="submit" value="save changes" style="float: right;" /></td>
</tr>
这是我的PHP代码,不知道是什么原因造成的。
if(isset($_post['btnosave'])){
echo'<script>alert("kuch to dekhao")</script>';
$cid = $_post['cid'];
$fname = $_post['fname'];
$lname = $_post['lname'];
$companyname = $_post['companyname'];
$company_contact_name = $_post['company_contact_name'];
$paddress = $_post['paddress'];
$saddress = $_post['saddress'];
$City = $_post['City'];
$State = $_post['State'];
$Zipcode = $_post['Zipcode'];
$Email = $_post['Email'];
$Phone = $_post['Phone'];
$spnam = $_post['spname'];
mysqli_query($connection,"update orders set CustomerID = '".$cid."', FirstName = '".$fname."', LastName = '".$lname."', companyname = '".$companyname."', companyname = '".$companyname."', company_contact_name = '".$company_contact_name."', Paddress = '".$paddress."', Saddress = '".$saddress."', City = '".$City."',State = '".$State."',Zipcode = '".$Zipcode."',Email = '".$Email."',Phone = '".$Phone."',SalesPerson = '".$spname."' where orderid='".$orderid."'") or die("<script>alert('error in update query)</script>");
}
?>
由于我是php新手,我有客户,他希望在旧版本中对他已经制作的产品进行一些更改,因此您可能会看到一些已被弃用的代码但是现在我正在使用mysqli进行他想要的进一步工作。但我仍然遇到问题,应该是工作或至少给出错误,它没有任何输出。
答案 0 :(得分:2)
在您的isset语句中,使用帖子方法上限,例如
如果(isset($ _ POST [ 'someval']))
以及所有其他地方也在您的代码中。
答案 1 :(得分:1)
$ _ post不是正确的格式。您需要使用正确的代码 $ _ POST 。当您使用post方法然后将PHP代码中的POST方法应用于大写。请在发布问题之前检查您的代码。