function getOrderItem($order_id) { $sql = "SELECT *, qty * p.price as total_price FROM {PRE}order_item oi\n\t\t\t\tINNER JOIN {PRE}product p ON p.product_id = oi.product_id\n INNER JOIN {PRE}category c ON p.category_id = c.category_id\n\t\t\t\tINNER JOIN {PRE}order o ON o.order_id = oi.order_id\n\t\t\t\tWHERE oi.order_id={$order_id}"; $query = $this->db->query($sql); return checkRes($query); // $this->db->join('product', 'product.product_id = order_item.product_id'); // $query = $this->db->get_where('order_item',array('order_id'=> $order_id)); // return checkRes($query); }
function checkSlug($slug, $table) { $this->db->like('slug', slugify($slug)); $query = $this->db->get($table); if (checkRes($query)) { return $this->getLatestExistsSlug($slug, $table); } else { return slugify($slug); } }
function getAllUnit() { $query = $this->db->get('unit'); return checkRes($query); }
/** Get All User * @return boolean */ function getAllUser() { $query = $this->db->get("user"); return checkRes($query); }
header($_SERVER['SERVER_PROTOCOL'] . ' 551 DataExecError', true, 551); exit; } require "{$root}/utils/dbopen.php"; $res = pg_query("BEGIN"); checkRes($res, 552); $res = pg_query_params($conn, "SELECT linetrack_id FROM line WHERE owner_id = \$1 AND script_id = \$2 AND id = \$3", array($owner, $sid, $lid)); checkRes($res, 551); $linetrack = pg_fetch_row($res); $trackid = $linetrack[0]; $res = pg_query_params($conn, "DELETE FROM linetrack WHERE owner_id = \$1 AND script_id = \$2 AND id = \$3", array($owner, $sid, $trackid)); checkRes($res, 551); $res = pg_query_params($conn, "DELETE FROM line WHERE owner_id = \$1 AND script_id = \$2 AND id = \$3", array($owner, $sid, $lid)); checkRes($res, 551); $res = pg_query("COMMIT"); checkRes($res, 552); $path = $filestore . "/tracks/" . $owner . "/" . $sid . "/"; unlink($path . $trackid . ".wav"); unlink($path . $trackid . "s.wav"); include "{$root}/utils/resequence.php"; include "{$root}/utils/dbclose.php"; exit; } /* Update Line Text */ if (isset($_POST['txt']) && isset($_POST['sid']) && isset($_POST['lid'])) { $sid = preg_replace("/[^0-9]/", '', $_POST['sid']); $lid = preg_replace("/[^0-9]/", '', $_POST['lid']); $text = $_POST['txt']; // Validation? require "{$root}/utils/dbopen.php"; $res = pg_query_params($conn, "UPDATE line SET text = \$1 WHERE owner_id = \$2 AND script_id = \$3 AND id = \$4", array($text, $owner, $sid, $lid));
function getProductCat($category_id) { $query = $this->db->get_where('product', array('category_id' => $category_id)); return checkRes($query); }
<?php $res = pg_query_params($conn, "SELECT resequence(\$1,\$2);", array($sid, $owner)); checkRes($res, 553);
function getAllCategories() { $query = $this->db->get('category'); return checkRes($query); }
function getAllInfo() { $query = $this->db->get('info'); return checkRes($query); }