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


PHP msg_error函数代码示例

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


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

示例1: exec_fichier_sql

function exec_fichier_sql($fichier, $link)
{
    global $l;
    $db_file = $fichier;
    $dbf_handle = @fopen($db_file, "r");
    echo "<br>";
    if (!$dbf_handle) {
        msg_error($l->g(2112) . " : " . $fichier);
        return true;
    } else {
        if (filesize($db_file) > 0) {
            $sql_query = fread($dbf_handle, filesize($db_file));
            fclose($dbf_handle);
            $data_sql = explode(";", $sql_query);
            foreach ($data_sql as $k => $v) {
                if (trim($v) != "") {
                    echo ".";
                    ob_flush();
                    flush();
                    mysql2_query_secure($v, $link);
                }
            }
            return false;
        }
        return true;
    }
}
开发者ID:GeorgeAlexandre,项目名称:OCSInventory-ocsreports,代码行数:27,代码来源:install.php

示例2: add_update_key

function add_update_key($form_values, $update = false)
{
    global $l;
    foreach ($form_values as $key => $value) {
        if (trim($value) == "") {
            msg_error($l->g(988));
            return FALSE;
        }
    }
    if ($update) {
        $req = "UPDATE regconfig SET " . "NAME='%s'," . "REGTREE='%s'," . "REGKEY='%s'," . "REGVALUE='%s' " . "where ID='%s'";
        $arg_req = array($form_values["NAME"], $form_values["REGTREE"], $form_values["REGKEY"], $form_values["REGVALUE"], $update);
    } else {
        $sql_verif = "select ID from regconfig \n\t\t\t\t\t\twhere REGTREE='%s' \n\t\t\t\t\t\t\tand REGKEY='%s'\n\t\t\t\t\t\t\tand REGVALUE='%s'";
        $arg_verif = array($form_values["REGTREE"], $form_values["REGKEY"], $form_values["REGVALUE"]);
        $res = mysql2_query_secure($sql_verif, $_SESSION['OCS']["readServer"], $arg_verif);
        $row = mysql_fetch_object($res);
        if (!is_numeric($row->ID)) {
            $req = "INSERT INTO regconfig (NAME,REGTREE,REGKEY,REGVALUE)\n\t\t\t\t\tVALUES('%s','%s','%s','%s')";
            $arg_req = array($form_values["NAME"], $form_values["REGTREE"], $form_values["REGKEY"], $form_values["REGVALUE"]);
        } else {
            msg_error($l->g(987));
            return FALSE;
        }
    }
    if (isset($req)) {
        mysql2_query_secure($req, $_SESSION['OCS']["writeServer"], $arg_req);
        if ($update) {
            msg_success($l->g(1185));
        } else {
            msg_success($l->g(1184));
        }
        return TRUE;
    }
}
开发者ID:inkoss,项目名称:karoshi-server,代码行数:35,代码来源:function_regconfig.php

示例3: remove_profile

function remove_profile($profile_id)
{
    global $l;
    if (!is_writable(DOCUMENT_REAL_ROOT . '/config/profiles')) {
        msg_error($l->g(2116));
    } else {
        unlink(DOCUMENT_REAL_ROOT . '/config/profiles/' . $profile_id . '.xml');
    }
}
开发者ID:stweil,项目名称:OCSInventory-ocsreports,代码行数:9,代码来源:profile_functions.php

示例4: exec_plugin_soap_client

/**
 * @param unknown $name : PluginName
 * @param unknown $action : Possible actions => delete (0) and install (1)
 */
function exec_plugin_soap_client($name, $action)
{
    global $l;
    $champs = array('OCS_SERVER_ADDRESS' => 'OCS_SERVER_ADDRESS');
    $values = look_config_default_values($champs);
    $address = $values['tvalue']['OCS_SERVER_ADDRESS'];
    if (class_exists('SoapClient')) {
        plugin_soap_client($name, $action);
    } else {
        msg_error($l->g(6006));
    }
}
开发者ID:stweil,项目名称:OCSInventory-ocsreports,代码行数:16,代码来源:functions_webservices.php

示例5: exist_server

function exist_server($list_id)
{
    global $l;
    $sql = "SELECT count(hardware_id) c,group_id,name \n\t\t  FROM download_servers,hardware\n\t\t\twhere hardware.id=download_servers.group_id\n\t\t\tand hardware_id in ";
    $arg = mysql2_prepare($sql, array(), $list_id);
    $res = mysql2_query_secure($arg['SQL'] . " group by group_id ", $_SESSION['OCS']["readServer"], $arg['ARG']);
    $msg = "";
    while ($val = mysql_fetch_array($res)) {
        $msg .= $val['c'] . " " . $l->g(1135) . " " . $val['name'] . "<br>";
    }
    if ($msg != "") {
        msg_error($l->g(877) . " <br>" . $msg . " " . $l->g(878));
    }
}
开发者ID:inkoss,项目名称:karoshi-server,代码行数:14,代码来源:function_server.php

示例6: migrate_profiles_2_2

function migrate_profiles_2_2()
{
    if (!file_exists(DOCUMENT_REAL_ROOT . '/config/profiles')) {
        mkdir(DOCUMENT_REAL_ROOT . '/config/profiles');
    }
    if (!is_writable(DOCUMENT_REAL_ROOT . '/config/profiles')) {
        msg_error($l->g(2116));
        exit;
    }
    $txt_serializer = new TxtProfileSerializer();
    $xml_serializer = new XMLProfileSerializer();
    foreach (scandir($_SESSION['OCS']['CONF_PROFILS_DIR']) as $file) {
        if (preg_match('/^(.+)_config\\.txt$/', $file, $matches) and $matches[1] != '4all') {
            $profile_name = $matches[1];
            $profile_data = read_profil_file($profile_name);
            $profile = $txt_serializer->unserialize($profile_name, $profile_data);
            $xml = $xml_serializer->serialize($profile);
            file_put_contents(DOCUMENT_REAL_ROOT . '/config/profiles/' . $profile_name . '.xml', $xml);
        }
    }
}
开发者ID:remicollet,项目名称:OCSInventory-ocsreports,代码行数:21,代码来源:include.php

示例7: exec_fichier_sql

function exec_fichier_sql($fichier)
{
    $db_file = $fichier;
    $dbf_handle = @fopen($db_file, "r");
    if (!$dbf_handle) {
        msg_error($l->g(2112) . " : " . $fichier);
        return true;
    } else {
        if (filesize($db_file) > 0) {
            $sql_query = fread($dbf_handle, filesize($db_file));
            fclose($dbf_handle);
            $data_sql = explode(";", $sql_query);
            foreach ($data_sql as $k => $v) {
                if (trim($v) != "") {
                    mysql2_query_secure($v, $_SESSION['OCS']["writeServer"]);
                }
            }
            return false;
        }
        return true;
    }
}
开发者ID:stweil,项目名称:OCSInventory-ocsreports,代码行数:22,代码来源:update.php

