Advertisement
terorama

fbn / details.php

Dec 22nd, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 20.19 KB | None | 0 0
  1. <?php
  2.  
  3. if (strpos($_SERVER['SERVER_NAME'],'unisample')===false) {
  4.    
  5.      session_start();
  6.      }
  7.  
  8. require 'fb.inc.php';
  9.  
  10.  
  11.      
  12. $fb = fbManager::getInstance();
  13.  
  14. if (!isset($_GET['ajax'])) {
  15.    drawForm();
  16.    exit();
  17. }
  18. //--------------------------------------------------------
  19. switch ($_GET['req']) {
  20.    case 'fql_user':
  21.    
  22.       echo $fb->db_drawTab('select '.$_GET['reqfld'].
  23.          ' from fql_user group by '.$_GET['reqfld'], false, true);
  24.          
  25.       break;
  26.          
  27.    case 'corr_user':
  28.       drawCorrs();
  29.       break;
  30.      
  31.    case 'tblinfo':
  32.       drawtblinfo();
  33.       break;     
  34.      
  35.    case 'csvinfo':
  36.       csvdownload();
  37.       break;
  38.      
  39.    case 'cleartab':
  40.       echo $fb->db_clearTable($_GET['reqt']);
  41.       break;
  42.    
  43.    case 'droptab':
  44.       echo $fb->db_dropTable($_GET['reqt']);
  45.       break;
  46. }
  47.  
  48. //------------------------------------------------------------------
  49. //                  csv download
  50. //------------------------------------------------------------------
  51. function csvdownload() {
  52.  
  53.    global $fb;
  54.    
  55.    $fb->downloadcsv();
  56. }
  57.  
  58. //------------------------------------------------------------------
  59. //                draw all tables info
  60. //------------------------------------------------------------------
  61. function drawtblinfo() {
  62.    
  63.    global $fb;
  64.    
  65.    $alltabs = $fb->db_getQuery('select name,sql from sqlite_master where type="table" order by name');
  66.    
  67.    foreach ($alltabs as $key=>$el) {
  68.    
  69.      
  70.       $ss = strstr($el['sql'],'(');
  71.       $zpos = strrpos($ss,')');
  72.       $ss = substr_replace($ss,'',$zpos);
  73.      
  74.       $alltabs[$key]['flds']= explode(',',$ss);
  75.    }
  76.    
  77.    $tabcontent = array();
  78.    
  79.    for ($i=0; $i<count($alltabs); $i++) {
  80.       $tabb = $alltabs[$i]['name'];
  81.      
  82.       $tabcontent[] = $fb->db_drawTab("select * from $tabb", false, true);
  83.    }
  84.    
  85.  
  86. ?>
  87.  
  88. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  89. <html xmlns:fb="http://ogp.me/ns/fb#">
  90. <head>
  91. <title>sqlite information page</title>
  92. <meta http-equiv="content-type" content="text/html;charset=utf8" />
  93. <meta name="description" content="detail page for fb statistics" />
  94. <meta name="keywords" content="facebook,api" />
  95. <script type="text/javascript" src="jquery.min.js"></script>
  96.  
  97. <style type="text/css">
  98.    * {
  99.       margin:0;
  100.       padding:0;
  101.       border:none;
  102.       outline:none;
  103.    }
  104.    
  105.    body {
  106.       font-size: 100%;
  107.       font-family:verdana, arial, sans-serif;
  108.    }
  109.    
  110.    ul {
  111.       list-style-type:none;
  112.    }
  113.    
  114.    
  115.    #container {
  116.       width:1200px;
  117.       margin:0 auto;
  118.    }  
  119.    
  120.    #header {
  121.       height:100px;
  122.       color:white;
  123.       background-color:#600;
  124.       margin-bottom:30px;
  125.       padding:30px 0 0 0;
  126.      
  127.    }
  128.    
  129.    #header h1 {
  130.       font-size: 1.5em;
  131.       line-height:1;
  132.  
  133.       width:40%;
  134.       margin-left:auto;
  135.       margin-right:auto;
  136.      
  137.    }
  138.    
  139.    #leftcol {
  140.       float:left;
  141.       width: 300px;
  142.       margin-right:50px;
  143.  
  144.    }
  145.    
  146.    #rightcol {
  147.       float:left;
  148.       width:650px;
  149.    }
  150.    
  151.    .hiddiv {
  152.       display: none;
  153.    }
  154.    
  155.    #flydiv {
  156.       position:absolute;
  157.       width:300px;
  158.       height:500px;
  159.       padding:10px 0 0 5px;
  160.       border:solid 1px #999;
  161.       background-color:#eee;
  162.       overflow:hidden;
  163.       display:none;
  164.      
  165.       font-size:0.75em;
  166.       font-family: courier new, monospace;
  167.       white-space: nowrap;
  168.      
  169.    }
  170.    
  171.    .inftab {
  172.       font-family: courier new, monospace;
  173.       font-size: 0.75em;
  174.       border-collapse:collapse;
  175.       border: solid 1px #777;
  176.    }
  177.    
  178.    .inftab tr:first-child td {
  179.       font-weight:bold;
  180.    }
  181.    
  182.    .inftab td {
  183.       padding: 3px 5px;
  184.       border: solid 1px;
  185.      
  186.    }
  187.    
  188.    #conmenu {
  189.       position:absolute;
  190.       width:250px;
  191.       height:50px;
  192.       border:solid 1px #999;
  193.       background-color:#ffe;
  194.       padding:4px 20px;
  195.       line-height:1.5;
  196.       cursor:pointer;
  197.      
  198.       display:none;
  199.    }
  200. </style>
  201.  
  202. <script type="text/javascript">
  203.  
  204.  
  205. //-------------------------------------------
  206. function clearTab(tabb) {
  207.  
  208.    ajax_request({'ajax':'','req':'cleartab','reqt':tabb});
  209. }
  210. //-------------------------------------------
  211. function dropTab(tabb) {
  212.  
  213.   ajax_request({'ajax':'','req':'droptab','reqt':tabb});
  214. }
  215.  
  216. //-------------------------------------------
  217. function onGetSuccess(data,status,xhr) {
  218.    $('#rightcol').html(data);
  219. }
  220. //-------------------------------------------
  221. function ajax_request (params) {
  222.    
  223.    $.get("<?php echo $_SERVER["PHP_SELF"]; ?>",
  224.       params, onGetSuccess);
  225.      
  226. }
  227.  
  228.  
  229. //-------------------------------------------
  230.  
  231. function init() {
  232.  
  233.  
  234.    $('#conmenu').mouseout( function(ev) {
  235.    
  236.       mell = $(this);
  237.      
  238.       var target = ev.target || ev.srcElement;
  239.       if (target!==this)
  240.          return;
  241.      
  242.      
  243.       var ztm = setTimeout( function() {
  244.          
  245.             mell.stop(true,true).fadeOut('fast');
  246.            
  247.          }, 200);
  248.          
  249.       $(this).data('zhide', ztm);
  250.      
  251.    });
  252.    
  253.    $('#conmenu li').hover (
  254.       function (ev) {
  255.          $(this).css('font-weight','bold');
  256.       },
  257.       function (ev) {
  258.          $(this).css('font-weight','normal');
  259.       });
  260.    
  261.    $('#conmenu li:first').click (
  262.       function(ev) {
  263.      
  264.          var tabb = $('#conmenu').data('tabb');
  265.          if (confirm('clear '+tabb+ '?'))
  266.             clearTab(tabb);
  267.       })
  268.      
  269.    $('#conmenu li:eq(1)').click (
  270.    
  271.       function(ev) {
  272.          var tabb = $('#conmenu').data('tabb');
  273.          
  274.          if (confirm('drop '+tabb+' ?'))
  275.             dropTab(tabb);
  276.       }  
  277.    );
  278.    
  279.    
  280.    //-------------------------------------
  281.    var tbrs = $('#maintab>tbody>tr');
  282.    
  283.    
  284.    tbrs.each(
  285.       function (i) {
  286.          $(this).children('td:first')
  287.          
  288.             .find ('div.hiddiv:last table:first').attr('class','inftab').end()
  289.            
  290.             .css('cursor','pointer')
  291.            
  292.             //------------------------------
  293.             .click( function() {
  294.            
  295.             $('#rightcol').html($(this).find('div.hiddiv:last').html());
  296.          })
  297.          //------------------------------
  298.          .hover (
  299.             function(ev) {
  300.                if ($('#flydiv').data('ztime'))
  301.                   clearTimeout($('#flydiv').data('ztime'));
  302.                
  303.                $(this).css('font-weight','bold');
  304.                $('#flydiv').html($(this).find('div.hiddiv:eq(0)').html())
  305.                
  306.                
  307.                .css('left', ev.clientX+300)
  308.                .css('top', ev.clientY+ (
  309.                  (document.documentElement && document.documentElement.scrollTop) ||
  310.                  (document.body && document.body.scrollTop) || 0)-200)
  311.                .stop(true, true).fadeIn('fast')
  312.                
  313.             },
  314.            
  315.             function(ev) {
  316.            
  317.                $('#flydiv').data('ztime',
  318.                   setTimeout( function() {
  319.                      $('#flydiv').stop(true, true).fadeOut('fast');
  320.                   },200));
  321.                
  322.                $(this).css('font-weight','normal');
  323.             })
  324.             //------------------------------
  325.             .on('contextmenu', function(ev) {
  326.            
  327.                ev = ev || event;
  328.                
  329.                var mdiv = $('#conmenu');
  330.                mdiv.data('tabb', $(this).text().slice(0, $(this).text().indexOf('(')).trim());
  331.                
  332.                var ztm = mdiv.data('zhide');
  333.                if (ztm)
  334.                   clearTimeout(ztm);
  335.                
  336.                mdiv.css('left', ev.clientX -30 )
  337.                   .css('top', ev.clientY +
  338.                      ( (document.documentElement && document.documentElement.scrollTop) ||
  339.                        (document.body && document.body.scrollTop) || 0) -30)
  340.                        
  341.                 .stop(true,true).fadeIn('fast');
  342.                
  343.                 try {
  344.                    ev.preventDefault();
  345.                 } catch(e) {
  346.                    ev.returnValue = false;
  347.                 }
  348.                
  349.                
  350.             }
  351.            
  352.             );
  353.       }
  354.    )
  355.    
  356. }
  357.  
  358.  
  359. //----------------------------------
  360.    $(document).ready (
  361.        function() {
  362.           init();
  363.        }
  364.    )
  365.  
  366. </script>
  367.  
  368. </head>
  369.  
  370. <body>
  371.  
  372. <div id="flydiv"></div>
  373.  
  374. <div id="conmenu">
  375. <ul>
  376.    <li>clear table</li>
  377.    <li>drop table</li>
  378. </ul>
  379. </div>
  380.  
  381. <div id="container">
  382. <div id="header">
  383. <h1>sqlite information</h1>
  384. </div>
  385.  
  386. <div id="leftcol">
  387. <table id="maintab">
  388. <tr><th>name</th>
  389. <?php
  390.  
  391. for ($i=0; $i<count($alltabs); $i++) {
  392.  
  393.    $el = $alltabs[$i];
  394.  
  395.    echo '<tr><td>'.$el['name'].
  396.    '<div class="hiddiv"><ul>';
  397.    
  398.    foreach ($el['flds'] as $fld) {
  399.       echo '<li>'.$fld.'</li>';
  400.    }  
  401.    echo '</ul></div>';  
  402.    
  403.    echo "<div class=\"hiddiv\">{$tabcontent[$i]}</div>";
  404.  
  405.    echo '</td></tr>';
  406. }
  407.  
  408. ?>
  409. </table></div>
  410.  
  411. <div id="rightcol">
  412.  
  413. </div>
  414. </div>
  415.  
  416. </body>
  417. </html>
  418.  
  419.  
  420. <?php      
  421.    
  422. }
  423.  
  424.  
  425.  
  426. //------------------------------------------------------------------
  427. //      draw correlated users diagram
  428. //------------------------------------------------------------------
  429. function drawCorrs() {
  430.  
  431.    global $fb;
  432.    
  433.    $inf = $fb->drawRelatedUsers($_GET['uid'],true);
  434.    if (!is_array($inf)) {
  435.       echo 'error: '.$inf;
  436.       exit();
  437.    }
  438.    
  439.    //-------------------------------------------------------
  440.    ?>
  441.    
  442.    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  443. <html xmlns:fb="http://ogp.me/ns/fb#">
  444. <head>
  445. <title>Details page</title>
  446. <meta http-equiv="content-type" content="text/html;charset=utf8" />
  447. <meta name="description" content="detail page for fb statistics" />
  448. <meta name="keywords" content="facebook,api" />
  449. <script type="text/javascript" src="jquery.min.js"></script>
  450.  
  451. <style type="text/css">
  452.  
  453.    body {
  454.       background:black;
  455.    }
  456.    
  457.    a, img {
  458.       text-decoration:none;
  459.       outline:none;
  460.       border:none;
  461.    }
  462.    .brick {
  463.       position:absolute;
  464.    }
  465.  
  466.    .roundb {
  467.       border-radius:50%;
  468.       -webkit-border-radius:50%;
  469.       -moz-border-radius:50%;
  470.      
  471.       padding:10px;
  472.    }
  473. </style>
  474.  
  475. <script type="text/javascript">
  476.  
  477.    $(document).ready(
  478.       function() {
  479.      
  480.          var b= $(document.body);
  481.          for (var i=0; i<40; i++) {
  482.             b.append($('<div/>',{'class':'roundb',}).css(
  483.                'background-color', 'rgb('+i*5+','+i*4+','+i*3+')'));
  484.                
  485.             b= b.children('.roundb').first();
  486.          }
  487.          
  488.          var els = $('.brick');
  489.          
  490.          var r=100;
  491.          var psy=0;
  492.          var psy_step=0.5;
  493.          
  494.          for (var i=0; i<els.length; i++) {
  495.             r+=2;
  496.             psy_step-=0.002;
  497.             psy+=psy_step;
  498.            
  499.             var x= Math.floor(r*Math.cos(psy)+window.innerWidth/2);
  500.             var y= Math.floor(r*Math.sin(psy)+window.innerHeight/2);
  501.            
  502.             els.eq(i).css('left',x).css('top',y).css('z-index',els.length-i);
  503.          }
  504.          
  505.       }
  506.    )
  507. </script>
  508.  
  509. </head>
  510. <body>
  511.  
  512.    
  513.    
  514.    <?php
  515.    //-------------------------------------------------------
  516.    
  517.    function wsort($a, $b) {
  518.       return ($a['weight']<$b['weight']) ? 1 : -1;
  519.    }
  520.  
  521.    foreach ($inf as &$el) {
  522.      
  523.      
  524.       $el['weight']=$el['lk_count']*1000 +
  525.          (($el['usersex']=='female') ? 1 : 0)*100+
  526.          (($el['userlocale']=='ru_RU') ? 1 : 0)*10;
  527.  
  528.    }
  529.    
  530.     usort ($inf, 'wsort');
  531.    
  532.     $nels=0;
  533.     foreach ($inf as $el) {
  534.      
  535.       $nels++;
  536.       if ($nels>400)
  537.          break;
  538.          
  539.       if ($el['userid']==$_GET['uid'])
  540.          continue;
  541.  
  542.       echo "<div class=\"brick\" rel=\"{$el["weight"]}\">".
  543.                 "<a href=\"{$el["userurl"]}\" target=\"_blank\">".
  544.                 "<img src=\"{$el["userpic"]}\" alt=\"{$el["username"]}\" /></a></div>";  
  545.      
  546.    }
  547.    
  548.  
  549.   ?>
  550.  
  551.   </body></html>
  552.  
  553.   <?php
  554.    
  555. }
  556. //------------------------------------------------------------------
  557. function drawForm() {
  558.  
  559. global $fb;
  560. $inf = $fb->getUserInfo();
  561. $flds = $fb->db_getTableFields('fql_user');
  562.  
  563. if (is_array($inf))
  564.    extract($inf[0]);
  565. else
  566.    $err3=$inf;
  567.  
  568.  
  569.  
  570. ?>
  571.  
  572. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  573. <html xmlns:fb="http://ogp.me/ns/fb#">
  574. <head>
  575. <title>Details page</title>
  576. <meta http-equiv="content-type" content="text/html;charset=utf8" />
  577. <meta name="description" content="detail page for fb statistics" />
  578. <meta name="keywords" content="facebook,api" />
  579. <script type="text/javascript" src="jquery.min.js"></script>
  580.  
  581. <style type="text/css">
  582.  
  583.    * {
  584.       margin:0;
  585.       padding:0;
  586.    }
  587.  
  588.    body {
  589.    
  590.       font-family:helvetica,verdana,sans-serif;
  591.       font-size:14px;
  592.       margin:10px 0 0 30px;
  593.    }
  594.    
  595.    h1 {
  596.       font-size:1.5em;
  597.       margin: 0 0 20px 0;
  598.    }
  599.    
  600.    a, a:visited {
  601.       color: #800;
  602.       text-decoration:none;
  603.    }
  604.    
  605.    a:hover, a:active {
  606.       text-decoration:underline;
  607.    }
  608.    
  609.    ul {
  610.       list-style-type:none;
  611.    }
  612.    
  613.    #userinfo {
  614.       max-width:200px;
  615.       border:solid 1px #888;
  616.       padding:10px 10px 20px 10px;
  617.       overflow:auto;
  618.       margin-bottom:10px;
  619.    }
  620.    
  621.    #userinfo img {
  622.       display:block;
  623.       float:left;
  624.       padding-right:15px;
  625.    }
  626.    
  627.    #userinfo a {
  628.       line-height:1.5em;
  629.    }
  630.    
  631.    .errormes {
  632.       border:solid 3px #900;
  633.       background:#ff8f8;
  634.       color: #900;
  635.       padding:10px;
  636.       max-width:300px;
  637.       margin-bottom:10px;
  638.    }
  639.    
  640.    #utfields {
  641.       border:solid 1px #888;
  642.       background:#eee;
  643.       padding:10px 20px 10px 30px;
  644.       float: left;
  645.       width:50%;
  646.       margin-right:200px;
  647.      
  648.      
  649.    }
  650.    
  651.    .button {
  652.       /*position:absolute;*/
  653.       font-size:0.85em;
  654.       border: solid 2px #800;
  655.       margin-bottom:5px;
  656.       margin-right:5px;
  657.       width:140px;
  658.       float:left;
  659.       overflow:hidden;
  660.       padding:6px 10px;
  661.       background:#f8f8f8;
  662.       cursor:pointer;
  663.      
  664.    }
  665.    
  666.    .button:last-child {
  667.       margin-bottom:0;
  668.    }
  669.    
  670.    #selectedfields {
  671.       position:relative;
  672.       float: left;
  673.       min-height:400px;
  674.       width:30%;
  675.       border:solid 1px #888;
  676.      
  677.    }
  678.    
  679.    #selectedfields:after {
  680.       content: "drag fields here";
  681.       position:absolute;
  682.       left:50%;
  683.       top:40%;
  684.       margin-left:-3.5em;
  685.       color:#ccc;
  686.       font-size:4em;
  687.       width:600px;
  688.      
  689.    }
  690.    
  691.    #ftgbutton {
  692.       padding: 5px 20px;
  693.       border:solid 1px #666;
  694.       background:#eee;
  695.       cursor:pointer;
  696.       border-radius:5px;
  697.       -moz-border-radius:5px;
  698.       -webkit-border-radius:5px;
  699.      
  700.       float:left;
  701.       margin-top:5px;
  702.    }
  703.    
  704.    #ftgbutton:hover {
  705.       background:#666;
  706.       color:white;
  707.    }
  708.    
  709.    #ajaxresult {
  710.       clear:both;
  711.       border:solid 1px #ccc;
  712.    }
  713.    
  714.    ul.accinfo {
  715.       overflow:auto;
  716.       border:solid 1px #ccc;
  717.       padding:5px 10px;
  718.       margin-bottom:10px;
  719.       width:50%;
  720.    }
  721.    
  722.    ul.accinfo li {
  723.       float:left;
  724.       margin-right:10px;
  725.    }
  726.    
  727.    ul.accinfo li img {
  728.       float:left;
  729.       margin-right:10px;
  730.    }
  731.    
  732.    
  733. </style>
  734.  
  735. <script type="text/javascript">
  736.  
  737.    $(document).ready(init);
  738.    
  739.    var Helper = {
  740.       //---------------------------
  741.       scroX : function() {
  742.      
  743.          return (document.documentElement && document.documentElement.scrollLeft ||
  744.             document.body && document.body.scrollLeft || 0);
  745.       },
  746.       //---------------------------
  747.       scroY : function() {
  748.      
  749.          return (document.documentElement && document.documentElement.scrollTop ||
  750.             document.body && document.body.scrollTop || 0);
  751.       },
  752.       //---------------------------
  753.       mouseX : function(ev) {
  754.      
  755.          return ev.clientX + this.scroX();
  756.       },
  757.       //---------------------------
  758.       mouseY : function(ev) {
  759.          
  760.          return ev.clientY + this.scroY();
  761.       },
  762.       //---------------------------
  763.       elX : function(el) {
  764.      
  765.          var zrect = el.getBoundingClientRect();
  766.          return zrect.left + this.scroX();       
  767.       },
  768.       //---------------------------
  769.       elY : function(el) {
  770.      
  771.          var zrect = el.getBoundingClientRect();
  772.          return zrect.top + this.scroY();        
  773.       }
  774.       //---------------------------
  775.    }
  776.    
  777.    //-----------------------------------------------
  778.    function Ddrop(hlp) {
  779.    
  780.       var _self = this;
  781.       this._helper = hlp;
  782.    
  783.       this.hook = function(el) {
  784.      
  785.          for (var i=0; i<el.length; i++) {
  786.             var el4 = el.get(i);
  787.             el4.onmousedown = this.mouseDown;
  788.             el4.onmouseup = this.mouseUp;
  789.             el4.onmousemove = this.mouseMove;
  790.             el4.onmouseout = this.mouseOut;
  791.          }
  792.          
  793.       }
  794.       //-----------------------------------------------
  795.       this.mouseDown = function(ev) {
  796.          //alert('test');
  797.          var ev = ev || event;
  798.          var target = this;
  799.          
  800.          target.pressed=true;
  801.          
  802.          var mouseX = _self._helper.mouseX(ev);        
  803.          var mouseY = _self._helper.mouseY(ev);
  804.                      
  805.          var elX = _self._helper.elX(target);
  806.          var elY = _self._helper.elY(target);
  807.          
  808.          target.diffX = mouseX - elX;
  809.          target.diffY = mouseY - elY;
  810.            
  811.            
  812.          target.style.left=elX+'px';
  813.          target.style.top=elY+'px';
  814.          $(target).css('z-index','1000');
  815.          target.style.position='absolute';
  816.          
  817.          try {
  818.             ev.preventDefault();
  819.          } catch(ex) {
  820.             ev.returnValue=false;
  821.          }
  822.       }
  823.       //-----------------------------------------------
  824.       this.mouseUp = function(ev) {
  825.      
  826.          var ev = ev || event;
  827.          var target = this;
  828.          
  829.          var aim =$('#selectedfields').get(0);
  830.          
  831.          var elX = _self._helper.elX(target);
  832.          var elY = _self._helper.elY(target);
  833.          
  834.          var aimX = _self._helper.elX(aim);
  835.          var aimY = _self._helper.elY(aim);
  836.          
  837.          var aimX3 = aimX + aim.offsetWidth;
  838.          var aimY3 = aimY + aim.offsetHeight;
  839.          
  840.          if  ((elX+target.offsetWidth>aimX) && (elX<aimX3) &&
  841.             (elY>aimY) && (elY<aimY3)) {
  842.          
  843.             aim.appendChild(target);
  844.          }
  845.  
  846.          
  847.          target.pressed=false;
  848.          target.style.position='';
  849.          $(target).css('z-index','10');
  850.          
  851.          
  852.       }
  853.       //-----------------------------------------------
  854.       this.mouseMove = function(ev) {
  855.          
  856.          var ev = ev || event;
  857.          var target = this;
  858.          //alert(target);
  859.          
  860.          if (target.pressed) {
  861.             target.style.left = _self._helper.mouseX(ev)-target.diffX+'px';
  862.             target.style.top = _self._helper.mouseY(ev)-target.diffY+'px';
  863.          }
  864.       }
  865.       //-----------------------------------------------
  866.       this.mouseOut = function(ev) {
  867.          
  868.          //_self.mouseUp(ev);
  869.          
  870.          var ev = ev || event;
  871.          var target = this;
  872.          
  873.          
  874.          target.pressed=false;
  875.          target.style.position='';
  876.          $(target).css('z-index','');
  877.       }
  878.       //-----------------------------------------------
  879.    
  880.    }
  881.    //-----------------------------------------
  882.    //                  init
  883.    //-----------------------------------------
  884.    function init() {
  885.       ddrop = new Ddrop(Helper);
  886.      
  887.       ddrop.hook($('#utfields .button'));
  888.       //------------------------------------
  889.       $('#ftgbutton').click ( function() {
  890.          
  891.          var fldels = $('#selectedfields .button');
  892.          var flds ='';
  893.          for (var i=0; i<fldels.length; i++) {
  894.             if (flds!='')
  895.                flds+=',';
  896.                
  897.             flds+=fldels[i].innerHTML;
  898.          }
  899.          
  900.          if (flds=='') return;
  901.          
  902.          $.ajax ( {
  903.             type : 'GET',
  904.             url : "<?php echo $_SERVER["PHP_SELF"] ?>",
  905.            
  906.             data : {
  907.                ajax:'',
  908.                req:'fql_user',
  909.                reqfld: flds
  910.             },
  911.            
  912.             success: onSuccess,
  913.             error: onError
  914.          
  915.          });
  916.      
  917.       });
  918.      
  919.       //------------------------------------
  920.       $('#ajaxresult').ajaxStart( function() {
  921.          $(this).html('Request started. Please wait...');
  922.       })
  923.      
  924.    }
  925.    //-----------------------------------------
  926.    
  927.    function onSuccess(inf, status, xhr) {
  928.       $('#ajaxresult').html(inf);
  929.    }
  930.     //-----------------------------------------
  931.    function onError(xhr, status, exception) {
  932.       $('#ajaxresult').html('Exception: '+exception);
  933.    }
  934.    //-----------------------------------------
  935.  
  936. </script>
  937.  
  938. </head>
  939. <body>
  940. <h1>fb tests detail page</h1>
  941. <?php if (!isset($err3)): ?>
  942. <div id="userinfo">
  943.    <a href="<?php echo $fb_profile_url ?>" target="_blank">
  944.       <img src="<?php echo $fb_pic_square ?>" />
  945.       Logged in user <?php echo $fb_name ?>
  946.       </a>
  947. </div>
  948. <?php else: ?>
  949.    <div class="errormes">
  950.       <?php echo $err3 ?>
  951.    </div>
  952. <?php endif;?>
  953.  
  954. <h3>Information gathered</h3>
  955.    <ul class="accinfo">
  956.    <?php
  957.    
  958.    $inf = $fb->getAcceptors();
  959.    
  960.    foreach ($inf as $el) {
  961.      echo '<li><a href="'.$_SERVER["PHP_SELF"].'?ajax&req=corr_user&uid='.$el['user_id'].
  962.      '" ><img src="'
  963.         .$el['userpic'].'" />'.$el['user_name'].'</a></li>';
  964.    }
  965.    
  966.    ?>
  967.    </ul>
  968.    
  969. <a href="<?php echo $_SERVER["PHP_SELF"].'?ajax&req=tblinfo'; ?>" target="_blank">
  970. retrieve all sqlite info
  971. </a><br/>
  972.  
  973. <h3>
  974. <a href="<?php echo $_SERVER["PHP_SELF"].'?ajax&req=csvinfo'; ?>" target="_blank">
  975. download csv
  976. </a></h3>
  977.  
  978. <div id="fldwrapper">
  979. <div id="utfields">
  980.    <?php
  981.       for ($i=0; $i<count($flds); $i++) {
  982.          echo "<div class=\"button\" >{$flds[$i]}</div>";
  983.       }
  984.    ?>
  985. </div>
  986.  
  987. <div id="selectedfields">
  988. </div>
  989. <div id="ftgbutton">show info</div>
  990. </div>
  991.  
  992. <div id="ajaxresult">
  993. </div>
  994.  
  995.  
  996.  
  997.  
  998. </body>
  999. </html>
  1000.  
  1001. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement