Advertisement
terorama

JQuery AJAX Examples

Oct 17th, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 21.85 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. //-----------------------------------------------
  5. //    exception and error handlers
  6. //-----------------------------------------------
  7. function exceptionHandler($e)  {
  8.  
  9.    echo '<div class="remark">Uncaught exception'.$e->getMessage().'</div>';
  10. }
  11. //----------------------
  12. function errorHandler($errno, $errstr, $errfile, $errline) {
  13.  
  14.    switch ($errno) {
  15.      
  16.       case E_ERROR:
  17.          echo '<div class="remark">';
  18.          echo 'Error: '.$errstr.'<br/>File: '.$errfile.'<br/>Line: '.$errline;
  19.          echo '</div>';
  20.          break;
  21.          
  22.       case E_WARNING:
  23.          echo '<div class="remark">';
  24.          echo 'Warning: '.$errstr.'<br/>File: '.$errfile.'<br/>Line: '.$errline;
  25.          echo '</div>';
  26.          break;
  27.          
  28.       case E_NOTICE:
  29.          echo '<div class="remark">';
  30.          echo 'Notice: '.$errstr.'<br/>File: '.$errfile.'<br/>Line: '.$errline;
  31.          echo '</div>';
  32.          break;  
  33.          
  34.       case 2048:
  35.          break;
  36.          
  37.       default:
  38.          echo '<div class="remark">';
  39.          echo   'Errno: '.$errno.'<br/>Error: '.$errstr.
  40.               '<br/>File: '.$errfile.'<br/>Line: '.$errline;
  41.          echo '</div>';
  42.          
  43.    }  
  44.    
  45.    
  46.    return true;
  47.    
  48. }
  49.  
  50. set_exception_handler('exceptionHandler');
  51.  
  52. $default_error_handler = set_error_handler('errorHandler');
  53.  
  54. //-----------------------------------------------
  55. require 'fb.inc.php';
  56.  
  57.  
  58.  
  59. //-----------------------------------------------
  60. //           process request
  61. //-----------------------------------------------
  62. $fb = fbManager::getInstance();
  63.  
  64.    if (!isset($_REQUEST['ajax']))
  65.       draw_form();
  66.      
  67.    else
  68.       {
  69.       switch ($_REQUEST['reqtype']) {
  70.      
  71.          case 'apigraph':
  72.             echo json_encode($fb->getNode($_REQUEST['req']));
  73.             break;
  74.            
  75.          case 'fql':
  76.             echo json_encode($fb->get_fql($_REQUEST['req']));
  77.             break;
  78.            
  79.          case 'getfqls':
  80.             echo json_encode(getFqls());
  81.             break;
  82.            
  83.          case 'mktab':
  84.             echo ($fb->createNodeTable($_REQUEST['req']));
  85.             break;
  86.            
  87.          }
  88.       }
  89.      
  90. //-------------------------------------------
  91. //            read fqls file
  92. //-------------------------------------------
  93. function getFqls() {
  94.  
  95.    $s = file_get_contents('fql.txt');
  96.    
  97.    $spl3=str_repeat('=',76);
  98.  
  99.    
  100.    $arr = explode($spl3,$s );
  101.    
  102.    //----------------
  103.    
  104.     function inff ($value) {
  105.    
  106.       $spl4=str_repeat('-',76);
  107.        
  108.       $inf = array();
  109.       list($nam,$val) = explode($spl4, $value);
  110.      
  111.       $nam=implode(' ',array_filter(array_map('trim',explode(' ',str_replace(array("\n","\r")," ",$nam)))));
  112.       $val=implode(' ',array_filter(array_map('trim',explode(' ',str_replace(array("\n","\r")," ",$val)))));
  113.      
  114.       $inf["name"]=$nam;
  115.       $inf["value"]=$val;
  116.      
  117.       return $inf;
  118.    }
  119.    //----------------
  120.    $arr4 = array_map('inff', $arr);
  121.    
  122.    return $arr4;
  123. }
  124.  
  125.      
  126. //-------------------------------------------
  127. //          draw page
  128. //-------------------------------------------
  129. function draw_form() {
  130.    global $fb;
  131. //---------------------
  132. ?>
  133.  
  134. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  135. <html xmlns:fb="http://ogp.me/ns/fb#">
  136.  
  137. <head>
  138. <title>Check page for fb operations</title>
  139.  
  140. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  141. <meta name="description" content="Check page for fb operations" />
  142. <meta name="keywords" content="facebook, api" />
  143.  
  144. <script type="text/javascript" src="jquery.min.js"></script>
  145. <!-- ----------------------------------------- -->
  146. <style type="text/css">
  147.    * {
  148.       margin:0;
  149.       padding:0;
  150.    }
  151.    
  152.    h1 {
  153.       padding:5px;
  154.    }
  155.    
  156.    h3 {
  157.       margin:15px 0 10px 0;
  158.    }
  159.    
  160.    li {
  161.       list-style-type:none;
  162.       margin-bottom:4px;
  163.    }
  164.    
  165.    
  166.    #loginblock {
  167.       font-family: arial, tahoma, sans-serif;
  168.       font-size: 12px;
  169.       word-wrap: break-word;
  170.    }
  171.    
  172.    #loginblock a, #loginblock a:visited {
  173.       display:block;
  174.       padding:5px 0 5px 20px;
  175.       margin: 4px 4px 5px 20px;
  176.       border:solid 1px #888;
  177.       background-color: #f0f0f0;
  178.       text-decoration:none;
  179.       color:#444;
  180.       font-weight:bold;
  181.       width:200px;
  182.       font-size:150%;
  183.    }
  184.    
  185.    #loginblock a:hover {
  186.       background-color:#aaa;
  187.       color:white;
  188.    }
  189.    
  190.    
  191.    
  192.    
  193.    #leftcolumn {
  194.       float:left;
  195.       width:400px;
  196.       background-color:#f5f5f5;
  197.       padding:10px;
  198.      
  199.       font-family: verdana, sans-serif;
  200.       font-size:18px;
  201.      
  202.    }
  203.    
  204.    #leftcolumn a, #leftcolumn a:visited {
  205.       color: #800;
  206.       text-decoration:none;
  207.      
  208.    }
  209.    
  210.    #leftcolumn a:hover {
  211.    
  212.       text-decoration: underline;
  213.    }
  214.    
  215.    #maincontent {
  216.       margin-left:450px;
  217.    }
  218.    
  219.    #ajaxcontent {
  220.       min-height:300px;
  221.       background-color:#fffff0;
  222.    }
  223.    
  224.    #ajaxcontent p {
  225.    
  226.      
  227.    }
  228.    
  229.    #ajaxstatus, #ajaxstatus3 {
  230.       min-height:50px;
  231.       margin: 5px;
  232.       border: solid 1px #999;
  233.       background-color: #eee;
  234.      
  235.    }
  236.    
  237.    #ajaxstatus p, #ajaxstatus3 p, #ajaxcontent p {
  238.       overflow:hidden;
  239.       border:solid 1px #aaa;
  240.       margin:5px;
  241.       padding:10px;
  242.    }
  243.    
  244.    .remark {
  245.       padding:10px;
  246.       font-size:16px;
  247.       border:solid 4px #888;
  248.       background-color:#f5f5f5;
  249.       margin-top:15px;
  250.       width:500px;
  251.       font-weight:bold;
  252.       word-wrap: break-word;
  253.      
  254.    }
  255.    
  256.    
  257.    #flinfo {
  258.       position:absolute;
  259.       display:none;
  260.       z-index:100;
  261.      
  262.    }
  263.    
  264.    /*--------------------------------*/
  265.    form {
  266.       font-family: tahoma, geneva, sans-serif;
  267.       font-size: 16px;
  268.       color:#926262;
  269.       padding:10px;
  270.    }
  271.    
  272.    fieldset {
  273.       border:1px solid #926262;
  274.       padding:20px;
  275.       padding-left:-1px;
  276.       -webkit-border-radius:5px;
  277.       -moz-border-radius:5px;
  278.       -border-radius:5px;
  279.       -khtml-border-radius:5px;
  280.    }
  281.    
  282.    legend {
  283.       font-size:1.5em;   
  284.       color:#926262;
  285.       margin-left:20px;
  286.       padding: 5px 10px;
  287.       border: 1px solid #926262;
  288.      
  289.       -webkit-border-radius:5px;
  290.       -moz-border-radius:5px;
  291.       -border-radius:5px;
  292.       -khtml-border-radius:5px;
  293.      
  294.       text-transform:capitalize;
  295.    }
  296.    /*--------------------------------*/
  297. </style>
  298.  
  299. <!-- ----------------------------------------- -->
  300. <script type="text/javascript">
  301.  
  302.  
  303.    function print_r(arr, level) {
  304.    
  305.        var print_red_text = "";
  306.        
  307.        if(!level)
  308.           level = 0;
  309.        //--------------------------------  
  310.        var level_padding = "";
  311.        
  312.        for(var j=0; j<level+1; j++)
  313.           level_padding += "    ";
  314.          
  315.        //--------------------------------
  316.        if (typeof(arr) == 'object') {
  317.          
  318.           for (var item in arr) {  
  319.          
  320.              var value = arr[item];          
  321.              if (typeof(value) == 'object') {
  322.                
  323.                 print_red_text += level_padding + "'" + item + "' :\n";
  324.                 print_red_text += print_r(value,level+1);
  325.                  
  326.                 }
  327.              else
  328.                 print_red_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
  329.              }
  330.           }  
  331.        else    
  332.           print_red_text = "===>"+arr+"<===("+typeof(arr)+")";
  333.          
  334.     return '<pre>'+print_red_text+'</pre>';
  335.   }
  336.    
  337.    //---------------------------------
  338.    $(document).ready(init);
  339.    
  340.    //----------------------------------------------
  341.    //             initialization
  342.    //----------------------------------------------
  343.    function init() {
  344.    
  345.       glTime=0;
  346.       //---------------------------
  347.       load_fql_list();
  348.    
  349.       //---------------------------
  350.       $('#leftcolumn h3').css({cursor:'pointer'}).click( function()
  351.          {$(this).next('ul').slideToggle('fast');}
  352.       )
  353.       //---------------------------
  354.      
  355.       $('#operationslist a').each(
  356.          function(i) {
  357.          
  358.             $(this).click(function() {
  359.            
  360.                var inp = $('form[name=paramform] input[name=crtab]');
  361.                //alert (inp.attr('checked'));
  362.                if ((inp.attr('checked')!==undefined) && (inp.attr('checked')!==false))
  363.                
  364.                   req_createtable($(this).attr('rel'));
  365.                else
  366.                   ajax_request($(this).attr('rel'),'apigraph');
  367.                
  368.             });
  369.            
  370.             $(this).text('load '+$(this).attr('rel'));
  371.             //alert $(this);
  372.          })
  373.          
  374.      //---------------------------   
  375.      $('#operationslist3 a').each(
  376.          function(i) {
  377.          
  378.             $(this).click(function() {
  379.                ajax_request($(this).attr('rel'),'fql');
  380.             });
  381.            
  382.             $(this).text('load '+$(this).attr('rel'));
  383.             //alert $(this);
  384.          })
  385.          
  386.       //-----------  AjaxStart, AjaxStop, AjaxSend, AjaxSuccess, AjaxError, AjaxComplete events
  387.      
  388.       //---------------------------------------  
  389.       //     ajaxStart   
  390.       //---------------------------------------  
  391.       $('#ajaxstatus').ajaxStart(
  392.           function() {
  393.              $(this).html('Request started. Please wait...');
  394.           })
  395.          
  396.       //---------------------------------------  
  397.       //    ajaxStop
  398.       //---------------------------------------      
  399.       $('#ajaxstatus').ajaxStop(
  400.           function() {
  401.              $(this).html('Request finished');
  402.           } )    
  403.      
  404.        //---------------------------------------     
  405.        //     ajaxSend
  406.        //---------------------------------------     
  407.        $('#ajaxstatus3').ajaxSend (
  408.        
  409.           function(ev, jqXHR, options) {   
  410.          
  411.              $(this).empty();
  412.              $(this).append($('<p/>').html('<b>triggered ajaxSend</b>'));
  413.              
  414.              $(this).append($('<p/>').html('ajaxResponse: <pre>'+jqXHR.responseText+'</pre>'));
  415.              $(this).append($('<p/>').html('status: '+jqXHR.status+'<br/>ready state:'+jqXHR.readyState));
  416.              
  417.              //---------------------------
  418.              $(this).append(
  419.                 $('<p>', {class:'info'}).html('ev: <br/>'/*+print_r(ev)*/));
  420.              
  421.              $(this).append(
  422.                 $('<p>', {class:'info'}).html('jqXHR: <br/>'+print_r(jqXHR))
  423.                    .css({'height':'50px', 'cursor':'pointer'})
  424.                    .click(function() {
  425.                      
  426.                       if ($(this).height()<800)
  427.                          $(this).animate({'height':'800px'},"fast");
  428.                       else
  429.                          $(this).animate({'height':'50px'},"fast");
  430.                    }));
  431.                
  432.            
  433.              $(this).append($(document.createElement('P'))
  434.                          .html('options: <br/>' +print_r(options))
  435.                          .css({'height':'50px', 'cursor':'pointer'})
  436.                          .click(function() {
  437.                             if ($(this).height()<800)
  438.                                $(this).animate({'height':'800px'},"fast");
  439.                             else
  440.                                $(this).animate({'height':'50px'},"fast");
  441.                          }));                    
  442.           }
  443.        )
  444.        
  445.        //---------------------------------------     
  446.        //     ajaxSuccess
  447.        //---------------------------------------
  448.        $('#ajaxstatus3').ajaxSuccess(
  449.        
  450.           function (ev, jqXHR, options) {
  451.              $(this).append($('<p/>').html('<b>triggered ajaxSuccess</b>'));
  452.              
  453.               $(this).append($('<p/>').html('ajaxResponse: <pre>'+jqXHR.responseText+'</pre>'));
  454.               $(this).append($('<p/>').html('status: '+jqXHR.status+'<br/>ready state:'+jqXHR.readyState));
  455.           }
  456.        );
  457.        
  458.        //---------------------------------------     
  459.        //     ajaxError
  460.        //---------------------------------------
  461.        $('#ajaxstatus3').ajaxError(
  462.        
  463.           function (ev, jqXHR, options, exception) {
  464.              $(this).append($('<p/>').html('<b>triggered ajaxError</b>'));
  465.              
  466.               $(this).append($('<p/>').html('ajaxResponse: <pre>'+jqXHR.responseText+'</pre>'));
  467.               $(this).append($('<p/>').html('status: '+jqXHR.status+'<br/>ready state:'+jqXHR.readyState));
  468.               $(this).append($('<p/>').html('exception: '+exception));
  469.           }
  470.        );
  471.        
  472.        
  473.        //---------------------------------------     
  474.        //     ajaxComplete
  475.        //---------------------------------------
  476.        $('#ajaxstatus3').ajaxComplete(
  477.        
  478.           function (ev, jqXHR, options) {
  479.              $(this).append($('<p/>').html('<b>triggered ajaxComplete</b>'));
  480.              
  481.               $(this).append($('<p/>').html('ajaxResponse: <pre>'+jqXHR.responseText+'</pre>'));
  482.               $(this).append($('<p/>').html('status: '+jqXHR.status+'<br/>ready state:'+jqXHR.readyState));
  483.           }
  484.        );
  485.      
  486.      
  487.    }
  488.  
  489.    
  490.    //-------------------------------------------------------
  491.    //                 local events
  492.    //-------------------------------------------------------
  493.    //-------------------------------------------------------
  494.    //         onSuccess
  495.    //-------------------------------------------------------
  496.    function onSuccess(inf, textStatus, jqXHR) {
  497.    
  498.      var a = $('#ajaxstatus3');
  499.      
  500.      a.append($('<p/>').html('<font color="red"><b>triggered local success</b></font>'));
  501.      a.append($('<p/>').html('ajaxResponse: <pre>'+jqXHR.responseText+'</pre>'));
  502.      a.append($('<p/>').html('status: '+jqXHR.status+'<br/>ready state:'+jqXHR.readyState));
  503.      a.append($('<p/>').html('textStatus: '+textStatus));
  504.    
  505.    
  506.       var s='';
  507.       //--------------------
  508.       function get_obj(objel, deep) {
  509.      
  510.           var s3= new Array(deep*3).join('&nbsp;');
  511.          
  512.           for (var el in objel) {
  513.            
  514.               s3+=typeof(objel[el])+' : '+el+' = '
  515.              
  516.               if (typeof(objel[el])=='object')
  517.              
  518.                   s3+=String.fromCharCode(13)+String.fromCharCode(10)+
  519.                        get_obj(objel[el], deep+1);
  520.                else {
  521.                   s3+= objel[el]+String.fromCharCode(13)+String.fromCharCode(10);
  522.                   }
  523.          }
  524.          return s3;
  525.      
  526.       }
  527.       //--------------------
  528.       s=get_obj(inf,0);
  529.      
  530.       var tnode = $('#ajaxcontent');
  531.       tnode.empty();
  532.      
  533.       tnode.append($(document.createElement('P')));
  534.       tnode.children('p').filter(':eq(0)').html('<b>'+textStatus+'</b>');
  535.  
  536.       tnode.append($('<p/>').html('<pre>'+s+'</pre>'));
  537.      
  538.       tnode.append($('<p>', {class: 'zinfo'}).html('XHR:<br/>'+print_r(jqXHR)));
  539.      
  540.      
  541.    }
  542.    
  543.    //-------------------------------------------------------
  544.    //         onError
  545.    //-------------------------------------------------------
  546.    function onError(xhr, status, exception) {
  547.    
  548.      var a = $('#ajaxstatus3');
  549.      
  550.      a.append($('<p/>').html('<font color="red"><b>triggered local error</b></font>'));
  551.      a.append($('<p/>').html('ajaxResponse: <pre>'+xhr.responseText+'</pre>'));
  552.      a.append($('<p/>').html('status: '+xhr.status+'<br/>ready state:'+xhr.readyState));
  553.      a.append($('<p/>').html('textStatus: '+status));
  554.      a.append($('<p/>').html('Exception: '+exception));
  555.      
  556.    }
  557.    
  558.    //-------------------------------------------------------
  559.    //         onBeforeSend
  560.    //-------------------------------------------------------
  561.    
  562.    function onBeforeSend(xhr, settings) {
  563.    
  564.      var tnode = $('#ajaxcontent');
  565.      tnode.html('please wait...');
  566.    
  567.      var a = $('#ajaxstatus3');
  568.      a.empty();
  569.      a.append($('<p/>').html('<font color="red"><b>triggered local beforeSend</b></font>'));
  570.      a.append($('<p/>').html('ajaxResponse: <pre>'+xhr.responseText+'</pre>'));
  571.      a.append($('<p/>').html('status: '+xhr.status+'<br/>ready state:'+xhr.readyState));
  572.      //a.append($('<p/>').html('settings: '+print_r(settings)));
  573.    }
  574.    
  575.    //-------------------------------------------------------
  576.    //         onComplete
  577.    //-------------------------------------------------------
  578.    function onComplete(xhr, status) {
  579.    
  580.      var a = $('#ajaxstatus3');
  581.      
  582.      a.append($('<p/>').html('<font color="red"><b>triggered local complete</b></font>'));
  583.      a.append($('<p/>').html('ajaxResponse: <pre>'+xhr.responseText+'</pre>'));
  584.      a.append($('<p/>').html('status: '+xhr.status+'<br/>ready state:'+xhr.readyState));
  585.      a.append($('<p/>').html('textStatus: '+status));
  586.    }
  587.    
  588.    
  589.    //-------------------------------------------------------
  590.    //            ajax request
  591.    //-------------------------------------------------------
  592.    
  593.    function ajax_request(param, reqtypeval) {
  594.    
  595.       $.ajaxSetup( {
  596.      
  597.          type: 'POST',
  598.          url: "<?php echo $_SERVER["PHP_SELF"]?>",
  599.          dataType: 'json',
  600.          processData: true,
  601.          cache: false,
  602.          timeout: 50000,
  603.          
  604.          username: '',
  605.          password: '',
  606.          ifModified: false,
  607.          global: true,
  608.          crossDomain: false,
  609.       })
  610.      
  611.       //----------------------------
  612.       $.ajax (
  613.          {
  614.             data: {ajax:'',
  615.                   reqtype:reqtypeval,
  616.                   req: param},
  617.        
  618.             //-----------------
  619.             beforeSend: onBeforeSend,
  620.             success: onSuccess,
  621.             error: onError,
  622.            
  623.             complete: onComplete,
  624.            
  625.             statusCode: {
  626.                404: function() {
  627.                
  628.                   var tnode = $('#ajaxcontent');
  629.                   tnode.html
  630.                }
  631.             }
  632.            
  633.            
  634.          
  635.          })
  636.    
  637.    }
  638.  
  639.    //-------------------------------------------------------
  640.    //            load fql list
  641.    //-------------------------------------------------------
  642.    
  643.    function onGetSuccess (data, status, xhr) {
  644.       el = $('#operationslist3');
  645.      
  646.       $.each(data, function (i, valu) {
  647.          var lii=$('<li/>');
  648.          
  649.          var a = $('<a/>');
  650.  
  651.          a.text(valu["name"]);
  652.          a.attr('href','#');
  653.          
  654.          //-----------------------------
  655.          a.click(
  656.             //------------
  657.             {fqlval: valu["value"]},
  658.             //------------
  659.             function(ev) {
  660.                ajax_request(ev.data.fqlval,'fql'); 
  661.                return false;
  662.             });
  663.            
  664.         //-----------------------------
  665.         a.data('fqv',valu["value"]);
  666.        
  667.         a.hover (
  668.  
  669.          function(ev) {
  670.             //$(this).after($('<p/>',{class:'remark'}).text($(this).data('fqv')));
  671.             //alert (ev.clientX);
  672.            
  673.            
  674.             clearTimeout(glTime);
  675.                
  676.             $('#flinfo').text($(this).data('fqv'))
  677.                .clearQueue()
  678.                .addClass('remark')
  679.                .css('left',ev.clientX+100)
  680.                .css('top',ev.clientY+
  681.                   ((document.documentElement && document.documentElement.scrollTop) ||
  682.                   (document.body && document.body.scrollTop) || 0)-100)
  683.                .fadeIn("fast");
  684.            
  685.          },
  686.          
  687.          function(ev) {
  688.             //$(this).next('p').remove();
  689.             glTime= setTimeout( function() {
  690.             $('#flinfo').fadeOut("slow")
  691.                .queue(
  692.                   function() {
  693.                      $(this).removeClass('remark');
  694.                      $(this).dequeue();
  695.                      })}, 1000);
  696.                      
  697.          }
  698.    
  699.         )
  700.                  
  701.          lii.append(a);
  702.          el.append(lii);
  703.       });
  704.    }
  705.    
  706.    //--------------------------------------------  
  707.    function load_fql_list() {
  708.    
  709.       $inf = $.get( "<?php echo $_SERVER["PHP_SELF"]?>",
  710.                     {ajax:'', reqtype:'getfqls'},
  711.                     onGetSuccess,
  712.                     'json');
  713.                    
  714.    }
  715.    
  716.    //------------------------------------------------------------  
  717.    //      create table  - request
  718.    //------------------------------------------------------------
  719.  
  720.    function onPostSuccess (data, status, xhr) {
  721.    
  722.       var tnode =$('#ajaxcontent');
  723.      
  724.       tnode.empty();
  725.      
  726.       tnode.append($('<p/>').text('status: '+status));
  727.       tnode.append($('<p/>').html('<pre>'+data+'</pre>'));
  728.    }
  729.    
  730.    
  731.    //-------------------------------------------------------
  732.    function req_createtable (param) {
  733.    
  734.       $inf = $.post("<?php echo $_SERVER["PHP_SELF"]?>",
  735.                         {ajax:'',
  736.                          reqtype:'mktab',
  737.                          req: param},
  738.                          
  739.                          onPostSuccess,
  740.                          'text'
  741.                          );
  742.    }  
  743.    
  744.    
  745.  
  746.    
  747. </script>
  748. <!-- ------------------------------------------ -->
  749.  
  750. </head>
  751.  
  752. <body>
  753.  
  754.    <div id="flinfo">
  755.    </div>
  756.    <h1>Test fb operational page</h1>
  757.    <div id="loginblock">
  758.    <?php
  759.     echo '<pre>'.print_r($_SESSION,true).'</pre>';
  760.    
  761.    
  762.    if (!$fb->connected()) {
  763.       echo   "<a href=\"$fb->loginUrl\">Login</a>";
  764.       //echo $fb->drawLogin(true);
  765.    }
  766.    else {
  767.       echo   "<a href=\"$fb->logoutUrl\">Logout</a>";
  768.  
  769.    }  
  770.    ?>
  771.    </div>
  772.    
  773.    <div id="leftcolumn">
  774.    
  775.    <h3>Utils</h3>
  776.    <a href='#' onclick="ajax_request('','getfqls');return false;">list of fqls</a>
  777.    
  778.    
  779.    <form name="paramform">
  780.       <fieldset>
  781.          <legend>commands</legend>
  782.          <label for="crtab">create table for node</label>
  783.          <input type="checkbox" name="crtab" />
  784.       </fieldset>
  785.    </form>
  786.    
  787.    <h3>Api graph requests</h3>
  788.    <ul id="operationslist">
  789.           <li><a href="#" rel="me"></a></li>
  790.       <li><a href="#" rel="me/accounts"></a></li>
  791.       <li><a href="#" rel="me/achievements"></a></li>
  792.       <li><a href="#" rel="me/activities"></a></li>
  793.       <li><a href="#" rel="me/albums"></a></li>
  794.       <li><a href="#" rel="me/apprequests"></a></li>
  795.       <li><a href="#" rel="me/books"></a></li>
  796.       <li><a href="#" rel="me/checkins"></a></li>
  797.       <li><a href="#" rel="me/events"></a></li>
  798.       <li><a href="#" rel="me/family"></a></li>
  799.       <li><a href="#" rel="me/friendlists"></a></li>
  800.       <li><a href="#" rel="me/friendrequests"></a></li>
  801.       <li><a href="#" rel="me/friends"></a></li>
  802.       <li><a href="#" rel="me/games"></a></li>
  803.       <li><a href="#" rel="me/groups"></a></li>
  804.       <li><a href="#" rel="me/home"></a></li>
  805.       <li><a href="#" rel="me/inbox"></a></li>
  806.       <li><a href="#" rel="me/interests"></a></li>
  807.       <li><a href="#" rel="me/likes"></a></li>
  808.       <li><a href="#" rel="me/links"></a></li>
  809.       <li><a href="#" rel="me/locations"></a></li>
  810.       <li><a href="#" rel="me/movies"></a></li>
  811.       <li><a href="#" rel="me/music"></a></li>
  812.       <li><a href="#" rel="me/mutualfriends"></a></li>
  813.       <li><a href="#" rel="me/notes"></a></li>
  814.       <li><a href="#" rel="me/notifications"></a></li>
  815.       <li><a href="#" rel="me/outbox"></a></li>
  816.       <li><a href="#" rel="me/payments"></a></li>
  817.       <li><a href="#" rel="me/permissions"></a></li>
  818.       <li><a href="#" rel="me/photos"></a></li>
  819.       <li><a href="#" rel="me/photos/uploaded"></a></li>
  820.       <li><a href="#" rel="me/picture"></a></li>
  821.       <li><a href="#" rel="me/pokes"></a></li>
  822.       <li><a href="#" rel="me/posts"></a></li>
  823.       <li><a href="#" rel="me/questions"></a></li>
  824.       <li><a href="#" rel="me/scores"></a></li>
  825.       <li><a href="#" rel="me/sharedposts"></a></li>
  826.       <li><a href="#" rel="me/statuses"></a></li>
  827.       <li><a href="#" rel="me/subscribedto"></a></li>
  828.       <li><a href="#" rel="me/subscribers"></a></li>
  829.       <li><a href="#" rel="me/tagged"></a></li>
  830.       <li><a href="#" rel="me/television"></a></li>
  831.       <li><a href="#" rel="me/updates"></a></li>
  832.       <li><a href="#" rel="me/videos"></a></li>
  833.      
  834.    </ul>
  835.    
  836.    <h3>Fql requests</h3>
  837.    <ul id="operationslist3">
  838.      
  839.      
  840.    </ul>
  841.    </div>
  842.    <div id="maincontent">
  843.    
  844.       <div id="ajaxcontent"></div>  
  845.       <div id="ajaxstatus"></div>
  846.       <div id="ajaxstatus3"></div>
  847.    </div>
  848. </body>
  849. </html>
  850.  
  851.  
  852.  
  853.  
  854.  
  855. <?php
  856. //--------------------
  857.  
  858. }
  859.    
  860.  
  861. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement