0

i am working on a coupon website and i need to open popup modal on next page whenever i click on the coupon

i tried alot but nothing works iam working on laravel 6 here's the jscript code $('#newpage').click(function(){ window.location.assign('<?php echo $loc ?>'); window.open('{{route('stores', ['brand_id' => $myuser->Url_Title])}}'); here's the button code <button id= "newpage" class="btn" data-toggle="modal" data-mytitle = "<?php echo $myuser->Title?>" data-target="#showdata" data-mycode = "<?php echo $myuser->Discount_Code ?>" style="color:white;background-color: #348700;border-radius: 3px; padding: 10px 10px; width: 100%"> <?php if($myuser->Type == "Code") {?> Show Code <?php } else { ?> Get Offer <?php } ?> </button> and here's the modal code <!--POPUP MODAL --> <?php //$users = DB::table('brands')->get(); $users = DB::table('coupons') ->join('brands', 'brands.Name', '=', 'coupons.Brand') ->select('coupons.*','brands.*') ->Limit(1) ->where('coupons.Url_Title','=',$brand_id) ->first();{ ?> <div class="modal fade p-5" id="showdata" tabindex="-1" role="dialog"> <div class="modal-dialog" role="document"> <div class="modal-content"> <button style="margin-left: 90%;" type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> <div class="modal-body"> <img style="margin:20px 33%;" src="<?php echo asset("assets/brands/$users->Image")?>"></img> <h5 id="Title" style="color: black; margin-left:9%; margin-top:15px;">

16th Jan 2020, 11:45 AM
Numair Noman Siddiquie
Numair Noman Siddiquie - avatar
1 Respuesta
+ 1
Numair Noman Siddiquie as here php code is not executable at server side so please attach the error message if any is pooping up. If no errors message is coming then let me ask you about "is source code is coming on screen directly" if that so then update the php connection code where you want to popup next page. As what you have shared here is looks ok to go but without any further information about db connection and files it's quite difficult to assume so if any error message is coming then attach that here and ping me I'll take an look and try to help you.
16th Jan 2020, 12:34 PM
DishaAhuja
DishaAhuja - avatar