Example #1
0
            $get_new_users = $dbh->prepare("SELECT * FROM cm_users\n\t\t\t\tWHERE date_created >= '{$mysqldate}' AND new = 'yes'");
            $get_new_users->execute();
            $news = $get_new_users->fetchAll(PDO::FETCH_ASSOC);
            foreach ($news as $new) {
                $by = username_to_fullname($dbh, $new['username']);
                $thumb = 'people/tn_no_picture.png';
                $action_text = " signed up for ClinicCases ";
                $time_done = $new['date_created'];
                $time_formatted = extract_date_time($new['date_created']);
                $what = 'Please review this application.';
                $follow_url = CC_BASE_URL . 'index.php?i=Users.php';
                $casename = '(view here)';
                $id = null;
                $item = array('by' => $by, 'action_text' => $action_text, 'casename' => $casename, 'id' => $id, 'what' => $what, 'follow_url' => $follow_url, 'time_done' => $time_done, 'time_formatted' => $time_formatted);
                $activities[] = $item;
            }
        }
        //TODO add board posts
        //Sort the activity array
        if (!empty($activities)) {
            sortBySubkey($activities, 'time_done');
        }
        //Create RSS
        $body = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n\t\t<rss version=\"2.0\">\n\t\t<channel>\n\t\t\t<title>Latest Activity - ClinicCases - " . CC_PROGRAM_NAME . "</title>\n\t\t\t<link>" . CC_BASE_URL . "</link>\n\t\t\t<description>Notification of new case activity on ClinicCases</description>\n\t\t";
        foreach ($activities as $a) {
            $body .= "<item>\n\t\t\t\t\t<title>" . $a['by'] . " " . $a['action_text'] . $a['casename'] . "</title>\n\t\t\t\t\t<link>" . $a['follow_url'] . "</link>\n\t\t\t\t\t<description> <![CDATA[" . $a['what'] . "]]> </description>\n\t\t\t\t\t<pubDate>" . $a['time_done'] . "</pubDate>\n\t\t\t\t\t</item>\n\t\t\t\t\t";
        }
        $body .= "</channel></rss>";
        echo $body;
    }
}
 } catch (Exception $e) {
     $email = BaseDonnee::getByUsername($bdd, "admin")["Email"];
     $object = $row["Name"] . " Wallet ne répond pas";
     $from = '*****@*****.**';
     $header = 'From:' . $from;
     $message = "Le wallet " . $row["Name"] . " semble avoir un problème et a été désactivée automatiquement.\nVeuillez le redemarrer et le réactiver dans le panel admin.\n";
     BaseDonnee::setState($bdd, $row["Name"], 1);
     if (mail($email, $object, $message, $header)) {
         echo "mail sent";
     } else {
         echo "mail failed";
     }
 }
 /*Selectionne toutes les transactions depuis ce dernier hash.
   Tri par timestamp croissant */
 sortBySubkey($transactionsInfo["transactions"], 'timereceived');
 $sortedTransactionInfos = $transactionsInfo["transactions"];
 var_dump($sortedTransactionInfos);
 //On parcourt toutes les transactions restantes dans l'ordre chronologique
 foreach ($sortedTransactionInfos as $transaction) {
     /*Theoriquement, si les withdrawals ont été supprimé, il n'y aura pas de send à archiver.
      * De plus, les trades étant realisé via seulement des "move", tous les "receive" sont forcemment des deposits
      * Nous allons ici archiver en BDD seulement les deposits, afin de s'assurer que la balance ne sera pas actualisée 2 fois.
      * La transaction doit avoir au minimum 4 confirmations pour être acceptée*/
     if ($transaction["category"] == "receive" && intval($transaction["confirmations"]) >= 1) {
         $amount = (double) sprintf("%.8f", $transaction["amount"]);
         $account = $transaction["account"];
         $address = $transaction["address"];
         $txid = $transaction["txid"];
         $newhash = $transaction["blockhash"];
         //On regarde si le dépot était destiné à un vote (seulement pour BTC)
Example #3
0
    $sql = "SELECT {$col_vals}, cm_case_assignees.case_id, cm_case_assignees.username FROM cm, cm_case_assignees WHERE cm.id = cm_case_assignees.case_id AND cm_case_assignees.username =  :username AND cm_case_assignees.status =  'active'";
} elseif ($_SESSION['permissions']['view_all_cases'] == "1") {
    //admin or super user type query - Users who can access all cases and "work" on all cases.
    $sql = "SELECT {$col_vals} FROM cm";
} else {
    echo "There is configuration error in your groups.";
    die;
}
$case_query = $dbh->prepare($sql);
$case_query->bindParam(':username', $user);
$case_query->execute();
if ($_SESSION['mobile']) {
    //mobile does not need json, so return a php array
    $raw_results = $case_query->fetchAll();
    //used for mobile
    sortBySubkey($raw_results, 'last_name');
} else {
    //Create array of column names for json output
    foreach ($col_result as $value) {
        if ($value[3] == "true") {
            $cols[] = $value[1];
        }
    }
    while ($result = $case_query->fetch(PDO::FETCH_ASSOC)) {
        $rows = array();
        //loop through results, create array, convert to json
        foreach ($cols as $col) {
            //First look for fields containining serialized arrays
            //and convert to strings
            $data = @unserialize($result[$col]);
            if ($data !== false) {
    $q->execute();
    $adverse = $q->fetchAll(PDO::FETCH_ASSOC);
    foreach ($adverse as $ad) {
        $contact_name = $contact['first_name'] . ' ' . $contact['last_name'];
        if (!$contact['type']) {
            $contact_type = "contact";
        } else {
            $contact_type = $contact['type'];
        }
        similar_text($contact_name, $ad['name'], $per);
        if ($per >= 80) {
            $conflicts[] = array('percentage' => $per, 'text' => "A party named <strong> " . $ad['name'] . " </strong> was adverse in the <a href='index.php?i=Cases.php#cases/" . $ad['case_id'] . "' target='_new'>" . case_id_to_casename($dbh, $ad['case_id']) . "</a> case. {$contact_name} is a\n\t\t\t{$contact_type} in this case. (" . round($per, 2) . " % match)");
        }
    }
}
//Return the data
$count = count($conflicts);
if ($type === 'alert') {
    if ($count > 0) {
        $return = array('conflicts' => true, 'number' => $count);
        echo json_encode($return);
    } else {
        $return = array('conflicts' => false);
        echo json_encode($return);
    }
} else {
    if ($count > 0) {
        sortBySubkey($conflicts, 'percentage');
    }
    include '../../../html/templates/interior/cases_conflicts.php';
}