function comments_popup_link($zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $CSSclass = '', $none = 'Comments Off', $echo = true)
 {
     if (get_xoops_option(wp_mod(), 'wp_use_xoops_comments') == 0) {
         if (empty($GLOBALS['comment_count_cache'][wp_id()]["{$GLOBALS['wp_post_id']}"])) {
             $criteria =& new CriteriaCompo(new Criteria('comment_post_ID', $GLOBALS['wp_post_id']));
             $criteria->add(new Criteria('comment_approved', '1 '));
             // Trick for numeric chars only string compare
             $commentHandler =& wp_handler('Comment');
             $number = $commentHandler->getCount($criteria);
         } else {
             $number = $GLOBALS['comment_count_cache'][wp_id()]["{$GLOBALS['wp_post_id']}"];
         }
     } else {
         $criteria =& new CriteriaCompo(new Criteria('comment_post_ID', $GLOBALS['wp_post_id']));
         $criteria->add(new Criteria('comment_approved', '1 '));
         // Trick for numeric chars only string compare
         $criteria_c =& new CriteriaCompo(new Criteria('comment_content', "<trackback />%", 'like'));
         $criteria_c->add(new Criteria('comment_content', "<pingback />%", 'like'), 'OR');
         $criteria_c->add(new Criteria('comment_type', 'trackback'), 'OR');
         $criteria_c->add(new Criteria('comment_type', 'pingback'), 'OR');
         $criteria->add($criteria_c);
         $commentHandler =& wp_handler('Comment');
         $number = $commentHandler->getCount($criteria);
     }
     $comments_popup_link = "";
     if (0 == $number && 'closed' == $GLOBALS['post']->comment_status && 'closed' == $GLOBALS['post']->ping_status) {
         return _echo($none, $echo);
     } else {
         if (!empty($GLOBALS['post']->post_password)) {
             // if there's a password
             if ($_COOKIE['wp-postpass_' . $GLOBALS['cookiehash']] != $GLOBALS['post']->post_password) {
                 // and it doesn't match the cookie
                 return _echo("Enter your password to view comments", $echo);
             }
         }
         $comments_popup_link .= '<a href="';
         if (!empty($GLOBALS['wpcommentsjavascript'])) {
             $comments_popup_link .= wp_siteurl() . '/' . $GLOBALS['wpcommentspopupfile'] . '?p=' . $GLOBALS['wp_post_id'] . '&amp;c=1';
             $comments_popup_link .= '" onclick="wpopen(this.href); return false"';
         } else {
             // if comments_popup_script() is not in the template, display simple comment link
             $comments_popup_link .= comments_link('', false);
             $comments_popup_link .= '"';
         }
         $comments_popup_link .= ' title="Comment for \'\'' . apply_filters('the_title', $GLOBALS['post']->post_title) . '\'\'"';
         if (!empty($CSSclass)) {
             $comments_popup_link .= ' class="' . $CSSclass . '"';
         }
         $comments_popup_link .= '>';
         $comments_popup_link .= comments_number($zero, $one, $more, $number, false);
         $comments_popup_link .= '</a>';
         return _echo($comments_popup_link, $echo);
     }
 }
function apply_filters($tag, $string)
{
    if (isset($GLOBALS['wp_filter'][wp_id()]['all'])) {
        foreach ($GLOBALS['wp_filter'][wp_id()]['all'] as $priority => $functions) {
            if (isset($GLOBALS['wp_filter'][wp_id()][$tag][$priority])) {
                $GLOBALS['wp_filter'][wp_id()][$tag][$priority] = array_merge($GLOBALS['wp_filter'][wp_id()]['all'][$priority], $GLOBALS['wp_filter'][wp_id()][$tag][$priority]);
            } else {
                $GLOBALS['wp_filter'][wp_id()][$tag][$priority] = array_merge($GLOBALS['wp_filter'][wp_id()]['all'][$priority], array());
            }
            $GLOBALS['wp_filter'][wp_id()][$tag][$priority] = array_unique($GLOBALS['wp_filter'][wp_id()][$tag][$priority]);
        }
    }
    /* Keep Plugin Comatibility */
    $tables = array('posts', 'users', 'categories', 'post2cat', 'comments', 'links', 'linkcategories', 'options', 'optiontypes', 'optionvalues', 'optiongroups', 'optiongroup_options', 'postmeta', 'settings');
    $oldtables = array();
    foreach ($tables as $table) {
        if (isset($GLOBALS['table' . $table])) {
            $oldtables[$table] = $GLOBALS['table' . $table];
        }
        $GLOBALS['table' . $table] = $GLOBALS['wpdb']->{$table}[wp_id()];
    }
    if (isset($GLOBALS['wp_filter'][wp_id()][$tag])) {
        ksort($GLOBALS['wp_filter'][wp_id()][$tag]);
        foreach ($GLOBALS['wp_filter'][wp_id()][$tag] as $priority => $functions) {
            foreach ($functions as $function) {
                //				echo "<br/>$tag - $function  <br>";
                $string = $function($string);
                //				echo $string;
            }
        }
    }
    foreach ($tables as $table) {
        unset($GLOBALS['table' . $table]);
    }
    foreach ($oldtables as $table => $value) {
        $GLOBALS['table' . $table] = $value;
    }
    return $string;
}
function add_referer()
{
    if (!empty($GLOBALS['single'])) {
        if (isset($_SERVER['HTTP_REFERER'])) {
            $url = $_SERVER['HTTP_REFERER'];
            if (not_excluded($url)) {
                require_once XOOPS_ROOT_PATH . '/class/snoopy.php';
                $snoopy = new Snoopy();
                if ($snoopy->fetch($url)) {
                    $page = $snoopy->results;
                    $matched = false;
                    $page = mb_conv($page, $GLOBALS['blog_charset'], 'auto');
                    if (preg_match_all('/<a\\s[^>]*?href=[\\"\']([^\\"\']*?)[\\"\'][^>]*>/', $page, $matches, PREG_PATTERN_ORDER)) {
                        foreach ($matches[1] as $match) {
                            if (strstr($match, wp_siteurl())) {
                                $matched = true;
                            }
                        }
                    }
                    if (!$matched) {
                        return;
                    }
                    preg_match('/<title>(.+)<\\/title>/is', $page, $title);
                    $title = $title[1];
                    if (!$title) {
                        preg_match('/^(http:\\/\\/)?([^\\/]+)/i', $url, $matches);
                        $host = $matches[2];
                        preg_match('/[^\\.\\/]+\\.[^\\.\\/]+$/', $host, $matches);
                        $title = $matches[0];
                    }
                    $new_entry = addslashes($title . ":!-!:" . $url);
                    add_post_meta($GLOBALS['wp_post_id'], 'wp-refer', $new_entry);
                    $GLOBALS['post_meta_cache'][wp_id()][$GLOBALS['wp_post_id']]['wp-refer'][] = $new_entry;
                }
            }
        }
    }
}
<?php

