当前位置: 首页>>代码示例>>PHP>>正文


PHP set_status函数代码示例

本文整理汇总了PHP中set_status函数的典型用法代码示例。如果您正苦于以下问题:PHP set_status函数的具体用法?PHP set_status怎么用?PHP set_status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了set_status函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: session_start

<?php

include_once 'hw_function.php';
session_start();
if (get_condition() == '1') {
    if (isset($_POST['status']) && !isset($_POST['apply'])) {
        if (get_status() == '1') {
            set_status('<0>');
            $_SESSION['message'] = "Device has been turned off";
            header('Location: /danzsecurity/setting');
        } else {
            if (get_status() == '0') {
                set_status('<1>');
                $_SESSION['message'] = "Device has been turned on";
                header('Location: /danzsecurity/setting');
            }
        }
    }
    if (isset($_POST['apply'])) {
        set_attempts("<{$_POST['password_attempts']}>");
        $_SESSION['message'] = "Password Attempts has been changed";
        header('Location: /danzsecurity/setting');
    }
} else {
    if (!isset($_POST['condition'])) {
        $_SESSION['error'] = "Setting cannot be changed while device is locked";
        header('Location: /danzsecurity/setting');
    }
}
if (isset($_POST['condition'])) {
    set_condition('<1>');
开发者ID:AlvaCorp,项目名称:sistem-kendali-pintu,代码行数:31,代码来源:hw_exec.php

示例2: end_status

function end_status($process)
{
    global $wp_restore, $complete;
    set_status($process, $complete, false);
    $wp_restore->save_process_status($process, 'completed');
}
开发者ID:ajspencer,项目名称:NCSSM-SG-WordPress,代码行数:6,代码来源:job_restore.php

示例3: User

            $user = new User($pdo_link);
            $user->username = $data["username"];
            $user->password = $data["password"];
            $success = $user->create();
            $response["debug"] = $success;
            /**
             * Switch won't work in this situation
             * Thanks php
             */
            if ($success === 1056) {
                set_status(403, $STR["username_taken"]);
            } elseif ($success === true) {
                $session = new Session($pdo_link);
                $session->user = $user;
                $response["session_token"] = $session->grant_token();
                set_status(201, $STR["account_created"]);
            } else {
                set_status(403, $STR["register_failed"]);
            }
        }
        break;
    case 'GET':
        if ("notes" == array_shift($path) && $SESSION_STARTED) {
            $note_list = $CURRENT_USER->fetch_user_notes();
            $response["notes"] = $note_list;
        }
        break;
    default:
        set_status(501, $STR["unsupported_method"]);
        break;
}
开发者ID:hrn4n,项目名称:argon,代码行数:31,代码来源:user.php

示例4: foreach

//массив живых rpc
$good_pings = 0;
//массив успешных пингов
foreach ($rpc_arr as $rpc_url) {
    $rpc_url = trim($rpc_url);
    if ($rpc_url == '') {
        continue;
    }
    if ($rss_url == 'no') {
        $rss_url = "";
        $ret = ping_rss($domen, $rpc_url, '1');
    } else {
        $rss_url = "http://{$domen}/{$rss_url}";
        $ret = ping_rss($domen, $rpc_url, '2');
        if ($ret == '405') {
            $ret = ping_rss($domen, $rpc_url, '1');
        }
    }
    if (in_array($ret, $good_codes)) {
        $good_rpc[] = $rpc_url;
        $good_pings++;
    }
}
$ping_date = date("Y-m-d");
set_status('ping_rss_tasks', $id_task, 'task_status', 'done');
set_status('ping_rss_tasks', $id_task, 'ping_date', $ping_date);
set_status('ping_rss_tasks', $id_task, 'good_pings', $good_pings);
//file_put_contents('data/ping/error_log.txt',$error);
//file_put_contents('data/ping/bad_rpc.txt',$bad_rpc);
//file_put_contents('data/ping/good_rpc.txt',$good_rpc);
//unset($bad_rpc,$good_rpc,$error);
开发者ID:ivrm,项目名称:mbgdorgen,代码行数:31,代码来源:ping_rss.php

