Esempio n. 1
0
$blog_type_user = $_SESSION['UID'];
$urlmoduleid = str_replace(" ", "", $_GET['urlmoduleid']);
$urlid = str_replace(" ", "", $_GET['urlid']);
$url = str_replace(" ", "", $_GET['url']);
$page = str_replace(" ", "", $_GET['page']);
$select_url_array = getWebSiteArrayByID($urlid);
//─Б┐ж┤┤йе
$link_name = str_replace(" ", "", $_POST['link_name']);
$link_url = str_replace(" ", "", $_POST['link_url']);
$isedused = str_replace(" ", "", $_POST['isedused']);
$link_module = str_replace(" ", "", $_POST['link_module']);
if ($link_name == "" || $link_name == null || $link_name == "╩С╚в═Эои├ч│к") {
    $info1 = "╩С╚в═Эои├ч│к";
} else {
    if ($urlid > 0) {
        $boolean = updateUrl($urlid, $link_name, $link_url, $isedused, $link_module);
        if ($boolean == true) {
            $info = "═ЭоиИЧл┬│╔╣д";
        } else {
            $info = "М╔М┌═Э┬унГмЫ,▓┘Оэ╩Д░▄,Кв╔н║зоп╩н...";
        }
    } else {
        if (viewIsedWebSiteByName($link_name) == true) {
            $info = "╩§ЙП┐Р┤Тн┌И├═Эои";
        } else {
            $boolean = createUrl($link_name, $link_url, $isedused, $link_module, $blog_type_user);
            //╗ы╚Ал┬▓т╚вх─╩§ЙПID║┼
            $urlidnew = mysql_insert_id();
            if ($boolean == true) {
                $info = "═Эои╠ь╝М│╔╣д";
            } else {
Esempio n. 2
0
    echo "\nFinished";
} else {
    echo "\nErrormessage: " . $mysqli->error;
}
$city2region = array();
echo "\nStart filling context_rk_jobs_vacancies.xml";
$sql = "\n        SELECT\n            l_position as vacancy,\n            l_location_city as geo,\n            COUNT(*) as total,\n            SUM(IF(cmp_rank IS NULL,0,1)) as promoted,\n            (SUM(IF(cmp_rank IS NULL,0,1)) / COUNT(l_id)) * 100 as calc,\n            'http://%subdomain%pingola.ru/jobs/search/%vacancy%%geo_params%' as url\n        FROM ru_eyezeek.jobs j\n            LEFT JOIN ru_eyezeek.promoted_jobs p ON j.l_id=p.o_l_id\n        WHERE l_isactive=1 and l_location_city<>'' AND l_position<>'' AND positions <> ''\n        GROUP BY l_location_city, l_position\n        HAVING calc> (CASE WHEN (total BETWEEN 10 AND 50) THEN 49.99\n        WHEN (total BETWEEN 51 AND 100) THEN 39.99\n        WHEN (total BETWEEN 101 AND 1000) THEN 19.99\n        WHEN (total BETWEEN 1001 AND 10000) THEN 4.99\n        WHEN (total>10000) THEN 1.99 END)\n        ORDER BY NULL DESC LIMIT 10000";
if ($result = $mysqli->query($sql)) {
    $writer = new XMLWriter();
    $writer->openURI($file_path . 'context_rk_jobs_vacancies.xml');
    $writer->startDocument('1.0', 'UTF-8');
    $writer->setIndent(TRUE);
    $writer->startElement('root');
    $writer->writeElement('creation-date', date("d/m/y : H:i:s", time()));
    while ($arr = $result->fetch_assoc()) {
        $arr = updateUrl($arr, $mysqli);
        if (empty($arr)) {
            continue;
        }
        $writer->startElement('offer');
        foreach ($arr as $name => $value) {
            if ($name == 'geo') {
                if (!isset($city2region[$value])) {
                    $reg_sql = "SELECT r.Name FROM ru_geo.City c JOIN ru_geo.Region r ON c.Region=r.ID WHERE c.Name='{$value}'";
                    if ($res = $mysqli->query($reg_sql)) {
                        $region = $res->fetch_assoc();
                        if (!empty($region['Name'])) {
                            $city2region[$value] = $region['Name'];
                        }
                    }
                }