示例#1
0
    }
    //end each
}
//end if
#fin de filtros
//FILTRO DE BUSQUEDA POR 3 COLUMNAS
if (trim($_POST['query']) != "") {
    $value = $_POST['query'];
    $where = " AND (uname LIKE '%{$value}%' OR email LIKE '%{$value}%' OR id='{$value}') ";
}
if (trim($where) == '') {
    $where = " AND status = 1 ";
}
$return = array();
$i = 0;
if ($usuarios = oob_user::search('all', 'uname', $where, $start, $count)) {
    foreach ($usuarios as $u) {
        $return[$i]['id'] = $u->get('user');
        $return[$i]['uname'] = $u->name();
        $return[$i]['email'] = $u->get('email');
        $return[$i]['status'] = oob_user::getStatus($u->get('status'));
        $i++;
    }
}
$result = array();
$result["totalCount"] = oob_user::searchCount("all", $where);
$result["topics"] = $return;
//RESULTADO
$obj_comunication = new OOB_ext_comunication();
$obj_comunication->set_data($result);
$obj_comunication->send(true, true);
示例#2
0
if (isset($_POST['txt_pass'])) {
    if ($_POST['txt_pass'] != "") {
        $usuario->set('password', $_POST['txt_pass']);
    }
} else {
    throw new OOB_Exception_400("La variable [txt_pass] no esta definida");
}
// email
if (isset($_POST['txt_email'])) {
    $usuario->set('email', $_POST['txt_email']);
} else {
    throw new OOB_Exception_400("La variable [txt_email] no esta definida");
}
// status
if (isset($_POST['cbo_estados'])) {
    $id_status = oob_user::getStatus($_POST['cbo_estados'], false);
    $usuario->set('status', $id_status);
} else {
    throw new OOB_Exception_400("La variable [cbo_estados] no esta definida");
}
if (!isset($_POST['txt_repetir'])) {
    throw new OOB_Exception_400("La variable [txt_repetir] no esta definida");
}
// tratamos de grabar si puso los dos pass iguales
if ($_POST['txt_pass'] === $_POST['txt_repetir']) {
    if ($usuario->store()) {
        $resultado["success"] = true;
    }
} else {
    // si queremos agregar una validacion extra al objeto, lo que hacemos es agregar el ID del error en caso de que no la pase
    $usuario->error()->addError("MISSMATCH");
示例#3
0
global $ari;
$handle = $ari->url->getVars();
$ari->t->caching = 0;
$ari->popup = true;
// valida pos
$pos = 0;
if (isset($_GET['pos']) && OOB_validatetext::isNumeric($_GET['pos']) && $_GET['pos'] > 0) {
    $pos = $_GET['pos'];
}
//levanta el limit
$modulo = new oob_module("personnel");
$limit = $modulo->config()->get('limit', 'employee');
$ari->t->assign('limit', $limit);
$ari->t->assign('total', oob_user::userCountNoAsigned());
$users = array();
if ($return = oob_user::listNoAssigned('uname', $pos, $limit)) {
    // show time
    $i = 0;
    foreach ($return as $u) {
        $users[$i]['id'] = $u->get('user');
        $users[$i]['uname'] = $u->name();
        $users[$i]['unameClean'] = OOB_validatetext::cleanToScript($u->name());
        $users[$i]['email'] = $u->get('email');
        $users[$i]['status'] = oob_user::getStatus($u->get('status'));
        ++$i;
    }
}
//end if
$ari->t->assign("users", $users);
// display
$ari->t->display($ari->module->admintpldir() . "/user_selectforemployee.tpl");
示例#4
0
global $ari;
$ari->popup = 1;
// no mostrar el main_frame
$page_size = PAGE_SIZE;
//STORE PARA TRAER EL LISTADO DE USUARIOS
$store = new PhpExt_Data_JsonStore();
$store->setUrl("/seguridad/user/get_users")->setRoot("topics")->setId("id")->setTotalProperty("totalCount");
//AGREGO LOS CAMPOS AL STORE
$store->addField(new PhpExt_Data_FieldConfigObject("id"));
$store->addField(new PhpExt_Data_FieldConfigObject("uname"));
$store->addField(new PhpExt_Data_FieldConfigObject("email"));
$store->addField(new PhpExt_Data_FieldConfigObject("status"));
$check_select = new PhpExt_Grid_CheckboxSelectionModel();
//Paso los estado a json
$estados = array();
foreach (oob_user::getStatus() as $id => $descripcion) {
    $estados[] = array($id, $descripcion);
}
$filter_plugin = new PhpExtUx_Grid_GridFilters();
$filter_plugin->addFilter(PhpExt_Grid_FilterConfigObject::createFilter("numeric", "id"));
$filter_plugin->addFilter(PhpExt_Grid_FilterConfigObject::createFilter("string", "uname"));
$filter_plugin->addFilter(PhpExt_Grid_FilterConfigObject::createFilter("string", "email"));
$filter_plugin->addFilter(PhpExt_Grid_FilterConfigObject::createFilter("list", "status", PhpExt_Javascript::variable(json_encode($estados)), PhpExt_Javascript::variable("1"), true));
$col_model = new PhpExt_Grid_ColumnModel();
$col_model->addColumn($check_select)->addColumn(PhpExt_Grid_ColumnConfigObject::createColumn("Id", "id", null, 40))->addColumn(PhpExt_Grid_ColumnConfigObject::createColumn("Usuario", "uname", null, 140))->addColumn(PhpExt_Grid_ColumnConfigObject::createColumn("Email", "email", null, 170))->addColumn(PhpExt_Grid_ColumnConfigObject::createColumn("Estado", "status"));
$paging = new PhpExt_Toolbar_PagingToolbar();
$paging->setStore($store)->setPageSize($page_size)->setDisplayInfo(true)->setEmptyMessage("No se encontraron usuarios");
$paging->getPlugins()->add($filter_plugin);
//GRILLA
$grid = new PhpExt_Grid_GridPanel();
$grid->setStore($store)->setSelectionModel($check_select)->setColumnModel($col_model)->setLoadMask(true)->setenableColLock(false);