$GLOBALS['blog'] = 1;
require dirname(__FILE__) . '/wp-config.php';
error_reporting(E_ERROR);
header("Content-type: text/css; charset=EUC-JP");
if (wp_id() == "-") {
    echo block_style_get('', false, false);
} else {
    echo block_style_get(wp_id(), false, false);
}
Ejemplo n.º 5
0
            //EMPTY
        } else {
            while ($smiles = $db->fetchArray($getsmiles)) {
                $GLOBALS['wpsmiliestrans'][wp_id()][$smiles['code']] = $smiles['smile_url'];
            }
        }
    } else {
        $GLOBALS['wpsmiliestrans'][wp_id()] = array(' :)' => 'icon_smile.gif', ' :D' => 'icon_biggrin.gif', ' :-D' => 'icon_biggrin.gif', ':grin:' => 'icon_biggrin.gif', ' :)' => 'icon_smile.gif', ' :-)' => 'icon_smile.gif', ':smile:' => 'icon_smile.gif', ' :(' => 'icon_sad.gif', ' :-(' => 'icon_sad.gif', ':sad:' => 'icon_sad.gif', ' :o' => 'icon_surprised.gif', ' :-o' => 'icon_surprised.gif', ':eek:' => 'icon_surprised.gif', ' 8O' => 'icon_eek.gif', ' 8-O' => 'icon_eek.gif', ':shock:' => 'icon_eek.gif', ' :?' => 'icon_confused.gif', ' :-?' => 'icon_confused.gif', ' :???:' => 'icon_confused.gif', ' 8)' => 'icon_cool.gif', ' 8-)' => 'icon_cool.gif', ':cool:' => 'icon_cool.gif', ':lol:' => 'icon_lol.gif', ' :x' => 'icon_mad.gif', ' :-x' => 'icon_mad.gif', ':mad:' => 'icon_mad.gif', ' :P' => 'icon_razz.gif', ' :-P' => 'icon_razz.gif', ':razz:' => 'icon_razz.gif', ':oops:' => 'icon_redface.gif', ':cry:' => 'icon_cry.gif', ':evil:' => 'icon_evil.gif', ':twisted:' => 'icon_twisted.gif', ':roll:' => 'icon_rolleyes.gif', ':wink:' => 'icon_wink.gif', ' ;)' => 'icon_wink.gif', ' ;-)' => 'icon_wink.gif', ':!:' => 'icon_exclaim.gif', ':?:' => 'icon_question.gif', ':idea:' => 'icon_idea.gif', ':arrow:' => 'icon_arrow.gif', ' :|' => 'icon_neutral.gif', ' :-|' => 'icon_neutral.gif', ':neutral:' => 'icon_neutral.gif', ':mrgreen:' => 'icon_mrgreen.gif');
    }
}
# sorts the smilies' array
if (!function_exists('smiliescmp')) {
    function smiliescmp($a, $b)
    {
        if (strlen($a) == strlen($b)) {
            return strcmp($a, $b);
        }
        return strlen($a) > strlen($b) ? -1 : 1;
    }
}
if (get_xoops_option(wp_mod(), 'wp_use_xoops_smilies') == 0) {
    uksort($GLOBALS['wpsmiliestrans'][wp_id()], 'smiliescmp');
}
# generates smilies' search & replace arrays
$GLOBALS['wp_smiliessearch'][wp_id()] = array();
$GLOBALS['wp_smiliesreplace'][wp_id()] = array();
foreach ($GLOBALS['wpsmiliestrans'][wp_id()] as $smiley => $img) {
    $GLOBALS['wp_smiliessearch'][wp_id()][] = $smiley;
    $smiley_masked = str_replace(' ', '', $smiley);
    $GLOBALS['wp_smiliesreplace'][wp_id()][] = " <img src='" . $GLOBALS['smilies_directory'] . "/{$img}' alt='{$smiley_masked}' />";
}
Ejemplo n.º 6
0
 public function update()
 {
     $this->load_auth();
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     $p_usaha_id = $this->uri->segment(4);
     $p_type_id = $this->uri->segment(5);
     $p_id = $this->uri->segment(6);
     //cek usaha -> cm bisa edit yg self aja
     if ($p_usaha_id == pad_reklame_id() || $p_usaha_id == pad_air_tanah_id()) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     //cek kohir
     if ($this->sptpd_model->is_kohir_ok($p_id)) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     // cek pmb
     if ($this->sptpd_model->is_sspd_ok($p_id) || $this->sptpd_model->is_bayar_ok($p_id)) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     $data['current'] = $this->module;
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("{$this->controller}/update/{$p_usaha_id}/{$p_type_id}/{$p_id}");
     $post_data = $this->fpost($p_usaha_id);
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $update_data = array('customer_id' => $input_post['customer_id'], 'customer_usaha_id' => $input_post['customer_usaha_id'], 'pajak_id' => $input_post['pajak_id'], 'tahun' => $input_post['tahun'], 'terimatgl' => date('Y-m-d', strtotime($input_post['terimatgl'])), 'type_id' => $input_post['type_id'], 'so' => $input_post['so'], 'jatuhtempotgl' => date('Y-m-d', strtotime($input_post['jatuhtempotgl'])), 'masadari' => date('Y-m-d', strtotime($input_post['masadari'])), 'masasd' => date('Y-m-d', strtotime($input_post['masasd'])), 'minomset' => $input_post['minomset'], 'dasar' => $input_post['dasar'], 'tarif' => $input_post['tarif'], 'denda' => $input_post['denda'], 'bunga' => $input_post['bunga'], 'setoran' => $input_post['setoran'], 'kenaikan' => $input_post['kenaikan'], 'kompensasi' => $input_post['kompensasi'], 'lain2' => $input_post['lain2'], 'pajak_terhutang' => $input_post['pajak'], 'r_bayarid' => $input_post['r_bayarid'], 'r_nsr' => $input_post['r_nsr'], 'rekening_id' => $input_post['rekening_id'], 'write_date' => date('Y-m-d'), 'write_uid' => sipkd_user_id());
         $reklame_data = array();
         if ($p_usaha_id == pad_reklame_id()) {
             //
         }
         $air_tanah_data = array();
         if ($p_usaha_id == pad_air_tanah_id()) {
             //
         }
         // data tambahan
         $tambahan_data = array();
         if (wp_login()) {
             //
         }
         $update_data = array_merge($update_data, $reklame_data, $air_tanah_data, $tambahan_data);
         $this->sptpd_model->update($p_id, $update_data);
         // data tambahan / detail
         if (wp_login()) {
             //
             // uplod dokeumen
             $this->unggah($p_id);
         }
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url($this->controller));
     }
     $data['dt'] = $post_data;
     $get = (object) $post_data;
     $options = array();
     $js = 'id="customer_usaha_id" class="input-xlarge"';
     $data['select_usaha'] = form_dropdown('customer_usaha_id', $options, null, $js);
     $select_data = $this->load->model('pajak_model')->get_select($get->pajak_id);
     $options = array();
     foreach ($select_data as $rows) {
         $options[$rows->id] = $rows->pajaknm;
     }
     $js = 'id="pajak_id" class="input-xxlarge"';
     $data['select_pajak'] = form_dropdown('pajak_id', $options, $get->pajak_id, $js);
     $select_data = $this->load->model('sptpd_type_model')->get_select();
     $options = array();
     foreach ($select_data as $rows) {
         $options[$rows->id] = $rows->typenm;
     }
     $js = 'id="type_id" class="input-small" onChange="void(0);"';
     $data['select_sptpd_type'] = form_dropdown('type_id', $options, $get->type_id, $js);
     $pajak_detail = $this->load->model('pad_model');
     if ($row = $pajak_detail->sptpd_get_pajak_detail($get->pajak_id, $get->terimatgl)) {
         $data['dt']['rekening_id'] = $row->rekening_id;
         $data['dt']['rekeningkd'] = $row->rekeningkd;
         $data['dt']['jatuhtempo'] = $row->jatuhtempo;
     }
     if (wp_login()) {
         $this->load->helper('directory');
         $dir = directory_map(dirname(__FILE__) . '//..//dokumen//');
         $files = array();
         foreach ($dir as $file) {
             $f = explode('@', $file);
             if ($f[0] == $p_id) {
                 $files[] = anchor(active_module_url("sptpd/unduh/{$file}"), $f[1], array("title" => "Unduh file {$f['1']}", "target" => "_blank"));
             }
         }
         $data['dt']['files'] = $files;
     }
     if ($p_usaha_id == pad_reklame_id()) {
         //
     } else {
         if ($p_usaha_id == pad_air_tanah_id()) {
             //
         } else {
             if (!wp_login()) {
                 $this->load->view('vsptpd_form', $data);
             } else {
                 $data['dt']['customer_id'] = wp_id();
                 $this->load->view('wp/vsptpd_form', $data);
             }
         }
     }
 }
 function the_meta($echo = true)
 {
     $the_meta = '';
     if ($keys = get_post_custom_keys()) {
         $the_meta .= "<ul class='post-meta'>\n";
         foreach ($keys as $key) {
             $values = array_map('trim', $GLOBALS['post_meta_cache'][wp_id()][$GLOBALS['wp_post_id']][$key]);
             $value = implode($values, ', ');
             $the_meta .= "<li><span class='post-meta-key'>{$key}:</span> {$value}</li>\n";
         }
         $the_meta .= "</ul>\n";
     }
     return _echo($the_meta, $echo);
 }
function get_catname($cat_ID)
{
    if (empty($GLOBALS['cache_catnames'][wp_id()]) || !$GLOBALS['use_cache']) {
        $categoryHandler =& wp_handler('Category');
        $categoryObjects =& $categoryHandler->getObjects();
        foreach ($categoryObjects as $categoryObject) {
            $GLOBALS['cache_catnames'][wp_id()][$categoryObject->getVar('cat_ID')] = $categoryObject->getVar('cat_name');
        }
    }
    $cat_name = $GLOBALS['cache_catnames'][wp_id()][$cat_ID];
    return $cat_name;
}
#wp-calendar #today {
\tbackground: #D85F7D;
\tcolor: #ffffff;
}

