Пример #1
0
function explodeinfo($info, $item)
{
    if (!is_array($item)) {
        $item = explodeopts($item);
    }
    $ln = explode("\n", preg_replace('/\\r/', '', $info));
    $n = 0;
    $result = array();
    while ($a = array_shift($ln)) {
        $lab = $item[$n];
        if (preg_match("/^" . str_replace("/", '\\/', quotemeta($lab)) . ": (.*)\$/", $a, $m)) {
            $v = isset($m[1]) ? $m[1] : "";
            if ($m[1] == "\\") {
                $v = "";
                $x = "/^" . (isset($item[$n + 1]) ? quotemeta($item[$n + 1]) : "\n") . ": /";
                while (count($ln) && !preg_match($x, $ln[0])) {
                    $a = array_shift($ln);
                    $v .= $v ? "\n{$a}" : $a;
                }
            }
            $result[$lab] = "{$v}";
        } else {
            global $xoopsConfig;
            if (isset($xoopsConfig['debug']) && $xoopsConfig['debug']) {
                echo "<span class='error'>" . $item[$n] . ",{$a}</span>";
            }
            break;
        }
        $n++;
    }
    return $result;
}
Пример #2
0
function search_font($str, $stx, $tag_open = '<code>', $tag_close = '</code>')
{
    if ($str == '') {
        return FALSE;
    }
    if ($stx != '') {
        // 문자앞에 \ 를 붙인다.
        $src = array('/', '|');
        $dst = array('\\/', '\\|');
        if (!trim($stx)) {
            return $str;
        }
        // 검색어 전체를 공란으로 나눈다
        $s = explode(' ', $stx);
        // '/(검색1|검색2)/i' 와 같은 패턴을 만듬
        $pattern = '';
        $bar = '';
        foreach ($s as $row) {
            if (trim($row) == '') {
                continue;
            }
            $tmp_str = str_replace($src, $dst, quotemeta($row));
            $pattern .= $bar . $tmp_str . '(?![^<]*>)';
            $bar = '|';
        }
        return preg_replace('/(' . $pattern . ')/i', $tag_open . '\\1' . $tag_close, $str);
        // 기존
        // return preg_replace('/('.preg_quote($stx, '/').')/i', $tag_open."\\1".$tag_close, $str);
    }
    return $str;
}
Пример #3
0
 function index()
 {
     $this->mongo_db->select_db("Users");
     $this->mongo_db->select_collection("Account");
     $sSearch = (string) trim("@");
     $sSearch = quotemeta($sSearch);
     $regex = "/{$sSearch}/i";
     $filter = $this->mongo_db->regex($regex);
     $pencarian = array('email' => $filter);
     $datapage['datalist'] = $this->mongo_db->find($pencarian, 0, 0, array('email' => 1));
     $datapage['tagcontent'] = $this->tambahan_fungsi->global_get_random(15);
     $css = array(base_url() . "resources/css/jqueryui.css", base_url() . "resources/plugin/codeprettifier/prettify.css", base_url() . "resources/plugin/form-toggle/toggles.css", base_url() . "resources/plugin/pines-notify/jquery.pnotify.default.css", base_url() . "resources/plugin/bootstrap3-dialog-master/bootstrap-dialog.css", base_url() . "resources/plugin/form-select2/select2.css", base_url() . "resources/plugin/form-multiselect/css/multi-select.css");
     $js = array(base_url() . "resources/plugin/jquery-validation-1.10.0/lib/jquery.metadata.js", base_url() . "resources/plugin/jquery-validation-1.10.0/dist/jquery.validate.js", base_url() . "resources/plugin/bootstrap3-dialog-master/bootstrap-dialog.js", base_url() . "resources/plugin/pines-notify/jquery.pnotify.min.js", base_url() . "resources/plugin/form-multiselect/js/jquery.multi-select.min.js", base_url() . "resources/plugin/quicksearch/jquery.quicksearch.min.js", base_url() . "resources/plugin/form-typeahead/typeahead.min.js", base_url() . "resources/plugin/form-select2/select2.min.js", base_url() . "resources/plugin/form-autosize/jquery.autosize-min.js");
     $this->template_admin->header_web(TRUE, "Broadcast Email", $css, $js, TRUE, "");
     $this->template_admin->headerbar();
     $this->template_admin->top_menu(TRUE);
     $this->load->view("panel/panel_utama");
     $this->template_admin->panel_menu();
     $this->load->view("panel/panel_content");
     $this->load->view("panel/panel_wrap");
     $this->load->view("sendemail_view", $datapage);
     $this->load->view("panel/close_div");
     $this->load->view("panel/close_div");
     $this->template_admin->addresbar();
     $this->load->view("panel/close_div");
     $this->template_admin->footer();
 }
Пример #4
0
 public function export(TableInterface $table, $toDirectory, $baseFileName = null)
 {
     if ($baseFileName === null) {
         $baseFileName = $table->getName() . '-structure.sql';
     }
     exec($this->mysqlDumpPath . 'mysqldump -u' . $this->username . ' -p' . quotemeta($this->password) . ' ' . $this->database . ' ' . $table . ' --no-data --create-options --disable-keys --lock-tables --skip-add-drop-table --skip-comments  > "' . $toDirectory . '/' . $baseFileName . '"');
 }
Пример #5
0
 function people($start = 0)
 {
     $keysearch = isset($_GET['keysearch']) ? $_GET['keysearch'] : "";
     $output['success'] = FALSE;
     $ceklogin = $this->cek_session->islogin();
     $output['logged_in'] = $ceklogin;
     $output['follow'] = FALSE;
     $output['message'] = "No user found";
     if ($ceklogin) {
         $this->mongo_db->select_db("Users");
         $this->mongo_db->select_collection("Properties");
         $pencarian = array();
         if ($keysearch != "") {
             $sSearch = (string) trim($keysearch);
             $sSearch = quotemeta($sSearch);
             $regex = "/{$sSearch}/i";
             $filter = $this->mongo_db->regex($regex);
             $pencarian = array('fullname' => $filter);
         }
         $tempdata = $this->mongo_db->find($pencarian, (int) $start, 100, array('join_date' => 1));
         $output['count'] = (int) $this->mongo_db->count2($pencarian);
         if ($tempdata) {
             $output['success'] = TRUE;
             $listdata = array();
             foreach ($tempdata as $dt) {
                 $tempdtuser = $this->m_userdata->user_account_byid($dt["lilo_id"]);
                 $listdata[] = array("_id" => $dt['lilo_id'], "avatarname" => $dt['avatarname'], "fullname" => $dt['fullname'], "picture" => $dt['picture'], "email" => $tempdtuser['email'], "username" => $tempdtuser['username'], "fb_id" => $tempdtuser['username'], "twitter_id" => $tempdtuser['username']);
             }
             $output['data'] = $listdata;
         }
     }
     echo json_encode($output);
 }
Пример #6
0
/**
 * @param string $from
 * @param string $to
 * @param bool   $show_comments
 * @return string
 */
