include_once "../ip-config.php"; require_once '../jq-config.php'; // include the jqGrid Class require_once ABSPATH . "php/jqGrid.php"; // include the driver class require_once ABSPATH . "php/jqGridPdo.php"; // Connection to the server $conn = new PDO(DB_DSN, DB_USER, DB_PASSWORD); // Tell the db that we use utf-8 $conn->query("SET NAMES utf8"); $rowid = jqGridUtils::Strip($_REQUEST["rowid"]); if (!$rowid) { die("Missed parameters"); } // Get details $SQL = "SELECT notes FROM project, priority, status WHERE id =" . (int) $rowid; $qres = jqGridDB::query($conn, $SQL); $result = jqGridDB::fetch_assoc($qres, $conn); $s = "<table width='60%' align='left'><tbody>"; $s .= "<tr><td width='15%'><b>Notes</b></td><td width='85%'>" . $result["notes"] . "</td></tr>"; $s .= "<tr><td width='15%'><b> </b></td><td width='85%'> </td></tr>"; $s .= "<tr><td width='15%'><b>Priority</b></td><td width='85%'>" . $result["priority"] . "</td></tr>"; $s .= "<tr><td width='15%'><b> </b></td><td width='85%'> </td></tr>"; $s .= "<tr><td width='15%'><b>Status</b></td><td width='85%'>" . $result["status"] . "</td></tr>"; $s .= "<tr><td width='15%'><b> </b></td><td width='85%'> </td></tr>"; $s .= "</tbody></table>"; echo $s; jqGridDB::closeCursor($qres); ?>
public function getEvents($start, $end) { if (!empty($this->user_id) && !empty($this->table)) { $sql = "SELECT "; $i = 0; foreach ($this->dbmap as $k => $v) { $sql .= $i == 0 ? $k . ' AS ' . $v : ', ' . $k . ' AS ' . $v; $i++; } if (strlen($this->searchwhere) > 0) { $sql .= ' FROM ' . $this->table . ' WHERE ' . $this->searchwhere . ' AND (user_id = ?) ORDER BY start DESC'; $params = $this->searchdata; $params[] = (int) $this->user_id; } else { $sql .= ' FROM ' . $this->table . ' WHERE user_id = ? AND start >= ? AND start <= ? ORDER BY start'; $params = array((int) $this->user_id, (int) $start, (int) $end); } $query = jqGridDB::prepare($this->db, $sql, $params); $ret = jqGridDB::execute($query); $ev = array(); while ($row = jqGridDB::fetch_assoc($query, $this->db)) { $row[$this->dbmap['all_day']] = $row[$this->dbmap['all_day']] == 1 ? true : false; $ev[] = $row; } jqGridDB::closeCursor($query); return $ev; } else { return false; } }
public function getEvents($start, $end) { if (!empty($this->user_id) && !empty($this->table)) { $sql = "SELECT "; $i = 0; foreach ($this->dbmap as $k => $v) { $sql .= $i == 0 ? $k . ' AS ' . $v : ', ' . $k . ' AS ' . $v; $i++; } $sql .= ' FROM ' . $this->table . ' WHERE '; if ($this->wherecond && strlen($this->wherecond) > 0) { $pos = stripos($this->wherecond, 'where'); if ($pos !== false) { $this->wherecond = substr_replace($this->wherecond, "", $pos, 5); } $sql .= $this->wherecond . ' AND '; } $sqluser = "******"; if (is_array($this->user_id)) { foreach ($this->user_id as $k => $v) { if ($k != 0) { $sqluser .= " OR user_id = ? "; } else { $sqluser .= " user_id = ? "; } } } else { $sqluser .= " user_id = ? "; } $sqluser .= ")"; if (strlen($this->searchwhere) > 0) { $sql .= $this->searchwhere . ' AND ' . $sqluser . ' ORDER BY start DESC'; $params = $this->whereparams; foreach ($this->searchdata as $k => $v) { $params[] = $v; } //$params[] if (is_array($this->user_id)) { foreach ($this->user_id as $k => $v) { $params[] = $v; } } else { $params[] = $this->user_id; } } else { $sql .= $sqluser . ' AND start >= ? AND start <= ? ORDER BY start'; $params = $this->whereparams; //$params[] if (is_array($this->user_id)) { foreach ($this->user_id as $k => $v) { $params[] = $v; } } else { $params[] = $this->user_id; } $params[] = (int) $start; $params[] = (int) $end; } $query = jqGridDB::prepare($this->db, $sql, $params); $ret = jqGridDB::execute($query, $params); $ev = array(); while ($row = jqGridDB::fetch_assoc($query, $this->db)) { $row[$this->dbmap['all_day']] = $row[$this->dbmap['all_day']] == 1 ? true : false; $ev[] = $row; } jqGridDB::closeCursor($query); return $ev; } else { return false; } }