public function updateStatus($plugin, $status)
 {
     $siteConfig = getUserConfig()->getSiteSettings();
     $plugins = (array) explode(',', $siteConfig['plugins']['activePlugins']);
     switch ($status) {
         case 'activate':
             if (!in_array($plugin, $plugins)) {
                 $plugins[] = $plugin;
             }
             break;
         case 'deactivate':
             if (in_array($plugin, $plugins)) {
                 foreach ($plugins as $key => $thisPlugin) {
                     if ($plugin == $thisPlugin) {
                         unset($plugins[$key]);
                     }
                 }
             }
             break;
     }
     $siteConfig['plugins']['activePlugins'] = implode(',', $plugins);
     $siteConfigStatus = getUserConfig()->writeSiteSettings($siteConfig);
     if (!$siteConfigStatus) {
         return $this->error('Could not change status of plugin', false);
     } else {
         return $this->success('Plugin status changed', true);
     }
 }
 /**
  * 修改皮肤弹窗
  */
 public function change()
 {
     $skinList = getSkinList();
     $this->assign('skinList', $skinList);
     $defaultSkin = getUserConfig();
     $this->assign('defaultSkin', $defaultSkin);
     $this->display(T('Addons://Skin@Skin/change'));
 }
Beispiel #3
0
 /**
  * 站点头部钩子,加载换肤插件所需样式
  * @param array $param 相关参数
  * @return bool
  * @author 郑钟良<*****@*****.**>
  */
 public function pageHeader($param)
 {
     $SkinsUrl = getRootUrl() . "Addons/Skin/Skins/";
     $config = getAddonConfig();
     if ($config['canSet'] == 0 || $config['mandatory'] == 1) {
         //强制执行管理员设置的默认皮肤
         // 载入换肤插件默认样式
         echo '<link href="' . $SkinsUrl . $config['defaultSkin'] . '/style.css" data-role="skin_link" rel="stylesheet" type="text/css"/>';
     } else {
         //执行用户设置样式
         // 载入换肤插件用户样式
         $userSkin = getUserConfig();
         echo '<link href="' . $SkinsUrl . $userSkin['skin'] . '/style.css" data-role="skin_link" rel="stylesheet" type="text/css"/>';
     }
 }
Beispiel #4
0
 function writeDbLogSql($sql, $type = 's')
 {
     if (getUserConfig("dblog") != "") {
         if ($type == 's') {
             if (substr($sql, 0, 24) == "insert into pdfarchiving") {
                 return;
             }
         }
         $f = fopen(getUserConfig("dblog"), "a");
         if ($f) {
             fwrite($f, $type . ":" . serialize($sql) . "\r\n");
             fclose($f);
         } else {
             session_addvalue("error", "unable to write db log");
         }
     }
 }
Beispiel #5
0
function resendConfirm($id)
{
    global $tables, $envelope, $prepend;
    $userdata = Sql_Fetch_Array_Query("select * from {$tables["user"]} where id = {$id}");
    $lists_req = Sql_Query(sprintf('select %s.name from %s,%s where 
  	%s.listid = %s.id and %s.userid = %d', $tables["list"], $tables["list"], $tables["listuser"], $tables["listuser"], $tables["list"], $tables["listuser"], $id));
    while ($row = Sql_Fetch_Row($lists_req)) {
        $lists .= '  * ' . $row[0] . "\n";
    }
    if ($userdata["subscribepage"]) {
        $subscribemessage = ereg_replace('\\[LISTS\\]', $lists, getUserConfig("subscribemessage:" . $userdata["subscribepage"], $id));
        $subject = getConfig("subscribesubject:" . $userdata["subscribepage"]);
    } else {
        $subscribemessage = ereg_replace('\\[LISTS\\]', $lists, getUserConfig("subscribemessage", $id));
        $subject = getConfig("subscribesubject");
    }
    logEvent("Resending confirmation request to " . $userdata["email"]);
    if (!TEST) {
        return sendMail($userdata["email"], $subject, $prepend . $subscribemessage, system_messageheaders($userdata["email"]), $envelope);
    }
}
Beispiel #6
0
function resendConfirm($id)
{
    global $tables, $envelope;
    $userdata = Sql_Fetch_Array_Query("select * from {$tables['user']} where id = {$id}");
    $lists_req = Sql_Query(sprintf('select %s.name from %s,%s where
    %s.listid = %s.id and %s.userid = %d', $tables['list'], $tables['list'], $tables['listuser'], $tables['listuser'], $tables['list'], $tables['listuser'], $id));
    while ($row = Sql_Fetch_Row($lists_req)) {
        $lists .= '  * ' . $row[0] . "\n";
    }
    if ($userdata['subscribepage']) {
        $subscribemessage = str_replace('[LISTS]', $lists, getUserConfig('subscribemessage:' . $userdata['subscribepage'], $id));
        $subject = getConfig('subscribesubject:' . $userdata['subscribepage']);
    } else {
        $subscribemessage = str_replace('[LISTS]', $lists, getUserConfig('subscribemessage', $id));
        $subject = getConfig('subscribesubject');
    }
    logEvent($GLOBALS['I18N']->get('Resending confirmation request to') . ' ' . $userdata['email']);
    if (!TEST) {
        return sendMail($userdata['email'], $subject, $_REQUEST['prepend'] . $subscribemessage, system_messageheaders($userdata['email']), $envelope);
    }
}
 if (is_array($_SESSION["lists"])) {
     reset($_SESSION["lists"]);
     $addition = 0;
     $listoflists = "";
     while (list($key, $listid) = each($_SESSION["lists"])) {
         $query = "replace INTO " . $tables["listuser"] . " (userid,listid,entered) values({$userid},{$listid},now())";
         $result = Sql_query($query, 1);
         # if the affected rows is 2, the user was already subscribed
         $addition = $addition || Sql_Affected_Rows() == 1;
         $listoflists .= "  * " . $_SESSION["listname"][$key] . "\n";
     }
     if ($addition) {
         $count["list_add"]++;
     }
     if (!TEST && $_SESSION["notify"] == "yes" && $addition) {
         $subscribemessage = ereg_replace('\\[LISTS\\]', $listoflists, getUserConfig("subscribemessage", $userid));
         sendMail($user["systemvalues"]["email"], getConfig("subscribesubject"), $subscribemessage, system_messageheaders(), $envelope);
     }
 }
 if (!is_array($_SESSION["groups"])) {
     $groups = array();
 } else {
     $groups = $_SESSION["groups"];
 }
 if (isset($everyone_groupid) && !in_array($everyone_groupid, $groups)) {
     array_push($groups, $everyone_groupid);
 }
 if (is_array($groups)) {
     #add this user to the groups identified
     reset($groups);
     $groupaddition = 0;
function makecontact_execute($action, $slot)
{
    global $_POST;
    global $_GET;
    global $_CONFIG;
    require_once "config/db.php";
    global $conn;
    global $_local_error;
    $_local_error = "";
    global $_local_reloadform;
    $_local_reloadform = "";
    global $render_current_slot;
    global $current_slots;
    //mark slot on execution stack
    $render_current_slot++;
    $current_slots[$render_current_slot] = $slot;
    if (getUserConfig("pageprotection") == "yes") {
        if (isset($_POST['fprotection']) && $_POST['fprotection'] != "") {
            if (isset($_GET['ajax']) && $_GET['ajax'] == 1) {
                if (intval(session_getvalue("protection_page")) != intval($_POST['fprotection'])) {
                    $_local_error = getLT("protectionerror");
                }
            } else {
                if (intval(session_getvalue("protection_page")) != intval($_POST['fprotection']) + 1) {
                    $_local_error = getLT("protectionerror");
                }
            }
        }
    }
    //set default filter
    $control_filter = "";
    $control_name = "makecontact";
    $control_table = "projectissues";
    $control_id = "id";
    //check for rights
    if (getUserConfig('dinsec_makecontact_cando', $action) == 'no') {
        $_local_error = getLT('nopermissions');
    }
    if (getUserConfig('dinsec_makecontact_canpost', $action) == 'no') {
        $_local_error = getLT('nopermissions');
    }
    if (session_getvalue("blockaccess_makecontact") == "yes") {
        $_local_error = getLT('nopermissions');
    }
    if (session_getvalue("blockaccess_projectissues") == "yes") {
        $_local_error = getLT('nopermissions');
    }
    if ($_local_error == "") {
        switch ($action) {
            case 'add':
                if (isset($_POST['cancel_button']) && $_POST['cancel_button'] == getLT('cancel')) {
                    $_local_error = 'usercanceled';
                    setSlotView($slot, "add");
                    break;
                }
                if ($_local_error == '') {
                    if (!isset($_POST['iname']) || $_POST['iname'] == '' || strip_tags($_POST['iname']) == '') {
                        $_local_error .= getLT('iname') . ' ' . getLT('shouldbefilled');
                    }
                }
                if ($_local_error == '') {
                    if (!isset($_POST['iemail']) || $_POST['iemail'] == '' || strip_tags($_POST['iemail']) == '') {
                        $_local_error .= getLT('iemail') . ' ' . getLT('shouldbefilled');
                    }
                }
                if ($_local_error == '') {
                    if (!isset($_POST['icontactname']) || $_POST['icontactname'] == '' || strip_tags($_POST['icontactname']) == '') {
                        $_local_error .= getLT('icontactname') . ' ' . getLT('shouldbefilled');
                    }
                }
                if ($_local_error == '') {
                    if (!isset($_POST['useraddress'])) {
                        $_local_error .= getLT('javascript?');
                    } else {
                        $ab_def = strtok($_POST['useraddress'], "-");
                        $ab_test = $ab_def . '-' . number_format(floatVal($ab_def . '.12') * 0.34, 4, '.', '');
                        if ($ab_test !== $_POST['useraddress']) {
                            $_local_error .= getLT('antiboterror?');
                        }
                    }
                }
                if ($_local_error == "") {
                    $conn->addnew($control_table);
                    $conn->setvalue('iname', correctPostValue($_POST['iname']));
                    $conn->setvalue('iemail', correctPostValue($_POST['iemail']));
                    $conn->setvalue('icontactname', correctPostValue($_POST['icontactname']));
                    $html = correctPostValue($_POST['idesc']);
                    $html = str_ireplace("<script", "[script", $html);
                    $html = str_ireplace("<link", "[link", $html);
                    $html = str_ireplace("<style", "[style", $html);
                    $conn->setvalue('idesc', $html);
                    $conn->setvalue('projectid', $_CONFIG['projectid']);
                    $conn->setvalue('idate', date("Y-m-d H:i:s"));
                    $id = $conn->update();
                    if ($id != "") {
                        session_addvalue($slot . '_info', getLT('wblank'));
                        session_setvalue($slot . "_viewid", $id);
                        setSlotView($slot, "add");
                    } else {
                        $_local_error = getLT('unableadd');
                        break;
                    }
                }
            case 'sendemail':
                if (isset($_POST['cancel_button']) && $_POST['cancel_button'] == getLT('cancel')) {
                    $_local_error = 'usercanceled';
                    break;
                }
                if ($_local_error == "") {
                    ob_start();
                    require_once "config/htmlreport.php";
                    require_once "config/templates.php";
                    require_once "config/mail.php";
                    global $_templates;
                    require_once "config/utils.php";
                    $_control_replace_sql = "parseAndReplaceAll";
                    $pdf = new HtmlReport("");
                    $emailbody = ob_get_contents();
                    ob_end_clean();
                    $emailbody = html_entity_decode($emailbody);
                    $emailsubject = getLT('emailcontact');
                    global $mails_sql_conn;
                    $mails_sql_conn = create_db_connection();
                    $mails_sql_conn->openselect($_control_replace_sql("select pemails as email from projects where id=0[config.projectid]"));
                    $noemail = false;
                    if ($mails_sql_conn->eof()) {
                        $noemail = true;
                    }
                    while (!$mails_sql_conn->eof()) {
                        $mailman = createMailObject();
                        $mailman->IsHTML(true);
                        $emailto = $mails_sql_conn->getvalue("email");
                        $emailreply = "";
                        $emailbcc = "";
                        $emailcc = "";
                        $emailfrom = "";
                        $emailbody = getFileContent(getFilePathFor('html', 'makecontact'));
                        require_once "config/utils.php";
                        $emailbody = parseAndReplaceAll($emailbody);
                        $emailreply = correctPostValue($_POST["iemail"]);
                        $mailman->Body = $emailbody;
                        $mailman->Subject = $emailsubject;
                        $mailman->ClearAddresses();
                        $mailman->AddAddress($emailto);
                        if ($emailbcc != "") {
                            $mailman->AddBCC($emailbcc);
                        }
                        if ($emailcc != "") {
                            $mailman->AddCC($emailcc);
                        }
                        if ($emailfrom != "") {
                            $mailman->FromName = "";
                            $mailman->From = $emailfrom;
                        }
                        if ($emailreply != '') {
                            $mailman->AddReplyTo($emailreply);
                        }
                        $mailman->send();
                        $mails_sql_conn->movenext();
                    }
                    $mails_sql_conn->close();
                    if ($noemail) {
                        session_addvalue($slot . '_error', getLT('noemailfound'));
                    } else {
                        session_addvalue($slot . '_info', getLT('yourmessageissent'));
                    }
                }
                break;
            default:
                //$_local_error="slot:".$slot." unknown post action: ".$action;
                setSlotView($slot, "");
                break;
        }
    }
    if (isset($_POST['cancel_button']) && $_POST['cancel_button'] == getLT('cancel')) {
        //if($_local_error!="") session_addvalue($slot.'_error',getLT($_local_error));
        $_local_error = '';
    } else {
        if ($_local_reloadform != "" || $_local_error != "" || $action == "justreloadform") {
            //save post for later use
            foreach ($_POST as $key => $val) {
                if (is_array($val)) {
                    session_setvalue('savedpost_makecontact_' . $key, correctPostValue(implode(",", str_replace(',', ' ', $_POST[$key]))));
                } else {
                    session_setvalue('savedpost_makecontact_' . $key, correctPostValue($val));
                }
            }
            if ($_local_error != "") {
                session_addvalue($slot . '_error', $_local_error);
            }
        }
    }
    $render_current_slot--;
    return $_local_error;
}
Beispiel #9
0
 function resetUniqueValue($md5, $value, $user, $userid = 0)
 {
     $connf = create_db_connection();
     $connf->execute("update " . getUserConfig("dbprefix") . "uniquevalues set util='" . $connf->escape($value) . "' where md5='" . $connf->escape($md5) . "' and user='******' and userid=0" . intval($userid));
     return $value;
 }
Beispiel #10
0
         #add this user to the lists identified
         reset($lists);
         $addition = 0;
         $listoflists = "";
         while (list($key, $listid) = each($lists)) {
             $query = "replace INTO " . $tables["listuser"] . " (userid,listid,entered) values({$userid},{$listid},current_timestamp)";
             $result = Sql_query($query);
             # if the affected rows is 2, the user was already subscribed
             $addition = $addition || Sql_Affected_Rows() == 1;
             $listoflists .= "  * " . $available_lists[$listid] . "\n";
         }
         if ($addition) {
             $additional_emails++;
         }
         if (!TEST && $_POST["notify"] == "yes" && $addition) {
             $subscribemessage = str_replace('[LISTS]', $listoflists, getUserConfig("subscribemessage", $userid));
             sendMail($email, getConfig("subscribesubject"), $subscribemessage, system_messageheaders(), $envelope);
         }
     }
     // end if
 }
 // end foreach
 $num_lists = sizeof($lists);
 # be grammatically correct :-)
 $displists = $num_lists == 1 ? $GLOBALS['I18N']->get('list') : $GLOBALS['I18N']->get('lists');
 $dispemail = $count_email_add == 1 ? $GLOBALS['I18N']->get('new email was') . " " : $GLOBALS['I18N']->get('new emails were') . " ";
 $dispemail2 = $additional_emails == 1 ? $GLOBALS['I18N']->get('email was') . " " : $GLOBALS['I18N']->get('emails were') . " ";
 if (!$some && !$additional_emails) {
     print "<br/>" . $GLOBALS['I18N']->get("All the emails already exist in the database and are members of the") . " {$displists}.";
 } else {
     print "{$count_email_add} {$dispemail} " . $GLOBALS['I18N']->get("succesfully imported to the database and added to") . " {$num_lists} {$displists}.<br/>{$additional_emails} {$dispemail2} " . $GLOBALS['I18N']->get("subscribed to the") . " {$displists}";
Beispiel #11
0
function unsubscribePage($id)
{
    global $tables;
    $email = '';
    $userid = 0;
    $msg = '';
    ## for unsubscribe, don't validate host
    $GLOBALS['check_for_host'] = 0;
    $res = '<title>' . $GLOBALS['strUnsubscribeTitle'] . '</title>' . "\n";
    $res .= $GLOBALS['pagedata']['header'];
    if (isset($_GET['uid'])) {
        $userdata = Sql_Fetch_Array_Query(sprintf('select email,id,blacklisted from %s where uniqid = "%s"', $tables['user'], sql_escape($_GET['uid'])));
        $email = $userdata['email'];
        $userid = $userdata['id'];
        $isBlackListed = $userdata['blacklisted'] != '0';
        $blacklistRequest = false;
    } else {
        if (isset($_REQUEST['email'])) {
            $email = $_REQUEST['email'];
        }
        if (!validateEmail($email)) {
            $email = '';
        }
        #0013076: Blacklisting posibility for unknown users
        # Set flag for blacklisting
        $blacklistRequest = $_GET['p'] == 'blacklist' || $_GET['p'] == 'donotsend';
        # only proceed when user has confirm the form
        if ($blacklistRequest && is_email($email)) {
            $_POST['unsubscribe'] = 1;
            $_POST['unsubscribereason'] = s('Forwarded receiver requested blacklist');
        }
    }
    if (UNSUBSCRIBE_JUMPOFF || !empty($_GET['jo'])) {
        $_POST['unsubscribe'] = 1;
        $_REQUEST['email'] = $email;
        if (!empty($_GET['jo'])) {
            $blacklistRequest = true;
            $_POST['unsubscribereason'] = s('"Jump off" used by subscriber, reason not requested');
        } else {
            $_POST['unsubscribereason'] = s('"Jump off" set, reason not requested');
        }
    }
    foreach ($GLOBALS['plugins'] as $pluginname => $plugin) {
        #    print $pluginname.'<br/>';
        if ($plugin->unsubscribePage($email)) {
            return;
        }
    }
    if (!empty($email) && isset($_POST['unsubscribe']) && isset($_REQUEST['email']) && isset($_POST['unsubscribereason'])) {
        ## all conditions met, do the unsubscribe
        #0013076: Blacklisting posibility for unknown users
        // It would be better to do this above, where the email is set for the other cases.
        // But to prevent vulnerabilities let's keep it here for now. [bas]
        if (!$blacklistRequest) {
            $query = Sql_Fetch_Row_Query(sprintf('select id,email,blacklisted from %s where email = "%s"', $tables['user'], sql_escape($email)));
            $userid = $query[0];
            $email = $query[1];
            $isBlackListed = !empty($query[2]);
        }
        if (!$userid) {
            #0013076: Blacklisting posibility for unknown users
            if ($blacklistRequest && !empty($email)) {
                addUserToBlacklist($email, $_POST['unsubscribereason']);
                addSubscriberStatistics('blacklist', 1);
                $res .= '<h3>' . $GLOBALS['strUnsubscribedNoConfirm'] . '</h3>';
            } else {
                $res .= $GLOBALS['strNoListsFound'];
                #'Error: '.$GLOBALS["strUserNotFound"];
                logEvent('Request to unsubscribe non-existent user: '******'select listid from %s where userid = %d', $GLOBALS['tables']['listuser'], $userid));
            while ($row = Sql_Fetch_Row($listsreq)) {
                array_push($subscriptions, $row[0]);
            }
            ## 17753 - do not actually remove the list-membership when unsubscribing
            #   $result = Sql_query(sprintf('delete from %s where userid = %d',$tables["listuser"],$userid));
            $lists = '  * ' . $GLOBALS['strAllMailinglists'] . "\n";
            if (empty($isBlackListed)) {
                // only process when not already marked as blacklisted
                # add user to blacklist
                addUserToBlacklist($email, nl2br(strip_tags($_POST['unsubscribereason'])));
                addUserHistory($email, 'Unsubscription', "Unsubscribed from {$lists}");
                $unsubscribemessage = str_replace('[LISTS]', $lists, getUserConfig("unsubscribemessage:{$id}", $userid));
                sendMail($email, getUserConfig("unsubscribesubject:{$id}"), stripslashes($unsubscribemessage), system_messageheaders($email), '', true);
                $reason = $_POST['unsubscribereason'] ? "Reason given:\n" . stripslashes($_POST['unsubscribereason']) : 'No Reason given';
                sendAdminCopy('List unsubscription', $email . " has unsubscribed\n{$reason}", $subscriptions);
                addSubscriberStatistics('unsubscription', 1);
            }
        }
        if ($userid) {
            $res .= '<h3>' . $GLOBALS['strUnsubscribeDone'] . '</h3>';
        }
        #0013076: Blacklisting posibility for unknown users
        //if ($blacklistRequest) {
        //$res .= '<h3>'.$GLOBALS["strYouAreBlacklisted"] ."</h3>";
        //}
        $res .= $GLOBALS['PoweredBy'] . '</p>';
        $res .= $GLOBALS['pagedata']['footer'];
        return $res;
    } elseif (isset($_POST['unsubscribe']) && !is_email($email) && !empty($email)) {
        $msg = '<span class="error">' . $GLOBALS['strEnterEmail'] . '</span><br>';
    }
    $res .= '<h3>' . $GLOBALS['strUnsubscribeInfo'] . '</h3>' . $msg . '<form method="post" action=""><input type="hidden" name="p" value="unsubscribe" />';
    if (!isset($_POST['email']) || empty($email)) {
        $res .= '<p>' . $GLOBALS['strEnterEmail'] . ': <input type="text" name="email" value="' . $email . '" size="40" /></p>';
    } else {
        $res .= '<p><input type="hidden" name="email" value="' . $email . '" />' . $GLOBALS['strEmail'] . ': ' . $email . '</p>';
    }
    if (!$email) {
        $res .= '<input type="submit" name="unsubscribe" value="' . $GLOBALS['strContinue'] . '"></form>';
        $res .= $GLOBALS['PoweredBy'];
        $res .= $GLOBALS['pagedata']['footer'];
        return $res;
    }
    $current = Sql_Fetch_Array_query(sprintf('select list.id as listid,user.uniqid as userhash, user.password as password
    from %s as list,%s as listuser,%s as user where list.id = listuser.listid and user.id = listuser.userid and user.email = "%s"', $tables['list'], $tables['listuser'], $tables['user'], sql_escape($email)));
    $some = $current['listid'];
    if (ASKFORPASSWORD && !empty($user['password'])) {
        # it is safe to link to the preferences page, because it will still ask for
        # a password
        $hash = $current['userhash'];
    } elseif (isset($_GET['uid']) && $_GET['uid'] == $current['userhash']) {
        # they got to this page from a link in an email
        $hash = $current['userhash'];
    } else {
        $hash = '';
    }
    $finaltext = $GLOBALS['strUnsubscribeFinalInfo'];
    $pref_url = getConfig('preferencesurl');
    $sep = strpos($pref_url, '?') !== false ? '&' : '?';
    $finaltext = str_ireplace('[preferencesurl]', $pref_url . $sep . 'uid=' . $hash, $finaltext);
    if (!$some) {
        #0013076: Blacklisting posibility for unknown users
        if (!$blacklistRequest) {
            $res .= '<b>' . $GLOBALS['strNoListsFound'] . '</b></ul>';
        }
        $res .= '<p><input type=submit value="' . $GLOBALS['strUnsubscribe'] . '">';
    } else {
        if ($blacklistRequest) {
            $res .= $GLOBALS['strExplainBlacklist'];
        } elseif (!UNSUBSCRIBE_JUMPOFF) {
            list($r, $c) = explode(',', getConfig('textarea_dimensions'));
            if (!$r) {
                $r = 5;
            }
            if (!$c) {
                $c = 65;
            }
            $res .= $GLOBALS['strUnsubscribeRequestForReason'];
            $res .= sprintf('<br/><textarea name="unsubscribereason" cols="%d" rows="%d" wrap="virtual"></textarea>', $c, $r) . $finaltext;
        }
        $res .= '<p><input type=submit name="unsubscribe" value="' . $GLOBALS['strUnsubscribe'] . '"></p>';
    }
    $res .= '</form>';
    $res .= '<p>' . $GLOBALS['PoweredBy'] . '</p>';
    $res .= $GLOBALS['pagedata']['footer'];
    return $res;
}
Beispiel #12
0
function getCodeFromNomenclator($soc, $grupa, $valoare, $type = 0, $paras = array())
{
    $resp = "0";
    $url = getUserConfig("nomenclator_url");
    if ($url == '') {
        global $localcodecall;
        $localcodecall = array();
        $localcodecall['soc'] = $soc;
        $localcodecall['grupa'] = $grupa;
        $localcodecall['valoare'] = $valoare;
        foreach ($paras as $kk => $vv) {
            $localcodecall[$kk] = $vv;
        }
        ob_start();
        include "coduri/code.php";
        $resp = ob_get_contents();
        ob_end_clean();
    } else {
        $newurl = $url . "?soc=" . urlencode($soc) . "&grupa=" . urlencode($grupa) . "&valoare=" . urlencode($valoare);
        foreach ($paras as $kk => $vv) {
            $newurl .= '&' . $kk . '=' . $vv;
        }
        $resp = file_get_contents($newurl);
    }
    if ($type !== false) {
        $r = explode("*", $resp);
        if (isset($r[$type])) {
            return $r[$type];
        }
    }
    return $resp;
}
<div class="workstep"><div class="worklabel" style="width:230px;">Afectiuni ginecologice: infectie HPV, cervicita cronica, fibromatoza uterina, endometrioza, mastopatie fibrochistica, nodul mamar, boala inflamatorie pelvina, anexita cronica?</div><div class="workfields" style="width:50px;"><select name="bo_Question17" style="width:50px;"><option value="">Nu</option><option value="1">Da</option></select>
</div></div>


<?php 
if (getUserConfig("emaildinprima") == "yes") {
    ?>
<div class="workstep"><div class="worklabel">Email:</div><div class=workfields><input name="emailclient" value="" class="validated" validate="required.email" size="20" type="email">
</div></div>
<?php 
}
?>

<?php 
if (getUserConfig("codpromotional") != "") {
    ?>
<div class="workstep"><div class="worklabel"><?php 
    echo getUserConfig("codpromotional");
    ?>
:</div><div class=workfields><input name="codpromotional" value="" size="20" type="text">
</div></div>
<?php 
}
?>

</div>

<!-- worksteps--></div>

Beispiel #14
0
});

function updateCells()
{
	var SA=parseFloat($("input[name=sumaasigurata]").val());
	var AC=parseFloat($("input[name=anconstructie]").val());
	$("*[crule]").each(function(){
		var afrule=0;
		eval($(this).attr("crule"));
		afrule=afrule.toFixed(0);
		$(this).html(""+afrule+" EURO");
	});
}
</script>
<?php 
if (getUserConfig('projectid') != "") {
    function getColorFromParameter($p, $d)
    {
        $valret = session_getvalue("colors_" . $p);
        if ($valret == "") {
            $valret = $d;
        }
        if (isset($_GET[$p]) && $_GET[$p] != "") {
            $valret = '#' . substr($_GET[$p], 0, 6);
        }
        session_setvalue("colors_" . $p, $valret);
        return $valret;
    }
    ?>
<style>
#ofertatarife * {text-shadow:none;}
Beispiel #15
0
getSiteConfigs();
global $conn;
global $_CONFIG;
require_once 'extern/Mobilpay/Payment/Request/Abstract.php';
require_once 'extern/Mobilpay/Payment/Request/Card.php';
require_once 'extern/Mobilpay/Payment/Request/Notify.php';
require_once 'extern/Mobilpay/Payment/Invoice.php';
require_once 'extern/Mobilpay/Payment/Address.php';
$errorCode = 0;
$errorType = Mobilpay_Payment_Request_Abstract::CONFIRM_ERROR_TYPE_NONE;
$errorMessage = '';
if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') == 0) {
    if (isset($_POST['env_key']) && isset($_POST['data'])) {
        #calea catre cheia privata
        #cheia privata este generata de mobilpay, accesibil in Admin -> Conturi de comerciant -> Detalii -> Setari securitate
        $privateKeyFilePath = getUserConfig('mobilpay_key');
        try {
            global $objPmReq;
            $objPmReq = Mobilpay_Payment_Request_Abstract::factoryFromEncrypted($_POST['env_key'], $_POST['data'], $privateKeyFilePath);
            #uncomment the line below in order to see the content of the request
            print_r($objPmReq);
            $errorCode = $objPmReq->objPmNotify->errorCode;
            // action = status only if the associated error code is zero
            if ($errorCode == "0") {
                switch ($objPmReq->objPmNotify->action) {
                    #orice action este insotit de un cod de eroare si de un mesaj de eroare. Acestea pot fi citite folosind $cod_eroare = $objPmReq->objPmNotify->errorCode; respectiv $mesaj_eroare = $objPmReq->objPmNotify->errorMessage;
                    #pentru a identifica ID-ul comenzii pentru care primim rezultatul platii folosim $id_comanda = $objPmReq->orderId;
                    case 'confirmed':
                        #cand action este confirmed avem certitudinea ca banii au plecat din contul posesorului de card si facem update al starii comenzii si livrarea produsului
                        //update DB, SET status = "confirmed/captured"
                        $_GET['mobilpayipn'] = true;
function unsubscribePage($id)
{
    $pagedata = pageData($id);
    if (isset($pagedata['language_file']) && is_file(dirname(__FILE__) . '/texts/' . $pagedata['language_file'])) {
        @(include dirname(__FILE__) . '/texts/' . $pagedata['language_file']);
    }
    global $tables;
    $res .= '<title>' . $GLOBALS["strUnsubscribeTitle"] . '</title>';
    $res = $pagedata["header"];
    if (isset($_GET["uid"])) {
        $req = Sql_Query("select * from {$tables['user']} where uniqid = \"" . $_GET["uid"] . "\"");
        $userdata = Sql_Fetch_Array($req);
        $email = $userdata["email"];
        if (UNSUBSCRIBE_JUMPOFF) {
            $_POST["unsubscribe"] = 1;
            $_POST["email"] = $email;
            $_POST["unsubscribereason"] = '"Jump off" set, reason not requested';
        }
    }
    if (isset($_POST["unsubscribe"]) && (isset($_POST["email"]) || isset($_POST["unsubscribeemail"])) && isset($_POST["unsubscribereason"])) {
        if (isset($_POST["email"])) {
            $email = trim($_POST["email"]);
        } else {
            $email = $_POST["unsubscribeemail"];
        }
        $query = Sql_Fetch_Row_Query("select id,email from {$tables["user"]} where email = \"{$email}\"");
        $userid = $query[0];
        $email = $query[1];
        if (!$userid) {
            $res .= 'Error: ' . $GLOBALS["strUserNotFound"];
            logEvent("Request to unsubscribe non-existent user: "******"email"], 0, 150));
        } else {
            $result = Sql_query("delete from {$tables["listuser"]} where userid = \"{$userid}\"");
            $lists = "  * " . $GLOBALS["strAllMailinglists"] . "\n";
            # add user to blacklist
            addUserToBlacklist($email, nl2br(strip_tags($_POST['unsubscribereason'])));
            addUserHistory($email, "Unsubscription", "Unsubscribed from {$lists}");
            $unsubscribemessage = ereg_replace("\\[LISTS\\]", $lists, getUserConfig("unsubscribemessage", $userid));
            sendMail($email, getConfig("unsubscribesubject"), stripslashes($unsubscribemessage), system_messageheaders($email));
            $reason = $_POST["unsubscribereason"] ? "Reason given:\n" . stripslashes($_POST["unsubscribereason"]) : "No Reason given";
            sendAdminCopy("List unsubscription", $email . " has unsubscribed\n{$reason}");
            addSubscriberStatistics('unsubscription', 1);
        }
        if ($userid) {
            $res .= '<h1>' . $GLOBALS["strUnsubscribeDone"] . "</h1><P>";
        }
        $res .= $GLOBALS["PoweredBy"] . '</p>';
        $res .= $pagedata["footer"];
        return $res;
    } elseif (isset($_POST["unsubscribe"]) && !$_POST["unsubscribeemail"]) {
        $msg = '<span class="error">' . $GLOBALS["strEnterEmail"] . "</span><br>";
    } elseif (!empty($_GET["email"])) {
        $email = trim($_GET["email"]);
    } else {
        if (isset($_REQUEST["email"])) {
            $email = $_REQUEST["email"];
        } elseif (isset($_REQUEST['unsubscribeemail'])) {
            $email = $_REQUEST['unsubscribeemail'];
        } elseif (!isset($email)) {
            $email = '';
        }
    }
    if (!isset($msg)) {
        $msg = '';
    }
    $res .= '<b>' . $GLOBALS["strUnsubscribeInfo"] . '</b><br>' . $msg . formStart();
    $res .= '<table>
  <tr><td>' . $GLOBALS["strEnterEmail"] . ':</td><td colspan=3><input type=text name="unsubscribeemail" value="' . $email . '" size=40></td></tr>
  </table>';
    if (!$email) {
        $res .= "<input type=submit name=unsubscribe value=\"{$GLOBALS['strContinue']}\"></form>\n";
        $res .= $GLOBALS["PoweredBy"];
        $res .= $pagedata["footer"];
        return $res;
    }
    $current = Sql_Fetch_Array_query("SELECT list.id as listid,user.uniqid as userhash, user.password as password FROM {$tables['list']} as list,{$tables['listuser']} as listuser,{$tables['user']} as user where list.id = listuser.listid and user.id = listuser.userid and user.email = \"{$email}\"");
    $some = $current["listid"];
    if (ASKFORPASSWORD && !empty($user['password'])) {
        # it is safe to link to the preferences page, because it will still ask for
        # a password
        $hash = $current["userhash"];
    } elseif (isset($_GET['uid']) && $_GET['uid'] == $current['userhash']) {
        # they got to this page from a link in an email
        $hash = $current['userhash'];
    } else {
        $hash = '';
    }
    $finaltext = $GLOBALS["strUnsubscribeFinalInfo"];
    $pref_url = getConfig("preferencesurl");
    $sep = ereg('\\?', $pref_url) ? '&' : '?';
    $finaltext = eregi_replace('\\[preferencesurl\\]', $pref_url . $sep . 'uid=' . $hash, $finaltext);
    if (!$some) {
        $res .= "<b>" . $GLOBALS["strNoListsFound"] . "</b></ul>";
        $res .= '<p><input type=submit value="' . $GLOBALS["strResubmit"] . '">';
    } else {
        list($r, $c) = explode(",", getConfig("textarea_dimensions"));
        if (!$r) {
            $r = 5;
        }
        if (!$c) {
            $c = 65;
        }
        $res .= $GLOBALS["strUnsubscribeRequestForReason"];
        $res .= sprintf('<br/><textarea name="unsubscribereason" cols="%d" rows="%d" wrap="virtual"></textarea>', $c, $r) . '

    ' . $finaltext . '

    <p><input type=submit name="unsubscribe" value="' . $GLOBALS["strUnsubscribe"] . '"></p>';
    }
    $res .= '<p>' . $GLOBALS["PoweredBy"] . '</p>';
    $res .= $pagedata["footer"];
    return $res;
}
			<div class="input-prepend">
				<span class="add-on indicatie" style="width:200px;">Serie CI/Buletin</span>
				<input type="text" name="pf_ciserie" value="" size="2" class="text-small" style="width:30px;">-<input type="number" name="pf_cinumar" value="" size="7" style="width:110px;" class="text-small">
			</div>
		</div>
	</div>
<?php 
}
?>

	<div class="row">
		<div class="span10">
			<div class="input-prepend">
				<span class="add-on" style="width:200px;">Carte identitate vehicul</span>
				<input type="text" class="span2 validated" name="serieciv" size=10 <?php 
if (getUserConfig("platalibra") == "yes") {
    echo 'validate="required.yes"';
}
?>
 title="Talon nou: X, Talon vechi: 4">
			</div>
		</div>
	</div>


	<div class="row">
		<div class="span10">
			<div class="input-prepend">
				<span class="add-on" style="width:200px;">Adresa de Corespondenta</span>
				<select name="adresalivrare" class="span2 validated validateundo" validate="for.alta.show.id.adresalivrare">
				<option value="prop">Aceeasi adresa</option>
Beispiel #18
0
<?php

ob_start();
if (getUserConfig("use_locale_jquery") == "yes") {
    ?>
<script type="text/javascript" src="js/jquery.js?1"></script><?php 
} else {
    ?>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<?php 
}
?>
<script type="text/javascript">
function textareaImplode(name)
{
	var alltxt='';
	var allfi=true;
	$('.'+name+'_implode').each(function()
	{
		if($(this).val()!='')
		{
			if(!allfi) alltxt+=', ';
			allfi=false;
			alltxt+=$(this).attr('label')+'. '+$(this).val();
		}
	});
	alltxt=alltxt.toUpperCase();
	$('textarea[name='+name+']').html(alltxt);
	$('textarea[name='+name+']').val(alltxt);
}
</script>
Beispiel #19
0
            }
        }
    }
}
if (session_getvalue("current_language") == 'ro') {
    $acceptro = true;
    $accepten = false;
}
if (session_getvalue("current_language") == 'en') {
    $acceptro = false;
    $accepten = true;
}
$_CONFIG['projectthumb'] = "thumb";
//get parameters
if (isset($_GET['s']) && $_GET['s'] == 'info' && isset($_GET['id']) && $_GET['id'] != '') {
    $siteface_id = intval($_GET['id']);
    session_setvalue("siteface_" . getUserConfig('projectid') . "_id", intval($_GET['id']));
    session_setvalue("siteface_" . getUserConfig('projectid') . "_sid", 0);
} else {
    $siteface_id = session_getvalue("siteface_" . getUserConfig('projectid') . "_id");
}
if (isset($_GET['s']) && $_GET['s'] == 'info' && isset($_GET['sid']) && $_GET['sid'] != '') {
    $siteface_sid = intval($_GET['sid']);
    session_setvalue("siteface_" . getUserConfig('projectid') . "_sid", intval($_GET['sid']));
} else {
    $siteface_sid = session_getvalue("siteface_" . getUserConfig('projectid') . "_sid");
}
//rights
$_CONFIG['dinsec_' . getLT("contracts") . '_cando_user'] = '******';
$_CONFIG['dinsec_' . getLT("clients") . '_cando_user'] = '******';
$_CONFIG['dinsec_' . getLT("propertiesorders") . '_cando_user'] = '******';
Beispiel #20
0
     if (!is_numeric($key)) {
         if ($old_data[$key] != $val && $key != 'password' && $key != 'modified') {
             $information_changed = 1;
             $history_entry .= "{$key} = {$val}\n*changed* from {$old_data[$key]}\n";
         }
     }
 }
 if (!$information_changed) {
     $history_entry .= "\nNo user system details changed";
 }
 $history_entry .= "\n\nList Membership: \n{$lists}\n";
 $message = str_replace('[LISTS]', $lists, getUserConfig('updatemessage', $userid));
 $message = str_replace('[USERDATA]', $datachange, $message);
 if ($emailchanged) {
     $newaddressmessage = str_replace('[CONFIRMATIONINFO]', getUserConfig('emailchanged_text', $userid), $message);
     $oldaddressmessage = str_replace('[CONFIRMATIONINFO]', getUserConfig('emailchanged_text_oldaddress', $userid), $message);
 } else {
     $message = str_replace('[CONFIRMATIONINFO]', '', $message);
 }
 print '<title>' . $GLOBALS['strPreferencesTitle'] . '</title>';
 print $subscribepagedata['header'];
 if (!TEST) {
     if ($emailchanged) {
         if (sendMail($data['email'], getConfig('updatesubject'), $oldaddressmessage, system_messageheaders($email), $envelope) && sendMail($email, getConfig('updatesubject'), $newaddressmessage, system_messageheaders($email), $envelope)) {
             $ok = 1;
             sendAdminCopy('Lists information changed', "\n" . $data['email'] . " has changed their information.\n\nThe email has changed to {$email}.\n\n{$history_entry}", $subscriptions);
             addUserHistory($email, 'Change', $history_entry);
         } else {
             $ok = 0;
         }
     } else {
Beispiel #21
0
function ws_process($action, $para = '')
{
    switch ($action) {
        case 'AdaugaOferta':
            $tipoferta = $_POST['tipoferta'];
            $xml = '<?xml version="1.0" encoding="utf-8"?>
	<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	  <soap:Header>
		 <CredentialHeader xmlns="http://asiguram.ro/ws">
		   <Username>' . getUserConfig("ws_username") . '</Username>
		   <Password>' . getUserConfig("ws_parola") . '</Password>
		 </CredentialHeader>
	  </soap:Header>
	  <soap:Body>
		 <AdaugaOferta xmlns="http://asiguram.ro/ws">
		   <tipoferta>' . $tipoferta . '</tipoferta>
		   <datavalabilitate>' . getDateForMysql($_POST['datavalabilitate'], getLT('dateformat')) . '</datavalabilitate>
		   <tipcontract>' . correctPostValue($_POST['tipproprietar']) . '</tipcontract>
		   ';
            switch ($_POST['tipoferta']) {
                case 'pad':
                    foreach ($_POST as $wk => $wv) {
                        if ($wk == "tipoferta" || $wk == "datavalabilitate") {
                            continue;
                        } else {
                            if ($wk == "produsdorit") {
                                switch ($wv) {
                                    case 'pad+fac':
                                        $xml .= '<emitepad>astrapaid</emitepad>';
                                        $xml .= '<emite>bonusold</emite>';
                                        break;
                                    case 'pad':
                                        $xml .= '<emitepad>astrapaid</emitepad>';
                                        $xml .= '<emite>fara</emite>';
                                        break;
                                    case 'fac':
                                        $xml .= '<emitepad>fara</emitepad>';
                                        $xml .= '<emite>doarbonus</emite>';
                                        break;
                                }
                                $xml .= '<' . $wk . '>' . correctPostValue($_POST[$wk]) . '</' . $wk . '>';
                            } else {
                                if ($wk == "panalavalabilitate") {
                                    $xml .= '<' . $wk . '>' . getDateForMysql($_POST['panalavalabilitate'], getLT('dateformat')) . '</' . $wk . '>';
                                } else {
                                    $xml .= '<' . $wk . '>' . correctPostValue($_POST[$wk]) . '</' . $wk . '>';
                                }
                            }
                        }
                    }
                    break;
                case 'casco':
                    foreach ($_POST as $wk => $wv) {
                        if ($wk == "tipoferta" || $wk == "datavalabilitate") {
                            continue;
                        } else {
                            if ($wk == "panalavalabilitate") {
                                $xml .= '<' . $wk . '>' . getDateForMysql($_POST['panalavalabilitate'], getLT('dateformat')) . '</' . $wk . '>';
                            } else {
                                $xml .= '<' . $wk . '>' . correctPostValue($_POST[$wk]) . '</' . $wk . '>';
                            }
                        }
                    }
                    break;
                case 'decont':
                    foreach ($_POST as $wk => $wv) {
                        if ($wk == "tipoferta" || $wk == "datavalabilitate") {
                            continue;
                        } else {
                            $xml .= '<' . $wk . '>' . correctPostValue($_POST[$wk]) . '</' . $wk . '>';
                        }
                    }
                    break;
                case 'sanatate':
                case 'malpraxis':
                case 'rotr':
                    foreach ($_POST as $wk => $wv) {
                        if ($wk == "tipoferta" || $wk == "datavalabilitate") {
                            continue;
                        } else {
                            $xml .= '<' . $wk . '>' . correctPostValue($_POST[$wk]) . '</' . $wk . '>';
                        }
                    }
                    break;
                case 'medicale':
                    $xml .= '
				<nrzile>' . correctPostValue($_POST['nrzile']) . '</nrzile>
				<panalavalabilitate>' . getDateForMysql($_POST['panalavalabilitate'], getLT('dateformat')) . '</panalavalabilitate>
				<tipproprietar>' . correctPostValue($_POST['tipproprietar']) . '</tipproprietar>
				<pf_tippersoana>' . correctPostValue($_POST['pf_tippersoana']) . '</pf_tippersoana>
				<pf_cnp>' . correctPostValue($_POST['pf_cnp']) . '</pf_cnp>
				<varsta>' . correctPostValue($_POST['varsta']) . '</varsta>
				<pj_tippersoana>' . correctPostValue($_POST['pj_tippersoana']) . '</pj_tippersoana>
				<pj_cui>' . correctPostValue($_POST['pj_cui']) . '</pj_cui>
				<teritoriu>' . correctPostValue($_POST['teritoriu']) . '</teritoriu>
				<scop>' . correctPostValue($_POST['scop']) . '</scop>
				<activitate>' . correctPostValue($_POST['activitate']) . '</activitate>
				<boli>' . correctPostValue($_POST['boli']) . '</boli>
				<grupuri>' . correctPostValue($_POST['grupuri']) . '</grupuri>
				<sporturi>' . correctPostValue($_POST['sporturi']) . '</sporturi>
				<taridest>' . correctPostValue($_POST['taridest']) . '</taridest>
				<taridest2>' . correctPostValue($_POST['taridest2']) . '</taridest2>
				<taridest3>' . correctPostValue($_POST['taridest3']) . '</taridest3>
				<taritranzit>' . correctPostValue($_POST['taritranzit']) . '</taritranzit>
				<acoperire>' . correctPostValue($_POST['acoperire']) . '</acoperire>
				<pretcalatorie>' . correctPostValue($_POST['pretcalatorie']) . '</pretcalatorie>
				<bagaje>' . correctPostValue($_POST['bagaje']) . '</bagaje>
';
                    break;
                case 'rezervare':
                case 'petitie':
                    foreach ($_POST as $wk => $wv) {
                        if ($wk == "tipoferta" || $wk == "datavalabilitate" || $wk == "emailclient") {
                            continue;
                        } else {
                            $xml .= '<' . $wk . '>' . correctPostValue($_POST[$wk]) . '</' . $wk . '>';
                        }
                    }
                    break;
                case 'rca':
                default:
                    switch ($_POST['tipproprietar']) {
                        case 'pf':
                            $xml .= '
		   <asigurat>
		     <tippersoana>' . correctPostValue($_POST['pf_tippersoana']) . '</tippersoana>
		     <cnpcui>' . correctPostValue($_POST['pf_cnp']) . '</cnpcui>
		     <localitate>' . correctPostValue($_POST['pf_localitate']) . '</localitate>
		     <judet>' . correctPostValue($_POST['pf_judet']) . '</judet>
		     <sector>' . correctPostValue($_POST['pf_sector']) . '</sector>
		     <permisan>' . correctPostValue($_POST['pf_permisan']) . '</permisan>
		     <permisluna>' . correctPostValue($_POST['pf_permisluna']) . '</permisluna>
		     <copii>' . correctPostValue($_POST['pf_copii']) . '</copii>
		     <casco>' . correctPostValue($_POST['pf_casco']) . '</casco>
		     <destinatie>' . correctPostValue($_POST['pf_destinatie']) . '</destinatie>
		   </asigurat>
		   ';
                            break;
                        case 'pj':
                            $xml .= '
		   <asigurat>
		     <tippersoana>' . correctPostValue($_POST['pj_tippersoana']) . '</tippersoana>
		     <cnpcui>' . correctPostValue($_POST['pj_cui']) . '</cnpcui>
		     <localitate>' . correctPostValue($_POST['pj_localitate']) . '</localitate>
		     <judet>' . correctPostValue($_POST['pj_judet']) . '</judet>
		     <sector>' . correctPostValue($_POST['pj_sector']) . '</sector>
		     <casco>' . correctPostValue($_POST['pj_casco']) . '</casco>
		     <rca>' . correctPostValue($_POST['pj_rca']) . '</rca>
		     <daune>' . correctPostValue($_POST['pj_daune']) . '</daune>
		     <destinatie>' . correctPostValue($_POST['pj_destinatie']) . '</destinatie>
		   </asigurat>
		   ';
                            break;
                        case 'leasing':
                            $xml .= '
		   <asigurat>
		     <nume>' . correctPostValue($_POST['leasingname']) . '</nume>
		     <cnpcui>' . correctPostValue($_POST['leasingcui']) . '</cnpcui>
		     <localitate>' . correctPostValue($_POST['leasinglocalitate']) . '</localitate>
		     <judet>' . correctPostValue($_POST['leasingjudet']) . '</judet>
		     <sector>' . correctPostValue($_POST['leas_sector']) . '</sector>
		   </asigurat>
		   ';
                            switch ($_POST['tiputilizator']) {
                                case 'pf':
                                    $xml .= '
		   <utilizator>
		     <tippersoana>' . correctPostValue($_POST['pf_tippersoana']) . '</tippersoana>
		     <cnpcui>' . correctPostValue($_POST['pf_cnp']) . '</cnpcui>
		     <localitate>' . correctPostValue($_POST['pf_localitate']) . '</localitate>
		     <judet>' . correctPostValue($_POST['pf_judet']) . '</judet>
		     <sector>' . correctPostValue($_POST['pf_sector']) . '</sector>
		     <permisan>' . correctPostValue($_POST['pf_permisan']) . '</permisan>
		     <permisluna>' . correctPostValue($_POST['pf_permisluna']) . '</permisluna>
		     <copii>' . correctPostValue($_POST['pf_copii']) . '</copii>
		     <casco>' . correctPostValue($_POST['pf_casco']) . '</casco>
		     <destinatie>' . correctPostValue($_POST['pf_destinatie']) . '</destinatie>
		   </utilizator>
		   ';
                                    break;
                                case 'pj':
                                    $xml .= '
		   <utilizator>
		     <tippersoana>' . correctPostValue($_POST['pj_tippersoana']) . '</tippersoana>
		     <cnpcui>' . correctPostValue($_POST['pj_cui']) . '</cnpcui>
		     <localitate>' . correctPostValue($_POST['pj_localitate']) . '</localitate>
		     <judet>' . correctPostValue($_POST['pj_judet']) . '</judet>
		     <sector>' . correctPostValue($_POST['pj_sector']) . '</sector>
		     <casco>' . correctPostValue($_POST['pj_casco']) . '</casco>
		     <rca>' . correctPostValue($_POST['pj_rca']) . '</rca>
		     <daune>' . correctPostValue($_POST['pj_daune']) . '</daune>
		     <destinatie>' . correctPostValue($_POST['pj_destinatie']) . '</destinatie>
		   </utilizator>
		   ';
                                    break;
                                    break;
                            }
                            break;
                    }
                    $codpromo = correctPostValue($_POST['codpromotional']);
                    $xml .= '
		   <vehicul>
		     <inmatriculare>' . correctPostValue($_POST['inmatriculare']) . '</inmatriculare>
		     <categorie>' . correctPostValue($_POST['categorie']) . '</categorie>
		     <marca>' . correctPostValue($_POST['marca']) . '</marca>
		     <model>' . correctPostValue($_POST['model']) . '</model>
		     <anfabricatie>' . correctPostValue($_POST['anfabricatie']) . '</anfabricatie>
		     <nrinm>' . correctPostValue($_POST['nrinm']) . '</nrinm>
		     <seriesasiu>' . correctPostValue($_POST['seriesasiu']) . '</seriesasiu>
		     <serieciv>' . correctPostValue($_POST['serieciv']) . '</serieciv>
		     <cilindree>' . intval($_POST['cilindree']) . '</cilindree>
		     <propulsie>' . correctPostValue($_POST['propulsie']) . '</propulsie>
		     <cp>' . intval($_POST['cp']) . '</cp>
		     <kg>' . intval($_POST['kg']) . '</kg>
		     <locuri>' . intval($_POST['locuri']) . '</locuri>
		     <parcauto>0</parcauto>
		     <codpromotional>' . $codpromo . '</codpromotional>
		   </vehicul>';
                    break;
            }
            $xml .= '
		<emailclient>' . correctPostValue($_POST['emailclient']) . '</emailclient>
		 </AdaugaOferta>
	  </soap:Body>
	</soap:Envelope>';
            //echo $xml;die();
            $data = ws_request(getUserConfig("ws_brokerurl"), $xml, 'AdaugaOferta');
            $r = $data['soap:Envelope']['soap:Body'];
            //print_r($r);die();
            if (isset($r['soap:Fault'])) {
                return false;
            }
            if (isset($r['AdaugaOfertaResponse']['idoferta'])) {
                if (intval($r['AdaugaOfertaResponse']['idoferta']['VALUE'])) {
                    return intval($r['AdaugaOfertaResponse']['idoferta']['VALUE']);
                }
            }
            return false;
        case 'InfoOferta':
            $xml = '<?xml version="1.0" encoding="utf-8"?>
	<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	  <soap:Header>
		 <CredentialHeader xmlns="http://asiguram.ro/ws">
		   <Username>' . getUserConfig("ws_username") . '</Username>
		   <Password>' . getUserConfig("ws_parola") . '</Password>
		 </CredentialHeader>
	  </soap:Header>
	  <soap:Body>
	 <InfoOferta xmlns="http://asiguram.ro/ws">
		   <idoferta>' . intval($para) . '</idoferta>
		 </InfoOferta>
	  </soap:Body>
	</soap:Envelope>';
            $data = ws_request(getUserConfig("ws_brokerurl"), $xml, 'InfoOferta');
            $r = $data['soap:Envelope']['soap:Body'];
            //print_r($data);
            if (isset($r['soap:Fault'])) {
                return false;
            }
            if (isset($r['InfoOfertaResponse']['idoferta'])) {
                if (intval($r['InfoOfertaResponse']['idoferta']['VALUE'])) {
                    return $r['InfoOfertaResponse'];
                }
            }
            return true;
        case 'PolitaOferta':
            if ($action == 'PolitaOferta') {
                $_GET['TarifeOferta'] = $_GET['PolitaOferta'];
            }
        case 'PDFOferta':
            if ($action == 'PDFOferta') {
                $_GET['TarifeOferta'] = $_GET['offid'];
            }
        case 'TarifeOferta':
            $xml = '<?xml version="1.0" encoding="utf-8"?>
	<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	  <soap:Header>
		 <CredentialHeader xmlns="http://asiguram.ro/ws">
		   <Username>' . getUserConfig("ws_username") . '</Username>
		   <Password>' . getUserConfig("ws_parola") . '</Password>
		 </CredentialHeader>
	  </soap:Header>
	  <soap:Body>
	 <TarifeOferta xmlns="http://asiguram.ro/ws">
		   <idoferta>' . intval($_GET['TarifeOferta']) . '</idoferta>
		   ' . ($action == 'PDFOferta' ? '<politaPDF>true</politaPDF>' : '') . '
		 </TarifeOferta>
	  </soap:Body>
	</soap:Envelope>';
            $data = ws_request(getUserConfig("ws_brokerurl"), $xml, 'TarifeOferta');
            //print_r($data);die();
            $r = $data['soap:Envelope']['soap:Body'];
            if (isset($r['soap:Fault'])) {
                return false;
            }
            if (isset($r['TarifeOfertaResponse']['idoferta'])) {
                $tipoferta = $r['TarifeOfertaResponse']['tipoferta']['VALUE'];
                if (intval($r['TarifeOfertaResponse']['idoferta']['VALUE'])) {
                    if ($action == "TarifeOferta") {
                        $soc = array();
                        //check tarifs
                        if (isset($r['TarifeOfertaResponse']['tarif']['societate'])) {
                            //we have one
                            $v = $r['TarifeOfertaResponse']['tarif'];
                            $soc[$v['societate']['VALUE']] = array();
                            $soc[$v['societate']['VALUE']]['soc'] = $v['societate']['VALUE'];
                            $soc[$v['societate']['VALUE']]['6'] = floatval($v['tarif6']['VALUE']);
                            $soc[$v['societate']['VALUE']]['12'] = floatval($v['tarif12']['VALUE']);
                            $soc[$v['societate']['VALUE']]['1'] = floatval($v['tarif1']['VALUE']);
                            $soc[$v['societate']['VALUE']]['bm'] = floatval($v['bm12']['VALUE']);
                        } else {
                            if (isset($r['TarifeOfertaResponse']['tarif'])) {
                                foreach ($r['TarifeOfertaResponse']['tarif'] as $k => $v) {
                                    $soc[$v['societate']['VALUE']] = array();
                                    $soc[$v['societate']['VALUE']]['soc'] = $v['societate']['VALUE'];
                                    $soc[$v['societate']['VALUE']]['6'] = floatval($v['tarif6']['VALUE']);
                                    $soc[$v['societate']['VALUE']]['12'] = floatval($v['tarif12']['VALUE']);
                                    $soc[$v['societate']['VALUE']]['1'] = floatval($v['tarif1']['VALUE']);
                                    $soc[$v['societate']['VALUE']]['bm'] = floatval($v['bm12']['VALUE']);
                                    $soc[$v['societate']['VALUE']]['com'] = floatval($v['com']['VALUE']);
                                }
                            }
                        }
                        usort($soc, sort12luni);
                        //set logos
                        global $_LANG_;
                        $_LANG_['carpatica'] = '<img src="images/carpatica.png" alt="' . getLT('carpatica') . '">';
                        $_LANG_['ardaf'] = '<img src="images/ardaf.png" alt="' . getLT('ardaf') . '">';
                        $_LANG_['astra'] = '<img src="images/astra.png" alt="' . getLT('astra') . '">';
                        $_LANG_['allianz'] = '<img src="images/allianz.png" alt="' . getLT('allianz') . '">';
                        $_LANG_['city'] = '<img src="images/city.png" alt="' . getLT('city') . '">';
                        $_LANG_['abc'] = '<img src="images/abc.png" alt="' . getLT('abc') . '">';
                        $_LANG_['omniasig'] = '<img src="images/omniasig.png" alt="' . getLT('omniasig') . '">';
                        $_LANG_['generali'] = '<img src="images/generali.png" alt="' . getLT('generali') . '">';
                        $_LANG_['grupama'] = '<img src="images/groupama.png" alt="' . getLT('grupama') . '">';
                        $_LANG_['uniqa'] = '<img src="images/uniqa.png" alt="' . getLT('uniqa') . '">';
                        $_LANG_['euroins'] = '<img src="images/euroins.png" alt="' . getLT('euroins') . '">';
                        $_LANG_['asirom'] = '<img src="images/asirom.png" alt="' . getLT('asirom') . '">';
                        $_LANG_['crediteurope'] = '<img src="images/crediteurope.png" alt="' . getLT('crediteurope') . '">';
                        $_LANG_['platinum'] = '<img src="images/gothaer.png" alt="Gothaer">';
                        $_LANG_['mondial'] = '<img src="images/mondial.png" alt="Mondial">';
                        switch ($tipoferta) {
                            case 'medicale':
                                //print_r($soc);
                                ?>
<table class="worktarife" cellpadding=0 cellspacing=0 border="1">
								<tr><th align=right>Asigurator<th align=right>Prima RON
								<?php 
                                foreach ($soc as $k => $v) {
                                    if ($v['12'] < 2) {
                                        continue;
                                    }
                                    ?>
									<tr><td align=center><?php 
                                    echo getLT($v['soc']);
                                    ?>
<td align=right class="worktarif"><a href="#" per="12" socid="<?php 
                                    echo $v['soc'];
                                    ?>
" tarif="<?php 
                                    echo showNumber($v['12'], 2);
                                    ?>
"><?php 
                                    $tt = showNumber($v['12'], 2);
                                    $tt = explode(",", $tt);
                                    echo $tt[0] . '<span class="tarifjos">,' . $tt[1] . '</span>';
                                    ?>
</a>
									<?php 
                                }
                                ?>
</table>
								<?php 
                                if (!isset($r['TarifeOfertaResponse']['ofertafinalizata']) || $r['TarifeOfertaResponse']['ofertafinalizata']['VALUE'] == "false") {
                                    ?>
									<a class="incarcatarife" href="site.php?TarifeOferta=<?php 
                                    echo intval($_GET['TarifeOferta']);
                                    ?>
"></a>
									<?php 
                                }
                                break;
                            case 'pad':
                            case 'casco':
                            case 'sanatate':
                            case 'malpraxis':
                            case 'rotr':
                                //print_r($soc);
                                ?>
<table class="worktarife" cellpadding=0 cellspacing=0 border="1">
								<tr><th align=right>Asigurator<th align=right>Prima EURO
								<?php 
                                foreach ($soc as $k => $v) {
                                    if ($v['12'] < 2) {
                                        continue;
                                    }
                                    ?>
									<tr><td align=center><?php 
                                    echo getLT($v['soc']);
                                    ?>
<td align=right class="worktarif"><a href="#" per="12" socid="<?php 
                                    echo $v['soc'];
                                    ?>
" tarif="<?php 
                                    echo showNumber($v['12'], 2);
                                    ?>
"><?php 
                                    $tt = showNumber($v['12'], 2);
                                    $tt = explode(",", $tt);
                                    echo $tt[0] . '<span class="tarifjos">,' . $tt[1] . '</span>';
                                    ?>
</a>
									<?php 
                                }
                                ?>
</table>
								<?php 
                                if (!isset($r['TarifeOfertaResponse']['ofertafinalizata']) || $r['TarifeOfertaResponse']['ofertafinalizata']['VALUE'] == "false") {
                                    ?>
									<a class="incarcatarife" href="site.php?TarifeOferta=<?php 
                                    echo intval($_GET['TarifeOferta']);
                                    ?>
"></a>
									<?php 
                                }
                                break;
                            case 'rca':
                            default:
                                //print_r($soc);
                                if (getUserConfig('color_design') == "2") {
                                    ?>
<table class="worktarife" cellpadding=0 cellspacing=0 border="1">
								<tr><th align=right style="font-size: 16px;color:black;" rowspan=2>Asigurator<th align=right style="font-size: 16px;color:black;" colspan=2>6 luni<th align=right style="font-size: 16px;color:black;"  colspan=2>1 an
								<tr><th align=right style="font-size: 16px;color:black;">In rate
									<th align=right style="font-size: 16px;color:black;">Integral
									<th align=right style="font-size: 16px;color:black;border-left: solid 2px #eee;">In rate
									<th align=right style="font-size: 16px;color:black;">Integral
								<?php 
                                    foreach ($soc as $k => $v) {
                                        if ($v['6'] < 2) {
                                            continue;
                                        }
                                        if ($v['12'] < 2) {
                                            continue;
                                        }
                                        $oldtarif6 = '';
                                        $oldtarif12 = '';
                                        if (false && (getUserConfig("reduceretarife") != "" || getUserConfig("reduceretarife_" . $v['soc']) != "")) {
                                            $red = getUserConfig("reduceretarife");
                                            if (getUserConfig("reduceretarife_" . $v['soc']) != "") {
                                                $red = getUserConfig("reduceretarife_" . $v['soc']);
                                            }
                                            $oldv6 = floatval($v[6]);
                                            $oldv12 = floatval($v[12]);
                                            $v[6] = floatval($v[6]) * (100 - floatval($red)) / 100;
                                            $v[12] = floatval($v[12]) * (100 - floatval($red)) / 100;
                                            $oldtarif6 = '<span class="tarifjos"> * ' . showNumber($oldv6, 2) . '</span>';
                                            $oldtarif12 = '<span class="tarifjos"> * ' . showNumber($oldv12, 2) . '</span>';
                                        }
                                        ?>
									<tr><td align=center style="text-align:center;"><?php 
                                        echo getLT($v['soc']);
                                        ?>
										<td align=center class="worktarif"><button socid="<?php 
                                        echo $v['soc'];
                                        ?>
" per="6" onclick="return clickPlataInRate('<?php 
                                        echo showNumber($oldv6, 2);
                                        ?>
',this);" class="btn btn-success">In rate <?php 
                                        echo showNumber($oldv6, 2);
                                        ?>
</button><br>&nbsp;
										<td align=center class="worktarif"><button socid="<?php 
                                        echo $v['soc'];
                                        ?>
" per="6" onclick="return clickPlataIntegral('<?php 
                                        echo showNumber($v[6], 2);
                                        ?>
',this);" class="btn btn-success">Cu reducere <?php 
                                        echo showNumber($v[6], 2);
                                        ?>
</button><br><?php 
                                        echo $oldtarif6;
                                        ?>
										<td align=center class="worktarif" style="border-left: solid 2px #eee;"><button socid="<?php 
                                        echo $v['soc'];
                                        ?>
" per="12" onclick="return clickPlataInRate('<?php 
                                        echo showNumber($oldv12, 2);
                                        ?>
',this);" class="btn btn-success">In rate <?php 
                                        echo showNumber($oldv12, 2);
                                        ?>
</button><br>&nbsp;
										<td align=center class="worktarif"><button socid="<?php 
                                        echo $v['soc'];
                                        ?>
" per="12" onclick="return clickPlataIntegral('<?php 
                                        echo showNumber($v[12], 2);
                                        ?>
',this);" class="btn btn-success">Cu reducere <?php 
                                        echo showNumber($v[12], 2);
                                        ?>
</button><br><?php 
                                        echo $oldtarif12;
                                        ?>
									<?php 
                                    }
                                    ?>
<tr><td colspan=5> * Comisionul platit brokerului, calculat ca procent din prima totala afisata in tabel, inclus in prima totala.</table>
								<?php 
                                } else {
                                    if (false && getUserConfig('codpromotional') == "Card Cheque") {
                                        //validate cod promo
                                        if (strlen(trim($v['codpromotional']['VALUE'])) == 13 && intval(substr(trim($v['codpromotional']['VALUE']), 0, 7)) == 6426174) {
                                            //ok
                                            global $_CONFIG;
                                            //$_CONFIG['reduceretarife']=10;
                                        }
                                    }
                                    ?>
<table class="worktarife" cellpadding=0 cellspacing=0 border="1">
								<tr><th align=right>Asigurator<th align=right>6 luni<th align=right>1 an
								<?php 
                                    foreach ($soc as $k => $v) {
                                        if ($v['6'] < 2) {
                                            continue;
                                        }
                                        if ($v['12'] < 2) {
                                            continue;
                                        }
                                        $oldtarif6 = '';
                                        $oldtarif12 = '';
                                        if (false && (getUserConfig("reduceretarife") != "" || getUserConfig("reduceretarife_" . $v['soc']) != "")) {
                                            $red = getUserConfig("reduceretarife");
                                            if (getUserConfig("reduceretarife_" . $v['soc']) != "") {
                                                $red = getUserConfig("reduceretarife_" . $v['soc']);
                                            }
                                            $oldv6 = floatval($v[6]);
                                            $oldv12 = floatval($v[12]);
                                            $v[6] = floatval($v[6]) * (100 - floatval($red)) / 100;
                                            $v[12] = floatval($v[12]) * (100 - floatval($red)) / 100;
                                            $oldtarif6 = '<del><span class="tarifjos">' . showNumber($oldv6, 2) . '</span></del><br>';
                                            $oldtarif12 = '<del><span class="tarifjos">' . showNumber($oldv12, 2) . '</span></del><br>';
                                        }
                                        $oldtarif6 = '<br><span class="tarifjos" style="color:gray">*' . $v['com'] . '% ' . showNumber($v[6] * $v['com'] / 100, 2) . '</span>';
                                        $oldtarif12 = '<br><span class="tarifjos" style="color:gray">*' . $v['com'] . '% ' . showNumber($v[12] * $v['com'] / 100, 2) . '</span>';
                                        ?>
									<tr><td align=center style="text-align:center;"><?php 
                                        echo getLT($v['soc']);
                                        ?>
<td align=right class="worktarif">
									<a href="#" socid="<?php 
                                        echo $v['soc'];
                                        ?>
" per="6" tarif="<?php 
                                        echo showNumber($v['6'], 2);
                                        ?>
"><?php 
                                        $tt = showNumber($v['6'], 2);
                                        $tt = explode(",", $tt);
                                        echo $tt[0] . '<span class="tarifjos">,' . $tt[1] . '</span>';
                                        echo $oldtarif6;
                                        ?>
</a><td align=right class="worktarif"><a href="#"  socid="<?php 
                                        echo $v['soc'];
                                        ?>
" per="12" tarif="<?php 
                                        echo showNumber($v['12'], 2);
                                        ?>
"><?php 
                                        $tt = showNumber($v['12'], 2);
                                        $tt = explode(",", $tt);
                                        echo $tt[0] . '<span class="tarifjos">,' . $tt[1] . '</span>';
                                        echo $oldtarif12;
                                        ?>
</a>
									<?php 
                                    }
                                    ?>
								<tr><td colspan=3 style="color:gray;font-size:0.3em;">* Comisionul platit brokerului, inclus in prima totala, calculat ca procent din prima totala afisata in tabel.
								</table>
								<?php 
                                }
                                if (!isset($r['TarifeOfertaResponse']['ofertafinalizata']) || $r['TarifeOfertaResponse']['ofertafinalizata']['VALUE'] == "false") {
                                    ?>
									<a class="incarcatarife" href="site.php?TarifeOferta=<?php 
                                    echo intval($_GET['TarifeOferta']);
                                    ?>
"></a>
									<?php 
                                }
                                break;
                        }
                    }
                    if ($action == "PolitaOferta") {
                        if (!isset($r['TarifeOfertaResponse']['politafinalizata']) || $r['TarifeOfertaResponse']['politafinalizata']['VALUE'] == "false") {
                            ?>
							<a class="incarcapolita" href="site.php?PolitaOferta=<?php 
                            echo intval($_GET['PolitaOferta']);
                            ?>
"></a>
							<?php 
                        } else {
                            if (!isset($r['TarifeOfertaResponse']['politaid']['VALUE']) || !intval($r['TarifeOfertaResponse']['politaid']['VALUE'])) {
                                ?>
							<a class="incarcapolitaeroare" href="site.php?PolitaOferta=<?php 
                                echo intval($_GET['PolitaOferta']);
                                ?>
"></a>
							<?php 
                            }
                        }
                    }
                    if ($action == "PDFOferta") {
                        header('Content-Disposition: attachment; filename="Polita-' . intval($_GET['offid']) . '.pdf";');
                        return base64_decode($r['TarifeOfertaResponse']['politaPDF']['VALUE']);
                    }
                }
            }
            return false;
            break;
        case 'DateOferta':
            $xml = '<?xml version="1.0" encoding="utf-8"?>
	<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	  <soap:Header>
		 <CredentialHeader xmlns="http://asiguram.ro/ws">
		   <Username>' . getUserConfig("ws_username") . '</Username>
		   <Password>' . getUserConfig("ws_parola") . '</Password>
		 </CredentialHeader>
	  </soap:Header>
	  <soap:Body>
	 <ModificaOferta xmlns="http://asiguram.ro/ws">
		   <idoferta>' . intval($_POST['offid']) . '</idoferta>
		   ';
            foreach ($_POST as $k => $v) {
                switch ($k) {
                    case 'tarif':
                    case 'tipplata':
                    case 'action':
                        break;
                    default:
                        $xml .= '<' . $k . '>' . $v . '</' . $k . '>';
                        break;
                }
            }
            $xml .= '
		 </ModificaOferta>
	  </soap:Body>
	</soap:Envelope>';
            $data = ws_request(getUserConfig("ws_brokerurl"), $xml, 'ModificaOferta');
            $r = $data['soap:Envelope']['soap:Body'];
            if (isset($r['soap:Fault'])) {
                return false;
            }
            return true;
            break;
        case 'WakeupCall':
            $xml = '<?xml version="1.0" encoding="utf-8"?>
	<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	  <soap:Header>
		 <CredentialHeader xmlns="http://asiguram.ro/ws">
		   <Username>' . getUserConfig("ws_username") . '</Username>
		   <Password>' . getUserConfig("ws_parola") . '</Password>
		 </CredentialHeader>
	  </soap:Header>
	  <soap:Body>
		<WakeupCall xmlns="http://asiguram.ro/ws">
			<idoferta>' . intval($_GET['WakeupCall']) . '</idoferta>
		</WakeupCall>
	  </soap:Body>
	</soap:Envelope>';
            $data = ws_request(getUserConfig("ws_brokerurl"), $xml, 'WakeupCall');
            $r = $data['soap:Envelope']['soap:Body'];
            if (isset($r['soap:Fault'])) {
                return false;
            }
            return true;
            break;
        case 'ContulNou':
        case 'ParolaUitata':
        case 'ContulTau':
        case 'Reincarca':
            $xml = '<?xml version="1.0" encoding="utf-8"?>
	<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	  <soap:Header>
		 <CredentialHeader xmlns="http://asiguram.ro/ws">
		   <Username>' . getUserConfig("ws_username") . '</Username>
		   <Password>' . getUserConfig("ws_parola") . '</Password>
		 </CredentialHeader>
	  </soap:Header>
	  <soap:Body>
		<' . $action . ' xmlns="http://asiguram.ro/ws">
			<clientid>' . session_getvalue("login_clientid") . '</clientid>
			';
            foreach ($_POST as $k => $v) {
                if ($k == "frandom") {
                    continue;
                }
                if ($k == "action") {
                    continue;
                }
                if ($k == "textbutton") {
                    continue;
                }
                if ($k == "automaticsubmit") {
                    continue;
                }
                $xml .= '<' . $k . '>' . $v . '</' . $k . '>';
            }
            $xml .= '
		</' . $action . '>
	  </soap:Body>
	</soap:Envelope>';
            $data = ws_request(getUserConfig("ws_brokerurl"), $xml, $action);
            $r = $data['soap:Envelope']['soap:Body'];
            global $_local_error;
            $_local_error = '';
            if (isset($r['soap:Fault'])) {
                $_local_error = $r['soap:Fault']['faultstring']['VALUE'];
                return false;
            }
            if (isset($r['Client']['id']['VALUE'])) {
                if (intval($r['Client']['id']['VALUE'])) {
                    session_setvalue("login_clientid", intval($r['Client']['id']['VALUE']));
                }
            }
            if (isset($r['Redirect']['screen']['VALUE'])) {
                ?>
<textarea><?php 
                if (isset($r['Redirect']['message']['VALUE'])) {
                    ?>
alert("<?php 
                    echo $r['Redirect']['message']['VALUE'];
                    ?>
");<?php 
                }
                ?>
location.href='site.php?t=<?php 
                echo $r['Redirect']['screen']['VALUE'];
                ?>
';</textarea>
				<?php 
                die;
            }
            return true;
            break;
        case 'Portofoliu':
            include "extensions/process_offer_ws_client.php";
            break;
    }
}
Beispiel #22
0
 public function view($plugin)
 {
     getAuthentication()->requireAuthentication();
     $siteConfig = getUserConfig()->getSiteSettings();
     $plugins = (array) explode(',', $siteConfig['plugins']['activePlugins']);
     if (!in_array($plugin, $plugins)) {
         $this->logger->warn(sprintf('Tried to call /plugin/%s/view.json on an inactive or non existant plugin', $plugin));
         return $this->error('Could not load plugin', false);
     }
     $pluginObj = getPlugin();
     $conf = $pluginObj->loadConf($plugin);
     $bodyTemplate = sprintf('%s/plugin-form.php', $this->config->paths->templates);
     $body = $this->template->get($bodyTemplate, array('plugin' => $plugin, 'conf' => $conf, 'crumb' => $this->session->get('crumb')));
     return $this->success(sprintf('Form for %s plugin', $plugin), array('markup' => $body));
 }
Beispiel #23
0
function getUserConfig($item, $userid = 0)
{
    global $default_config, $tables, $domain, $website;
    $hasconf = Sql_Table_Exists($tables["config"]);
    $value = '';
    if ($hasconf) {
        $query = 'select value,editable from ' . $tables['config'] . ' where item = ?';
        $req = Sql_Query_Params($query, array($item));
        if (!Sql_Num_Rows($req)) {
            if (array_key_exists($item, $default_config)) {
                $value = $default_config[$item]['value'];
            }
        } else {
            $row = Sql_fetch_Row($req);
            $value = $row[0];
            if ($row[1] == 0) {
                $GLOBALS['noteditableconfig'][] = $item;
            }
        }
    }
    # if this is a subpage item, and no value was found get the global one
    if (!$value && strpos($item, ":") !== false) {
        list($a, $b) = explode(":", $item);
        $value = getUserConfig($a, $userid);
    }
    if ($userid) {
        $query = 'select uniqid, email from ' . $tables['user'] . ' where id = ?';
        $rs = Sql_Query_Params($query, array($userid));
        $user_req = Sql_Fetch_Row($rs);
        $uniqid = $user_req[0];
        $email = $user_req[1];
        # parse for placeholders
        # do some backwards compatibility:
        # hmm, reverted back to old system
        $url = getConfig("unsubscribeurl");
        $sep = strpos($url, '?') !== false ? '&' : '?';
        $value = str_ireplace('[UNSUBSCRIBEURL]', $url . $sep . 'uid=' . $uniqid, $value);
        $url = getConfig("confirmationurl");
        $sep = strpos($url, '?') !== false ? '&' : '?';
        $value = str_ireplace('[CONFIRMATIONURL]', $url . $sep . 'uid=' . $uniqid, $value);
        $url = getConfig("preferencesurl");
        $sep = strpos($url, '?') !== false ? '&' : '?';
        $value = str_ireplace('[PREFERENCESURL]', $url . $sep . 'uid=' . $uniqid, $value);
        $value = str_ireplace('[EMAIL]', $email, $value);
        $value = parsePlaceHolders($value, getUserAttributeValues($email));
    }
    $value = str_ireplace('[SUBSCRIBEURL]', getConfig("subscribeurl"), $value);
    $value = preg_replace('/\\[DOMAIN\\]/i', $domain, $value);
    #@ID Should be done only in one place. Combine getConfig and this one?
    $value = preg_replace('/\\[WEBSITE\\]/i', $website, $value);
    if ($value == "0") {
        $value = "false";
    } elseif ($value == "1") {
        $value = "true";
    }
    return $value;
}
Beispiel #24
0
?>
;
}
th.datepickerWeek span
{
	color: <?php 
echo getUserConfig("theme_color4");
?>
;
}
</STYLE>
<?php 
cache_addvalue("head", ob_get_contents());
ob_end_clean();
ob_start();
if (getUserConfig("datepicker") != "yes") {
    ?>
<DIV ID="calendardiv" STYLE="position:absolute;visibility:hidden;background-color:white;z-index:100;"></DIV>
<script>
var global_cal = new CalendarPopup("calendardiv");
//global_cal.showNavigationDropdowns();
global_cal.setCssPrefix("");
global_cal.setMonthNames(<?php 
    echo getLT('months');
    ?>
);
global_cal.setDayHeaders(<?php 
    echo getLT('shortdays');
    ?>
);
global_cal.setWeekStartDay(<?php 
Beispiel #25
0
            $datachange .= $value?$strYes:$strNo;
          elseif ($attribute["type"] != "textline" && $attribute["type"] != "textarea")
            $datachange .= AttributeValue($attribute["tablename"],$value);
          else
            $datachange .= stripslashes($value);
          $datachange .= "\n";
        }
      }
    }
  }

  $message = ereg_replace('\[LISTS\]', $lists, getUserConfig("updatemessage",$userid));
  $message = ereg_replace('\[USERDATA\]', $datachange, $message);
  if ($emailchanged) {
    $newaddressmessage = ereg_replace('\[CONFIRMATIONINFO\]', getUserConfig("emailchanged_text",$userid), $message);
    $oldaddressmessage = ereg_replace('\[CONFIRMATIONINFO\]', getUserConfig("emailchanged_text_oldaddress",$userid), $message);
  } else {
    $message = ereg_replace('\[CONFIRMATIONINFO\]', "", $message);
  }

	print '<title>'.$GLOBALS["strPreferencesTitle"].'</title>';
  print $subscribepagedata["header"];
  if (!TEST) {
    if ($emailchanged) {
      if (sendMail($data["email"],getConfig("updatesubject"),$oldaddressmessage, system_messageheaders($email),$envelope) &&
	      sendMail($email,getConfig("updatesubject"),$newaddressmessage, system_messageheaders($email),$envelope)) {
				$ok = 1;
    		sendAdminCopy("Lists information changed",$data["email"] . " has changed their information.\nThe email has changed to $email.");
      } else {
      	$ok = 0;
      }
Beispiel #26
0
$_LANG_['newsimg'] = "Imagine";
$_LANG_['newsimg2'] = "Imagine secundara";
$_LANG_['newsimg3'] = "Imagine secundara";
$_LANG_['newsimg4'] = "Imagine secundara";
$_LANG_['newsimg5'] = "Imagine secundara";
$_LANG_['newsimg6'] = "Imagine secundara";
$_LANG_['prodimage'] = "Imagine";
$_LANG_['prodimage2'] = "Imagine secundara";
$_LANG_['prodimage3'] = "Imagine secundara";
$_LANG_['prodimage4'] = "Imagine secundara";
$_LANG_['prodimage5'] = "Imagine secundara";
$_LANG_['prodimage6'] = "Imagine secundara";
$_LANG_['astra'] = "ASTRA";
$_LANG_['carpatica'] = "CARPATICA";
$_LANG_['euroins'] = "EUROINS";
$_LANG_['uniqa'] = "UNIQA";
$_LANG_['grupama'] = "GROUPAMA";
$_LANG_['allianz'] = "ALLIANZ";
$_LANG_['asirom'] = "ASIROM";
$_LANG_['omniasig'] = "OMNIASIG";
$_LANG_['platinum'] = "GOTHAER";
$_LANG_['mondial'] = "MONDIAL";
$_LANG_['bcrasig'] = "OMNIASIG BCR";
$_LANG_['generali'] = "GENERALI";
$_LANG_['ardaf'] = "GENERALI ARDAF";
$_LANG_['abc'] = "ABC ASIGURARI";
$_LANG_['city'] = "CITY INSURANCE";
$_LANG_['crediteurope'] = "CREDIT EUROPE";
if (file_exists("cache/language_" . getUserConfig('projectid') . ".php")) {
    include "cache/language_" . getUserConfig('projectid') . ".php";
}
        ?>
</div></div><?php 
    }
} else {
    //wait for more
    ?>
<div class="workstep"><div class=workfields style="width:295px;height:120px;">
<span id="loadingpolitaimg"><img src="images/ajax-loader.gif">Acum incerc sa emit polita</span>
<br>
<span id="loadingpolitamesaj" style="display:none;">
Polita dumneavoastra s-a emisa. Puteti descarca o copie de aici: <a href="site.php?t=polita&offid=<?php 
    echo intval($_GET['offid']);
    ?>
">Polita</a>
</span>
<span id="loadingpolitaeroare" style="display:none;"><?php 
    echo getUserConfig("mesaj_eroare");
    ?>
</span>
	<div style="height:1px;"><div id="offpolita"><a class="incarcapolita" href="site.php?PolitaOferta=<?php 
    echo intval($_GET['offid']);
    ?>
"></a></div></div>
</div></div>
<?php 
}
?>

</div>

Beispiel #28
0
		{
			//ignore
			return true;
		}
		if(!isElementVisible($(this)) && $(this).css("display")!="block")
		{
			nextstep=this;
			foundone=true;
			return false;
		}
		var valid=true;
		$(this).find(".validated").each(function(){
			if(!validateFieldRule($(this),{},$(this).attr("validate")))
			{
				$(this).css("background-color", "<?php 
echo getUserConfig("alert_color");
?>
");
				ret=false;
				valid=false;
				allvalid=false;
			}
			else
			{
				$(this).css("background-color", "white");
				valid=true;
			}
		});
		if(valid)
		{
			//save all
Beispiel #29
0
 function Payment()
 {
     $this->backref = getUserConfig("ws_merch_backurl");
     // TDB - from MERCHANT
 }
<div id="worksteps">

<input type="hidden" name="automaticsubmit" value="false">
<input type="hidden" name="offid" value="<?php 
echo intval($_GET['offid']);
?>
">
<input type="hidden" name="tipoferta" value="rezervare">
<?php 
require_once "extensions/process_offer_ws.php";
$date = ws_process("InfoOferta", intval($_GET['offid']));
$pin = md5(getUserConfig("sitepin") . "-" . intval($_GET['offid']));
if (isset($_GET['motiv']) && $_GET['motiv'] == "neconfirmare") {
    if ($pin != $_GET["pin"]) {
        ?>
<input type="hidden" name="action" value="PlataOk">
<input type="hidden" name="textbutton" value="Eroare pin">
<div class="work_col1">

<div class="biglabel"><img src="images/x.png" border=0> Eroare Pin</div>

<div class="workstep"><div class=workfields style="width:295px;height:auto;">Linkul nu este valabil, va rugam sa raportati eroarea.
</div></div>

</div>
		<?php 
    } else {
        ?>
<input type="hidden" name="action" value="TarifeOferta">
<input type="hidden" name="textbutton" value="Nu avem camere libere">
<input type="hidden" name="ofertastatus" value="2">