function generateApacheRewrite($from, $to, $show_comments)
{
    $parsedFrom = parse_url(trim($from));
    $parsedTo = parse_url(trim($to));
    $line_output = "";
    if ($show_comments) {
        $line_output .= PHP_EOL . '# ' . $_POST['type'] . ' --- ' . $from . ' => ' . $to . PHP_EOL;
    }
    if ($parsedFrom['host'] != $parsedTo['host']) {
        $line_output .= 'RewriteCond %{HTTP_HOST} ^' . quotemeta($parsedFrom['host']) . '$';
        $line_output .= PHP_EOL;
        $prefix = $parsedTo['scheme'] . '://' . $parsedTo['host'] . '/';
    } else {
        $prefix = '/';
    }
    $explodedQuery = explode('&', $parsedFrom['query']);
    foreach ($explodedQuery as $qs) {
        if (strlen($qs) > 0) {
            $line_output .= 'RewriteCond %{QUERY_STRING} (^|&)' . quotemeta($qs) . '($|&)';
            $line_output .= PHP_EOL;
        }
    }
    $line_output .= 'RewriteRule ^' . quotemeta(ltrim($parsedFrom['path'], '/')) . '$ ' . $prefix . ltrim($parsedTo['path'], '/') . '?' . $parsedTo['query'] . ($_POST['type'] == 'Rewrite' ? '&%{QUERY_STRING}' : ' [L,R=301]');
    $line_output .= PHP_EOL;
    return $line_output;
}
Пример #7
0
 function pattern_output()
 {
     $subpattern_array = array('/%title%/', '/%date%/', '/%link%/', '/%excerpt(\\d*)%/');
     $var_array = array(quotemeta($this->ptitle), $this->datum, $this->plink, $this->excerpt);
     $r = preg_replace($subpattern_array, $var_array, $this->pattern);
     return stripslashes($r);
 }
Пример #8
0
function replace_smileys($text, $calledfrom = 'root')
{
    if ($calledfrom == 'admin') {
        $prefix = '.';
        $prefix2 = '../';
    } else {
        $prefix = '';
        $prefix2 = '';
    }
    $filepath = $prefix . "./images/smileys/";
    unset($files);
    if ($dh = opendir($filepath)) {
        while ($file = readdir($dh)) {
            if (preg_match("/\\.gif/si", $file)) {
                $files[] = $file;
            }
        }
    }
    $replacements_1 = array();
    $replacements_2 = array();
    foreach ($files as $file) {
        $smiley = explode(".", $file);
        $replacements_1[] = ':' . quotemeta($smiley[0]) . ':';
        $replacements_2[] = '[SMILE=smile]' . $prefix2 . 'images/smileys/' . $file . '[/SMILE]';
    }
    $ergebnis = safe_query("SELECT * FROM `" . PREFIX . "smileys`");
    while ($ds = mysql_fetch_array($ergebnis)) {
        $replacements_1[] = $ds['pattern'];
        $replacements_2[] = '[SMILE=' . $ds['alt'] . ']' . $prefix2 . 'images/smileys/' . $ds['name'] . '[/SMILE]';
    }
    $text = strtr($text, array_combine($replacements_1, $replacements_2));
    return $text;
}
Пример #9
0
 /**
  * @ignore
  */
 public static function fromFileScan($uPattern)
 {
     $tSep = quotemeta(DIRECTORY_SEPARATOR);
     $tPos = strrpos($uPattern, $tSep);
     if ($tSep !== '/' && $tPos === false) {
         $tSep = '/';
         $tPos = strrpos($uPattern, $tSep);
     }
     if ($tPos !== false) {
         $tPattern = substr($uPattern, $tPos + strlen($tSep));
         $tPath = substr($uPattern, 0, $tPos + strlen($tSep));
     } else {
         $tPath = $uPattern;
         $tPattern = "";
     }
     $tTemp = new static();
     $tHandle = new \DirectoryIterator($tPath);
     $tPatExists = strlen($uPattern) > 0;
     for (; $tHandle->valid(); $tHandle->next()) {
         if (!$tHandle->isFile()) {
             continue;
         }
         $tFile = $tHandle->current();
         if ($tPatExists && !fnmatch($tPattern, $tFile)) {
             continue;
         }
         $tTemp->add(simplexml_load_file($tPath . $tFile));
     }
     return $tTemp;
 }
Пример #10
0
 function list_data()
 {
     $this->mongo_db->select_db("Users");
     $this->mongo_db->select_collection("Account");
     $awal = isset($_GET['iDisplayStart']) ? (int) $_GET['iDisplayStart'] : 0;
     $limit = isset($_GET['iDisplayLength']) ? (int) $_GET['iDisplayLength'] : 10;
     $sEcho = isset($_GET['sEcho']) ? (int) $_GET['sEcho'] : 1;
     $sSearch = isset($_GET['sSearch']) ? $_GET['sSearch'] : "";
     $sSortDir_0 = isset($_GET['sSortDir_0']) ? $_GET['sSortDir_0'] : "asc";
     $pencarian = array();
     if ($sSearch != "") {
         $sSearch = (string) trim($sSearch);
         $sSearch = quotemeta($sSearch);
         $regex = "/{$sSearch}/i";
         $filter = $this->mongo_db->regex($regex);
         $pencarian = array('username' => $filter);
     }
     $data = $this->mongo_db->find($pencarian, $awal, $limit, array('username' => 1));
     $output = array("sEcho" => intval($sEcho), "iTotalRecords" => $this->mongo_db->count($pencarian), "iTotalDisplayRecords" => $this->mongo_db->count($pencarian), "aaData" => array());
     $i = $awal + 1;
     foreach ($data as $dt) {
         $actionmenu = $this->template_icon->detail_onclick("getdatauserval('" . $dt['_id'] . "')", "", 'Set Value', "bullet_go.png", "", "linkdetail");
         $output['aaData'][] = array($i, $dt['username'], $dt['email'], $actionmenu);
         $i++;
     }
     if (IS_AJAX) {
         echo json_encode($output);
     } else {
         redirect($this->session->userdata('urlsebelumnya'));
     }
 }
Пример #11
0
 function list_data()
 {
     $this->mongo_db->select_db("Game");
     $this->mongo_db->select_collection("DialogStory");
     $awal = isset($_GET['iDisplayStart']) ? (int) $_GET['iDisplayStart'] : 0;
     $limit = isset($_GET['iDisplayLength']) ? (int) $_GET['iDisplayLength'] : 10;
     $sEcho = isset($_GET['sEcho']) ? (int) $_GET['sEcho'] : 1;
     $sSortDir_0 = isset($_GET['sSortDir_0']) ? $_GET['sSortDir_0'] : "desc";
     $iSortCol_0 = isset($_GET['iSortCol_0']) ? (int) $_GET['iSortCol_0'] : 0;
     $jns_sorting = -1;
     if ($sSortDir_0 == "asc") {
         $jns_sorting = 1;
     }
     $keysearchdt = "name";
     if ($iSortCol_0 == 1) {
         $keysearchdt = "name";
     } else {
         if ($iSortCol_0 == 2) {
             $keysearchdt = "description";
         }
     }
     $sSearch = isset($_GET['sSearch']) ? $_GET['sSearch'] : "";
     $pencarian = array();
     if ($sSearch != "") {
         $sSearch = (string) trim($sSearch);
         $sSearch = quotemeta($sSearch);
         $regex = "/{$sSearch}/i";
         $filter = $this->mongo_db->regex($regex);
         $pencarian = array($keysearchdt => $filter);
     }
     $data = $this->mongo_db->find($pencarian, $awal, $limit, array($keysearchdt => $jns_sorting));
     $output = array("sEcho" => intval($sEcho), "iTotalRecords" => $this->mongo_db->count($pencarian), "iTotalDisplayRecords" => $this->mongo_db->count($pencarian), "aaData" => array());
     $i = $awal + 1;
     foreach ($data as $dt) {
         $import = "";
         $copy = "";
         $detail = "";
         $delete = "";
         if ($this->m_checking->actions("Dialogs", "module5", "Export", TRUE, FALSE, "home")) {
             $import = $this->template_icon->link_icon3("quest/dialog/export/" . $dt['_id'], "Import", "database_go.png", "target=\"_blank\" class=\"linkdetail\" ");
         }
         if ($this->m_checking->actions("Dialogs", "module5", "Duplicate", TRUE, FALSE, "home")) {
             $copy = $this->template_icon->detail_onclick("duplikat('" . $dt['_id'] . "')", "", 'Create Duplicat', "application_side_contract.png", "", "linkdetail");
         }
         if ($this->m_checking->actions("Dialogs", "module5", "Edit", TRUE, FALSE, "home")) {
             $detail = $this->template_icon->detail_onclick("ubahdata('" . $dt['_id'] . "')", "#editdata", 'Edit', "pencil.png", "", "", "data-toggle='modal'");
         }
         if ($this->m_checking->actions("Dialogs", "module5", "Delete", TRUE, FALSE, "home")) {
             $delete = $this->template_icon->detail_onclick("hapusdata('" . $dt['_id'] . "','Are you sure want to delete Dialog with name " . $dt['name'] . "')", "", 'Delete', "delete.png", "", "linkdelete");
         }
         $output['aaData'][] = array($i, "<label><input type='checkbox' name='id_export[]' value='" . (string) $dt['_id'] . "'/></label>", $dt['name'], $dt['description'], $import . $copy . $detail . $delete);
         $i++;
     }
     if (IS_AJAX) {
         echo json_encode($output);
     } else {
         redirect('quest/dialog/index');
     }
 }
Пример #12
0
 function list_data()
 {
     $this->mongo_db->select_db("Logs");
     $this->mongo_db->select_collection("logActivities");
     $awal = isset($_GET['iDisplayStart']) ? (int) $_GET['iDisplayStart'] : 0;
     $limit = isset($_GET['iDisplayLength']) ? (int) $_GET['iDisplayLength'] : 10;
     $sEcho = isset($_GET['sEcho']) ? (int) $_GET['sEcho'] : 1;
     $sSortDir_0 = isset($_GET['sSortDir_0']) ? $_GET['sSortDir_0'] : "desc";
     $iSortCol_0 = isset($_GET['iSortCol_0']) ? (int) $_GET['iSortCol_0'] : 0;
     $jns_sorting = -1;
     if ($sSortDir_0 == "asc") {
         $jns_sorting = 1;
     }
     $keysearchdt = "datetime";
     if ($iSortCol_0 == 1) {
         $keysearchdt = "user";
     } else {
         if ($iSortCol_0 == 2) {
             $keysearchdt = "url";
         } else {
             if ($iSortCol_0 == 3) {
                 $keysearchdt = "datetime";
             } else {
                 if ($iSortCol_0 == 4) {
                     $keysearchdt = "action";
                 }
             }
         }
     }
     $sSearch = isset($_GET['sSearch']) ? $_GET['sSearch'] : "";
     $pencarian = array();
     if ($sSearch != "") {
         $sSearch = (string) trim($sSearch);
         $sSearch = quotemeta($sSearch);
         $regex = "/{$sSearch}/i";
         $filter = $this->mongo_db->regex($regex);
         $pencarian = array($keysearchdt => $filter);
     }
     $data = $this->mongo_db->find($pencarian, $awal, $limit, array($keysearchdt => $jns_sorting));
     $output = array("sEcho" => intval($sEcho), "iTotalRecords" => $this->mongo_db->count($pencarian), "iTotalDisplayRecords" => $this->mongo_db->count($pencarian), "aaData" => array());
     $i = $awal + 1;
     foreach ($data as $dt) {
         $tgl = "";
         if ($dt['datetime'] != "") {
             $tgl = date('Y-m-d H:i:s', $dt['datetime']->sec);
         }
         $delete = "";
         if ($this->m_checking->actions("User Logs", "module11", "Delete", TRUE, FALSE, "home")) {
             $delete = $this->template_icon->detail_onclick("hapusdata('" . $dt['_id'] . "','Are you sure want to delete Log " . $dt['user'] . "')", "", 'Delete', "delete.png", "", "linkdelete");
         }
         $output['aaData'][] = array($i, $dt['user'], $dt['url'], $tgl, $dt['action'], $delete);
         $i++;
     }
     if (IS_AJAX) {
         echo json_encode($output);
     } else {
         redirect('weblog/index');
     }
 }
Пример #13
0
 function list_data()
 {
     $this->mongo_db->select_db("Assets");
     $this->mongo_db->select_collection("Redeem");
     $awal = isset($_GET['iDisplayStart']) ? (int) $_GET['iDisplayStart'] : 0;
     $limit = isset($_GET['iDisplayLength']) ? (int) $_GET['iDisplayLength'] : 10;
     $sEcho = isset($_GET['sEcho']) ? (int) $_GET['sEcho'] : 1;
     $sSortDir_0 = isset($_GET['sSortDir_0']) ? $_GET['sSortDir_0'] : "desc";
     $iSortCol_0 = isset($_GET['iSortCol_0']) ? (int) $_GET['iSortCol_0'] : 0;
     $jns_sorting = -1;
     if ($sSortDir_0 == "asc") {
         $jns_sorting = 1;
     }
     $keysearchdt = "create";
     if ($iSortCol_0 == 1) {
         $keysearchdt = "code";
     } else {
         if ($iSortCol_0 == 2) {
             $keysearchdt = "name";
         } else {
             if ($iSortCol_0 == 3) {
                 $keysearchdt = "count";
             }
         }
     }
     $sSearch = isset($_GET['sSearch']) ? $_GET['sSearch'] : "";
     $pencarian = array();
     if ($sSearch != "") {
         $sSearch = (string) trim($sSearch);
         $sSearch = quotemeta($sSearch);
         $regex = "/{$sSearch}/i";
         $filter = $this->mongo_db->regex($regex);
         $pencarian = array($keysearchdt => $filter);
     }
     $data = $this->mongo_db->find($pencarian, $awal, $limit, array('create' => $jns_sorting));
     $output = array("sEcho" => intval($sEcho), "iTotalRecords" => $this->mongo_db->count($pencarian), "iTotalDisplayRecords" => $this->mongo_db->count($pencarian), "aaData" => array());
     $i = $awal + 1;
     foreach ($data as $dt) {
         $tglexpire = "";
         if ($dt['expire'] != "") {
             $tglexpire = date('Y-m-d', $dt['expire']->sec);
         }
         $detail = "";
         $delete = "";
         if ($this->m_checking->actions("Redeem Code", "module5", "Delete", TRUE, FALSE, "home")) {
             $delete = $this->template_icon->detail_onclick("hapusdata('" . $dt['_id'] . "','Are you sure want to delete Redeem code " . $dt['code'] . "')", "", 'Delete', "delete.png", "", "linkdelete");
         }
         if ($this->m_checking->actions("Redeem Code", "module5", "Edit", TRUE, FALSE, "home")) {
             $detail = $this->template_icon->detail_onclick("ubahdata('" . $dt['_id'] . "','" . $dt['code'] . "','" . $dt['name'] . "','" . $dt['count'] . "','" . $tglexpire . "')", "#editdata", 'Edit', "pencil.png", "", "", "data-toggle='modal'");
         }
         $output['aaData'][] = array($i, $dt['code'], $dt['name'], $dt['count'], $tglexpire, date('Y-m-d', $dt['create']->sec), $detail . $delete);
         $i++;
     }
     if (IS_AJAX) {
         echo json_encode($output);
     } else {
         redirect('redimcode/index');
     }
 }
