Example #1
0
         if ($pol['config']['elecciones_estado'] != 'elecciones') {
             mysql_query("UPDATE users SET partido_afiliado = '" . $_POST['partido'] . "' WHERE ID = '" . $pol['user_ID'] . "' LIMIT 1", $link);
             mysql_query("DELETE FROM " . SQL . "partidos_listas WHERE user_ID = '" . $pol['user_ID'] . "'", $link);
             evento_log_OLD(9, $_POST['partido']);
         }
         $refer_url = 'perfil/' . $pol['nick'] . '/';
         break;
     case 'crear-partido':
         $_POST['siglas'] = preg_replace("/[^[a-z-]/i", "", $_POST['siglas']);
         $ya_es_presidente = false;
         $result = mysql_query("SELECT ID FROM " . SQL . "partidos WHERE ID_presidente = '" . $pol['user_ID'] . "'", $link);
         while ($r = mysql_fetch_array($result)) {
             $ya_es_presidente = true;
         }
         if ($pol['config']['elecciones_estado'] != 'elecciones' and strlen($_POST['siglas']) <= 12 and strlen($_POST['siglas']) >= 2 and nucleo_acceso($vp['acceso']['crear_partido']) and $_POST['nombre'] and $ya_es_presidente == false) {
             $_POST['descripcion'] = gen_text($_POST['descripcion']);
             mysql_query("INSERT INTO " . SQL . "partidos \r\n(ID_presidente, fecha_creacion, siglas, nombre, descripcion, estado) \r\nVALUES ('" . $pol['user_ID'] . "', '" . $date . "', '" . strtoupper($_POST['siglas']) . "', '" . $_POST['nombre'] . "', '" . $_POST['descripcion'] . "', 'ok')\r\n", $link);
             $result = mysql_query("SELECT ID FROM " . SQL . "partidos WHERE siglas = '" . $_POST['siglas'] . "' LIMIT 1", $link);
             while ($r = mysql_fetch_array($result)) {
                 $partido_ID = $r['ID'];
             }
             evento_log_OLD(3, $partido_ID);
         }
         // actualizar info en theme
         $result = mysql_query("SELECT COUNT(ID) AS num FROM " . SQL . "partidos WHERE estado = 'ok'", $link);
         while ($r = mysql_fetch_array($result)) {
             mysql_query("UPDATE " . SQL . "config SET valor = '" . $r['num'] . "' WHERE dato = 'info_partidos' LIMIT 1", $link);
         }
         $refer_url = 'partidos/';
         break;
 }
Example #2
0
 function __construct()
 {
     dom_div::__construct();
     $this->etype = 'progress_cell';
     $this->css_class = 'progress_cell';
     editor_generic::addeditor('anchor', new progress_cell_a());
     $this->append_child($this->editors['anchor']);
     $name_div = new dom_div();
     $name_div->css_class = 'progress_cell_header';
     $this->append_child($name_div);
     if ($_SESSION['progress_edit']) {
         editor_generic::addeditor('name_text', new editor_textarea());
         $this->editors['name_text']->attributes['rows'] = 2;
     } else {
         editor_generic::addeditor('name_text', new editor_statictext());
     }
     $name_div->append_child($this->editors['name_text']);
     $description_div = new dom_div();
     $description_div->css_style['background-color'] = 'white';
     $this->append_child($description_div);
     if ($_SESSION['progress_edit']) {
         editor_generic::addeditor('description_text', new editor_textarea());
     } else {
         editor_generic::addeditor('description_text', new editor_statichtml());
     }
     $description_div->append_child($this->editors['description_text']);
     editor_generic::addeditor('subtargets', new progress_cell_subtargets());
     $this->append_child($this->editors['subtargets']);
     if ($_SESSION['progress_edit']) {
         editor_generic::addeditor('del', new editor_button());
         $this->append_child($this->editors['del']);
         $this->editors['del']->attributes['value'] = '-';
         editor_generic::addeditor('inprogress', new editor_checkbox());
         $this->append_child($this->editors['inprogress']);
         $this->append_child(gen_text('wip'));
         editor_generic::addeditor('isdone', new editor_checkbox());
         $this->append_child($this->editors['isdone']);
         $this->append_child(gen_text('done'));
         editor_generic::addeditor('add_sub', new editor_pick_button());
         $this->append_child($this->editors['add_sub']);
         $this->editors['add_sub']->list_class = 'progress_cell_editor_dep_list';
     } else {
         $this->inprogress = new dom_div();
         $this->inprogress->css_style['background-color'] = 'yellow';
         $this->append_child($this->inprogress);
         $txt = new dom_statictext();
         $txt->text = 'В разработке';
         $this->inprogress->append_child($txt);
         $this->isdone = new dom_div();
         $this->isdone->css_style['background-color'] = 'green';
         $this->append_child($this->isdone);
         $txt = new dom_statictext();
         $txt->text = 'Готово';
         $this->isdone->append_child($txt);
     }
 }