Example #1
0
 /**
  * Buscar codigo en tablas temporales y las gestionadas
  */
 public function postValidacodigo()
 {
     if (Input::has('codactu')) {
         $codactu = Input::get('codactu');
         try {
             $row = Gestion::getRowgestiones($codactu);
         } catch (Exception $e) {
             $this->_errorController->saveError($exc);
             $msj = 'Ocurrió una interrupción en el registro del movimiento';
             return array('rst' => 0, 'datos' => $msj);
         }
         //si existe
         return Response::json(array('rst' => $row));
     }
     //vacio
     return Response::json(array('rst' => 0));
 }
Example #2
0
 /**
  * reenviar tarea de officetrack
  * POST /api/reenviarot
  * @param  int  gestion_id
  * @return Response
  */
 public function postReenviarot()
 {
     if (Input::has('gestion_id')) {
         Input::replace(array('buscar' => Input::get('gestion_id'), 'tipo' => 'g.id'));
         $result = Gestion::getCargar();
         $resultDos = array();
         if ($result['rst'] == '1') {
             $datos = $result['datos'][0];
             $resultDos['fh_agenda'] = $datos->fh_agenda;
             $resultDos['codactu'] = trim($datos->codactu . ' ');
             $resultDos['fecha_registro'] = trim($datos->fecha_registro . ' ');
             $resultDos['nombre_cliente'] = trim($datos->nombre_cliente . ' ');
             $resultDos['act_codmotivo_req_catv'] = trim($datos->codmotivo_req_catv . ' ');
             $resultDos['orden_trabajo'] = trim($datos->orden_trabajo . ' ');
             $resultDos['fftt'] = trim($datos->fftt . ' ');
             $resultDos['dir_terminal'] = trim($datos->dir_terminal . ' ');
             $resultDos['inscripcion'] = trim($datos->inscripcion . ' ');
             $resultDos['mdf'] = trim($datos->mdf . ' ');
             $resultDos['segmento'] = trim($datos->segmento . ' ');
             $resultDos['clase_servicio_catv'] = trim($datos->clase_servicio_catv . ' ');
             $resultDos['total_averias'] = trim($datos->total_averias . ' ');
             $resultDos['zonal'] = trim($datos->zonal . ' ');
             $resultDos['llamadastec15dias'] = trim($datos->llamadastec15dias . ' ');
             $resultDos['quiebre'] = trim($datos->quiebre . ' ');
             $resultDos['lejano'] = trim($datos->lejano . ' ');
             $resultDos['distrito'] = trim($datos->distrito . ' ');
             $resultDos['averia_m1'] = trim($datos->averia_m1 . ' ');
             $resultDos['telefono_codclientecms'] = trim($datos->telefono_codclientecms . ' ');
             $resultDos['area2'] = trim($datos->area2 . ' ');
             $resultDos['eecc_final'] = trim($datos->eecc_zona . ' ');
             $resultDos['gestion_id'] = trim($datos->id . ' ');
             $resultDos['estado'] = trim($datos->estado . ' ');
             $resultDos['velocidad'] = trim($datos->veloc_adsl . ' ');
             $resultDos['cr_observacion'] = trim($datos->observacion . ' ');
             //$resultDos['reenviar'] =trim( $datos->reenviar.' ');
             $resultDos['actividad'] = trim($datos->actividad . ' ');
             $resultDos['tecnico_id'] = trim($datos->tecnico_id . ' ');
             $resultDos['coordinado2'] = trim($datos->coordinado . ' ');
             $resultDos['direccion_instalacion'] = trim($datos->direccion_instalacion . ' ');
             $resultTres = Helpers::ruta('officetrack/procesarot', 'POST', $resultDos, false);
             return Response::json($resultTres);
         } else {
             return Response::json($result);
         }
     }
 }
 public function postRegistrar()
 {
     try {
         DB::beginTransaction();
         $returnArray = array("rst" => 0, "msj" => "No se realizaron cambios", "act" => null, "error" => "", "gestion_id" => "");
         if (Request::ajax() or Input::get('noajax')) {
             $gestionId = "";
             $cupos = true;
             if (Input::get('gestion_id')) {
                 $returnArray["act"] = "Nuevo movimiento creado";
                 $gestionId = Input::get('gestion_id');
                 $ultmov = DB::table('ultimos_movimientos')->where('gestion_id', '=', $gestionId)->first();
                 $ultimoMovimiento = UltimoMovimiento::find($ultmov->id);
                 $gestionesMovimientos = new GestionMovimiento();
                 $gestionesMovimientos["quiebre_id"] = Input::get('quiebre_id');
                 $gestionesMovimientos["gestion_id"] = Input::get('gestion_id');
                 $gestionesMovimientos["empresa_id"] = Input::get('empresa_id');
                 $gestionesMovimientos["zonal_id"] = Input::get('zonal_id');
                 $gestionesMovimientos["estado_id"] = Input::get('estado');
                 $gestionesMovimientos["motivo_id"] = Input::get('motivo');
                 $gestionesMovimientos["submotivo_id"] = Input::get('submotivo');
                 $gestionesMovimientos["observacion"] = Input::get('observacion2');
                 $gestionesMovimientos["coordinado"] = Input::get('coordinado2');
                 $ultimoMovimiento["quiebre_id"] = Input::get('quiebre_id');
                 $ultimoMovimiento["empresa_m_id"] = Input::get('empresa_id');
                 $ultimoMovimiento["zonal_id"] = Input::get('zonal_id');
                 $ultimoMovimiento["estado_id"] = Input::get('estado');
                 $ultimoMovimiento["motivo_id"] = Input::get('motivo');
                 $ultimoMovimiento["submotivo_id"] = Input::get('submotivo');
                 $ultimoMovimiento["observacion_m"] = Input::get('observacion2');
                 $ultimoMovimiento["coordinado"] = Input::get('coordinado2');
                 if (Input::get('flag_tecnico')) {
                     $ultimoMovimiento["flag_tecnico"] = Input::get('flag_tecnico');
                     $gestionesMovimientos["flag_tecnico"] = Input::get('flag_tecnico');
                 }
                 if (Input::get('horario_id') && Input::get('horario_id') != '') {
                     $gestionesMovimientos["horario_id"] = Input::get('horario_id');
                     $gestionesMovimientos["dia_id"] = Input::get('dia_id');
                     $gestionesMovimientos["fecha_agenda"] = Input::get('fecha_agenda');
                     $ultimoMovimiento["horario_id"] = Input::get('horario_id');
                     $ultimoMovimiento["dia_id"] = Input::get('dia_id');
                     $ultimoMovimiento["fecha_agenda"] = Input::get('fecha_agenda');
                 }
                 if (Input::get('tecnico') && Input::get('tecnico') != '') {
                     $gestionesMovimientos["celula_id"] = Input::get('celula');
                     $gestionesMovimientos["tecnico_id"] = Input::get('tecnico');
                     $ultimoMovimiento["celula_id"] = Input::get('celula');
                     $ultimoMovimiento["tecnico_id"] = Input::get('tecnico');
                 }
                 if (Input::get('fecha_consolidacion') && Input::get('fecha_consolidacion') != '') {
                     $gestionesMovimientos["fecha_consolidacion"] = Input::get('fecha_consolidacion');
                     $ultimoMovimiento["fecha_consolidacion"] = Input::get('fecha_consolidacion');
                 }
                 //Origen del movimiento realizado
                 $gestionesMovimientos["submodulo_id"] = 3;
                 if (Input::get('submodulo_id') !== null) {
                     $gestionesMovimientos["submodulo_id"] = Input::get('submodulo_id');
                 }
                 if (Input::get('usuario_sistema') !== null) {
                     $gestionesMovimientos['usuario_created_at'] = 697;
                 }
                 $gestionesMovimientos['estado_ofsc_id'] = '0';
                 $gestionesMovimientos['usuario_created_at'] = Auth::user()->id;
                 $gestionesMovimientos->save();
                 if (substr(Input::get('estado_agendamiento'), -2) == '-1') {
                     $gestionesDetalles = GestionDetalle::where('gestion_id', '=', $gestionId)->update(array('x' => Input::get('x'), 'y' => Input::get('y')));
                     $ultimoMovimiento['x'] = Input::get('x');
                     $ultimoMovimiento['y'] = Input::get('y');
                 }
                 $ultimoMovimiento['estado_ofsc_id'] = '0';
                 $ultimoMovimiento['usuario_updated_at'] = Auth::user()->id;
                 $ultimoMovimiento->save();
             } else {
                 $id = "";
                 $returnArray["act"] = "Nuevo registro creado";
                 $gestiones = new Gestion();
                 $ultimoMovimiento = new UltimoMovimiento();
                 $gestiones["actividad_id"] = Input::get('actividad_id');
                 $gestiones["nombre_cliente_critico"] = Input::get('nombre_cliente_critico');
                 $gestiones["telefono_cliente_critico"] = Input::get('telefono_cliente_critico');
                 $gestiones["celular_cliente_critico"] = Input::get('celular_cliente_critico');
                 $gestiones['usuario_created_at'] = Auth::user()->id;
                 $gestiones->save();
                 $ultimoMovimiento["actividad_id"] = Input::get('actividad_id');
                 $ultimoMovimiento["nombre_cliente_critico"] = Input::get('nombre_cliente_critico');
                 $ultimoMovimiento["telefono_cliente_critico"] = Input::get('telefono_cliente_critico');
                 $ultimoMovimiento["celular_cliente_critico"] = Input::get('celular_cliente_critico');
                 $ultimoMovimiento['usuario_created_at'] = Auth::user()->id;
                 $gestionId = $gestiones->id;
                 $id = $gestiones->id;
                 $gestiones["id_atc"] = "ATC_" . date("Y") . "_" . $id;
                 $gestiones->save();
                 $ultimoMovimiento["id_atc"] = "ATC_" . date("Y") . "_" . $id;
                 $gestionesDetalles = new GestionDetalle();
                 $gestionesDetalles["gestion_id"] = $id;
                 $gestionesDetalles["quiebre_id"] = Input::get('quiebre_id');
                 $gestionesDetalles["empresa_id"] = Input::get('empresa_id');
                 $gestionesDetalles["zonal_id"] = Input::get('zonal_id');
                 $gestionesDetalles["codactu"] = Input::get('codactu');
                 $gestionesDetalles["tipo_averia"] = Input::get('tipo_averia');
                 $gestionesDetalles["horas_averia"] = Input::get('horas_averia');
                 $gestionesDetalles["fecha_registro"] = Input::get('fecha_registro');
                 $gestionesDetalles["ciudad"] = Input::get('ciudad');
                 $gestionesDetalles["inscripcion"] = Input::get('inscripcion');
                 $gestionesDetalles["fono1"] = Input::get('fono1');
                 $gestionesDetalles["telefono"] = Input::get('telefono');
                 $gestionesDetalles["mdf"] = Input::get('mdf');
                 $gestionesDetalles["observacion"] = Input::get('observacion');
                 $gestionesDetalles["segmento"] = Input::get('segmento');
                 $gestionesDetalles["area"] = Input::get('area');
                 $gestionesDetalles["direccion_instalacion"] = Input::get('direccion_instalacion');
                 $gestionesDetalles["codigo_distrito"] = Input::get('codigo_distrito');
                 $gestionesDetalles["nombre_cliente"] = Input::get('nombre_cliente');
                 $gestionesDetalles["orden_trabajo"] = Input::get('orden_trabajo');
                 $gestionesDetalles["veloc_adsl"] = Input::get('veloc_adsl');
                 $gestionesDetalles["clase_servicio_catv"] = Input::get('clase_servicio_catv');
                 $gestionesDetalles["codmotivo_req_catv"] = Input::get('codmotivo_req_catv');
                 $gestionesDetalles["total_averias_cable"] = Input::get('total_averias_cable');
                 $gestionesDetalles["total_averias_cobre"] = Input::get('total_averias_cobre');
                 $gestionesDetalles["total_averias"] = Input::get('total_averias');
                 $gestionesDetalles["fftt"] = Input::get('fftt');
                 $gestionesDetalles["llave"] = Input::get('llave');
                 $gestionesDetalles["dir_terminal"] = Input::get('dir_terminal');
                 $gestionesDetalles["fonos_contacto"] = Input::get('fonos_contacto');
                 $gestionesDetalles["contrata"] = Input::get('contrata');
                 $gestionesDetalles["zonal"] = Input::get('zonal');
                 $gestionesDetalles["wu_nagendas"] = Input::get('wu_nagendas');
                 $gestionesDetalles["wu_nmovimientos"] = Input::get('wu_nmovimientos');
                 $gestionesDetalles["wu_fecha_ult_agenda"] = Input::get('wu_fecha_ult_agenda');
                 $gestionesDetalles["total_llamadas_tecnicas"] = Input::get('total_llamadas_tecnicas');
                 $gestionesDetalles["total_llamadas_seguimiento"] = Input::get('total_llamadas_seguimiento');
                 $gestionesDetalles["llamadastec15dias"] = Input::get('llamadastec15dias');
                 $gestionesDetalles["llamadastec30dias"] = Input::get('llamadastec30dias');
                 $gestionesDetalles["lejano"] = Input::get('lejano');
                 $gestionesDetalles["distrito"] = Input::get('distrito');
                 $gestionesDetalles["eecc_zona"] = Input::get('eecc_zona');
                 $gestionesDetalles["zona_movistar_uno"] = Input::get('zona_movistar_uno');
                 $gestionesDetalles["paquete"] = Input::get('paquete');
                 $gestionesDetalles["data_multiproducto"] = Input::get('data_multiproducto');
                 $gestionesDetalles["averia_m1"] = Input::get('averia_m1');
                 $gestionesDetalles["fecha_data_fuente"] = Input::get('fecha_data_fuente');
                 $gestionesDetalles["telefono_codclientecms"] = Input::get('telefono_codclientecms');
                 $gestionesDetalles["rango_dias"] = Input::get('rango_dias');
                 $gestionesDetalles["sms1"] = Input::get('sms1');
                 $gestionesDetalles["sms2"] = Input::get('sms2');
                 $gestionesDetalles["area2"] = Input::get('area2');
                 $gestionesDetalles["microzona"] = Input::get('microzona');
                 $gestionesDetalles["tipo_actuacion"] = Input::get('tipo_actuacion');
                 $gestionesDetalles["actividad_tipo_id"] = Input::get('actividad_tipo_id');
                 if (Input::get('x') and Input::get('y')) {
                     $gestionesDetalles["x"] = Input::get('x');
                     $gestionesDetalles["y"] = Input::get('y');
                     $ultimoMovimiento["x"] = Input::get('x');
                     $ultimoMovimiento["y"] = Input::get('y');
                 }
                 $gestionesDetalles['usuario_created_at'] = Auth::user()->id;
                 $gestionesDetalles->save();
                 /**********************************************************/
                 $ffttExplode = explode("|", Input::get('fftt'));
                 $tipoAExplode = explode("-", Input::get('tipo_averia'));
                 if (count($tipoAExplode) == 1) {
                     $tipoAExplode = explode("_", Input::get('tipo_averia'));
                 }
                 $arrayproadsl = array(1, 2, 4);
                 $arrayprocatv = array(5, 6, 7, 8, 9);
                 $arrayaveradsl = array(1, 2, 3, 14, 15, 16, 17, 9, 18, 19, 20);
                 $arrayaverbas = array(1, 2, 3, 10, 11, 12, 4, 9);
                 $arrayavercatv = array(5, 13, 6, 7, 8, 9);
                 $sqlttff = 'INSERT INTO gestiones_fftt (gestion_id,fftt_tipo_id,nombre) VALUES (?,?,?)';
                 if (in_array('aver', $tipoAExplode, true) and count($ffttExplode) > 1) {
                     if (in_array('adsl', $tipoAExplode, true)) {
                         for ($i = 0; $i < count($arrayaveradsl); $i++) {
                             $array = array($id, $arrayaveradsl[$i], trim($ffttExplode[$i]));
                             if (trim($ffttExplode[$i]) != '') {
                                 DB::insert($sqlttff, $array);
                             }
                         }
                     } elseif (in_array('bas', $tipoAExplode, true)) {
                         for ($i = 0; $i < count($arrayaverbas); $i++) {
                             $array = array($id, $arrayaverbas[$i], trim($ffttExplode[$i]));
                             if (trim($ffttExplode[$i]) != '') {
                                 DB::insert($sqlttff, $array);
                             }
                         }
                     } elseif (in_array('catv', $tipoAExplode, true)) {
                         for ($i = 0; $i < count($arrayavercatv); $i++) {
                             $array = array($id, $arrayavercatv[$i], trim($ffttExplode[$i]));
                             if (trim($ffttExplode[$i]) != '') {
                                 DB::insert($sqlttff, $array);
                             }
                         }
                     }
                 } elseif (in_array('prov', $tipoAExplode, true) and count($ffttExplode) > 1) {
                     if (in_array('adsl', $tipoAExplode, true) or in_array('bas', $tipoAExplode, true)) {
                         for ($i = 0; $i < count($arrayproadsl); $i++) {
                             if ($i == 1 and strtoupper(substr(trim($ffttExplode[$i]), 0, 1)) == 'A') {
                                 $array = array($id, $arrayproadsl[$i], trim($ffttExplode[$i]));
                             } elseif ($i == 1) {
                                 $array = array($id, 3, trim($ffttExplode[$i]));
                             } else {
                                 $array = array($id, $arrayproadsl[$i], trim($ffttExplode[$i]));
                             }
                             if (trim($ffttExplode[$i]) != '') {
                                 DB::insert($sqlttff, $array);
                             }
                         }
                     } elseif (in_array('catv', $tipoAExplode, true)) {
                         for ($i = 0; $i < count($arrayprocatv); $i++) {
                             $array = array($id, $arrayprocatv[$i], trim($ffttExplode[$i]));
                             if (trim($ffttExplode[$i]) != '') {
                                 DB::insert($sqlttff, $array);
                             }
                         }
                     }
                 }
                 /**********************************************************/
                 $ultimoMovimiento["gestion_id"] = $id;
                 $ultimoMovimiento["quiebre_id"] = Input::get('quiebre_id');
                 $ultimoMovimiento["empresa_id"] = Input::get('empresa_id');
                 $ultimoMovimiento["zonal_id"] = Input::get('zonal_id');
                 $ultimoMovimiento["codactu"] = Input::get('codactu');
                 $ultimoMovimiento["tipo_averia"] = Input::get('tipo_averia');
                 $ultimoMovimiento["horas_averia"] = Input::get('horas_averia');
                 $ultimoMovimiento["fecha_registro"] = Input::get('fecha_registro');
                 $ultimoMovimiento["ciudad"] = Input::get('ciudad');
                 $ultimoMovimiento["inscripcion"] = Input::get('inscripcion');
                 $ultimoMovimiento["fono1"] = Input::get('fono1');
                 $ultimoMovimiento["telefono"] = Input::get('telefono');
                 $ultimoMovimiento["mdf"] = Input::get('mdf');
                 $ultimoMovimiento["observacion"] = Input::get('observacion');
                 $ultimoMovimiento["segmento"] = Input::get('segmento');
                 $ultimoMovimiento["area"] = Input::get('area');
                 $ultimoMovimiento["direccion_instalacion"] = Input::get('direccion_instalacion');
                 $ultimoMovimiento["codigo_distrito"] = Input::get('codigo_distrito');
                 $ultimoMovimiento["nombre_cliente"] = Input::get('nombre_cliente');
                 $ultimoMovimiento["orden_trabajo"] = Input::get('orden_trabajo');
                 $ultimoMovimiento["veloc_adsl"] = Input::get('veloc_adsl');
                 $ultimoMovimiento["clase_servicio_catv"] = Input::get('clase_servicio_catv');
                 $ultimoMovimiento["codmotivo_req_catv"] = Input::get('codmotivo_req_catv');
                 $ultimoMovimiento["total_averias_cable"] = Input::get('total_averias_cable');
                 $ultimoMovimiento["total_averias_cobre"] = Input::get('total_averias_cobre');
                 $ultimoMovimiento["total_averias"] = Input::get('total_averias');
                 $ultimoMovimiento["fftt"] = Input::get('fftt');
                 $ultimoMovimiento["llave"] = Input::get('llave');
                 $ultimoMovimiento["dir_terminal"] = Input::get('dir_terminal');
                 $ultimoMovimiento["fonos_contacto"] = Input::get('fonos_contacto');
                 $ultimoMovimiento["contrata"] = Input::get('contrata');
                 $ultimoMovimiento["zonal"] = Input::get('zonal');
                 $ultimoMovimiento["wu_nagendas"] = Input::get('wu_nagendas');
                 $ultimoMovimiento["wu_nmovimientos"] = Input::get('wu_nmovimientos');
                 $ultimoMovimiento["wu_fecha_ult_agenda"] = Input::get('wu_fecha_ult_agenda');
                 $ultimoMovimiento["total_llamadas_tecnicas"] = Input::get('total_llamadas_tecnicas');
                 $ultimoMovimiento["total_llamadas_seguimiento"] = Input::get('total_llamadas_seguimiento');
                 $ultimoMovimiento["llamadastec15dias"] = Input::get('llamadastec15dias');
                 $ultimoMovimiento["llamadastec30dias"] = Input::get('llamadastec30dias');
                 $ultimoMovimiento["lejano"] = Input::get('lejano');
                 $ultimoMovimiento["distrito"] = Input::get('distrito');
                 $ultimoMovimiento["eecc_zona"] = Input::get('eecc_zona');
                 $ultimoMovimiento["zona_movistar_uno"] = Input::get('zona_movistar_uno');
                 $ultimoMovimiento["paquete"] = Input::get('paquete');
                 $ultimoMovimiento["data_multiproducto"] = Input::get('data_multiproducto');
                 $ultimoMovimiento["averia_m1"] = Input::get('averia_m1');
                 $ultimoMovimiento["fecha_data_fuente"] = Input::get('fecha_data_fuente');
                 $ultimoMovimiento["telefono_codclientecms"] = Input::get('telefono_codclientecms');
                 $ultimoMovimiento["rango_dias"] = Input::get('rango_dias');
                 $ultimoMovimiento["sms1"] = Input::get('sms1');
                 $ultimoMovimiento["sms2"] = Input::get('sms2');
                 $ultimoMovimiento["area2"] = Input::get('area2');
                 $ultimoMovimiento["microzona"] = Input::get('microzona');
                 $ultimoMovimiento["tipo_actuacion"] = Input::get('tipo_actuacion');
                 $gestionesMovimientos = new GestionMovimiento();
                 $gestionesMovimientos["gestion_id"] = $id;
                 $gestionesMovimientos["quiebre_id"] = Input::get('quiebre_id');
                 $gestionesMovimientos["empresa_id"] = Input::get('empresa_id');
                 $gestionesMovimientos["zonal_id"] = Input::get('zonal_id');
                 $gestionesMovimientos["estado_id"] = Input::get('estado');
                 $gestionesMovimientos["motivo_id"] = Input::get('motivo');
                 $gestionesMovimientos["submotivo_id"] = Input::get('submotivo');
                 $gestionesMovimientos["observacion"] = Input::get('observacion2');
                 $gestionesMovimientos["coordinado"] = Input::get('coordinado2');
                 $ultimoMovimiento["empresa_m_id"] = Input::get('empresa_id');
                 $ultimoMovimiento["estado_id"] = Input::get('estado');
                 $ultimoMovimiento["motivo_id"] = Input::get('motivo');
                 $ultimoMovimiento["submotivo_id"] = Input::get('submotivo');
                 $ultimoMovimiento["observacion_m"] = Input::get('observacion2');
                 $ultimoMovimiento["coordinado"] = Input::get('coordinado2');
                 if (Input::get('flag_tecnico')) {
                     $gestionesMovimientos["flag_tecnico"] = Input::get('flag_tecnico');
                     $ultimoMovimiento["flag_tecnico"] = Input::get('flag_tecnico');
                 }
                 if (Input::get('horario_id') && Input::get('horario_id') != '') {
                     $gestionesMovimientos["horario_id"] = Input::get('horario_id');
                     $gestionesMovimientos["dia_id"] = Input::get('dia_id');
                     $gestionesMovimientos["fecha_agenda"] = Input::get('fecha_agenda');
                     $ultimoMovimiento["horario_id"] = Input::get('horario_id');
                     $ultimoMovimiento["dia_id"] = Input::get('dia_id');
                     $ultimoMovimiento["fecha_agenda"] = Input::get('fecha_agenda');
                 }
                 if (Input::get('tecnico') && Input::get('tecnico') != '') {
                     $gestionesMovimientos["celula_id"] = Input::get('celula');
                     $gestionesMovimientos["tecnico_id"] = Input::get('tecnico');
                     $ultimoMovimiento["celula_id"] = Input::get('celula');
                     $ultimoMovimiento["tecnico_id"] = Input::get('tecnico');
                 }
                 if (Input::get('fecha_consolidacion') && Input::get('fecha_consolidacion') != '') {
                     $gestionesMovimientos["fecha_consolidacion"] = Input::get('fecha_consolidacion');
                     $ultimoMovimiento["fecha_consolidacion"] = Input::get('fecha_consolidacion');
                 }
                 //Origen del movimiento realizado
                 $gestionesMovimientos["submodulo_id"] = 3;
                 if (Input::get('submodulo_id') !== null) {
                     $gestionesMovimientos["submodulo_id"] = Input::get('submodulo_id');
                 }
                 //OFSC
                 $ultimoMovimiento["actividad_tipo_id"] = Input::get('actividad_tipo_id');
                 $gestionesMovimientos['estado_ofsc_id'] = '0';
                 $gestionesMovimientos['usuario_created_at'] = Auth::user()->id;
                 $gestionesMovimientos->save();
                 $ultimoMovimiento['estado_ofsc_id'] = '0';
                 $ultimoMovimiento['usuario_updated_at'] = Auth::user()->id;
                 $ultimoMovimiento['updated_at'] = date("Y-m-d H:i:s");
                 $ultimoMovimiento['usuario_created_at'] = Auth::user()->id;
                 $ultimoMovimiento->save();
             }
             $returnArray["gestion_id"] = $gestionId;
             $returnArray['gestion_movimiento_id'] = $gestionesMovimientos->id;
             DB::commit();
             $returnArray["rst"] = 1;
             $returnArray["msj"] = 'Registro realizado correctamente';
             $returnArray["error"] = "";
         }
         return $returnArray;
     } catch (Exception $exc) {
         DB::rollback();
         $returnArray["rst"] = 2;
         $returnArray["msj"] = 'Ocurrió un error en el registro';
         $returnArray["error"] = $exc->getMessage();
         return $returnArray;
     }
 }
Example #4
0
<?php

session_start();
include_once "BaseDeDonne.php";
include_once "BDClass.php";
$Gestion = new Gestion();
date_default_timezone_set('America/Montreal');
include_once "headpage.php";
$target_dir = "./Images/";
if (isset($_FILES['fichier'])) {
    $errors = array();
    $maxsize = 3145728;
    $acceptable = array('image/jpeg', 'image/jpg', 'image/gif', 'image/png');
    if ($_FILES['fichier']['size'] >= $maxsize) {
        $errors[] = 'Ce fichier est trop large.';
    }
    if ($_FILES["fichier"]["size"] == 0) {
        $errors[] = 'Votre fichier est vide.';
    }
    if (!in_array($_FILES['fichier']['type'], $acceptable)) {
        // != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" && $imageFileType != "gif") {
        $errors[] = "Seulement les fichiers JPG, JPEG, PNG & GIF sont acceptés.";
    }
    if (count($errors) === 0) {
        $RandUniqId = uniqid("img_", false);
        if (move_uploaded_file($_FILES["fichier"]["tmp_name"], $target_dir . $RandUniqId)) {
            echo "Le fichier " . basename($_FILES["fichier"]["name"]) . " a été téléversé.";
            $Gestion->AddImageBd($RandUniqId, $_SESSION["user"], date("Y-m-d H:i:s"), $_POST["TitreImage"]);
            //echo($_SESSION["user"]);
        } else {
            echo "Il y a eu un erreur avec le fichier.";
Example #5
0
 public function postBandejaexcel()
 {
     $gestion = Gestion::getCargar();
     if (Input::has('imagen')) {
         $objPHPExcel = new PHPExcel();
         $objPHPExcel->getProperties()->setCreator("Jorge Salcedo")->setLastModifiedBy("Jorge Salcedo")->setTitle("Office 2007 XLSX Test Document")->setSubject("Office 2007 XLSX Test Document")->setDescription("Reporte de Problemas")->setKeywords("office 2007 openxml php")->setCategory("Test result file");
         $az = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ', 'BA', 'BB', 'BC', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BK', 'BL', 'BM', 'BN', 'BO', 'BP', 'BQ', 'BR', 'BS', 'BT', 'BU', 'BV', 'BW', 'BX', 'BY', 'BZ', 'CA', 'CB', 'CC', 'CD', 'CE', 'CF', 'CG', 'CH', 'CI', 'CJ', 'CK', 'CL', 'CM', 'CN', 'CO', 'CP', 'CQ', 'CR', 'CS', 'CT', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DA', 'DB', 'DC', 'DD', 'DE', 'DF', 'DG', 'DH', 'DI', 'DJ', 'DK', 'DL', 'DM', 'DN', 'DO', 'DP', 'DQ', 'DR', 'DS', 'DT', 'DU', 'DV', 'DW', 'DX', 'DY', 'DZ');
         $objPHPExcel->getDefaultStyle()->getFont()->setName('Bookman Old Style');
         $objPHPExcel->getDefaultStyle()->getFont()->setSize(8);
         $valorinicial = 1;
         $azpos = 0;
         foreach ($gestion['datos'] as $data) {
             //Encabezado
             if ($valorinicial == 1) {
                 foreach ($data as $key => $val) {
                     $objPHPExcel->getActiveSheet()->setCellValue($az[$azpos] . $valorinicial, $key);
                     $azpos++;
                 }
             }
             $valorinicial++;
             $azpos = 0;
             //Datos
             foreach ($data as $val) {
                 $val = str_replace(array("\r\n", "\n", "\n\n", "\t", "\r"), array("", "", "", "", ""), $val);
                 $objPHPExcel->getActiveSheet()->setCellValue($az[$azpos] . $valorinicial, $val);
                 $azpos++;
             }
         }
         $objPHPExcel->getActiveSheet()->setTitle('PSI');
         $objPHPExcel->setActiveSheetIndex(0);
         $objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
         $objWriter->save('reporte/u743/PSI_' . date("Y-m-d_H-i-s") . '.xlsx');
         $zipfile = new Zipfile();
         $zipfile->add_dir("reporte/");
         $ruta = "reporte/u743/";
         $zipfile->carpeta = array();
         $zipfile->archivo = array();
         $zipfile->listar_directorios_ruta($ruta);
         $carpeta = $zipfile->carpeta;
         $archivo = $zipfile->archivo;
         for ($i = 0; $i < count($carpeta); $i++) {
             $zipfile->add_dir(str_replace("reporte/u743/", "reporte/", $carpeta[$i]));
             //$zipfile->add_dir( $carpeta[$i] );
         }
         for ($i = 0; $i < count($archivo); $i++) {
             $zipfile->add_file($archivo[$i], str_replace("reporte/u743/", "reporte/", $archivo[$i]));
             //$zipfile->add_file($archivo[$i],$archivo[$i] );
         }
         header("Content-type: application/octet-stream");
         header("Content-disposition: attachment; filename=bandeja.zip");
         echo $zipfile->file();
         exit;
     } else {
         $filename = Helpers::convert_to_file_excel('Bandeja_' . date("Ymd_His"));
         header('Content-Type: application/octet-stream; charset=utf-8;');
         header('Content-Disposition: attachment; filename=' . $filename);
         header('Expires: 0');
         header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
         header("Content-Transfer-Encoding: binary");
         header('Pragma: public');
         $n = 1;
         foreach ($gestion['datos'] as $data) {
             //Encabezado
             if ($n == 1) {
                 foreach ($data as $key => $val) {
                     echo $key . "\t";
                 }
                 echo "\r\n";
             }
             //Datos
             foreach ($data as $val) {
                 $val = str_replace(array("\r\n", "\n", "\n\n", "\t", "\r"), array("", "", "", "", ""), $val);
                 echo $val . "\t";
             }
             echo "\r\n";
             $n++;
         }
     }
     //
 }
Example #6
0
<?php

/*
 */
session_start();
require_once "php/main.php";
try {
    if (empty($_SESSION['id'])) {
        $c = new Identification();
        $c->handleRequest();
    } elseif (!empty($_SESSION['id'])) {
        if (!empty($_SESSION['administrateur'])) {
            $c = new Gestion();
            $c->gestion_admin();
        } else {
            if (isset($_REQUEST['idpro3'])) {
                $c = new Nouvelleconsult();
                //	$c->find($_REQUEST['idpro3'],$_REQUEST['idani'],"_accueil", $tva, $marge_medic);
                $c->find($_REQUEST['idpro3'], $_REQUEST['idani'], "_accueil");
            } else {
                if (isset($_REQUEST['reglage'])) {
                    $c = new Reglage();
                    //	$c->zone_reglage($tva);
                    $c->zone_reglage();
                } else {
                    if (isset($_REQUEST['admin'])) {
                        $c = new Log_admin();
                        $c->login_admin();
                    } else {
                        if (isset($_REQUEST['agenda'])) {
                            $c = new Agenda();
 public function norealizadoOfsc()
 {
     $save["aid"] = $activityId;
     $actu = \Gestion::getCargar($codactu);
     $actuObj = $actu["datos"][0];
     $actuArray = (array) $actuObj;
     $actuArray['estado_agendamiento'] = "3-0";
     $actuArray['gestion_id'] = $actuObj->id;
     $actuArray['estado'] = 5;
     $actuArray['motivo'] = 4;
     $actuArray['submotivo'] = 6;
     unset($actuArray["fecha_agenda"]);
     unset($actuArray["horario_id"]);
     unset($actuArray["dia_id"]);
     unset($actuArray["tecnico"]);
     unset($actuArray["tecnico_id"]);
     unset($actuArray["celula_id"]);
     Input::replace($actuArray);
     $save = $this->_gestionMovimientoController->postRegistrar();
     $datos = array();
     $datos['aid'] = $activityId;
     $datos['envio_ofsc'] = 4;
     $datos['gestion_id'] = $save['gestion_id'];
     $datos['gestion_movimiento_id'] = $save['gestion_movimiento_id'];
     $datos['estado_ofsc_id'] = 4;
     GestionMovimiento::OfscUpdate($datos);
 }
Example #8
0
<?php

session_set_cookie_params(0);
session_start();
include_once "BaseDeDonne.php";
include_once "BDClass.php";
$Gestion = new Gestion();
date_default_timezone_set('America/Montreal');
//si qqun a check la box rester connecter
if (isset($_COOKIE["userCookie"])) {
    $_SESSION["user"] = $_COOKIE["userCookie"];
}
//Ajouter l'entete
include_once "headpage.php";
if (isset($_POST["deconnect"]) && $_POST["deconnect"]) {
    session_destroy();
    // supprime le fichier de session
    session_unset();
    setcookie("userCookie", "", -1);
    header("Location: index.php");
}
if (!isset($_SESSION["user"])) {
    if (isset($_POST["username"]) && $_POST["username"] != "") {
        //echo($_POST["username"]);
        //echo($_POST["psw"]);
        if ($Gestion->ValidConnexion($_POST["username"], $_POST["psw"])) {
            $_SESSION["user"] = $_POST["username"];
            $Gestion->DateRefresh($_SESSION["user"], date("Y-m-d H:i:s"), get_client_ip2());
            if ($_POST["cbx"]) {
                //Set Cookies
                setcookie("userCookie", $_SESSION["user"], time() + 24 * 60 * 60);
Example #9
0
<head>
    <link rel='stylesheet' type='text/css' href='styles.css'>
</head>
<?php 
session_start();
include_once "BaseDeDonne.php";
include_once "BDClass.php";
$gestion = new Gestion();
include_once "headpage.php";
$image = $_GET["i"];
$ImageInfos = 0;
if ($ImageInfos = $gestion->GetInfoFromImage($image)) {
    $imageUser = $ImageInfos[0][0];
    $imageDate = $ImageInfos[0][1];
    $imageTitre = $ImageInfos[0][2];
}
gestionPost($gestion);
//Section Image
echo "\n<div class='lediv'>\n    <img class='limg' src='./Images/" . $image . "'>\n</div>\n<div class='comment'>\n    <h2>" . $imageTitre . "</h2>\n    <b>Auteur: " . $imageUser . "</b>\n    <br>\n    Date de Création: " . $imageDate . "\n</div>\n";
//Sections Commentaire
echo "\n<hr>\n<div class='comment'>\n";
$tableauCommentaire = $gestion->GetCommentaireFromImage($image);
echo "\n    <table class='upload' style='width: 100%'>\n    <tr>\n        <td>User</td>\n        <td>Date</td>\n        <td colspan='2'>Commentaire</td>\n    </tr>\n    ";
for ($i = 0; $i < count($tableauCommentaire); $i++) {
    echo "\n        <tr>\n            <td>" . $tableauCommentaire[$i][0] . "</td>\n            <td>" . $tableauCommentaire[$i][1] . "</td>";
    if ($tableauCommentaire[$i][0] == $_SESSION["user"] || $_SESSION["user"] == "admin") {
        echo "\n            <td>" . $tableauCommentaire[$i][2] . "</td>\n            <form action='gestimage.php' method='post'>\n                <td class='SupprimerButton'>\n                    <input type='submit' value='Supprimer' name='SupCom'>\n                    <input type='hidden' value='" . $tableauCommentaire[$i][3] . "' name='IdImagePost'>\n                </td>\n            </form>\n        </tr>\n        ";
    } else {
        echo "<td colspan='2'>" . $tableauCommentaire[$i][2] . "</td>";
    }
}
<?php

include_once "Inscription_Modele.php";
$Gestion = new Gestion();
/**
 * Created by PhpStorm.
 * User: 201356187
 * Date: 2015-11-18
 * Time: 18:14
 */
$VariableErreur = "";
$VariableSucces = "";
$TableauCharacter = $Gestion->SelectUsager();
if (isset($_POST["Inscription"])) {
    if (empty($_POST['Username']) && empty($_POST['Type']) && empty($_POST['Race'])) {
        if ($Gestion->Inscription($Username, $Type, $Race)) {
            $VariableSucces = "Bravo asti de champion";
        } else {
            $VariableErreur = "Ca marche pas";
        }
    } else {
        $VariableErreur = "Des champs sont vide biatch";
    }
}
if (isset($_POST["Desinscription"])) {
    echo "yolo";
    $Gestion->Desinscription($_POST["Desinscription"]);
    $TableauCharacter = $Gestion->SelectUsager();
}
 /**
  * Recepciona datos de Bandeja Controller
  * 
  * @return type
  */
 public function postCrear()
 {
     if (Request::ajax()) {
         DB::beginTransaction();
         $id = "";
         $gestiones = new Gestion();
         $gestiones["actividad_id"] = Input::get('tipo_actividad');
         $gestiones["nombre_cliente_critico"] = Input::get('cr_nombre');
         $gestiones["telefono_cliente_critico"] = Input::get('cr_telefono');
         $gestiones["celular_cliente_critico"] = Input::get('cr_celular');
         $gestiones['usuario_created_at'] = Auth::user()->id;
         try {
             $gestiones->save();
         } catch (Exception $exc) {
             DB::rollback();
             $this->_errorController->saveError($exc);
             return Response::json(array('rst' => 2, 'datos' => 'Error gestiones'));
         }
         $gestiones["id_atc"] = "RTC_" . date("Y") . "_" . $id;
         $id = $gestiones->id;
         $fechaRegistro = date("Y-m-d H:i:s");
         $gestionesDetalles = new GestionDetalle();
         $gestionesDetalles["gestion_id"] = $id;
         $gestionesDetalles["quiebre_id"] = Input::get('quiebre');
         $gestionesDetalles["empresa_id"] = Input::get('empresa_id');
         $gestionesDetalles["zonal_id"] = Input::get('zonal_id');
         $gestionesDetalles["codactu"] = Input::get('averia');
         $gestionesDetalles["tipo_averia"] = Input::get('tipo_averia');
         $gestionesDetalles["horas_averia"] = '0';
         $gestionesDetalles["fecha_registro"] = $fechaRegistro;
         $gestionesDetalles["ciudad"] = '';
         $gestionesDetalles["inscripcion"] = Input::get('telefono');
         $gestionesDetalles["fono1"] = Input::get('telefono');
         $gestionesDetalles["telefono"] = Input::get('telefono');
         $mdf = explode("___", Input::get('mdf'));
         $gestionesDetalles["mdf"] = $mdf[0];
         $gestionesDetalles["observacion"] = Input::get('cr_observacion');
         $gestionesDetalles["segmento"] = Input::get('segmento');
         $gestionesDetalles["area"] = '';
         $gestionesDetalles["direccion_instalacion"] = Input::get('direccion');
         $gestionesDetalles["codigo_distrito"] = '';
         $gestionesDetalles["nombre_cliente"] = Input::get('cr_nombre');
         $gestionesDetalles["orden_trabajo"] = '';
         $gestionesDetalles["veloc_adsl"] = '';
         $gestionesDetalles["clase_servicio_catv"] = '';
         $gestionesDetalles["codmotivo_req_catv"] = '';
         $gestionesDetalles["total_averias_cable"] = '';
         $gestionesDetalles["total_averias_cobre"] = '';
         $gestionesDetalles["total_averias"] = '';
         $fftt = "";
         $troba = trim(Input::get("troba"));
         $amplificador = trim(Input::get("amplificador"));
         $tap = trim(Input::get("tap"));
         $cable = trim(Input::get("cable"));
         $terminal = trim(Input::get("terminal"));
         if (Input::get('tipo_averia') == 'rutina-catv-pais') {
             $fftt = $mdf[0] . "|" . $troba . "|" . $amplificador . "|" . $tap;
         } else {
             $fftt = $mdf[0] . "|" . $cable . "|" . $terminal;
         }
         $gestionesDetalles["fftt"] = $fftt;
         $gestionesDetalles["llave"] = '';
         $gestionesDetalles["dir_terminal"] = '';
         $gestionesDetalles["fonos_contacto"] = Input::get('cr_telefono');
         $gestionesDetalles["contrata"] = Input::get('eecc');
         $gestionesDetalles["zonal"] = Input::get('zonal');
         $gestionesDetalles["wu_nagendas"] = '0';
         $gestionesDetalles["wu_nmovimientos"] = '0';
         $gestionesDetalles["wu_fecha_ult_agenda"] = '';
         $gestionesDetalles["total_llamadas_tecnicas"] = '0';
         $gestionesDetalles["total_llamadas_seguimiento"] = '0';
         $gestionesDetalles["llamadastec15dias"] = '0';
         $gestionesDetalles["llamadastec30dias"] = '0';
         $gestionesDetalles["lejano"] = Input::get('lejano');
         $gestionesDetalles["distrito"] = Input::get('distrito');
         $gestionesDetalles["eecc_zona"] = Input::get('eecc');
         $gestionesDetalles["zona_movistar_uno"] = Input::get('movistar_uno');
         $gestionesDetalles["paquete"] = '';
         $gestionesDetalles["data_multiproducto"] = '';
         $gestionesDetalles["averia_m1"] = '';
         $gestionesDetalles["fecha_data_fuente"] = $fechaRegistro;
         $gestionesDetalles["telefono_codclientecms"] = Input::get('telefono');
         $gestionesDetalles["rango_dias"] = '';
         $gestionesDetalles["sms1"] = '';
         $gestionesDetalles["sms2"] = '';
         $gestionesDetalles["area2"] = 'EN CAMPO';
         $gestionesDetalles["microzona"] = Input::get('microzona');
         $tipoActuacion = "";
         if (Input::get('tipo_actividad') == 3) {
             $tipoActuacion = "AVERIA";
         } else {
             $tipoActuacion = "PROVISION";
         }
         $gestionesDetalles["tipo_actuacion"] = $tipoActuacion;
         $gestionesDetalles["x"] = Input::get('x');
         $gestionesDetalles["y"] = Input::get('y');
         if (Input::has('codservcms')) {
             $gestionesDetalles['codservcms'] = Input::get('codservcms');
         }
         if (Input::has('codclie')) {
             $gestionesDetalles['codclie'] = Input::get('codclie');
         }
         if (Input::has('edificio')) {
             $gestionesDetalles['edificio_id'] = Input::get('edificio');
         }
         $gestionesDetalles['usuario_created_at'] = Auth::user()->id;
         try {
             $gestionesDetalles->save();
         } catch (Exception $exc) {
             DB::rollback();
             $this->_errorController->saveError($exc);
             return Response::json(array('rst' => 2, 'datos' => 'Error gestion detalle'));
         }
         $gestionesMovimientos = new GestionMovimiento();
         //codigo submodulo origen regis
         $gestionesMovimientos['submodulo_id'] = 5;
         $gestionesMovimientos["gestion_id"] = $id;
         $gestionesMovimientos["empresa_id"] = Input::get('empresa_id');
         $gestionesMovimientos["zonal_id"] = Input::get('zonal_id');
         $gestionesMovimientos["estado_id"] = '7';
         $gestionesMovimientos["motivo_id"] = '2';
         $gestionesMovimientos["submotivo_id"] = '18';
         $gestionesMovimientos["observacion"] = 'Registro Manual';
         $gestionesMovimientos["coordinado"] = '0';
         $gestionesMovimientos['usuario_created_at'] = Auth::user()->id;
         try {
             $gestionesMovimientos->save();
         } catch (Exception $exc) {
             DB::rollback();
             $this->_errorController->saveError($exc);
             return Response::json(array('rst' => 2, 'datos' => 'Error gestion movimiento'));
         }
         $ultimoMovimiento = new UltimoMovimiento();
         $ultimoMovimiento["actividad_id"] = Input::get('tipo_actividad');
         $ultimoMovimiento["nombre_cliente_critico"] = Input::get('cr_nombre');
         $ultimoMovimiento["telefono_cliente_critico"] = Input::get('cr_telefono');
         $ultimoMovimiento["celular_cliente_critico"] = Input::get('cr_celular');
         $ultimoMovimiento['usuario_created_at'] = Auth::user()->id;
         $ultimoMovimiento["id_atc"] = "RTC_" . date("Y") . "_" . $id;
         $ultimoMovimiento["gestion_id"] = $id;
         $ultimoMovimiento["quiebre_id"] = Input::get('quiebre');
         $ultimoMovimiento["empresa_id"] = Input::get('empresa_id');
         $ultimoMovimiento["zonal_id"] = Input::get('zonal_id');
         $ultimoMovimiento["codactu"] = Input::get('averia');
         $ultimoMovimiento["tipo_averia"] = Input::get('tipo_averia');
         $ultimoMovimiento["horas_averia"] = 0;
         $ultimoMovimiento["fecha_registro"] = $fechaRegistro;
         $ultimoMovimiento["ciudad"] = '';
         $ultimoMovimiento["inscripcion"] = Input::get('telefono');
         $ultimoMovimiento["fono1"] = Input::get('telefono');
         $ultimoMovimiento["telefono"] = Input::get('telefono');
         $ultimoMovimiento["mdf"] = $mdf[0];
         $ultimoMovimiento["observacion"] = 'Registro Manual';
         $ultimoMovimiento["segmento"] = Input::get('segmento');
         $ultimoMovimiento["area"] = '';
         $ultimoMovimiento["direccion_instalacion"] = Input::get('direccion');
         $ultimoMovimiento["codigo_distrito"] = '';
         $ultimoMovimiento["nombre_cliente"] = Input::get('cr_nombre');
         $ultimoMovimiento["orden_trabajo"] = '';
         $ultimoMovimiento["veloc_adsl"] = '';
         $ultimoMovimiento["clase_servicio_catv"] = '';
         $ultimoMovimiento["codmotivo_req_catv"] = '';
         $ultimoMovimiento["total_averias_cable"] = '';
         $ultimoMovimiento["total_averias_cobre"] = '';
         $ultimoMovimiento["total_averias"] = '';
         $fftt = "";
         $troba = trim(Input::get("troba"));
         $amplificador = trim(Input::get("amplificador"));
         $tap = trim(Input::get("tap"));
         $cable = trim(Input::get("cable"));
         $terminal = trim(Input::get("terminal"));
         if (Input::get('tipo_averia') == 'rutina-catv-pais') {
             $fftt = $mdf[0] . "|" . $troba . "|" . $amplificador . "|" . $tap;
         } else {
             $fftt = $mdf[0] . "|" . $cable . "|" . $terminal;
         }
         $ultimoMovimiento["fftt"] = $fftt;
         $ultimoMovimiento["llave"] = '';
         $ultimoMovimiento["dir_terminal"] = '';
         $ultimoMovimiento["fonos_contacto"] = Input::get('cr_telefono');
         $ultimoMovimiento["contrata"] = Input::get('eecc');
         $ultimoMovimiento["zonal"] = Input::get('zonal');
         $ultimoMovimiento["wu_nagendas"] = 0;
         $ultimoMovimiento["wu_nmovimientos"] = 0;
         $ultimoMovimiento["wu_fecha_ult_agenda"] = '';
         $ultimoMovimiento["total_llamadas_tecnicas"] = '0';
         $ultimoMovimiento["total_llamadas_seguimiento"] = '0';
         $ultimoMovimiento["llamadastec15dias"] = '0';
         $ultimoMovimiento["llamadastec30dias"] = '0';
         $ultimoMovimiento["lejano"] = Input::get('lejano');
         $ultimoMovimiento["distrito"] = Input::get('distrito');
         $ultimoMovimiento["eecc_zona"] = Input::get('eecc');
         $ultimoMovimiento["zona_movistar_uno"] = Input::get('movistar_uno');
         $ultimoMovimiento["paquete"] = '';
         $ultimoMovimiento["data_multiproducto"] = '';
         $ultimoMovimiento["averia_m1"] = '';
         $ultimoMovimiento["fecha_data_fuente"] = $fechaRegistro;
         $ultimoMovimiento["telefono_codclientecms"] = Input::get('telefono');
         $ultimoMovimiento["rango_dias"] = '';
         $ultimoMovimiento["sms1"] = '';
         $ultimoMovimiento["sms2"] = '';
         $ultimoMovimiento["area2"] = 'EN CAMPO';
         $ultimoMovimiento["microzona"] = Input::get('microzona');
         $tipoActuacion = "";
         if (Input::get('tipo_actividad') == 3) {
             $tipoActuacion = "AVERIA";
         } else {
             $tipoActuacion = "PROVISION";
         }
         $ultimoMovimiento["tipo_actuacion"] = $tipoActuacion;
         /*$ultimoMovimiento["empresa_m_id"]=
           Input::get('empresa_id');*/
         $ultimoMovimiento["estado_id"] = '7';
         $ultimoMovimiento["motivo_id"] = '2';
         $ultimoMovimiento["submotivo_id"] = '18';
         /*$ultimoMovimiento["observacion_m"]=
           Input::get('observacion2');*/
         $ultimoMovimiento["coordinado"] = '0';
         /*if ( Input::get('flag_tecnico') ) {
           
           $ultimoMovimiento["flag_tecnico"]=
                       Input::get('flag_tecnico');
           }*/
         $ultimoMovimiento['usuario_updated_at'] = Auth::user()->id;
         $ultimoMovimiento['updated_at'] = date("Y-m-d H:i:s");
         $ultimoMovimiento['usuario_created_at'] = Auth::user()->id;
         try {
             $ultimoMovimiento->save();
         } catch (Exception $exc) {
             DB::rollback();
             $this->_errorController->saveError($exc);
             return Response::json(array('rst' => 2, 'datos' => 'Error ultimo movimiento'));
         }
         DB::commit();
         return array('rst' => 1, 'msj' => "Registro Realizado con Éxito");
     }
 }
Example #12
0
 public function postEnvioofsc()
 {
     $datos = array();
     $datos['hf'] = explode("||", Input::get('hf'));
     $datos['fecha'] = $datos['hf'][0];
     $datos['bucket'] = $datos['hf'][1];
     $datos['slot'] = $datos['hf'][2];
     //time slot
     $datos['horas'] = explode("-", $datos['hf'][3]);
     $datos['empresa_id'] = Input::get('empresa_id');
     $datos['codactu'] = Input::get('codactu');
     $sla = false;
     $slaInicio = "0000-00-00 00:00";
     //retorno de transaccion
     $save = array("rst" => 2, "msj" => "Sin reultados.", "error" => "", "gestion_id" => 0);
     $inbound = new Inbound();
     $gestionId = "";
     $codactu = $datos['codactu'];
     //"35268199"; //
     $date = $datos['fecha'];
     //date("Y-m-d"); //
     $bucket = $datos['bucket'];
     //"BK_PRUEBAS_TOA";
     $tini = trim($datos['horas'][0]);
     //"09:00"
     $tend = trim($datos['horas'][1]);
     //"13:00"
     $tobooking = date("Y-m-d H:i");
     $slot = $datos['slot'];
     //"AM"
     $cuadrante = "Something";
     $techTp = "NULL";
     $techBb = "NULL";
     $techTv = "NULL";
     $wzKey = "";
     $wtLabel = "";
     $wType = "";
     $accTech = "COAXIAL";
     $businessType = "";
     $phone = array(0 => "", 1 => "");
     //Datos de la actuacion
     $actu = \Gestion::getCargar($codactu);
     //Existe la actuacion
     if (isset($actu["datos"][0])) {
         $actuObj = $actu["datos"][0];
         $actuArray = (array) $actuObj;
         $actuArray['noajax'] = "ok";
         //Motivo/Submotivo
         $actuArray['gestion_id'] = $actuObj->id;
         $actuArray['motivo'] = 1;
         $actuArray['submotivo'] = 1;
         $actuArray['estado'] = 2;
         //GestionID
         $gestionId = $actuObj->id;
         //Tipo de actividad: tabla "actividaes_tipos"
         $actTipo = DB::table('actividades_tipos')->select('nombre', 'label', 'sla', 'duracion')->where('id', '=', $actuArray['actividad_tipo_id'])->first();
         //Duracion en minutos
         $duration = $actTipo->duracion;
         //Quiebre grupo
         $quiebreGrupo = DB::table('quiebre_grupos')->select('nombre')->where('id', '=', $actuArray['quiebre_grupo_id'])->first();
         //Negocio por texto
         if (strpos($actuArray['tipo_averia'], "catv") > 0) {
             $businessType = "CATV";
         }
         if (strpos($actuArray['tipo_averia'], "adsl") > 0) {
             $businessType = "ADSL";
         }
         if (strpos($actuArray['tipo_averia'], "bas") > 0) {
             $businessType = "BASICA";
         }
         $wtLabel = $actTipo->label;
         $wType = $actTipo->nombre;
         //Telefonos de contacto
         $phoneArray = explode("|", $actuArray['fonos_contacto']);
         if (isset($phoneArray[0])) {
             $phone[0] = $phoneArray[0];
         }
         if (isset($phoneArray[1])) {
             $phone[1] = $phoneArray[1];
         }
         //Si no hay telefono de contacto
         if (strlen(trim($actuArray['fonos_contacto'])) < 6) {
             $phone = array("0000000", "0000000");
         }
         //Datos XY Web
         $actuArray['x'] = $actuArray['coord_x'];
         $actuArray['y'] = $actuArray['coord_y'];
         //Facilidades técnicas
         $ffttController = new \FfttController();
         $val = new stdClass();
         $val->fftt = $actuArray['fftt'];
         $val->tipoactu = $actuArray['tipo_averia'];
         $ffttArray = $ffttController->getExplodefftt($val);
         if ($ffttArray["tipo"] == 'catv') {
             $wzKey = $ffttArray["nodo"] . "_" . $ffttArray["troba"];
         } else {
             $wzKey = $ffttArray["mdf"] . "_" . $ffttArray["armario"];
         }
         //Parche: datos no concuerdan -> enumeration
         if ($actuArray['segmento'] == "NO-VIP") {
             $actuArray['segmento'] = "N";
         }
         //Homologacion de campos
         $dataOfsc = array("bucket" => $datos['bucket'], "actividad" => strtolower($actuObj->actividad), "date" => $date, "type" => "update_activity", "external_id" => $bucket, "start_time" => $tini, "end_time" => $tend, "appt_number" => $actuArray['codactu'], "customer_number" => $actuArray['inscripcion'], "worktype_label" => $wtLabel, "time_slot" => $slot, "time_of_booking" => $tobooking, "duration" => $duration, "name" => $actuArray['nombre_cliente'], "phone" => $phone[0], "email" => "", "cell" => $phone[1], "address" => $actuArray['direccion_instalacion'], "city" => "Lima", "state" => "Lima", "zip" => "LIMA 05", "language" => "1", "reminder_time" => "15", "time_zone" => "19", "coordx" => $actuArray['coord_x'], "coordy" => $actuArray['coord_y'], "XA_CREATION_DATE" => $tobooking, "XA_SOURCE_SYSTEM" => "PSI", "XA_CUSTOMER_SEGMENT" => $actuArray['segmento'], "XA_CUSTOMER_TYPE" => "", "XA_CONTACT_NAME" => "", "XA_CONTACT_PHONE_NUMBER_2" => "", "XA_CONTACT_PHONE_NUMBER_3" => "", "XA_CONTACT_PHONE_NUMBER_4" => "", "XA_CITY_CODE" => "", "XA_DISTRICT_CODE" => $actuArray['codigo_distrito'], "XA_DISTRICT_NAME" => $actuArray['distrito'], "XA_ZONE" => $actuArray['zonal'], "XA_QUADRANT" => $cuadrante, "XA_WORK_ZONE_KEY" => $wzKey, "XA_RURAL" => "", "XA_RED_ZONE" => "", "XA_WORK_TYPE" => $wType, "XA_APPOINTMENT_SCHEDULER" => "CLI", "XA_USER" => "", "XA_REQUIREMENT_NUMBER" => $actuArray['codactu'], "XA_NUMBER_SERVICE_ORDER" => $actuArray['orden_trabajo'], "XA_CHANNEL_ORIGIN" => "", "XA_SALES_POINT_CODE" => "", "XA_SALES_POINT_DESCRIPTION" => "", "XA_COMMERCIAL_VALIDATION" => "", "XA_TECHNICAL_VALIDATION" => "", "XA_WEB_UNIFICADA" => "", "XA_ORDER_AREA" => "", "XA_COMMERCIAL_PACKET" => "", "XA_COMPANY_NAME" => $actuArray['empresa'], "XA_GRUPO_QUIEBRE" => $quiebreGrupo->nombre, "XA_QUIEBRES" => $actuArray['quiebre'], "XA_BUSINESS_TYPE" => $businessType, "XA_PRODUCTS_SERVICES" => "", "XA_CURRENT_PRODUCTS_SERVICES" => "", "XA_EQUIPMENT" => "", "XA_NOTE" => $actuArray['observacion'], "XA_TELEPHONE_TECHNOLOGY" => $techTp, "XA_BROADBAND_TECHNOLOGY" => $techBb, "XA_TV_TECHNOLOGY" => $techTv, "XA_ACCESS_TECHNOLOGY" => $accTech, "XA_HFC_ZONE" => "", "XA_HFC_NODE" => "", "XA_HFC_TROBA" => "", "XA_HFC_AMPLIFIER" => "", "XA_HFC_TAP" => "", "XA_HFC_BORNE" => "", "XA_REQUIREMENT_TYPE" => "", "XA_REQUIREMENT_REASON" => "", "XA_CATV_SERVICE_CLASS" => "", "XA_MDF" => $actuArray['mdf'], "XA_CABLE" => "", "XA_CABINET" => "", "XA_BOX" => "", "XA_TERMINAL_ADDRESS" => "", "XA_TERMINAL_LINKHTTP" => "", "XA_ADSLSTB_PREFFIX" => "NULL", "XA_ADSLSTB_MOVEMENT" => "NULL", "XA_ADSL_SPEED" => "", "XA_ADSLSTB_SERVICE_TYPE" => "", "XA_PENDING_EXTERNAL_ACTION" => "", "XA_SMS_1" => $actuArray['sms1'], "XA_DIAGNOSIS" => "", "XA_TOTAL_REPAIRS" => $actuArray['total_averias']);
         //Envio por SLA
         if (Input::get('agdsla') == 'sla' and Input::get('slaini') != '') {
             $sla = true;
             $slaInicio = strtotime(Input::get('slaini'));
             $slaDay = $actTipo->sla * 3600;
             $slaFin = $slaInicio + $slaDay;
             $dataOfsc["sla_window_start"] = date("Y-m-d H:i", $slaInicio);
             $dataOfsc["sla_window_end"] = date("Y-m-d H:i", $slaFin);
             $dataOfsc["date"] = date("Y-m-d", $slaInicio);
         }
         //Campos adicionales para averia
         if (strtolower($actuObj->actividad) == 'averia') {
             $dataOfsc["XA_DIAGNOSIS"] = "SB_01";
         }
         /**
          * Guardar en tablas de gestion
          * - gestiones
          * - gestiones_detalles
          * - gestiones_movimientos
          * - ultimos_movimientos
          */
         $actuArray['fecha_agenda'] = $date;
         $horario = Horario::where('horario', '=', $slot)->first();
         if ($horario != NULL and $horario != '') {
             $actuArray['horario_id'] = $horario->id;
             $actuArray['dia_id'] = date("N", strtotime($date));
         }
         $actuArray['estado_agendamiento'] = "1-1";
         unset($actuArray["tecnico"]);
         unset($actuArray["tecnico_id"]);
         unset($actuArray["celula_id"]);
         Input::replace($actuArray);
         $save = $this->_gestionMovimientoController->postRegistrar();
         unset($actuArray["fecha_agenda"]);
         unset($actuArray["horario_id"]);
         unset($actuArray["dia_id"]);
         $actuArray['estado_agendamiento'] = "3-0";
         $actuArray['motivo'] = 2;
         $actuArray['submotivo'] = 18;
         $actuArray['estado'] = 7;
         if ($save["rst"] == 1) {
             //Crear actividad en OFSC
             /*if ( $dataOfsc['date']==0 ) {
                   $dataOfsc['date']=date("Y-m-d",strtotime(Input::get('slaini')) );
               }*/
             $response = $inbound->createActivity($dataOfsc, $sla);
             $report = $response->data->data->commands->command->appointment->report;
             $resultBool = true;
             /**
              * $report->message:
              * 
              * El mensaje de respuesta puede ser un arreglo
              * o un único mensaje.
              * Se valida la respuesta para cada mensaje recibido.
              */
             if (is_array($report->message)) {
                 foreach ($report->message as $val) {
                     if ($val->result == 'warning') {
                         $save["error"][] = $val->description;
                     }
                     if ($val->result == 'error') {
                         $save["error"][] = $val->description;
                     }
                 }
             } else {
                 if ($report->message->result == 'error') {
                     $resultBool = false;
                     $save["error"][] = $report->message->description;
                 }
             }
             //$result = $report->message->result;
             //Retorno OK
             if ($resultBool) {
                 //Appointment id
                 $aid = $response->data->data->commands->command->appointment->aid;
                 $datosofsc = array();
                 $datosofsc['aid'] = $aid;
                 $datosofsc['gestion_id'] = $save['gestion_id'];
                 $datosofsc['envio_ofsc'] = 2;
                 if ($sla == false) {
                     $datosofsc['envio_ofsc'] = 1;
                 }
                 $datosofsc['gestion_movimiento_id'] = $save['gestion_movimiento_id'];
                 GestionMovimiento::ActOfscAid($datosofsc);
                 $save["msj"] = "Registro y envío a OFSC correcto.";
                 $save["aid"] = $aid;
             }
             //Retorno ERROR
             if (!$resultBool) {
                 $errArray['type'] = $report->message->type;
                 $errArray['code'] = $report->message->code;
                 $errArray['desc'] = $report->message->description;
                 Input::replace($actuArray);
                 $save = $this->_gestionMovimientoController->postRegistrar();
                 $save["rst"] = 2;
                 $save["msj"] = "No se pudo enviar a OFSC. " . $report->message->description;
             }
         }
     }
     return json_encode($save);
 }
Example #13
0
<?php

include_once "BDClass.php";
$Gestion = new Gestion();
echo "\n<div style='text-align: center;width: auto'>\n    <h3>Connexion</h3>\n    <form action='index.php' method='post'>\n        Identifiant:<br>\n        <input type='text' name='username'>\n        <br>\n        Mot de passe:<br>\n        <input type='password' name='psw'>\n        <br>\n        Rester connecté:\n        <input type='checkbox' name='cbx'>\n        <br><br>\n        <input type='submit' value='Connexion' name='login'>\n    </form>\n    <hr>";
if (isset($_POST["add"]) && $_POST["add"]) {
    if ($_POST["username_n"] == "" || $_POST["fullname_n"] == "" || $_POST["psw_n1"] == "" || $_POST["psw_n2"] == "") {
        echo "\n            <p style='color: red;text-align: center'>Un des champs est vide</p>\n            ";
    } else {
        if (!$Gestion->ValidIdentity($_POST["username_n"])) {
            echo "\n            <p style='color: red;text-align: center'>L'identifiant est deja utilisé</p>\n            ";
        } else {
            if ($_POST["psw_n1"] != $_POST["psw_n2"]) {
                echo "\n            <p style='color: red;text-align: center'>Le mot de passe n'est pas correctement confirmer</p>\n            ";
            } else {
                if ($Gestion->AddUserBD($_POST["fullname_n"], $_POST["username_n"], $_POST["psw_n1"], get_client_ip(), "2000-12-12 23:23:23")) {
                    echo "\n            <p style='color: blue;text-align: center'>Compte crée!</p>\n            ";
                    unset($_POST["add"]);
                } else {
                    echo "\n            <p style='color: red;text-align: center'>Une érreur est survenue lors de la création de l'usager</p>\n            ";
                }
            }
        }
    }
}
echo "\n    <h3>Pas de compte ? Crée toi en un !</h3>\n    <form action='index.php' method='post'>\n        Nom complet:<br>\n        <input type='text' name='fullname_n' maxlength='50'>\n        <br>\n        Identifiant:<br>\n        <input type='text' name='username_n' maxlength='50'>\n        <br>\n        Mot de passe:<br>\n        <input type='password' name='psw_n1' maxlength='50'>\n        <br>\n        Confirmer mot de passe:<br>\n        <input type='password' name='psw_n2' maxlength='50'>\n        <br><br>\n        <input type='submit' value='Créer' name='add'>\n    </form>\n</div>\n";
function get_client_ip()
{
    $ipaddress = '';
    if (getenv('HTTP_CLIENT_IP')) {
        $ipaddress = getenv('HTTP_CLIENT_IP');
Example #14
0
<?php

include_once "BaseDeDonne.php";
include_once "BDClass.php";
$gestion = new Gestion();
include_once "headpage.php";
$target_dir = "./Images/";
$image = $_GET["image"];
if ($image[0] != '.') {
    if (file_exists($target_dir . $image)) {
        if (unlink($target_dir . $image)) {
            echo "L'image " . $image . " a été supprimée.";
            $gestion->DelImageBd($image);
        } else {
            echo "L'image " . $image . " n'a pas été supprimée.";
        }
    } else {
        echo "Ce fichier n'existe pas.";
    }
} else {
    echo "Vous n'avez pas accès a supprimer ce fichier.";
}
?>
<br>
<br>
<form action="index.php" method="post">
    <input type="submit" value="Retour">
<?php 
include_once "footpage.html";
Example #15
0
<?php

session_start();
include_once "BaseDeDonne.php";
include_once "BDClass.php";
$gestion = new Gestion();
date_default_timezone_set('America/Montreal');
include_once "headpage.php";
$target_dir = "./Images/";
$image = $_POST["image"];
$message = $_POST["commentaireSec"];
if ($image[0] != '.') {
    if (file_exists($target_dir . $image)) {
        if (!empty($message)) {
            if ($gestion->CommenterPhoto($image, $_SESSION["user"], date("Y-m-d H:i:s"), $message)) {
                echo "\n            <p style='color: blue'>Succès! Le commentaire a été enregistré!</p>\n             ";
            } else {
                echo "\n            <p style='color: red'>Erreur. Un probleme est survenue dans la BD</p>\n             ";
            }
        } else {
            echo "\n            <p style='color: red'>Erreur. Le commentaire est vide.</p>\n             ";
        }
        //echo("image:".$image." text:".$message);
    } else {
        echo "<p style='color: red'>Erreur. Ce fichier n'existe pas.</p>";
    }
} else {
    echo "<p style='color: red'>Erreur. Vous n'avez pas accès a commenter ce fichier.</p>";
}
?>
    <!--<form class="comment" action="index.php" method="post">
Example #16
0
<?php

session_start();
include_once "BaseDeDonne.php";
include_once "BDClass.php";
$Gestion = new Gestion();
echo "\n<div style='text-align: center'>\n    <h1 style='background-color: darkseagreen'>Administration</h1>\n    <form action='index.php' method=''>\n        <input type='submit' value='Retour'>\n    </form>\n</div>";
if (isset($_SESSION["user"]) && $_SESSION["user"] == "admin") {
    $TableauUser = $Gestion->SelectUsager();
    if (isset($_POST["Desinscription"])) {
        $Gestion->DeleteUser($_POST["Desinscription"]);
        header("location: adminPage.php");
    }
    //Affichage de tous
    echo "\n    <h1>Gestion des usager</h1>\n    <h3>Les 10 derniers usager connecté sont en jaune</h3>\n    <table border='1'>\n    <tr>\n        <td>Username</td>\n        <td>Password</td>\n        <td>Fullname</td>\n        <td>IPadresse</td>\n        <td>TimeConnexion</td>\n    </tr>\n    ";
    for ($i = 0; $i < count($TableauUser); $i++) {
        echo "\n        <tr ";
        if ($i < 10) {
            echo "style='background-color: #ffff99'";
        }
        echo ">\n            <td>" . $TableauUser[$i][0] . "</td>\n            <td>" . $TableauUser[$i][1] . "</td>\n            <td>" . $TableauUser[$i][2] . "</td>\n            <td>" . $TableauUser[$i][3] . "</td>\n            <td>" . $TableauUser[$i][4] . "</td>\n            <form action='adminPage.php' method='post'>\n                <td><button name='Desinscription' value='" . $TableauUser[$i][0] . "' >Supprimer</button></td>\n            </form>\n            <form action='profil.php' method='post'>\n                <td><button name='adminProfilRequest' value='" . $TableauUser[$i][0] . "' >Profil</button></td>\n            </form>\n        </tr>\n        ";
    }
    echo "</table>";
} else {
    echo "\n            <p style='color: red;text-align: center'>Accès illégal a cette page, " . $_SESSION["user"] . " n'est pas un administrateur</p>\n            ";
}
include_once "footpage.html";
Example #17
0
<?php

include_once "BaseDeDonne.php";
include_once "BDClass.php";
$gestion = new Gestion();
// exemple avec le répertoire courant
$repertoire = "./Images";
// la valeur de retour de scandir est un tableau
$fichiers = scandir($repertoire);
$compteur = 0;
?>

<head>
    <link rel="stylesheet" type="text/css" href="styles.css">
</head>
<table class="vision">
    <?php 
if ($fichiers !== FALSE) {
    for ($i = sizeof($fichiers) - 1; $i >= 0; $i--) {
        $nomFichier = $fichiers[$i];
        if ($nomFichier[0] != "." && !empty($gestion->GetInfoFromImage($nomFichier))) {
            if ($compteur == 5) {
                echo "</tr>";
                $compteur = 0;
            }
            if ($compteur % 5 == 0) {
                echo "<tr>";
            }
            echo '<td><a href="gestimage.php?i=' . $nomFichier . '"><img src="Images/' . $nomFichier . '"></a></td>';
            $compteur++;
        }