Пример #14
0
 function list_data()
 {
     $this->mongo_db->select_db("Users");
     $this->mongo_db->select_collection("Account");
     $awal = isset($_GET['iDisplayStart']) ? (int) $_GET['iDisplayStart'] : 0;
     $limit = isset($_GET['iDisplayLength']) ? (int) $_GET['iDisplayLength'] : 10;
     $sEcho = isset($_GET['sEcho']) ? (int) $_GET['sEcho'] : 1;
     $sSearch = isset($_GET['sSearch']) ? $_GET['sSearch'] : "";
     $sSortDir_0 = isset($_GET['sSortDir_0']) ? $_GET['sSortDir_0'] : "asc";
     $pencarian = array();
     if ($sSearch != "") {
         $sSearch = (string) trim($sSearch);
         $sSearch = quotemeta($sSearch);
         $regex = "/{$sSearch}/i";
         $filter = $this->mongo_db->regex($regex);
         $pencarian = array('username' => $filter);
     }
     $data = $this->mongo_db->find($pencarian, $awal, $limit, array('username' => 1));
     $output = array("sEcho" => intval($sEcho), "iTotalRecords" => $this->mongo_db->count($pencarian), "iTotalDisplayRecords" => $this->mongo_db->count($pencarian), "aaData" => array());
     $i = $awal + 1;
     foreach ($data as $dt) {
         $delete = "";
         $priview = "";
         if ($this->m_checking->actions("User Akses", "module2", "Delete", TRUE, FALSE, "home")) {
             $delete = $this->template_icon->detail_onclick("hapusdata('" . $dt['_id'] . "','Are you sure want to delete User Access " . $dt['username'] . "')", "", 'Revoke User Access', "group_delete.png", "", "linkdelete");
         }
         if ($this->m_checking->actions("User Akses", "module2", "Edit", TRUE, FALSE, "home")) {
             $priview = $this->template_icon->detail_onclick("lihatdetail('" . $dt['_id'] . "','" . (isset($dt['access']) ? $dt['access'] : '') . "','" . (isset($dt['brand_id']) ? $dt['brand_id'] : '') . "')", "#editdata", 'Edit', "group_edit.png", "", "", "data-toggle='modal'");
         }
         $group = "";
         $brand = "";
         if (isset($dt['access'])) {
             $this->mongo_db->select_db("Game");
             $this->mongo_db->select_collection("Group");
             $checkdata = $this->mongo_db->findOne(array('Code' => $dt['access']));
             if ($checkdata) {
                 $group = $checkdata['Name'];
             }
         }
         if (isset($dt['brand_id'])) {
             $this->mongo_db->select_db("Assets");
             $this->mongo_db->select_collection("Brand");
             $checkdata = $this->mongo_db->findOne(array('brand_id' => $dt['brand_id']));
             if ($checkdata) {
                 $brand = $checkdata['name'];
             } else {
                 $brand = $dt['brand_id'];
             }
         }
         $tempdtuser = $this->m_userdata->user_properties((string) $dt["_id"]);
         $output['aaData'][] = array($i, $tempdtuser["fullname"], $tempdtuser["handphone"], $dt['username'], $dt['email'], $group, $brand, $priview . $delete);
         $i++;
     }
     if (IS_AJAX) {
         echo json_encode($output);
     } else {
         redirect('management/user/index');
     }
 }
Пример #15
0
/**
 * @param string $fileName
 * @param array  $rules
 *
 * @return bool
 */
function insertRules($fileName, array $rules = [])
{
    $startTag = '/*INSERT_START*/';
    $endTag = '/*INSERT_END*/';
    $content = file_get_contents($fileName);
    $content = preg_replace($regexp = sprintf('#%s(.*)%s#s', quotemeta($startTag), quotemeta($endTag)), $startTag . var_export($rules, true) . $endTag, $content);
    return false !== file_put_contents($fileName, $content);
}
Пример #16
0
 public function Replace($String)
 {
     foreach ($this->Codes as $BBCode => $Value) {
         $String = eregi_replace(quotemeta($BBCode), quotemeta($Value), $String);
         $String = str_replace("\\.", ".", $String);
     }
     return $String;
 }
Пример #17
0
 function list_data()
 {
     $this->mongo_db->select_db("Assets");
     $this->mongo_db->select_collection("Color");
     $awal = isset($_GET['iDisplayStart']) ? (int) $_GET['iDisplayStart'] : 0;
     $limit = isset($_GET['iDisplayLength']) ? (int) $_GET['iDisplayLength'] : 10;
     $sEcho = isset($_GET['sEcho']) ? (int) $_GET['sEcho'] : 1;
     $sSortDir_0 = isset($_GET['sSortDir_0']) ? $_GET['sSortDir_0'] : "desc";
     $iSortCol_0 = isset($_GET['iSortCol_0']) ? (int) $_GET['iSortCol_0'] : 0;
     $jns_sorting = -1;
     if ($sSortDir_0 == "asc") {
         $jns_sorting = 1;
     }
     $keysearchdt = "name";
     if ($iSortCol_0 == 1) {
         $keysearchdt = "name";
     } else {
         if ($iSortCol_0 == 3) {
             $keysearchdt = "color";
         }
     }
     $sSearch = isset($_GET['sSearch']) ? $_GET['sSearch'] : "";
     $pencarian = array();
     if ($sSearch != "") {
         $sSearch = (string) trim($sSearch);
         $sSearch = quotemeta($sSearch);
         $regex = "/{$sSearch}/i";
         $filter = $this->mongo_db->regex($regex);
         $pencarian = array($keysearchdt => $filter);
     }
     $data = $this->mongo_db->find($pencarian, $awal, $limit, array($keysearchdt => $jns_sorting));
     $output = array("sEcho" => intval($sEcho), "iTotalRecords" => $this->mongo_db->count($pencarian), "iTotalDisplayRecords" => $this->mongo_db->count($pencarian), "aaData" => array());
     $i = $awal + 1;
     foreach ($data as $dt) {
         $img = "<img src='" . base_url() . "resources/image/noavatar2.png' class='img-thumbnail' style='max-width:75px; max-height:75px;'/>";
         $filename = "";
         if (!empty($dt['file'])) {
             $img = "<a class='fancybox' href='" . $this->config->item('path_asset_img') . "preview_images/" . $dt['file'] . "'><img src='" . $this->config->item('path_asset_img') . "preview_images/" . $dt['file'] . "' class='img-thumbnail' style='max-width:75px; max-height:75px;'/></a>&nbsp;&nbsp;" . $dt['file'];
             $filename = $dt['file'];
         }
         $detail = "";
         $delete = "";
         if ($this->m_checking->actions("Color", "module6", "Edit", TRUE, FALSE, "home/index")) {
             $detail = $this->template_icon->detail_onclick("ubahdata('" . $dt['_id'] . "','" . $dt['name'] . "','" . $dt['color'] . "','" . $filename . "')", "#editdata", 'Edit', "pencil.png", "", "", "data-toggle='modal'");
         }
         if ($this->m_checking->actions("Color", "module6", "Delete", TRUE, FALSE, "home/index")) {
             $delete = $this->template_icon->detail_onclick("hapusdata('" . $dt['_id'] . "','Are you sure want to delete Color " . $dt['name'] . "')", "", 'Delete', "delete.png", "", "linkdelete");
         }
         $tempwarnargb = explode(",", substr($dt['color'], 5));
         $output['aaData'][] = array($i, $dt['name'], $dt['color'], "<span style='width: 15px;height: 15px;display:block;margin:20px 3px 3px 3px;background-color: " . $dt['color'] . ";'></span>" . "<br />#" . dechex($tempwarnargb[0]) . dechex($tempwarnargb[1]) . dechex($tempwarnargb[2]), $img, $detail . $delete);
         $i++;
     }
     if (IS_AJAX) {
         echo json_encode($output);
     } else {
         redirect('inventory/mgcolor/index');
     }
 }
