Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <pre id="love" type="submit" data-toggle="modal" data-target="#myModal" onclick="mymodal(''+this["id"]+'')">'+this["love"]+' students <i class="glyphicon glyphicon-heart fa-lg" style="color:red"></i></pre >
- var list='';
- function mymodal(id){
- $.post('postname_.php',{post_id:id},function(data1){
- $.each(data1.result,function(){
- list+='<div class="modal fade" id="myModal" role="dialog">'+'<div class="modal-dialog">'+'<div class="modal-content">'+
- '<div class="modal-header">'+'<button type="button" class="close" data-dismiss="modal">×</button>'+
- '<h4 class="modal-title">Students who loved your post</h4>'+' </div>'+'<div class="modal-body">';
- list+='<h4 class="text-danger">'+this["finame"]+' '+this['sename']+'</h4>';
- list+='</div>'+'<div class="modal-footer">'+
- '<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>'+'</div>'+
- '</div>'+'</div>'+'</div>';
- $('#insert').append(list);}),'json'
- });
- }
- <?php
- require("../vendor/library50-php-5/CS50/CS50.php");
- CS50::init(__DIR__ . "/../config.json");
- $result=array();
- $frows3=CS50::query("SELECT * FROM userhit WHERE plove=? AND bypost=?",1,$_POST['post_id']);
- foreach($frows3 as $frow3){
- $frow4=CS50::query("SELECT * FROM userinfopersonal WHERE user_id=? ",$frow3['user_id']);
- $frow5=CS50::query("SELECT * FROM userprof WHERE user_id=? ",$frow3['user_id']);
- array_push($result,array('finame'=>$frow4[0]['firstname'],'sename'=>$frow4[0]['secondname'],'url1'=>$frow5[0]['url']));
- }echo json_encode(array('result'=> $result)); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement