Exemplo n.º 1
0
<?php

$args = array('tbl' => 'sr_usrs_login');
$pd = makeform($args);
global $PAGE, $TRADS;
/*	Check the POST data to see if the username already exists...
		if it does, see if the person forgot their username.*/
if (isset($_POST['sr_usrname'])) {
    $args = array('tbl' => 'sr_usrs_login', 'formDesc' => $_SESSION['formDesc']);
    $pd = checkform($args);
    //die(print_r($pd));
    if ($pd['result'] == 'passed') {
        //ok, we passed the test, so now lets process the data...
        $_POST['sr_usrgroup'] = 'users';
        //die("you're in");
        global $STORAGE;
        //include_once 'app/core/storage.class.php';
        //$STORAGE = & $registry->get('STORAGE');
        // $STORAGE = & new storage();
        // parent::sestusr();
        if ($_POST['submit']) {
            unset($_POST['submit']);
        }
        if ($_POST[$TRADS->popTrad('submit')]) {
            unset($_POST[$TRADS->popTrad('submit')]);
        }
        $nu = $STORAGE->formToDB('sr_usrs_login');
        if ($nu) {
            //$PAGE->body_message = $TRADS->popTrad('PLEASE_LOGIN_TO_CONTINUE_SIGNUP');
            $PAGE->forwardMessage($TRADS->popTrad('You_must_be_logged_in_to_continue'));
            // $STORAGE->store('PLEASE_LOGIN_TO_CONTINUE_SIGNUP', 'MESSAGE', 'global');
Exemplo n.º 2
0
 function edit()
 {
     // we need a user, then to provide him with choices - edit the login details, edit his personal info, or fix his map...
     global $PAGE, $STORAGE, $TRADS;
     $current = $this->arrayGetUsrInfo($_SESSION['idsr_usrs_login']);
     if (isset($_POST['submit'])) {
         // change the data...
         $args = array('tbl' => 'sr_ads', 'formDesc' => $_SESSION['formDesc']);
         $pd = checkform($args);
         if ($pd['result'] == 'passed') {
             // the data is good...
             global $STORAGE;
             $condition = 'idsr_usrs_login = '******'idsr_usrs_login'];
             if ($_POST['submit']) {
                 unset($_POST['submit']);
             }
             if ($_POST[$TRADS->popTrad('submit')]) {
                 unset($_POST[$TRADS->popTrad('submit')]);
             }
             $nu = $STORAGE->formToDB('sr_usrs_info', '', 'update', $condition);
             if ($nu !== false) {
                 // we have an ad inserted!
                 if ($_POST['sr_street'] !== $current['sr_street'] || $_POST['sr_city'] !== $current['sr_city']) {
                     // recode the location...
                     include_once 'inc/googleRecordLocFunc.inc.php';
                     //$address = $_POST["sr_street"] . ',' . $_POST["sr_city"] . ',' . $_POST["sr_state"] . ',' . $_POST["sr_country"];
                     $address = $_POST["sr_street"] . ',' . $_POST["sr_city"] . ',' . $_POST["sr_country"];
                     $aull = split(',', strGoogleGetLatLng($address));
                     //die($aull[0]);
                     //die(stripos($aull[0], 'failed'));
                     if (stripos($aull[0], 'failed')) {
                         //die('badaddress');
                         $PAGE->body_error .= $aull[0] . ', ' . $aull[1];
                         $this->errors .= $aull[0] . ', ' . $aull[1];
                         $PAGE->forwardMessage('impossible de localiser votre address. Essayez de nouveau.', 'error');
                         header('location:' . $_SERVER['REQUEST_URI']);
                         //break;
                     }
                     // TODO get the current session start time and the current timestamp
                     $ary = array('sr_lat' => $aull[0], 'sr_lng' => $aull[1]);
                     //$condition = 'idsr_usrs_login = '******'id']
                     //$udata = & new storage();
                     $r = $STORAGE->formToDB('sr_usrs_data', '', 'update', $condition, $ary);
                     $locstr = $_SERVER['PHP_SELF'] . '?where=users&what=view';
                     header('location:' . $locstr);
                 }
                 $locstr = $_SERVER['PHP_SELF'] . '?where=users&what=view';
                 header('location:' . $locstr);
             } else {
                 // didn't work :-(
                 die('didn\'t get an update - got : ' . $nu);
                 // TODO make a routine for failed inserts - a form to open an issue ticket?
             }
         }
     }
     $args = array('tbl' => 'sr_usrs_info', 'currentArray' => $current);
     $PAGE->body_message .= $TRADS->popTrad('please_complete_details');
     $pd = makeform($args);
     foreach ($pd as $k => $v) {
         //	$GLOBALS[$k] = $v;
         $PAGE->{$k} .= $v;
     }
 }
Exemplo n.º 3
0
<title>Node details</title>

<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script src="graphs.js" type="text/javascript" ></script>
 </head>



<?php 
$name = "";
$whichnode = "1";
if (isset($_POST['save'])) {
    $whichnode = $_POST["nodenum"];
    #load which node
    $OK = checkform();
    echo $OK;
    if ($OK) {
        savesets($whichnode);
    }
}
if (isset($_POST['load'])) {
    $whichnode = $_POST["nodenum"];
    #load which node selected
}
?>


<div class="table">                                      <!-- navigation bar -->
   <div class=bar>
    	<div class="item">