Пример #18
0
 function list_data()
 {
     $this->mongo_db->select_db("Game");
     $this->mongo_db->select_collection("Achievements");
     $awal = isset($_GET['iDisplayStart']) ? (int) $_GET['iDisplayStart'] : 0;
     $limit = isset($_GET['iDisplayLength']) ? (int) $_GET['iDisplayLength'] : 10;
     $sEcho = isset($_GET['sEcho']) ? (int) $_GET['sEcho'] : 1;
     $sSortDir_0 = isset($_GET['sSortDir_0']) ? $_GET['sSortDir_0'] : "desc";
     $iSortCol_0 = isset($_GET['iSortCol_0']) ? (int) $_GET['iSortCol_0'] : 0;
     $jns_sorting = -1;
     if ($sSortDir_0 == "asc") {
         $jns_sorting = 1;
     }
     $keysearchdt = "name";
     if ($iSortCol_0 == 1) {
         $keysearchdt = "name";
     } else {
         if ($iSortCol_0 == 2) {
             $keysearchdt = "description";
         }
     }
     $sSearch = isset($_GET['sSearch']) ? $_GET['sSearch'] : "";
     $pencarian = array();
     if ($sSearch != "") {
         $sSearch = (string) trim($sSearch);
         $sSearch = quotemeta($sSearch);
         $regex = "/{$sSearch}/i";
         $filter = $this->mongo_db->regex($regex);
         $pencarian = array($keysearchdt => $filter);
     }
     if ($this->session->userdata('brand') != "") {
         $pencarian = array_merge($pencarian, array("brand_id" => $this->session->userdata('brand')));
     }
     $data = $this->mongo_db->find($pencarian, $awal, $limit, array($keysearchdt => $jns_sorting));
     $output = array("sEcho" => intval($sEcho), "iTotalRecords" => $this->mongo_db->count($pencarian), "iTotalDisplayRecords" => $this->mongo_db->count($pencarian), "aaData" => array());
     $i = $awal + 1;
     foreach ($data as $dt) {
         $detail = "";
         $delete = "";
         if ($this->m_checking->actions("Achievement", "module5", "Edit", TRUE, FALSE, "home")) {
             $detail = $this->template_icon->detail_onclick("ubahdata('" . $dt['_id'] . "')", "#editdata", 'Edit', "pencil.png", "", "", "data-toggle='modal'");
         }
         if ($this->m_checking->actions("Achievement", "module5", "Delete", TRUE, FALSE, "home")) {
             $delete = $this->template_icon->detail_onclick("hapusdata('" . $dt['_id'] . "','Are you sure want to delete Achievement " . $dt['name'] . "')", "", 'Delete', "delete.png", "", "linkdelete");
         }
         $pathimg = $this->config->item('path_asset_img') . "preview_images/";
         $picture = "<a class='fancybox' href='" . $pathimg . $dt['icon_default'] . "'><img src='" . $pathimg . $dt['icon_default'] . "' alt='' class='img-thumbnail' style='max-width:75px; max-height:75px;' /></a><br />";
         $picture .= "<a class='fancybox' href='" . $pathimg . $dt['icon_active'] . "'><img src='" . $pathimg . $dt['icon_active'] . "' alt='' class='img-thumbnail' style='max-width:75px; max-height:75px;' /></a><br />";
         $output['aaData'][] = array($i, $dt['name'], $dt['description'], $dt['point'], $dt['brand_id'], $dt['state'], $picture, $detail . $delete);
         $i++;
     }
     if (IS_AJAX) {
         echo json_encode($output);
     } else {
         redirect('contest/achievement/index');
     }
 }
Пример #19
0
 function list_data()
 {
     $this->mongo_db->select_db("Game");
     $this->mongo_db->select_collection("Gesticon");
     $awal = isset($_GET['iDisplayStart']) ? (int) $_GET['iDisplayStart'] : 0;
     $limit = isset($_GET['iDisplayLength']) ? (int) $_GET['iDisplayLength'] : 10;
     $sEcho = isset($_GET['sEcho']) ? (int) $_GET['sEcho'] : 1;
     $sSortDir_0 = isset($_GET['sSortDir_0']) ? $_GET['sSortDir_0'] : "desc";
     $iSortCol_0 = isset($_GET['iSortCol_0']) ? (int) $_GET['iSortCol_0'] : 0;
     $jns_sorting = -1;
     if ($sSortDir_0 == "asc") {
         $jns_sorting = 1;
     }
     $keysearchdt = "command";
     if ($iSortCol_0 == 1) {
         $keysearchdt = "command";
     } else {
         if ($iSortCol_0 == 2) {
             $keysearchdt = "animation";
         }
     }
     $sSearch = isset($_GET['sSearch']) ? $_GET['sSearch'] : "";
     $pencarian = array();
     if ($sSearch != "") {
         $sSearch = (string) trim($sSearch);
         $sSearch = quotemeta($sSearch);
         $regex = "/{$sSearch}/i";
         $filter = $this->mongo_db->regex($regex);
         $pencarian = array($keysearchdt => $filter);
     }
     $data = $this->mongo_db->find($pencarian, $awal, $limit, array($keysearchdt => $jns_sorting));
     $output = array("sEcho" => intval($sEcho), "iTotalRecords" => $this->mongo_db->count($pencarian), "iTotalDisplayRecords" => $this->mongo_db->count($pencarian), "aaData" => array());
     $i = $awal + 1;
     foreach ($data as $dt) {
         $check = "false";
         $dtanimation = $dt['animation'];
         if (substr($dt['animation'], 0, 1) == "@") {
             $check = "true";
             $dtanimation = str_replace("@", "", $dt['animation']);
         }
         $detail = "";
         $delete = "";
         if ($this->m_checking->actions("EMO", "module6", "Edit", TRUE, FALSE, "home")) {
             $detail = $this->template_icon->detail_onclick("ubahdata('" . $dt['_id'] . "','" . $dt['command'] . "','" . $dt['gender'] . "','" . $dtanimation . "'," . $check . ")", "#editdata", 'Edit', "pencil.png", "", "", "data-toggle='modal'");
         }
         if ($this->m_checking->actions("EMO", "module6", "Delete", TRUE, FALSE, "home")) {
             $delete = $this->template_icon->detail_onclick("hapusdata('" . $dt['_id'] . "','Are you sure want to delete EMO " . $dt['command'] . "')", "", 'Delete', "delete.png", "", "linkdelete");
         }
         $output['aaData'][] = array($i, $dt['command'], $dt['animation'], $detail . $delete);
         $i++;
     }
     if (IS_AJAX) {
         echo json_encode($output);
     } else {
         redirect('avatar/gesticon/index');
     }
 }
Пример #20
0
 function list_data()
 {
     $this->mongo_db->select_db("Articles");
     $this->mongo_db->select_collection("Slideshow");
     $awal = isset($_GET['iDisplayStart']) ? (int) $_GET['iDisplayStart'] : 0;
     $limit = isset($_GET['iDisplayLength']) ? (int) $_GET['iDisplayLength'] : 10;
     $sEcho = isset($_GET['sEcho']) ? (int) $_GET['sEcho'] : 1;
     $sSortDir_0 = isset($_GET['sSortDir_0']) ? $_GET['sSortDir_0'] : "desc";
     $iSortCol_0 = isset($_GET['iSortCol_0']) ? (int) $_GET['iSortCol_0'] : 0;
     $jns_sorting = -1;
     if ($sSortDir_0 == "asc") {
         $jns_sorting = 1;
     }
     $keysearchdt = "no";
     if ($iSortCol_0 == 2) {
         $keysearchdt = "title";
     } else {
         if ($iSortCol_0 == 3) {
             $keysearchdt = "image";
         } else {
             if ($iSortCol_0 == 4) {
                 $keysearchdt = "link";
             }
         }
     }
     $sSearch = isset($_GET['sSearch']) ? $_GET['sSearch'] : "";
     $pencarian = array();
     if ($sSearch != "") {
         $sSearch = (string) trim($sSearch);
         $sSearch = quotemeta($sSearch);
         $regex = "/{$sSearch}/i";
         $filter = $this->mongo_db->regex($regex);
         $pencarian = array($keysearchdt => $filter);
     }
     $data = $this->mongo_db->find($pencarian, $awal, $limit, array($keysearchdt => $jns_sorting));
     $output = array("sEcho" => intval($sEcho), "iTotalRecords" => $this->mongo_db->count($pencarian), "iTotalDisplayRecords" => $this->mongo_db->count($pencarian), "aaData" => array());
     $i = $awal + 1;
     foreach ($data as $dt) {
         $detail = "";
         $delete = "";
         if ($this->m_checking->actions("Slideshow", "module6", "Delete", TRUE, FALSE, "home")) {
             $delete = $this->template_icon->detail_onclick("hapusdata('" . $dt['_id'] . "','Are you sure want to delete Slideshow " . $dt['title'] . "')", "", 'Delete', "delete.png", "", "linkdelete");
         }
         if ($this->m_checking->actions("Slideshow", "module6", "Edit", TRUE, FALSE, "home")) {
             $detail = $this->template_icon->detail_onclick("ubahdata('" . $dt['_id'] . "')", "#editdata", 'Edit', "pencil.png", "", "", "data-toggle='modal'");
         }
         $img = "<a class='fancybox' href='" . $dt['image'] . "'><img src='" . $dt['image'] . "' class='img-thumbnail' style='max-width:75px; max-height:75px;'/></a>";
         $output['aaData'][] = array($i, $dt['no'], $dt['title'], $img, $dt['link'], $detail . $delete);
         $i++;
     }
     if (IS_AJAX) {
         echo json_encode($output);
     } else {
         redirect('setting/slideshow/index');
     }
 }
Пример #21
0
function seo_urls($s)
{
    $XPS_URL = str_replace('/', '\\/', quotemeta(XOOPS_URL));
    $s = forum_absolutize($s);
    // Fix URLs and HTML.
    $module_name = REAL_MODULE_NAME;
    $search = array('/<(a|meta)([^>]*)(href|url)=([\'\\"]{0,1})' . $XPS_URL . '\\/modules\\/' . $module_name . '\\/(index.php)([^>\'\\"]*)([\'\\"]{1})([^>]*)>/i', '/<(a|meta)([^>]*)(href|url)=([\'\\"]{0,1})' . $XPS_URL . '\\/modules\\/' . $module_name . '\\/(viewpost.php)([^>\'\\"]*)([\'\\"]{1})([^>]*)>/i', '/<(a|meta)([^>]*)(href|url)=([\'\\"]{0,1})' . $XPS_URL . '\\/modules\\/' . $module_name . '\\/(viewall.php)([^>\'\\"]*)([\'\\"]{1})([^>]*)>/i', '/<(a|meta)([^>]*)(href|url)=([\'\\"]{0,1})' . $XPS_URL . '\\/modules\\/' . $module_name . '\\/(rss.php)([^>\'\\"]*)([\'\\"]{1})([^>]*)>/i', '/<(a|meta)([^>]*)(href|url)=([\'\\"]{0,1})' . $XPS_URL . '\\/modules\\/' . $module_name . '\\/(viewforum.php)([^>\'\\"]*)([\'\\"]{1})([^>]*)>/i', '/<(a|meta)([^>]*)(href|url)=([\'\\"]{0,1})' . $XPS_URL . '\\/modules\\/' . $module_name . '\\/(viewtopic.php)([^>\'\\"]*)([\'\\"]{1})([^>]*)>/i', '/<(a|meta)([^>]*)(href|url)=([\'\\"]{0,1})' . $XPS_URL . '\\/modules\\/' . $module_name . '\\/(.*)([^>\'\\"]*)([\'\\"]{1})([^>]*)>/i');
    $s = preg_replace_callback($search, 'replace_links', $s);
    return $s;
}
Пример #22
0
function generateUrlFilters($url, $name, $value, $class_active)
{
    $info = array();
    $info['class'] = "";
    $info['url'] = "";
    if (strpos($url, "home") == false) {
        $url .= "";
    } else {
        if (strpos($url, "?") != false) {
            $url .= "";
        } else {
            $url .= "/";
        }
    }
    if (strpos($url, "?") == false) {
        $url .= "?";
    } else {
        $url .= "";
    }
    $url = str_replace("%20", " ", $url);
    $get_var = $name . "=" . $value;
    $pattern = quotemeta($get_var);
    $pattern = str_replace("/", "\\/", $pattern);
    $pattern = '/' . $pattern . '/';
    preg_match_all($pattern, $url, $matches);
    if (count($matches[0]) == 0) {
        // if (strpos ( $url, $value ) == false) {
        // não existe
        // se não existir,
        // não marca como bold
        // add no link
        $info['class'] = "";
        $info['url'] = $url;
        if (substr($url, -1) != "?") {
            $info['url'] .= "&";
        }
        $info['url'] .= $get_var;
    } else {
        // se existir, marca como bold
        // remove do link ou não adiciona no link
        $info['class'] = $class_active;
        $info['url'] = strstr($url, "?", true);
        // antes do ?
        $temp = strstr($url, "?");
        // depois do ?
        $urlParameters = str_replace($get_var, "", $temp);
        $urlParameters = rtrim($urlParameters, "&");
        $urlParameters = str_replace("?&", "?", $urlParameters);
        if (!empty($urlParameters)) {
            $info['url'] .= $urlParameters;
        }
        $info['url'] = ereg_replace('(\\&)+', "&", $info['url']);
    }
    return $info;
}
Пример #23
0
 function list_data()
 {
     $this->mongo_db->select_db("Users");
     $this->mongo_db->select_collection("DeletedUsers");
     $awal = isset($_GET['iDisplayStart']) ? (int) $_GET['iDisplayStart'] : 0;
     $limit = isset($_GET['iDisplayLength']) ? (int) $_GET['iDisplayLength'] : 10;
     $sEcho = isset($_GET['sEcho']) ? (int) $_GET['sEcho'] : 1;
     $sSearch = isset($_GET['sSearch']) ? $_GET['sSearch'] : "";
     $sSortDir_0 = isset($_GET['sSortDir_0']) ? $_GET['sSortDir_0'] : "asc";
     $pencarian = array();
     if ($sSearch != "") {
         $sSearch = (string) trim($sSearch);
         $sSearch = quotemeta($sSearch);
         $regex = "/{$sSearch}/i";
         $filter = $this->mongo_db->regex($regex);
         $pencarian = array('properties.fullname' => $filter);
     }
     $data = $this->mongo_db->find($pencarian, $awal, $limit, array('properties.avatarname' => 1));
     $output = array("sEcho" => intval($sEcho), "iTotalRecords" => $this->mongo_db->count($pencarian), "iTotalDisplayRecords" => $this->mongo_db->count($pencarian), "aaData" => array());
     $i = $awal + 1;
     foreach ($data as $dt) {
         $delete = "";
         $redeactive = "";
         $priview = "";
         $username = isset($dt['username']) ? $datatemp['username'] : "";
         $name = "";
         $email = "";
         $sex = "";
         if (isset($dt['account'])) {
             $datatemp = $dt['account'];
             $email = isset($datatemp['email']) ? $datatemp['email'] : "";
         }
         if (isset($dt['properties'])) {
             $datatemp = $dt['properties'];
             $sex = isset($datatemp['sex']) ? $datatemp['sex'] : "";
         }
         if (isset($dt['properties'])) {
             $datatemp = $dt['properties'];
             $name = isset($datatemp['fullname']) ? $datatemp['fullname'] : "";
         }
         if ($this->m_checking->actions("User Deactivated", "module2", "Delete", TRUE, FALSE, "home")) {
             $delete = $this->template_icon->detail_onclick("hapusdata('" . $dt['_id'] . "','Are you sure want to delete User Deactivated " . $name . " ? ')", "", 'Delete', "delete.png", "", "linkdelete");
         }
         if ($this->m_checking->actions("User Deactivated", "module2", "set Active", TRUE, FALSE, "home")) {
             $redeactive = $this->template_icon->detail_onclick("setactive('" . $dt['_id'] . "','Are you sure want to set Active " . $name . " ? ')", "", 'Set Active Account', "book_previous.png", "", "linkdelete");
         }
         $output['aaData'][] = array($i, $name, $email, $sex, $redeactive . $delete);
         $i++;
     }
     if (IS_AJAX) {
         echo json_encode($output);
     } else {
         redirect('user/deactivated/index');
     }
 }