#wp-calendar th {
\tfont-style: normal;
\tfont-size: 11px;
\ttext-transform: capitalize;
}
EOD;
    /* Don't remove this line */
}
/* Don't remove this line */
if (@in_array('pukiwiki', $GLOBALS['wp_filter'][wp_id()]['the_content']["6"]) && !preg_match("/^" . preg_quote(wp_base() . "/", "/") . "/i", $cur_PATH)) {
    /* Don't remove this line */
    if (!defined("WP_BLOCK_WIKI_READ")) {
        /* Don't remove this line */
        define("WP_BLOCK_WIKI_READ", "1");
        $wp_block_style .= <<<EOD
/*
 * modPukiWiki錮ㅞⅩ�엠ㄵ瑜래샵혼데澄婁�
 */
div.modPukiWP_ie5 {
\ttext-align:left;
}

.modPukiWP_style_table
{
\tpadding:0px;
$GLOBALS['s_weekday_length'] = _WP_CAL_SWEEK_LEN;
// the months, translate them if necessary - note: this isn't active everywhere yet
$GLOBALS['month']['01'] = _WP_CAL_JANUARY;
$GLOBALS['month']['02'] = _WP_CAL_FEBRUARY;
$GLOBALS['month']['03'] = _WP_CAL_MARCH;
$GLOBALS['month']['04'] = _WP_CAL_APRIL;
$GLOBALS['month']['05'] = _WP_CAL_MAY;
$GLOBALS['month']['06'] = _WP_CAL_JUNE;
$GLOBALS['month']['07'] = _WP_CAL_JULY;
$GLOBALS['month']['08'] = _WP_CAL_AUGUST;
$GLOBALS['month']['09'] = _WP_CAL_SEPTEMBER;
$GLOBALS['month']['10'] = _WP_CAL_OCTOBER;
$GLOBALS['month']['11'] = _WP_CAL_NOVEMBER;
$GLOBALS['month']['12'] = _WP_CAL_DECEMBER;
$GLOBALS['s_month_length'] = _WP_CAL_SMONTH_LEN;
$GLOBALS['wp_month_format'] = _WP_MONTH_FORMAT;
// here's the conversion table, you can modify it if you know what you're doing
if (get_xoops_option(wp_mod(), 'wp_use_xoops_smilies')) {
    // Get smilies infomation from XOOPS DB
    $_getsmiles = $GLOBALS['xoopsDB']->query("SELECT id, code, smile_url FROM " . $GLOBALS['xoopsDB']->prefix("smiles") . " ORDER BY id");
    if ($GLOBALS['xoopsDB']->getRowsNum($_getsmiles) == "0") {
        //EMPTY
    } else {
        while ($_smiles = $GLOBALS['xoopsDB']->fetchArray($_getsmiles)) {
            $GLOBALS['wpsmiliestrans'][wp_id()][$_smiles['code']] = $_smiles['smile_url'];
        }
    }
} else {
    $GLOBALS['wpsmiliestrans'][wp_id()] = array(' :)' => 'icon_smile.gif', ' :D' => 'icon_biggrin.gif', ' :-D' => 'icon_biggrin.gif', ':grin:' => 'icon_biggrin.gif', ' :)' => 'icon_smile.gif', ' :-)' => 'icon_smile.gif', ':smile:' => 'icon_smile.gif', ' :(' => 'icon_sad.gif', ' :-(' => 'icon_sad.gif', ':sad:' => 'icon_sad.gif', ' :o' => 'icon_surprised.gif', ' :-o' => 'icon_surprised.gif', ':eek:' => 'icon_surprised.gif', ' 8O' => 'icon_eek.gif', ' 8-O' => 'icon_eek.gif', ':shock:' => 'icon_eek.gif', ' :?' => 'icon_confused.gif', ' :-?' => 'icon_confused.gif', ' :???:' => 'icon_confused.gif', ' 8)' => 'icon_cool.gif', ' 8-)' => 'icon_cool.gif', ':cool:' => 'icon_cool.gif', ':lol:' => 'icon_lol.gif', ' :x' => 'icon_mad.gif', ' :-x' => 'icon_mad.gif', ':mad:' => 'icon_mad.gif', ' :P' => 'icon_razz.gif', ' :-P' => 'icon_razz.gif', ':razz:' => 'icon_razz.gif', ':oops:' => 'icon_redface.gif', ':cry:' => 'icon_cry.gif', ':evil:' => 'icon_evil.gif', ':twisted:' => 'icon_twisted.gif', ':roll:' => 'icon_rolleyes.gif', ':wink:' => 'icon_wink.gif', ' ;)' => 'icon_wink.gif', ' ;-)' => 'icon_wink.gif', ':!:' => 'icon_exclaim.gif', ':?:' => 'icon_question.gif', ':idea:' => 'icon_idea.gif', ':arrow:' => 'icon_arrow.gif', ' :|' => 'icon_neutral.gif', ' :-|' => 'icon_neutral.gif', ':neutral:' => 'icon_neutral.gif', ':mrgreen:' => 'icon_mrgreen.gif');
}
include get_custom_path('wp-config-custom.php');
Ejemplo n.º 11
0
 public function update()
 {
     $this->load_auth();
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     $p_usaha_id = $this->uri->segment(4);
     $p_type_id = $this->uri->segment(5);
     $p_id = $this->uri->segment(6);
     //cek kohir
     if ($this->sptpd_model->is_kohir_ok($p_id) && !is_super_admin()) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     // cek pmb
     // kalau user sa boleh edit. 17-10-2014 (AA)
     if (($this->sptpd_model->is_sspd_ok($p_id) || $this->sptpd_model->is_bayar_ok($p_id)) && !is_super_admin()) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     $data['current'] = $this->module;
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("{$this->controller}/update/{$p_usaha_id}/{$p_type_id}/{$p_id}");
     $post_data = $this->fpost($p_usaha_id);
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         //cek nama wp - kalo beda update nama
         /*
         $wp_data = $this->load->model('subjek_pajak_model')->get($input_post['customer_id']);
         $wp_nama = $wp_data->nama;
         $cid  = $input_post['customer_id'];
         if($wp_nama != $input_post['nama']) {
             $this->load->model('subjek_pajak_model')->rename_wp($cid, $input_post['nama']);
         }
         */
         $update_data = array('customer_id' => $input_post['customer_id'], 'customer_usaha_id' => $input_post['customer_usaha_id'], 'pajak_id' => $input_post['pajak_id'], 'tahun' => date('Y', strtotime($input_post['terimatgl'])), 'terimatgl' => date('Y-m-d', strtotime($input_post['terimatgl'])), 'type_id' => $input_post['type_id'], 'so' => $input_post['so'], 'jatuhtempotgl' => date('Y-m-d', strtotime($input_post['jatuhtempotgl'])), 'masadari' => date('Y-m-d', strtotime($input_post['masadari'])), 'masasd' => date('Y-m-d', strtotime($input_post['masasd'])), 'minomset' => $input_post['minomset'], 'dasar' => $input_post['dasar'], 'tarif' => $input_post['tarif'], 'denda' => $input_post['denda'], 'bunga' => $input_post['bunga'], 'setoran' => $input_post['setoran'], 'kenaikan' => $input_post['kenaikan'], 'kompensasi' => $input_post['kompensasi'], 'lain2' => $input_post['lain2'], 'pajak_terhutang' => $input_post['pajak'], 'r_bayarid' => $input_post['r_bayarid'], 'r_nsr' => $input_post['r_nsr'], 'rekening_id' => $input_post['rekening_id'], 'write_date' => date('Y-m-d'), 'write_uid' => sipkd_user_id());
         $reklame_data = array();
         if ($p_usaha_id == pad_reklame_id()) {
             $input_post = $post_data;
             $reklame_data = array('r_nsrno' => $input_post['r_nsrno'], 'r_nsrtgl' => empty($input_post['r_nsrtgl']) ? NULL : date('Y-m-d', strtotime($input_post['r_nsrtgl'])), 'r_tarifid' => $input_post['r_tarifid'], 'r_kontrak' => $input_post['r_kontrak'], 'r_lama' => $input_post['r_lama'], 'r_jalanklas_id' => $input_post['r_jalanklas_id'], 'r_jalan_id' => $input_post['r_jalan_id'], 'r_lokasi' => $input_post['r_lokasi'], 'r_judul' => $input_post['r_judul'], 'r_panjang' => $input_post['r_panjang'], 'r_lebar' => $input_post['r_lebar'], 'r_muka' => $input_post['r_muka'], 'r_banyak' => $input_post['r_banyak'], 'r_luas' => $input_post['r_luas'], 'r_lokasi_id' => $input_post['r_lokasi_id'], 'r_calculated' => $input_post['r_calculated'], 'r_nsr_id' => $input_post['r_nsr_id'], 'r_lokasi_pasang_id' => $input_post['r_lokasi_pasang_id'], 'r_lokasi_pasang_val' => $input_post['r_lokasi_pasang_val'], 'r_jalanklas_val' => $input_post['r_jalanklas_val'], 'r_sudut_pandang_id' => $input_post['r_sudut_pandang_id'], 'r_sudut_pandang_val' => $input_post['r_sudut_pandang_val'], 'r_tinggi' => $input_post['r_tinggi'], 'r_njop' => $input_post['r_njop'], 'r_status' => $input_post['r_status'], 'r_nama' => $input_post['nama']);
         }
         $air_tanah_data = array();
         if ($p_usaha_id == pad_air_tanah_id()) {
             $input_post = $post_data;
             $air_tanah_data = array('volume' => $input_post['volume'], 'satuan' => 'M3');
         }
         $update_data = array_merge($update_data, $reklame_data, $air_tanah_data);
         $this->sptpd_model->update($p_id, $update_data);
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url($this->controller));
     }
     $data['dt'] = $post_data;
     $get = (object) $post_data;
     $options = array();
     $js = 'id="customer_usaha_id" class="input-xlarge"';
     $data['select_usaha'] = form_dropdown('customer_usaha_id', $options, null, $js);
     $select_data = $this->load->model('pad_model')->sptpd_get_pajak($p_usaha_id);
     $options = array();
     if ($select_data) {
         foreach ($select_data as $rows) {
             if ($p_usaha_id == pad_reklame_id()) {
                 $options[$rows->id] = $rows->nama . " = " . number_format($rows->reklame, 0, ',', '.');
             } else {
                 $options[$rows->id] = $rows->nama;
             }
         }
     }
     $js = 'id="pajak_id" class="input-xxlarge"';
     $data['select_pajak'] = form_dropdown('pajak_id', $options, $get->pajak_id, $js);
     $select_data = $this->load->model('sptpd_type_model')->get_select();
     $options = array();
     if ($select_data) {
         foreach ($select_data as $rows) {
             $options[$rows->id] = $rows->typenm;
         }
     }
     $js = 'id="type_id" class="input-small" onChange="void(0);"';
     $data['select_sptpd_type'] = form_dropdown('type_id', $options, $get->type_id, $js);
     $pajak_detail = $this->load->model('pad_model');
     if ($row = $pajak_detail->sptpd_get_pajak_detail($get->pajak_id, $get->terimatgl)) {
         $data['dt']['rekening_id'] = $row->rekening_id;
         $data['dt']['rekeningkd'] = $row->rekeningkd;
         $data['dt']['jatuhtempo'] = $row->jatuhtempo;
     } else {
         $data['dt']['rekeningkd'] = '';
         $data['dt']['jatuhtempo'] = '';
     }
     if ($p_usaha_id == pad_reklame_id()) {
         //-new
         $select_data = $this->load->model('reklame_nilai_strategis_model')->get_select();
         $options = array();
         if ($select_data) {
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->nsrnm;
             }
         }
         $js = 'id="r_nsr_id" class="input-xlarge" required ';
         $data['select_nsr'] = form_dropdown('r_nsr_id', $options, $get->r_nsr_id, $js);
         $select_data = $this->load->model('rek_lokasi_pasang_model')->get_select();
         $options = array();
         if ($select_data) {
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->lokasinm;
             }
         }
         $js = 'id="r_lokasi_pasang_id" class="input-xlarge" required ';
         $data['select_lokasi_pasang'] = form_dropdown('r_lokasi_pasang_id', $options, $get->r_lokasi_pasang_id, $js);
         $select_data = $this->load->model('rek_sudut_pandang_model')->get_select();
         $options = array();
         if ($select_data) {
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->sudutnm;
             }
         }
         $js = 'id="r_sudut_pandang_id" class="input-xlarge" required ';
         $data['select_sudut_pandang'] = form_dropdown('r_sudut_pandang_id', $options, $get->r_sudut_pandang_id, $js);
         $options = array('Pasang Baru' => 'Pasang Baru', 'Perpanjangan' => 'Perpanjangan');
         $js = 'id="r_status" class="input-large" required ';
         $data['select_status'] = form_dropdown('r_status', $options, $get->r_status, $js);
         //-end-new
         $select_data = $this->load->model('jalan_klas_model')->get_select();
         $options = array();
         if ($select_data) {
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->kelasnm;
             }
         }
         $js = 'id="r_jalanklas_id" class="input-xlarge" required ';
         $data['select_jalan_klas'] = form_dropdown('r_jalanklas_id', $options, $get->r_jalanklas_id, $js);
         $select_data = $this->load->model('jalan_model')->get_select();
         $options = array();
         if ($select_data) {
             $options[] = "# KOSONG #";
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->jalannm;
             }
         }
         $js = 'id="r_jalan_id" class="input-large combobox" ';
         $data['select_jalan'] = form_dropdown('r_jalan_id', $options, $get->r_jalan_id, $js);
         $select_data = $this->load->model('kecamatan_model')->get_select();
         $options = array();
         if ($select_data) {
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->kecamatannm;
             }
         }
         $js = 'id="r_lokasi_id" class="input-medium" required ';
         $data['select_lokasi'] = form_dropdown('r_lokasi_id', $options, $get->r_lokasi_id, $js);
         $options = array(1 => 'Tidak ada', 2 => 'Produk Rokok +25%', 3 => 'Reklame Pendidikan -25%', 4 => 'Kenaikan 25% & Pengurangan 25%');
         $js = 'id="r_tarifid" class="input-large" required ';
         $data['select_tarif'] = form_dropdown('r_tarifid', $options, $get->r_tarifid, $js);
         if (!wp_login()) {
             $this->load->view('vsptpd_form_reklame', $data);
         } else {
             $data['dt']['customer_id'] = wp_id();
             $this->load->view('wp/vsptpd_form_reklame', $data);
         }
     } else {
         if ($p_usaha_id == pad_air_tanah_id()) {
             $select_data = $this->load->model('air_zona_model')->get_select();
             $options = array();
             if ($select_data) {
                 foreach ($select_data as $row) {
                     $options[$row->id] = $row->zonanm;
                 }
             }
             $js = 'id="air_zona_id" class="input-medium" required ';
             $data['select_zona'] = form_dropdown('air_zona_id', $options, $get->air_zona_id, $js);
             $select_data = $this->load->model('air_manfaat_model')->get_select();
             $options = array();
             if ($select_data) {
                 foreach ($select_data as $row) {
                     $options[$row->id] = $row->manfaatnm;
                 }
             }
             $js = 'id="air_manfaat_id" class="input-medium" required ';
             $data['select_manfaat'] = form_dropdown('air_manfaat_id', $options, $get->air_manfaat_id, $js);
             if (!wp_login()) {
                 $this->load->view('vsptpd_form_at', $data);
             } else {
                 $data['dt']['customer_id'] = wp_id();
                 $this->load->view('wp/vsptpd_form_at', $data);
             }
         } else {
             if (!wp_login()) {
                 $this->load->view('vsptpd_form', $data);
             } else {
                 $data['dt']['customer_id'] = wp_id();
                 $this->load->view('wp/vsptpd_form', $data);
             }
         }
     }
 }
Ejemplo n.º 12
0
 function _b_wp_contents_show($options, $wp_num = "")
 {
     $no_posts = empty($options[0]) ? 10 : $options[0];
     $tpl_file = empty($options[1]) ? 'wp_contents.html' : $options[1];
     $category = empty($options[2]) ? "all" : intval($options[2]);
     $GLOBALS['dateformat'] = get_settings('date_format');
     $GLOBALS['timeformat'] = get_settings('time_format');
     $_criteria = new CriteriaCompo(new Criteria('post_status', 'publish'));
     $_criteria->add(new Criteria('post_date', current_time('mysql'), '<='));
     if (empty($category) || $category == 'all' || $category == '0') {
         $_joinCriteria = null;
     } else {
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('post2cat'), 'ID', 'post_id');
         $_wCriteria =& new CriteriaCompo();
         $_wCriteria->add(new Criteria('category_id', intCriteriaVal($category)), 'OR');
         $_catc = trim(get_category_children($category, '', ' '));
         if ($_catc !== "") {
             $_catc_array = explode(' ', $_catc);
             for ($_j = 0; $_j < count($_catc_array); $_j++) {
                 $_wCriteria->add(new Criteria('category_id', intCriteriaVal($_catc_array[$_j])), 'OR');
             }
         }
         $_criteria->add($_wCriteria);
     }
     $_criteria->setGroupBy(wp_table('posts') . '.ID');
     $_criteria->setSort('post_date');
     $_criteria->setOrder('DESC');
     $_criteria->setLimit($no_posts);
     $_criteria->setStart(0);
     $postHandler =& wp_handler('Post');
     $postObjects =& $postHandler->getObjects($_criteria, false, '', 'DISTINCT', $_joinCriteria);
     //		echo $postHandler->getLastSQL();
     $lposts = array();
     foreach ($postObjects as $postObject) {
         $lposts[] =& $postObject->exportWpObject();
     }
     if ($lposts) {
         // Get the categories for all the posts
         $_post_id_list = array();
         foreach ($lposts as $post) {
             $_post_id_list[] = $post->ID;
             $GLOBALS['category_cache'][wp_id()][$post->ID] = array();
         }
         $_post_id_list = implode(',', $_post_id_list);
         $_post_id_criteria =& new Criteria('post_id', '(' . $_post_id_list . ')', 'IN');
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('post2cat'), 'ID', 'post_id');
         $_joinCriteria->cascade(new XoopsJoinCriteria(wp_table('categories'), 'category_id', 'cat_ID'));
         $postObjects =& $postHandler->getObjects($_post_id_criteria, false, 'ID, category_id, cat_name, category_nicename, category_description, category_parent', true, $_joinCriteria);
         foreach ($postObjects as $postObject) {
             $_cat->ID = $postObject->getVar('ID');
             $_cat->category_id = $postObject->getExtraVar('category_id');
             $_cat->cat_name = $postObject->getExtraVar('cat_name');
             $_cat->category_nicename = $postObject->getExtraVar('category_nicename');
             $_cat->category_description = $postObject->getExtraVar('category_description');
             $_cat->category_parent = $postObject->getExtraVar('category_parent');
             $GLOBALS['category_cache'][wp_id()][$postObject->getVar('ID')][] =& $_cat;
             unset($_cat);
         }
         // Do the same for comment numbers
         $_post_id_criteria =& new Criteria('comment_post_ID', '(' . $_post_id_list . ')', 'IN');
         $_criteria =& new CriteriaCompo(new Criteria('post_status', 'publish'));
         $_criteria->add(new Criteria('comment_approved', '1 '));
         $_criteria->add($_post_id_criteria);
         $_criteria->setGroupBy('ID');
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('comments'), 'ID', 'comment_post_ID');
         $postObjects =& $postHandler->getObjects($_criteria, false, 'ID, COUNT( comment_ID ) AS ccount', false, $_joinCriteria);
         foreach ($postObjects as $postObject) {
             $GLOBALS['comment_count_cache'][wp_id()]['' . $postObject->getVar('ID')] = $postObject->getExtraVar('ccount');
         }
         // Get post-meta info
         if ($meta_list = $GLOBALS['wpdb']->get_results('SELECT post_id, meta_key, meta_value FROM ' . wp_table('postmeta') . ' WHERE post_id IN(' . $_post_id_list . ') ORDER BY post_id, meta_key', ARRAY_A)) {
             // Change from flat structure to hierarchical:
             $GLOBALS['post_meta_cache'][wp_id()] = array();
             foreach ($meta_list as $metarow) {
                 $mpid = $metarow['post_id'];
                 $mkey = $metarow['meta_key'];
                 $mval = $metarow['meta_value'];
                 // Force subkeys to be array type:
                 if (!isset($GLOBALS['post_meta_cache'][wp_id()][$mpid]) || !is_array($GLOBALS['post_meta_cache'][wp_id()][$mpid])) {
                     $GLOBALS['post_meta_cache'][wp_id()][$mpid] = array();
                 }
                 if (!isset($GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"]) || !is_array($GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"])) {
                     $GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"] = array();
                 }
                 // Add a value to the current pid/key:
                 $GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"][] = $mval;
             }
         }
     }
     $blog = 1;
     $block = array();
     $block['use_theme_template'] = get_xoops_option(wp_mod(), 'use_theme_template');
     $block['style'] = block_style_get(false);
     $block['divid'] = 'wpBlockContent' . $wp_num;
     $block['template_content'] = "";
     $i = 0;
     $GLOBALS['previousday'] = 0;
     foreach ($lposts as $post) {
         $GLOBALS['post'] = $post;
         if ($block['use_theme_template'] == 0) {
             $content = array();
             start_wp();
             $content['date'] = the_date($GLOBALS['dateformat'], '', '', false);
             $content['time'] = the_time('', false);
             $content['title'] = the_title('', '', false);
             $content['permlink'] = get_permalink();
             $content['author'] = the_author_posts_link('', false);
             $content['category'] = the_category('', '', false);
             $content['body'] = the_content(_WP_TPL_MORE, 0, '', false);
             $content['linkpage'] = link_pages('<br />Pages: ', '<br />', 'number', 'next page', 'previous page', '%', '', false);
             if (get_xoops_option(wp_mod(), 'wp_use_xoops_comments') == 0) {
                 $content['comments'] = comments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
             } else {
                 $content['comments'] = xcomments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
                 $content['comments'] .= " | ";
                 $content['comments'] .= comments_popup_link(_WP_TPL_TRACKBACK0, _WP_TPL_TRACKBACK1, _WP_TPL_TRACKBACKS, '', 'Trackback Off', false);
             }
             $content['trackback'] = trackback_rdf(0, false);
             $block['contents'][] = $content;
         } else {
             ob_start();
             include get_custom_path('content_block-template.php');
             $block['template_content'] .= ob_get_contents();
             ob_end_clean();
         }
     }
     $_wpTpl =& new WordPresTpl('theme');
     $_wpTpl->assign('block', $block);
     if (!$_wpTpl->tpl_exists($tpl_file)) {
         $tpl_file = 'wp_contents.html';
     }
     $block['content'] = $_wpTpl->fetch($tpl_file);
     $GLOBALS['previousday'] = 0;
     $GLOBALS['day'] = 0;
     $GLOBALS['comment_count_cache'][wp_id()] = array();
     return $block;
 }
 function _b_wp_contents_show($options, $wp_num = "")
 {
     $no_posts = empty($options[0]) ? 10 : $options[0];
     $GLOBALS['dateformat'] = stripslashes(get_settings('date_format'));
     $GLOBALS['timeformat'] = stripslashes(get_settings('time_format'));
     $_criteria = new CriteriaCompo(new Criteria('post_status', 'publish'));
     $_criteria->add(new Criteria('post_date', current_time('mysql'), '<='));
     $_criteria->setGroupBy(wp_table('posts') . '.ID');
     $_criteria->setSort('post_date');
     $_criteria->setOrder('DESC');
     $_criteria->setLimit($no_posts);
     $_criteria->setStart(0);
     $postHandler =& wp_handler('Post');
     $postObjects =& $postHandler->getObjects($_criteria, false, '', 'DISTINCT');
     $lposts = array();
     foreach ($postObjects as $postObject) {
         $lposts[] =& $postObject->exportWpObject();
     }
     if ($lposts) {
         // Get the categories for all the posts
         $_post_id_list = array();
         foreach ($lposts as $post) {
             $_post_id_list[] = $post->ID;
             $GLOBALS['category_cache'][wp_id()][$post->ID] = array();
         }
         $_post_id_list = implode(',', $_post_id_list);
         $_post_id_criteria =& new Criteria('post_id', '(' . $_post_id_list . ')', 'IN');
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('post2cat'), 'ID', 'post_id');
         $_joinCriteria->cascade(new XoopsJoinCriteria(wp_table('categories'), 'category_id', 'cat_ID'));
         $postObjects =& $postHandler->getObjects($_post_id_criteria, false, 'ID, category_id, cat_name, category_nicename, category_description, category_parent', true, $_joinCriteria);
         foreach ($postObjects as $postObject) {
             $_cat->ID = $postObject->getVar('ID');
             $_cat->category_id = $postObject->getExtraVar('category_id');
             $_cat->cat_name = $postObject->getExtraVar('cat_name');
             $_cat->category_nicename = $postObject->getExtraVar('category_nicename');
             $_cat->category_description = $postObject->getExtraVar('category_description');
             $_cat->category_parent = $postObject->getExtraVar('category_parent');
             $GLOBALS['category_cache'][wp_id()][$postObject->getVar('ID')][] =& $_cat;
             unset($_cat);
         }
         // Do the same for comment numbers
         $_criteria =& new CriteriaCompo(new Criteria('post_status', 'publish'));
         $_criteria->add(new Criteria('comment_approved', '1 '));
         $_criteria->add($_post_id_criteria);
         $_criteria->setGroupBy('ID');
         $_joinCriteria =& new XoopsJoinCriteria(wp_table('comments'), 'ID', 'comment_post_ID');
         $postObjects =& $postHandler->getObjects($_criteria, false, 'ID, COUNT( comment_ID ) AS ccount', false, $_joinCriteria);
         foreach ($postObjects as $postObject) {
             $GLOBALS['comment_count_cache'][wp_id()]['' . $postObject->getVar('ID')] = $postObject->getExtraVar('ccount');
         }
     }
     $blog = 1;
     $block = array();
     $block['use_theme_template'] = get_xoops_option(wp_mod(), 'use_theme_template');
     $block['style'] = block_style_get(false);
     $block['divid'] = 'wpBlockContent' . $wp_num;
     $block['template_content'] = "";
     $i = 0;
     $GLOBALS['previousday'] = 0;
     foreach ($lposts as $post) {
         $GLOBALS['post'] = $post;
         if ($block['use_theme_template'] == 0) {
             $content = array();
             start_wp();
             $content['date'] = the_date($GLOBALS['dateformat'], '', '', false);
             $content['time'] = the_time('', false);
             $content['title'] = the_title('', '', false);
             $content['permlink'] = get_permalink();
             $content['author'] = the_author_posts_link('', false);
             $content['category'] = the_category('', '', false);
             $content['body'] = the_content(_WP_TPL_MORE, 0, '', false);
             $content['linkpage'] = link_pages('<br />Pages: ', '<br />', 'number', 'next page', 'previous page', '%', '', false);
             if (get_xoops_option(wp_mod(), 'wp_use_xoops_comments') == 0) {
                 $content['comments'] = comments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
             } else {
                 $content['comments'] = xcomments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
                 $content['comments'] .= " | ";
                 $content['comments'] .= comments_popup_link(_WP_TPL_COMMENT0, _WP_TPL_COMMENT1, _WP_TPL_COMMENTS, '', 'Comments Off', false);
             }
             $content['trackback'] = trackback_rdf(0, false);
             $block['contents'][] = $content;
         } else {
             ob_start();
             include get_custom_path('content_block-template.php');
             $block['template_content'] .= ob_get_contents();
             ob_end_clean();
         }
     }
     $GLOBALS['previousday'] = 0;
     $GLOBALS['day'] = 0;
     $GLOBALS['comment_count_cache'][wp_id()] = array();
     return $block;
 }
 function get_author_link($echo = false, $author_id, $author_name = "")
 {
     $permalink_structure = get_settings('permalink_structure');
     if ($permalink_structure == '') {
         $link = wp_siteurl() . '/index.php?author=' . $author_id;
     } else {
         if ($author_name == '') {
             $author_name = $GLOBALS['cache_userdata'][wp_id()][$author_id]->user_login;
         }
         // Get any static stuff from the front
         $front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
         $link = wp_siteurl() . $front . 'author/';
         $link .= rawurlencode($author_name) . '/';
     }
     return _echo($link, $echo);
 }
    function block_style_get($echo = true, $with_tpl = true)
    {
        $wp_num = wp_id() == '-' ? '' : wp_id();
        if ($with_tpl) {
            if (get_xoops_option(wp_mod(), 'wp_use_blockcssheader') == 1) {
                $tplVars =& $GLOBALS['xoopsTpl']->get_template_vars();
                $csslink = "\n" . '<link rel="stylesheet" type="text/css" media="screen" href="' . wp_siteurl() . '/wp-blockstyle.php" />';
                if (array_key_exists('xoops_block_header', $tplVars)) {
                    if (!strstr($tplVars['xoops_block_header'], $csslink)) {
                        $GLOBALS['xoopsTpl']->assign('xoops_block_header', $tplVars['xoops_block_header'] . $csslink);
                    }
                } else {
                    $GLOBALS['xoopsTpl']->assign('xoops_block_header', $csslink);
                }
                return;
            } else {
                if (get_xoops_option(wp_mod(), 'wp_use_blockcssheader') == 2) {
                    $tplVars =& $GLOBALS['xoopsTpl']->get_template_vars();
                    $csslink = '" />' . "\n" . '<link rel="stylesheet" type="text/css" media="screen" href="' . wp_siteurl() . '/wp-blockstyle.php';
                    if (!strstr($tplVars['xoops_themecss'], $csslink)) {
                        $GLOBALS['xoopsTpl']->assign('xoops_themecss', $tplVars['xoops_themecss'] . $csslink);
                    }
                    return;
                } else {
                    if (!defined('WP_BLOCKSTYLE_READ' . $wp_num)) {
                        define('WP_BLOCKSTYLE_READ' . $wp_num, 1);
                        if ($echo) {
                            echo '<style type="text/css" media="screen">@import url(' . wp_siteurl() . '/wp-blockstyle.php);</style>' . "\n";
                        } else {
                            return '<style type="text/css" media="screen">@import url(' . wp_siteurl() . '/wp-blockstyle.php);</style>';
                        }
                    }
                    return '';
                }
            }
        }
        $wp_block_style = '';
        include_once get_custom_path('wp-blocks.css.php');
        if ($echo) {
            if (trim($wp_block_style) != "") {
                echo <<<EOD
<style type="text/css" media="screen">
    <!--
\t{$wp_block_style}
    -->
</style>
EOD;
            }
        } else {
            return trim($wp_block_style);
        }
    }
        } else {
            if (file_exists(XOOPS_ROOT_PATH . '/common/spaw/spaw_control.class.php')) {
                $use_spaw = true;
                $spaw_root = XOOPS_ROOT_PATH . '/common/spaw/';
            }
        }
        if (!file_exists($spaw_root . 'class/script_gecko.js.php') && $is_gecko) {
            $use_spaw = false;
        }
    }
} else {
    $use_spaw = false;
}
// $use_koivi = $GLOBALS['wp_use_koivi'];
$smilies = array();
foreach ($GLOBALS['wpsmiliestrans'][wp_id()] as $smiley => $img) {
    $smile['id'] = str_replace("'", "\\'", $smiley);
    $smile['path'] = $smilies_directory . '/' . $img;
    $smile['name'] = $smiley;
    $smilies[] = $smile;
}
if ($use_spaw) {
    include_once $spaw_root . "spaw_control.class.php";
    $trans_tbl = get_html_translation_table(HTML_SPECIALCHARS);
    $trans_tbl = array_flip($trans_tbl);
    $content = strtr($content, $trans_tbl);
    $sw = new SPAW_Wysiwyg('wp_content', $content, _LANGCODE, 'full', 'default', '70%', '400px');
    $spaw_form = $sw->getHtml();
    //} else if ($use_koivi) {
    //	include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
    //	include_once 'wysiwyg/formwysiwygtextarea.php';
    if ($meta_list = $GLOBALS['wpdb']->get_results('SELECT post_id, meta_key, meta_value FROM ' . wp_table('postmeta') . ' WHERE post_id IN(' . $_post_id_list . ') ORDER BY post_id, meta_key', ARRAY_A)) {
        // Change from flat structure to hierarchical:
        $GLOBALS['post_meta_cache'][wp_id()] = array();
        foreach ($meta_list as $metarow) {
            $mpid = $metarow['post_id'];
            $mkey = $metarow['meta_key'];
            $mval = $metarow['meta_value'];
            // Force subkeys to be array type:
            if (!isset($GLOBALS['post_meta_cache'][wp_id()][$mpid]) || !is_array($GLOBALS['post_meta_cache'][wp_id()][$mpid])) {
                $GLOBALS['post_meta_cache'][wp_id()][$mpid] = array();
            }
            if (!isset($GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"]) || !is_array($GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"])) {
                $GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"] = array();
            }
            // Add a value to the current pid/key:
            $GLOBALS['post_meta_cache'][wp_id()][$mpid]["{$mkey}"][] = $mval;
        }
    }
}
if (preg_match('#/modules/' . wp_mod() . '(/|/index.php.*)?$#', $_SERVER['PHP_SELF'])) {
    //redirect feed and trackback
    if (test_param('feed')) {
        require_once 'wp-feed.php';
        exit;
    } else {
        if (test_param('tb')) {
            $trackback_filename = get_settings('trackback_filename') ? get_settings('trackback_filename') : 'wp-trackback.php';
            require_once $trackback_filename;
            exit;
        }
    }
 function convert_smilies($text)
 {
     if (get_settings('use_smilies')) {
         // HTML loop taken from texturize function, could possible be consolidated
         $textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE);
         // capture the tags as well as in between
         $stop = count($textarr);
         // loop stuff
         $output = '';
         for ($i = 0; $i < $stop; $i++) {
             $content = $textarr[$i];
             if (strlen($content) > 0 && '<' != $content[0]) {
                 // If it's not a tag
                 $content = str_replace($GLOBALS['wp_smiliessearch'][wp_id()], $GLOBALS['wp_smiliesreplace'][wp_id()], $content);
             }
             $output .= $content;
         }
     } else {
         // return default text.
         $output = $text;
     }
     return $output;
 }
    function block_style_get($echo = true, $with_tpl = true)
    {
        $wp_num = wp_id() == '-' ? '' : wp_id();
        if ($with_tpl) {
            if (get_xoops_option(wp_mod(), 'wp_use_blockcssheader')) {
                $tplVars =& $GLOBALS['xoopsTpl']->get_template_vars();
                $csslink = "\n<link rel='stylesheet' type='text/css' media='screen' href='" . wp_siteurl() . "/wp-blockstyle.php' />";
                if (array_key_exists('xoops_block_header', $tplVars)) {
                    if (!strstr($tplVars['xoops_block_header'], $csslink)) {
                        $GLOBALS['xoopsTpl']->assign('xoops_block_header', $tplVars['xoops_block_header'] . $csslink);
                    }
                } else {
                    $GLOBALS['xoopsTpl']->assign('xoops_block_header', $csslink);
                }
                return;
            } else {
                if (!defined('WP_BLOCKSTYLE_READ' . $wp_num)) {
                    define('WP_BLOCKSTYLE_READ' . $wp_num, 1);
                    echo '<style type="text/css" midia="screen">@import url(' . wp_siteurl() . '/wp-blockstyle.php);</style>' . "\n";
                }
                return;
            }
        }
        if (file_exists(wp_base() . '/themes/' . $GLOBALS['xoopsConfig']['theme_set'] . '/wp-blocks.css.php')) {
            $themes = $GLOBALS['xoopsConfig']['theme_set'];
        } else {
            $themes = 'default';
        }
        $wp_block_style = '';
        include_once wp_base() . '/themes/' . $themes . '/wp-blocks.css.php';
        if ($echo) {
            if (trim($wp_block_style) != "") {
                echo <<<EOD
<style type="text/css" media="screen">
    <!--
\t{$wp_block_style}
    -->
</style>
EOD;
            }
        } else {
            return trim($wp_block_style);
        }
    }
