コード例 #1
0
function Login_Button_DoLogin_OnClick(&$sender)
{
    $Login_Button_DoLogin_OnClick = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $Login;
    //Compatibility
    //End Login_Button_DoLogin_OnClick
    //Login @4-DE10C29C
    global $CCSLocales;
    global $Redirect;
    if (!CCLoginUser($Container->username->Value, $Container->password->Value)) {
        $Container->Errors->addError($CCSLocales->GetText("CCS_LoginError"));
        $Container->password->SetValue("");
        $Login_Button_DoLogin_OnClick = 0;
    } else {
        global $Redirect;
        $seshmenu = "";
        $glip = array("glyphicon-cog", "glyphicon-cog", "glyphicon-list", "glyphicon-folder-close", "glyphicon-usd", "glyphicon-gift", "glyphicon-time", "glyphicon-user", "glyphicon-log-in", "glyphicon-align-justify");
        $DBhrcon_ = new clsDBhrcon();
        $queryMD = "select p_module_id, code, description from p_module " . "where is_active='Y' order by listing_no";
        $DBhrcon_->query($queryMD);
        while ($DBhrcon_->next_record()) {
            $seshmenu = $seshmenu . "<li><a href='../main/modul.php?p_module_id=" . $DBhrcon_->f("p_module_id") . "'" . "title='" . $DBhrcon_->f("code") . "&#13;" . $DBhrcon_->f("description") . "' target=''>" . "<i class='glyphicon " . $glip[$DBhrcon_->f("p_module_id")] . "' style='font-size: 32px; border:2px solid #ffffff; padding:3px'></i>";
        }
        $DBhrcon_->close();
        CCSetSession("hmenu", $seshmenu);
        $Redirect = CCGetParam("ret_link", $Redirect);
        $Login_Button_DoLogin_OnClick = 1;
    }
    //End Login
    //Close Login_Button_DoLogin_OnClick @3-0EB5DCFE
    return $Login_Button_DoLogin_OnClick;
}
コード例 #2
0
ファイル: register_events.php プロジェクト: 4v4t4r/CTF-LCC
function users_AfterInsert()
{
    //users_AfterInsert @4-34AA212C
    //Custom Code @34-2A29BDB7
    global $users;
    global $now;
    global $NewPass;
    global $EP;
    global $Give_New_Credit;
    global $Give_Amount;
    global $Give_Tokens;
    global $Give_Cause;
    $lookdb = new clsDBNetConnect();
    $lookdb->connect();
    $lookdb->query("SELECT * FROM users WHERE user_login='******'");
    if ($lookdb->next_record()) {
        $ld = array("first" => $lookdb->f("first_name"), "ID" => $lookdb->f("user_id"), "user_password" => $lookdb->f("user_password"), "last" => $lookdb->f("last_name"), "email" => $lookdb->f("email"), "address" => $lookdb->f("address1"), "address2" => $lookdb->f("address2"), "state" => $lookdb->f("state_id"), "zip" => $lookdb->f("zip"), "city" => $lookdb->f("city"), "phonedy" => $lookdb->f("phone_day"), "phoneevn" => $lookdb->f("phone_evn"), "fax" => $lookdb->f("fax"), "ip" => $lookdb->f("ip_insert"), "date_created" => $lookdb->f("date_created"));
    }
    CCSetSession("RecentUserSign", $users->user_login->Value);
    CCSetSession("RecentUserEmail", $users->email->Value);
    $EP["EMAIL:CURRENT_USERNAME"] = $users->user_login->Value;
    $EP["EMAIL:CURRENT_USERID"] = $ld["ID"];
    $EP["EMAIL:CURRENT_USER_PASSWORD"] = $ld["user_password"];
    $EP["EMAIL:CURRENT_USER_FIRST_NAME"] = $ld["first"];
    $EP["EMAIL:CURRENT_USER_LAST_NAME"] = $ld["last"];
    $EP["EMAIL:CURRENT_USER_EMAIL"] = $ld["email"];
    $EP["EMAIL:CURRENT_USER_ADDRESS"] = $ld["address"];
    $EP["EMAIL:CURRENT_USER_ADDRESS2"] = $ld["address2"];
    $EP["EMAIL:CURRENT_USER_STATE"] = $ld["state"];
    $EP["EMAIL:CURRENT_USER_CITY"] = $ld["city"];
    $EP["EMAIL:CURRENT_USER_ZIP"] = $ld["zip"];
    $EP["EMAIL:CURRENT_USER_DAY_PHONE"] = $ld["phonedy"];
    $EP["EMAIL:CURRENT_USER_EVN_PHONE"] = $ld["phoneevn"];
    $EP["EMAIL:CURRENT_USER_FAX"] = $ld["fax"];
    $EP["EMAIL:CURRENT_USER_IP"] = getenv("REMOTE_ADDR");
    $EP["EMAIL:CURRENT_USER__REGISTERED_IP"] = $ld["ip"];
    $EP["EMAIL:CURRENT_USER_DATE_SIGNEDUP"] = date("F j, Y, g:i a", $ld["date_created"]);
    mailout("NewRegistration", $now["notify"], $ld["ID"], 1000000000, time(), $EP);
    if ($Give_New_Credit == 1) {
        $gdb = new clsDBNetConnect();
        $gdb->connect();
        if ($Give_Amount) {
            $SQL = "INSERT INTO charges(user_id, date, cause, charge) VALUES ('" . $ld["ID"] . "', '" . time() . "', '" . $Give_Cause . "', '" . $Give_Amount . "')";
            $gdb->query($SQL);
        }
        if ($Give_Tokens) {
            $SQL = "update users set tokens = '" . $Give_Tokens . "' where user_id = '" . $ld["ID"] . "'";
            $gdb->query($SQL);
        }
    }
    //End Send Email
    //End Custom Code
}
コード例 #3
0
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
}
コード例 #4
0
ファイル: user_attribute.php プロジェクト: rayminami/chumanis
function setUserAttrib($uid)
{
    $attr_db = new clsDBhrcon();
    $attr_sql = "SELECT\r\n\t\t\t\t\tp_user_attribute.user_attribute_value,p_user_attribute_list.code as list_code,p_user_attribute_list.name as list_name,p_user_attribute_type.code as type_code\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\tp_user_attribute\r\n\t\t\t\t\tLEFT JOIN p_user_attribute_list ON p_user_attribute.p_user_attribute_list_id = p_user_attribute_list.p_user_attribute_list_id\r\n\t\t\t\t\tLEFT JOIN p_user_attribute_type ON p_user_attribute.p_user_attribute_type_id = p_user_attribute_type.p_user_attribute_type_id\r\n\t\t\t\t\tWHERE p_user_attribute.p_user_id =" . $uid;
    $attr_db->query($attr_sql);
    $attr_db->next_record();
    $items_attr = array();
    foreach ($attr_db->Provider->Query_ID as $key => $val) {
        if (isset($items_attr[$val['type_code']])) {
            if (!is_array($items_attr[$val['type_code']])) {
                $items_attr_temp = $items_attr[$val['type_code']];
                $items_attr[$val['type_code']] = array();
                $items_attr[$val['type_code']][] = $items_attr_temp;
                $items_attr[$val['type_code']][] = $val['list_code'];
            } else {
                $items_attr[$val['type_code']][] = $val['list_code'];
            }
        } else {
            $items_attr[$val['type_code']] = $val['list_code'];
        }
    }
    CCSetSession("USER_ATTR", json_encode($items_attr));
}
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 contacts_holidays_maintcontent_BeforeShow(&$sender)
{
    $contacts_holidays_maintcontent_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $contacts_holidays_maintcontent;
    //Compatibility
    //End contacts_holidays_maintcontent_BeforeShow
    //Custom Code @2-2A29BDB7
    // -------------------------
    // Write your own code here.
    global $MainPage;
    $showalert = CCGetSession("showalert", "hide");
    $MainPage->Attributes->SetValue("showalert", $showalert);
    if ($showalert == "show") {
        CCSetSession("showalert", "hide");
    }
    // -------------------------
    //End Custom Code
    //Close contacts_holidays_maintcontent_BeforeShow @1-60969598
    return $contacts_holidays_maintcontent_BeforeShow;
}
コード例 #7
0
ファイル: Classes.php プロジェクト: rayminami/chumanis
 function Show($RowNumber = "")
 {
     $Tpl = CCGetTemplate($this);
     if ($this->Visible) {
         $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeShow", $this);
         if (!$this->Visible) {
             $Tpl->setblockvar("FileUpload " . $this->Name, "");
             return;
         }
         $this->Attributes->Show();
         if (strlen($RowNumber)) {
             $ControlName = $this->Name . "_" . $RowNumber;
             $FileControl = $this->Name . "_File_" . $RowNumber;
             $DeleteControl = $this->Name . "_Delete_" . $RowNumber;
         } else {
             $ControlName = $this->Name;
             $FileControl = $this->Name . "_File";
             $DeleteControl = $this->Name . "_Delete";
         }
         $SessionName = CCGetParam($ControlName);
         if (!strlen($SessionName)) {
             $random_value = mt_rand(100000, 9999999) . mt_rand(100000, 9999999);
             $SessionName = "FileUpload" . $random_value . date("dHis");
             $this->State = array($this->Value, "");
         }
         CCSetSession($SessionName, $this->State);
         $Tpl->SetVar("State", $SessionName);
         $Tpl->SetVar("ControlName", $ControlName);
         $Tpl->SetVar("FileControl", $FileControl);
         $Tpl->SetVar("DeleteControl", $DeleteControl);
         if (strlen($this->Value)) {
             $Tpl->SetVar("ActualFileName", $this->Value);
             $Tpl->SetVar("FileName", $this->GetFileName());
             $Tpl->SetVar("FileSize", $this->GetFileSize());
             $Tpl->parse("FileUpload " . $this->Name . "/Info", false);
             if ($this->Required) {
                 $Tpl->parse("FileUpload " . $this->Name . "/Upload", false);
                 $Tpl->setblockvar("FileUpload " . $this->Name . "/DeleteControl", "");
             } else {
                 $Tpl->setblockvar("FileUpload " . $this->Name . "/Upload", "");
                 $Tpl->parse("FileUpload " . $this->Name . "/DeleteControl", false);
             }
         } else {
             $Tpl->parse("FileUpload " . $this->Name . "/Upload", false);
             $Tpl->setblockvar("FileUpload " . $this->Name . "/Info", "");
             $Tpl->setblockvar("FileUpload " . $this->Name . "/DeleteControl", "");
         }
         $Tpl->Parse("FileUpload " . $this->Name, false);
     } else {
         $Tpl->setblockvar("FileUpload " . $this->Name, "");
     }
 }
function contacts_subhobbies_maintcontent_alm_customers_contacts_su_AfterInsert(&$sender)
{
    $contacts_subhobbies_maintcontent_alm_customers_contacts_su_AfterInsert = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $contacts_subhobbies_maintcontent;
    //Compatibility
    //End contacts_subhobbies_maintcontent_alm_customers_contacts_su_AfterInsert
    //Custom Code @16-2A29BDB7
    // -------------------------
    // Write your own code here.
    CCSetSession("showalert", "show");
    // -------------------------
    //End Custom Code
    //Close contacts_subhobbies_maintcontent_alm_customers_contacts_su_AfterInsert @2-B68B9575
    return $contacts_subhobbies_maintcontent_alm_customers_contacts_su_AfterInsert;
}
コード例 #9
0
 function Init()
 {
     $this->SetLocale(CCGetFromGet("locale"));
     $this->SetLocale(CCGetSession("locale"));
     $this->SetLocale($this->DefaultLocale);
     CCSetSession("locale", $this->GetFormatInfo("Name"));
     CCSetSession("lang", $this->GetFormatInfo("Language"));
 }
コード例 #10
0
function CCLogoutUser()
{
    CCSetSession("UserID", "");
    CCSetSession("UserName", "");
    CCSetSession("GroupID", "");
    CCSetSession("UserAddr", "");
    CCSetSession("hmenu", "");
    CCSetSession("lmenu", "");
}
コード例 #11
0
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;
}
コード例 #12
0
function products_suite_viewcontent_alm_product_suites_AfterInsert(&$sender)
{
    $products_suite_viewcontent_alm_product_suites_AfterInsert = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $products_suite_viewcontent;
    //Compatibility
    //End products_suite_viewcontent_alm_product_suites_AfterInsert
    //Custom Code @22-2A29BDB7
    // -------------------------
    // Write your own code here.
    //Show message alert after saving information
    CCSetSession("showalert", "show");
    global $lastguid;
    global $FileName;
    global $Redirect;
    $Redirect = $FileName . "?guid={$lastguid}";
    // -------------------------
    //End Custom Code
    //Close products_suite_viewcontent_alm_product_suites_AfterInsert @2-E7C4D88F
    return $products_suite_viewcontent_alm_product_suites_AfterInsert;
}
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;
}
コード例 #14
0
ファイル: Common.php プロジェクト: santo-s/do_sql.js
function GenerateCaptchaCode($letters, $sesVariableName, $width, $height, $length, $rot, $br, $w1, $w2, $noise)
{
    $restricted = "|cp|cb|ck|c6|c9|rn|rm|mm|co|do|cl|db|qp|qb|dp|";
    $res = new clsQuadraticPaths();
    $t = "";
    $code = "";
    $r = "";
    for ($i = 0; $i < $length; $i++) {
        $r = intval(count($letters) * (mt_rand(0, 99) / 100));
        while (strpos("|" . substr($code, -strlen($code), 1) . $letters[$r][0] . "|", $restricted) !== false) {
            $r = intval(count($letters) * (mt_rand(0, 99) / 100));
        }
        $code = $code . $letters[$r][0];
        $t = new clsQuadraticPaths();
        $t->LoadFromArray($letters[$r]);
        $t->Wave(2 * $w2 * (mt_rand(0, 99) / 100) - $w2);
        $t->Rotate(2 * $rot * (mt_rand(0, 99) / 100) - $rot);
        $t->Normalize(0, 100);
        if ($t->MaxX - $t->MinX > 100) {
            $t->Normalize(100, 100);
        }
        $t->Addition(($i - 1) * $t->MaxY, 0);
        $res->AddPaths($t);
    }
    $res->Rotate(90);
    $res->Wave(2 * $w1 * (mt_rand(0, 99) / 100) - $w1);
    $res->Rotate(-90);
    $res->Broke($br, $br);
    $res->Normalize($width - 12, $height - 12);
    $res->Addition(6, 6);
    $res->Mix();
    $res->Noises($noise);
    CCSetSession($sesVariableName, $code);
    return $res->ToString();
}
コード例 #15
0
function customers_maintcontent_BeforeShow(&$sender)
{
    $customers_maintcontent_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $customers_maintcontent;
    //Compatibility
    //End customers_maintcontent_BeforeShow
    //Custom Code @227-2A29BDB7
    // -------------------------
    // Write your own code here.
    global $Tpl;
    $tab = CCGetFromGet("tab", "tab1_active");
    $mr = CCGetFromGet("mr", "customers");
    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;
    }
    if ($mr == "contacts") {
        $Tpl->setvar("mr_show", "hide");
        $Tpl->setvar("contact_show", "show");
    } else {
        $Tpl->setvar("mr_show", "show");
        $Tpl->setvar("contact_show", "hide");
    }
    //Settingup saved message popup
    global $MainPage;
    $showalert = CCGetSession("showalert", "hide");
    $MainPage->Attributes->SetValue("showalert", $showalert);
    if ($showalert == "show") {
        CCSetSession("showalert", "hide");
    }
    //On Edit mode, check if has contacts
    $customer_guid = trim(CCGetFromGet("guid", ""));
    if (strlen($customer_guid) > 0) {
        $customers = new Customers();
        $params = array();
        $params["customer_guid"] = $customer_guid;
        $hasContacts = $customers->customerHasContacts($params);
        if ($hasContacts["hasContacts"] == "1") {
            CCSetSession("contacterror", "hide");
        } else {
            CCSetSession("contacterror", "show");
        }
    }
    //Contact warning, shows when no contact has been added to the company
    $contacterror = CCGetSession("contacterror", "");
    $MainPage->Attributes->SetValue("showalert_contacterror", $contacterror);
    // -------------------------
    //End Custom Code
    //Close customers_maintcontent_BeforeShow @1-CA17A984
    return $customers_maintcontent_BeforeShow;
}
コード例 #16
0
function globalmaint_maintcontent_BeforeShow(&$sender)
{
    $globalmaint_maintcontent_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $globalmaint_maintcontent;
    //Compatibility
    //End globalmaint_maintcontent_BeforeShow
    //Custom Code @2-2A29BDB7
    // -------------------------
    // Write your own code here.
    global $Tpl;
    global $MainPage;
    global $FileName;
    global $CCSLocales;
    $m = trim(CCGetFromGet("m", "city"));
    $o = trim(CCGetFromPost("o", ""));
    $guid = trim(CCGetFromGet("guid", ""));
    $userid = CCGetUserID();
    $customers = new Customers();
    $params = array();
    $params["m"] = $m;
    $params["guid"] = $guid;
    $params["userid"] = $userid;
    switch ($o) {
        case "insert":
            $title = trim(CCGetFromPost("s_title", ""));
            $m = trim(CCGetFromPost("hidm"));
            $params["title"] = $title;
            $params["m"] = $m;
            $customers->insertMaintByModule($params);
            header("Location: globalmaint.php?m={$m}");
            break;
        case "update":
            $title = trim(CCGetFromPost("s_title", ""));
            $m = trim(CCGetFromPost("hidm", ""));
            $guid = trim(CCGetFromPost("hidguid", ""));
            $params["title"] = $title;
            $params["m"] = $m;
            $params["guid"] = $guid;
            $updateCustomer = $customers->updateMaintByModule($params);
            //Checking if there was a duplicity error
            $errors = (array) $updateCustomer["errors"];
            $errorcount = (int) $errors["ErrorsCount"];
            $error = $errors["Errors"][0];
            if ($errorcount >= 1) {
                $position = strpos($error, "Duplicate entry");
                if (!($position === false)) {
                    CCSetSession("showerror", "show");
                    CCSetSession("showalert", "hide");
                    header("Location: globalmaint_maint.php?m={$m}&guid={$guid}");
                    exit;
                    //There is a bug without it, the session values dont get set when thereis a forced header redirect
                }
            } else {
                header("Location: globalmaint.php?m={$m}");
            }
            break;
    }
    if (strlen($guid) > 0) {
        //Getting module details
        switch ($m) {
            case "city":
            case "business_partners":
            case "customers_type":
            case "jobposition":
            case "manufacturer":
            case "offerings":
            case "pricingtier":
            case "group":
            case "producttypes":
            case "licensetypes":
            case "producttags":
            case "resellers":
            case "license_granttypes":
            case "competitor_products":
            case "contacts_colors":
            case "contacts_hobbies":
            case "contacts_holidays":
                $moduleContent = $customers->getAllModuleByGuid($params);
                $moduleContent = $moduleContent["details"];
                $globalmaint_maintcontent->o->setvalue("update");
                foreach ($moduleContent as $content) {
                    $globalmaint_maintcontent->s_title->setvalue($content["title"]);
                    $globalmaint_maintcontent->hidguid->setvalue($content["guid"]);
                }
                break;
        }
    }
    $globalmaint_maintcontent->hidm->setvalue($m);
    //Settingup saved message popup
    $showalert = CCGetSession("showalert", "hide");
    $MainPage->Attributes->SetValue("showalert", $showalert);
    if ($showalert == "show") {
        CCSetSession("showalert", "hide");
    }
    $showerror = CCGetSession("showerror", "hide");
    $MainPage->Attributes->SetValue("showerror", $showerror);
    if ($showerror == "show") {
        CCSetSession("showerror", "hide");
        //Duplicate entry error
        $globalmaint_maintcontent->lberror->SetValue($CCSLocales->GetText("duplicate_record"));
    }
    // -------------------------
    //End Custom Code
    //Close globalmaint_maintcontent_BeforeShow @1-02A95A19
    return $globalmaint_maintcontent_BeforeShow;
}
コード例 #17
0
ファイル: Common.php プロジェクト: 4v4t4r/CTF-LCC
function CCLogoutUser()
{
    CCSetSession("AdminID", "");
    CCSetSession("AdminLogin", "");
    CCSetSession("UserPassword", "");
    CCSetSession("AdminGroup", "");
}
コード例 #18
0
function customers_viewcontent_BeforeShow(&$sender)
{
    $customers_viewcontent_BeforeShow = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $customers_viewcontent;
    //Compatibility
    //End customers_viewcontent_BeforeShow
    //Custom Code @159-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("tab2_active", "active");
            break;
        case "addcontact":
            $Tpl->setvar("tab3_active", "active");
            break;
    }
    //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");
    }
    // -------------------------
    //End Custom Code
    //Close customers_viewcontent_BeforeShow @1-6903B239
    return $customers_viewcontent_BeforeShow;
}
コード例 #19
0
ファイル: StartListing.php プロジェクト: 4v4t4r/CTF-LCC
unset($SQL);
unset($SQL);
unset($SQL);
unset($SQL);
if ($_GET["PreviewNum"]) {
    $db = new clsDBNetConnect();
    $query = "delete from `items` where `ItemNum`='" . $_GET["PreviewNum"] . "'";
    $db->query($query);
    $query = "delete from `listing_index` where `ItemNum`='" . $_GET["PreviewNum"] . "'";
    $db->query($query);
    $query = "INSERT INTO items (\r\n  `ItemNum`,\r\n  `category`,\r\n  `user_id`,\r\n  `title`,\r\n  `status`,\r\n  `end_reason`,\r\n  `started`,\r\n  `close`,\r\n  `closes`,\r\n  `bold`,\r\n  `background`,\r\n  `cat_featured`,\r\n  `home_featured`,\r\n  `gallery_featured`,\r\n  `image_preview`,\r\n  `slide_show`,\r\n  `counter`,\r\n  `make_offer`,\r\n  `image_one`,\r\n  `image_two`,\r\n  `image_three`,\r\n  `image_four`,\r\n  `image_five`,\r\n  `asking_price`,\r\n  `quantity`,\r\n  `city_town`,\r\n  `state_province`,\r\n  `country`,\r\n  `description`,\r\n  `added_description`,\r\n  `dateadded`,\r\n  `item_paypal`,\r\n  `ship1`,\r\n  `shipfee1`,\r\n  `ship2`,\r\n  `shipfee2`,\r\n  `ship3`,\r\n  `shipfee3`,\r\n  `ship4`,\r\n  `shipfee4`,\r\n  `ship5`,\r\n  `shipfee5`) SELECT \r\n  `ItemNum`,\r\n  `category`,\r\n  `user_id`,\r\n  `title`,\r\n  `status`,\r\n  `end_reason`,\r\n  `started`,\r\n  `close`,\r\n  `closes`,\r\n  `bold`,\r\n  `background`,\r\n  `cat_featured`,\r\n  `home_featured`,\r\n  `gallery_featured`,\r\n  `image_preview`,\r\n  `slide_show`,\r\n  `counter`,\r\n  `make_offer`,\r\n  `image_one`,\r\n  `image_two`,\r\n  `image_three`,\r\n  `image_four`,\r\n  `image_five`,\r\n  `asking_price`,\r\n  `quantity`,\r\n  `city_town`,\r\n  `state_province`,\r\n  `country`,\r\n  `description`,\r\n  `added_description`,\r\n  `dateadded`,\r\n  `item_paypal`,\r\n  `ship1`,\r\n  `shipfee1`,\r\n  `ship2`,\r\n  `shipfee2`,\r\n  `ship3`,\r\n  `shipfee3`,\r\n  `ship4`,\r\n  `shipfee4`,\r\n  `ship5`,\r\n  `shipfee5` from `items_preview` where `ItemNum` = '" . $_GET["PreviewNum"] . "'";
    $db->query($query);
    $query = "delete from `items_preview` where `ItemNum` = '" . $_GET["PreviewNum"] . "'";
    $db->query($query);
    CCSetSession("RecentItemNum", $_GET["PreviewNum"]);
    CCSetSession("RecentPreviewItem", "");
}
if (CCGetSession("RecentItemNum") != "") {
    $db = new clsDBNetConnect();
    $SQL = "SELECT * FROM items WHERE ItemNum=" . CCGetSession("RecentItemNum");
    $db->connect();
    $db->query($SQL);
    $Result = $db->next_record();
    $finalcat = $db->f("category");
    $coupon = new clsDBNetConnect();
    $SQL = "SELECT * FROM used_coupons WHERE ItemNum=" . CCGetSession("RecentItemNum") . " and `used` IS NULL";
    $coupon->query($SQL);
    if ($coupon->next_record()) {
        $SQL = "SELECT * FROM coupons WHERE id=" . $coupon->f("coupon_id");
        $coupon->query($SQL);
        if ($coupon->next_record()) {
コード例 #20
0
function startlistingnow($ItemNum, $UserID)
{
    global $now;
    global $EP;
    global $regcharges;
    CCSetSession("ItemNum", $ItemNum);
    $db = new clsDBNetConnect();
    $db->connect();
    $whereif = "ItemNum='" . $ItemNum . "'";
    $days = CCDLookUp("close", "items", $whereif, $db);
    $dayslk = CCDLookUp("days", "lookup_listing_dates", "date_id='" . $days . "'", $db);
    $dayscal = 86400 * $dayslk + time();
    $approval = groupApprovalSpec();
    if ($approval["required"] && $now["approv_priority"] || $approval["required"] && !$now["approv_priority"] && !$approval["notrequired"]) {
        $stat = 99;
    } else {
        $stat = 1;
    }
    $sql = "select `acct_credit_used` from items where ItemNum = '" . $ItemNum . "'";
    $db->query($sql);
    if ($db->next_record()) {
        if ($db->f("acct_credit_used") > 0) {
            $sql = "insert into `charges` (`user_id`, `date`, `charge`, `cause`) Values ('" . $UserID . "', '" . time() . "', '-" . $db->f("acct_credit_used") . "', 'Account Credit Used to Start Item Number: " . $ItemNum . "')";
            $db->query($sql);
        }
    }
    $sql = "UPDATE items SET status='" . $stat . "', started=" . time() . ", closes=" . $dayscal . " WHERE ItemNum='" . $ItemNum . "'";
    $db->query($sql);
    $sql = "select * from used_coupons where ItemNum = '" . $ItemNum . "'";
    $db->query($sql);
    if ($db->next_record()) {
        $sql = "UPDATE used_coupons SET `used`='1' WHERE ItemNum='" . $ItemNum . "'";
        $db->query($sql);
    }
    $sql = "select * from used_tokens where ItemNum = '" . $ItemNum . "'";
    $db->query($sql);
    if ($db->next_record()) {
        $sql = "UPDATE used_tokens SET `date`='" . time() . "' WHERE ItemNum='" . $ItemNum . "'";
        $db->query($sql);
    }
    unset($db);
    unset($sql);
    CCSetSession("RecentItemNum", "");
    $lookdb = new clsDBNetConnect();
    $lookdb->connect();
    $lookdb->query("SELECT * FROM users WHERE user_id='" . $UserID . "'");
    if ($lookdb->next_record()) {
        $ld = array("first" => $lookdb->f("first_name"), "ID" => $lookdb->f("user_id"), "user_password" => $lookdb->f("user_password"), "last" => $lookdb->f("last_name"), "email" => $lookdb->f("email"), "address" => $lookdb->f("address1"), "address2" => $lookdb->f("address2"), "state" => $lookdb->f("state_id"), "zip" => $lookdb->f("zip"), "city" => $lookdb->f("city"), "phonedy" => $lookdb->f("phone_day"), "phoneevn" => $lookdb->f("phone_evn"), "fax" => $lookdb->f("fax"), "ip" => $lookdb->f("ip_insert"), "date_created" => $lookdb->f("date_created"));
    }
    $nb = new clsDBNetConnect();
    $nb->connect();
    $nb->query("SELECT * FROM items WHERE " . $whereif);
    if ($nb->next_record()) {
        $ls = array("itemID" => $nb->f("itemID"), "ItemNum" => $nb->f("ItemNum"), "category" => $nb->f("category"), "title" => $nb->f("title"), "started" => $nb->f("started"), "close" => $nb->f("close"), "closes" => $nb->f("closes"), "bold" => $nb->f("bold"), "background" => $nb->f("background"), "cat_featured" => $nb->f("cat_featured"), "home_featured" => $nb->f("home_featured"), "gallery_featured" => $nb->f("gallery_featured"), "image_preview" => $nb->f("image_preview"), "slide_show" => $nb->f("slide_show"), "counter" => $nb->f("counter"), "make_offer" => $nb->f("make_offer"), "image_one" => $nb->f("image_one"), "image_two" => $nb->f("image_two"), "image_three" => $nb->f("image_three"), "image_four" => $nb->f("image_four"), "image_five" => $nb->f("image_five"), "asking_price" => $nb->f("asking_price"), "quantity" => $nb->f("quantity"), "city" => $nb->f("city_town"), "state" => $nb->f("state_province"));
    }
    $lbold = pode($ls["bold"], $regcharges["bold_fee"]);
    $lhome = pode($ls["home_featured"], $regcharges["home_fee"]);
    $lback = pode($ls["background"], $regcharges["high_fee"]);
    $lcat = pode($ls["cat_featured"], $regcharges["cat_fee"]);
    $lgal = pode($ls["gallery_featured"], $regcharges["gallery_fee"]);
    $lipre = pode($ls["image_preview"], $regcharges["image_pre_fee"]);
    $lslide = pode($ls["slide_show"], $regcharges["slide_fee"]);
    $lcount = pode($ls["counter"], $regcharges["counter_fee"]);
    $li1 = podeimg($ls["image_one"], $regcharges["upload_fee"]);
    $li2 = podeimg($ls["image_two"], $regcharges["upload_fee"]);
    $li3 = podeimg($ls["image_three"], $regcharges["upload_fee"]);
    $li4 = podeimg($ls["image_four"], $regcharges["upload_fee"]);
    $li5 = podeimg($ls["image_five"], $regcharges["upload_fee"]);
    if ($ls["make_offer"] == 1) {
        $make = "Make Offer";
    }
    if ($ls["make_offer"] == 0) {
        $make = "";
    }
    $gf1 = new clsDBNetConnect();
    $gf1->connect();
    $gf2 = new clsDBNetConnect();
    $gf2->connect();
    $gf3 = new clsDBNetConnect();
    $gf3->connect();
    $EP["EMAIL:AD_ITEM_NUMBER"] = $ls["ItemNum"];
    $EP["EMAIL:AD_CATEGORY_ID"] = $ls["category"];
    $EP["EMAIL:AD_CATEGORY"] = CCDLookUp("name", "categories", "cat_id='" . $ls["category"] . "'", $gf1);
    $EP["EMAIL:AD_TITLE"] = $ls["title"];
    $EP["EMAIL:AD_STARTED"] = date("F j, Y, g:i a", $ls["started"]);
    $EP["EMAIL:AD_CLOSES"] = date("F j, Y, g:i a", $ls["closes"]);
    $EP["EMAIL:AD_DAYS_RUNNING"] = CCDLookUp("days", "lookup_listing_dates", "date_id='" . $ls["close"] . "'", $gf2);
    $EP["EMAIL:AD_BOLD_CHARGE"] = $lbold;
    $EP["EMAIL:AD_HIGHLIGHTED_CHARGE"] = $lback;
    $EP["EMAIL:AD_CATEGORY_FEATURED_CHARGE"] = $lcat;
    $EP["EMAIL:AD_GALLERY_CHARGE"] = $lgal;
    $EP["EMAIL:AD_IMAGE_PREVIEW_CHARGE"] = $lipre;
    $EP["EMAIL:AD_HOME_PAGE_CHARGE"] = $lhome;
    $EP["EMAIL:AD_SLIDE_SHOW_CHARGE"] = $lslide;
    $EP["EMAIL:AD_COUNTER_CHARGE"] = $lcount;
    $EP["EMAIL:AD_DAYS_FEE"] = CCDLookUp("fee", "lookup_listing_dates", "date_id='" . $ls["close"] . "'", $gf3);
    $EP["EMAIL:AD_IMAGE_ONE_CHARGE"] = $li1;
    $EP["EMAIL:AD_IMAGE_TWO_CHARGE"] = $li2;
    $EP["EMAIL:AD_IMAGE_THREE_CHARGE"] = $li3;
    $EP["EMAIL:AD_IMAGE_FOUR_CHARGE"] = $li4;
    $EP["EMAIL:AD_IMAGE_FIVE_CHARGE"] = $li5;
    $EP["EMAIL:AD_MAKE_OFFER"] = $make;
    $EP["EMAIL:AD_ASKING_PRICE"] = $ls["asking_price"];
    $EP["EMAIL:AD_QUANTITY"] = $ls["quantity"];
    $EP["EMAIL:AD_CITY"] = $ls["city"];
    $EP["EMAIL:AD_STATE_PROVINCE"] = $ls["state"];
    $EP["EMAIL:CURRENT_USERNAME"] = CCGetUserLogin();
    $EP["EMAIL:CURRENT_USERID"] = $ld["ID"];
    $EP["EMAIL:CURRENT_USER_PASSWORD"] = $ld["user_password"];
    $EP["EMAIL:CURRENT_USER_FIRST_NAME"] = $ld["first"];
    $EP["EMAIL:CURRENT_USER_LAST_NAME"] = $ld["last"];
    $EP["EMAIL:CURRENT_USER_EMAIL"] = $ld["email"];
    $EP["EMAIL:CURRENT_USER_ADDRESS"] = $ld["address"];
    $EP["EMAIL:CURRENT_USER_ADDRESS2"] = $ld["address2"];
    $EP["EMAIL:CURRENT_USER_STATE"] = $ld["state"];
    $EP["EMAIL:CURRENT_USER_CITY"] = $ld["city"];
    $EP["EMAIL:CURRENT_USER_ZIP"] = $ld["zip"];
    $EP["EMAIL:CURRENT_USER_DAY_PHONE"] = $ld["phonedy"];
    $EP["EMAIL:CURRENT_USER_EVN_PHONE"] = $ld["phoneevn"];
    $EP["EMAIL:CURRENT_USER_FAX"] = $ld["fax"];
    $EP["EMAIL:CURRENT_USER_IP"] = getenv("REMOTE_ADDR");
    $EP["EMAIL:CURRENT_USER__REGISTERED_IP"] = $ld["ip"];
    $EP["EMAIL:CURRENT_USER_DATE_SIGNEDUP"] = date("F j, Y, g:i a", $ld["date_created"]);
    if ($stat == 99) {
        mailout("NewListingApproval", $now["notifyads"], $ld["ID"], 1000000000, time(), $EP);
    } else {
        mailout("NewListing", $now["notifyads"], $ld["ID"], 1000000000, time(), $EP);
        index_listing($ItemNum);
        $db = new clsDBNetConnect();
        $query = "Select * from custom_textarea_values where `ItemNum` = {$ItemNum}";
        $db->query($query);
        while ($db->next_record()) {
            index_listing($ItemNum, $db->f("value"), "ta", $db->f("field_id"));
        }
        $query = "Select * from custom_textbox_values where `ItemNum` = {$ItemNum}";
        $db->query($query);
        while ($db->next_record()) {
            index_listing($ItemNum, $db->f("value"), "tb", $db->f("field_id"));
        }
        $query = "Select * from custom_dropdown_values where `ItemNum` = {$ItemNum}";
        $db->query($query);
        while ($db->next_record()) {
            index_listing($ItemNum, $db->f("option_id"), "dd", $db->f("field_id"), $db->f("option_id"));
        }
        add_catcounts($ls["category"]);
    }
    //End Custom Code
    return $stat;
}
コード例 #21
0
ファイル: index_events.php プロジェクト: Okwori/iRadiology
function users_AfterInsert(&$sender)
{
    $users_AfterInsert = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $users;
    //Compatibility
    //End users_AfterInsert
    //Custom Code @42-2A29BDB7
    // -------------------------
    global $Redirect;
    $db = new clsDBconnection1();
    $sql1 = "select max(user_id) as uid from users";
    $db->query($sql1);
    $Result1 = $db->next_record();
    $uid = $db->f('uid');
    if ($Result1) {
        CCSetSession("myid", $uid);
    }
    $Redirect = "welcome.php";
    // -------------------------
    //End Custom Code
    //Close users_AfterInsert @14-11208659
    return $users_AfterInsert;
}
コード例 #22
0
ファイル: modul_events.php プロジェクト: rayminami/chumanis
function Page_OnInitializeView(&$sender)
{
    $Page_OnInitializeView = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $modul;
    //Compatibility
    //End Page_OnInitializeView
    //Custom Code @8-2A29BDB7
    // -------------------------
    // Write your own code here.
    global $namaMD;
    $p_module_id = $_GET["p_module_id"];
    $DBhrcon_ = new clsDBhrcon();
    $queryMD = "select code from p_module where p_module_id=" . $p_module_id;
    $DBhrcon_->query($queryMD);
    if ($DBhrcon_->next_record()) {
        $namaMD = $DBhrcon_->f("code");
        CCSetSession("namamodullabel", $DBhrcon_->f("code"));
    } else {
        $namaMD = "--";
    }
    $DBhrcon_->close();
    $seslmenu = "" . "<div class='blockheader'> " . "<h3 class='t'>" . $namaMD . "</h3> " . "</div>" . "<div class='blockcontent'>" . "<div id='cssmenu'>" . "<ul id='Accordion'>";
    $queryMN = "select * from f_display_menu_tree(" . $p_module_id . ")";
    $PLevel = array(0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
    $level = 0;
    $bdmnid = -1;
    $nplevel = 0;
    $parid = -1;
    $DBhrcon_->query($queryMN);
    $curdata = "-";
    while ($DBhrcon_->next_record()) {
        if ($parid != -1) {
            if ($nplevel == $DBhrcon_->f("parent_id")) {
                $curdata = "<li class='has-sub'><a href='" . $file_name . "?idmenulabel=" . $DBhrcon_->f("p_menu_id") . "'><span>" . $mncode . "</span></a><ul>";
                $seslmenu = $seslmenu . $curdata;
                $level = $level + 1;
                $PLevel[$level] = $nplevel;
            } else {
                $curdata = "<li><a href='" . $file_name . "?idmenulabel=" . $DBhrcon_->f("p_menu_id") . "'><span>" . $mncode . "</span></a> </li> ";
                $seslmenu = $seslmenu . $curdata;
                while ($PLevel[$level] > $DBhrcon_->f("parent_id") && $level > 0) {
                    $level = $level - 1;
                    $seslmenu = $seslmenu . "</ul></li>";
                }
            }
        }
        $bdmnid = $DBhrcon_->f("p_menu_id");
        $nplevel = $DBhrcon_->f("p_menu_id");
        $parid = $DBhrcon_->f("parent_id");
        $mncode = $DBhrcon_->f("code");
        $file_name = $DBhrcon_->f("file_name");
    }
    if ($parid != -1) {
        $curdata = "<li><a href='" . $file_name . "?idmenulabel=" . $DBhrcon_->f("p_menu_id") . "'><span>" . $mncode . "</span></a> </li> ";
        $seslmenu = $seslmenu . $curdata;
        while ($PLevel[$level] > $DBhrcon_->f("parent_id") && $level > 0) {
            $level = $level - 1;
            $seslmenu = $seslmenu . "</ul></li>";
        }
    }
    $DBhrcon_->close();
    $seslmenu = $seslmenu . "</ul>" . "</div>" . "</div>";
    CCSetSession("lmenu", $seslmenu);
    // -------------------------
    //End Custom Code
    //Close Page_OnInitializeView @1-81DF8332
    return $Page_OnInitializeView;
}
コード例 #23
0
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;
}
コード例 #24
0
ファイル: login_events.php プロジェクト: rayminami/chumanis
function Login_Button_DoLogin_OnClick(&$sender)
{
    $Login_Button_DoLogin_OnClick = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $Login;
    //Compatibility
    //End Login_Button_DoLogin_OnClick
    //Login @4-DE10C29C
    global $CCSLocales;
    global $Redirect;
    CCLogoutUser();
    $db = new clsDBhrcon();
    $SQL = "select * from f_userlogin(null," . $db->ToSQL($Container->username->Value, ccsText) . "," . $db->ToSQL($Container->password->Value, ccsText) . ",'localhost')";
    // . " AND user_pwd=" . $db->ToSQL($password, ccsText);
    $db->query($SQL);
    $Result = $db->next_record();
    if ($Result) {
        CCSetSession("UserID", $db->f("p_user_id"));
        CCSetSession("UserName", $Container->username->Value);
        CCSetSession("GroupID", $db->f("p_user_id"));
        CCSetSession("UserAddr", $_SERVER["REMOTE_ADDR"]);
        CCSetSession("UserStatus", $db->f("o_is_new_user"));
    }
    //o_result_int integer,
    //o_result_msg character varying,
    //o_is_new_user character varying,
    //o_is_change_pwd character varying,
    //o_last_login_text character varying,
    //o_user_id integer)
    if ($db->f('o_result_int') != 1) {
        //$Container->Errors->addError($CCSLocales->GetText("CCS_LoginError"));
        $Container->Errors->addError($db->f('o_result_msg'));
        $Container->password->SetValue("");
        $Login_Button_DoLogin_OnClick = 0;
    } else {
        global $Redirect;
        //Add CAS
        if ($db->f('o_is_new_user') == "Y") {
            $seslmenu = "" . "<div class='blockheader'><h3 class='t'>Profile</h3></div>" . "<div class='blockcontent'>" . "<div style='position:relative; width:100%; height:100%'>" . "<img border='0' height='100' src='../images/users/" . CCGetUserLogin() . ".jpg' style='display: block; margin: 0 auto;'>" . "<p style='text-align:center'><strong>" . CCGetUserLogin() . "</strong></p></div>" . "<div id='cssmenu'>" . "<ul>" . "<li><a href='../main/home.php'><span>Task Box</span></a></li>" . "<li><a href='#'><span>User profile</span></a></li>" . "<li><a href='../admin.menu/p_user_pass_change.php'><span>Change Password</span></a></li>" . "</ul>" . "</div>" . "</div>";
            CCSetSession("lmenu", $seslmenu);
            $Redirect = "../admin.menu/p_user_pass_change.php";
        } else {
            if ($db->f('o_is_change_pwd') == "Y") {
                $seslmenu = "" . "<div class='blockheader'><h3 class='t'>Profile</h3></div>" . "<div class='blockcontent'>" . "<div style='position:relative; width:100%; height:100%'>" . "<img border='0' height='100' src='../images/users/" . CCGetUserLogin() . ".jpg' style='display: block; margin: 0 auto;'>" . "<p style='text-align:center'><strong>" . CCGetUserLogin() . "</strong></p></div>" . "<div id='cssmenu'>" . "<ul>" . "<li><a href='../main/home.php'><span>Task Box</span></a></li>" . "<li><a href='#'><span>User profile</span></a></li>" . "<li><a href='../admin.menu/p_user_pass_change.php'><span>Change Password</span></a></li>" . "</ul>" . "</div>" . "</div>";
                CCSetSession("lmenu", $seslmenu);
                $Redirect = "../admin.menu/p_user_pass_change.php";
            }
        }
        //End Add CAS
        $uid = $db->f('o_user_id');
        $seshmenu = "";
        $DBhrcon_ = new clsDBhrcon();
        //$queryMD  = "select p_module_id, code, description from p_module " .
        //            "where is_active='Y' order by listing_no";
        $lsuser = CCGetUserLogin();
        $queryMD = "select * from f_display_app('" . $lsuser . "')";
        $DBhrcon_->query($queryMD);
        while ($DBhrcon_->next_record()) {
            $param = CCAddParam("", "p_module_id", $DBhrcon_->f("p_module_id"));
            $seshmenu = $seshmenu . "<li><a href='../main/modul.php?" . $param . "'" . "title='" . $DBhrcon_->f("code") . " - " . $DBhrcon_->f("description") . "' target=''>" . "<img border='0' src='../images/menu/" . $DBhrcon_->f("p_module_id") . ".gif'></a> </li>";
        }
        include_once 'user_attribute.php';
        setUserAttrib($uid);
        $DBhrcon_->close();
        CCSetSession("hmenu", $seshmenu);
        $Redirect = CCGetParam("ret_link", $Redirect);
        $Login_Button_DoLogin_OnClick = 1;
    }
    //End Login
    //Close Login_Button_DoLogin_OnClick @3-0EB5DCFE
    return $Login_Button_DoLogin_OnClick;
}
コード例 #25
0
function CCLogoutUser()
{
    CCSetSession("UserID", "");
    CCSetSession("UserLogin", "");
    CCSetSession("GroupID", "");
}
コード例 #26
0
ファイル: home.php プロジェクト: rayminami/chumanis
$Attributes->Show();
//End Initialize HTML Template
//Execute Components @1-910C1783
$MasterPage->Operations();
//End Execute Components
//Go to destination page @1-FBA93089
if ($Redirect) {
    $CCSEventResult = CCGetEvent($CCSEvents, "BeforeUnload", $MainPage);
    header("Location: " . $Redirect);
    unset($Tpl);
    exit;
}
//End Go to destination page
//        "<div class='blockheader'><h3 class='t'>Menu</h3></div>".
$seslmenu = "" . "<div class='blockheader'><h3 class='t'>Profile</h3></div>" . "<div class='blockcontent'>" . "<div style='position:relative; width:100%; height:100%'>" . "<img border='0' height='100' src='../images/users/" . CCGetUserLogin() . ".jpg' style='display: block; margin: 0 auto;'>" . "<p style='text-align:center'><strong>" . CCGetUserLogin() . "</strong></p></div>" . "<div id='cssmenu'>" . "<ul>" . "<li><a href='../main/home.php'><span>Task Box</span></a></li>" . "<li><a href='#'><span>User profile</span></a></li>" . "<li><a href='../admin.menu/p_user_pass_change.php'><span>Change Password</span></a></li>" . "</ul>" . "</div>" . "</div>";
CCSetSession("lmenu", $seslmenu);
//Show Page @1-6E46253E
$Head->Show();
$Content->Show();
$MasterPage->Tpl->SetVar("Head", $Tpl->GetVar("Panel Head"));
$MasterPage->Tpl->SetVar("Content", $Tpl->GetVar("Panel Content"));
$MasterPage->Show();
if (!isset($main_block)) {
    $main_block = $MasterPage->HTML;
}
$CCSEventResult = CCGetEvent($CCSEvents, "BeforeOutput", $MainPage);
if ($CCSEventResult) {
    echo $main_block;
}
//End Show Page
//Unload Page @1-88C40CD3
コード例 #27
0
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;
}
function Page_OnInitializeView(&$sender)
{
    $Page_OnInitializeView = true;
    $Component =& $sender;
    $Container =& CCGetParentContainer($sender);
    global $t_target_realisasi_jenis_view_large_dengan_target_triwulan_v2;
    //Compatibility
    //End Page_OnInitializeView
    //Custom Code @66-2A29BDB7
    // -------------------------
    // Write your own code here.
    // -------------------------
    //End Custom Code
    // -------------------------
    // Write your own code here.
    global $selected_id;
    global $t_target_realisasi_jenisGrid;
    $selected_id = -1;
    $selected_id = CCGetFromGet("t_revenue_target_id", $selected_id);
    $dbConn = new clsDBConnSIKP();
    $sql = "select p_year_period_id from p_year_period \r\n\twhere year_code = (select extract(year from sysdate))";
    $dbConn->query($sql);
    $item = 0;
    while ($dbConn->next_record()) {
        $item = $dbConn->f("p_year_period_id");
    }
    CCSetSession("p_year_period_id2", $item);
    $t_target_realisasi_jenisGrid->p_year_period_id2->SetValue($item);
    //$t_target_realisasi_jenisGrid1->p_year_period_id2->SetValue($item);
    // -------------------------
    //Close Page_OnInitializeView @1-81DF8332
    return $Page_OnInitializeView;
}
コード例 #29
0
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;
}
コード例 #30
0
ファイル: newitem.php プロジェクト: 4v4t4r/CTF-LCC
 function UpdateRow()
 {
     global $closes;
     global $valid;
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "BeforeUpdate");
     $this->ds->category->SetValue($this->category->GetValue());
     $this->ds->title->SetValue($this->title->GetValue());
     $this->ds->item_paypal->SetValue($this->item_paypal->GetValue());
     $this->ds->quantity->SetValue($this->quantity->GetValue());
     $this->ds->ship1->SetValue($this->ship1->GetValue());
     $this->ds->shipfee1->SetValue($this->shipfee1->GetValue());
     $this->ds->ship2->SetValue($this->ship2->GetValue());
     $this->ds->shipfee2->SetValue($this->shipfee2->GetValue());
     $this->ds->ship3->SetValue($this->ship3->GetValue());
     $this->ds->shipfee3->SetValue($this->shipfee3->GetValue());
     $this->ds->ship4->SetValue($this->ship4->GetValue());
     $this->ds->shipfee4->SetValue($this->shipfee4->GetValue());
     $this->ds->ship5->SetValue($this->ship5->GetValue());
     $this->ds->shipfee5->SetValue($this->shipfee5->GetValue());
     if ($this->asking_price->GetValue() == NULL) {
         $Asking = 0.0;
     } elseif ($this->asking_price->GetValue() == 0) {
         $Asking = 0.0;
     } else {
         $Asking = $this->asking_price->GetValue();
     }
     $this->ds->asking_price->SetValue($Asking);
     $this->ds->make_offer->SetValue($this->make_offer->GetValue());
     $this->ds->description->SetValue($this->description->GetValue());
     $this->ds->image_preview->SetValue($this->image_preview->GetValue());
     $this->ds->slide_show->SetValue($this->slide_show->GetValue());
     $this->ds->city_town->SetValue($this->city_town->GetValue());
     $this->ds->state_province->SetValue($this->state_province->GetValue());
     $this->ds->country->SetValue($this->country->GetValue());
     if ($valid) {
         $this->ds->fakeuser->SetValue($this->fakeuser->GetValue());
         $this->ds->startnow->SetValue($this->startnow->GetValue());
         $this->ds->addtime->SetValue($this->addtime->GetValue());
     }
     $tempdb = new clsDBNetConnect();
     $tempdb->connect();
     $this->ds->close->SetValue($this->close->GetValue());
     $this->ds->closes->SetValue(86400 * CCDLookUp("days", "lookup_listing_dates", "date_id='" . $this->close->GetValue() . "'", $tempdb) + time());
     $this->ds->started->SetValue(time());
     $this->ds->home_featured->SetValue($this->home_featured->GetValue());
     $this->ds->gallery_featured->SetValue($this->gallery_featured->GetValue());
     $this->ds->cat_featured->SetValue($this->cat_featured->GetValue());
     $this->ds->bold->SetValue($this->bold->GetValue());
     $this->ds->background->SetValue($this->background->GetValue());
     $this->ds->counter->SetValue($this->counter->GetValue());
     $this->ds->ItemNum->SetValue($this->ItemNum->GetValue());
     CCSetSession("RecentItemNum", $this->ItemNum->GetValue());
     if (!$valid) {
         $this->ds->user_id->SetValue(CCGetUserID());
     } else {
         $this->ds->user_id->SetValue($this->fakeuser->GetValue());
     }
     $this->ds->status->SetValue(0);
     $this->ds->image_five->SetValue($this->image_five->GetValue());
     $this->ds->image_four->SetValue($this->image_four->GetValue());
     $this->ds->image_three->SetValue($this->image_three->GetValue());
     $this->ds->image_two->SetValue($this->image_two->GetValue());
     $this->ds->image_one->SetValue($this->image_one->GetValue());
     $this->ds->Update();
     $this->CCSEventResult = CCGetEvent($this->CCSEvents, "AfterUpdate");
     if ($this->ds->Errors->Count() > 0) {
         echo "Error in Record " . $this->ComponentName . " / Update Operation";
         $this->ds->Errors->Clear();
         $this->Errors->AddError("Database command error.");
     }
     return $this->Errors->Count() == 0;
 }