Пример #24
0
 function list_data_mix()
 {
     $this->mongo_db->select_db("Users");
     $this->mongo_db->select_collection("AvatarMix");
     $awal = isset($_GET['iDisplayStart']) ? (int) $_GET['iDisplayStart'] : 0;
     $limit = isset($_GET['iDisplayLength']) ? (int) $_GET['iDisplayLength'] : 10;
     $sEcho = isset($_GET['sEcho']) ? (int) $_GET['sEcho'] : 1;
     $sSortDir_0 = isset($_GET['sSortDir_0']) ? $_GET['sSortDir_0'] : "desc";
     $iSortCol_0 = isset($_GET['iSortCol_0']) ? (int) $_GET['iSortCol_0'] : 0;
     $jns_sorting = -1;
     if ($sSortDir_0 == "asc") {
         $jns_sorting = 1;
     }
     $keysearchdt = "name";
     if ($iSortCol_0 == 1) {
         $keysearchdt = "name";
     } else {
         if ($iSortCol_0 == 2) {
             $keysearchdt = "gender";
         } else {
             if ($iSortCol_0 == 3) {
                 $keysearchdt = "bodytype";
             }
         }
     }
     $sSearch = isset($_GET['sSearch']) ? $_GET['sSearch'] : "";
     $pencarian = array();
     if ($sSearch != "") {
         $sSearch = (string) trim($sSearch);
         $sSearch = quotemeta($sSearch);
         $regex = "/{$sSearch}/i";
         $filter = $this->mongo_db->regex($regex);
         $pencarian = array($keysearchdt => $filter);
     }
     $data = $this->mongo_db->find($pencarian, $awal, $limit, array($keysearchdt => $jns_sorting));
     $output = array("sEcho" => intval($sEcho), "iTotalRecords" => $this->mongo_db->count($pencarian), "iTotalDisplayRecords" => $this->mongo_db->count($pencarian), "aaData" => array());
     $i = $awal + 1;
     foreach ($data as $dt) {
         $title = !isset($dt['name']) ? "" : $dt['name'];
         $gender = !isset($dt['gender']) ? "" : $dt['gender'];
         $size = !isset($dt['bodytype']) ? "" : $dt['bodytype'];
         $img = "";
         if (!empty($dt['picture'])) {
             $img = "<a class='fancybox' href='" . $this->config->item('path_asset_img') . "preview_images/" . $dt['picture'] . "'><img src='" . $this->config->item('path_asset_img') . "preview_images/" . $dt['picture'] . "' class='img-thumbnail' style='max-width:75px; max-height:75px;'/></a>";
         }
         $detail = $this->template_icon->detail_onclick("getdatamix('" . (string) $dt['_id'] . "')", "", 'Set Value', "bullet_go.png", "", "linkdetail");
         $output['aaData'][] = array($i, $title, $gender, $size, $img, $detail);
         $i++;
     }
     if (IS_AJAX) {
         echo json_encode($output);
     } else {
         redirect($this->session->userdata('urlsebelumnya'));
     }
 }
Пример #25
0
 function index($numberpage = 0)
 {
     $this->mongo_db->select_db("Users");
     $this->mongo_db->select_collection("Properties");
     $sSearch = isset($_GET['q']) ? $_GET['q'] : "";
     $pencarian = array();
     if ($sSearch != "") {
         $sSearch = (string) trim($sSearch);
         $sSearch = quotemeta($sSearch);
         $regex = "/{$sSearch}/i";
         $filter = $this->mongo_db->regex($regex);
         $pencarian = array('fullname' => $filter);
     }
     $config['base_url'] = base_url() . "home/search";
     $config['total_rows'] = $this->mongo_db->count2($pencarian);
     $config['uri_segment'] = 4;
     $config['per_page'] = 10;
     $config['full_tag_open'] = '<div><ul class="pagination pagination-sm">';
     $config['full_tag_close'] = '</ul></div>';
     $config['first_link'] = '<i class="icon-long-arrow-left"></i> Newer';
     $config['first_tag_open'] = '<li class="previous">';
     $config['first_tag_close'] = '</li>';
     $config['last_link'] = 'Older <i class="icon-long-arrow-right"></i>';
     $config['last_tag_open'] = '<li class="next">';
     $config['last_tag_close'] = '</li>';
     $config['next_link'] = '<i class="icon-double-angle-right"></i>';
     $config['next_tag_open'] = '<li>';
     $config['next_tag_close'] = '</li>';
     $config['prev_link'] = '<i class="icon-double-angle-left"></i>';
     $config['prev_tag_open'] = '<li>';
     $config['prev_tag_close'] = '</li>';
     $config['cur_tag_open'] = '<li class="disabled active"><a href="#">';
     $config['cur_tag_close'] = '</a></li>';
     $config['num_tag_open'] = '<li>';
     $config['num_tag_close'] = '</li>';
     $this->pagination->initialize($config);
     $datapage['paging'] = $this->pagination->create_links();
     $datapage['count'] = $config['total_rows'];
     $datapage['datalist'] = $this->mongo_db->find($pencarian, 0, 0, array('join_date' => 1));
     $css = array(base_url() . "resources/plugin/codeprettifier/prettify.css", base_url() . "resources/plugin/form-toggle/toggles.css");
     $js = array(base_url() . "resources/plugin/charts-chartjs/Chart.min.js");
     $this->template_admin->header_web(TRUE, "Search Page", $css, $js, TRUE, "");
     $this->template_admin->headerbar();
     $this->template_admin->top_menu(TRUE);
     $this->load->view("panel/panel_utama");
     $this->template_admin->panel_menu();
     $this->load->view("panel/panel_content");
     $this->load->view("panel/panel_wrap");
     $this->load->view("search_view", $datapage);
     $this->load->view("panel/close_div");
     $this->load->view("panel/close_div");
     $this->template_admin->addresbar();
     $this->load->view("panel/close_div");
     $this->template_admin->footer();
 }
