Example #1
0
function charges_AfterInsert()
{
    //charges_AfterInsert @4-B46BA208
    //Custom Code @13-2A29BDB7
    if (CCGetSession("RecentItemNum")) {
        $ItemNum = CCGetSession("RecentItemNum");
    }
    startlistingnow($ItemNum, CCGetUserID());
}
function Page_BeforeShow()
{
    //Page_BeforeShow @1-66DC429C
    //Set Tag @4-E60AFC09
    global $Tpl;
    $userlog = CCGetSession("RecentUserSign");
    $userem = CCGetSession("RecentUserEmail");
    $Tpl->SetVar("userlogin", $userlog);
    $Tpl->SetVar("useremail", $userem);
    CCSetSession("RecentUserSign", "");
    CCSetSession("RecentUserEmail", "");
    //End Set Tag
}
Example #3
0
function buynowPayPal($ItemNum)
{
    global $Tpl;
    global $EP;
    $Tpl->SetBlockVar("Confirm_PayPal", "");
    $iteminfo = new clsDBNetConnect();
    $query = "Select * from items where ItemNum={$ItemNum}";
    $iteminfo->query($query);
    $iteminfo->next_record();
    $sellerid = $iteminfo->f("user_id");
    $sellerinfo = new clsDBNetConnect();
    $query = "select first_name, last_name, email, user_login from users where user_id={$sellerid}";
    $sellerinfo->query($query);
    $sellerinfo->next_record();
    $userinfo = new clsDBNetConnect();
    $from_user_id = CCGetSession("UserID");
    $query = "select first_name, last_name, email, user_login from users where user_id={$from_user_id}";
    $userinfo->query($query);
    $userinfo->next_record();
    $shipoption = 1;
    while ($iteminfo->f("ship" . $shipoption) != "") {
        if ($shipoption == 1) {
            $Tpl->setVar("checked", "checked");
        } else {
            $Tpl->setVar("checked", "");
        }
        if ($iteminfo->f("shipfee" . $shipoption) == 0 || $iteminfo->f("shipfee" . $shipoption) == "") {
            $price = "0.00";
        } else {
            $price = $iteminfo->f("shipfee" . $shipoption);
        }
        $Tpl->setVar("method", $iteminfo->f("ship" . $shipoption));
        $Tpl->setVar("option", $shipoption);
        $Tpl->setVar("price", "\$" . $price);
        $Tpl->Parse("Row", True);
        $shipoption++;
    }
    if (!$iteminfo->f("ship1")) {
        $Tpl->setVar("method", "No Shipping Specified");
        $Tpl->setVar("option", "999999");
        $Tpl->setVar("price", "\$" . "0.00");
        $Tpl->setVar("checked", "checked");
        $Tpl->Parse("Row", True);
    }
    $Tpl->setVar("ItemNum", $ItemNum);
    $Tpl->setVar("title", $iteminfo->f("title"));
    $Tpl->setVar("asking_price", $iteminfo->f("asking_price"));
    $Tpl->Parse("Confirm_PayPal", True);
}
function t_vat_setllementGrid_cetak_sptpd_BeforeShow(&$sender)
{
    $t_vat_setllementGrid_cetak_sptpd_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_vat_setllementGrid;
    //Compatibility
    //End t_vat_setllementGrid_cetak_sptpd_BeforeShow
    // -------------------------
    // Write your own code here.
    $pajak = $t_vat_setllementGrid->total_vat_amount->GetValue();
    $denda = $t_vat_setllementGrid->total_penalty_amount->GetValue();
    $totaltotal = $pajak + $denda;
    $t_vat_setllementGrid->total_total->SetValue($totaltotal);
    $nilai = $t_vat_setllementGrid->t_vat_setllement_id->GetValue();
    $nilai2 = $t_vat_setllementGrid->p_vat_type_id->GetValue();
    $t_vat_setllementGrid->cetak_sptpd->SetValue("<input type='button' style='display:none;' value='CETAK' style='WIDTH: 57px; HEIGHT: 22px' class='Button' onclick=\"" . "cetakSptpd(" . $nilai . "," . $nilai2 . ")\">");
    $action_button = CCGetFromGet("action_button", "");
    $action_button2 = CCGetFromGet("action_button2", "");
    if ($action_button == 'flag_payment' && $action_button2 != 'cetak_register') {
        $dbConn = new clsDBConnSIKP();
        $sql = "select sikp.f_payment_manual(" . CCGetFromGet('t_customer_order_id') . ",'" . CCGetSession('UserLogin') . "')";
        $dbConn->query($sql);
        $dbConn->next_record();
        echo "\r\n  \t\t<script>\r\n  \t\talert('" . $dbConn->f('f_payment_manual') . "');\r\n  \t\t</script>\r\n  \t\t";
        $dbConn->close();
    } else {
        if ($action_button2 == 'cetak_register') {
            $dbConn = new clsDBConnSIKP();
            $sql = "select sikp.f_print_register(" . CCGetFromGet('t_customer_order_id') . ",'" . CCGetSession('UserLogin') . "')";
            $dbConn->query($sql);
            $dbConn->next_record();
            print_laporan($dbConn->f('f_print_register'));
            /*echo "
            			<script>
            				window.open('../services/print_string.php?input_number=".$dbConn->f('f_print_register')."', '_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes');
            			</script>
            		";*/
            $dbConn->close();
            exit;
        }
    }
    // -------------------------
    //Close t_vat_setllementGrid_cetak_sptpd_BeforeShow @300-BF0BB7F2
    return $t_vat_setllementGrid_cetak_sptpd_BeforeShow;
}
Example #5
0
function MasterPage_llMenu_BeforeShow(&$sender)
{
    $MasterPage_llMenu_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $llMenu;
    //Compatibility
    //End MasterPage_llMenu_BeforeShow
    //Custom Code @12-2A29BDB7
    // -------------------------
    // Write your own code here.
    $Component->Text = CCGetSession("lmenu");
    // -------------------------
    //End Custom Code
    //Close MasterPage_llMenu_BeforeShow @10-0267086D
    return $MasterPage_llMenu_BeforeShow;
}
function t_vat_setllementForm_Button1_OnClick(&$sender)
{
    $t_vat_setllementForm_Button1_OnClick = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_vat_setllementForm;
    //Compatibility
    //End t_vat_setllementForm_Button1_OnClick
    //Custom Code @165-2A29BDB7
    // -------------------------
    // Write your own code here.
    // -------------------------
    //End Custom Code
    // -------------------------
    // Write your own code here.
    $dbConn = new clsDBConnSIKP();
    $User = CCGetUserLogin();
    $t_bphtb_registration_id = $t_vat_setllementForm->t_bphtb_registration_id->GetValue();
    $alasan = $t_vat_setllementForm->alasan->GetValue();
    $njop_pbb = $t_vat_setllementForm->njop_pbb->GetValue();
    $bphtb_amt_final = $t_vat_setllementForm->bphtb_amt_final->GetValue();
    $bphtb_amt_final_keberatan = $t_vat_setllementForm->bphtb_amt_final_keberatan->GetValue();
    $errorMsg = '';
    $sql = "select * from f_insert_bphtb_keberatan(" . $t_bphtb_registration_id . ",19," . $bphtb_amt_final_keberatan . "," . $bphtb_amt_final . ",'" . $alasan . "','" . $User . "')";
    //echo $sql;
    //die($sql);
    $dbConn->query($sql);
    $dbConn->next_record();
    $t_bphtb_keberatan_id = $dbConn->f("o_t_bphtb_keberatan_id");
    $t_customer_order_id = $dbConn->f("o_t_customer_order_id");
    $mess = $dbConn->f("o_mess");
    $sql = "select sikp.f_first_submit_engine(511," . $t_customer_order_id . ",'" . CCGetSession('UserLogin') . "')";
    $dbConn->query($sql);
    //modified by wiliam
    echo "<script> \r\n\t\talert('" . $mess . "');\r\n\t\twindow.opener.location.reload();\r\n\t\twindow.close();\r\n\t</script>";
    // -------------------------
    //Close t_vat_setllementForm_Button1_OnClick @164-6DBB2532
    //return $t_vat_setllementForm_Button1_OnClick;
}
function roleForm_Button_Insert_OnClick(&$sender)
{
    $roleForm_Button_Insert_OnClick = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $roleForm;
    //Compatibility
    //End roleForm_Button_Insert_OnClick
    //Custom Code @73-2A29BDB7
    // -------------------------
    global $CCSLocales;
    global $Redirect;
    //CCLogoutUser();
    $db = new clsDBhrcon();
    $SQL = "select * from f_changeuserpwd(" . $db->ToSQL($Container->user_name->Value, ccsText) . "," . $db->ToSQL(CCGetSession("is_new_user"), ccsText) . "," . $db->ToSQL($Container->old_password->Value, ccsText) . "," . $db->ToSQL($Container->new_password->Value, ccsText) . "," . $db->ToSQL($Container->new_password2->Value, ccsText) . ")";
    $db->query($SQL);
    $Result = $db->next_record();
    if (!$Result) {
        return;
    }
    //
    if ($db->f('o_result_int') != 1) {
        //print_r("test");exit;
        $Container->Errors->addError($db->f('o_result_msg'));
        $db->close();
    } else {
        CCLogoutUser();
        $db->close();
        print_r("<script language='JavaScript'>alert('Sukses');top.location.href='../';</script>");
    }
    //header('location:'.ServerURL . "main/login.php");
    //exit;
    // -------------------------
    //End Custom Code
    //Close roleForm_Button_Insert_OnClick @5-CEA01FFE
    return;
    //$roleForm_Button_Insert_OnClick;
}
function t_executive_summary_form_AfterInsert(&$sender)
{
    $t_executive_summary_form_AfterInsert = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_executive_summary_form;
    //Compatibility
    //End t_executive_summary_form_AfterInsert
    //Custom Code @132-2A29BDB7
    // -------------------------
    // Write your own code here.
    $t_executive_summary_form->DataSource->next_record();
    $records = $t_executive_summary_form->DataSource->Record;
    if ($t_executive_summary_form->DataSource->Errors->ErrorsCount == 0) {
        $dbConn = new clsDBConnSIKP();
        $sql = "select sikp.f_first_submit_engine(508," . $records['o_t_customer_order_id'] . ",'" . CCGetSession('UserLogin') . "')";
        $dbConn->query($sql);
    }
    // -------------------------
    //End Custom Code
    //Close t_executive_summary_form_AfterInsert @25-96DE34DB
    return $t_executive_summary_form_AfterInsert;
}
Example #9
0
 function Show()
 {
     global $Tpl;
     if (!$this->Visible) {
         return;
     }
     $ShownRecords = 0;
     $this->ds->Parameters["sesUserID"] = CCGetSession("UserID");
     $this->ds->Prepare();
     $this->ds->Open();
     $GridBlock = "Grid " . $this->ComponentName;
     $Tpl->block_path = $GridBlock;
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow");
     $is_next_record = $this->ds->next_record();
     if ($is_next_record && $ShownRecords < $this->PageSize) {
         do {
             $this->ds->SetValues();
             $Tpl->block_path = $GridBlock . "/Row";
             $this->ItemNum->SetValue($this->ds->ItemNum->GetValue());
             $this->title->SetValue($this->ds->title->GetValue());
             $twodays = $this->ds->started->GetValue();
             $theday = getdate($twodays);
             $lastofyear = substr($theday["year"], -2);
             $enddate = $theday["mon"] . "/" . $theday["mday"] . "/" . $lastofyear;
             $this->started->SetValue($enddate);
             $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
             $this->ItemNum->Show();
             $this->title->Show();
             $this->started->Show();
             $Tpl->block_path = $GridBlock;
             $Tpl->parse("Row", true);
             $ShownRecords++;
             $is_next_record = $this->ds->next_record();
         } while ($is_next_record && $ShownRecords < $this->PageSize);
     } else {
         $Tpl->parse("NoRecords", false);
     }
     $this->Navigator->TotalPages = $this->ds->PageCount();
     $this->Sorter_ItemNum->Show();
     $this->Sorter_title->Show();
     $this->Sorter_started->Show();
     $this->Navigator->Show();
     $Tpl->parse("", false);
     $Tpl->block_path = "";
 }
function users_reassignuser_content_BeforeShow(&$sender)
{
    $users_reassignuser_content_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $users_reassignuser_content;
    //Compatibility
    //End users_reassignuser_content_BeforeShow
    //Custom Code @53-2A29BDB7
    // -------------------------
    // Write your own code here.
    //Settingup saved message popup
    $sourceuser = (int) CCGetFromPost("lbsourceuser", 0);
    $targetuser = (int) CCGetFromPost("lbtargetuser", 0);
    $companies = CCGetFromPost("companies", array());
    $o = trim(CCGetFromPost("o", ""));
    if ($o == "reassignuser") {
        if ($sourceuser != $targetuser) {
            if (count($companies) > 0) {
                global $FileName;
                $params = array();
                $params["sourceuser"] = $sourceuser;
                $params["targetuser"] = $targetuser;
                $params["companies"] = $companies;
                $customers = new Customers();
                $reassigned = $customers->reassignUser($params);
                $total_updated = $reassigned["result"]["total_updated"];
                if ($total_updated > 0) {
                    CCSetSession("showalert", "show");
                    //$users_reassignuser_content->lbsourceuser->setvalue($targetuser);
                }
            }
        }
    } else {
        //Default param value
        $sourceuserid = (int) CCGetFromGet("sourceuserid", "0");
        if ($sourceuserid <= 0) {
            $users_reassignuser_content->lbsourceuser->setvalue("1");
        } else {
            $users_reassignuser_content->lbsourceuser->setvalue($sourceuserid);
        }
    }
    global $MainPage;
    $showalert = CCGetSession("showalert", "hide");
    $MainPage->Attributes->SetValue("showalert", $showalert);
    if ($showalert == "show") {
        CCSetSession("showalert", "hide");
    }
    // -------------------------
    //End Custom Code
    //Close users_reassignuser_content_BeforeShow @1-90D76575
    return $users_reassignuser_content_BeforeShow;
}
Example #11
0
 function Show()
 {
     global $Tpl;
     if (!$this->Visible) {
         return;
     }
     $ShownRecords = 0;
     $this->ds->Parameters["sesUserID"] = CCGetSession("UserID");
     $this->ds->Prepare();
     $this->ds->Open();
     $GridBlock = "Grid " . $this->ComponentName;
     $Tpl->block_path = $GridBlock;
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow");
     $is_next_record = $this->ds->next_record();
     if ($is_next_record && $ShownRecords < $this->PageSize) {
         do {
             $this->ds->SetValues();
             $Tpl->block_path = $GridBlock . "/Row";
             $this->value->SetValue($this->ds->value->GetValue());
             $this->results->SetValue($this->ds->results->GetValue());
             $this->id->SetValue($this->ds->id->GetValue());
             $this->date->SetValue(date("F j, Y, g:i a", $this->ds->date->GetValue()));
             $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
             $this->value->Show();
             $this->results->Show();
             $this->id->Show();
             $this->date->Show();
             $array = explode(" :!:!:: ", $this->ds->value->GetValue());
             $i = 0;
             $output = "";
             while ($array[$i]) {
                 $temp = explode(" ::!:!: ", $array[$i]);
                 if ($temp[1] != "") {
                     $output .= "<b>" . $temp[0] . "</b> = <i>\"" . $temp[1] . "\"</i><hr width=\"25\" align=\"left\">";
                 }
                 $i++;
             }
             $Tpl->SetVar("summery", $output);
             $array = explode(" :!:!:: ", $this->ds->results->GetValue());
             $i = 0;
             $output = "";
             while ($array[$i]) {
                 $temp = explode(" ::!:!: ", $array[$i]);
                 if ($temp[1] != "") {
                     $output .= "<a href=\"ViewItem.php?ItemNum=" . $temp[0] . "\"><b>" . $temp[1] . "</b>: <i>ItemNumber-" . $temp[0] . "</i><hr width=\"25\" align=\"left\">";
                 }
                 $i++;
             }
             $Tpl->SetVar("results", $output);
             $Tpl->SetVar("count", $i);
             $Tpl->block_path = $GridBlock;
             $Tpl->parse("Row", true);
             $ShownRecords++;
             $is_next_record = $this->ds->next_record();
         } while ($is_next_record && $ShownRecords < $this->PageSize);
     }
     $this->Navigator->TotalPages = $this->ds->PageCount();
     $this->Sorter_value->Show();
     $this->Sorter_results->Show();
     $this->Sorter_date->Show();
     $this->Navigator->Show();
     $Tpl->parse("", false);
     $Tpl->block_path = "";
 }
function customers_assessment_maintcontent_BeforeShow(&$sender)
{
    $customers_assessment_maintcontent_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $customers_assessment_maintcontent;
    //Compatibility
    //End customers_assessment_maintcontent_BeforeShow
    //Custom Code @9-2A29BDB7
    // -------------------------
    // Write your own code here.
    global $MainPage;
    $params = array();
    $customers = new Customers();
    $tab = CCGetFromGet("tab", "tab_9");
    $guid = CCGetFromGet("guid", "");
    $o_post = CCGetFromPost("o", "");
    switch ($o_post) {
        case "insert":
            $typeid_post = (int) CCGetFromPost("hidtype_id", "0");
            $option_title = trim(CCGetFromPost("title", ""));
            $tab = trim(CCGetFromPost("hidtab", ""));
            $params["type_id"] = $typeid_post;
            $params["title"] = $option_title;
            $newOption = $customers->addAssessmentType($params);
            $newOption = $newOption["options"];
            $guid = $newOption["guid"];
            //Will show saved pop and disable button
            CCSetSession("showalert", "show");
            //Redirect after submit
            header("Location: customers_assessment.php?tab={$tab}");
            break;
        case "update":
            $typeid_post = (int) CCGetFromPost("hidtype_id", "0");
            $option_title = trim(CCGetFromPost("title", ""));
            $tab = trim(CCGetFromPost("hidtab", ""));
            $guid = trim(CCGetFromPost("hidguid", ""));
            $params["type_id"] = $typeid_post;
            $params["title"] = $option_title;
            $params["guid"] = $guid;
            $customers->editAssessmentType($params);
            //Will show saved pop and disable button
            CCSetSession("showalert", "show");
            //Redirect after submit
            header("Location: customers_assessment.php?tab={$tab}");
            break;
    }
    $guid = trim($guid, "guid=");
    $type_id = trim($tab, "tab_");
    if (strlen($guid) > 0) {
        $params["guid"] = $guid;
        $option = $customers->getAssessmentOptionsByGuid($params);
        $option = $option["options"][0];
        $customers_assessment_maintcontent->hidguid->SetValue($option["guid"]);
        $customers_assessment_maintcontent->title->SetValue($option["title"]);
        $customers_assessment_maintcontent->o->SetValue("update");
    }
    $customers_assessment_maintcontent->hidtype_id->SetValue($type_id);
    $customers_assessment_maintcontent->hidtab->SetValue($tab);
    $params["type_id"] = $type_id;
    $type_detail = $customers->getAssessmentTypeByID($params);
    $type_detail = $type_detail["types"][0];
    $typeid_title = $type_detail["type"];
    $customers_assessment_maintcontent->lbtype->setvalue($typeid_title);
    //Settingup saved message popup
    $showalert = CCGetSession("showalert", "hide");
    $MainPage->Attributes->SetValue("showalert", $showalert);
    if ($showalert == "show") {
        CCSetSession("showalert", "hide");
    }
    // -------------------------
    //End Custom Code
    //Close customers_assessment_maintcontent_BeforeShow @1-BC8E08EE
    return $customers_assessment_maintcontent_BeforeShow;
}
 function Update()
 {
     global $CCSLocales;
     global $DefaultDateFormat;
     $this->CmdExecution = true;
     $this->cp["updated_by"] = new clsSQLParameter("sesUserLogin", ccsText, "", "", CCGetSession("UserLogin", NULL), NULL, false, $this->ErrorBlock);
     $this->cp["updated_date"] = new clsSQLParameter("expr739", ccsText, "", "", date("Y-m-d H:i:s"), NULL, false, $this->ErrorBlock);
     $this->cp["wp_p_region_id"] = new clsSQLParameter("ctrlwp_p_region_id", ccsFloat, "", "", $this->wp_p_region_id->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["wp_p_region_id_kel"] = new clsSQLParameter("ctrlwp_p_region_id_kel", ccsFloat, "", "", $this->wp_p_region_id_kel->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["wp_name"] = new clsSQLParameter("ctrlwp_name", ccsText, "", "", $this->wp_name->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["wp_address_name"] = new clsSQLParameter("ctrlwp_address_name", ccsText, "", "", $this->wp_address_name->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["npwp"] = new clsSQLParameter("ctrlnpwp", ccsText, "", "", $this->npwp->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["object_p_region_id_kec"] = new clsSQLParameter("ctrlobject_p_region_id_kec", ccsText, "", "", $this->object_p_region_id_kec->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["object_p_region_id"] = new clsSQLParameter("ctrlobject_p_region_id", ccsText, "", "", $this->object_p_region_id->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["land_area"] = new clsSQLParameter("ctrlland_area", ccsFloat, "", "", $this->land_area->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["land_price_per_m"] = new clsSQLParameter("ctrlland_price_per_m", ccsFloat, "", "", $this->land_price_per_m->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["land_total_price"] = new clsSQLParameter("ctrlland_total_price", ccsFloat, "", "", $this->land_total_price->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["building_area"] = new clsSQLParameter("ctrlbuilding_area", ccsFloat, "", "", $this->building_area->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["building_price_per_m"] = new clsSQLParameter("ctrlbuilding_price_per_m", ccsFloat, "", "", $this->building_price_per_m->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["building_total_price"] = new clsSQLParameter("ctrlbuilding_total_price", ccsFloat, "", "", $this->building_total_price->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["wp_rt"] = new clsSQLParameter("ctrlwp_rt", ccsText, "", "", $this->wp_rt->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["wp_rw"] = new clsSQLParameter("ctrlwp_rw", ccsText, "", "", $this->wp_rw->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["object_rt"] = new clsSQLParameter("ctrlobject_rt", ccsText, "", "", $this->object_rt->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["object_rw"] = new clsSQLParameter("ctrlobject_rw", ccsText, "", "", $this->object_rw->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["njop_pbb"] = new clsSQLParameter("ctrlnjop_pbb", ccsText, "", "", $this->njop_pbb->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["object_address_name"] = new clsSQLParameter("ctrlobject_address_name", ccsText, "", "", $this->object_address_name->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["p_bphtb_legal_doc_type_id"] = new clsSQLParameter("ctrlp_bphtb_legal_doc_type_id", ccsText, "", "", $this->p_bphtb_legal_doc_type_id->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["npop"] = new clsSQLParameter("ctrlnpop", ccsFloat, "", "", $this->npop->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["npop_tkp"] = new clsSQLParameter("ctrlnpop_tkp", ccsFloat, "", "", $this->npop_tkp->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["npop_kp"] = new clsSQLParameter("ctrlnpop_kp", ccsFloat, "", "", $this->npop_kp->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["bphtb_amt"] = new clsSQLParameter("ctrlbphtb_amt", ccsFloat, "", "", $this->bphtb_amt->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["bphtb_amt_final"] = new clsSQLParameter("ctrlbphtb_amt_final", ccsFloat, "", "", $this->bphtb_amt_final->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["bphtb_discount"] = new clsSQLParameter("ctrlbphtb_discount", ccsFloat, "", "", $this->bphtb_discount->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["description"] = new clsSQLParameter("ctrldescription", ccsText, "", "", $this->description->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["market_price"] = new clsSQLParameter("ctrlmarket_price", ccsFloat, "", "", $this->market_price->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["mobile_phone_no"] = new clsSQLParameter("ctrlmobile_phone_no", ccsText, "", "", $this->mobile_phone_no->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["wp_p_region_id_kec"] = new clsSQLParameter("ctrlwp_p_region_id_kec", ccsFloat, "", "", $this->wp_p_region_id_kec->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["object_p_region_id_kel"] = new clsSQLParameter("ctrlobject_p_region_id_kel", ccsFloat, "", "", $this->object_p_region_id_kel->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["jenis_harga_bphtb"] = new clsSQLParameter("ctrljenis_harga_bphtb", ccsText, "", "", $this->jenis_harga_bphtb->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["jenis_harga_bphtb"] = new clsSQLParameter("ctrljenis_harga_bphtb", ccsText, "", "", $this->jenis_harga_bphtb->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["bphtb_legal_doc_description"] = new clsSQLParameter("ctrlbphtb_legal_doc_description", ccsText, "", "", $this->bphtb_legal_doc_description->GetValue(true), NULL, false, $this->ErrorBlock);
     $this->cp["add_disc_percent"] = new clsSQLParameter("ctrladd_disc_percent", ccsSingle, "", "", $this->add_disc_percent->GetValue(true), NULL, false, $this->ErrorBlock);
     $wp = new clsSQLParameters($this->ErrorBlock);
     $wp->AddParameter("1", "ctrlt_bphtb_registration_id", ccsFloat, "", "", $this->t_bphtb_registration_id->GetValue(true), "", false);
     if (!$wp->AllParamsSet()) {
         $this->Errors->addError($CCSLocales->GetText("CCS_CustomOperationError_MissingParameters"));
     }
     $wp->AddParameter("2", "urlt_bphtb_registration_id", ccsFloat, "", "", CCGetFromGet("t_bphtb_registration_id", NULL), "", false);
     if (!$wp->AllParamsSet()) {
         $this->Errors->addError($CCSLocales->GetText("CCS_CustomOperationError_MissingParameters"));
     }
     $wp->AddParameter("3", "urlt_bphtb_registration_id", ccsFloat, "", "", CCGetFromGet("t_bphtb_registration_id", NULL), "", false);
     if (!$wp->AllParamsSet()) {
         $this->Errors->addError($CCSLocales->GetText("CCS_CustomOperationError_MissingParameters"));
     }
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent);
     if (!is_null($this->cp["updated_by"]->GetValue()) and !strlen($this->cp["updated_by"]->GetText()) and !is_bool($this->cp["updated_by"]->GetValue())) {
         $this->cp["updated_by"]->SetValue(CCGetSession("UserLogin", NULL));
     }
     if (!is_null($this->cp["updated_date"]->GetValue()) and !strlen($this->cp["updated_date"]->GetText()) and !is_bool($this->cp["updated_date"]->GetValue())) {
         $this->cp["updated_date"]->SetValue(date("Y-m-d H:i:s"));
     }
     if (!is_null($this->cp["wp_p_region_id"]->GetValue()) and !strlen($this->cp["wp_p_region_id"]->GetText()) and !is_bool($this->cp["wp_p_region_id"]->GetValue())) {
         $this->cp["wp_p_region_id"]->SetValue($this->wp_p_region_id->GetValue(true));
     }
     if (!is_null($this->cp["wp_p_region_id_kel"]->GetValue()) and !strlen($this->cp["wp_p_region_id_kel"]->GetText()) and !is_bool($this->cp["wp_p_region_id_kel"]->GetValue())) {
         $this->cp["wp_p_region_id_kel"]->SetValue($this->wp_p_region_id_kel->GetValue(true));
     }
     if (!is_null($this->cp["wp_name"]->GetValue()) and !strlen($this->cp["wp_name"]->GetText()) and !is_bool($this->cp["wp_name"]->GetValue())) {
         $this->cp["wp_name"]->SetValue($this->wp_name->GetValue(true));
     }
     if (!is_null($this->cp["wp_address_name"]->GetValue()) and !strlen($this->cp["wp_address_name"]->GetText()) and !is_bool($this->cp["wp_address_name"]->GetValue())) {
         $this->cp["wp_address_name"]->SetValue($this->wp_address_name->GetValue(true));
     }
     if (!is_null($this->cp["npwp"]->GetValue()) and !strlen($this->cp["npwp"]->GetText()) and !is_bool($this->cp["npwp"]->GetValue())) {
         $this->cp["npwp"]->SetValue($this->npwp->GetValue(true));
     }
     if (!is_null($this->cp["object_p_region_id_kec"]->GetValue()) and !strlen($this->cp["object_p_region_id_kec"]->GetText()) and !is_bool($this->cp["object_p_region_id_kec"]->GetValue())) {
         $this->cp["object_p_region_id_kec"]->SetValue($this->object_p_region_id_kec->GetValue(true));
     }
     if (!is_null($this->cp["object_p_region_id"]->GetValue()) and !strlen($this->cp["object_p_region_id"]->GetText()) and !is_bool($this->cp["object_p_region_id"]->GetValue())) {
         $this->cp["object_p_region_id"]->SetValue($this->object_p_region_id->GetValue(true));
     }
     if (!is_null($this->cp["land_area"]->GetValue()) and !strlen($this->cp["land_area"]->GetText()) and !is_bool($this->cp["land_area"]->GetValue())) {
         $this->cp["land_area"]->SetValue($this->land_area->GetValue(true));
     }
     if (!is_null($this->cp["land_price_per_m"]->GetValue()) and !strlen($this->cp["land_price_per_m"]->GetText()) and !is_bool($this->cp["land_price_per_m"]->GetValue())) {
         $this->cp["land_price_per_m"]->SetValue($this->land_price_per_m->GetValue(true));
     }
     if (!is_null($this->cp["land_total_price"]->GetValue()) and !strlen($this->cp["land_total_price"]->GetText()) and !is_bool($this->cp["land_total_price"]->GetValue())) {
         $this->cp["land_total_price"]->SetValue($this->land_total_price->GetValue(true));
     }
     if (!is_null($this->cp["building_area"]->GetValue()) and !strlen($this->cp["building_area"]->GetText()) and !is_bool($this->cp["building_area"]->GetValue())) {
         $this->cp["building_area"]->SetValue($this->building_area->GetValue(true));
     }
     if (!is_null($this->cp["building_price_per_m"]->GetValue()) and !strlen($this->cp["building_price_per_m"]->GetText()) and !is_bool($this->cp["building_price_per_m"]->GetValue())) {
         $this->cp["building_price_per_m"]->SetValue($this->building_price_per_m->GetValue(true));
     }
     if (!is_null($this->cp["building_total_price"]->GetValue()) and !strlen($this->cp["building_total_price"]->GetText()) and !is_bool($this->cp["building_total_price"]->GetValue())) {
         $this->cp["building_total_price"]->SetValue($this->building_total_price->GetValue(true));
     }
     if (!is_null($this->cp["wp_rt"]->GetValue()) and !strlen($this->cp["wp_rt"]->GetText()) and !is_bool($this->cp["wp_rt"]->GetValue())) {
         $this->cp["wp_rt"]->SetValue($this->wp_rt->GetValue(true));
     }
     if (!is_null($this->cp["wp_rw"]->GetValue()) and !strlen($this->cp["wp_rw"]->GetText()) and !is_bool($this->cp["wp_rw"]->GetValue())) {
         $this->cp["wp_rw"]->SetValue($this->wp_rw->GetValue(true));
     }
     if (!is_null($this->cp["object_rt"]->GetValue()) and !strlen($this->cp["object_rt"]->GetText()) and !is_bool($this->cp["object_rt"]->GetValue())) {
         $this->cp["object_rt"]->SetValue($this->object_rt->GetValue(true));
     }
     if (!is_null($this->cp["object_rw"]->GetValue()) and !strlen($this->cp["object_rw"]->GetText()) and !is_bool($this->cp["object_rw"]->GetValue())) {
         $this->cp["object_rw"]->SetValue($this->object_rw->GetValue(true));
     }
     if (!is_null($this->cp["njop_pbb"]->GetValue()) and !strlen($this->cp["njop_pbb"]->GetText()) and !is_bool($this->cp["njop_pbb"]->GetValue())) {
         $this->cp["njop_pbb"]->SetValue($this->njop_pbb->GetValue(true));
     }
     if (!is_null($this->cp["object_address_name"]->GetValue()) and !strlen($this->cp["object_address_name"]->GetText()) and !is_bool($this->cp["object_address_name"]->GetValue())) {
         $this->cp["object_address_name"]->SetValue($this->object_address_name->GetValue(true));
     }
     if (!is_null($this->cp["p_bphtb_legal_doc_type_id"]->GetValue()) and !strlen($this->cp["p_bphtb_legal_doc_type_id"]->GetText()) and !is_bool($this->cp["p_bphtb_legal_doc_type_id"]->GetValue())) {
         $this->cp["p_bphtb_legal_doc_type_id"]->SetValue($this->p_bphtb_legal_doc_type_id->GetValue(true));
     }
     if (!is_null($this->cp["npop"]->GetValue()) and !strlen($this->cp["npop"]->GetText()) and !is_bool($this->cp["npop"]->GetValue())) {
         $this->cp["npop"]->SetValue($this->npop->GetValue(true));
     }
     if (!is_null($this->cp["npop_tkp"]->GetValue()) and !strlen($this->cp["npop_tkp"]->GetText()) and !is_bool($this->cp["npop_tkp"]->GetValue())) {
         $this->cp["npop_tkp"]->SetValue($this->npop_tkp->GetValue(true));
     }
     if (!is_null($this->cp["npop_kp"]->GetValue()) and !strlen($this->cp["npop_kp"]->GetText()) and !is_bool($this->cp["npop_kp"]->GetValue())) {
         $this->cp["npop_kp"]->SetValue($this->npop_kp->GetValue(true));
     }
     if (!is_null($this->cp["bphtb_amt"]->GetValue()) and !strlen($this->cp["bphtb_amt"]->GetText()) and !is_bool($this->cp["bphtb_amt"]->GetValue())) {
         $this->cp["bphtb_amt"]->SetValue($this->bphtb_amt->GetValue(true));
     }
     if (!is_null($this->cp["bphtb_amt_final"]->GetValue()) and !strlen($this->cp["bphtb_amt_final"]->GetText()) and !is_bool($this->cp["bphtb_amt_final"]->GetValue())) {
         $this->cp["bphtb_amt_final"]->SetValue($this->bphtb_amt_final->GetValue(true));
     }
     if (!is_null($this->cp["bphtb_discount"]->GetValue()) and !strlen($this->cp["bphtb_discount"]->GetText()) and !is_bool($this->cp["bphtb_discount"]->GetValue())) {
         $this->cp["bphtb_discount"]->SetValue($this->bphtb_discount->GetValue(true));
     }
     if (!is_null($this->cp["description"]->GetValue()) and !strlen($this->cp["description"]->GetText()) and !is_bool($this->cp["description"]->GetValue())) {
         $this->cp["description"]->SetValue($this->description->GetValue(true));
     }
     if (!is_null($this->cp["market_price"]->GetValue()) and !strlen($this->cp["market_price"]->GetText()) and !is_bool($this->cp["market_price"]->GetValue())) {
         $this->cp["market_price"]->SetValue($this->market_price->GetValue(true));
     }
     if (!is_null($this->cp["mobile_phone_no"]->GetValue()) and !strlen($this->cp["mobile_phone_no"]->GetText()) and !is_bool($this->cp["mobile_phone_no"]->GetValue())) {
         $this->cp["mobile_phone_no"]->SetValue($this->mobile_phone_no->GetValue(true));
     }
     if (!is_null($this->cp["wp_p_region_id_kec"]->GetValue()) and !strlen($this->cp["wp_p_region_id_kec"]->GetText()) and !is_bool($this->cp["wp_p_region_id_kec"]->GetValue())) {
         $this->cp["wp_p_region_id_kec"]->SetValue($this->wp_p_region_id_kec->GetValue(true));
     }
     if (!is_null($this->cp["object_p_region_id_kel"]->GetValue()) and !strlen($this->cp["object_p_region_id_kel"]->GetText()) and !is_bool($this->cp["object_p_region_id_kel"]->GetValue())) {
         $this->cp["object_p_region_id_kel"]->SetValue($this->object_p_region_id_kel->GetValue(true));
     }
     if (!is_null($this->cp["jenis_harga_bphtb"]->GetValue()) and !strlen($this->cp["jenis_harga_bphtb"]->GetText()) and !is_bool($this->cp["jenis_harga_bphtb"]->GetValue())) {
         $this->cp["jenis_harga_bphtb"]->SetValue($this->jenis_harga_bphtb->GetValue(true));
     }
     if (!is_null($this->cp["jenis_harga_bphtb"]->GetValue()) and !strlen($this->cp["jenis_harga_bphtb"]->GetText()) and !is_bool($this->cp["jenis_harga_bphtb"]->GetValue())) {
         $this->cp["jenis_harga_bphtb"]->SetValue($this->jenis_harga_bphtb->GetValue(true));
     }
     if (!is_null($this->cp["bphtb_legal_doc_description"]->GetValue()) and !strlen($this->cp["bphtb_legal_doc_description"]->GetText()) and !is_bool($this->cp["bphtb_legal_doc_description"]->GetValue())) {
         $this->cp["bphtb_legal_doc_description"]->SetValue($this->bphtb_legal_doc_description->GetValue(true));
     }
     if (!is_null($this->cp["add_disc_percent"]->GetValue()) and !strlen($this->cp["add_disc_percent"]->GetText()) and !is_bool($this->cp["add_disc_percent"]->GetValue())) {
         $this->cp["add_disc_percent"]->SetValue($this->add_disc_percent->GetValue(true));
     }
     $wp->Criterion[1] = $wp->Operation(opEqual, "t_bphtb_registration_id", $wp->GetDBValue("1"), $this->ToSQL($wp->GetDBValue("1"), ccsFloat), false);
     $wp->Criterion[2] = $wp->Operation(opEqual, "t_bphtb_registration_id", $wp->GetDBValue("2"), $this->ToSQL($wp->GetDBValue("2"), ccsFloat), false);
     $wp->Criterion[3] = $wp->Operation(opEqual, "t_bphtb_registration_id", $wp->GetDBValue("3"), $this->ToSQL($wp->GetDBValue("3"), ccsFloat), false);
     $Where = $wp->opAND(false, $wp->opAND(false, $wp->Criterion[1], $wp->Criterion[2]), $wp->Criterion[3]);
     $this->UpdateFields["updated_by"]["Value"] = $this->cp["updated_by"]->GetDBValue(true);
     $this->UpdateFields["updated_date"]["Value"] = $this->cp["updated_date"]->GetDBValue(true);
     $this->UpdateFields["wp_p_region_id"]["Value"] = $this->cp["wp_p_region_id"]->GetDBValue(true);
     $this->UpdateFields["wp_p_region_id_kel"]["Value"] = $this->cp["wp_p_region_id_kel"]->GetDBValue(true);
     $this->UpdateFields["wp_name"]["Value"] = $this->cp["wp_name"]->GetDBValue(true);
     $this->UpdateFields["wp_address_name"]["Value"] = $this->cp["wp_address_name"]->GetDBValue(true);
     $this->UpdateFields["npwp"]["Value"] = $this->cp["npwp"]->GetDBValue(true);
     $this->UpdateFields["object_p_region_id_kec"]["Value"] = $this->cp["object_p_region_id_kec"]->GetDBValue(true);
     $this->UpdateFields["object_p_region_id"]["Value"] = $this->cp["object_p_region_id"]->GetDBValue(true);
     $this->UpdateFields["land_area"]["Value"] = $this->cp["land_area"]->GetDBValue(true);
     $this->UpdateFields["land_price_per_m"]["Value"] = $this->cp["land_price_per_m"]->GetDBValue(true);
     $this->UpdateFields["land_total_price"]["Value"] = $this->cp["land_total_price"]->GetDBValue(true);
     $this->UpdateFields["building_area"]["Value"] = $this->cp["building_area"]->GetDBValue(true);
     $this->UpdateFields["building_price_per_m"]["Value"] = $this->cp["building_price_per_m"]->GetDBValue(true);
     $this->UpdateFields["building_total_price"]["Value"] = $this->cp["building_total_price"]->GetDBValue(true);
     $this->UpdateFields["wp_rt"]["Value"] = $this->cp["wp_rt"]->GetDBValue(true);
     $this->UpdateFields["wp_rw"]["Value"] = $this->cp["wp_rw"]->GetDBValue(true);
     $this->UpdateFields["object_rt"]["Value"] = $this->cp["object_rt"]->GetDBValue(true);
     $this->UpdateFields["object_rw"]["Value"] = $this->cp["object_rw"]->GetDBValue(true);
     $this->UpdateFields["njop_pbb"]["Value"] = $this->cp["njop_pbb"]->GetDBValue(true);
     $this->UpdateFields["object_address_name"]["Value"] = $this->cp["object_address_name"]->GetDBValue(true);
     $this->UpdateFields["p_bphtb_legal_doc_type_id"]["Value"] = $this->cp["p_bphtb_legal_doc_type_id"]->GetDBValue(true);
     $this->UpdateFields["npop"]["Value"] = $this->cp["npop"]->GetDBValue(true);
     $this->UpdateFields["npop_tkp"]["Value"] = $this->cp["npop_tkp"]->GetDBValue(true);
     $this->UpdateFields["npop_kp"]["Value"] = $this->cp["npop_kp"]->GetDBValue(true);
     $this->UpdateFields["bphtb_amt"]["Value"] = $this->cp["bphtb_amt"]->GetDBValue(true);
     $this->UpdateFields["bphtb_amt_final"]["Value"] = $this->cp["bphtb_amt_final"]->GetDBValue(true);
     $this->UpdateFields["bphtb_discount"]["Value"] = $this->cp["bphtb_discount"]->GetDBValue(true);
     $this->UpdateFields["description"]["Value"] = $this->cp["description"]->GetDBValue(true);
     $this->UpdateFields["market_price"]["Value"] = $this->cp["market_price"]->GetDBValue(true);
     $this->UpdateFields["mobile_phone_no"]["Value"] = $this->cp["mobile_phone_no"]->GetDBValue(true);
     $this->UpdateFields["wp_p_region_id_kec"]["Value"] = $this->cp["wp_p_region_id_kec"]->GetDBValue(true);
     $this->UpdateFields["object_p_region_id_kel"]["Value"] = $this->cp["object_p_region_id_kel"]->GetDBValue(true);
     $this->UpdateFields["jenis_harga_bphtb"]["Value"] = $this->cp["jenis_harga_bphtb"]->GetDBValue(true);
     $this->UpdateFields["jenis_harga_bphtb"]["Value"] = $this->cp["jenis_harga_bphtb"]->GetDBValue(true);
     $this->UpdateFields["bphtb_legal_doc_description"]["Value"] = $this->cp["bphtb_legal_doc_description"]->GetDBValue(true);
     $this->UpdateFields["add_disc_percent"]["Value"] = $this->cp["add_disc_percent"]->GetDBValue(true);
     $this->SQL = CCBuildUpdate("t_bphtb_registration", $this->UpdateFields, $this);
     $this->SQL .= strlen($Where) ? " WHERE " . $Where : $Where;
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteUpdate", $this->Parent);
     if ($this->Errors->Count() == 0 && $this->CmdExecution) {
         $this->query($this->SQL);
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteUpdate", $this->Parent);
     }
 }
Example #14
0
 function Initialize()
 {
     if (!$this->Visible) {
         return;
     }
     $this->ds->Parameters["sesUserID"] = CCGetSession("UserID");
 }
function licensing_customerscontent_BeforeShow(&$sender)
{
    $licensing_customerscontent_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $licensing_customerscontent;
    //Compatibility
    //End licensing_customerscontent_BeforeShow
    //Custom Code @152-2A29BDB7
    // -------------------------
    // Write your own code here.
    global $Tpl;
    $tab = CCGetFromGet("tab", "tab1_active");
    switch ($tab) {
        default:
        case "details":
            $Tpl->setvar("tab1_active", "active");
            break;
        case "licensing":
            $Tpl->setvar("tab2_active", "active");
            break;
        case "licenselist":
            $Tpl->setvar("tab3_active", "active");
            break;
        case "licensearchive":
            $Tpl->setvar("tab4_active", "active");
            break;
        case "competitor_renewals":
            $Tpl->setvar("tab5_active", "active");
            break;
        case "product_displacement":
            $Tpl->setvar("tab6_active", "active");
            break;
    }
    //Setting the active tab for licensing when the cssForm is present and has licensing as the form submitted
    $cssForm = trim(CCGetFromGet("ccsForm", ""));
    if ($cssForm == "licensing") {
        //Whichever tab set will be reset to avoid more than 1 tab active
        $Tpl->setvar("tab1_active", "");
        $Tpl->setvar("tab2_active", "active");
        $Tpl->setvar("tab3_active", "");
        $Tpl->setvar("tab4_active", "");
        $Tpl->setvar("tab5_active", "");
        $Tpl->setvar("tab6_active", "");
    }
    //Settingup saved message popup
    global $MainPage;
    $showalert = CCGetSession("showalert", "hide");
    $MainPage->Attributes->SetValue("showalert", $showalert);
    if ($showalert == "show") {
        CCSetSession("showalert", "hide");
    }
    //Setting up alerts to let user know the customer has not contacts yet
    $customers = new Customers();
    $customer_guid = CCGetFromGet("guid", "");
    $params = array();
    $params["customer_guid"] = $customer_guid;
    $hasContacts = $customers->customerHasContacts($params);
    if ($hasContacts["hasContacts"] == "1") {
        $MainPage->Attributes->SetValue("showalert_contacterror", "hide");
    } else {
        $MainPage->Attributes->SetValue("showalert_contacterror", "show");
    }
    //Setting up alerts to let user know the license may need support
    $license_guid = trim(CCGetFromGet("license_guid", ""));
    if (strlen($license_guid) > 0) {
        $products = new Alm\Products();
        $params = array();
        $params["license_guid"] = $license_guid;
        $hasSupport = $products->licenseHasSupport($params);
        if ($hasSupport["hasSupport"] == "1") {
            $MainPage->Attributes->SetValue("showalert_addsupport", "hide");
        } else {
            $MainPage->Attributes->SetValue("showalert_addsupport", "show");
        }
    } else {
        $MainPage->Attributes->SetValue("showalert_addsupport", "hide");
    }
    //Check if session variable showalert_addsupport has a show value
    $showalert_addsupport = CCGetSession("showalert_addsupport", "");
    if ($showalert_addsupport == "show") {
        CCSetSession("showalert_addsupport", "hide");
        $MainPage->Attributes->SetValue("showalert_addsupport", $showalert);
    }
    //Procesing file uploading
    $hidlicense_guid = trim(CCGetFromPost("hidlicense_guid", ""));
    if (!empty($_FILES) && strlen($hidlicense_guid) > 0) {
        $params = array();
        $params["license_guid"] = $hidlicense_guid;
        $products = new \Alm\Products();
        $products->uploadLicenseFile($_FILES, $params);
        //Finishing script execution for file uploads because its asyncronous
        exit;
    }
    $license_guid = trim(CCGetFromGet("license_guid", ""));
    $licensefile_guid = trim(CCGetFromGet("licensefile_guid", ""));
    $o = trim(CCGetFromGet("o", ""));
    //Delete licensing operation
    if (strlen($licensefile_guid) > 0 && $o == "dellicense") {
        $params = array();
        $params["licensefile_guid"] = $licensefile_guid;
        $products = new \Alm\Products();
        $products->deleteLicenseFileByGuid($params);
        $querystring = CCGetQueryString("QueryString", array("licensefile_guid", "o"));
        global $FileName;
        $urlRedirect = $FileName . "?{$querystring}";
        header("Location: {$urlRedirect}");
    }
    //Delete full licensing operation
    if (strlen($license_guid) > 0 && $o == "delfulllicense") {
        $params = array();
        $params["license_guid"] = $license_guid;
        $products = new \Alm\Products();
        $products->deleteFullLicenseByGuid($params);
        $querystring = CCGetQueryString("QueryString", array("license_guid", "o"));
        global $FileName;
        $urlRedirect = $FileName . "?{$querystring}";
        header("Location: {$urlRedirect}");
    }
    if (strlen($license_guid) > 0) {
        //License files grid
        $params = array();
        $params["license_guid"] = $license_guid;
        $products = new \Alm\Products();
        $licenseFiles = $products->getLicenseFiles($params);
        $licenseFiles = $licenseFiles["licensefiles"];
        $querystring = CCGetQueryString("QueryString", array("o", "licensefile_guid", "tab"));
        foreach ($licenseFiles as $licenseFile) {
            $licensefile_guid = $licenseFile["guid"];
            $linkdelete = "";
            if (CCGetGroupID() == "4") {
                //Moved linkdelete to code because issues displaying panels inside custom template blocks
                $linkdelete = "<a href='licensing_customers.php?o=dellicense&licensefile_guid={$licensefile_guid}&tab=licenselist&{$querystring}' class='dellicense' ><li class='icon-trash bigger-150 red'></li></a>";
            }
            $Tpl->setvar("linkdelete", $linkdelete);
            $Tpl->setvar("licensefile_guid", $licensefile_guid);
            $Tpl->setvar("getparams", "&" . $querystring);
            $Tpl->Parse("licensefile_list", true);
        }
    }
    // -------------------------
    //End Custom Code
    //Close licensing_customerscontent_BeforeShow @1-0B488567
    return $licensing_customerscontent_BeforeShow;
}
function companies_viewcontent_BeforeShow(&$sender)
{
    $companies_viewcontent_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $companies_viewcontent;
    //Compatibility
    //End companies_viewcontent_BeforeShow
    //Custom Code @32-2A29BDB7
    // -------------------------
    // Write your own code here.
    global $Tpl;
    $tab = CCGetFromGet("tab", "tab1_active");
    switch ($tab) {
        default:
        case "details":
            $Tpl->setvar("tab1_active", "active");
            break;
        case "evaluation":
            $Tpl->setvar("tab3_active", "active");
            break;
        case "addcontact":
            $Tpl->setvar("tab2_active", "active");
            break;
    }
    //Settingup saved message popup
    global $MainPage;
    $showalert = CCGetSession("showalert", "hide");
    $MainPage->Attributes->SetValue("showalert", $showalert);
    if ($showalert == "show") {
        CCSetSession("showalert", "hide");
    }
    // -------------------------
    //End Custom Code
    //Close companies_viewcontent_BeforeShow @1-AEB03160
    return $companies_viewcontent_BeforeShow;
}
Example #17
0
 function Update()
 {
     global $CCSLocales;
     global $DefaultDateFormat;
     $this->CmdExecution = true;
     $this->cp["t_cust_account_id"] = new clsSQLParameter("ctrlt_cust_account_id", ccsInteger, "", "", $this->t_cust_account_id->GetValue(true), 0, false, $this->ErrorBlock);
     $this->cp["p_account_status_id"] = new clsSQLParameter("ctrlp_account_status_id", ccsInteger, "", "", $this->p_account_status_id->GetValue(true), 0, false, $this->ErrorBlock);
     $this->cp["description"] = new clsSQLParameter("ctrldescription", ccsText, "", "", $this->description->GetValue(true), "", false, $this->ErrorBlock);
     $this->cp["valid_to"] = new clsSQLParameter("ctrlvalid_to", ccsText, "", "", $this->valid_to->GetValue(true), "", false, $this->ErrorBlock);
     $this->cp["user_name"] = new clsSQLParameter("sesUserLogin", ccsText, "", "", CCGetSession("UserLogin", NULL), "", false, $this->ErrorBlock);
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildUpdate", $this->Parent);
     if (!is_null($this->cp["t_cust_account_id"]->GetValue()) and !strlen($this->cp["t_cust_account_id"]->GetText()) and !is_bool($this->cp["t_cust_account_id"]->GetValue())) {
         $this->cp["t_cust_account_id"]->SetValue($this->t_cust_account_id->GetValue(true));
     }
     if (!strlen($this->cp["t_cust_account_id"]->GetText()) and !is_bool($this->cp["t_cust_account_id"]->GetValue(true))) {
         $this->cp["t_cust_account_id"]->SetText(0);
     }
     if (!is_null($this->cp["p_account_status_id"]->GetValue()) and !strlen($this->cp["p_account_status_id"]->GetText()) and !is_bool($this->cp["p_account_status_id"]->GetValue())) {
         $this->cp["p_account_status_id"]->SetValue($this->p_account_status_id->GetValue(true));
     }
     if (!strlen($this->cp["p_account_status_id"]->GetText()) and !is_bool($this->cp["p_account_status_id"]->GetValue(true))) {
         $this->cp["p_account_status_id"]->SetText(0);
     }
     if (!is_null($this->cp["description"]->GetValue()) and !strlen($this->cp["description"]->GetText()) and !is_bool($this->cp["description"]->GetValue())) {
         $this->cp["description"]->SetValue($this->description->GetValue(true));
     }
     if (!is_null($this->cp["valid_to"]->GetValue()) and !strlen($this->cp["valid_to"]->GetText()) and !is_bool($this->cp["valid_to"]->GetValue())) {
         $this->cp["valid_to"]->SetValue($this->valid_to->GetValue(true));
     }
     if (!is_null($this->cp["user_name"]->GetValue()) and !strlen($this->cp["user_name"]->GetText()) and !is_bool($this->cp["user_name"]->GetValue())) {
         $this->cp["user_name"]->SetValue(CCGetSession("UserLogin", NULL));
     }
     $this->SQL = "select f_update_acc_status(" . $this->SQLValue($this->cp["t_cust_account_id"]->GetDBValue(), ccsInteger) . "," . $this->SQLValue($this->cp["p_account_status_id"]->GetDBValue(), ccsInteger) . ",'" . $this->SQLValue($this->cp["description"]->GetDBValue(), ccsText) . "','" . $this->SQLValue($this->cp["valid_to"]->GetDBValue(), ccsText) . "', '" . $this->SQLValue($this->cp["user_name"]->GetDBValue(), ccsText) . "')";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteUpdate", $this->Parent);
     if ($this->Errors->Count() == 0 && $this->CmdExecution) {
         $this->query($this->SQL);
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteUpdate", $this->Parent);
     }
 }
Example #18
0
function CCGetUserLogin()
{
    return CCGetSession("UserLogin");
}
 function Insert()
 {
     global $CCSLocales;
     global $DefaultDateFormat;
     $this->CmdExecution = true;
     $this->cp["t_vat_setllement_id"] = new clsSQLParameter("ctrlt_vat_setllement_id", ccsInteger, "", "", $this->t_vat_setllement_id->GetValue(true), 0, false, $this->ErrorBlock);
     $this->cp["nilai_denda"] = new clsSQLParameter("ctrlnilai_denda", ccsFloat, "", "", $this->nilai_denda->GetValue(true), 0, false, $this->ErrorBlock);
     $this->cp["deskripsi"] = new clsSQLParameter("ctrldeskripsi", ccsText, "", "", $this->deskripsi->GetValue(true), "", false, $this->ErrorBlock);
     $this->cp["user_name"] = new clsSQLParameter("sesUserLogin", ccsText, "", "", CCGetSession("UserLogin", NULL), "", false, $this->ErrorBlock);
     $this->cp["flag_piutang"] = new clsSQLParameter("ctrlflag_piutang", ccsText, "", "", $this->flag_piutang->GetValue(true), "", false, $this->ErrorBlock);
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent);
     if (!is_null($this->cp["t_vat_setllement_id"]->GetValue()) and !strlen($this->cp["t_vat_setllement_id"]->GetText()) and !is_bool($this->cp["t_vat_setllement_id"]->GetValue())) {
         $this->cp["t_vat_setllement_id"]->SetValue($this->t_vat_setllement_id->GetValue(true));
     }
     if (!strlen($this->cp["t_vat_setllement_id"]->GetText()) and !is_bool($this->cp["t_vat_setllement_id"]->GetValue(true))) {
         $this->cp["t_vat_setllement_id"]->SetText(0);
     }
     if (!is_null($this->cp["nilai_denda"]->GetValue()) and !strlen($this->cp["nilai_denda"]->GetText()) and !is_bool($this->cp["nilai_denda"]->GetValue())) {
         $this->cp["nilai_denda"]->SetValue($this->nilai_denda->GetValue(true));
     }
     if (!strlen($this->cp["nilai_denda"]->GetText()) and !is_bool($this->cp["nilai_denda"]->GetValue(true))) {
         $this->cp["nilai_denda"]->SetText(0);
     }
     if (!is_null($this->cp["deskripsi"]->GetValue()) and !strlen($this->cp["deskripsi"]->GetText()) and !is_bool($this->cp["deskripsi"]->GetValue())) {
         $this->cp["deskripsi"]->SetValue($this->deskripsi->GetValue(true));
     }
     if (!is_null($this->cp["user_name"]->GetValue()) and !strlen($this->cp["user_name"]->GetText()) and !is_bool($this->cp["user_name"]->GetValue())) {
         $this->cp["user_name"]->SetValue(CCGetSession("UserLogin", NULL));
     }
     if (!is_null($this->cp["flag_piutang"]->GetValue()) and !strlen($this->cp["flag_piutang"]->GetText()) and !is_bool($this->cp["flag_piutang"]->GetValue())) {
         $this->cp["flag_piutang"]->SetValue($this->flag_piutang->GetValue(true));
     }
     $this->SQL = "SELECT f_update_penalty_new(" . $this->SQLValue($this->cp["t_vat_setllement_id"]->GetDBValue(), ccsInteger) . "," . $this->SQLValue($this->cp["flag_piutang"]->GetDBValue(), ccsText) . "," . $this->SQLValue($this->cp["nilai_denda"]->GetDBValue(), ccsFloat) . ", '" . $this->SQLValue($this->cp["deskripsi"]->GetDBValue(), ccsText) . "', '" . $this->SQLValue($this->cp["user_name"]->GetDBValue(), ccsText) . "') AS msg";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteInsert", $this->Parent);
     if ($this->Errors->Count() == 0 && $this->CmdExecution) {
         //$this->query($this->SQL);
         $this->itemResult = $this->query($this->SQL);
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteInsert", $this->Parent);
     }
 }
Example #20
0
function Page_BeforeShow()
{
    //Page_BeforeShow @1-66DC429C
    //Custom Code @32-2A29BDB7
    global $Tpl;
    $finalcat = CCGetFromGet("finalcat", "");
    $ItemNum = CCGetFromGet("Item_Number", "");
    if (CCGetSession("RecentPreviewItem")) {
        $ItemNum = CCGetSession("RecentPreviewItem");
    }
    $cats = "(";
    $db = new clsDBNetConnect();
    $query = "select * from categories where cat_id='" . $finalcat . "'";
    $db->query($query);
    $db->next_record();
    $Tpl->SetVar("category", $finalcat);
    $Tpl->SetVar("cat_name", $db->f("name"));
    $cats .= "cat_id=" . $db->f("cat_id");
    if ($db->f("sub_cat_id") > 0) {
        $cats .= " or ";
        $sub = $db->f("sub_cat_id");
        $query = "select * from categories where cat_id={$sub}";
        $db->query($query);
        $db->next_record();
        $cats .= "cat_id=" . $db->f("cat_id");
        if ($db->f("sub_cat_id") > 0) {
            $cats .= " or ";
            $sub = $db->f("sub_cat_id");
            $query = "select * from categories where cat_id={$sub}";
            $db->query($query);
            $db->next_record();
            $cats .= "cat_id=" . $db->f("cat_id");
            if ($db->f("sub_cat_id") > 0) {
                $cats .= " or ";
                $sub = $db->f("sub_cat_id");
                $query = "select * from categories where cat_id={$sub}";
                $db->query($query);
                $db->next_record();
                $cats .= "cat_id=" . $db->f("cat_id");
                if ($db->f("sub_cat_id") > 0) {
                    $cats .= " or ";
                    $sub = $db->f("sub_cat_id");
                    $query = "select * from categories where cat_id={$sub}";
                    $db->query($query);
                    $db->next_record();
                    $cats .= "cat_id=" . $db->f("cat_id");
                    if ($db->f("sub_cat_id") > 0) {
                        $cats .= " or ";
                        $sub = $db->f("sub_cat_id");
                        $query = "select * from categories where cat_id={$sub}";
                        $db->query($query);
                        $db->next_record();
                        $cats .= "cat_id=" . $db->f("cat_id");
                        if ($db->f("sub_cat_id") > 0) {
                            $cats .= " or ";
                            $sub = $db->f("sub_cat_id");
                            $query = "select * from categories where cat_id={$sub}";
                            $db->query($query);
                            $db->next_record();
                            $cats .= "cat_id=" . $db->f("cat_id");
                        } else {
                            $cats .= ")";
                        }
                    } else {
                        $cats .= ")";
                    }
                } else {
                    $cats .= ")";
                }
            } else {
                $cats .= ")";
            }
        } else {
            $cats .= ")";
        }
    } else {
        $cats .= ")";
    }
    $Tpl->SetBlockVar("Custom_TextArea", "");
    $custtxt = new clsDBNetConnect();
    $query = "select * from custom_textarea where {$cats}";
    $custtxt->query($query);
    if ($custtxt->next_record()) {
        $custtxt->seek();
        $queryfields = "(";
        $count = 0;
        while ($custtxt->next_record()) {
            if ($count > 0) {
                $queryfields .= " or ";
            }
            $queryfields .= "field_id='" . $custtxt->f("id") . "'";
            $textvar[$custtxt->f("id")] = $custtxt->f("template_var");
            $textdesc[$custtxt->f("id")] = $custtxt->f("description");
            $textname[$custtxt->f("id")] = $custtxt->f("name");
            $count++;
        }
        $custtxt->seek();
        $queryfields .= ") and";
        if (!$_POST["closes"] && $_GET["Item_Number"]) {
            $custtxtvalues = new clsDBNetConnect();
            $query = "select * from custom_textarea_values where {$queryfields} ItemNum=" . $ItemNum;
            $custtxtvalues->query($query);
            while ($custtxtvalues->next_record()) {
                $fieldvalues[$custtxtvalues->f("field_id")] = $custtxtvalues->f("value");
            }
        }
        if ($_POST && !$_GET["Item_Number"]) {
            $custtxt->seek();
            while ($custtxt->next_record()) {
                $fieldvalues[$custtxt->f("id")] = $_POST["custtxt_area::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id")];
            }
        }
        $custtxt->seek();
        while ($custtxt->next_record()) {
            $Tpl->SetVar("ta_name", multiline($textname[$custtxt->f("id")]));
            $Tpl->SetVar("ta_description", multiline($textdesc[$custtxt->f("id")]));
            $Tpl->SetVar("ta_var", "custtxt_area::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id"));
            $Tpl->SetVar("ta_value", stripslashes($fieldvalues[$custtxt->f("id")]));
            $Tpl->SetVar("ta_name_" . $custtxt->f("id"), multiline($textname[$custtxt->f("id")]));
            $Tpl->SetVar("ta_description_" . $custtxt->f("id"), multiline($textdesc[$custtxt->f("id")]));
            $Tpl->SetVar("ta_var_" . $custtxt->f("id"), "custtxt_area::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id"));
            $Tpl->SetVar("ta_value_" . $custtxt->f("id"), stripslashes($fieldvalues[$custtxt->f("id")]));
            $Tpl->Parse("Row", True);
        }
        $Tpl->Parse("Custom_TextArea", True);
    }
    //////////////////////////////
    //Custom TextBox
    //////////////////////////////
    $txtvar = "";
    $txtdesc = "";
    $txtname = "";
    $custtxtvalues = "";
    $custtxt = "";
    $fieldvalues = "";
    $Tpl->SetBlockVar("Custom_TextBox", "");
    $custtxt = new clsDBNetConnect();
    $query = "select * from custom_textbox where {$cats}";
    $custtxt->query($query);
    if ($custtxt->next_record()) {
        $custtxt->seek();
        $queryfields = "(";
        $count = 0;
        while ($custtxt->next_record()) {
            if ($count > 0) {
                $queryfields .= " or ";
            }
            $queryfields .= "field_id='" . $custtxt->f("id") . "'";
            $textvar[$custtxt->f("id")] = $custtxt->f("template_var");
            $textdesc[$custtxt->f("id")] = $custtxt->f("description");
            $textname[$custtxt->f("id")] = $custtxt->f("name");
            $count++;
        }
        $custtxt->seek();
        $queryfields .= ") and";
        if ($_GET["Item_Number"] && !$_POST["closes"]) {
            $custtxtvalues = new clsDBNetConnect();
            $query = "select * from custom_textbox_values where {$queryfields} ItemNum=" . $ItemNum;
            $custtxtvalues->query($query);
            while ($custtxtvalues->next_record()) {
                $fieldvalues[$custtxtvalues->f("field_id")] = $custtxtvalues->f("value");
            }
        }
        if ($_POST && !$_GET["Item_Number"]) {
            $custtxt->seek();
            while ($custtxt->next_record()) {
                $fieldvalues[$custtxt->f("id")] = $_POST["custtxt_box::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id")];
            }
        }
        $custtxt->seek();
        while ($custtxt->next_record()) {
            $Tpl->SetVar("tb_name", multiline($textname[$custtxt->f("id")]));
            $Tpl->SetVar("tb_description", multiline($textdesc[$custtxt->f("id")]));
            $Tpl->SetVar("tb_value", stripslashes($fieldvalues[$custtxt->f("id")]));
            $Tpl->SetVar("tb_var", "custtxt_box::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id"));
            $Tpl->SetVar("tb_name_" . $custtxt->f("id"), multiline($textname[$custtxt->f("id")]));
            $Tpl->SetVar("tb_description_" . $custtxt->f("id"), multiline($textdesc[$custtxt->f("id")]));
            $Tpl->SetVar("tb_value_" . $custtxt->f("id"), stripslashes($fieldvalues[$custtxt->f("id")]));
            $Tpl->SetVar("tb_var_" . $custtxt->f("id"), "custtxt_box::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id"));
            $Tpl->Parse("tb_Row", True);
        }
        $Tpl->Parse("Custom_TextBox", True);
    }
    /////////////////////////////////////////////////////////////////
    //Custom DropDown Fields
    /////////////////////////////////////////////////////////////////
    $txtvar = "";
    $txtdesc = "";
    $txtname = "";
    $custtxtvalues = "";
    $custtxt = "";
    $fieldvalues = "";
    $optionlist = "";
    $checked = "";
    $selected = "";
    $Tpl->SetBlockVar("Custom_DropDown", "");
    $custtxt = new clsDBNetConnect();
    $custoptions = new clsDBNetConnect();
    $query = "select * from custom_dropdown where {$cats}";
    $custtxt->query($query);
    if ($custtxt->next_record()) {
        $custtxt->seek();
        $queryfields = "(";
        $count = 0;
        while ($custtxt->next_record()) {
            if ($count > 0) {
                $queryfields .= " or ";
            }
            $query = "select * from custom_dropdown_options where field_id = '" . $custtxt->f("id") . "'";
            $custoptions->query($query);
            if ($_GET["Item_Number"] && !$_POST["custddbox::" . $custtxt->f("template_var") . "::" . $custtxt->f("id")]) {
                $dvalue = new clsDBNetConnect();
                $query = "select * from custom_dropdown_values where ItemNum = {$ItemNum} and field_id = " . $custtxt->f("id");
                $dvalue->query($query);
                if ($dvalue->next_record()) {
                    $selected[$custtxt->f("id")] = $dvalue->f("option_id");
                } else {
                    $selected[$custtxt->f("id")] = "default";
                }
            } elseif ($_POST["custddbox::" . $custtxt->f("template_var") . "::" . $custtxt->f("id")]) {
                $selected[$custtxt->f("id")] = $_POST["custddbox::" . $custtxt->f("template_var") . "::" . $custtxt->f("id")];
            }
            while ($custoptions->next_record()) {
                $checked = "";
                if (!$_GET["Item_Number"] && !$_POST["custddbox::" . $custtxt->f("template_var") . "::" . $custtxt->f("id")] && $custoptions->f("default") == 1 || $custoptions->f("default") == 1 && $selected[$custtxt->f("id")] == "default") {
                    $checked = " selected ";
                } elseif ($custoptions->f("id") == $selected[$custtxt->f("id")]) {
                    $checked = " selected ";
                } else {
                    $checked = "";
                }
                $optionlist[$custtxt->f("id")][] = "<option value=\"" . $custoptions->f("id") . "\"{$checked}>" . $custoptions->f("option") . "</option>\n";
            }
            $queryfields .= "field_id='" . $custtxt->f("id") . "'";
            $textvar[$custtxt->f("id")] = $custtxt->f("template_var");
            $textdesc[$custtxt->f("id")] = $custtxt->f("description");
            $textname[$custtxt->f("id")] = $custtxt->f("name");
            $count++;
        }
        $custtxt->seek();
        $count = 0;
        while ($custtxt->next_record()) {
            $i = 0;
            $builtoptions = "";
            while ($optionlist[$custtxt->f("id")][$i]) {
                $builtoptions .= $optionlist[$custtxt->f("id")][$i];
                $i++;
            }
            $Tpl->SetVar("dd_name", multiline($textname[$custtxt->f("id")]));
            $Tpl->SetVar("dd_description", multiline($textdesc[$custtxt->f("id")]));
            $Tpl->SetVar("dd_var", "custddbox::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id"));
            $Tpl->SetVar("dropdown_Options", $builtoptions);
            $Tpl->SetVar("dd_name_" . $custtxt->f("id"), multiline($textname[$custtxt->f("id")]));
            $Tpl->SetVar("dd_description_" . $custtxt->f("id"), multiline($textdesc[$custtxt->f("id")]));
            $Tpl->SetVar("dd_var_" . $custtxt->f("id"), "custddbox::" . $textvar[$custtxt->f("id")] . "::" . $custtxt->f("id"));
            $Tpl->SetVar("dropdown_Options_" . $custtxt->f("id"), $builtoptions);
            $Tpl->Parse("dd_Row", True);
        }
        $Tpl->Parse("Custom_DropDown", True);
    }
    //////////////////////////////////
    //End Custom Vars/////////////////
    //////////////////////////////////
    global $regcharges;
    $sql = "SELECT * FROM categories WHERE sub_cat_id > '0' ORDER BY weight, name";
    $db = new clsDBNetConnect();
    $db->connect();
    $db->query($sql);
    while ($db->next_record()) {
        $catid = $db->f(0);
        $subid = $db->f(1);
        $name = $db->f(2);
        if ($subid == 1) {
            $inis .= "<OPTION value=\"" . $catid . "\">" . $name . "</OPTION>";
        }
        $dsper .= "catlist[" . $catid . "] = new Array(" . $subid . " , \"" . $name . "\");\r\n";
    }
    $closestCat = getparents($_GET["finalcat"]);
    if (!$closestCat) {
        $closestCat = 1;
    }
    $db2 = new clsDBNetConnect();
    $db2->connect();
    $db2->query("SELECT * FROM lookup_listing_dates WHERE charge_for='1' and cat_id={$closestCat}");
    $dayfees = "";
    while ($db2->next_record()) {
        $dayfees = $dayfees . $db2->f("days") . " Days - <font color='red'>" . $regcharges["currency"] . $db2->f("fee") . "</font><br>";
    }
    $Tpl->SetVar("cats", $dsper);
    $Tpl->SetVar("catbuild", $inis);
    $Tpl->SetVar("dayfees", $dayfees);
    unset($db);
    //End Custom Code
}
 function Show()
 {
     global $Tpl;
     global $CCSLocales;
     if (!$this->Visible) {
         return;
     }
     $this->RowNumber = 0;
     $this->DataSource->Parameters["sesUserID"] = CCGetSession("UserID", NULL);
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeSelect", $this);
     $this->DataSource->Prepare();
     $this->DataSource->Open();
     $this->HasRecord = $this->DataSource->has_next_record();
     $this->IsEmpty = !$this->HasRecord;
     $this->Attributes->Show();
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
     if (!$this->Visible) {
         return;
     }
     $GridBlock = "Grid " . $this->ComponentName;
     $ParentPath = $Tpl->block_path;
     $Tpl->block_path = $ParentPath . "/" . $GridBlock;
     if (!$this->IsEmpty) {
         $this->ControlsVisible["DLink"] = $this->DLink->Visible;
         $this->ControlsVisible["message_status"] = $this->message_status->Visible;
         $this->ControlsVisible["creation_date"] = $this->creation_date->Visible;
         $this->ControlsVisible["message_type"] = $this->message_type->Visible;
         $this->ControlsVisible["t_message_inbox_bphtb_id"] = $this->t_message_inbox_bphtb_id->Visible;
         $this->ControlsVisible["status_view"] = $this->status_view->Visible;
         $this->ControlsVisible["ppat_name"] = $this->ppat_name->Visible;
         while ($this->ForceIteration || $this->RowNumber < $this->PageSize && ($this->HasRecord = $this->DataSource->has_next_record())) {
             $this->RowNumber++;
             if ($this->HasRecord) {
                 $this->DataSource->next_record();
                 $this->DataSource->SetValues();
             }
             $Tpl->block_path = $ParentPath . "/" . $GridBlock . "/Row";
             $this->DLink->Parameters = CCGetQueryString("QueryString", array("FLAG", "ccsForm"));
             $this->DLink->Parameters = CCAddParam($this->DLink->Parameters, "t_message_inbox_id", $this->DataSource->f("t_message_inbox_bphtb_id"));
             $this->message_status->SetValue($this->DataSource->message_status->GetValue());
             $this->creation_date->SetValue($this->DataSource->creation_date->GetValue());
             $this->message_type->SetValue($this->DataSource->message_type->GetValue());
             $this->t_message_inbox_bphtb_id->SetValue($this->DataSource->t_message_inbox_bphtb_id->GetValue());
             $this->status_view->SetValue($this->DataSource->status_view->GetValue());
             $this->ppat_name->SetValue($this->DataSource->ppat_name->GetValue());
             $this->Attributes->SetValue("rowNumber", $this->RowNumber);
             $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow", $this);
             $this->Attributes->Show();
             $this->DLink->Show();
             $this->message_status->Show();
             $this->creation_date->Show();
             $this->message_type->Show();
             $this->t_message_inbox_bphtb_id->Show();
             $this->status_view->Show();
             $this->ppat_name->Show();
             $Tpl->block_path = $ParentPath . "/" . $GridBlock;
             $Tpl->parse("Row", true);
         }
     } else {
         // Show NoRecords block if no records are found
         $this->Attributes->Show();
         $Tpl->parse("NoRecords", false);
     }
     $errors = $this->GetErrors();
     if (strlen($errors)) {
         $Tpl->replaceblock("", $errors);
         $Tpl->block_path = $ParentPath;
         return;
     }
     $this->Navigator->PageNumber = $this->DataSource->AbsolutePage;
     $this->Navigator->PageSize = $this->PageSize;
     if ($this->DataSource->RecordsCount == "CCS not counted") {
         $this->Navigator->TotalPages = $this->DataSource->AbsolutePage + ($this->DataSource->next_record() ? 1 : 0);
     } else {
         $this->Navigator->TotalPages = $this->DataSource->PageCount();
     }
     if ($this->Navigator->TotalPages <= 1) {
         $this->Navigator->Visible = false;
     }
     $this->Navigator->Show();
     $Tpl->parse();
     $Tpl->block_path = $ParentPath;
     $this->DataSource->close();
 }
 function Insert()
 {
     global $CCSLocales;
     global $DefaultDateFormat;
     $this->CmdExecution = true;
     $this->cp["sender_message_id"] = new clsSQLParameter("urlt_message_inbox_bphtb_id", ccsFloat, "", "", CCGetFromGet("t_message_inbox_bphtb_id", NULL), 0, false, $this->ErrorBlock);
     $this->cp["user_name"] = new clsSQLParameter("sesUserLogin", ccsText, "", "", CCGetSession("UserLogin", NULL), "", false, $this->ErrorBlock);
     $this->cp["message_body"] = new clsSQLParameter("ctrlmessage_body", ccsText, "", "", $this->message_body->GetValue(true), "", false, $this->ErrorBlock);
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent);
     if (!is_null($this->cp["sender_message_id"]->GetValue()) and !strlen($this->cp["sender_message_id"]->GetText()) and !is_bool($this->cp["sender_message_id"]->GetValue())) {
         $this->cp["sender_message_id"]->SetText(CCGetFromGet("t_message_inbox_bphtb_id", NULL));
     }
     if (!strlen($this->cp["sender_message_id"]->GetText()) and !is_bool($this->cp["sender_message_id"]->GetValue(true))) {
         $this->cp["sender_message_id"]->SetText(0);
     }
     if (!is_null($this->cp["user_name"]->GetValue()) and !strlen($this->cp["user_name"]->GetText()) and !is_bool($this->cp["user_name"]->GetValue())) {
         $this->cp["user_name"]->SetValue(CCGetSession("UserLogin", NULL));
     }
     if (!is_null($this->cp["message_body"]->GetValue()) and !strlen($this->cp["message_body"]->GetText()) and !is_bool($this->cp["message_body"]->GetValue())) {
         $this->cp["message_body"]->SetValue($this->message_body->GetValue(true));
     }
     $this->SQL = "SELECT f_send_message_to_ppat(" . $this->SQLValue($this->cp["sender_message_id"]->GetDBValue(), ccsFloat) . ",'" . $this->SQLValue($this->cp["user_name"]->GetDBValue(), ccsText) . "','" . $this->SQLValue($this->cp["message_body"]->GetDBValue(), ccsText) . "',null) as pesan";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteInsert", $this->Parent);
     if ($this->Errors->Count() == 0 && $this->CmdExecution) {
         $this->query($this->SQL);
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteInsert", $this->Parent);
     }
 }
function products_maintcontent_BeforeShow(&$sender)
{
    $products_maintcontent_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $products_maintcontent;
    //Compatibility
    //End products_maintcontent_BeforeShow
    //Custom Code @41-2A29BDB7
    // -------------------------
    // Write your own code here.
    //Settingup saved message popup
    global $MainPage;
    $showalert = CCGetSession("showalert", "hide");
    $MainPage->Attributes->SetValue("showalert", $showalert);
    if ($showalert == "show") {
        CCSetSession("showalert", "hide");
    }
    //There is some code duplication regarding show duplicate message info, session storage is read after some events
    //has being fired and therefore not read.
    $o = trim(CCGetFromGet("o", ""));
    if ($o == "duplicate") {
        $showglobal_alert = CCGetSession("showglobal_alert", "hide");
        //$MainPage->Attributes->SetValue("showglobal_alert",$showglobal_alert);
        $products_maintcontent->alm_products->showglobal_alert->SetValue($showglobal_alert);
        if ($showglobal_alert == "show") {
            CCSetSession("showglobal_alert", "hide");
        }
    } else {
        $products_maintcontent->alm_products->showglobal_alert->SetValue("hide");
        CCSetSession("showglobal_alert", "hide");
    }
    // -------------------------
    //End Custom Code
    //Close products_maintcontent_BeforeShow @1-86B6A4EF
    return $products_maintcontent_BeforeShow;
}
Example #24
0
$charges->Operation();
$charges1->Operation();
$Footer->Operations();
//End Execute Components
//Go to destination page @1-BEB91355
if ($Redirect) {
    $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
    header("Location: " . $Redirect);
    exit;
}
//End Go to destination page
//Initialize HTML Template @1-A0111C9D
$CCSEventResult = CCGetEvent($CCSEvents, "OnInitializeView");
$Tpl = new clsTemplate();
include './Lang/lang_class.php';
$Tpl->LoadTemplate(TemplatePath . $TemplateFileName, "main");
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeShow");
//End Initialize HTML Template
$Tpl->setVar("ItemNum", CCGetSession("RecentItemNum"));
$Tpl->setVar("finalcat", $finalcat);
//Show Page @1-C99B99CD
$Header->Show("Header");
$charges->Show();
$charges1->Show();
$Footer->Show("Footer");
$Tpl->PParse("main", false);
//End Show Page
//Unload Page @1-AB7622EF
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload");
unset($Tpl);
//End Unload Page
Example #25
0
 function Delete()
 {
     global $CCSLocales;
     global $DefaultDateFormat;
     $this->CmdExecution = true;
     $Where = "";
     $this->cp["p_role_id"] = new clsSQLParameter("ctrlp_role_id", ccsInteger, "", "", $this->p_role_id->GetValue(true), 0, false, $this->ErrorBlock);
     $this->cp["struser"] = new clsSQLParameter("sesUserName", ccsText, "", "", CCGetSession("UserName", NULL), "", false, $this->ErrorBlock);
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildDelete", $this->Parent);
     if (!is_null($this->cp["p_role_id"]->GetValue()) and !strlen($this->cp["p_role_id"]->GetText()) and !is_bool($this->cp["p_role_id"]->GetValue())) {
         $this->cp["p_role_id"]->SetValue($this->p_role_id->GetValue(true));
     }
     if (!strlen($this->cp["p_role_id"]->GetText()) and !is_bool($this->cp["p_role_id"]->GetValue(true))) {
         $this->cp["p_role_id"]->SetText(0);
     }
     if (!is_null($this->cp["struser"]->GetValue()) and !strlen($this->cp["struser"]->GetText()) and !is_bool($this->cp["struser"]->GetValue())) {
         $this->cp["struser"]->SetValue(CCGetSession("UserName", NULL));
     }
     $this->SQL = "select * from f_crud_p_role\n" . "(" . $this->SQLValue($this->cp["p_role_id"]->GetDBValue(), ccsInteger) . ", \n" . "null,\n" . "null,\n" . "null,\n" . "null,\n" . "null,\n" . "'" . $this->SQLValue($this->cp["struser"]->GetDBValue(), ccsText) . "',\n" . "'D')";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteDelete", $this->Parent);
     if ($this->Errors->Count() == 0 && $this->CmdExecution) {
         $this->query($this->SQL);
         //begin-tambahan
         $Result = $this->next_record();
         if ($this->f('oint_result') != 1) {
             $this->Errors->AddError($this->f('ostr_msg'));
             return;
         }
         //end-tambahan
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteDelete", $this->Parent);
     }
 }
Example #26
0
<?php

define("RelativePath", "..");
define("PathToCurrentPage", "/report/");
define("FileName", "cetak_registrasi.php");
include_once RelativePath . "/Common.php";
$dbConn = new clsDBConnSIKP();
$t_customer_order_id = CCGetFromGet("t_customer_order_id");
$user = CCGetSession('UserLogin');
$sql = "select f_print_register_new({$t_customer_order_id}, '{$user}')";
$dbConn->query($sql);
$dbConn->next_record();
echo $dbConn->f('f_print_register_new');
 function Insert()
 {
     global $CCSLocales;
     global $DefaultDateFormat;
     $this->CmdExecution = true;
     $this->cp["t_vat_setllement_id"] = new clsSQLParameter("ctrlt_vat_setllement_id", ccsInteger, "", "", $this->t_vat_setllement_id->GetValue(true), 0, false, $this->ErrorBlock);
     $this->cp["alasan"] = new clsSQLParameter("ctrlalasan", ccsText, "", "", $this->alasan->GetValue(true), "", false, $this->ErrorBlock);
     $this->cp["user_name"] = new clsSQLParameter("sesUserLogin", ccsText, "", "", CCGetSession("UserLogin", NULL), "", false, $this->ErrorBlock);
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeBuildInsert", $this->Parent);
     if (!is_null($this->cp["t_vat_setllement_id"]->GetValue()) and !strlen($this->cp["t_vat_setllement_id"]->GetText()) and !is_bool($this->cp["t_vat_setllement_id"]->GetValue())) {
         $this->cp["t_vat_setllement_id"]->SetValue($this->t_vat_setllement_id->GetValue(true));
     }
     if (!strlen($this->cp["t_vat_setllement_id"]->GetText()) and !is_bool($this->cp["t_vat_setllement_id"]->GetValue(true))) {
         $this->cp["t_vat_setllement_id"]->SetText(0);
     }
     if (!is_null($this->cp["alasan"]->GetValue()) and !strlen($this->cp["alasan"]->GetText()) and !is_bool($this->cp["alasan"]->GetValue())) {
         $this->cp["alasan"]->SetValue($this->alasan->GetValue(true));
     }
     if (!is_null($this->cp["user_name"]->GetValue()) and !strlen($this->cp["user_name"]->GetText()) and !is_bool($this->cp["user_name"]->GetValue())) {
         $this->cp["user_name"]->SetValue(CCGetSession("UserLogin", NULL));
     }
     $this->SQL = "SELECT f_reject_trans(" . $this->SQLValue($this->cp["t_vat_setllement_id"]->GetDBValue(), ccsInteger) . ",'" . $this->SQLValue($this->cp["user_name"]->GetDBValue(), ccsText) . "','" . $this->SQLValue($this->cp["alasan"]->GetDBValue(), ccsText) . "', 0, '') AS msg";
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeExecuteInsert", $this->Parent);
     if ($this->Errors->Count() == 0 && $this->CmdExecution) {
         $this->itemResult = $this->query($this->SQL);
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterExecuteInsert", $this->Parent);
     }
 }
function products_suite_maintcontent_BeforeShow(&$sender)
{
    $products_suite_maintcontent_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $products_suite_maintcontent;
    //Compatibility
    //End products_suite_maintcontent_BeforeShow
    //Custom Code @14-2A29BDB7
    // -------------------------
    // Write your own code here.
    //Settingup saved message popup
    global $MainPage;
    $showalert = CCGetSession("showalert", "hide");
    $MainPage->Attributes->SetValue("showalert", $showalert);
    if ($showalert == "show") {
        CCSetSession("showalert", "hide");
    }
    // -------------------------
    //End Custom Code
    //Close products_suite_maintcontent_BeforeShow @1-CA363294
    return $products_suite_maintcontent_BeforeShow;
}
Example #29
0
 function Show()
 {
     global $Tpl;
     global $now;
     if (!$this->Visible) {
         return;
     }
     $ShownRecords = 0;
     $this->ds->Parameters["sesUserID"] = CCGetSession("UserID");
     $this->ds->Prepare();
     $this->ds->Open();
     $GridBlock = "Grid " . $this->ComponentName;
     $Tpl->block_path = $GridBlock;
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow");
     $is_next_record = $this->ds->next_record();
     if ($is_next_record && $ShownRecords < $this->PageSize) {
         do {
             $this->ds->SetValues();
             $Tpl->block_path = $GridBlock . "/Row";
             $this->comment->SetValue($this->ds->comment->GetValue());
             $twodays = $this->ds->date->GetValue();
             $theday = getdate($twodays);
             $lastofyear = substr($theday["year"], -2);
             $enddate = $theday["mon"] . "/" . $theday["mday"] . "/" . $lastofyear;
             $this->date->SetValue(date("F j, Y, g:i a", $this->ds->date->GetValue()));
             if ($this->ds->doing_rating->GetValue() != "" && is_numeric($this->ds->doing_rating->GetValue()) && $this->ds->doing_rating->GetValue() != 1000000000) {
                 $lookupdb = new clsDBNetConnect();
                 $lookupdb->connect();
                 $thename = CCDLookUp("user_login", "users", "user_id='" . $this->ds->doing_rating->GetValue() . "'", $lookupdb);
                 $this->doing_rating->SetValue($thename);
                 unset($lookupdb);
             } else {
                 $this->doing_rating->SetValue($now["sitename"]);
             }
             $this->id->SetValue($this->ds->id->GetValue());
             $this->ItemNum->SetValue($this->ds->ItemNum->GetValue());
             if ($this->ds->rating->GetValue() == 1) {
                 $this->rating->SetValue("<img src=\"images/positive.gif\">");
             }
             if ($this->ds->rating->GetValue() == 0) {
                 $this->rating->SetValue("<img src=\"images/neutral.gif\">");
             }
             if ($this->ds->rating->GetValue() == -1) {
                 $this->rating->SetValue("<img src=\"images/negative.gif\">");
             }
             if ($this->ds->buysell->GetValue() == 1) {
                 $this->buysell->SetValue("Buyer");
             }
             if ($this->ds->buysell->GetValue() == 0) {
                 $this->buysell->SetValue("Seller");
             }
             $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShowRow");
             $this->comment->Show();
             $this->date->Show();
             $this->doing_rating->Show();
             $this->buysell->Show();
             $this->id->Show();
             $this->ItemNum->Show();
             $this->rating->Show();
             $counter = new clsDBNetConnect();
             $query = "select * from feedback where `counter` = '" . $this->ds->id->GetValue() . "'";
             $counter->query($query);
             if ($counter->next_record()) {
                 $Tpl->SetBlockVar("counter", "");
                 $Tpl->setVar("countercomment", stripslashes($counter->f("comment")));
                 $Tpl->setVar("countericon", "<img src=\"images/CounterComment.gif\">");
                 $Tpl->setVar("counterlink", "");
                 $Tpl->parse("counter", "");
             } else {
                 $Tpl->SetBlockVar("counter", "");
                 $Tpl->setVar("countercomment", "");
                 $Tpl->setVar("countericon", "");
                 if (CCGetUserID() == $_GET["user_id"]) {
                     $Tpl->setVar("counterlink", "<a href=\"RateUser.php?id=" . $this->ds->id->GetValue() . "\">&nbsp;&nbsp;&nbsp;&nbsp;<i>Comment on this rating</i></a>");
                 }
             }
             $Tpl->block_path = $GridBlock;
             $Tpl->parse("Row", true);
             $ShownRecords++;
             $is_next_record = $this->ds->next_record();
         } while ($is_next_record && $ShownRecords < $this->PageSize);
     } else {
         $Tpl->parse("NoRecords", false);
     }
     $this->Navigator->TotalPages = $this->ds->PageCount();
     $this->Sorter_doing_rating->Show();
     $this->Sorter_date->Show();
     $this->Navigator->Show();
     $Tpl->parse("", false);
     $Tpl->block_path = "";
 }
function Page_BeforeShow(&$sender)
{
    $Page_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_bphtb_registration_list_update;
    //Compatibility
    //End Page_BeforeShow
    //Custom Code @703-2A29BDB7
    // -------------------------
    // Write your own code here.
    if (CCGetFromGet("submit_bphtb") == 1) {
        $dbConn = new clsDBConnSIKP();
        $sql = "select count(*) as jml from t_product_order_control where doc_id = " . CCGetFromGet('t_customer_order_id') . "and and p_w_doc_type_id = 505";
        $dbConn->query($sql);
        $jumlah_data;
        if ($dbConn->next_record()) {
            $jumlah_data = $dbConn->f('jml');
        }
        if ($jumlah_data == 0) {
            $sql = "select sikp.f_first_submit_engine(505," . CCGetFromGet('t_customer_order_id') . ",'" . CCGetSession('UserLogin') . "')";
            $dbConn->query($sql);
        } else {
            echo "\r\n\t\t\t\t<script>\r\n\t\t\t\t\talert('Data BPHTB Sudah Tersubmit');\r\n\t\t\t\t</script>\r\n\t\t\t";
            //exit;
        }
        $dbConn->close();
        header('Location:t_bphtb_registration_list.php');
        exit;
    }
    // -------------------------
    //End Custom Code
    //Close Page_BeforeShow @1-4BC230CD
    return $Page_BeforeShow;
}