Guest User

Untitled

a guest
Feb 12th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. $.ajax
  2. ({
  3. type: "POST",
  4. url: "plugins/system/ratingx/conf.php",
  5. data: dataString,
  6. cache: false,
  7. success: function(html)
  8. {
  9.  
  10. <?php
  11. define( '_JEXEC', 1) or die;
  12. defined( '_JEXEC' ) or die;
  13.  
  14. $mysql_hostname = "localhost";
  15. $mysql_user = "px";
  16. $mysql_password = "px";
  17. $mysql_database = "jum";
  18. $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password)
  19. or die("Opps some thing went wrong");
  20. mysql_select_db($mysql_database, $bd) or die("Opps some thing went wrong");
  21.  
  22.  
  23. if($_POST['id'])
  24. {
  25. $id=mysql_real_escape_string($_POST['id']);
  26. $name=mysql_real_escape_string($_POST['name']);
  27.  
  28.  
  29. mysql_query("update messages set $name=$name+1 where id='$id'");
  30.  
  31.  
  32. $result=mysql_query("select up,down from messages where id='$id'");
  33. $row=mysql_fetch_array($result);
  34. $up_value=$row['up'];
  35. $down_value=$row['down'];
  36. $total=$up_value+$down_value;
  37.  
  38. $up_per=($up_value*100)/$total;
  39. $down_per=($down_value*100)/$total;
  40. ?>
  41. <div style="margin-bottom:10px">
  42. <b>Ratings for this blog</b> ( <?php echo $total; ?> total)
  43. </div>
  44. <table width="700px">
  45.  
  46. <tr>
  47. <td width="30px"></td>
  48. <td width="60px"><?php echo $up_value; ?></td>
  49. <td width="600px"><div id="greebar" style="width:<?php echo $up_per; ?>%"></div></td>
  50. </tr>
  51.  
  52. <tr>
  53. <td width="30px"></td>
  54. <td width="60px"><?php echo $down_value; ?></td>
  55. <td width="600px"><div id="redbar" style="width:<?php echo $down_per; ?>%"></div></td>
  56. </tr>
  57.  
  58. </table>
  59.  
  60. <?php
  61.  
  62. }
Add Comment
Please, Sign In to add comment