示例8: desactive_download_option

    if (trim($protectedPost['MOTIF'])) {
        if ($protectedPost["ACTION"] == "again") {
            //delete all info of specific teledeploy
            desactive_download_option($systemid, $protectedGet['affect_again']);
            active_option('DOWNLOAD', $systemid, $protectedGet['affect_again']);
        } elseif ($protectedPost["ACTION"] == "reset") {
            desactive_packet($systemid, $protectedGet['affect_reset']);
        }
        mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg);
        if (mysql_affected_rows() != 0) {
            $sql = "INSERT INTO itmgmt_comments (hardware_id,comments,user_insert,date_insert,action) \n\t\t\t\t\tvalues ('%s','%s','%s',%s,'%s => %s')";
            $arg = array($systemid, $protectedPost['MOTIF'], $_SESSION['OCS']["loggeduser"], "sysdate()", $protectedPost["ACTION"], $protectedPost['NAME_PACK']);
            mysql2_query_secure($sql, $_SESSION['OCS']["writeServer"], $arg);
        }
    } else {
        msg_error($l->g(903));
    }
}
if ($protectedPost['Reset_modif_x']) {
    unset($protectedGet['affect_again'], $protectedGet['affect_reset']);
}
if ($protectedGet['affect_again'] or $protectedGet['affect_reset']) {
    if ($protectedGet['affect_again']) {
        $id_pack_affect = $protectedGet['affect_again'];
        $hidden_action = 'again';
        $title_action = $l->g(904);
        $lbl_action = $l->g(905);
    } else {
        $id_pack_affect = $protectedGet['affect_reset'];
        $hidden_action = 'reset';
        $title_action = $l->g(906);
开发者ID:inkoss,项目名称:karoshi-server,代码行数:31,代码来源:cd_configuration.php

示例9: mysql_query

     $sql_rules = "select distinct rule,rule_name from download_affect_rules order by 1";
     $res_rules = mysql_query($sql_rules, $_SESSION['OCS']["readServer"]) or die(mysql_error($_SESSION['OCS']["readServer"]));
     $nb_rule = 0;
     while ($val_rules = mysql_fetch_array($res_rules)) {
         $first = $val_rules['rule'];
         $list_rules[$val_rules['rule']] = $val_rules['rule_name'];
         $nb_rule++;
     }
     if ($nb_rule > 1) {
         $select_choise = $l->g(668) . show_modif($list_rules, 'rule_choise', 2, $form_name);
         echo $select_choise;
     } elseif ($nb_rule == 1) {
         $protectedPost['rule_choise'] = $first;
         echo "<input type=hidden value='" . $first . "' name='rule_choise' id='rule_choise'>";
     } elseif ($nb_rule == 0) {
         msg_error($l->g(982));
     }
 }
 if ($protectedPost['onglet'] == 'MACH') {
     echo $l->g(1292) . show_modif(array('NO' => $l->g(454), 'YES' => $l->g(455)), 'DWL_OPT', 2, $form_name);
 }
 if ($protectedPost['onglet'] == 'MACH' and $protectedPost['DWL_OPT'] != '' or $protectedPost['onglet'] == 'SERV_GROUP' and $protectedPost['rule_choise'] != '') {
     //recherche de toutes les r�gles pour les serveurs de redistribution
     $list_fields = array('FILE_ID' => 'e.FILEID', 'INFO_LOC' => 'e.INFO_LOC', 'CERT_FILE' => 'e.CERT_FILE', 'CERT_PATH' => 'e.CERT_PATH', $l->g(1037) => 'a.NAME', $l->g(1039) => 'a.PRIORITY', $l->g(51) => 'a.COMMENT', $l->g(274) => 'a.OSNAME', $l->g(953) . " (KB)" => 'a.SIZE');
     if (!isset($nb_rule) or $nb_rule > 0) {
         if ($protectedPost['onglet'] != 'SERV_GROUP') {
             $list_fields['PACK_LOC'] = 'e.PACK_LOC';
             $list_fields['ACTIVE_ID'] = 'e.ID';
             $list_fields['MODIF'] = 'e.ID';
         } else {
             $list_fields['ACTIVE_ID'] = 'e.FILEID';
开发者ID:inkoss,项目名称:karoshi-server,代码行数:31,代码来源:ms_custom_pack.php

示例10: show_users_left_menu

// OCS INVENTORY REPORTS
// Copyleft Erwan GOALOU 2010 (erwan(at)ocsinventory-ng(pt)org)
// Web: http://www.ocsinventory-ng.org
//
// This code is open source and may be copied and modified as long as the source
// code is always made freely available.
// Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt
//====================================================================================
global $l;
if (!AJAX) {
    require_once 'views/users_views.php';
    require_once 'views/profile_create_form.php';
    show_users_left_menu('ms_add_profile');
    echo '<div class="right-content">';
    if (!is_writable(DOCUMENT_REAL_ROOT . '/config/profiles')) {
        msg_error($l->g(2116));
    } else {
        show_profile_create_form();
    }
    echo '</div>';
} else {
    require_once 'lib/profile_functions.php';
    if (!is_writable(DOCUMENT_REAL_ROOT . '/config/profiles')) {
        $response = array('status' => 'error', 'message' => $l->g(2116));
    } else {
        if ($errors = validate_profile_create_form($_POST)) {
            $response = array('status' => 'error', 'message' => $l->g(1404), 'errors' => $errors);
        } else {
            if ($profile_id = create_profile($_POST)) {
                $response = array('status' => 'success', 'message' => $l->g(1405), 'profile_id' => $profile_id);
            } else {
开发者ID:remicollet,项目名称:OCSInventory-ocsreports,代码行数:31,代码来源:ms_add_profile.php

示例11: msg_error

                } else {
                    echo '<div class="plugin-frame plugin-name-' . $plugin->getId() . '">';
                    require $plugin_file;
                    echo '</div>';
                }
            }
        }
    }
} else {
    if (isset($protectedGet['option']) and isset($plugins[$protectedGet['option']])) {
        // If specific plugin
        $plugin = $plugins[$protectedGet['option']];
        $plugin_file = PLUGINS_DIR . "computer_detail/" . $plugin->getId() . "/" . $plugin->getId() . ".php";
        if (file_exists($plugin_file)) {
            if (!$ajax) {
                echo '<div class="plugin-frame plugin-name-' . $plugin->getId() . '">';
            }
            require $plugin_file;
            if (!$ajax) {
                echo '</div>';
            }
        }
    } else {
        // Else error
        msg_error('Page not found');
    }
}
echo '</div>';
if ($ajax) {
    ob_end_clean();
}
开发者ID:remicollet,项目名称:OCSInventory-ocsreports,代码行数:31,代码来源:ms_computer.php

示例12: while

         }
         /*if ($protectedPost['NB_COMPUTERS'] === 1)
         		$protectedPost['NB_COMPUTERS']='';*/
         $i = 0;
         while ($i < $protectedPost['NB_COMPUTERS']) {
             $id_computer = insert_manual_computer($protectedPost, $protectedPost['NB_COMPUTERS']);
             if (!is_array($fields)) {
                 $fields[] = 'TAG';
                 $values_fields[] = '';
             }
             insertinfo_computer($id_computer, $fields, $values_fields);
             $i++;
         }
         msg_success($l->g(881));
     } else {
         msg_error($l->g(684) . "<br>" . $error);
     }
 }
 $i = 0;
 $info_form['FIELDS']['name_field'][$i] = 'NB_COMPUTERS';
 $info_form['FIELDS']['type_field'][$i] = 0;
 $info_form['FIELDS']['value_field'][$i] = $protectedPost['NB_COMPUTERS'] != '' ? $protectedPost['NB_COMPUTERS'] : '1';
 $info_form['FIELDS']['tab_name'][$i] = $l->g(28);
 $config[$i]['CONFIG']['SIZE'] = 4;
 $config[$i]['CONFIG']['MAXLENGTH'] = 4;
 $other_data['COMMENT_BEHING'][$i] = '';
 $config[$i]['CONFIG']['JAVASCRIPT'] = $chiffres;
 foreach ($form_fields_typeinput as $key => $value) {
     $i++;
     $info_form['FIELDS']['name_field'][$i] = $key;
     $info_form['FIELDS']['type_field'][$i] = 0;
开发者ID:inkoss,项目名称:karoshi-server,代码行数:31,代码来源:ms_local.php

示例13: add_rule

function add_rule($RULE_NAME, $RULE_VALUES, $ID_RULE = '')
{
    global $l, $protectedPost;
    $rule_exist = verify_name($RULE_NAME);
    if ($rule_exist == 'NAME_NOT_EXIST') {
        //verify this id is new
        $sql = "select id from download_affect_rules where id='%s'";
        $arg = $ID_RULE;
        $result_id = mysql2_query_secure($sql, $_SESSION['OCS']["readServer"], $arg);
        $id_exist = mysqli_fetch_object($result_id);
        //generate id
        if (!is_numeric($ID_RULE) or $ID_RULE == '' or isset($id_exist->id)) {
            $sql_new_id = "select max(RULE) as ID_RULE from download_affect_rules";
            $result_new_id = mysql2_query_secure($sql_new_id, $_SESSION['OCS']["readServer"]);
            $new_id = mysqli_fetch_object($result_new_id);
            $ID_RULE = $new_id->ID_RULE;
            $ID_RULE++;
        }
        //insert new rule
        $i = 1;
        while ($RULE_VALUES['PRIORITE_' . $i]) {
            if ($RULE_VALUES['CFIELD_' . $i] != "") {
                $sql_insert_rule = "insert into download_affect_rules (RULE,RULE_NAME,PRIORITY,CFIELD,OP,COMPTO,SERV_VALUE) \n\t\t\t\tvalue (%s,'%s',%s,'%s','%s','%s','%s')";
                $arg = array($ID_RULE, $protectedPost['RULE_NAME'], $RULE_VALUES['PRIORITE_' . $i], $RULE_VALUES['CFIELD_' . $i], $RULE_VALUES['OP_' . $i], $RULE_VALUES['COMPTO_' . $i], $RULE_VALUES['COMPTO_TEXT_' . $i]);
                mysql2_query_secure($sql_insert_rule, $_SESSION['OCS']["writeServer"], $arg);
            }
            $i++;
        }
    } else {
        echo msg_error($l->g(670));
    }
}
开发者ID:stweil,项目名称:OCSInventory-ocsreports,代码行数:32,代码来源:function_rules.php

示例14: count

$year_mouth['Sep'] = 9;
$year_mouth['Aug'] = 8;
$year_mouth['Jul'] = 7;
$year_mouth['Jun'] = 6;
$year_mouth['May'] = 5;
$year_mouth['Apr'] = 4;
$year_mouth['Mar'] = 3;
$year_mouth['Feb'] = 2;
$year_mouth['Jan'] = 1;
$sql = "select count(*) c from devices d,\n\t\t\t\t\t\t\tdownload_enable d_e,download_available d_a\n\t\t\t\t\t\twhere d.name='DOWNLOAD'\n\t\t\t\t\t\t\tand d_e.id=d.ivalue\n\t\t\t\t\t\t\tand d_a.fileid=d_e.fileid\n\t\t\t\t\t\t\tand d_e.fileid='%s'";
$arg = $protectedGet['stat'];
$result = mysql2_query_secure($sql, $_SESSION['OCS']["readServer"], $arg);
$item = mysql_fetch_object($result);
$total_mach = $item->c;
if ($total_mach <= 0) {
    msg_error($l->g(837));
    require_once FOOTER_HTML;
    die;
}
$sql = "select d.hardware_id as id,d.comments as date_valid \n\t\t\t\t\tfrom devices d,download_enable d_e,download_available d_a\n\t\t\twhere d.name='DOWNLOAD' \n\t\t\t\tand tvalue='%s' \n\t\t\t\tand comments is not null\n\t\t\t\tand d_e.id=d.ivalue\n\t\t\t\tand d_a.fileid=d_e.fileid\n\t\t\t\tand d_e.fileid='%s'";
$arg = array(urldecode($protectedGet['ta']), $protectedGet['stat']);
$result = mysql2_query_secure($sql, $_SESSION['OCS']["readServer"], $arg);
$nb_4_hour = array();
//$total_mach=0;
while ($item = mysql_fetch_object($result)) {
    //echo $item->date_valid."<br>";
    unset($data_temp, $day, $year, $hour_temp, $hour);
    $data_temp = explode(' ', $item->date_valid);
    if ($data_temp[2] != '') {
        $day = $data_temp[2];
    } else {
开发者ID:inkoss,项目名称:karoshi-server,代码行数:31,代码来源:ms_speed_stat.php

示例15: backup_server

                if (!preg_match("/^[a-zA-Z0-9._-]+\$/", $user)) {
                    $msg = _gameserver_user_invalid . "<br>";
                    $error = true;
                }
                if (exists_entry("name", "backup_server", "name", $name) == true) {
                    $error = true;
                    $msg = _template_exists;
                }
                if ($error == false) {
                    $stmt = $mysqli->prepare("INSERT INTO backup_server(name,type,ip,port,user,password) VALUES (?,?,?,?,?,?)");
                    $stmt->bind_param('sssiss', $name, $type, $ip, $port, $user, $password);
                    $stmt->execute();
                    $stmt->close();
                    msg_okay(_backup_message_added);
                } else {
                    msg_error('Something went wrong, ' . $msg);
                }
            }
        }
        ?>

                  <form class="form-horizontal" action="index.php?page=backup?add" method="post">
                    <div class="form-group">
                      <label class="control-label col-sm-2">Name:</label>
                      <div class="col-sm-6">
                        <input type="text" class="form-control input-sm" name="name" placeholder="Chewbacca">
                      </div>
                    </div>
                    <div class="form-group">
                      <label class="control-label col-sm-2">IP/Port:</label>
                      <div class="col-sm-3">
开发者ID:sollidius,项目名称:Prometheus,代码行数:31,代码来源:backup.php


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