} } function confirm_notice($snt) { $msg = gen_total_msg($snt); echo_msg($msg); $confirm = ask_y_or_n("Are you sure to send the above message?"); if ($confirm) { echo "Comment mail will be sent.\n\n"; send($msg); } else { echo "Comment mail is cancelled.\n\n"; } } function manual() { echo "Welcome to S&T comment system.\n\n"; $snt = select_snt(); confirm_notice($snt); echo "Bye.\n"; } if ($argc === 1) { manual(); } else { if ($argv[1] === "auto") { auto(); } else { my_log(__FILE__, "Command arguments are invalid\n"); exit(1); } }
function autocomplete_TipAse_Nombre() { try { $info = auto("tipo_aseguradora", "TipAse_Id", "TipAse_Nombre", $this->input->get('term')); $this->output->set_content_type('application/json')->set_output(json_encode($info)); } catch (exception $e) { } finally { } }
function autocomplete_tipDoc_Descripcion() { $info = auto("tipo_documento", "tipDoc_tipo", "tipDoc_Descripcion", $this->input->get('term')); $this->output->set_content_type('application/json')->set_output(json_encode($info)); }
$snt = select_snt(); $is_fst = select_is_fst(); confirm_notice($is_fst, $snt); echo "Bye.\n"; } function auto($is_fst) { if ($is_fst) { $snts = snts_n_days_later(6); } else { $snts = snts_n_days_later(2); } foreach ($snts as $snt) { $msg = gen_snt_msg($is_fst, $snt); send_notice($is_fst, $snt, $msg); } } if ($argc === 1) { manual(); } else { if ($argv[1] === "fst") { auto(true); } else { if ($argv[1] === "snd") { auto(false); } else { my_log(__FILE__, "Command arguments are invalid\n"); exit(1); } } }
function autocompletarresponsable() { try { $info = auto("planes", "pla_id", "pla_nombre", $this->input->get('term')); $this->output->set_content_type('application/json')->set_output(json_encode($info)); } catch (exception $e) { } finally { } }
function autocomplete_TipCon_Descripcion() { try { $this->db->where('activo', 'S'); $info = auto("tipo_contrato", "TipCon_Id", "TipCon_Descripcion", $this->input->get('term')); $this->output->set_content_type('application/json')->set_output(json_encode($info)); } catch (exception $e) { } finally { } }
function autocompletarapellido() { $info = auto("empleado", "Emp_Id", "Emp_Apellido", $this->input->get('term')); $this->output->set_content_type('application/json')->set_output(json_encode($info)); }
function guardar_auto($f_tipo, $valores, $proyecto, $subtipo) { if ($f_tipo != "proyectos") { if (count($valores) > 0) { foreach ($valores as $id_ => $valor) { //echo $id_."-->".$valor."<br>"; $s_ = "select * from configuracion where seccion='aprobaciones' and nombre='{$id_}'"; $r_ = mysql_query($s_); if (mysql_num_rows($r_) > 0) { $s_1 = "update configuracion set valor='{$valor}' where nombre='{$id_}' and seccion='aprobaciones'"; $r_1 = mysql_query($s_1); } else { $s_1 = "inset into configuracion VALUES ('', 'aprobaciones', '{$id_}', 'Horas para aprobacion automatica por division', 'aprobacion_auto', "; $s_1 .= "'{$valor}', '1')"; $r_1 = mysql_query($s_1); } } } auto($f_tipo, $f_proyecto); } else { if ($subtipo == "formulario") { $s_ = "select * from autorizaciones_auto where id_proyecto='{$proyecto}' and activo='1'"; $r_ = mysql_query($s_); if (mysql_num_rows($r_) > 0) { echo "<script>alert('Error, registro duplicado!');</script>"; nuevo_auto("proyectos", $f_proyecto, $proyecto); } else { $s_1 = "select nombre from proyectos where id='{$proyecto}'"; $r_1 = mysql_query($s_1); $d_1 = mysql_fetch_array($r_1); $nombre = $d_1['nombre']; $s_1 = "insert into autorizaciones_auto values('','{$proyecto}','{$nombre}','{$valores}','1')"; $r_1 = mysql_query($s_1); auto($f_tipo, $f_proyecto); } } else { if (count($valores) > 0) { foreach ($valores as $id_ => $valor) { $s_ = "select * from autorizaciones_auto where id='{$id_}'"; $r_ = mysql_query($s_); $s_1 = "update autorizaciones_auto set horas='{$valor}' where id='{$id_}'"; $r_1 = mysql_query($s_1); } } auto($f_tipo, $f_proyecto); } } }