本文整理汇总了PHP中messages::get_msg方法的典型用法代码示例。如果您正苦于以下问题:PHP messages::get_msg方法的具体用法?PHP messages::get_msg怎么用?PHP messages::get_msg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类messages
的用法示例。
在下文中一共展示了messages::get_msg方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_persona
function add_persona()
{
$fun = new funciones();
$msg = new messages();
$response = new StdClass();
/*recibimos variables*/
$tipo = $_POST['tipo'];
$nombre = $_POST['nombre'];
$ced = $_POST['ced'];
$lic = $_POST['lic'];
$lic_v = $_POST['lic_v'];
$dir = $_POST['dir'];
$tel = $_POST['tel'];
$cel = $_POST['cel'];
$f1 = $_POST['f1'];
$f2 = $_POST['f2'];
$placa = $_POST['placa'];
if ($tipo == 1) {
$placa = "0";
}
if ($nombre == "") {
$res = false;
$mes = $msg->get_msg("e005");
} else {
$con = new con();
$con->connect();
/* verificamos que no esté registrado en la tabla de personas*/
$res_existe = $fun->existe("personas", "pe_cedula", $ced);
if (!$res_existe) {
/* ingresamos datos de la persona */
$qry = "INSERT INTO tbl_personas \n\t\t\t\t(pe_nombre, pe_tel, pe_cedula, pe_licencia, pe_licencia_vigencia, pe_dir, pe_cel, pe_tipo, pe_created, pe_estado, pe_f1, pe_f2, pe_ve_id) \n\t\t\t\tVALUES \n\t\t\t\t('" . $nombre . "', '" . $tel . "', '" . $ced . "', '" . $lic . "', '" . $lic_v . "', '" . $dir . "', '" . $cel . "', '" . $tipo . "', " . $_SESSION["ses_id"] . ", 1 , '" . $f1 . "', '" . $f2 . "', " . $placa . ");";
//echo "QUERY: ".$qry;
$resp = mysql_query($qry);
if (!$resp) {
$res = false;
$mes = $msg->get_msg("e003");
} else {
$res = true;
$mes = $msg->get_msg("e004");
}
} else {
$res = false;
$mes = $msg->get_msg("e003-1", "El usuario ya existe");
}
}
$response->res = $res;
$response->mes = $mes;
echo json_encode($response);
$con->disconnect();
}
示例2: login
function login()
{
$msg = new messages();
$fun = new funciones();
if (!$fun->isAjax()) {
header("Location: login.php");
}
$con = new con();
$con->connect();
$response = new StdClass();
$usu = $_POST['usr'];
$pass = $_POST['psw'];
$pass = sha1(md5($pass));
/*Consulta a la Bd*/
$selectSQL = "SELECT * FROM `tbl_users` WHERE `us_usuario` = '{$usu}' AND `us_clave` = '{$pass}' AND us_estado = 1";
$row_cons = mysql_query($selectSQL);
$existe = mysql_fetch_assoc($row_cons);
/*Termina Consulta*/
/*Existe*/
//$existe = 1;
if ($existe) {
$res = true;
$mes = "panel.html";
$_SESSION["ses_id"] = $existe['us_id'];
//$menu = 1;
} else {
$res = false;
$mes = $msg->get_msg("e002");
}
$response->res = $res;
$response->mes = $mes;
echo json_encode($response);
$con->disconnect();
}
示例3: change_pack
function change_pack()
{
$fun = new funciones();
$msg = new messages();
$response = new StdClass();
/*recibimos variables*/
$act = $_POST["a"];
$id = $_POST["id"];
if ($act == "" || $id == "") {
$res = false;
$mes = $msg->get_msg("e005");
} else {
$con = new con();
$con->connect();
if ($act == 1) {
//activar, cambiar a 99
if ($fun->borrar("remisiones_fisicas", "rf_id", $id)) {
$res = true;
$mes = $msg->get_msg("e004");
} else {
$res = false;
$mes = $msg->get_msg("e003-1", "Activando remision.");
}
} else {
//desactivar, cambiar a 1
if ($fun->activar("remisiones_fisicas", "rf_id", $id)) {
$res = true;
$mes = $msg->get_msg("e004");
} else {
$res = false;
$mes = $msg->get_msg("e003-1", "Desactivando remision.");
}
}
}
$response->res = $res;
$response->mes = $mes;
echo json_encode($response);
$con->disconnect();
}
示例4: remove_user
function remove_user()
{
$fun = new funciones();
$msg = new messages();
$response = new StdClass();
/*recibimos variables*/
$user = $_POST["user"];
$res = $fun->borrar("vehiculos", "ve_id", $user);
if ($res) {
$res = true;
$mes = $msg->get_msg("e004");
} else {
$res = false;
$mes = $msg->get_msg("e022");
}
$response->res = $res;
$response->mes = $mes;
echo json_encode($response);
}
示例5: load_row
function load_row()
{
$fun = new funciones();
$msg = new messages();
$response = new StdClass();
/*recibimos variables*/
$id = $_POST["id"];
if ($id == "") {
$res = false;
$mes = $msg->get_msg("e005");
} else {
$con = new con();
$con->connect();
//traemos datos según sea el id
$qry = "SELECT * FROM `tbl_remisiones_fisicas` WHERE rf_id =" . $id . ";";
$data = $fun->get_array($qry);
if ($data != false) {
$res = true;
$response->key = $data[0]['rf_id'];
$response->ini = $data[0]['rf_dig_ini'];
$response->fin = $data[0]['rf_dig_fin'];
$response->inter = $data[0]['rf_interventor'];
$response->persona = $data[0]['rf_persona_entrega'];
} else {
$res = false;
$response->mes = $msg->get_msg("e034");
}
}
$response->res = $res;
echo json_encode($response);
$con->disconnect();
}
示例6: json_encode
$con = new con();
$con->connect();
$response = new StdClass();
$usu = $_POST['user'];
$pass = $_POST['pass'];
$pass = sha1(md5($pass));
/* $pass_encriptada1 = md5 ($pass); //Encriptacion nivel 1
$pass_encriptada2 = crc32($pass_encriptada1); //Encriptacion nivel 1
$pass_encriptada3 = sha1("xtemp".$pass_encriptada2); //Encriptacion nivel 3
$pass_encriptada4 = crypt($pass_encriptada3, "xtemp"); //Encriptacion nivel 2 */
/*Consulta a la Bd*/
$selectSQL = "SELECT * FROM `tbl_usuarios` WHERE `us_usuario` = '{$usu}' AND `us_clave` = '{$pass}'";
$row_cons = mysql_query($selectSQL);
$existe = mysql_fetch_assoc($row_cons);
/*Termina Consulta*/
/*Existe*/
//$existe = 1;
if ($existe) {
$res = true;
$mes = $msg->get_msg("e001");
$_SESSION["ses_id"] = $existe['us_id'];
$_SESSION["ses_tipo"] = $existe['us_tipo'];
//$menu = 1;
} else {
$res = false;
$mes = $msg->get_msg("e002");
}
$response->res = $res;
$response->mes = $mes;
echo json_encode($response);
$con->disconnect();
示例7: del_persona
function del_persona()
{
$fun = new funciones();
$msg = new messages();
$response = new StdClass();
/*recibimos variables*/
$id = $_POST["id"];
$con = new con();
$con->connect();
/* ingresamos datos de la finca */
$tbl = "personas";
$cambios = "pe_estado=99";
$where = "pe_id=" . $id;
$r = $fun->actualizar($tbl, $cambios, $where);
if ($r) {
$res = true;
$mes = $msg->get_msg("e004");
} else {
$res = false;
$mes = $msg->get_msg("e035");
}
$response->res = $res;
$response->mes = $mes;
echo json_encode($response);
$con->disconnect();
}
示例8: con
function programar_rutas()
{
$con = new con();
$msg = new messages();
$fun = new funciones();
$con->connect();
//Fecha
date_default_timezone_set("America/Bogota");
$fecha = date('Y-m-d G:i:s');
$filename = "R_" . date('YmdGis');
$filename .= ".html";
$content = "";
$hoy = date('Y-m-d');
$content .= "<h1>Informe, generacion de rutas</h1>";
$content .= "<br>Fecha " . $fecha . "<br>";
//traemos municipios
$qry_sn = "SELECT * FROM tbl_subnucleos ORDER BY sn_id ASC";
$res_sn = $fun->get_array($qry_sn);
if (!$res_sn) {
$content .= $msg->get_msg("e025");
} else {
//($res_sn);
//cantidad de sn:
$cant_sn = count($res_sn);
$content .= "Total Municipios: " . $cant_sn . "<br>";
for ($i = 0; $i < $cant_sn; $i++) {
$content .= "<h1>municipio nro: " . $res_sn[$i]["sn_id"] . "";
$content .= "=> " . $res_sn[$i]["sn_subnucleo"] . "</h1><br>";
//traemos conductores asociados
$qry_con = 'SELECT * FROM tbl_personas
INNER JOIN tbl_vehiculos ON ve_id = pe_ve_id
WHERE
pe_f1 = ' . $res_sn[$i]["sn_id"] . ' OR
pe_f2 = ' . $res_sn[$i]["sn_id"] . '
;';
//$content.= $qry_con;
/*HACE FALTA LA DOBLE VALIDACIÓN DE QUE ESTE NO ESTÉ ASIGNADO O SUGERIDO A OTRA FINCA*/
$res_con = $fun->get_array($qry_con);
$cant_con = count($res_con);
$content .= "<br> cantidad de conductores: " . $cant_con;
//para cada subnucleo, listamos sus respectivas fincas
$qry_fin = 'SELECT * FROM tbl_fincas WHERE fi_sn_id = ' . $res_sn[$i]["sn_id"] . ';';
$res_fin = $fun->get_array($qry_fin);
//traemos inventarios por cada finca
$cant_fin = count($res_fin);
$content .= "<br> cantidad de fincas: " . $cant_fin . "<br>";
$arr_inv = array();
$pos = 0;
$c = 0;
for ($j = 0; $j < $cant_fin; $j++) {
$qry_inv = 'SELECT * FROM tbl_inventario WHERE in_fi_id = ' . $res_fin[$j]["fi_id"] . ' AND in_mt_restante > 0 AND in_estado=1;';
//$content.= $qry_inv;
$res_inv = $fun->get_array($qry_inv);
$c = count($res_inv);
if ($c > 1) {
$pos = $pos + $c;
for ($k = 0; $k < $pos; $k++) {
$arr_inv[$k] = $res_inv[$k];
}
}
if ($c == 1) {
$arr_inv[$pos] = $res_inv[0];
$pos++;
}
}
$cant_inv = count($arr_inv);
$content .= "<br> <h4>cantidad de inventarios de este municipio: " . $cant_inv . "</h4>";
/*$content.= "<pre>";
print_r($arr_inv);
$content.= "</pre>";*/
//traemos turnos
$qry_tur = 'SELECT * FROM tbl_turnos ORDER BY tu_id ASC';
$res_tur = $fun->get_array($qry_tur);
//variables de sesión para cada inventario
for ($ci = 0; $ci < $cant_inv; $ci++) {
$id_inv = $arr_inv[$ci]["in_id"];
$_SESSION[$id_inv]["inv_rest"] = $arr_inv[$ci]["in_mt_restante"];
//$content.= "<br>prueba variable sesion".$_SESSION[$id_inv]["inv_rest"];
}
//recorremos arreglo y vamos asignando conductores
if ($cant_inv > 0) {
$turno = 0;
$tg = 0;
for ($doblete = 0; $doblete < 2; $doblete++) {
$end = false;
$l = 0;
while ($end == false) {
for ($m = 0; $m < $cant_inv; $m++) {
if ($l == $cant_con) {
$end = true;
break;
}
//traemos inventario restante
//$inv_rest = $fun->get_custom("SELECT in_mt_restante FROM tbl_inventario WHERE in_id=".$arr_inv[$m]["in_id"]);
$inv_rest = $_SESSION[$arr_inv[$m]["in_id"]]["inv_rest"];
if ($inv_rest > 0) {
$inv_nuevo = $inv_rest - $res_con[$l]["ve_capacidad_m3"];
if ($inv_nuevo >= 0) {
$content .= "<pre>";
$content .= "<br> ----> [" . $l . "] asignando cond " . $res_con[$l]["pe_id"] . " (cap. " . $res_con[$l]["ve_capacidad_m3"] . "m<sup>3</sup>) a inventario " . $arr_inv[$m]["in_id"] . " en el turno (" . $turno . "): " . $res_tur[$turno]["tu_hora_ini"] . "\n\t\t\t\t \t\t\tinventario restante: " . $inv_nuevo;
//.........这里部分代码省略.........
示例9: get_cap
function get_cap()
{
$fun = new funciones();
$msg = new messages();
$response = new StdClass();
/*recibimos variables*/
$cod = $_POST["cod"];
$lote = $_POST["lote"];
$qry_cap = "SELECT vol_ica_m3 FROM `tbl_matriz_ica` \n\t\t\t\t\tINNER JOIN tbl_fincas ON fi_codigo = codfinca\n\t\t\t\t\tINNER JOIN tbl_lotes_autorizados ON la_idlote = idlote\n\t\t\t\t\tWHERE fi_id = '" . $cod . "' AND la_id = " . $lote;
$res_cap = $fun->get_array($qry_cap);
if ($res_cap) {
//$fun->print_array($res_inv);
$res = true;
$mes = $res_cap[0]['vol_ica_m3'];
} else {
$res = false;
$mes = $msg->get_msg("e030");
}
$response->res = $res;
$response->mes = $mes;
echo json_encode($response);
}
示例10: upd_vehiculo
function upd_vehiculo()
{
$fun = new funciones();
$msg = new messages();
$response = new StdClass();
/*recibimos variables*/
$id = $_POST['id'];
$vh = $_POST['vh'];
$con = new con();
$con->connect();
$t = "personas";
$c = "pe_ve_id=" . $vh;
$w = "pe_id=" . $id;
$resp = $fun->actualizar($t, $c, $w);
if ($resp) {
$res = true;
$mes = $msg->get_msg("e004");
} else {
$res = false;
$mes = $msg->get_msg("e036");
}
$con->disconnect();
$response->res = $res;
$response->mes = $mes;
echo json_encode($response);
}
示例11: remove_finca
function remove_finca()
{
$fun = new funciones();
$msg = new messages();
$response = new StdClass();
/*recibimos variables*/
$finca = $_POST["finca"];
if ($fun->borrar("fincas", "fi_id", $finca)) {
if ($fun->borrar("inventario", "in_fi_id", $finca)) {
if ($fun->borrar("control_inventarios", "ci_fi_id", $finca)) {
if ($fun->borrar("lotes_autorizados", "la_fi_id", $finca)) {
$res = true;
$mes = $msg->get_msg("e004");
} else {
$res = false;
$mes = $msg->get_msg("e016");
}
} else {
$res = false;
$mes = $msg->get_msg("e017");
}
} else {
$res = false;
$mes = $msg->get_msg("e018");
}
} else {
$res = false;
$mes = $msg->get_msg("e015");
}
$response->res = $res;
$response->mes = $mes;
echo json_encode($response);
}
示例12: upd_despacho
function upd_despacho()
{
$fun = new funciones();
$msg = new messages();
$response = new StdClass();
/*recibimos variables*/
$de_id = $_POST['id'];
$opt = $_POST['op'];
switch ($opt) {
case 1:
$estado = 2;
break;
case 2:
$estado = 3;
break;
case 3:
$estado = 99;
break;
}
$con = new con();
$con->connect();
//preguntamos si existe el despacho y si está sugerido
$existe = $fun->existe("despachos", "de_id", $de_id, "");
if ($existe) {
if ($opt == 1) {
$qry_des = 'SELECT * FROM tbl_despachos WHERE de_id=' . $de_id . ';';
//echo "despachos: ".$qry_des;
$arr_des = $fun->get_array($qry_des);
//$fun->print_array($arr_des);
//traemos inventario
$qry_inv = 'SELECT * FROM tbl_inventario WHERE in_id =' . $arr_des[0]["de_in_id"] . ';';
//echo "despachos: ".$qry_inv;
$arr_inv = $fun->get_array($qry_inv);
//$fun->print_array($arr_inv);
//tomamos datos y los modificamos
$inv_nuevo = $arr_inv[0]["in_mt_restante"] - $arr_des[0]['de_ve_capacidad_m3'];
//echo "<br>nuevo inventario: ".$inv_nuevo;
//realizar la actualización
$upd_vol = $fun->actualizar("inventario", "in_mt_restante =" . $inv_nuevo, "in_id = " . $arr_inv[0]["in_id"]);
}
$res_upd = $fun->actualizar("despachos", "de_estado=" . $estado, "de_id=" . $de_id);
if ($res_upd) {
$res = true;
$mes = $msg->get_msg('e004');
} else {
$res = false;
$mes = $msg->get_msg('e027');
}
} else {
$res = false;
$mes = $msg->get_msg('e028');
}
$con->disconnect();
$response->res = $res;
$response->mes = $mes;
echo json_encode($response);
}
示例13: books
if (isset($_POST["opt"])) {
$bk = new books();
$response = new StdClass();
$mes = new messages();
$fun = new funciones();
switch ($_POST["opt"]) {
case 'add':
$title = $_POST["title"];
$isbn = $_POST["isbn"];
$autor = $_POST["autor"];
$genre = $_POST["genre"];
$release = $_POST["release"];
$res = $bk->add($title, $isbn, $autor, $genre, $release);
if ($res) {
$response->res = true;
$response->mes = $mes->get_msg("e004");
} else {
$response->res = false;
$response->mes = $mes->get_msg("e003");
}
break;
case 'list':
$res = $bk->display_list();
if ($res) {
$response->res = true;
$response->mes = $res;
} else {
$response->res = false;
$response->mes = $mes->get_msg("e005");
}
break;