PageRenderTime 27ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/specialmarry/pet.php

http://ccmtc-chen.googlecode.com/
PHP | 282 lines | 261 code | 12 blank | 9 comment | 15 complexity | 34171ef0e232c052d28be56124863115 MD5 | raw file
  1. <?php
  2. session_start();
  3. require_once("../mysql/DataBasesClass.php");
  4. $DB=new DataBasesClass;
  5. if(isset($_GET['page']))
  6. {
  7. $page=$_GET['page'];
  8. $userid=$_GET['userid'];
  9. }
  10. else
  11. {
  12. $page=0;
  13. $userid=$_GET['userid']; // ??user_id;
  14. // $userid=$DB->atrribute_value('user',$username,'user_id');
  15. }
  16. $userarr=$DB->user_information($userid);
  17. $username=$userarr['user_name'];
  18. if($userid==-1)//?????(???????id)
  19. {
  20. Header("Location:namewrong.php");//DataBasesClass.php???????????????????
  21. exit;
  22. }
  23. $sql="select * from pet where user_id='".$userid."'";
  24. $result=mysql_query($sql,$DB->my_connect);
  25. $pet_num=@mysql_num_rows($result);
  26. //echo $pet_num;
  27. if($userid==-1)
  28. {
  29. $pet_num=-1;//?????
  30. }
  31. while($row = @mysql_fetch_array($result, MYSQL_ASSOC))
  32. {
  33. $petid=$row['pet_id'];
  34. $pet_id[]=$DB->atrribute_value("pet",$petid,"pet_id");
  35. $pet_name[]=$DB->atrribute_value("pet",$petid,"pet_name");
  36. $pet_sex[]=$DB->atrribute_value("pet",$petid,"pet_sex");
  37. $pet_species[]=$DB->atrribute_value("pet",$petid,"pet_species");
  38. $pet_otherspecies[]=$DB->atrribute_value("pet",$petid,"pet_species_others");
  39. $pet_birth[]=$DB->atrribute_value("pet",$petid,"pet_birthday");
  40. $pet_info[]=$DB->atrribute_value("pet",$petid,"pet_information");
  41. $pet_pay_way[]=$DB->atrribute_value("pet",$petid,"pet_pay_way");
  42. $pet_pay_cost[]=$DB->atrribute_value("pet",$petid,"pet_pay_cost");
  43. $pet_pay_time[]=$DB->atrribute_value("pet",$petid,"pet_pay_time");
  44. $pet_require[]=$DB->atrribute_value("pet",$petid,"pet_sex_require");
  45. $pet_child_distribution[]=$DB->atrribute_value("pet",$petid,"pet_child_distribution");
  46. $pet_visited[]=$DB->atrribute_value("pet",$petid,"pet_visited");//
  47. $pet_kind[]=$DB->atrribute_value("pet",$petid,"pet_kind");//
  48. }
  49. if($pet_num==1)
  50. {//???
  51. $turnpage="";
  52. }
  53. if(($pet_num==($page+1))&&($pet_num!=1))
  54. {//??????
  55. $turnpage='<a href=otherspecialprofile.php?page='.($page-1).'&userid='.$userid.'>???</a>';
  56. }
  57. if($pet_num>($page+1))
  58. {//?????????
  59. $turnpage='<a href=otherspecialprofile.php?page='.($page-1).'&userid='.$userid.'>???</a>|<a href=otherspecialprofile.php?page='.($page+1).'&userid='.$userid.'>???</a>';
  60. }
  61. if(($page==0)&&($pet_num!=1))
  62. {
  63. $turnpage='<a href=otherspecialprofile.php?page='.($page+1).'&userid='.$userid.'>???</a>';
  64. }
  65. ?>
  66. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  67. <html xmlns="http://www.w3.org/1999/xhtml">
  68. <head>
  69. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  70. <!-- InstanceBeginEditable name="doctitle" -->
  71. <title>??????????</title>
  72. <link rel="stylesheet" type="text/css" href="../../Templates/sdmenu/sdmenu.css" />
  73. <script type="text/javascript" src="../../Templates/sdmenu/sdmenu.js">
  74. /***********************************************
  75. * Slashdot Menu script- By DimX
  76. * Submitted to Dynamic Drive DHTML code library: http://www.dynamicdrive.com
  77. * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
  78. ***********************************************/
  79. </script>
  80. <script type="text/javascript">
  81. // <![CDATA[
  82. var myMenu;
  83. window.onload = function() {
  84. myMenu = new SDMenu("my_menu");
  85. myMenu.init();
  86. };
  87. function loginin()
  88. {
  89. window.showModalDialog('http://localhost/petfeeling/loginout/loginin.php');
  90. }
  91. function loginout()
  92. {
  93. if(confirm("??????")){
  94. window.location.href='http://localhost/petfeeling/loginout/exitok.php';
  95. } }
  96. // ]]>
  97. </script>
  98. <!-- InstanceEndEditable -->
  99. <!-- InstanceBeginEditable name="head" -->
  100. <!-- InstanceEndEditable -->
  101. <style type="text/css">
  102. <!--
  103. .STYLE1 {font-family: "????", "??"}
  104. .STYLE3 {
  105. font-size: 18px;
  106. font-family: "??";
  107. }
  108. -->
  109. </style>
  110. <link href="../../style.css" rel="stylesheet" type="text/css" />
  111. <link href="../style.css" rel="stylesheet" type="text/css" />
  112. <style type="text/css">
  113. <!--
  114. .STYLE6 {font-size: 18px}
  115. .STYLE7 {font-family: "??"}
  116. -->
  117. </style>
  118. </head>
  119. <body style="margin:0">
  120. <div id="main" style="width:1000px;margin:0 auto;border:1px #ccc solid;">
  121. <div class="headline" style="text-align: right;background:#b64eeb;">
  122. <?php if(!isset($_SESSION['username']))
  123. {?>
  124. <td> <button type="button" onclick='loginin()'>??</button></td>
  125. <td><a href="../../loginout/register.php">??</a></td>
  126. <?php }
  127. else { ?>
  128. <td> <button type="button" onclick='loginout()'>??</button></td>
  129. <td> <?php echo "??: ".$_SESSION['username']; ?></td>
  130. <td> <?php echo "???:".$DB->noreadmessage($_SESSION['username']) ; ?></td>
  131. <?php
  132. }
  133. ?>
  134. </div>
  135. <div id="head" style="height:187px;width:1000px;border:1px #ccc solid">
  136. <table width="1000" height="187px" border="0" bgcolor="#FF9999" background-color="rgb(255,128,128)" cellpadding="0" cellspacing="0">
  137. <tr>
  138. <td height="132" colspan="9" align="left" bordercolor="#FF9999" bgcolor="white"><img src="../images/??logo.jpg" width="210" height="132" />
  139. <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="782" height="132">
  140. <param name="movie" value="../../images/logo.swf" />
  141. <param name="quality" value="high" />
  142. <embed src="../../images/logo.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="782" height="132"></embed>
  143. </object></td>
  144. </tr>
  145. <tr>
  146. <td width="111" height="55" align="center" background="../images/????.jpg" bgcolor="#FF9999" class="content"><span class="STYLE3 STYLE6 STYLE1"><a href="../index.php" class="STYLE1">??</a></span></td>
  147. <td width="111" align="center" background="../images/????.jpg" bgcolor="#FF9999" class="content"><span class="STYLE1 STYLE7 STYLE3 STYLE6"><span class="STYLE1"><a href="../marry/dogmarry.php">????</a></span></span></td>
  148. <td width="107" align="center" background="../images/????.jpg" bgcolor="#FF9999" class="content"><span class="STYLE3 STYLE1 STYLE6"><span class="STYLE1"><a href="../marry/catmarry.php">????</a></span></span></td>
  149. <td width="104" align="center" background="../images/????.jpg" bgcolor="#FF9999" class="content"><span class="STYLE3 STYLE1 STYLE6"><span class="STYLE1"><a href="../marry/othermarry.php">????</a></span></span></td>
  150. <td width="117" align="center" background="../images/????.jpg" bgcolor="#FF9999" class="content"><span class="STYLE3 STYLE1 STYLE6"><span class="STYLE1"><a href="specialmarry.php">??????</a></span></span></td>
  151. <td width="105" align="center" background="../images/????.jpg" bgcolor="#FF9999" class="content"><span class="STYLE3 STYLE1 STYLE6"><span class="STYLE1"><a href="../myaccount/myaccount.php">????</a></span></span></td>
  152. <td width="104" align="center" background="../images/????.jpg" bgcolor="#FF9999" class="content"><span class="STYLE3 STYLE1 STYLE6"><span class="STYLE1"><a href="../petknowledge/petknowledgeindex.php">????</a></span></span></td>
  153. <td width="106" align="center" background="../images/????.jpg" bgcolor="#FF9999" class="content"><span class="STYLE3 STYLE1 STYLE6"><span class="STYLE1">????</span></span></td>
  154. <td width="97" height="55" align="center" background="../images/????.jpg" bgcolor="#FF9999" class="content"><span class="STYLE1 STYLE6">????</span></td>
  155. </tr>
  156. </table>
  157. </div>
  158. <div style="float:left;width:845px;height:900px;">
  159. <!-- InstanceBeginEditable name="EditRegion3" -->
  160. <div style="margin:20px;">
  161. <table width="807" height="193" border="0">
  162. <td width="265"><form action="../myaccount/mail/message.php?email_to=<?php echo $username; ?> " method="post" name="form" id="form" >
  163. <tr class="content">
  164. <td height="57" colspan="3" class="title" background="../images/?????.gif">????????</td>
  165. </tr>
  166. <tr class="content">
  167. <td height="57" align="left" class="dashedtd">?????<?php echo $userarr['user_real_name'];?><strong></strong></td>
  168. <td width="284" height="57" class="dashedtd">???<?php echo $userarr['user_email'];?><strong></strong></td>
  169. <td width="244" class="dashedtd"><input name="submit" type="submit" class="STYLE3" value="????"/></td>
  170. </tr>
  171. <form/>
  172. <tr>
  173. <td height="69" align="left" class="dashedtd">?????<?php $province=$userarr['user_province'];
  174. if ($province=="??"||$province=="??"||$province=="??"||$province=="??")
  175. {
  176. echo $province."?";
  177. }
  178. else{
  179. echo $province."?".$userarr['user_city'];
  180. } ?></td>
  181. <td height="69" valign="middle" class="dashedtd">?????<?php echo $userarr['user_tel']; ?></td>
  182. <td class="dashedtd">&nbsp;</td>
  183. </tr>
  184. <tr>
  185. <td height="69" colspan="3" align="left" class="dashedtd">???????<?php echo $userarr['user_information']; ?></td>
  186. </tr>
  187. <tr class="content">
  188. <td height="57" colspan="3" background="../images/?????.gif" class="title">????</td>
  189. </tr>
  190. </table>
  191. <table width="807" height="865" border="0">
  192. <?php if($pet_num==0)
  193. echo "<tr><td class='title STYLE4'>"."???????????"."</td></tr>";
  194. else {
  195. ?>
  196. <tr>
  197. <td width="182" rowspan="7">
  198. <?php if(!file_exists("../../petsimage/".$user_id.'_'.$petid."small.jpg")){ ?>
  199. <p><img src="../images/petphoto.gif" width="160" height="160" /></p>
  200. <?php }
  201. else{ ?><p><img src="../../petsimage/<?php echo $user_id.'_'.$petid."small.jpg"; ?>" width="160" height="160" /></p> <?php }?></td>
  202. <td width="123" height="39" class="dashedtd"><span class="dashedtd">?????</span></td>
  203. <td width="488" class="dashedtd">&nbsp;<?php echo $pet_name[$page];?></td>
  204. </tr>
  205. <tr>
  206. <td height="44" class="dashedtd">?????</td>
  207. <td height="44" class="dashedtd">&nbsp;<?php echo $pet_kind[$page];?></td>
  208. </tr>
  209. <tr>
  210. <td height="44" class="dashedtd"><span class="content">?????</span></td>
  211. <td height="44" class="dashedtd">&nbsp;<?php echo $pet_sex[$page];?></td>
  212. </tr>
  213. <tr>
  214. <td height="36" class="dashedtd"><span class="content">?????</span></td>
  215. <td height="36" class="dashedtd">&nbsp;<?php $petspecies=$pet_species[$page];
  216. if ($petspecies=="??"){
  217. echo $pet_species[$page];
  218. echo "&nbsp;&nbsp;".$pet_otherspecies[$page];
  219. }
  220. else
  221. echo $pet_species[$page];?></td>
  222. </tr>
  223. <tr>
  224. <td height="39" class="dashedtd"><span class="content">?????</span></td>
  225. <td height="39" class="dashedtd">&nbsp;<?php echo $pet_birth[$page];?></td>
  226. </tr>
  227. <tr>
  228. <td height="39" class="dashedtd">?????</td>
  229. <td height="39" class="dashedtd">&nbsp;<?php echo $pet_visited[$page];?></td>
  230. </tr>
  231. <tr>
  232. <td height="39" class="dashedtd"><span class="content">???????</span></td>
  233. <td height="39" class="dashedtd">&nbsp;<?php echo $pet_info[$page];?></td>
  234. </tr>
  235. <tr>
  236. <td height="57" colspan="3" background="../images/?????.gif" class="title">??????</td>
  237. </tr>
  238. <tr>
  239. <td height="36" class="dashedtd">????:</td>
  240. <td colspan="2" class="dashedtd">&nbsp;<?php echo $pet_pay_way[$page];?></td>
  241. </tr>
  242. <tr>
  243. <td height="38" class="dashedtd">??????:</td>
  244. <td colspan="2" class="dashedtd">&nbsp;<?php echo $pet_child_distribution[$page];?></td>
  245. </tr>
  246. <tr>
  247. <td height="38" class="dashedtd">????:</td>
  248. <td colspan="2" class="dashedtd">&nbsp;<?php echo $pet_pay_cost[$page];?></td>
  249. </tr>
  250. <tr>
  251. <td height="37" class="dashedtd">??????:</td>
  252. <td colspan="2" class="dashedtd">&nbsp;<?php echo $pet_pay_time[$page];?></td>
  253. </tr>
  254. <tr>
  255. <td height="37" class="dashedtd"><span class="content">???????</span></td>
  256. <td colspan="2" class="dashedtd">&nbsp;<?php echo $pet_require[$page];?></td>
  257. </tr>
  258. <tr>
  259. <td height="22" colspan="3" align="center">&nbsp;<?php echo $turnpage?></td>
  260. </tr>
  261. <?php
  262. }
  263. ?>
  264. <td height="128"></tbody>
  265. </table>
  266. </div>
  267. <!-- InstanceEndEditable --> </div>
  268. </div>
  269. </body>
  270. <!-- InstanceEnd --></html>