Ejemplo n.º 20
0
 public function update()
 {
     $this->load_auth();
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url("{$this->controller}/index/{$p_usaha_id}"));
     }
     $p_usaha_id = $this->uri->segment(4);
     $p_type_id = $this->uri->segment(5);
     $p_id = $this->uri->segment(6);
     //cek kohir
     if ($this->sptpd_model->is_kohir_ok($p_id) && !is_super_admin()) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url("{$this->controller}/index/{$p_usaha_id}"));
     }
     // cek pmb
     // kalau user sa boleh edit. 17-10-2014 (AA)
     if ($this->sptpd_model->is_bayar($p_id) && !is_super_admin()) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url("{$this->controller}/index/{$p_usaha_id}"));
     }
     $data['current'] = $this->module;
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("{$this->controller}/update/{$p_usaha_id}/{$p_type_id}/{$p_id}");
     $post_data = $this->fpost($p_usaha_id);
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         //cek nama wp - kalo beda update nama
         /*
         $wp_data = $this->load->model('subjek_pajak_model')->get($input_post['customer_id']);
         $wp_nama = $wp_data->nama;
         $cid  = $input_post['customer_id'];
         if($wp_nama != $input_post['nama']) {
             $this->load->model('subjek_pajak_model')->rename_wp($cid, $input_post['nama']);
         }
         */
         //HANDLE JIKA TANGGAL TERIMA BACKDATE
         $sptno = $input_post['sptno'];
         $query = $this->db->query("select terimatgl from pad_spt where id={$p_id}");
         foreach ($query->result() as $row) {
             $trmtgl_old = $row->terimatgl;
         }
         $trmtgl_old = (new DateTime($trmtgl_old))->format('Y-m');
         $trmtgl_new = (new DateTime($input_post['terimatgl']))->format('Y-m');
         $bln = date('m', strtotime($input_post['terimatgl']));
         $thn = date('Y', strtotime($input_post['terimatgl']));
         if (strtotime($trmtgl_new) < strtotime($trmtgl_old)) {
             $query = $this->db->query("select sptno from pad_spt where usaha_id={$p_usaha_id}  \r\n                                            AND EXTRACT(MONTH FROM terimatgl) = {$bln}  \r\n                                            AND EXTRACT(YEAR FROM terimatgl) = {$thn} \r\n                                            order by sptno desc limit 1;");
             foreach ($query->result() as $row) {
                 $sptno = $row->sptno + 1;
             }
             if ($query->num_rows() < 1) {
                 $sptno = 1;
             }
         } else {
             $sptno = $input_post['sptno'];
         }
         // END HANDLE
         $update_data = array('sptno' => $sptno, 'customer_id' => $input_post['customer_id'], 'customer_usaha_id' => $input_post['customer_usaha_id'], 'pajak_id' => $input_post['pajak_id'], 'tahun' => date('Y', strtotime($input_post['terimatgl'])), 'terimatgl' => date('Y-m-d', strtotime($input_post['terimatgl'])), 'bulan' => date('m', strtotime($input_post['terimatgl'])), 'type_id' => $input_post['type_id'], 'so' => $input_post['so'], 'jatuhtempotgl' => date('Y-m-d', strtotime($input_post['jatuhtempotgl'])), 'masadari' => date('Y-m-d', strtotime($input_post['masadari'])), 'masasd' => date('Y-m-d', strtotime($input_post['masasd'])), 'minimal_omset' => $input_post['minimal_omset'], 'dasar' => $input_post['dasar'], 'tarif' => $input_post['tarif'], 'denda' => $input_post['denda'], 'bunga' => $input_post['bunga'], 'setoran' => $input_post['setoran'], 'kenaikan' => $input_post['kenaikan'], 'kompensasi' => $input_post['kompensasi'], 'lain2' => $input_post['lain2'], 'pajak_terhutang' => $input_post['pajak'], 'r_bayarid' => $input_post['r_bayarid'], 'r_nsr' => $input_post['r_nsr'], 'rekening_id' => $input_post['rekening_id'], 'doc_no' => $input_post['doc_no'], 'cara_bayar' => $input_post['cara_bayar'], 'usaha_id' => $p_usaha_id, 'multiple' => $input_post['multiple'], 'omset1' => $input_post['omset1'], 'omset6' => $input_post['omset6'], 'omset2' => $input_post['omset2'], 'omset7' => $input_post['omset7'], 'omset3' => $input_post['omset3'], 'omset8' => $input_post['omset8'], 'omset4' => $input_post['omset4'], 'omset9' => $input_post['omset9'], 'omset5' => $input_post['omset5'], 'omset10' => $input_post['omset10'], 'omset11' => $input_post['omset11'], 'omset16' => $input_post['omset16'], 'omset12' => $input_post['omset12'], 'omset17' => $input_post['omset17'], 'omset13' => $input_post['omset13'], 'omset18' => $input_post['omset18'], 'omset14' => $input_post['omset14'], 'omset19' => $input_post['omset19'], 'omset15' => $input_post['omset15'], 'omset20' => $input_post['omset20'], 'omset21' => $input_post['omset21'], 'omset26' => $input_post['omset26'], 'omset22' => $input_post['omset22'], 'omset27' => $input_post['omset27'], 'omset23' => $input_post['omset23'], 'omset28' => $input_post['omset28'], 'omset24' => $input_post['omset24'], 'omset29' => $input_post['omset29'], 'omset25' => $input_post['omset25'], 'omset30' => $input_post['omset30'], 'omset31' => $input_post['omset31'], 'omset_lain' => $input_post['omset32'], 'keterangan1' => $input_post['keterangan1'], 'keterangan6' => $input_post['keterangan6'], 'keterangan2' => $input_post['keterangan2'], 'keterangan7' => $input_post['keterangan7'], 'keterangan3' => $input_post['keterangan3'], 'keterangan8' => $input_post['keterangan8'], 'keterangan4' => $input_post['keterangan4'], 'keterangan9' => $input_post['keterangan9'], 'keterangan5' => $input_post['keterangan5'], 'keterangan10' => $input_post['keterangan10'], 'keterangan11' => $input_post['keterangan11'], 'keterangan16' => $input_post['keterangan16'], 'keterangan12' => $input_post['keterangan12'], 'keterangan17' => $input_post['keterangan17'], 'keterangan13' => $input_post['keterangan13'], 'keterangan18' => $input_post['keterangan18'], 'keterangan14' => $input_post['keterangan14'], 'keterangan19' => $input_post['keterangan19'], 'keterangan15' => $input_post['keterangan15'], 'keterangan20' => $input_post['keterangan20'], 'keterangan21' => $input_post['keterangan21'], 'keterangan26' => $input_post['keterangan26'], 'keterangan22' => $input_post['keterangan22'], 'keterangan27' => $input_post['keterangan27'], 'keterangan23' => $input_post['keterangan23'], 'keterangan28' => $input_post['keterangan28'], 'keterangan24' => $input_post['keterangan24'], 'keterangan29' => $input_post['keterangan29'], 'keterangan25' => $input_post['keterangan25'], 'keterangan30' => $input_post['keterangan30'], 'keterangan31' => $input_post['keterangan31'], 'keterangan_lain' => $input_post['keterangan32'], 'updated' => date('Y-m-d'), 'update_uid' => sipkd_user_id(), 'notes' => $input_post['notes']);
         $reklame_data = array();
         if ($p_usaha_id == pad_reklame_id()) {
             $input_post = $post_data;
             $reklame_data = array('r_nsrno' => $input_post['r_nsrno'], 'r_nsrtgl' => empty($input_post['r_nsrtgl']) ? NULL : date('Y-m-d', strtotime($input_post['r_nsrtgl'])), 'r_tarifid' => $input_post['r_tarifid'], 'r_kontrak' => $input_post['r_kontrak'], 'r_judul' => $input_post['r_judul'], 'r_calculated' => $input_post['r_calculated'], 'r_sudut_pandang_id' => $input_post['r_sudut_pandang_id'], 'r_sudut_pandang_val' => $input_post['r_sudut_pandang_val'], 'r_njop' => $input_post['r_njop'], 'r_status' => $input_post['r_status'], 'ijin_no' => $input_post['ijin_no'], 'jenis_masa' => $input_post['jenis_masa'], 'no_telp' => $input_post['no_telp'], 'r_lokasi' => $input_post['r_lokasi'], 'skpd_lama' => $input_post['skpd_old']);
         }
         $air_tanah_data = array();
         if ($p_usaha_id == pad_air_tanah_id()) {
             $input_post = $post_data;
             $air_tanah_data = array('volume' => $input_post['volume'], 'satuan' => 'M3');
         }
         if ($this->session->userdata("mode") == "edit") {
             if ($input_post['multiple'] == 0) {
                 $lastinput = date('Y-m-d', strtotime($input_post['masadari']));
                 $customer_usaha_id = $input_post['customer_usaha_id'];
                 $pajak_id = $input_post['pajak_id'];
                 $masapajak_bulan = $input_post['masapajak_bulan'];
                 $rekening_id = $input_post['rekening_id'];
                 $type_id = $input_post['type_id'];
                 $cekduplikat = $this->sptpd_model->is_multiple($customer_usaha_id, $pajak_id, $type_id, $rekening_id, $lastinput, $this->session->userdata("mode"));
                 if ($cekduplikat == true) {
                     $this->session->set_flashdata('msg_warning', 'Pajak tersebut dengan Masa Pajak: ' . $masapajak_bulan . ' Sudah Ada, Harap Cek Data-data Sebelumnya');
                     redirect(active_module_url($this->controller . '/index/' . $p_usaha_id));
                 } else {
                     //data_valid
                     $update_data = array_merge($update_data, $reklame_data, $air_tanah_data);
                     $this->sptpd_model->update($p_id, $update_data);
                 }
             } else {
                 $update_data = array_merge($update_data, $reklame_data, $air_tanah_data);
                 $this->sptpd_model->update($p_id, $update_data);
             }
         } else {
             $this->session->set_flashdata('msg_warning', 'UNKNOWN MODE');
             redirect(active_module_url($this->controller . '/index/' . $p_usaha_id));
         }
         $update_uid = sipkd_user_id();
         $updated = date('Y-m-d h:i:s');
         if ($p_usaha_id == pad_air_tanah_id()) {
             $end = $input_post['end_loop_sumur'];
             $query = $this->db->query("select * from pad_air_tanah where spt_id = {$p_id} limit 1");
             foreach ($query->result() as $row) {
                 $create_uid = $row->create_uid;
                 $created = $row->created;
             }
             $query = $this->db->query("delete from pad_air_tanah where spt_id = {$p_id}");
             //delete dulu
             $spt_id = $p_id;
             for ($i = 1; $i <= $end; $i++) {
                 $m_sumur = 'sumur_ke' . $i;
                 $m_awal = 'meteran_awal' . $i;
                 $m_akhir = 'meteran_akhir' . $i;
                 $m_volume = 'volume' . $i;
                 $m_sipa = 'sipa_no' . $i;
                 $sumur = $input_post[$m_sumur];
                 $awal = $input_post[$m_awal];
                 $akhir = $input_post[$m_akhir];
                 $vol = $input_post[$m_volume];
                 $sipa_no = $input_post[$m_sipa];
                 $this->db->query("insert into pad_air_tanah (sumur_ke, spt_id, sipa_no, awal, akhir, volume, create_uid, created, update_uid, updated) \r\n                                          values ({$sumur}, {$spt_id}, '{$sipa_no}' , {$awal}, {$akhir}, {$vol},  {$create_uid}, '{$created}', {$update_uid}, '{$updated}')");
             }
             $tarif = $input_post['tarif'];
             $this->db->query("delete from pad_air_tanah_hit where spt_id={$spt_id}");
             for ($i = 1; $i <= $input_post['max_hit']; $i++) {
                 $volume = $input_post['hit_vol' . $i];
                 $hda = $input_post['hit_hda' . $i];
                 $jumlah = $input_post['hit_val' . $i];
                 $this->db->query("insert into pad_air_tanah_hit \r\n                                             (spt_id,  vol,      hda,  jumlah,  tarif,  update_uid,   updated) \r\n                                      values ({$spt_id}, {$volume},  {$hda}, {$jumlah}, {$tarif}, {$update_uid}, '{$updated}')");
             }
         }
         if ($p_usaha_id == pad_reklame_id()) {
             // data tambahan / detail
             $dtKD = $this->input->post('dtKD');
             $tambahan_data2 = array();
             if (isset($dtKD)) {
                 $i = 1;
                 $dtKD = json_decode($dtKD, true);
                 if (count($dtKD['dtKD']) > 0) {
                     $rd_row = array();
                     foreach ($dtKD['dtKD'] as $rows) {
                         $rd_row = array('spt_id' => $p_id, 'media_id' => $rows[0], 'kelas_jalan_id' => $rows[2], 'panjang' => $rows[4], 'lebar' => $rows[5], 'tinggi' => $rows[6], 'sisi' => $rows[8], 'banyak' => $rows[9], 'lama' => $rows[10], 'nsr' => pad_to_decimal($rows[11]), 'tambahan' => pad_to_decimal($rows[12]), 'alamat' => $rows[14], 'status_baliho' => $rows[16], 'jalan_id' => $rows[17], 'updated' => $updated, 'update_uid' => $update_uid);
                         $i++;
                         $tambahan_data2 = array_merge($tambahan_data2, array($rd_row));
                     }
                     //langsung ajah dah - sementara
                     $query = "delete from pad_spt_reklame where spt_id = {$p_id}";
                     $this->db->query($query);
                     $this->db->insert_batch('pad_spt_reklame', $tambahan_data2);
                 }
             }
         }
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url("{$this->controller}/index/{$p_usaha_id}"));
     }
     $data['dt'] = $post_data;
     $get = (object) $post_data;
     $options = array();
     $js = 'id="customer_usaha_id" class="input-xlarge" readonly ';
     $data['select_usaha'] = form_dropdown('customer_usaha_id', $options, null, $js);
     $select_data = $this->load->model('pad_model')->sptpd_get_pajak($p_usaha_id);
     $options = array();
     if ($select_data) {
         foreach ($select_data as $rows) {
             if ($p_usaha_id == pad_reklame_id()) {
                 $options[$rows->id] = $rows->nama . " = " . number_format($rows->reklame, 0, ',', '.');
             } else {
                 $options[$rows->id] = $rows->nama;
             }
         }
     }
     $js = 'id="pajak_id" class="form-control"';
     $data['select_pajak'] = form_dropdown('pajak_id', $options, $get->pajak_id, $js);
     $select_data = $this->load->model('sptpd_type_model')->get_select();
     $options = array();
     if ($select_data) {
         foreach ($select_data as $rows) {
             $options[$rows->id] = $rows->typenm;
         }
     }
     $js = 'id="type_id" class="input-small" onChange="void(0);"';
     $data['select_sptpd_type'] = form_dropdown('type_id', $options, $get->type_id, $js);
     $pajak_detail = $this->load->model('pad_model');
     if ($row = $pajak_detail->sptpd_get_pajak_detail($get->pajak_id, $get->terimatgl, 0)) {
         $data['dt']['rekening_id'] = $row->rekening_id;
         $data['dt']['kode'] = $row->kode;
         $data['dt']['jatuhtempo'] = $row->jatuhtempo;
     } else {
         $data['dt']['kode'] = '';
         $data['dt']['jatuhtempo'] = '';
     }
     if ($p_usaha_id == pad_reklame_id()) {
         //-new
         $select_data = $this->load->model('reklame_nilai_strategis_model')->get_select();
         $options = array();
         if ($select_data) {
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->nama;
             }
         }
         $js = 'id="r_nsr_id" class="input-xlarge" required ';
         $data['select_nsr'] = form_dropdown('r_nsr_id', $options, $get->r_nsr_id, $js);
         $select_data = $this->load->model('reklame_lokasi_pasang_model')->get_select();
         $options = array();
         if ($select_data) {
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->nama;
             }
         }
         $js = 'id="r_lokasi_pasang_id" class="input-xlarge" required ';
         $data['select_lokasi_pasang'] = form_dropdown('r_lokasi_pasang_id', $options, $get->r_lokasi_pasang_id, $js);
         $select_data = $this->load->model('reklame_sudut_pandang_model')->get_select();
         $options = array();
         if ($select_data) {
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->nama;
             }
         }
         $js = 'id="r_sudut_pandang_id" class="input-xlarge" required ';
         $data['select_sudut_pandang'] = form_dropdown('r_sudut_pandang_id', $options, $get->r_sudut_pandang_id, $js);
         $options = array('Pasang Baru' => 'Pasang Baru', 'Perpanjangan' => 'Perpanjangan');
         $js = 'id="r_status" class="input-large" required ';
         $data['select_status'] = form_dropdown('r_status', $options, $get->r_status, $js);
         //-end-new
         $select_data = $this->load->model('jalan_kelas_model')->get_select();
         $options = array();
         if ($select_data) {
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->nama;
             }
         }
         $js = 'id="r_jalanklas_id" class="input-xlarge" required ';
         $data['select_jalan_kelas'] = form_dropdown('r_jalanklas_id', $options, $get->r_jalanklas_id, $js);
         $select_data = $this->load->model('jalan_model')->get_select();
         $options = array();
         if ($select_data) {
             $options[] = "# KOSONG #";
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->nama;
             }
         }
         $js = 'id="r_jalan_id" class="input-large combobox" ';
         $data['select_jalan'] = form_dropdown('r_jalan_id', $options, $get->r_jalan_id, $js);
         $select_data = $this->load->model('kecamatan_model')->get_select();
         $options = array();
         if ($select_data) {
             foreach ($select_data as $row) {
                 $options[$row->id] = $row->nama;
             }
         }
         $js = 'id="r_lokasi_id" class="input-medium" required ';
         $data['select_lokasi'] = form_dropdown('r_lokasi_id', $options, $get->r_lokasi_id, $js);
         $options = array(1 => 'Tidak ada', 2 => 'Produk Rokok +25%');
         $js = 'id="r_tarifid" class="input-large" required ';
         $data['select_tarif'] = form_dropdown('r_tarifid', $options, $get->r_tarifid, $js);
         if (!wp_login()) {
             $this->load->view('vsptpd_form_reklame', $data);
         } else {
             $data['dt']['customer_id'] = wp_id();
             $this->load->view('wp/vsptpd_form_reklame', $data);
         }
     } else {
         if ($p_usaha_id == pad_air_tanah_id()) {
             $select_data = $this->load->model('air_zona_model')->get_select();
             $options = array();
             if ($select_data) {
                 foreach ($select_data as $row) {
                     $options[$row->id] = $row->nama;
                 }
             }
             $js = 'id="air_zona_id" class="input-medium" required ';
             $data['select_zona'] = form_dropdown('air_zona_id', $options, $get->air_zona_id, $js);
             $select_data = $this->load->model('air_manfaat_model')->get_select();
             $options = array();
             if ($select_data) {
                 foreach ($select_data as $row) {
                     $options[$row->id] = $row->nama;
                 }
             }
             $js = 'id="air_manfaat_id" class="input-medium" required ';
             $data['select_manfaat'] = form_dropdown('air_manfaat_id', $options, $get->air_manfaat_id, $js);
             if (!wp_login()) {
                 $this->load->view('vsptpd_form_at', $data);
             } else {
                 $data['dt']['customer_id'] = wp_id();
                 $this->load->view('wp/vsptpd_form_at', $data);
             }
         } else {
             if (!wp_login()) {
                 $this->load->view('vsptpd_form', $data);
             } else {
                 $data['dt']['customer_id'] = wp_id();
                 $this->load->view('wp/vsptpd_form', $data);
             }
         }
     }
 }
 function in_category($category)
 {
     // Check if the current post is in the given category
     $cats = '';
     foreach ($GLOBALS['category_cache'][wp_id()][$GLOBALS['post']->ID] as $cat) {
         $cats[] = $cat->category_id;
     }
     if (in_array($category, $cats)) {
         return true;
     } else {
         return false;
     }
 }
