pranjal

Untitled

Jul 12th, 2012
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. //=========== Update code ===============
  2. $msgl='';
  3.  
  4. if(isset($_REQUEST['edit_x']) && $_REQUEST['edit_x']=='Edit Ticket') {
  5. //echo "fddffdsfd"; exit;
  6. //echo "<pre>";print_r($_REQUEST);exit;
  7. if($_REQUEST['name']==''){
  8. $msgl="Cust Name can not be blank";
  9. echo '<b><font color="red">'.$msgl.'</font></b>';
  10. }elseif($_REQUEST['email']==''){
  11. $msgl="Cust Email can not be blank";
  12. echo '<b><font color="red">'.$msgl.'</font></b>';
  13. }elseif($_REQUEST['topicId']==''){
  14. $msgl="Topic Id can not be blank";
  15. echo '<font color=red>'.$msgl.'</font>';
  16. }elseif($_REQUEST['subject']==''){
  17. $msgl="Subject can not be blank";
  18. echo '<font color=red>'.$msgl.'</font>';
  19. }
  20.  
  21. if ($msgl==''){
  22. update_cust(query_type($_REQUEST['topicId']));
  23. header('Location: viewticket.php?msg=3');
  24. }
  25. }
  26.  
  27. function query_type($k)
  28. {
  29. switch ($k) {
  30. case "1":
  31. return "Billing";
  32. break;
  33. case "2":
  34. return "Sales";
  35. break;
  36. case "3":
  37. return "Resp...";
  38. break;
  39. default:
  40. return "Invalid Option";
  41. break;
  42. }
  43. }
  44.  
  45.  
  46. function update_cust($topicId){
  47. //echo "In Update"; exit;
  48. //echo "<pre>";print_r($_REQUEST);exit;
  49.  
  50. $con=mysql_connect("localhost","root","");
  51.  
  52. mysql_select_db('supportsystem',$con);
  53.  
  54. $qry="update newticket set fname='".$_REQUEST['name']."', email='".$_REQUEST['email']."', phno='".$_REQUEST['phone']."', ext='".$_REQUEST['phone_ext']."',help='".$topicId."',subject='".$_REQUEST['subject']."', username='".$_REQUEST['username']."',vehicleno='".$_REQUEST['veh_name']."',msg='".$_REQUEST['message']."' where id ='".$_REQUEST['hideid']."'";
  55.  
  56.  
  57. mysql_query($qry,$con);
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment