如何在点击href后禁用部分页面代码?

时间:2014-11-18 08:22:50

标签: php mysql

我正在尝试创建故障单系统,想法是在同一页面中获取新故障单表单旁边的所有故障单,我希望当有人点击故障单时,故障单和新的故障单表单应该消失并打开故障单在同一页面中的响应表单。我的意思是当有人点击机票时,我希望一切都消失,期待响应形成。请帮忙。          

     print ("
     <form action='<?php echo $PHP_SELF;?>' method='post' class='f'>
     <input type='text' name='subject' placeholder='العنوان'></input>
     <textarea name='tmessage' placeholder='الموضوع'></textarea>
     <input type='submit' name='t_submit' value='انشاء'></input>
     </form>");
     $tsubject=$_POST['subject'];
     $tmessage=$_POST['tmessage'];
     $tsubmit=$_POST['t_submit'];
     $ttdate=date ("Y-m-d");
     if(isset($tsubmit)){

     $int=mysql_query("INSERT INTO tickets(id,u_id,message,subject,date,status) 

     VALUES('','$_SESSION[id]','$tmessage','$tsubject','$ttdate','0')");

     if($int) { echo "تم انشاء التذكرة بنجاح";} else{ echo "خطاء"; }

     }
     $gtk=mysql_query("SELECT * FROM tickets WHERE u_id='$_SESSION[id]'");
     while($ftk=mysql_fetch_object($gtk)){
     if($ftk->status == 0) { $tkst= "معلقة"; }
     if($ftk->status == 1) { $tkst= "مجابه"; }
     print("<a href='tickets.php?tkid=$ftk->id' class='f'>$ftk->subject</a> . 

     $tkst");
     }
     $tkid=$_GET['tkid'];

     $uig=mysql_query("SELECT * FROM users WHERE id='$_SESSION[id]'");
     $fuig=mysql_fetch_object($uig);
     $gm=mysql_query("SELECT * FROM tickets WHERE id='$tkid'");
     $fgm=mysql_fetch_object($gm);
     print ("<fieldset>
     <legend>$fuig->username </legend>
     $fgm->message
     </fieldset>");
     $grs=mysql_query("SELECT * FROM responses WHERE t_id='$tkid' ORDER BY id 

     ASC");
     while($fgrs=mysql_fetch_object($grs)){

     print("$fgrs->response <br>");

     }
     print("
     <form action='<?php echo $PHP_SELF;?>' method='post'>
     <textarea name='response'></textarea>
     <input type='submit' name='rsubmit' value='ارسل'></input>
     </form>
     ");
     $response=$_POST ['response'];
     $rsubmit=$_POST ['rsubmit'];
     $tdate=date ("Y-m-d");
     if(isset($rsubmit)){


     $ir=mysql_query("INSERT INTO responses(id,t_id,response,r_date) VALUES

     ('','$tkid','$response','$tdate')");
     if($ir) { echo "تم ارسال الرد";
     } else { echo "خطاء";}
     }




        ?>

0 个答案:

没有答案