Пример #1
0
<?php

include '../../../../Conf/Include.php';
$name = $_REQUEST['name'] ?: null;
$url = $_REQUEST['url'] ?: null;
$json = new \SivarApi\Tools\Services_JSON();
$json_stack = null;
$stack = $_REQUEST['stack'] ?: null;
if ($stack == null || $stack == '""') {
    $json_stack = $json->encode(array("name" => $name, "url" => $url));
    echo "[" . $json_stack . "]";
    exit;
} else {
    $json_stack = json_decode($stack, true);
    $json_stack[] = array("name" => $name, "url" => $url);
    echo $json->encode($json_stack);
    exit;
}
Пример #2
0
<?php

include '../../../../Conf/Include.php';
//INICIAMOS SESION
Session::InitSession();
//CARGAMOS LA DEPENDENCIA
set_dependencies(array("MessageController"));
//OBTENEMOS EL ID DEL MENSAJE
$id = $_GET['id_message'];
//CARGAMOS EL CONTROLADOR
$msj = new MessageController();
$request = $msj->GetChatById($id);
$first = $msj->GetMessageById($id);
if (count($first) == 0) {
    $first = "";
} else {
    $first = $first[0]['mensaje'];
}
$data = array("me" => Session::GetSession("login", "id"), "chat" => $request, "mensaje" => htmlspecialchars_decode($first, ENT_QUOTES));
$json = new SivarApi\Tools\Services_JSON();
echo $json->encode($data);
exit;
//CONVERTIMOS EN FORMATO JSON
//echo "<pre>";
//print_r($request);
//echo "</pre>";
Пример #3
0
<?php

include '../../../Conf/Include.php';
set_dependencies(array("AdminController"));
$admin = new AdminController();
$result = $admin->Get_MasterPrivilegios();
$json = new \SivarApi\Tools\Services_JSON();
echo $json->encode($result);
Пример #4
0
 $body_contact .= '<th>Titulo</th>';
 $body_contact .= '<th>E-mail</th>';
 $body_contact .= '<th>Notas</th>';
 $body_contact .= '<th></th>';
 $body_contact .= '</tr></thead>';
 $body_contact .= "<tbody id='table_contacts' name='table_contacts'>";
 $paginacion = new BasePagination();
 $paginacion->porPagina(1);
 $paginacion->SetPagArrayData($contact);
 $contact = $paginacion->GetPagination();
 $nav = $paginacion->Getnavigate();
 foreach ($contact as $c_k => $c_v) {
     $id_contact = $c_v['id_prospect_contact'];
     $phone_contact = $sales->Get_PhonesContact($id_contact);
     $json_phone_contact = null;
     $json_class = new SivarApi\Tools\Services_JSON();
     if (count($phone_contact) != 0) {
         $json_phone_contact = $json_class->encode($phone_contact);
     }
     $val_id = "Ctl" . (string) $id_contact;
     $json_contact = $json_class->encode($c_v);
     $body_contact .= "<input type='hidden' name='" . $val_id . "' id='" . $val_id . "' value='" . $json_contact . "' />";
     $body_contact .= "<input type='hidden' name='" . $id_contact . "' id='" . $id_contact . "' value='" . $json_phone_contact . "' />";
     $body_contact .= '<tr id="child' . (string) $c_v['id_prospect_contact'] . '" class="odd gradeX">';
     $body_contact .= "<td>" . $c_v['nombres'] . " " . $c_v['apellidos'] . "</td>";
     $body_contact .= "<td>" . $c_v['titulo'] . "</td>";
     $body_contact .= "<td>" . '<button type="button" onclick="EmailContact(' . "'" . $c_v['email'] . "'" . ');" class=" btn btn-info"><i class="fa fa-envelope-o"></i></i></i></button>' . "</td>";
     $body_contact .= "<td><button type='button' class='btn btn-success' " . 'onclick="ShowNotes(' . "'" . htmlspecialchars($c_v['notas']) . "'" . ');"' . ">" . '<i class="fa fa-comment"></i>' . "</button></td>";
     $body_contact .= "<td>" . '<button type="button" onclick="ProspectPhones(' . $id_contact . ');" class=" btn btn-info"><i class="fa fa-phone"></i></i></button>' . "";
     $body_contact .= "" . '<button type="button" onclick="NewPhoneContact(' . $c_v['id_prospect_contact'] . ')" class="btn orange"><i class="fa fa-plus"></i></button>' . "";
     $body_contact .= "" . '<button type="button" onclick="EditContact(' . "'" . $val_id . "'" . ');" class="btn btn-primary"><i class="fa fa-pencil"></i></button>' . "";
Пример #5
0
include '../../../Conf/Include.php';
set_dependencies(array("ProspectController", "AdminController"));
if (!isset($_REQUEST['type'])) {
    exit;
}
$prospect = new ProspectController();
$type = $_REQUEST['type'];
switch ($type) {
    case "add_contact":
        $id = $_REQUEST['id'];
        $name = $_REQUEST['name'];
        $tel = $_REQUEST['tel'];
        $result = $prospect->SetContactPhone($id, $name, $tel);
        if ($result) {
            $contact = $prospect->Get_PhonesContact($id);
            $json = new \SivarApi\Tools\Services_JSON();
            echo $json->encode($contact);
        }
        unset($id);
        unset($name);
        unset($tel);
        break;
    case "add":
        $id = $_REQUEST['id'];
        $name = $_REQUEST['name'];
        $name2 = $_REQUEST['name2'];
        $title = $_REQUEST['title'];
        $mail = $_REQUEST['mail'];
        $notes = $_REQUEST['notes'];
        $result = $prospect->SetContact(array("id_prospect" => $id, "nombres" => $name, "apellidos" => $name2, "titulo" => $title, "email" => $mail, "notas" => $notes));
        if ($result) {
Пример #6
0
    if ($value['imagen'] == null) {
        $data .= '<img src="' . FunctionsController::GetUrl("img", false) . '/users/avatar.png" class="img-circle" alt="">';
    } else {
        $data .= '<img src="' . FunctionsController::GetUrl("img", false) . '/users/' . $value['imagen'] . '" class="img-circle" alt="">';
    }
    $data .= '</span>';
    $data .= '<span class="subject">';
    $sub_msj = $messagecontroller->GetCountSubMessage($value['id_mensaje'], $id_user);
    if ($sub_msj >= 1) {
        $data .= '<span class="badge badge-default">';
        $data .= $sub_msj . '</span>';
    }
    $data .= '<span class="from">';
    $data .= $value['nombre'] . '</span>';
    $data .= '<span class="time">' . FunctionsController::Get_TimeAgo($value['fecha'] . " " . $value['hora']) . '</span>';
    $data .= '</span>';
    $data .= '<br><span class="message">';
    $data .= '<b>' . $value['asunto'] . "</b><br>";
    if (strlen($value['mensaje']) >= 65) {
        $data .= substr(htmlspecialchars_decode($value['mensaje']), 0, 60) . ' (...)';
    } else {
        $data .= $value['mensaje'];
    }
    $data .= '</span>';
    $data .= '</a>';
    $data .= '</li>';
}
$array_['inbox'] = array("data" => $data);
$json = new SivarApi\Tools\Services_JSON();
echo $json->encode($array_);
unset($messagecontroller);