Exemplo n.º 1
0
    if ($password1 != '' || $password2 != '') {
        if ($password1 != $password2) {
            $err = "<b>Password</b> does not match";
        }
        if (strlen($password1) < 5) {
            $err = "<b>Password</b> must be greater than 6 letters";
        }
    }
    if ($err != "") {
        echo "<span class='label label-important'><i class='icon-info-sign'></i> {$err}</span>";
    } else {
        if ($password1 == '' && $password2 == '') {
            $password = $db->getone("select password from users where id={$id}");
        } else {
            $password = md5($password1);
        }
        $sql = "update users set `password` = '{$password}',`phone`='{$phone}' where id={$id}";
        $res = $db->query($sql);
        if (PEAR::isError($res)) {
            $status[] = $res->getຂໍ້​ຄວາມ();
        }
        if (count($status) > 0) {
            $statu = implode(', ', $status);
            echo "<span class='label label-important'>\n\t\t\t\t\t\t<i class='icon-bug'></i> Get some error. Let technicians know this.\n\t\t\t\t\t</span>";
        } else {
            $statu = "OKIE";
            echo "\n\t\t\t\t\t<span class='label label-success'><i class='icon-ok-sign'></i> <b>{$username}</b> has ອັບ​ເດດd!</span>\n\t\t\t\t\t<script language='javascript'>\n\t\t\t\t\t\tloadform('includes/acc/acc_user_db.php?lang=<?php echo {$lang} ?>','#entry','#loadtext');\n\t\t\t\t\t</script>\n\t\t\t\t";
        }
        weblog($sql, "Edit user {$username} with status: {$statu}");
    }
}
Exemplo n.º 2
0
}
$rown = $db->getone("SELECT count(*) FROM `users` WHERE `username` = '{$username}'");
if ($rown > 0 || $username == 'itpro') {
    $err = "<b>Username</b> already exist";
}
if (strlen($username) < 2) {
    $err = "<b>Username</b> must include at least 3 characters";
}
if ($username == '') {
    $err = "<b>Username</b> can't be blank";
}
$permission .= ",{$role}";
//Them permission trung ten voi role, quan ly tuong duong
if ($err != "") {
    echo "<span class='label label-important'><i class='icon-info-sign'></i> {$err}</span>";
} else {
    $password = md5($password1);
    $sql = "insert into users(`username`,`password`,`phone`,`role`,`permission`) \n\t\t\t\t\t\tvalues('{$username}','{$password}','{$phone}','{$role}','{$permission}')";
    $res = $db->query($sql);
    if (PEAR::isError($res)) {
        $status[] = $res->getຂໍ້​ຄວາມ();
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> Get some error. Let technicians know this.\n\t\t\t\t</span>";
    } else {
        $statu = "OKIE";
        echo "\n\t\t\t\t<span class='label label-success'><i class='icon-ok-sign'></i> <b>{$username}</b> has added!</span>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\tloadform('includes/sadmin/sadmin_user_db.php?lang=<?php echo {$lang} ?>','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
    }
    weblog($sql, "Add User {$username} with status: {$statu}");
}
Exemplo n.º 3
0
        $status[] = "Can't move sound file.";
    }
    if ($status[0] != "Can't move sound file." && $filetype == 'wav') {
        /*$convertfile = "/sounds/tree/musics/$y/$m/$d/$filename";
        		try{
        			ini_set("soap.wsdl_cache_enabled", "0");
        			$client = new SoapClient('http://10.10.1.54:8080/axis2/services/treeFadaoWS?wsdl');
        			$result = $client->convert_wav2mp3(array('wav_file'=>$convertfile));
        			$info = $result->return;
        			$filename = $info;
        		}catch (Exception $e) {
        			print('SoapResult error:'.$e->getຂໍ້​ຄວາມ());
        		}*/
    }
    $content = "{$y}/{$m}/{$d}/{$filename}";
    $sql = "insert into ivr (`parrent`,`name`,`key_pressed`,`content`,`com_id`) values ('{$parrent}','{$name}','{$key_pressed}','{$content}','{$com_id}')";
    $res = $db->query($sql);
    if (PEAR::isError($res)) {
        $status[] = $res->getຂໍ້​ຄວາມ();
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<div class='alert alert-error'>\n\t\t\t\t\t<i class='icon-bug'></i> Get some error. Let technicians know this.\n\t\t\t\t</div>";
    } else {
        $statu = "OKIE";
        echo "<div class='alert alert-success'><i class='icon-ok-sign'></i> <b>{$name}</b> has added!</div>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\t\$('input[name=uploadedfile]').val('');\n\t\t\t\t\tloadform('includes/ivr/ivr_tree_db.php?lang=<?php echo {$lang} ?>','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
    }
    weblog($sql, "Add IVR node {$name} with status: {$statu}");
} else {
    echo "<div class='alert alert-error'><i class='icon-info-sign'></i> {$err}</div>";
}
Exemplo n.º 4
0
            if ($status[0] != "Can't move sound file." && $filetype == 'wav') {
                /*$convertfile = "/sounds/tree/musics/$y/$m/$d/$filename";
                		try{
                			ini_set("soap.wsdl_cache_enabled", "0");
                			$client = new SoapClient('http://10.10.1.54:8080/axis2/services/treeFadaoWS?wsdl');
                			$result = $client->convert_wav2mp3(array('wav_file'=>$convertfile));
                			$info = $result->return;
                			$filename = $info;
                		}catch (Exception $e) {
                			print('SoapResult error:'.$e->getຂໍ້​ຄວາມ());
                		}*/
            }
            $content = "{$y}/{$m}/{$d}/{$filename}";
        }
        $sql = "update `ivr` set `name` = '{$name}',`key_pressed` = '{$key_pressed}',`content` = '{$content}' where id={$id}";
        //die($sql);
        $res = $db->query($sql);
        if (PEAR::isError($res)) {
            $status[] = $res->getຂໍ້​ຄວາມ();
        }
        if (count($status) > 0) {
            $statu = implode(', ', $status);
            echo "<div class='alert alert-error'>\n\t\t\t\t\t\t<i class='icon-bug'></i> Get some error. Let technicians know this.\n\t\t\t\t\t</div>";
        } else {
            $statu = "OKIE";
            echo "<div class='alert alert-success'><i class='icon-ok-sign'></i> {$name} is updated!</div>\n\t\t\t\t\t<script language='javascript'>\n\t\t\t\t\t\tloadform('includes/ivr/ivr_tree_db.php?lang=<?php echo {$lang} ?>','#entry','#loadtext');\n\t\t\t\t\t\t\$('#queue').html('<input type=hidden class=medium name=\"content\" value=\"{$content}\">');\n\t\t\t\t\t</script>\n\t\t\t\t";
            //unlink("../../contents/ivr/$oldpath");
        }
        weblog($sql, "ອັບ​ເດດ song width id {$id} with status: {$statu}");
    }
}
Exemplo n.º 5
0
    if (strlen($username) < 2) {
        $err = "<b>Username</b> must include at least 3 characters";
    }
    if ($username == '') {
        $err = "<b>Username</b> can't be blank";
    }
    $permission .= ",{$role}";
    //Them permission trung ten voi role, quan ly tuong duong
    if ($err != "") {
        echo "<span class='label label-important'><i class='icon-info-sign'></i> {$err}</span>";
    } else {
        if ($password1 == '' && $password2 == '') {
            $password = $db->getone("select password from users where id={$id}");
        } else {
            $password = md5($password1);
        }
        $sql = "update users set `username` = '{$username}',`password` = '{$password}',`phone`='{$phone}',\n\t\t`role` = '{$role}',`permission`='{$permission}' where id={$id}";
        $res = $db->query($sql);
        if (PEAR::isError($res)) {
            $status[] = $res->getຂໍ້​ຄວາມ();
        }
        if (count($status) > 0) {
            $statu = implode(', ', $status);
            echo "<span class='label label-important'>\n\t\t\t\t\t<i class='icon-bug'></i> Get some error. Let technicians know this.\n\t\t\t\t</span>";
        } else {
            $statu = "OKIE";
            echo "\n\t\t\t\t<span class='label label-success'><i class='icon-ok-sign'></i> <b>{$username}</b> has ອັບ​ເດດd!</span>\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\tloadform('includes/sadmin/sadmin_user_db.php?lang=<?php echo {$lang} ?>','#entry','#loadtext');\n\t\t\t\t</script>\n\t\t\t";
        }
        weblog($sql, "Edit User ID {$id} with status: {$statu}");
    }
}
Exemplo n.º 6
0
<?php

include '../../config.php';
ensure_permission('sadmin');
ensure_role('sadmin');
if (isset($_REQUEST['submit'])) {
    $res = $db->query("select * from usssd_params");
    while ($res->fetchInto($row)) {
        $value = isset($_REQUEST[$row['param_name']]) ? $_REQUEST[$row['param_name']] : $_POST[$row['param_name']];
        if (is_array($value)) {
            $value = implode(',', $value);
        }
        $res2 = $db->query("UPDATE usssd_params SET param_value='{$value}' WHERE param_name='{$row['param_name']}'");
        if (PEAR::isError($res2)) {
            $status[] = $res2->getຂໍ້​ຄວາມ();
        }
    }
    if (count($status) > 0) {
        $statu = implode(', ', $status);
        echo "<span class='label label-important'>\n\t\t\t\t<i class='icon-bug'></i> Get some error. Let technicians know this.\n\t\t\t</span>";
    } else {
        $statu = "OKIE";
        echo "<span class='label label-success'><i class='icon-ok-sign'></i> ອັບ​ເດດ success fully!</span>\n\t\t\t";
    }
    weblog('Many sql', "ອັບ​ເດດ system setting with status: {$statu}");
}