Ejemplo n.º 1
0
  if ($valueskv != '') $values = $client->parsekv($valueskv, TRUE);
}

if (($session == '' && $passphrase == '') || !login()) {
  $onload = 'passphrase';
  $page = 'login';
} else {
   if ($values == '') {
    $values = scanFolder($folder);
    $valueskv = $client->array2kv($values);
  }
}

$title = "Loom Wallet";

if ($page == 'main') doMain();
elseif ($page == 'locations') doLocations();
elseif ($page == 'add_location') doAddLocation();
elseif ($page == 'logout') doLogout();

drawHead();

if ($page == 'login') drawLogin();
elseif ($page == 'main') drawMain();
elseif ($page == 'locations') drawLocations();
elseif ($page == 'add_location') drawAddLocation();

drawTail();

function doMain() {
  global $qty, $type, $location, $take, $give;
Ejemplo n.º 2
0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 *
 * see http://www.gnu.org/licenses/gpl.html for more information
 */
require "functions.inc.php";
$db = new DB();
requireUser();
if ($_POST["action"] == "save") {
    $body = handleSave();
} else {
    $body = doMain();
}
display("Preferences", $body);
function doMain()
{
    $db = new DB();
    if ($_GET["msg"]) {
        $result = "<p>" . $_GET["msg"] . "</p>";
    }
    $result .= "<p>Please enter a rating for the following restaurants on a scale from 1 to 100.  100 being the best restaurant ever, 0 being a restaurant you would never visit.</p>";
    $sql = "SELECT r.ID, r.Name, r.Note, a.Rating FROM restaurants r LEFT JOIN attendees a ON r.ID = a.RestaurantID AND a.User = '******' ORDER BY r.Name";
    $results = $db->query($sql);
    if (!$results) {
        echo mysql_error();
    }
    $result .= "<form method=\"post\" class=\"oneColumn\">";