Пример #26
0
 function list_data()
 {
     $this->mongo_db->select_db("Game");
     $this->mongo_db->select_collection("Group");
     $awal = isset($_GET['iDisplayStart']) ? (int) $_GET['iDisplayStart'] : 0;
     $limit = isset($_GET['iDisplayLength']) ? (int) $_GET['iDisplayLength'] : 10;
     $sEcho = isset($_GET['sEcho']) ? (int) $_GET['sEcho'] : 1;
     $sSortDir_0 = isset($_GET['sSortDir_0']) ? $_GET['sSortDir_0'] : "desc";
     $iSortCol_0 = isset($_GET['iSortCol_0']) ? (int) $_GET['iSortCol_0'] : 0;
     $jns_sorting = -1;
     if ($sSortDir_0 == "asc") {
         $jns_sorting = 1;
     }
     $keysearchdt = "Name";
     if ($iSortCol_0 == 1) {
         $keysearchdt = "Name";
     } else {
         if ($iSortCol_0 == 2) {
             $keysearchdt = "Description";
         }
     }
     $sSearch = isset($_GET['sSearch']) ? $_GET['sSearch'] : "";
     $pencarian = array();
     if ($sSearch != "") {
         $sSearch = (string) trim($sSearch);
         $sSearch = quotemeta($sSearch);
         $regex = "/{$sSearch}/i";
         $filter = $this->mongo_db->regex($regex);
         $pencarian = array($keysearchdt => $filter);
     }
     $data = $this->mongo_db->find($pencarian, $awal, $limit, array($keysearchdt => $jns_sorting));
     $output = array("sEcho" => intval($sEcho), "iTotalRecords" => $this->mongo_db->count($pencarian), "iTotalDisplayRecords" => $this->mongo_db->count($pencarian), "aaData" => array());
     $i = $awal + 1;
     foreach ($data as $dt) {
         $config = "";
         $detail = "";
         $delete = "";
         if ($this->m_checking->actions("Group User", "module2", "Setting Akses", TRUE, FALSE, "home")) {
             $config = $this->template_icon->detail_onclick("settingmodule('" . $dt['_id'] . "')", "", 'Edit Access', "building.png", "", "linkdetail");
         }
         if ($this->m_checking->actions("Group User", "module2", "Edit", TRUE, FALSE, "home")) {
             $detail = $this->template_icon->detail_onclick("ubahdata('" . $dt['_id'] . "','" . $dt['Name'] . "','" . $dt['Description'] . "')", "#editdata", 'Detail', "page_white_edit.png", "", "", "data-toggle='modal'");
         }
         if ($this->m_checking->actions("Group User", "module2", "Delete", TRUE, FALSE, "home")) {
             $delete = $this->template_icon->detail_onclick("hapusdata('" . $dt['_id'] . "','Are you sure want to delete Group " . $dt['Name'] . "')", "", 'Delete', "delete.png", "", "linkdelete");
         }
         $output['aaData'][] = array($i, $dt['Name'], $dt['Description'], $config . $detail . $delete);
         $i++;
     }
     if (IS_AJAX) {
         echo json_encode($output);
     } else {
         redirect('management/groups/index');
     }
 }
/**
 * The output filter.
 */
function ossdl_off_filter($content)
{
    global $ossdl_off_blog_url, $ossdl_off_cdn_url;
    if ($ossdl_off_blog_url == $ossdl_off_cdn_url) {
        // no rewrite needed
        return $content;
    } else {
        $regex = '#(?<=[\\"\'])' . quotemeta($ossdl_off_blog_url) . '(?:(/(?:wp\\-content|wp\\-includes)[^\\"\']+)|(/[^/\\"\']+))(?=[\\"\'])#';
        return preg_replace_callback($regex, 'ossdl_off_rewriter_new', $content);
    }
}
Пример #28
0
function getname($url)
{
    if (stripos(urldecode(basename($_POST["file"])), "?") === false) {
        return urldecode(basename($_POST["file"]));
    } else {
        $string = quotemeta("/" . urldecode(basename($url)));
        if (preg_match_all("/\\/(.+)\\?/i", $string, $matches)) {
            return stripslashes($matches[1][0]);
        }
    }
}
Пример #29
0
 function list_data()
 {
     $this->mongo_db->select_db("Assets");
     $this->mongo_db->select_collection("DefaultAvatar");
     $awal = isset($_GET['iDisplayStart']) ? (int) $_GET['iDisplayStart'] : 0;
     $limit = isset($_GET['iDisplayLength']) ? (int) $_GET['iDisplayLength'] : 10;
     $sEcho = isset($_GET['sEcho']) ? (int) $_GET['sEcho'] : 1;
     $sSortDir_0 = isset($_GET['sSortDir_0']) ? $_GET['sSortDir_0'] : "desc";
     $iSortCol_0 = isset($_GET['iSortCol_0']) ? (int) $_GET['iSortCol_0'] : 0;
     $jns_sorting = -1;
     if ($sSortDir_0 == "asc") {
         $jns_sorting = 1;
     }
     $keysearchdt = "name";
     if ($iSortCol_0 == 1) {
         $keysearchdt = "name";
     } else {
         if ($iSortCol_0 == 2) {
             $keysearchdt = "gender";
         } else {
             if ($iSortCol_0 == 3) {
                 $keysearchdt = "description";
             }
         }
     }
     $sSearch = isset($_GET['sSearch']) ? $_GET['sSearch'] : "";
     $pencarian = array();
     if ($sSearch != "") {
         $sSearch = (string) trim($sSearch);
         $sSearch = quotemeta($sSearch);
         $regex = "/{$sSearch}/i";
         $filter = $this->mongo_db->regex($regex);
         $pencarian = array($keysearchdt => $filter);
     }
     $data = $this->mongo_db->find($pencarian, $awal, $limit, array($keysearchdt => $jns_sorting));
     $output = array("sEcho" => intval($sEcho), "iTotalRecords" => $this->mongo_db->count($pencarian), "iTotalDisplayRecords" => $this->mongo_db->count($pencarian), "aaData" => array());
     $i = $awal + 1;
     foreach ($data as $dt) {
         $title = !isset($dt['name']) ? "" : $dt['name'];
         $gender = !isset($dt['gender']) ? "" : $dt['gender'];
         $description = !isset($dt['description']) ? "" : $dt['description'];
         $detail = "";
         if ($this->m_checking->actions("Default Avatar", "module7", "Edit", TRUE, FALSE, "home")) {
             $detail = $this->template_icon->detail_onclick("ubahdata('" . $dt['_id'] . "')", "", 'Edit', "pencil.png", "", "linkdetail");
         }
         $output['aaData'][] = array($i, $title, $gender, $description, $detail);
         $i++;
     }
     if (IS_AJAX) {
         echo json_encode($output);
     } else {
         redirect('avatar/defaultavatar/index');
     }
 }
Пример #30
0
 function showContent()
 {
     $action = empty($_GET['main']) ? '' : $_GET['main'];
     if (empty($action)) {
         $action = 'index';
     }
     $action = trim($action, '/\\');
     $parts = explode('/', $action);
     $action = array_shift($parts);
     $action = mb_strtolower(quotemeta($action));
     $arguments = $parts;
     $this->getArgs($arguments);
     if (isset($_POST["action"])) {
         $this->registry->set("action", $_POST["action"]);
         unset($_POST["action"]);
     } else {
         if (isset($_GET["action"])) {
             $this->registry->set("action", $_GET["action"]);
         }
     }
     $this->registry->set("args", $this->args);
     $this->registry->set("get", $_GET);
     $this->registry->set("post", $_POST);
     if ($action == "ajax" and isset($parts[0])) {
         if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) and $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
             if (isset($this->registry["module_" . $this->args[0]])) {
                 $module = new LoadModule($this->args[0]);
                 $module->ajax($this->registry["action"], $this->registry["post"]);
                 exit;
             } else {
                 $class = "Controller_Ajax_" . ucfirst($this->args[0]);
                 $controller = new $class();
                 $method = $this->registry["action"];
                 $controller->{$method}($this->registry["post"]);
                 exit;
             }
         }
     } else {
         if (isset($this->registry["module_" . $action])) {
             $module = new LoadModule($action);
             $module->show();
         } else {
             if (!is_file($this->registry["controller"] . ucfirst($action) . '.php')) {
                 $class = 'Engine_Controller';
                 $controller = new $class();
                 $controller->__call();
             } else {
                 $class = 'Controller_' . ucfirst($action);
                 $controller = new $class();
                 $controller->index();
             }
         }
     }
 }