public function set_contract($id_contrato) { $fecha = FunctionsController::get_date(); $update = parent::Update("contrato", array("aceptado" => "1", "fecha_contrato" => $fecha), "id_contrato LIKE {$id_contrato}"); return $update; }
/** * -------------------------------------------------------------- * 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>"; }
*@copyright (c) 2015, Lieison * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * *@version 1.0 *@todo Lieison S.A de C.V * * * */ include '../../../Conf/Include.php'; set_dependencies(array("ProspectController", "AdminController")); $prospecto = new ProspectController(); $arrayp = array("nombre" => $_REQUEST['nombre'], "direccion" => $_REQUEST['direccion1'], "direccion2" => $_REQUEST['direccion2'], "provincia" => $_REQUEST['provincia'], "ciudad" => $_REQUEST['ciudad'], "id_pais" => $_REQUEST['pais'], "zip" => $_REQUEST['zip'], "telefono" => $_REQUEST['telefono'], "fax" => $_REQUEST['fax'], "pagina_web" => $_REQUEST['web'], "email" => $_REQUEST['mail'], "facebook" => $_REQUEST['facebook'], "twitter" => $_REQUEST['twitter'], "notas" => $_REQUEST['notas'], "fecha" => FunctionsController::get_date(), "estado" => 1); echo $prospecto->Add_Prospect($arrayp);
} 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)); }
case 1: $print_status .= " Activo     <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'])) {
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())); }
$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);