예제 #1
0
 /**
  * --------------------------------------------------------------
  *  FUNCIONES DE PROSPECTO A CLIENTE 
  * --------------------------------------------------------------
  */
 public function CreateClient($id_prospect)
 {
     $prospect = $this->Get_Prospect_ById($id_prospect);
     if (count($prospect) <= 0) {
         return false;
     }
     $this->Set_MetaStatus(2, $id_prospect);
     $client = array("nombre" => $prospect['nombre'], "direccion" => $prospect['direccion'] . "," . " " . $prospect['direccion2'], "id_pais" => $prospect['id_pais'], "provincia" => $prospect['provincia'], "zip" => $prospect['zip'], "telefono" => $prospect['telefono'], "facebook" => $prospect['facebook'], "twitter" => $prospect['twitter'], "pagina_web" => $prospect['pagina_web'], "email" => $prospect['email'], "fax" => $prospect['fax'], "ciudad" => $prospect['ciudad'], "id_prospect" => $prospect['id_prospect'], "fecha" => FunctionsController::get_date(), "hora" => FunctionsController::get_time());
     return parent::Insert("sales_client", $client);
     //echo "<pre>";
     //print_r($client);
     // echo "</pre>";
 }
예제 #2
0
<?php

include '../../../Conf/Include.php';
set_dependencies(array("AdminController"));
Session::InitSession();
//INICIA SESION
$header = new Http\Header();
//INSTANCIA EL HEADER
if (Session::ExistSession("login")) {
    //VERIFICA SI EXISTE LA SESION LOGIN
    $id_log = Session::GetSession("log");
    //OBTIENE EL LOG DE LOGUEO
    $hora_salida = FunctionsController::get_time();
    //OBTIENE LA HORA DE SALIDA
    $admin = new AdminController();
    //INSTANCIA EL CONTROLADOR DEL ADMIN
    $admin->Update_log($id_log, $hora_salida);
    //ACTUALIZA EL LOG O BITACORA
    if (!Session::ExistSession("DUPLICATE_SESSION")) {
        //VERIFICA SI ES SESION DUPLICADA
        $admin->UpdateSession($_SESSION['login']["id_log"], 0);
        //EN DADO CASO NO SEA ENTONCES RESTABLECE LA ACTIVIDAD A CERO
    }
    Session::DestroySession("", true);
    //LIBERA TODAS LAS VARIABLES DE SESION ...
    $header->redirect(FunctionsController::GetUrl("login.php"));
    //REDIRECT
} else {
    $header->redirect(FunctionsController::GetUrl("login.php"));
    //REDIRECT
}
예제 #3
0
} else {
    $url = "login.php?redirect=" . $_REQUEST['redirect'];
    $url_err = "login.php?error=true&redirect=" . $_REQUEST['redirect'];
    $url_index = "index.php?redirect=" . $_REQUEST['redirect'];
}
if (!isset($_POST['username'])) {
    $header->redirect(FunctionsController::GetUrl($url));
}
if (preg_match("/[^A-Za-z0-9]/", $user) || preg_match("/[^A-Za-z0-9]/", $pass)) {
    if (!\SivarApi\Tools\Validation::CheckEmail($user)) {
        $header->redirect(FunctionsController::GetUrl($url_err));
        exit;
    }
}
$admin_controller = new AdminController();
$is_user = $admin_controller->GetLogin($user, $pass);
if ($is_user) {
    $hora_entrada = FunctionsController::get_time();
    $fecha = FunctionsController::get_date();
    $id_user = Session::GetSession("login", "id");
    if (!$admin_controller->SessionActive(Session::GetSession('login', "id_log"))) {
        $id_log = $admin_controller->Create_Log($id_user, $hora_entrada, $fecha);
        $admin_controller->UpdateSession(Session::GetSession('login', "id_log"), 1);
    } else {
        $_SESSION['DUPLICATE_SESSION'] = true;
    }
    $_SESSION['log'] = $id_log;
    $header->redirect(FunctionsController::GetUrl($url_index));
} else {
    $header->redirect(FunctionsController::GetUrl($url_err));
}
예제 #4
0
                 $print_status .= " Activo  &nbsp&nbsp&nbsp <input class='btn green' type='button' onclick='ProspectActivate(0 ,{$id_p});' value='Desactivar' id='cmd_estado' />";
                 break;
         }
     } else {
         $print_status .= "Opps!! Hubo algun error , Intente Luego";
     }
     $print_status .= "</div>";
     echo $print_status;
 } else {
     if (isset($_REQUEST['id'])) {
         //INICIAR PROSPECTO ... IMPRIMIR TODOS LOS DATOS
         //REGISTRA LA ENTRADA DEL USUARIO HACIA EL PROSPECTO
         session_start();
         $id_user = $_SESSION['login']['id'];
         $date = FunctionsController::get_date();
         $time = FunctionsController::get_time();
         $id_p = $_REQUEST['id'];
         $sales->NewEntrance($id_user, $id_p, $date, $time);
         //TERMINA EL REGISTRO DE ENTRADA
         $prospect_data = $sales->Get_Prospect_ById($id_p);
         //obtener los datos por medio del id
         //CREACION DE LA BITACORA ...
         $sales->InitBitacora($id_p);
         //verifica si los datos del prospecto existe
         if (count($prospect_data) == 0) {
             exit;
         }
         //Prospect body , este caso no
         $prospect_body_dir = "";
         if (SivarApi\Tools\Validation::Is_Empty_OrNull($prospect_data['direccion'])) {
             $prospect_body_dir .= '<div class="form-body"><i class="fa fa-map-marker"></i>  <b>Direccion: </b> Sin Direccion </div>';
예제 #5
0
 public function SetSubmessage($id_message, $id_usuario, $mensaje)
 {
     return $this->Insert("lieisoft_submensajeria", array("id_mensajeria" => $id_message, "id_usuario" => $id_usuario, "mensaje" => $mensaje, "fecha" => FunctionsController::get_date(), "hora" => FunctionsController::get_time()));
 }
예제 #6
0
    $encript = new \SivarApi\Tools\Encriptacion\Encriptacion();
    $id_mt = $encript->Md5Encrypt(mt_rand(0, 1000) . mt_rand(100, 500) . $id_user . $_REQUEST['title']);
    $box_files = $_REQUEST['box_nodes'] ?: "";
    $mensaje = htmlspecialchars("<b>La tarea Consiste en :</b><br> " . $_REQUEST['client_description'] . "<div align='center'><a target='_blank' class='btn btn-circle green-haze btn-sm ' href='" . FunctionsController::GetUrl("task/show_task.php?id={$id_mt}") . "'>Ver tarea ...</a></div>", ENT_QUOTES);
    $asunto = " Tarea :" . $_REQUEST['title'];
    $msj = new MessageController();
    $id_msj = $msj->SetmessageLastId($_REQUEST['id_user'], $id_user, $mensaje, $asunto);
    $val = $task->SaveTask(array("id_multitask" => $id_mt, "id_client" => $_REQUEST['id_client'], "id_user_from" => $id_user, "description" => $_REQUEST['client_description'] ?: "ERROR", "title" => $_REQUEST['title'], "status" => 1), array("id_multitask" => $id_mt, "id_type" => 1, "id_user_from" => $id_user, "id_user_to" => $_REQUEST['id_user'], "id_message" => $id_msj[0]['id'], "date_asign" => FunctionsController::get_date(), "time_asign" => FunctionsController::get_time(), "box_files" => $box_files, "files" => $_REQUEST['other_docs'] ?: "", "comments" => $_REQUEST['user_comment'], "date_deadline" => FunctionsController::ReWriteDate($_REQUEST['deadline']), "time_deadline" => $_REQUEST['hourdead'], "status" => $_REQUEST['user_activate']));
    if (!$val) {
        echo 0;
    } else {
        echo $id_mt;
    }
} catch (Exception $ex) {
    $error = "(" . FunctionsController::get_date() . ")";
    $error .= "(" . FunctionsController::get_time() . ")";
    $error .= "(ERROR==>" . $ex->getMessage() . ")";
    $dir = "../../task/logs/";
    $log = new LogsController($dir);
    $log->SetLog($error);
    $log->CloseLog();
} catch (PDOException $ex) {
    $error = "(" . FunctionsController::get_date() . ")";
    $error .= "(" . FunctionsController::get_time() . ")";
    $error .= "(ERROR==>" . $ex->getMessage() . ")";
    $dir = "../../task/logs/";
    $log = new LogsController($dir);
    $log->SetLog($error);
    $log->CloseLog();
}
unset($task);