Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. <select id="user_id" onchange="funCom(this);" >
  2. <option value="" >Select Broker </option>
  3. <?php $aData=$oGeneral->get_records('tbl_user');
  4.  
  5. $aUsertDetails = $oGeneral->aAdmin;
  6. $iUserDetails = $oGeneral->iAdmin;
  7. for($i=0;$i<$iUserDetails;$i++){?>
  8. <option value="<?=$aUsertDetails[$i]['fld_id']?>">
  9. <?php echo $aUsertDetails[$i]['fld_name']; ?></option>
  10.  
  11. <?php }?>
  12. </select>
  13. <input type="text" id="comm" name="fld_commision" value="" onkeyup="sum()" required>
  14.  
  15. function funCom(id){
  16. id = id.value;
  17.  
  18. Token= "search-comm";
  19. SendData= "Token="+Token+"&id="+id;
  20.  
  21.  
  22. $.ajax({ url: 'Ajaxhandler.php',
  23. dataType: 'text',
  24. type: 'post',
  25. async: false,
  26. data: SendData,
  27. success: function(data)
  28. {
  29.  
  30.  
  31. //var commision=stripHTML(data);
  32. //$('#comm').val(commision); again not working
  33. //$('#comm').text(data); Tried this but fail
  34. $('#comm').val(data); //output is <body></body></html>7000
  35. // i want only 7000 i have tried
  36. },
  37. error: function( jqXhr, textStatus, errorThrown ){
  38. console.log( errorThrown );
  39. } });
  40.  
  41.  
  42. }
  43.  
  44. <?php
  45. require('../configuration/configuration.php');
  46. $oGeneral = new GeneralClass();
  47. $oUser = new UserClass();
  48.  
  49. $token= $_REQUEST['Token'];
  50.  
  51. switch($token) {
  52. case 'search-comm': $id=$_REQUEST['id'];
  53. $oUser->project_commision($id);
  54. $aUsertDetails = $oUser->aResults;
  55. $iUsertDetails = $oUser->iResults;
  56. $total=0;
  57. for($i=0;$i<$iUsertDetails;$i++){
  58. $total+= $aUsertDetails[$i]['fld_commsionprice'];
  59.  
  60. }
  61. echo $total;
  62. break;
  63. }
  64.  
  65. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement