Esempio n. 1
0
 public function __construct($caseID)
 {
     $this->gremlin = new Gremlin();
     #load case's info from ID
     $sql = "SELECT * FROM cases WHERE case_id='{$caseID}'";
     $rawData = $gremlin->query($sql);
     extract($rawData);
     $this->caseID = $caseID;
     $this->teamID = $team_id;
     $this->docID = $doc_id;
     $this->procID = $proc_id;
     $this->siteID = $site_id;
     $this->status = $status;
     $this->dttm = $dttm;
     $this->cmt = $cmt;
     loadTypes();
     loadActiveAssignments();
 }
Esempio n. 2
0
<?php

global $user;
include_once '../../php/functions.php';
include_once '../../php/ajax.php';
sec_session_start();
$accountTypes = loadTypes('account_types');
$frequency = loadTypes('frequency');
ob_start();
?>

<form>
  <p class="dialog-info" class="error">
  </p>
  <table width="100%">
    <tbody>
      <tr class="form-row">
        <td><label for="account-name">Account Name:</label></td>
        <td><input type="text" id="account-name" class="xcp-form-input" name="name" /></td>
        <td><label for="account-type">Account Type:</label></td>
        <td><select id="account-type" class="chosen" name="type" data-placeholder="Select Type">
            <option/>
            <?php 
foreach ($accountTypes as $key => $type) {
    ?>
            <option value="<?php 
    echo $key;
    ?>
"><?php 
    echo $type;
    ?>
 function loadTypes($area)
 {
     global $db;
     $tags = array();
     try {
         $tagQuery = $db->prepare("SELECT * FROM tag WHERE area=:area ORDER BY typeName ASC");
         $tagQuery->execute(array(':area' => $area));
     } catch (PDOException $e) {
         exit("error in query");
     }
     while ($row = $tagQuery->fetch(PDO::FETCH_ASSOC)) {
         $tags[] = $row;
     }
     return $tags;
 }
 $tags = loadTypes($area);
 // Determine if type has changed so that we can require approval if the type requires it and it has not actually gone through an approval process.
 if ($type != $_POST['type']) {
     // Find the correct tag for the old default whiteboard type
     foreach ($tags as $tag) {
         if ($tag['typeId'] == $type) {
             $oldTag = $tag;
             break;
         }
     }
     // Find the correct tag for the new default whiteboard type
     foreach ($tags as $tag) {
         if ($tag['typeId'] == $_POST['type']) {
             $newTag = $tag['mustApprove'];
             break;
         }
Esempio n. 4
0
<?php

include_once 'class-dbconnect.php';
include_once 'config.php';
sec_session_start();
$accountTypes = loadTypes('account_types');
function checkbrute($user_id)
{
    global $dbc;
    $now = time();
    $valid_attempts = $now - 2 * 60 * 60;
    if ($stmt = $dbc->prepare("SELECT time FROM login_attempts WHERE user_id = ? AND time > '{$valid_attempts}'")) {
        $stmt->bind_param('i', $user_id);
        $stmt->execute();
        $stmt->store_result();
        if ($stmt->num_rows > 5) {
            return true;
        } else {
            return false;
        }
    }
}
function checkLogin()
{
    global $dbc;
    if (isset($_SESSION['user_id'], $_SESSION['login_string'])) {
        $user_id = $_SESSION['user_id'];
        $login_string = $_SESSION['login_string'];
        $user_browser = $_SERVER['HTTP_USER_AGENT'];
        if ($stmt = $dbc->prepare("SELECT password FROM users WHERE id = ? LIMIT 1")) {
            $stmt->bind_param('i', $user_id);
Esempio n. 5
0
<?php

include_once '../../php/functions.php';
include_once '../../php/ajax.php';
sec_session_start();
$random_salt = hash('sha512', uniqid(mt_rand(1, mt_getrandmax()), true));
$_SESSION['cipher'] = $random_salt;
$_SESSION['xcp_id'] = hash('sha512', $random_salt, $_SERVER['HTTP_USER_AGENT']);
$account = getAccount($_POST['id']);
$_SESSION['account_id'] = $account['ID'];
$accountTypes = loadTypes('account_types');
$transTypes = loadTypes('trans_types', $account['type']);
$formFields = array(array('transaction-ref' => array('class' => 'xcp-form-input', 'type' => 'text', 'label' => 'Confirmation/Ref #:', 'placeholder' => '', 'title' => ''), 'transaction-date' => array('class' => 'xcp-form-input datepicker', 'type' => 'text', 'label' => 'Transaction Date:', 'placeholder' => 'mm/dd/yyyy', 'desciption' => '')), array('transaction-source' => array('class' => 'chosen-select expense', 'type' => 'select', 'label' => 'Transaction Source:', 'data-placeholder' => 'Select Account', 'title' => '', 'options' => loadSources()), 'transaction-amount' => array('class' => 'xcp-form-input', 'type' => 'text', 'label' => 'Transaction Amount:', 'placeholder' => '', 'title' => '', 'style' => $account['due_date'] < date() ? 'color: red; font-weight:bold' : '', 'value' => number_format($account['payment'], 2))), array('transaction-type' => array('class' => 'chosen-select expense', 'type' => 'select', 'label' => 'Transaction Type:', 'data-placeholder' => 'Select Type', 'title' => '', 'options' => $transTypes), 'transaction-memo' => array('class' => 'xcp-form-input xcp-textarea', 'label' => 'Transaction Memo:', 'title' => '', 'type' => 'textarea')));
ob_start();
?>
<form id="add_transaction">
  <section id="" class="page-1 top account-detail">
  	<h2 class="account-name"><?php 
echo $account['name'];
?>
</h2>
    <table>
      <tbody>
      	<tr>
        	<td colspan="3"><h3>Account Status: <span id="account-status"></span></td>
        </tr>
        <?php 
$count = 1;
$rowCount = 4;
unset($account['user']);
foreach ($account as $key => $value) {