示例5: generate_upload_full_html_site_map

//Генерим одностраничную карту сайта со ссылками на все страницы дора sitemap.html
generate_upload_full_html_site_map();
//Заливаем папку со скриптами редиректа на хост
upload_script_folder_to_host();
//Сохраняем ссылки на страницы дора в файл
# save_dor_pages_links_to_file();
//Генерация robots.txt и заливка на хост
generate_upload_robots_txt();
//генерация sitemap.xml и заливка на хост
generate_upload_xml_site_map();
//Генерация и заливка rss
generate_upload_rss_xml();
//Заносим запись в таблицу `dors` и заносим туда ссылки на индекс на карту и др. характеристики дора
add_ready_dor_to_base();
//Меняем статус хоста на 'used'
set_status('hosts', $id_host, 'host_status', 'used');
//Увеличиваем заюзанность шаблона на 1 и вставляем значение в базу
$used_num++;
$result = mysql_query("UPDATE `dor_tpls` SET `usednum` = '{$used_num}' WHERE `id` = '{$id_dor_tpl}' LIMIT 1;");
if (!$result) {
    echo mysql_error();
    exit;
}
//добавляем задание на пинг rss, если нужно
if ($ping_rss) {
    add_ping_rss_task($dor_md5, $dor_name, 'rss.xml');
}
mysql_close($cn);
unset($used_num);
//пингуем xml sitemap, если нужно
if ($ping_map) {
开发者ID:ivrm,项目名称:mbgdorgen,代码行数:31,代码来源:dorgen.php

示例6: create_upload_redirect

function create_upload_redirect()
{
    //Создаем файл редиректа и заливаем на хост
    global $tmp, $script_fname, $redir_code, $ftp_con, $ftp_dir, $id_task;
    $fr = fopen("tmp/{$tmp}/{$script_fname}", 'w+');
    fputs($fr, $redir_code);
    fclose($fr);
    //заливаем редирект на хост
    $upload_page = @upload_page_to_host($script_fname, $ftp_con, $ftp_dir);
    unlink("tmp/{$tmp}/{$script_fname}");
    if (!$upload_page) {
        echo "Невозможно залить редирект на хост";
        set_status('dorgen_tasks', $id_task, 'dor_status', 'error');
        exit;
    }
}
开发者ID:ivrm,项目名称:mbgdorgen,代码行数:16,代码来源:function.php

示例7: write_warning_status

        write_warning_status('106');
    }
    //Rename backup folder
    if (!$wp_backup->rename_backup_folder()) {
        $backup_job->set_task_error('109');
        write_fatal_error_status('109');
        //cleanup_on_failure( $wp_backup->backup_project_path );
        end_backup(109, false);
    }
    //Take an inventory of the zip files created
    $file_system = new WPBackItUp_FileSystem($logger);
    $zip_files = $file_system->get_fileonly_list($wp_backup->backup_project_path, 'zip');
    $wp_backup->save_file_list_inventory(WPBACKITUP__SQL_BULK_INSERT_SIZE, $backup_job->backup_id, 'backups', $wp_backup->backup_project_path, $zip_files);
    //Combine the zip files into one file
    //	$zip_remaining_files_count = $wp_backup->backup_files( $backup_job->backup_id, $wp_backup->backup_project_path, 'backup-files', 'combined' );
    set_status('finalize_backup', $complete, false);
    $backup_job->set_task_complete();
    $logger->log('**END FINALIZE BACKUP**');
}
//If we get this far we have a finalized backup so change the path
$wp_backup->set_final_backup_path();
if ($backup_job->get_job_status() == 'complete') {
    //SUCCESS- End Job!
    $wp_backup->update_job_control_complete($backup_job->backup_id);
    //write response file first to make sure it is there
    write_response_file_success();
    set_status_success();
    $WPBackitup->increment_successful_backup_count();
    end_backup(null, true);
}
exit;
开发者ID:ajspencer,项目名称:NCSSM-SG-WordPress,代码行数:31,代码来源:job_backup.php

示例8: ScanRules

function ScanRules()
{
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".pid";
    if (!$GLOBALS["FORCE"]) {
        $pid = $unix->get_pid_from_file($pidfile);
        if ($unix->process_exists($pid, basename(__FILE__))) {
            build_progress("Process {$pid} already exists", 110);
            echo "Process {$pid} already exists\n";
            return;
        }
    }
    if (system_is_overloaded(basename(__FILE__))) {
        echo "Overloaded system, aborting\n";
        build_progress("Overloaded system", 110);
        return;
    }
    @file_put_contents($pidfile, getmypid());
    include_once dirname(__FILE__) . '/ressources/class.mysql.squid.builder.php';
    $q = new mysql_squid_builder();
    $base = "/home/squid/rttsize";
    $YEAR = date("Y");
    $MONTH = date("m");
    $DAY = date("d");
    $HOUR = date("H");
    $WEEK = date("W");
    $baseHour = "/home/squid/rttsize/{$YEAR}/{$MONTH}/{$WEEK}/{$DAY}/{$HOUR}";
    $baseDay = "/home/squid/rttsize/{$YEAR}/{$MONTH}/{$WEEK}/{$DAY}";
    $baseWeek = "/home/squid/rttsize/{$YEAR}/{$MONTH}/{$WEEK}";
    $baseMonth = "/home/squid/rttsize/{$YEAR}/{$MONTH}";
    $during[60] = $baseHour;
    $during[1440] = $baseDay;
    $during[10080] = $baseWeek;
    $GLOBALS["MUST_RELOAD_SQUID"] = false;
    $GLOBALS["STATUS"] = array();
    $sql = "SELECT ID,PatternGroup FROM bandquotas_status WHERE `freeze`=1";
    $results = $q->QUERY_SQL($sql);
    while ($ligne = mysql_fetch_assoc($results)) {
        $key = "{$ligne["ID"]}-{$ligne["PatternGroup"]}";
        $GLOBALS["STATUS"][$key]["FREEZE"] = 1;
    }
    $sql = "SELECT * FROM bandquotas WHERE enabled=1";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        echo $q->mysql_error . "\n";
        build_progress("MySQL error", 110);
        return;
    }
    if (mysql_num_rows($results) == 0) {
        build_progress("{no_rule}", 110);
        set_status();
        return;
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $QuotaSizeBytes = $ligne["QuotaSizeBytes"];
        $GroupType = $ligne["GroupType"];
        $PatternGroup = $ligne["PatternGroup"];
        $TimeFrame = $ligne["TimeFrame"];
        $basePath = $during[$TimeFrame];
        $RuleName = $ligne["RuleName"];
        $FileAcls = "/etc/squid3/bandwidths/Group{$ligne["ID"]}.acl";
        build_progress("{Scanning} Rule:{$ligne["ID"]}", 50);
        events("[INFO]: Analyze {$RuleName}", __LINE__);
        if ($GroupType == 0) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Scanning {$PatternGroup} [Active Directory] ({$RuleName})\n";
            }
            ScanActiveDirectoryGroups($ligne["ID"], $RuleName, $PatternGroup, $basePath, $QuotaSizeBytes, $FileAcls);
            continue;
        }
        if ($GroupType == 2) {
            ScanIpAddr_single($ligne["ID"], $RuleName, $PatternGroup, $basePath, $QuotaSizeBytes, $FileAcls);
            continue;
        }
        if ($GroupType == 1) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Scanning {$PatternGroup} [Simple Member] ({$RuleName})\n";
            }
            Scan_member_single($ligne["ID"], $RuleName, $PatternGroup, $basePath, $QuotaSizeBytes, $FileAcls);
            continue;
        }
        if ($GroupType == 3) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Scanning {$PatternGroup} [Simple MAC] ({$RuleName})\n";
            }
            ScanMacAddr_single($ligne["ID"], $RuleName, $PatternGroup, $basePath, $QuotaSizeBytes, $FileAcls);
            continue;
        }
        if ($GroupType == 4) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Scanning {$PatternGroup} [Full network] ({$RuleName})\n";
            }
            ScanNetwork($ligne["ID"], $RuleName, $PatternGroup, $basePath, $QuotaSizeBytes, $FileAcls);
            continue;
        }
    }
    build_progress("{Scanning} {status}", 90);
    set_status();
    if ($GLOBALS["MUST_RELOAD_SQUID"]) {
        build_progress("{reloading_proxy_service}", 95);
//.........这里部分代码省略.........
开发者ID:articatech,项目名称:artica,代码行数:101,代码来源:exec.quotaband.php

示例9: check_file

function check_file($id)
{
    //echo VIDEO_STORAGE_DIR.$fname."<br>";
    $fname = $id . ".mpg";
    //if (file_exists(KARAOKE_STORAGE_DIR.$fname)){
    //var_dump(get_status($id));
    $color_status = get_status($id);
    if ($color_status == 1) {
        $color = 'green';
        set_status($id, 1);
    } else {
        if ($color_status == 0) {
            $color = 'red';
            set_status($id, 0);
        } else {
            if ($color_status == 2) {
                $color = 'blue';
            }
        }
    }
    return "<font id='path_{$id}' color='{$color}'>{$fname}</font>";
}
开发者ID:Eugen1985,项目名称:stalker_portal,代码行数:22,代码来源:add_karaoke.php

示例10: xml_crud

function xml_crud($xml, $tax_args, $meta_args, $post, $status)
{
    switch ($status) {
        /* -------------------------------------------------------- *\
             ADD
           \* -------------------------------------------------------- */
        case 'add':
            global $wpdb;
            $querystr = "\n          SELECT * FROM wp_posts\n          WHERE post_type = 'occasions'\n        ";
            $result = $wpdb->get_results($querystr);
            // check if we have occasions in db
            if (count($result) < 1) {
                // controles uitvoeren
                check_vehicle($xml);
                // create the taxonomies
                create_tax($tax_args);
                $post_id = wp_insert_post($post);
                // insert post taxonomies
                insert_post_tax($post_id, $tax_args);
                // insert post meta values
                insert_meta_values($post_id, $meta_args);
                // foto's opslaan
                process_photos($post_id, $xml->afbeeldingen['afbeelding']);
                // set status
                set_status(1);
            } else {
                global $wpdb;
                $querystr = "\n            SELECT * FROM wp_postmeta \n            WHERE meta_key = 'occasion_hexon_nr' \n            AND meta_value = '{$xml->voertuignr_hexon}'\n          ";
                $result = $wpdb->get_results($querystr);
                if (count($result) < 1) {
                    // controles uitvoeren
                    check_vehicle($xml);
                    // create the taxonomies
                    create_tax($tax_args);
                    $post_id = wp_insert_post($post);
                    // insert post taxonomies
                    insert_post_tax($post_id, $tax_args);
                    // insert post meta values
                    insert_meta_values($post_id, $meta_args);
                    // foto's opslaan
                    process_photos($post_id, $xml->afbeeldingen['afbeelding']);
                    // set status
                    set_status(1);
                }
                // set status
                set_status(0);
            }
            break;
            /* -------------------------------------------------------- *\
                 UPDATE
               \* -------------------------------------------------------- */
        /* -------------------------------------------------------- *\
             UPDATE
           \* -------------------------------------------------------- */
        case 'change':
            // Controles uitvoeren
            check_vehicle($xml);
            global $wpdb;
            $querystr = "\n          SELECT * FROM wp_postmeta \n          WHERE meta_key = 'occasion_hexon_nr' \n          AND meta_value = '{$xml->voertuignr_hexon}'\n          LIMIT 1\n        ";
            $result = $wpdb->get_results($querystr);
            $post_id = $result[0]->post_id;
            if ($post_id) {
                $post['ID'] = $post_id;
                create_tax($tax_args);
                insert_post_tax($post_id, $tax_args);
                wp_update_post($post);
                delete_post_media($post_id);
                foreach ($meta_args as $key => $val) {
                    update_post_meta($post_id, $key, $val);
                }
                // foto's opslaan
                process_photos($post_id, $xml->afbeeldingen['afbeelding']);
                set_status(1);
            } else {
                set_status(0);
            }
            break;
            /* -------------------------------------------------------- *\
                 DELETE
               \* -------------------------------------------------------- */
        /* -------------------------------------------------------- *\
             DELETE
           \* -------------------------------------------------------- */
        case 'delete':
            // Voertuig verwijderen uit database
            global $wpdb;
            // TODO: Use constant in query
            $querystr = "SELECT post_id \n          FROM {$wpdb->postmeta} \n          WHERE meta_key = 'occasion_hexon_nr' AND meta_value = '{$xml->voertuignr_hexon}'\n          LIMIT 1\n        ";
            $result = $wpdb->get_results($wpdb->prepare($querystr));
            $post_id = $result[0]->post_id;
            if ($post_id) {
                delete_post_media($post_id);
                foreach ($meta_args as $key => $val) {
                    delete_post_meta($post_id, $key);
                }
                wp_delete_post($post_id, true);
                set_status(1);
            } else {
                set_status(0);
            }
//.........这里部分代码省略.........
开发者ID:daanbakker1995,项目名称:lba-doorlinken-voorraad,代码行数:101,代码来源:doorlinkenvoorraad.php

示例11: foreach

    $count = 1;
    foreach ($my_quotes_list as $res) {
        $user_id = $res->user_id;
        $quote_id = $res->quote_id;
        $user_fname = $res->user_fname;
        $registration_no = $res->registration_no;
        $subject_name = $res->subject_name;
        $status = $res->status_id;
        echo "<tr>";
        echo "<td>" . $count++ . "</td>";
        echo "<td>" . $res->user_fname . "</td>";
        echo "<td>" . $res->registration_no . "</td>";
        echo "<td>" . $res->subject_name . "</td>";
        echo "<td> <center> {$res->no_of_license}  " . set_add_button($user_fname, $registration_no, $subject_name, $status) . "</center></td>";
        echo "<td>" . $res->discount_amount . "</td>";
        echo "<td> <center><small class='badge " . bgcolor($status) . "'>" . set_status($status) . "</small></center></td>";
        // echo "<td> <button type='button' class='btn btn-success' onclick='associate_subscribe_subject(\"$quote_id\");'> Pay </button>";
        // echo "<button type='button' class='btn btn-danger' onclick='remove_aoi(\"$quote_id\");'> Delete </button> </td>";
        echo "</tr>";
    }
}
function set_add_button($user_fname, $registration_no, $subject_name, $status)
{
    switch ($status) {
        case '6':
            return "<button class='btn btn-success' data-toggle='modal' data-target='#addLicense' onClick='request_license(\"{$user_fname}\",\"{$registration_no}\",\"{$subject_name}\")'> <i class='fa fa-plus'></i></button>";
            break;
        default:
            # code...
            break;
    }
开发者ID:sriram1991,项目名称:SHARE,代码行数:31,代码来源:request_quotation_area.php

示例12: intval

        $schedid = intval($schedid);
        if ($schedid > 0) {
            system("sudo /usr/share/ossim/scripts/vulnmeter/cancel_scan.pl {$schedid}");
        }
        break;
    case "play_task":
        $omp->play_task($job_id);
        break;
    case "pause_task":
        $omp->pause_task($job_id);
        break;
    case "stop_task":
        $omp->stop_task($job_id);
        break;
    case "resume_task":
        $omp->resume_task($job_id);
        break;
    case "delete_task":
        $omp->delete_task($job_id);
        break;
    case "delete":
        delete_sched($schedid);
        break;
    case "setstatus":
        set_status($schedid, $enabled);
        break;
    default:
        main_page(1, $sortby, $sortdir);
        break;
}
require_once "footer.php";
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:manage_jobs.php

示例13: fopen

        $fh = fopen($file, 'w+');
        fputs($fh, md5(mt_rand(10, 789)));
        fclose($fh);
        //Подключаемся к фтп-хосту
        $ftp_con = @ftp_connect($ftp_host);
        $login = @ftp_login($ftp_con, $ftp_login, $ftp_pass);
        if (!$ftp_con || !$login) {
            //echo'Невозможно соединиться с удаленным хостом';
            set_status('hosts', $id, 'host_status', 'error');
            continue;
        }
        ftp_pasv($ftp_con, $passive_mode);
        //flush;
        //Заливаем файл на хост.
        if ($ftp_dir != '') {
            $remote_file_path = $ftp_dir . '/' . $fname;
            // print_r($remote_file_path);
        } else {
            $remote_file_path = $fname;
        }
        $upload = @ftp_put($ftp_con, $remote_file_path, $file, FTP_BINARY);
        if (!$upload) {
            echo 'Не удается залить файл на хост';
            set_status('hosts', $id, 'host_status', 'error');
        } else {
            set_status('hosts', $id, 'host_status', 'allow');
        }
    }
    unlink($file);
    header("Location: http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
}
开发者ID:ivrm,项目名称:mbgdorgen,代码行数:31,代码来源:mails.php

示例14: server_delete

    if ($action == 'delete') {
        $id = $_GET['id'];
        $server = server_delete($link, $id, $game_name);
        if ($game_name == 'orders') {
            header("Location: index.php?orders=true");
        } else {
            header("Location: index.php?game=" . $game_name);
        }
    } else {
        if ($action == 'edit') {
            $id = (int) $_GET['id'];
            if (!empty($_POST) && $id > 0) {
                server_edit($link, $id, $game_name, $_POST['server_name'], $_POST['1kk'], $_POST['100kk'], $_POST['1000kk']);
                header("Location: index.php?game={$game_name}");
            }
            $server = server_get($id, $link, $game_name);
            //include("../views/server_admin.php");
        }
    }
}
if (isset($_GET['orders'])) {
    if (isset($_POST['data'])) {
        $data = json_decode($_POST['data'], true);
        set_status($link, $data[1], $data[0]);
    }
    $orders = orders_get($link);
    include "../views/admin_panel_orders.php";
} else {
    $servers = servers_all($link, $game_name);
    include_once "../views/admin_panel.php";
}
开发者ID:123cmp,项目名称:lineageSite,代码行数:31,代码来源:index.php

示例15: foreach

{
    foreach ($params as $param) {
        if (!isset($_POST[$param])) {
            return false;
        }
    }
    return true;
}
switch ($method) {
    case "POST":
        $data = $_POST;
        break;
    case "PUT":
        $data = [];
        parse_str(file_get_contents("php://input"), $data);
        break;
    default:
        $data = NULL;
        break;
}
if (in_array($endpoint, $valid_endpoints)) {
    include "endpoints/" . $endpoint . ".php";
} else {
    set_status(404, $STR["endpoint_404"]);
}
$json = json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
if (isset($_GET["callback"])) {
    $json = $_GET["callback"] . "({$json});";
}
print $json;
exit;
开发者ID:hrn4n,项目名称:argon,代码行数:31,代码来源:api.php


注:本文中的set_status函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。