if ($_GET[action]=="show"){
$car = validate_id($_GET[id]);
$ba = $DB-%26gt;fetch_one_array("SELECT * FROM brand WHERE id = '$car[brand]'");
echo "
%26lt;form name=\"car\" method=\"post\" action=\"car.php\" onsubmit=\"return CheckForm()\" enctype=\"multipart/form-data\"%26gt;
%26lt;input type=\"hidden\" name=\"action\" value=\"update1\"%26gt;
%26lt;input type=\"hidden\" name=\"cid\" value=\"$car[cid]\"%26gt;
%26lt;table width=\"700\" border=\"0\" cellspacing=\"0\" class=\"tableoutline\"%26gt;
%26lt;tr class=\"tbhead\"%26gt;
%26lt;td colspan=\"2\"%26gt;$ba[brand] $car[name] information%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td width=\"169\"%26gt;Model锛?lt;/td%26gt;
%26lt;td width=\"327\"%26gt;%26lt;label%26gt;
$car[name]
%26lt;/label%26gt;%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr %26gt;
%26lt;td %26gt;Brand锛?lt;/td%26gt;%26lt;td%26gt;
%26lt;select name=\"brand\" %26gt;";
$sql = "select * from brand";
$result = $DB-%26gt;query($sql);
$cage = date("Y-m-j",$car[cage]);
$years = date("Y-m-j",$car[years]);
$car[rentdate] = date("Y-m-j",$car[rentdate]);
$car[rentbackdate] = date("Y-m-j",$car[rentbackdate]);
$rows = @mysql_num_rows($result);
for ($i=0;$i%26lt;$rows;$i++){
@mysql_data_seek($result,$i);
$brand = @mysql_fetch_array($result);
if($car[brand]==$brand[id]){
echo "
%26lt;option value=\"$brand[id]\" selected disabled class=\"\"%26gt;$brand[brand]%26lt;/option%26gt;";
}else{
echo "
%26lt;option value=\"$brand[id]\" disabled class=\"\"%26gt;$brand[brand]%26lt;/option%26gt;";
}
}
echo"%26lt;/select%26gt;%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td%26gt;Color锛?lt;/td%26gt;
%26lt;td%26gt;$car[color]%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td%26gt; Engine锛?lt;/td%26gt;
%26lt;td%26gt;$car[fa]%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td%26gt; Seller锛?lt;/td%26gt;
%26lt;td%26gt;$car[company]%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td%26gt; Buyer锛?lt;/td%26gt;
%26lt;td%26gt;$car[person]%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td%26gt; Price锛?lt;/td%26gt;
%26lt;td%26gt;$car[price]%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;";
$cpforms-%26gt;makerent(array('text'=%26gt;'Rent status锛?lt;/td%26gt;%26lt;td%26gt;',
'name'=%26gt;'ornot',
'selected'=%26gt;$car[ornot],
));
echo "
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td%26gt; Customer锛?lt;/td%26gt;
%26lt;td%26gt;%26lt;input name=\"rentname\" type=\"text\" id=\"rentname\" value=\"$car[rentname]\"%26gt;%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td%26gt; Rent date锛?lt;/td%26gt;
%26lt;td%26gt;%26lt;input name=\"rentdate\" type=\"text\" id=\"rentdate\" value=\"$car[rentdate]\" onclick=\"setday(this)\"%26gt;(*1999-11-30 is an sample*)%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td%26gt; Return date锛?lt;/td%26gt;
%26lt;td%26gt;%26lt;input name=\"rentbackdate\" type=\"text\" id=\"rentbackdate\" value=\"$car[rentbackdate]\" onclick=\"setday(this)\"%26gt;(*1999-11-30 is an sample*)%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td%26gt; Purchase date锛?lt;/td%26gt;
%26lt;td%26gt;$cage%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td%26gt; Insurance锛?lt;/td%26gt;
%26lt;td%26gt;$years%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td%26gt;Maintenance record锛?lt;/td%26gt;
%26lt;td%26gt;$car[maintenance]%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td%26gt;Picture锛?lt;/td%26gt;
%26lt;td%26gt;";
$id1 = $car[cid];
$car1 = $DB-%26gt;fetch_one_array("SELECT * FROM file WHERE oid = '$id1' AND ty = 2");
if($car1[path]==""){echo"No picture";}else{
echo"
%26lt;img src=\"$car1[path]\" width=\"400\" height=\"200\" /%26gt;";
}
echo"%26lt;/td%26gt;%26lt;/tr%26gt;
%26lt;tr width=\"100%\" class=\"tbhead\"%26gt;
%26lt;td width=\"\" colspan=\"2\" align=\"center\"%26gt;
%26lt;input class=\"bginput\" accesskey=\"y\" type=\"submit\" name=\"submit\" value=\" submit \" %26gt;
%26lt;input class=\"bginput\" type=\"button\" name=\"Submit2\" value=\"back\" onclick=\"history.back(1)\"%26gt;
%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;/table%26gt;
%26lt;/form%26gt;
";
}
//========鏇存柊姹借溅绉熻溅璧勬枡===========
if ($_POST[action]=="update1"){
$cid = $_POST[cid];
$date_elements = explode("-" ,$_POST[rentdate]);
$_POST[rentdate] = mktime (0,0,0,$date_elements [1], $date_elements[ 2],$date_elements [0]);
$date_elements = explode("-" ,$_POST[rentbackdate]);
$_POST[rentbackdate] = mktime (0,0,0,$date_elements [1], $date_elements[ 2],$date_elements [0]);
$DB-%26gt;query("UPDATE cars SET
ornot='".addslashes(htmlspecialchars(str...
rentname='".addslashes(htmlspecialchars(...
rentdate='".addslashes(htmlspecialchars(... WHERE cid='$cid'',
rentbackdate='".addslashes(htmlspecialch... WHERE cid='$cid'");
redirect("./setup.php?action=carshow","E... car is successful.");
}
$DB-%26gt;close();
?%26gt;
%26lt;/body%26gt;
%26lt;/html%26gt;
Who can help me check php file problem?? so worry.. PLZ....-_-````?microsoft windows xp
Does not look easy, may be you can contact a PHP expert live at website like http://askexpert.info/ .
Who can help me check php file problem?? so worry.. PLZ....-_-````?ie 7 internet explorer
Tough to say without any error messages or further documentation.
For example how is validate_id is declared?
No comments:
Post a Comment