Ejemplo n.º 1
0
 static function GetLogo($width = null, $height = null)
 {
     $logo = "LogoB.png";
     $dir = 'admin/img/assert/logos/';
     if (SivarApi\Tools\Validation::Is_Empty_OrNull($width) || SivarApi\Tools\Validation::Is_Empty_OrNull($height)) {
         echo '<a href="' . self::$relative_route . 'admin/index.php">
             <img src="' . self::$relative_route . $dir . $logo . '"' . 'width="86" height="35" alt="logo" class="logo-default"/>
           </a>';
     } else {
         echo '<a href="' . self::$relative_route . 'admin/index.php">
             <img src="' . self::$relative_route . $dir . $logo . '"' . 'width="' . $width . '" height="' . $height . '" alt="logo" class="logo-default"/>
           </a>';
     }
 }
Ejemplo n.º 2
0
 public function SetNew_Avatar($destination, $file_name)
 {
     if (!is_dir($destination)) {
         return false;
     } else {
         if (SivarApi\Tools\Validation::Is_Empty_OrNull($file_name)) {
             return false;
         }
     }
     $directory = new _Directory();
     $this->array_file = $directory->UploadFile($destination, $file_name);
     if ($this->array_file != null) {
         unset($directory);
         $update_avatar = parent::Update("usuario", array("imagen" => $this->array_file), "id_usuario LIKE '{$this->ID_USER}'");
         if ($update_avatar) {
             return true;
         } else {
             return false;
         }
     } else {
         unset($directory);
         return null;
     }
 }
								<th>
									 Privilegios
								</th>
								<th>
									 Nivel
								</th>
								<th>
									Padre
                                                                </th>
                                                                <th></th>
							</tr>
							</thead>
                                                        <tbody>
							<?php 
$rols = $adminc->get_master_rols(false);
if (SivarApi\Tools\Validation::Is_Empty_OrNull($rols)) {
    echo "<tr><td>No Hay datos !!</td></tr>";
} else {
    foreach ($rols as $key => $value) {
        echo "<tr>";
        foreach ($value as $k => $v) {
            switch ($k) {
                case "id_privilegios":
                    break;
                default:
                    echo "<td>{$v}</td>";
                    break;
            }
        }
        $id_u = $value['id_privilegios'];
        echo '<td><a class="delete" href="dashboard_gestion_usuarios.php?id_rol=' . $id_u . '">Eliminar</a></td>';
Ejemplo n.º 4
0
 public function InsertBitacora($id_bitacora, $id_user, $id_type, $title, $description, $date = null, $hour = null)
 {
     if (SivarApi\Tools\Validation::Is_Empty_OrNull($date) || SivarApi\Tools\Validation::Is_Empty_OrNull($hour)) {
         $date = FunctionsController::get_date();
         $hour = FunctionsController::get_time();
     }
     return parent::Insert("sales_prospect_bitacora_log", array("id_bitacora" => $id_bitacora, "id_usuario" => $id_user, "id_tipo" => $id_type, "titulo" => $title, "descripcion" => $description, "fecha" => $date, "hora" => $hour));
 }
Ejemplo n.º 5
0
<?php

include '../../../Conf/Include.php';
set_dependencies(array("AdminController"));
$header = new Http\Header();
$redirect = $_REQUEST['redirect'] ?: null;
$user = $_POST['username'];
$pass = $_POST['password'];
//$url_builder   = NULL;
$url = null;
$url_err = null;
$url_index = null;
if (SivarApi\Tools\Validation::Is_Empty_OrNull($redirect)) {
    $url = "login.php";
    $url_err = "login.php?error=true";
    $url_index = "index.php";
} 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();
Ejemplo n.º 6
0
 $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>';
 } else {
     $prospect_body_dir .= '<div class="form-body"><i class="fa fa-map-marker"></i><b>Direccion: </b>' . $prospect_data['direccion'] . '</div>';
 }
 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 2: </b> Sin Direccion </div>';
 } else {
     $prospect_body_dir .= '<div class="form-body"><i class="fa fa-map-marker"></i> <b>Direccion 2: </b>' . $prospect_data['direccion2'] . '</div>';
 }
 $title_dir = "Direccion ";
 $action_button = '';
 $pais = $sales->Get_Country($prospect_data['id_pais']);
 //obtiene el pais
 $prospect_body_dir .= '<div class="form-body"><i class="fa fa-globe"></i> <b>Provincia : </b>' . $prospect_data['provincia'] . '<b>&nbsp&nbsp&nbsp&nbsp  <i class="fa fa-globe"></i> Ciudad: </b>' . $prospect_data['ciudad'] . '<b>&nbsp&nbsp&nbsp&nbsp  <i class="fa fa-globe"></i> Pais: </b>' . $pais . '</div>';
 //agrega los datos de la direccion
 //perfil o progreso del prospecto completado
 $propect_progress = $sales->Get_ProspectProgress($prospect_data['id_prospect']);
 $complete_profile = "(Perfil Completado:  " . $propect_progress . "%)";
 if ($propect_progress >= 100) {
     $complete_profile = "";
Ejemplo n.º 7
0
 /**
 *@version 1.0
 *@author Rolando Arriaza , ultima version
 *@todo Funcion para crear un arbol de archivos
 *@param string $directory directorio donde comenzara el arbol
 *@param string|array patron en cual el archivo debe respetar
 *@example  
 * <code>
 *   buscaremos los archivos que inicien en dashboard como dashboard.php o dashboard_img.jpg
 *   $pattern = "dashboard"
 * 
 *   busca archivos con el nombre inicial dashboard y extencion php
 *   $pattern = array("name"=>"dashboard" , "extend"=>"php");
        $pattern = array("name"=>"dashboard" , "extend"=>"php" , "pattern"=>false);
 * </code>
 *@return bool | array false si no existe directorio 
 */
 public function FindDataDirectory($directory, $pattern = null)
 {
     if (!is_dir($directory)) {
         return false;
     }
     $object = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::SELF_FIRST);
     if (SivarApi\Tools\Validation::Is_Empty_OrNull($pattern)) {
         foreach ($object as $key => $value) {
             $class = new SplFileInfo($key);
             if ($class->getType() == "file") {
                 $filename = $class->getFilename();
                 $path = $class->getPath();
                 array_push($this->array_dir, array("root" => $path, "filename" => $filename));
             }
         }
     } else {
         $preg = null;
         if (is_array($pattern)) {
             if (isset($pattern['pattern'])) {
                 $p = $pattern["name"];
                 $ext = $pattern["extend"];
                 $preg = "/^({$p}\\.{$ext})\$/";
             } else {
                 $p = $pattern["name"];
                 $ext = $pattern["extend"];
                 $preg = "/^({$p}\\w+\\.{$ext})\$/";
             }
         } else {
             $preg = "/^({$pattern}\\w+\\.php)\$/";
         }
         foreach ($object as $key => $value) {
             $class = new SplFileInfo($key);
             if ($class->getType() == "file") {
                 $filename = $class->getFilename();
                 $path = $class->getPath();
                 $ext = $class->getExtension();
                 if (preg_match($preg, $filename)) {
                     array_push($this->array_dir, array("root" => $path, "filename" => $filename));
                 }
             }
         }
     }
     return $this->array_dir;
 }
Ejemplo n.º 8
0
 public function ConvertPrivToString($numeric_privs)
 {
     $admin = new AdminController();
     $privs = $admin->Get_MasterPrivilegios();
     $privs_array = array();
     $numeric_array = explode(",", $numeric_privs);
     for ($i = 0; $i < count($numeric_array); $i++) {
         foreach ($privs as $v) {
             if ($numeric_array[$i] == $v['nivel']) {
                 array_push($privs_array, $v['nombre']);
                 break;
             }
         }
     }
     $glue = implode(",", $privs_array);
     if (SivarApi\Tools\Validation::Is_Empty_OrNull($glue)) {
         return "all privileges";
     }
     return $glue;
 }