<?php require_once '../../inc/conf.php'; header("Cache-Control: no-cache"); $set = ''; foreach ($_POST['data'] as $key => $value) { $set .= $key . '="' . $value . '",'; } $set = substr($set, 0, -1); if (isOk($_POST['guid'])) { $set .= ',guid="' . makeGUID($_POST['data'][$_POST['guid']]) . '"'; } $db->update('UPDATE ' . $_POST['type'] . ' SET ' . $set . ' WHERE id=' . $_POST['id']);
<?php require_once '../inc/conf.php'; header('Content-Type: application/json; charset=utf-8'); header("Cache-Control: no-cache"); $id = $db->insert('INSERT INTO ' . $_POST['type'] . ' SET ' . $_POST['previewField'] . '="' . $_POST['title'] . '"' . (isOk($_POST['guid']) ? ', guid="' . makeGUID($_POST['title']) . '"' : '') . (isOk($_POST['parentId']) && isOk($_POST['parentTable']) ? ', ' . $_POST['parentTable'] . '_id="' . $_POST['parentId'] . '"' : '')); $rs = $db->select('SELECT * FROM ' . $_POST['type'] . ' WHERE id=' . $id); echo json_encode($rs['result']);
$rs = $db->select('SELECT id FROM author WHERE name="' . $_POST['author'] . '"'); if ($rs['total'] != 0) { $author_id = $rs['result'][0]['id']; } else { $author_id = $db->insert('INSERT INTO author SET name="' . $_POST['author'] . '", guid="' . makeGUID($_POST['author']) . '"'); $data['author_id'] = $author_id; } // DESCRIPTION if (isOk($_POST['description'])) { $description = ereg_replace("[\n\r]", "\t", $description); $description = ereg_replace("\t\t+", "\n", $description); $description = '<p>' . str_replace('<br /><br />', '</p><p>', nl2br(trim($_POST['description']))) . '</p>'; } else { $description = ''; } // INSERT $id = $db->insert(' INSERT INTO map SET date = "' . time() . '", date_created = "' . time() . '", title = "' . $_POST['title'] . '", guid = "' . makeGUID($_POST['title']) . '", description = "' . $description . '", game_id = "' . $game_id . '", gametype_id = "' . $gametype_id . '", author_id = "' . $author_id . '", mode_id = "0", image_id = "0" '); $data['map_id'] = $id; echo json_encode($data);
$subject = $_POST['subject']; $descrip = $_POST['descrip']; $date = $_POST['date']; $user_id = $_POST['user_id']; $priority_id = $_POST['priority_id']; $ticketstatus_id = 1; $location_id = $_POST['location_id']; $floor_id = $_POST['floor_id']; $room_area = $_POST['room_area']; $serviceType_id = $_POST['serviceType_id']; $date_respondby = $_POST['date_respondby']; $date_assigned = $_POST['date_assigned']; $date_due = $_POST['date_due']; $date_complete = $_POST['date_complete']; try { $t_id = makeGUID(); for ($i = 0; $i < count($servicetypes); $i++) { if ($servicetypes[$i]['id'] == $serviceType_id) { $groups_id = $servicetypes[$i]['groups_id']; } } $sql = "INSERT INTO ticket (id, subject, descrip, date, user_id, user_assigned_id, priority_id, ticketstatus_id, \n\t\t\t location_id, floor_id, room_area, serviceType_id, date_respondby, date_assigned, date_due, \n\t\t\t date_complete, groups_id)\n\t\t\t\t VALUES (:id, :subject, :descrip, :date, :user_id, :user_assigned_id, :priority_id, :ticketstatus_id, \n\t\t\t\t \t :location_id, :floor_id, :room_area, :serviceType_id, :date_respondby, :date_assigned, :date_due, \n\t\t\t\t \t :date_complete, :groups_id)"; $db = getConnection(); $stmt = $db->prepare($sql); $stmt->bindParam("subject", $subject); $stmt->bindParam("descrip", $descrip); $stmt->bindParam("date", $date); $stmt->bindParam("user_id", $user_id); $stmt->bindParam("user_assigned_id", $user_assigned_id); $stmt->bindParam("priority_id", $priority_id); $stmt->bindParam("ticketstatus_id", $ticketstatus_id);
<?php require_once '../inc/conf.php'; header("Cache-Control: no-cache"); $set = ''; foreach ($_POST['data'] as $key => $value) { $set .= $key . '="' . str_replace('"', '\\"', $value) . '",'; } $set = substr($set, 0, -1); if (isOk($_POST['guid'])) { $set .= ',guid="' . makeGUID($_POST['data'][$_POST['previewField']]) . '"'; } $db->update('UPDATE ' . $_POST['type'] . ' SET ' . $set . ' WHERE id=' . $_POST['id']);
if (isset($_POST['submit'])) { $username = $_POST['username']; $password = md5($_POST['password']); $email = $_POST['email']; $title = $_POST['title']; $firstname = $_POST['firstname']; $middlename = $_POST['middlename']; $lastname = $_POST['lastname']; $nickname = $_POST['nickname']; $workphone = $_POST['workphone']; $cellphone = $_POST['cellphone']; if (empty($username) or empty($password)) { echo "<p>You must enter a username and password !</p>"; } else { try { $guid = makeGUID(); $admin = "false"; $sql = "INSERT INTO profile (id, username, password, email, title, firstname, middlename, lastname, nickname, workphone, cellphone)\r\n\t\t\t\t VALUES (:id, :username, :password, :email, :title, :firstname, :middlename, :lastname, :nickname, :workphone, :cellphone)"; $db = getConnection(); $stmt = $db->prepare($sql); $stmt->bindParam("id", $guid); $stmt->bindParam("username", $username); $stmt->bindParam("password", $password); $stmt->bindParam("email", $email); $stmt->bindParam("title", $title); $stmt->bindParam("firstname", $firstname); $stmt->bindParam("middlename", $middlename); $stmt->bindParam("lastname", $lastname); $stmt->bindParam("nickname", $nickname); $stmt->bindParam("workphone", $workphone); $stmt->bindParam("cellphone", $cellphone);
<?php require_once '../inc/conf.php'; header('Content-Type: application/json; charset=utf-8'); header("Cache-Control: no-cache"); $id = $db->update('UPDATE ' . $_POST['type'] . ' SET ' . $_POST['previewField'] . '="' . $_POST['title'] . '"' . (isOk($_POST['guid']) ? ', guid="' . makeGUID($_POST['title']) . '"' : '') . 'WHERE id=' . $_POST['id']); echo json_encode(array('title' => $_POST['title']));
m.title AS title, m.image_id AS image, g.name AS game, g.guid as game_guid, t.name AS gametype, t.guid AS gametype_guid FROM map AS m JOIN game AS g ON m.game_id = g.id JOIN gametype AS t ON m.gametype_id = t.id WHERE m.status = 1 AND m.author_id = ' . $authorId . ' AND m.date < ' . time() . ' AND g.status = 1 AND t.status = 1 GROUP BY m.id ORDER BY m.date DESC'); foreach ($rs['result'] as $key => $item) { $tpl->assignLoopVar('moreMapFrom', array('id' => $item['id'], 'title' => encodeCurly($item['title']), 'game' => encodeCurly($item['game']), 'gametype' => encodeCurly($item['gametype']), 'image' => $item['image'], 'map_guid' => makeGUID($item['title']), 'game_guid' => $item['game_guid'], 'gametype_guid' => $item['gametype_guid'], 'class' => $key % 2 == 0 ? 'pair' : 'odd')); } } ///////////////////////// // MORE MAP GAME ///////////////////////// require 'bloc/moreMapGame.php'; ///////////////////////// // PAGE INFOS ///////////////////////// $tpl->assignVar(array('PAGE_TITLE' => encodeCurly($gameName . ' - ' . $mapTitle), 'PAGE_DESCRIPTION' => encodeCurly($mapTitle . ', a ' . $gametypeName . ' map for ' . $gameName . ', realised by ' . $authorName), 'PAGE_KEYWORDS' => encodeCurly($mapTitle . ', ' . $gameName . ', ' . $gametypeName . ', ' . $authorName . ', ' . implode(', ', $keywordList))));