Jump to content

Jahren

Members
  • Posts

    66
  • Joined

  • Last visited

    Never

Posts posted by Jahren

  1. xajax is availlable here : http://www.xajax-project.org/en/download/

     

    I use their test files.

     

    so i use :

    <?php
    include './xajax/xajax_core/xajax.inc.php';
    
    $xajax = new xajax();
    
    $rqstAdd =& $xajax->register(XAJAX_FUNCTION, 'doAdd');
    $rqstReset =& $xajax->register(XAJAX_FUNCTION, 'doReset');
    
    // set the parameters
    $rqstAdd->setParameter(0, XAJAX_JS_VALUE, 39);
    $rqstAdd->setParameter(1, XAJAX_JS_VALUE, 571);
    
    $xajax->processRequest();
    
    function doAdd($a, $b)
    {
        $response = new xajaxResponse();
        $response->assign('answer', 'innerHTML', $a + $b);
        $response->assign('reset', 'style.display', 'block');
        return $response;
    }
    
    function doReset()
    {
        $response = new xajaxResponse();
        $response->clear('answer', 'innerHTML');
        $response->assign('reset', 'style.display', 'none');
        return $response;
    }
    

     

    I cant even create the Ajax object. gives me the weird error. I tried their support forums but its kinda dead :S

    thanks for your time

  2. hi!

    I'm trying to use xajax on my server but I get a weird error :

    Fatal error: Call to undefined function phpdebug_print_backtrace() in /home/client/public_html/Bidup/admin/xajax/xajax_core/plugin_layer/xajaxEventPlugin.inc.php on line 1

     

    for some reason it believes the <?php tag is part of the debug+print call.

     

    code :

    <?php
    
    debug_print_backtrace();

     

    The exact same files works perfectly on my local webserver.

    I don't know what to do, please help xD

     

     

  3. Hmmm, try seperating the operations to simplify the model.

    first you want all types in order. then use a temp array to store the data. (declare the array before the first loop.)

     

    $query = "SELECT id_type, str_type FROM types ORDER BY str_type ASC";
    

     

    then

    I need to understand why $i=30 ; $i<98.

    is it that you want to loop for each type you get from the first query?

     

     

  4. php code must be inserted into <?php ?> brackets.

    use of shortends is possible but not recommanded, its not multi-plateform friendly

    <?xml version="1.0"?> is a shortend for <?php xml version="1.0" ?>

     

    hence, php believes this is php code

    The answer is:

    disable short_open_tag in the php.ini.

    OR use

     

    <?php echo("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); ?>

     

     

  5. i'M not sure I understand, you want to send a confirmation email in that code, or you need to know if the SQL query has worked?

     

    $SomeVar = $fin;
    
       $query = "SELECT * FROM dyomails WHERE ID = '$SomeVar'";
       $results = mysql_query($query);
       if($results){
           //IT WORKS
           if($line = mysql_fetch_assoc($results))
           {
               echo "<item>" . $line["Email"] . "</item>\n";
           }
       }
       else{
          //DOESN'T WORK
          echo mysql_error($link);
       }
    

  6. Because the data changes from year to year.

    so when you select a year, it fetches the data from that specific year with xajax.

    What I believe is happening is that $xAjax_objResponse->script("document.getElementById('date1').onchange();"); happens before the data is set on the page even tho I set it up in order. Would that make any sense? and how should I change my approach?

     

    I could post some code but you'll always need more :P

     

    edit :

    In order:

    I select a year which fires xajax_updateFormValeurs(this.value);

    updateFormValeurs returns value assigments to html controls and should call an other event:

     

    xajax_updateFormDates(xajax.getFormValues('form_plan_action'));

    This format dates value and call $xAjax_objResponse->script('document.getElementById("nbJoursFeries").onchange();');

     

    nbJoursFeries calls

    updateForm();

    some calculation and stuff

    AND

    xajax_updateGraphique(xajax.getFormValues("form_plan_action"));

     

    here's the code

    function updateGraphique($formData){
    $xAjax_objResponse = initXajaxObject();
    $joursRecit = $formData['nbJoursTravail'];
    $joursAutre = $formData['nbJoursEntre'] - $joursRecit;
    $joursTotal = $joursRecit + $joursAutre;
    
    if($joursTotal > 0){
    	$pourcentageRecit = round($joursRecit * 100 / $joursTotal);
    	$pourcentageAutre = round($joursAutre * 100 / $joursTotal);
    
    	//on parametrise le graphique
    	$pie = new pie_chart();
    	$pie->set_sizeX(200);
    	$pie->set_sizeY(200);
    	$pie->set_couleur_fond('FFFFFF'); //28211a
    	$pie->add_element($pourcentageRecit, '467287', 'recit', '000', 'RECIT');
    	$pie->add_element($pourcentageAutre, '28211A', 'autre', 'FFF', 'AUTRE');
    	$_SESSION['pie'] = $pie;
    
    	//on grandit l'objet
    	$xAjax_objResponse->assign("pie_chart", "style.width", "200px");
    	$xAjax_objResponse->assign("pie_chart", "style.height", "200px");
    
    	//je vais chercher la map clickable ensuite
    	$xAjax_objResponse->assign("piemap", "innerHTML", $pie->getMapAreaInnerHTML());
    }
    else{
    	unset($_SESSION['pie']);
    	//on rétrécit l'objet
    	$xAjax_objResponse->assign("pie_chart", "style.width", "50px");
    	$xAjax_objResponse->assign("pie_chart", "style.height", "50px");			
    }
    
    return $xAjax_objResponse;
    }
    

     

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.