function get_user_grid() { $sortname = common::getVar('sidx', 'user_id'); $sortorder = common::getVar('sord', 'asc'); $sort = "ORDER BY {$sortname} {$sortorder}"; $searchField = common::getVar('searchField'); $searchValue = common::getVar('searchValue'); $con = 1; if ($searchField != '' && $searchValue != '') { $con .= " and {$searchField} like '%{$searchValue}%'"; } $sql = "select * from scic_result where {$con} {$sort}"; $page = common::getVar('page', 1); $limit = common::getVar('rows'); $count = sql::count("scic_result"); if ($count > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0; } if ($page > $total_pages) { $page = $total_pages; } if ($limit < 0) { $limit = 0; } $start = $limit * $page - $limit; if ($start < 0) { $start = 0; } $sql_query = $this->db->query($sql . " limit {$start}, {$limit}"); $rows = $sql_query->result_array(); $i = 0; $responce->page = $page; $responce->total = $total_pages; $responce->records = $count; foreach ($rows as $row) { $dat = sql::row("scic_skillset", "user_id=" . $row['user_id'], "fullname"); $notify = $row['notification'] == 1 ? 'Email Sent' : 'Pending'; $status = $row['test_status'] == 1 ? 'Complete' : 'Incomplete'; $responce->rows[$i]['id'] = $row['user_id']; $responce->rows[$i]['cell'] = array($row['email'], $dat['fullname'], $status, $notify); //$row['first_name'] . ' ' . $row['last_name'], $row['email'], $i++; } header("Expires: Sat, 17 Jul 2010 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); header("Author: Mohaimen khan"); header("Email: joyes528@gmail.com"); header("Content-type: text/x-json"); echo json_encode($responce); return ''; }
function get_shorturl_grid() { $sortname = common::getVar('sidx', 'id'); $sortorder = common::getVar('sord', 'desc'); $sort = "ORDER BY {$sortname} {$sortorder}"; $serachoption = '1 '; if ($this->session->userdata('purchase_search') != '') { $serachoption = $this->session->userdata('purchase_search'); //$this->session->unset_userdata('purchase_search'); } $sql = "select * from urls where " . $serachoption . $sort; $page = common::getVar('page', 1); $limit = common::getVar('rows'); $i = 0; $count = sql::count('urls', '1'); if ($count > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 5; } if ($page > $total_pages) { $page = $total_pages; } if ($limit < 0) { $limit = 0; } $start = $limit * $page - $limit; if ($start < 0) { $start = 0; } $sql_query = $this->db->query($sql . " limit {$start}, {$limit}"); $rows = $sql_query->result_array(); $responce->page = $page; $responce->total = $total_pages; $responce->records = $count; foreach ($rows as $row) { $surl = "guit.biz/" . $row['shortcode']; $responce->rows[$i]['id'] = $row['id']; $responce->rows[$i]['cell'] = array($row['shortcode'], $surl, $row['url'], $row['ga_campaign'], $row['ga_adgroup'], $row['ga_ad_content'], $row['ga_keyword']); $i++; } header("Expires: Sat, 17 Jul 2010 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); header("Author:Mohaimen khan"); header("Email: joyes@sec.ac.bd"); header("Content-type: text/x-json"); echo json_encode($responce); return ''; }
function get_member_form_list() { //$sortname = common::getVar('sidx', 'id'); //$sortorder = common::getVar('sord', 'asc'); //$sort = "ORDER BY $sortname $sortorder"; $sql = "select * from user where user_type=1"; $page = common::getVar('page', 1); $limit = common::getVar('rows'); $i = 0; $tmp = $this->db->query($sql); $count = count($tmp->result_array()); if ($count > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 5; } if ($page > $total_pages) { $page = $total_pages; } if ($limit < 0) { $limit = 0; } $start = $limit * $page - $limit; if ($start < 0) { $start = 0; } $sql_query = $this->db->query($sql . " limit {$start}, {$limit}"); $rows = $sql_query->result_array(); $responce->page = $page; $responce->total = $total_pages; $responce->records = $count; foreach ($rows as $row) { if ($row['status'] == 1) { $status = 'Active'; } else { $status = 'Inactive'; } $responce->rows[$i]['id'] = $row['id']; $responce->rows[$i]['cell'] = array($row['name'], $row['birthdate'], $row['username'], $row['present_address'], $row['phone'], $row['email'], $status); $i++; } header("Expires: Sat, 17 Jul 2010 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); header("Author: Md. Forhadur Rahman"); header("Email: forhad271@gmail.com"); header("Content-type: text/x-json"); echo json_encode($responce); return ''; }
function get_categoryGrid() { $sql = "select * from category"; $page = common::getVar('page', 1); $limit = common::getVar('rows'); $i = 0; $tmp = $this->db->query($sql); $count = count($tmp->result_array()); if ($count > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 5; } if ($page > $total_pages) { $page = $total_pages; } if ($limit < 0) { $limit = 0; } $start = $limit * $page - $limit; if ($start < 0) { $start = 0; } $sql_query = $this->db->query($sql . " limit {$start}, {$limit}"); $rows = $sql_query->result_array(); $responce->page = $page; $responce->total = $total_pages; $responce->records = $count; foreach ($rows as $row) { $desc = $this->word_limiter(trim(strip_tags($row['description'])), 5); $responce->rows[$i]['cat_id'] = $row['cat_id']; if ($row['status'] == 1) { $status = 'Active'; } else { $status = 'Inactive'; } $responce->rows[$i]['cell'] = array($row['cat_name'], $desc, $status); $i++; } header("Expires: Sat, 17 Jul 2010 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); header("Author: Md. Anwar Hossain"); header("Email: anwarworld@gmail.com"); header("Content-type: text/x-json"); echo json_encode($responce); return ''; }
function get_advertise_form_list_1() { $sql = "select * from advertise"; $page = common::getVar('page', 1); $limit = common::getVar('rows'); $i = 0; $tmp = $this->db->query($sql); $count = count($tmp->result_array()); if ($count > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 5; } if ($page > $total_pages) { $page = $total_pages; } if ($limit < 0) { $limit = 0; } $start = $limit * $page - $limit; if ($start < 0) { $start = 0; } $sql_query = $this->db->query($sql . " limit {$start}, {$limit}"); $rows = $sql_query->result_array(); $responce->page = $page; $responce->total = $total_pages; $responce->records = $count; foreach ($rows as $row) { if ($row['status'] == 1) { $status = 'Active'; } else { $status = 'Inactive'; } $responce->rows[$i]['add_id'] = $row['add_id']; $responce->rows[$i]['cell'] = array($row['company_name'], $row['description'], $row['dead_line'], $row['url'], $status); $i++; } header("Expires: Sat, 17 Jul 2010 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); header("Author: Md. Forhadur Rahman"); header("Email: forhad271@gmail.com"); header("Content-type: text/x-json"); echo json_encode($responce); return ''; }
function get_question_grid() { $sortname = common::getVar('sidx', 'id'); $sortorder = common::getVar('sord', 'desc'); $sort = " ORDER BY {$sortname} {$sortorder}"; $searchField = $_REQUEST['searchField']; //common::getVar('searchField'); //$searchValue = common::getVar('searchValue'); $con = 1; if ($searchField != '0' && $searchField != '') { $searchField = $searchField - 1; $con .= " and type = {$searchField} "; } $sql = "select * from scic_question where " . $con . $sort; $page = common::getVar('page', 1); $limit = common::getVar('rows'); $i = 0; $count = sql::count('scic_question', '1'); if ($count > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 5; } if ($page > $total_pages) { $page = $total_pages; } if ($limit < 0) { $limit = 0; } $start = $limit * $page - $limit; if ($start < 0) { $start = 0; } $sql_query = $this->db->query($sql . " limit {$start}, {$limit}"); $rows = $sql_query->result_array(); $responce->page = $page; $responce->total = $total_pages; $responce->records = $count; foreach ($rows as $row) { if ($row['type'] == 0) { $label = "General"; } else { if ($row['type'] == 1) { $label = "First Part"; } else { if ($row['type'] == 2) { $label = "Second part"; } else { if ($row['type'] == 3) { $label = "Third part"; } else { $label = "None"; } } } } $responce->rows[$i]['id'] = $row['id']; $responce->rows[$i]['cell'] = array($row['texts'], $label, $row['status']); $i++; } header("Expires: Sat, 17 Jul 2010 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); header("Author:Mohaimen khan"); header("Email: joyes@sec.ac.bd"); header("Content-type: text/x-json"); echo json_encode($responce); return ''; }