$Erros = [];
 while (!feof($FileRead)) {
     $file = fgets($FileRead);
     $Linha = !empty($file) ? explode(";", utf8_encode($file)) : null;
     if (is_array($Linha) && count($Linha) == 12) {
         $Erro = null;
         $Objeto = array();
         $Objeto['part_os'] = $Linha[0];
         $Objeto['part_date'] = Check::Data($Linha[1]);
         $Objeto['part_nm_paciente'] = $Linha[4];
         $Objeto['part_vl_liquido'] = Check::toFloat($Linha[9]);
         $Objeto['part_vl_pago'] = Check::toFloat($Linha[10]);
         $Objeto['part_vl_debito'] = Check::toFloat($Linha[11]);
         $Linha[2] = $Linha[2] == '0' ? "418 - Sistema" : $Linha[2];
         $findUser = explode(" - ", $Linha[2])[1];
         $atendente = FindUser($findUser);
         $findCode = explode('-', $Linha[0])[0];
         $unidade = FindCod($findCode);
         if (!$atendente) {
             $Erro = true;
             $Objeto['error'] = 'Não encontrado atendente: ' . $findUser;
             $Erros[] = $Objeto;
         } else {
             $Objeto['aten_id'] = $atendente;
         }
         if (!$unidade) {
             $Erro = true;
             $Objeto['error'] = 'Não encontradoa Unidade: ' . $findCode;
             $Erros[] = $Objeto;
         } else {
             $Objeto['unid_id'] = $unidade;
Exemple #2
0
define('ALT', 1);
// Do they have authorization to use the Search engine?
if (!$_SESSION['permissions']['csearch']) {
    // No. Let them know the bad news.
    Unauthorized();
}
// Get the information of each forum.
list($aCategory, $aForum) = GetForumInfo();
// What are they wanting to do?
switch ($_REQUEST['action']) {
    case 'showresult':
        ShowResult();
    case 'query':
        Query();
    case 'finduser':
        FindUser();
    case 'getnew':
        GetNewPosts();
    case 'getdaily':
        GetDailyPosts();
}
// Search page template
require "./skins/{$CFG['skin']}/search/main.tpl.php";
// *************************************************************************** \\
function Query()
{
    // Are they searching by keyword or username?
    if (trim($_REQUEST['keywordsearch']) != '') {
        // Keyword
        KeywordSearch();
    } else {
 public static function GetUserFriendlyName($sName = '')
 {
     if (empty($sName)) {
         $oUser = self::$m_oUser;
     } else {
         $oUser = FindUser($sName);
     }
     if (is_null($oUser)) {
         return '';
     }
     return $oUser->GetFriendlyName();
 }
$sql = 'SELECT * FROM Users ORDER BY LastName, FirstName';
$result = SqlQuery($loc, $sql);
$names = array();
$names[] = "";
while ($row = $result->fetch_assoc()) {
    $names[] = $row["LastName"] . ', ' . $row["FirstName"];
}
$param_list = array(array("FieldName" => "User", "FieldType" => "Selection", "Selection" => $names, "Caption" => "User Accout"));
$doform = true;
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    DenyGuest();
    if (empty($_POST["User"])) {
        goto GenerateHtml;
    }
    $lastnamefirst = $_POST["User"];
    $newuserid = FindUser("LastNameFirst", $lastnamefirst);
    if (!$newuserid) {
        $error_msg = "Unable to find user id. (Two users with same name?)";
        $doform = true;
        goto GenerateHtml;
    }
    $newuserinfo = GetUserInfo($newuserid);
    $newusername = $newuserinfo["UserName"];
    $currentuser = GetUserName();
    log_msg($loc, 'User ' . $currentuser . ' is attemping to masquerade as ' . $newusername);
    session_unset();
    session_destroy();
    session_start();
    $okay = StartLogin($newusername, "", true);
    if ($okay === false) {
        log_msg($loc, "Login failure for masquerade.  Starting ALL over.");
            $error_msg = "Worker not in database!  Cannot assign.";
            log_error($loc, array($error_msg, "Worker Name: " . $_POST["Workers"]));
            goto SetupForm;
        }
        MakeAssignment($wid, $workerid);
        $msg = 'New Assigment: "' . $workername . '" assigned by ' . $username;
        AttachSystemNote($wid, $msg);
        goto SetupForm;
    }
    if (!empty($_POST["Remove"])) {
        if (empty($_POST["Workers"])) {
            $error_msg = "No worker found. Cannot assign.";
            goto SetupForm;
        }
        $workername = $_POST["Workers"];
        $workerid = FindUser("FullName", $workername);
        $workerinfo = GetUserInfo($workerid);
        if (!$workerinfo) {
            $error_msg = "Worker not in database!  Cannot remove.";
            log_error($loc, array($error_msg, "Worker Name: " . $_POST["Workers"]));
            goto SetupForm;
        }
        RemoveAssignment($wid, $workerid);
        $msg = 'Deleted Assignment: "' . $workername . '" unassigned by ' . $username;
        AttachSystemNote($wid, $msg);
        goto SetupForm;
    }
    DieWithMsg($loc, "Incorrect Post.");
}
SetupForm:
$pagetabtitle = "Epic " . $wo["WIDStr"];
Exemple #6
0
 if (empty($d3["errors"])) {
     $dgood = $d3;
 }
 $d4 = date_parse_from_format("m/d/y", $dt);
 if (empty($d4["errors"])) {
     $dgood = $d4;
 }
 if (empty($dgood)) {
     $error_msg = "Bad Date input.  Use yyyy-mm-dd or mm/dd/yy.";
     goto GenerateHtml;
 }
 $dtt = sprintf("%04d-%02d-%02d", $dgood["year"], $dgood["month"], $dgood["day"]);
 // Figure out who is to be used as author.
 $authorid = 0;
 if ($_POST["Author"] != "[System]") {
     $authorid = FindUser("LastNameFirst", $_POST["Author"]);
     if (!$authorid) {
         $error_msg = "Unable to find author id! ";
         $doform = true;
         goto GenerateHtml;
     }
 }
 // Fix up unspecified parameters.
 $_POST["DateNeedBy"] = $dtt;
 $_POST["Revision"] = 1;
 // Since already pre-approved, start as 1.
 $_POST["AuthorID"] = $authorid;
 $_POST["DateCreated"] = date("Y-m-d");
 $_POST["Assigned"] = 1;
 $_POST["Approved"] = 1;
 $_POST["ApprovedByCap"] = 0;
<?php

session_start();
require "scripts/check.php";
$username = $_SESSION['username'];
$userID = FindUser($username);
$_SESSION['userID'] = $userID;
if ($userID == 0) {
    ?>
<script>location.href = "index.php?login=error";</script>
<?php 
}
//get interests
$populate = file_get_contents("http://akwebservice.azurewebsites.net/populate.php?pop=1");
$listitems = json_decode($populate, true);
//get colors
$populatec = file_get_contents("http://akwebservice.azurewebsites.net/populate.php?pop=2");
$coloritems = json_decode($populatec, true);
//get avatars
$populatea = file_get_contents("http://akwebservice.azurewebsites.net/populate.php?pop=3");
$avataritems = json_decode($populatea, true);
?>

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
        <link href="css/bootstrap.css" rel="stylesheet" />
        <title></title>
    </head>