Ejemplo n.º 22
0
                     if ($msg == '') {
                         //no error message
                         $result = $wpdb->query("UPDATE " . wp_table('options') . " SET option_value = '{$new_val}' WHERE option_id = {$option->option_id}");
                         if (!$result) {
                             $db_errors .= " SQL error while saving {$this_name}. ";
                         } else {
                             ++$any_changed;
                         }
                     } else {
                         $validation_message .= $msg;
                     }
                 }
             }
         }
         // end foreach
         unset($GLOBALS['cache_settings'][wp_id()]);
         // so they will be re-read
     }
     // end if options
     if ($any_changed) {
         $message = $any_changed . _LANG_WOP_SETTING_SAVED;
     }
     if ($dB_errors != '' || $validation_message != '') {
         if ($message != '') {
             $message .= '<br />and ';
         }
         $message .= $dB_errors . '<br />' . $validation_message;
     }
     //break; //fall through
 //break; //fall through
 default:
Ejemplo n.º 23
0
 public function update()
 {
     $this->load_auth();
     if (!$this->module_auth->update) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     $p_usaha_id = $this->uri->segment(4);
     $p_type_id = $this->uri->segment(5);
     $p_id = $this->uri->segment(6);
     //cek tipe dokumen -> cm bisa edit yg self aja
     if ($p_type_id != pad_dok_self_id()) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     //cek usaha
     if ($p_usaha_id == pad_reklame_id() || $p_usaha_id == pad_air_tanah_id()) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     //cek kohir
     //if ($this->sptpd_model->is_kohir_ok($p_id)) {
     //   $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
     //    redirect(active_module_url($this->controller));
     //}
     if ($this->sptpd_model->is_bayar($p_id)) {
         $this->session->set_flashdata('msg_warning', $this->module_auth->msg_update);
         redirect(active_module_url($this->controller));
     }
     //Validasi Multiple
     $data['current'] = $this->module;
     $data['apps'] = $this->apps_model->get_active_only();
     $data['faction'] = active_module_url("{$this->controller}/update/{$p_usaha_id}/{$p_type_id}/{$p_id}");
     $post_data = $this->fpost($p_usaha_id);
     $this->fvalidation();
     if ($this->form_validation->run() == TRUE) {
         $input_post = $post_data;
         $update_data = array('customer_id' => $input_post['customer_id'], 'customer_usaha_id' => $input_post['customer_usaha_id'], 'pajak_id' => $input_post['pajak_id'], 'tahun' => date('Y', strtotime($input_post['terimatgl'])), 'bulan' => date('m', strtotime($input_post['terimatgl'])), 'terimatgl' => date('Y-m-d', strtotime($input_post['terimatgl'])), 'type_id' => $input_post['type_id'], 'so' => $input_post['so'], 'jatuhtempotgl' => date('Y-m-d', strtotime($input_post['jatuhtempotgl'])), 'masadari' => date('Y-m-d', strtotime($input_post['masadari'])), 'masasd' => date('Y-m-d', strtotime($input_post['masasd'])), 'minimal_omset' => $input_post['minimal_omset'], 'dasar' => $input_post['dasar'], 'tarif' => $input_post['tarif'], 'denda' => $input_post['denda'], 'bunga' => $input_post['bunga'], 'setoran' => $input_post['setoran'], 'kenaikan' => $input_post['kenaikan'], 'kompensasi' => $input_post['kompensasi'], 'lain2' => $input_post['lain2'], 'cara_bayar' => $input_post['cara_bayar'], 'pajak_terhutang' => $input_post['pajak'], 'r_bayarid' => $input_post['r_bayarid'], 'r_nsr' => $input_post['r_nsr'], 'rekening_id' => $input_post['rekening_id'], 'updated' => date('Y-m-d'), 'update_uid' => sipkd_user_id(), 'omset1' => $input_post['omset1'], 'omset6' => $input_post['omset6'], 'omset2' => $input_post['omset2'], 'omset7' => $input_post['omset7'], 'omset3' => $input_post['omset3'], 'omset8' => $input_post['omset8'], 'omset4' => $input_post['omset4'], 'omset9' => $input_post['omset9'], 'omset5' => $input_post['omset5'], 'omset10' => $input_post['omset10'], 'omset11' => $input_post['omset11'], 'omset16' => $input_post['omset16'], 'omset12' => $input_post['omset12'], 'omset17' => $input_post['omset17'], 'omset13' => $input_post['omset13'], 'omset18' => $input_post['omset18'], 'omset14' => $input_post['omset14'], 'omset19' => $input_post['omset19'], 'omset15' => $input_post['omset15'], 'omset20' => $input_post['omset20'], 'omset21' => $input_post['omset21'], 'omset26' => $input_post['omset26'], 'omset22' => $input_post['omset22'], 'omset27' => $input_post['omset27'], 'omset23' => $input_post['omset23'], 'omset28' => $input_post['omset28'], 'omset24' => $input_post['omset24'], 'omset29' => $input_post['omset29'], 'omset25' => $input_post['omset25'], 'omset30' => $input_post['omset30'], 'omset31' => $input_post['omset31'], 'omset_lain' => $input_post['omset32'], 'keterangan1' => $input_post['keterangan1'], 'keterangan6' => $input_post['keterangan6'], 'keterangan2' => $input_post['keterangan2'], 'keterangan7' => $input_post['keterangan7'], 'keterangan3' => $input_post['keterangan3'], 'keterangan8' => $input_post['keterangan8'], 'keterangan4' => $input_post['keterangan4'], 'keterangan9' => $input_post['keterangan9'], 'keterangan5' => $input_post['keterangan5'], 'keterangan10' => $input_post['keterangan10'], 'keterangan11' => $input_post['keterangan11'], 'keterangan16' => $input_post['keterangan16'], 'keterangan12' => $input_post['keterangan12'], 'keterangan17' => $input_post['keterangan17'], 'keterangan13' => $input_post['keterangan13'], 'keterangan18' => $input_post['keterangan18'], 'keterangan14' => $input_post['keterangan14'], 'keterangan19' => $input_post['keterangan19'], 'keterangan15' => $input_post['keterangan15'], 'keterangan20' => $input_post['keterangan20'], 'keterangan21' => $input_post['keterangan21'], 'keterangan26' => $input_post['keterangan26'], 'keterangan22' => $input_post['keterangan22'], 'keterangan27' => $input_post['keterangan27'], 'keterangan23' => $input_post['keterangan23'], 'keterangan28' => $input_post['keterangan28'], 'keterangan24' => $input_post['keterangan24'], 'keterangan29' => $input_post['keterangan29'], 'keterangan25' => $input_post['keterangan25'], 'keterangan30' => $input_post['keterangan30'], 'keterangan31' => $input_post['keterangan31'], 'keterangan_lain' => $input_post['keterangan32']);
         $reklame_data = array();
         if ($p_usaha_id == pad_reklame_id()) {
             //
         }
         $air_tanah_data = array();
         if ($p_usaha_id == pad_air_tanah_id()) {
             //
         }
         // data tambahan
         $tambahan_data = array();
         if (wp_login()) {
             //
         }
         // Validasi Duplikasi Masa Pajak
         if ($this->session->userdata("mode") == "edit") {
             if ($input_post['multiple'] == 0) {
                 $lastinput = date('Y-m-d', strtotime($input_post['masadari']));
                 $customer_usaha_id = $input_post['customer_usaha_id'];
                 $pajak_id = $input_post['pajak_id'];
                 $rekening_id = $input_post['rekening_id'];
                 $type_id = $input_post['type_id'];
                 $cekduplikat = $this->sptpd_model->is_multiple($customer_usaha_id, $pajak_id, $type_id, $rekening_id, $lastinput);
                 if ($cekduplikat == true) {
                     $this->session->set_flashdata('msg_warning', 'Pajak dengan Masa Pajak Tersebut Sudah Ada, Harap Cek Data-data Sebelumnya');
                     redirect(active_module_url($this->controller));
                 } else {
                     $update_data = array_merge($update_data, $reklame_data, $air_tanah_data, $tambahan_data);
                     $this->sptpd_model->update($p_id, $update_data);
                 }
             } else {
                 $update_data = array_merge($update_data, $reklame_data, $air_tanah_data, $tambahan_data);
                 $this->sptpd_model->update($p_id, $update_data);
             }
         }
         // data tambahan / detail
         if (wp_login()) {
             //
             // uplod dokeumen
             $this->unggah($p_id);
         }
         $this->session->set_flashdata('msg_success', 'Data telah disimpan');
         redirect(active_module_url($this->controller));
     }
     $data['dt'] = $post_data;
     $get = (object) $post_data;
     $options = array();
     $js = 'id="customer_usaha_id" class="input-xlarge"';
     $data['select_usaha'] = form_dropdown('customer_usaha_id', $options, null, $js);
     $select_data = $this->load->model('pajak_model')->get_select($get->pajak_id);
     $options = array();
     foreach ($select_data as $rows) {
         $options[$rows->id] = $rows->nama;
     }
     $js = 'id="pajak_id" class="input-xxlarge"';
     $data['select_pajak'] = form_dropdown('pajak_id', $options, $get->pajak_id, $js);
     $select_data = $this->load->model('sptpd_type_model')->get_select();
     $options = array();
     foreach ($select_data as $rows) {
         $options[$rows->id] = $rows->typenm;
     }
     $js = 'id="type_id" class="input-small" onChange="void(0);"';
     $data['select_sptpd_type'] = form_dropdown('type_id', $options, $get->type_id, $js);
     $pajak_detail = $this->load->model('pad_model');
     if ($row = $pajak_detail->sptpd_get_pajak_detail($get->pajak_id, $get->terimatgl)) {
         $data['dt']['rekening_id'] = $row->rekening_id;
         $data['dt']['kode'] = $row->kode;
         $data['dt']['jatuhtempo'] = $row->jatuhtempo;
         $data['dt']['multiple'] = $row->multiple;
     }
     if (wp_login()) {
         $this->load->helper('directory');
         $dir = directory_map(dirname(__FILE__) . '//..//dokumen//');
         $files = array();
         foreach ($dir as $file) {
             $f = explode('@', $file);
             if ($f[0] == $p_id) {
                 $files[] = anchor(active_module_url("sptpd/unduh/{$file}"), $f[1], array("title" => "Unduh file {$f['1']}", "target" => "_blank"));
             }
         }
         $data['dt']['files'] = $files;
     }
     if ($p_usaha_id == pad_reklame_id()) {
         //
     } else {
         if ($p_usaha_id == pad_air_tanah_id()) {
             //
         } else {
             if (!wp_login()) {
                 $this->load->view('vsptpd_form', $data);
             } else {
                 $data['dt']['customer_id'] = wp_id();
                 $this->load->view('wp/vsptpd_form', $data);
             }
         }
     }
 }
}
//WordPressプラグイン互換性確保用
$GLOBALS['siteurl'] = wp_siteurl();
update_option('siteurl', $GLOBALS['siteurl'], true);
$GLOBALS['querystring_start'] = '?';
$GLOBALS['querystring_equal'] = '=';
$GLOBALS['querystring_separator'] = '&amp;';
$GLOBALS['dateformat'] = stripslashes(get_settings('date_format'));
$GLOBALS['timeformat'] = stripslashes(get_settings('time_format'));
// Used to guarantee unique cookies
$GLOBALS['cookiehash'] = md5(wp_siteurl());
require wp_base() . '/wp-includes/vars.php';
require wp_base() . '/wp-includes/wp-filter-setup.php';
if (empty($GLOBALS['wp_inblock']) || $GLOBALS['wp_inblock'] != 1) {
    if (!defined('XOOPS_PULUGIN' . wp_id())) {
        define('XOOPS_PULUGIN' . wp_id(), 1);
        if (get_settings('active_plugins')) {
            $check_plugins = explode("\n", get_settings('active_plugins'));
            foreach ($check_plugins as $check_plugin) {
                if (file_exists(wp_base() . '/wp-content/plugins/' . $check_plugin)) {
                    if (!defined(md5('WP_PLUGIN_' . strtoupper($check_plugin) . '_INCLUDED'))) {
                        define(md5('WP_PLUGIN_' . strtoupper($check_plugin) . '_INCLUDED'), 1);
                        require_once wp_base() . '/wp-content/plugins/' . $check_plugin;
                    } else {
                        // It is very tricky!!
                        if (!defined(md5('WP_PLUGIN_' . strtoupper($check_plugin) . wp_base() . '_DEFINED'))) {
                            define(md5('WP_PLUGIN_' . strtoupper($check_plugin) . wp_base() . '_DEFINED'), 1);
                            if (preg_match_all('/(add|remove)_(action|filter)\\s*\\([^\\)]+\\)\\s*\\;/', implode('', file(wp_base() . '/wp-content/plugins/' . $check_plugin)), $matches, PREG_SET_ORDER)) {
                                foreach ($matches as $match) {
                                    eval($match[0]);
                                }
 function get_permalink($id = false)
 {
     $rewritecode = array('%year%', '%monthnum%', '%day%', '%hour%', '%minute%', '%second%', '%postname%', '%post_id%', '%category%', '%author%', '%pagename%');
     $permalink = get_settings('permalink_structure');
     $postHandler =& wp_handler('Post');
     if ($id) {
         $id = intval($id);
         if ($permalink == '') {
             return wp_siteurl() . '/index.php?p=' . $id;
         }
         if (!isset($GLOBALS['permalink_cache'][wp_id()]) || !isset($GLOBALS['permalink_cache'][wp_id()][$id])) {
             $postObject =& $postHandler->get($id);
             $GLOBALS['permalink_cache'][wp_id()][$id] =& $postObject->exportWpObject();
         }
         $idpost = $GLOBALS['permalink_cache'][wp_id()][$id];
     } else {
         $idpost = $GLOBALS['post'];
     }
     if ('' != $permalink) {
         $unixtime = strtotime($idpost->post_date);
         $cats = get_the_category($idpost->ID);
         $category = $cats[0]->category_nicename;
         $authordata = get_userdata($idpost->post_author);
         $author = $authordata->user_login;
         $rewritereplace = array(date('Y', $unixtime), date('m', $unixtime), date('d', $unixtime), date('H', $unixtime), date('i', $unixtime), date('s', $unixtime), $idpost->post_name, $idpost->ID, $category, $author, $idpost->post_name);
         return wp_siteurl() . str_replace($rewritecode, $rewritereplace, $permalink);
     } else {
         return wp_siteurl() . '/index.php?p=' . $idpost->ID;
     }
 }