public function __construct() { parent::__construct(); require_once RDIR . '/server/drivers/' . $this->driver . '.php'; $this->url = str_replace('server/freichat.php', '', $this->url); $this->frm_id = $_SESSION[$this->uid . 'usr_ses_id']; $this->frm_name = $_SESSION[$this->uid . 'usr_name']; $this->connectDB(); if ($this->debug == true) { error_reporting(-1); } }
function confirm_delete(id) { var answer = confirm("Sure you want to Delete?") if (answer){ //alert("Deleted!"); window.location="admin.php?freiload=chatrooms&do=delete&id="+id; } else{ alert("cancelled"); } } <?php require_once '../define.php'; $construct = new freichatXconstruct(); $db = $construct->connectDB(); //-----create room if (isset($_GET['do']) && $_GET['do'] == 'create') { if (isset($_POST['room_name'])) { if ($_POST['room_name'] == "" || $_POST['room_order'] == "") { echo "alert('Error: Fields cannot be left empty!');"; } else { $order = (int) $_POST['room_order']; $room_name = $_POST['room_name']; $room_name = htmlentities($room_name, ENT_QUOTES, "UTF-8"); $qry = "INSERT INTO frei_rooms(room_name,room_order) VALUES(" . $db->quote($room_name) . "," . $order . ")"; $result = $db->query($qry); echo "//{$qry}"; echo "\n alert('Chatroom was successfully created.');"; }
public function __construct() { parent::__construct(); }