Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select id="user_id" onchange="funCom(this);" >
- <option value="" >Select Broker </option>
- <?php $aData=$oGeneral->get_records('tbl_user');
- $aUsertDetails = $oGeneral->aAdmin;
- $iUserDetails = $oGeneral->iAdmin;
- for($i=0;$i<$iUserDetails;$i++){?>
- <option value="<?=$aUsertDetails[$i]['fld_id']?>">
- <?php echo $aUsertDetails[$i]['fld_name']; ?></option>
- <?php }?>
- </select>
- <input type="text" id="comm" name="fld_commision" value="" onkeyup="sum()" required>
- function funCom(id){
- id = id.value;
- Token= "search-comm";
- SendData= "Token="+Token+"&id="+id;
- $.ajax({ url: 'Ajaxhandler.php',
- dataType: 'text',
- type: 'post',
- async: false,
- data: SendData,
- success: function(data)
- {
- //var commision=stripHTML(data);
- //$('#comm').val(commision); again not working
- //$('#comm').text(data); Tried this but fail
- $('#comm').val(data); //output is <body></body></html>7000
- // i want only 7000 i have tried
- },
- error: function( jqXhr, textStatus, errorThrown ){
- console.log( errorThrown );
- } });
- }
- <?php
- require('../configuration/configuration.php');
- $oGeneral = new GeneralClass();
- $oUser = new UserClass();
- $token= $_REQUEST['Token'];
- switch($token) {
- case 'search-comm': $id=$_REQUEST['id'];
- $oUser->project_commision($id);
- $aUsertDetails = $oUser->aResults;
- $iUsertDetails = $oUser->iResults;
- $total=0;
- for($i=0;$i<$iUsertDetails;$i++){
- $total+= $aUsertDetails[$i]['fld_commsionprice'];
- }
- echo $total;
- break;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement