SEOClerks

Fix javascript user id not being sent

Fix javascript user id not being sent

I need someone who is good with javascript and Laravel to fix a gift plugin it does not send the userid on submission

This is the data that is being submitted

data={to_user: $('#userid_gift').val(),gift_id:gift_id,msg:msg};

this is from the console view

to_user=&gift_id=11&msg=

the gift id is there but the to_user is empty so it fails


Requirements

This is the Javascript code that is used in the forms

<script type="text/javascript">
if( @if(request()->is('profile/*')) true @else false @endif ){
$('#gift-modal').show();
}
$('.giftimage').on('click',function(){
$('.giftimage').removeClass('activegift');
$(this).addClass('activegift');
})
$('#send_gift').on('click',function(){
var gift = $(this).parent().parent().find('.giftimage.activegift');
var gift_price =gift.data('price');
var gift_id =gift.data('giftid');
var msg='';
data={to_user: $('#userid_gift').val(),gift_id:gift_id,msg:msg};
$.ajax({
type: "POST",
url: "{{{ url('/send_gift') }}}",
data: data,
success: function(data){

toastr.success(data.message);

window.location.reload();

},
error: function(XMLHttpRequest, textStatus, errorThrown) {
toastr.error("{{{trans_choice('app.error',1)}}}");
}
});
})
</script>

This is on a seperate php file

<script>
$('#giftmodal').on('click',function(){

$('#userid_gift').val('<?php echo e($user_id); ?>');

$('#userid_gift').val('{{{$user_id}}}');

$('.gift_header').text("{{{trans('app.send_gift')}}}");
})
</script>

I need the to_user to get populated with the correct info i.e.

to_user=523&gift_id=11&msg=

523 being the user the gift is getting sent too


Skills Required

Php Js Javascript Laravel

Bids

**** quitely easy job ****

i can fix it with in 2 hours,
please ping me

i can do this easily.

Bid On Listing Created 9 years ago in Programming

Other jobs by mikeboy

Order Now
Process Time: 0.20273184776306

Possible Duplicate queries found!
MatchCountSQLScript
SELECT * FROM wanttobuy A, categories_wanttobuy B, seoclerks.members C WHERE A.wantid='53928' AND A.category=B.CATID AND A.USERID=C.USERID1SELECT A.*, B.name, B.seo, C.username, C.userlevel, C.footer_code, C.rating, C.ratingcount, C.googleplus_profile, C.total_recommendations, C.USERID, C.profilepicture, C.average_response_time, C.lastlogin, C.addtime FROM wanttobuy A, categories_wanttobuy B, seoclerks.members C WHERE A.wantid='53928' AND A.category=B.CATID AND A.USERID=C.USERID

/opt/clerks-staging/docroot/viewwant.php 163 () ()

SELECT * FROM seoclerks.members_recommendations WHERE USERID=27760 AND status=1 ORDER BY MRID DESC limit 11SELECT recommendation_text, FROMID, time_added FROM seoclerks.members_recommendations WHERE USERID=27760 AND status=1 ORDER BY MRID DESC limit 1

/opt/clerks-staging/docroot/include/functions/main.php 21955 getLastRecommendation() ()

SELECT * FROM seoclerks.members WHERE USERID='166828'1SELECT username FROM seoclerks.members WHERE USERID='166828'

/opt/clerks-staging/docroot/include/functions/main.php 1577 insert_get_username_from_userid() ()

SELECT * FROM ratings_buyer WHERE USERID=277601SELECT sum(good) as thumbup, sum(bad) as thumbdown FROM ratings_buyer WHERE USERID=27760

/opt/clerks-staging/docroot/include/functions/main.php 19523 GetRatingsAsBuyerTotal() ()

SELECT * FROM wanttobuy A, categories_wanttobuy B WHERE A.wantid != 53928 AND A.category=B.CATID AND A.active=1 AND (A.tags like '%Php Js Javascript Laravel%' ) LIMIT 41SELECT A.wantid, A.title, A.p1, A.maxprice, B.name, B.seo FROM wanttobuy A, categories_wanttobuy B WHERE A.wantid != 53928 AND A.category=B.CATID AND A.active=1 AND (A.tags like '%Php Js Javascript Laravel%' ) LIMIT 4

/opt/clerks-staging/docroot/viewwant.php 551 () ()

SELECT * FROM wanttobuy A, categories_wanttobuy B WHERE A.wantid != 53928 AND A.category=B.CATID AND A.active=1 AND A.USERID=27760 LIMIT 41SELECT A.wantid, A.title, A.p1, A.maxprice, B.name, B.seo FROM wanttobuy A, categories_wanttobuy B WHERE A.wantid != 53928 AND A.category=B.CATID AND A.active=1 AND A.USERID=27760 LIMIT 4

/opt/clerks-staging/docroot/viewwant.php 568 () ()

SELECT * FROM wantcomments a, seoclerks.members b WHERE a.PID='53928' AND a.USERID=b.USERID and b.status='1' AND a.status=1 order by a.CID asc1SELECT a.comment, a.USERID, a.CID, a.time_added, a.istranslated, a.parentid, b.username, b.profilepicture FROM wantcomments a, seoclerks.members b WHERE a.PID='53928' AND a.USERID=b.USERID and b.status='1' AND a.status=1 order by a.CID asc

/opt/clerks-staging/docroot/viewwant.php 835 () ()

UPDATE wanttobuy SET viewcount = viewcount + 1 WHERE wantid='53928'1UPDATE wanttobuy SET viewcount = viewcount + 1 WHERE wantid='53928'

/opt/clerks-staging/docroot/include/functions/main.php 1729 update_wantviewcount() ()

SELECT * FROM wantbids as w, seoclerks.members AS m WHERE w.active=1 AND m.USERID=w.USERID AND m.status=1 AND w.USERID>0 AND w.wantid='53928' ORDER BY w.bidid ASC 1SELECT w.bidid, w.PID, w.comment, w.title, w.pricepublic, w.USERID, w.adjustedprice, w.ip, m.profilepicture FROM wantbids as w, seoclerks.members AS m WHERE w.active=1 AND m.USERID=w.USERID AND m.status=1 AND w.USERID>0 AND w.wantid='53928' ORDER BY w.bidid ASC

/opt/clerks-staging/docroot/viewwant.php 1192 () ()

SELECT * FROM seoclerks.members as m WHERE m.USERID=6086151SELECT m.username, m.skills, m.userlevel, m.ip, m.total_recommendations FROM seoclerks.members as m WHERE m.USERID=608615

/opt/clerks-staging/docroot/viewwant.php 1258 () ()

SELECT * FROM seoclerks.members as m WHERE m.USERID=5474561SELECT m.username, m.skills, m.userlevel, m.ip, m.total_recommendations FROM seoclerks.members as m WHERE m.USERID=547456

/opt/clerks-staging/docroot/viewwant.php 1258 () ()

SELECT * FROM seoclerks.members as m WHERE m.USERID=188391SELECT m.username, m.skills, m.userlevel, m.ip, m.total_recommendations FROM seoclerks.members as m WHERE m.USERID=18839

/opt/clerks-staging/docroot/viewwant.php 1258 () ()

SELECT * FROM categories_wanttobuy1SELECT * FROM categories_wanttobuy

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() parseRedundantQueriesCache()

SELECT * FROM posts WHERE USERID=277601SELECT sum(positive_ratings) as thumbup, sum(negative_ratings) as thumbdown FROM posts WHERE USERID=27760

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() GetBuyerRatingsTotal()

SELECT * FROM categories1SELECT * FROM categories

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() parseRedundantQueriesCache()

select * from categories_software order by name asc1select * from categories_software order by name asc

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() insert_GetSoftwareCategories()

select * from categories_wanttobuy order by name asc1select * from categories_wanttobuy order by name asc

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() insert_get_wantcategories()

select * from categories_wanttotrade order by name asc1select * from categories_wanttotrade order by name asc

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() insert_get_tradecategories()

SELECT * FROM seoclerks.members WHERE USERID='608615'1SELECT profilepicture FROM seoclerks.members WHERE USERID='608615'

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() getUserProfileImage()

SELECT * FROM seoclerks.members WHERE USERID='547456'1SELECT profilepicture FROM seoclerks.members WHERE USERID='547456'

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() getUserProfileImage()

SELECT * FROM seoclerks.members WHERE USERID='18839'1SELECT profilepicture FROM seoclerks.members WHERE USERID='18839'

/opt/clerks-staging/docroot/libraries/adodb5/adodb.inc.php 1899 CacheExecute() getUserProfileImage()

SELECT * FROM seoclerks.members WHERE USERID='27760'1SELECT profile_data FROM seoclerks.members WHERE USERID='27760'

/opt/clerks-staging/docroot/include/functions/main.php 1927 getUserBackground() include()

Invalid SQL

count(*)sql1error_msg

Expensive SQL

Tuning the following SQL could reduce the server load substantially
LoadCountSQLMaxMin

Suspicious SQL

The following SQL have high average execution times
Avg TimeCountSQLMaxMin
1.4058741SELECT count(A.PID) as total from posts A , seoclerks.members C WHERE A.active=1 AND A.USERID=C.USERID AND A.sold_out=0 AND A.USERID=C.USERID AND category IN (23,48,53,103) AND gtags like'%Drops%' AND type !=99 1.4058741.405874
0.7630901SELECT count(A.PID) as total from posts A , seoclerks.members C WHERE A.active=1 AND A.USERID=C.USERID AND A.sold_out=0 AND A.USERID=C.USERID AND category IN (17,18,22,30,33,47,49,50,72,84) AND gtags like'%Googletop10%' AND type !=99 0.7630900.763090
0.7223721SELECT count(A.PID) as total from posts A , seoclerks.members C WHERE A.active=1 AND A.USERID=C.USERID AND A.sold_out=0 AND A.USERID=C.USERID AND category IN (17,18,22,30,33,47,49,50,72,84) AND gtags like'%Allinone%' AND type !=99 0.7223720.722372
0.1251771SELECT A.wantid, A.title, A.p1, A.maxprice, B.name, B.seo FROM wanttobuy A, categories_wanttobuy B WHERE A.wantid != 53928 AND A.category=B.CATID AND A.active=1 AND (A.tags like '%Php Js Javascript Laravel%' ) LIMIT 40.1251770.125177