function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->well_child = new FormWellChild($_POST['id']);
     parent::populate_object($this->well_child);
     $new_form = false;
     if (empty($_POST['id'])) {
         $new_form = true;
     }
     $this->well_child->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     if ($new_form) {
         addForm($GLOBALS['encounter'], "Well Child Visit", $this->well_child->id, "well_child", $GLOBALS['pid'], $_SESSION['userauthorized']);
     }
     if (!empty($_POST['cpt_code'])) {
         $sql = "select * from codes where code ='" . mysql_real_escape_string($_POST['cpt_code']) . "' order by id";
         $results = sqlQ($sql);
         $row = mysql_fetch_array($results);
         if (!empty($row)) {
             addBilling(date("Ymd"), 'CPT4', $row['code'], $row['code_text'], $_SESSION['pid'], $_SESSION['userauthorized'], $_SESSION['authUserID'], $row['modifier'], $row['units'], $row['fee']);
         }
     }
     $_POST['process'] = "";
     return;
 }
 public function __construct()
 {
     /*($_SERVER['REQUEST_METHOD'], $this->getUrl(), 
       $this->getHeaders());
       */
     if (isset($_POST)) {
         $post_data = $_POST;
         // If charset specified, convert back to upstream charset before adding.
         if (Conf::$default_upstream_charset) {
             array_walk($post_data, function (&$value) {
                 $value = mb_convert_encoding($value, Conf::$default_upstream_charset, 'utf-8');
             });
         }
         if ($this->getPostEncType() == self::POST_ENC_TYPE_MULTIPART) {
             // First unset the original content type header. addForm() will automatically add it
             // with it's own boundary value.
             $this->setHeader('Content-Type', NULL);
             $this->getBody(addForm($_POST));
         } else {
             $this->getBody($post_data);
         }
         Log::add($post_data, 'post_data');
     }
     /*
     $this->setOptions(
         [                
             'connecttimeout' => Conf::$proxy_http_request_connecttimeout,
             'dns_cache_timeout' => Conf::$proxy_http_request_dns_cache_timeout,
             'retrycount' => Conf::$proxy_http_request_retrycount,
             'timeout' => Conf::$proxy_http_request_timeout
         ]);
     */
     //Log::add($this->__toString(), 'ProxyHttpRequest->__toString()');
 }
/**
 * List search results
 * @param array $res Array containing results of search
 * @param bool $includesource If true, adds backend column to address listing
 */
function addr_display_result($res, $includesource = true)
{
    global $PHP_SELF, $oTemplate, $oErrorHandler;
    //FIXME: no HTML output from core
    echo addForm($PHP_SELF, 'post', 'addressbook', '', '', array(), TRUE) . addHidden('html_addr_search_done', 'true');
    addr_insert_hidden();
    $oTemplate->assign('compose_addr_pop', false);
    $oTemplate->assign('include_abook_name', $includesource);
    $oTemplate->assign('addresses', formatAddressList($res));
    $oTemplate->display('addrbook_search_list.tpl');
    echo '</form>';
}
Пример #4
0
function do_visit_form($irow, $encounter, $first)
{
    global $insert_count, $debug, $verbose;
    $pid = $irow['pid'];
    // If a gcac form already exists for this visit, get out.
    $row = sqlQuery("SELECT COUNT(*) AS count FROM forms WHERE " . "pid = '{$pid}' AND encounter = '{$encounter}' AND " . "formdir = 'LBFgcac' AND deleted = 0");
    if ($row['count']) {
        echo "<br />*** Visit {$pid}.{$encounter} skipped, already has a GCAC visit form ***\n";
        return;
    }
    $a = array('client_status' => $irow['client_status'], 'in_ab_proc' => $irow['in_ab_proc'], 'ab_location' => $irow['ab_location'], 'complications' => $irow['fol_compl'], 'contrameth' => $irow['contrameth']);
    // logic that applies only to the first related visit
    if ($first) {
        if ($a['ab_location'] == 'ma') {
            $a['ab_location'] = 'proc';
        }
        $a['complications'] = $irow['rec_compl'];
        $a['contrameth'] = '';
    }
    $newid = 0;
    $didone = false;
    foreach ($a as $field_id => $value) {
        if ($value !== '') {
            if ($newid) {
                $query = "INSERT INTO lbf_data " . "( form_id, field_id, field_value ) " . " VALUES ( '{$newid}', '{$field_id}', '{$value}' )";
                if ($verbose) {
                    echo "<br />{$query}\n";
                }
                if (!$debug) {
                    sqlStatement($query);
                }
            } else {
                $query = "INSERT INTO lbf_data " . "( field_id, field_value ) " . " VALUES ( '{$field_id}', '{$value}' )";
                if ($verbose) {
                    echo "<br />{$query}\n";
                }
                if (!$debug) {
                    $newid = sqlInsert($query);
                }
            }
            $didone = true;
        }
    }
    if ($newid && !$debug) {
        addForm($encounter, 'IPPF GCAC', $newid, 'LBFgcac', $pid, 1);
        ++$insert_count;
    }
    if (!$didone) {
        echo "<br />*** Empty issue skipped for visit {$pid}.{$encounter} ***\n";
    }
}
Пример #5
0
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->prior_auth = new FormPriorAuth($_POST['id']);
     parent::populate_object($this->prior_auth);
     $this->prior_auth->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     addForm($GLOBALS['encounter'], "Prior Authorization Form", $this->prior_auth->id, "prior_auth", $GLOBALS['pid'], $_SESSION['userauthorized']);
     $_POST['process'] = "";
     return;
 }
Пример #6
0
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->hptje_primary = new FormHpTjePrimary($_POST['id']);
     parent::populate_object($this->hptje_primary);
     $this->hptje_primary->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     addForm($GLOBALS['encounter'], "Head Pain TJE", $this->hptje_primary->id, "hp_tje_primary", $GLOBALS['pid'], $_SESSION['userauthorized']);
     $_POST['process'] = "";
     return;
 }
Пример #7
0
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->form = new FormSOAP($_POST['id']);
     parent::populate_object($this->form);
     $this->form->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     if (empty($_POST['id'])) {
         addForm($GLOBALS['encounter'], "SOAP", $this->form->id, "soap2", $GLOBALS['pid'], $_SESSION['userauthorized']);
         $_POST['process'] = "";
     }
     return;
 }
/**
 * List search results
 * @param array $res Array containing results of search
 * @param bool $includesource If true, adds backend column to address listing
 */
function addr_display_result($res, $includesource = true)
{
    global $color, $javascript_on, $PHP_SELF, $squirrelmail_language;
    if (sizeof($res) <= 0) {
        return;
    }
    echo addForm($PHP_SELF, 'POST', 'addrbook') . addHidden('html_addr_search_done', 'true');
    addr_insert_hidden();
    $line = 0;
    if ($javascript_on) {
        print '<script language="JavaScript" type="text/javascript">' . "\n<!-- \n" . "function CheckAll(ch) {\n" . "   for (var i = 0; i < document.addrbook.elements.length; i++) {\n" . "       if( document.addrbook.elements[i].type == 'checkbox' &&\n" . "           document.addrbook.elements[i].name.substr(0,16) == 'send_to_search['+ch ) {\n" . "           document.addrbook.elements[i].checked = !(document.addrbook.elements[i].checked);\n" . "       }\n" . "   }\n" . "}\n" . "//-->\n" . "</script>\n";
        $chk_all = '<a href="#" onClick="CheckAll(\'T\');">' . _("All") . '</a>&nbsp;<font color="' . $color[9] . '">' . _("To") . '</font>' . '&nbsp;&nbsp;' . '<a href="#" onClick="CheckAll(\'C\');">' . _("All") . '</a>&nbsp;<font color="' . $color[9] . '">' . _("Cc") . '</font>' . '&nbsp;&nbsp;' . '<a href="#" onClick="CheckAll(\'B\');">' . _("All") . '</a>';
    } else {
        // check_all links are implemented only in JavaScript. disable links in js=off environment.
        $chk_all = '';
    }
    echo html_tag('table', '', 'center', '', 'border="0" width="98%"') . html_tag('tr', '', '', $color[9]) . html_tag('th', '&nbsp;' . $chk_all, 'left') . html_tag('th', '&nbsp;' . _("Name"), 'left') . html_tag('th', '&nbsp;' . _("E-mail"), 'left') . html_tag('th', '&nbsp;' . _("Info"), 'left');
    if ($includesource) {
        echo html_tag('th', '&nbsp;' . _("Source"), 'left', '', 'width="10%"');
    }
    echo "</tr>\n";
    foreach ($res as $row) {
        $email = AddressBook::full_address($row);
        if ($line % 2) {
            $tr_bgcolor = $color[12];
        } else {
            $tr_bgcolor = $color[4];
        }
        if ($squirrelmail_language == 'ja_JP') {
            echo html_tag('tr', '', '', $tr_bgcolor, 'nowrap') . html_tag('td', '<input type="checkbox" name="send_to_search[T' . $line . ']" value = "' . htmlspecialchars($email) . '" />&nbsp;' . _("To") . '&nbsp;' . '<input type="checkbox" name="send_to_search[C' . $line . ']" value = "' . htmlspecialchars($email) . '" />&nbsp;' . _("Cc") . '&nbsp;' . '<input type="checkbox" name="send_to_search[B' . $line . ']" value = "' . htmlspecialchars($email) . '" />&nbsp;' . _("Bcc") . '&nbsp;', 'center', '', 'width="5%" nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['lastname']) . ' ' . htmlspecialchars($row['firstname']) . '&nbsp;', 'left', '', 'nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['email']) . '&nbsp;', 'left', '', 'nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['label']) . '&nbsp;', 'left', '', 'nowrap');
        } else {
            echo html_tag('tr', '', '', $tr_bgcolor, 'nowrap') . html_tag('td', addCheckBox('send_to_search[T' . $line . ']', FALSE, $email) . '&nbsp;' . _("To") . '&nbsp;' . addCheckBox('send_to_search[C' . $line . ']', FALSE, $email) . '&nbsp;' . _("Cc") . '&nbsp;' . addCheckBox('send_to_search[B' . $line . ']', FALSE, $email) . '&nbsp;' . _("Bcc") . '&nbsp;', 'center', '', 'width="5%" nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['name']) . '&nbsp;', 'left', '', 'nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['email']) . '&nbsp;', 'left', '', 'nowrap') . html_tag('td', '&nbsp;' . htmlspecialchars($row['label']) . '&nbsp;', 'left', '', 'nowrap');
        }
        if ($includesource) {
            echo html_tag('td', '&nbsp;' . $row['source'] . '&nbsp;', 'left', '', 'nowrap');
        }
        echo "</tr>\n";
        $line++;
    }
    if ($includesource) {
        $td_colspan = '5';
    } else {
        $td_colspan = '4';
    }
    echo html_tag('tr', html_tag('td', '<input type="submit" name="addr_search_done" value="' . _("Use Addresses") . '" /> ' . '<input type="submit" name="addr_search_cancel" value="' . _("Cancel") . '" />', 'center', '', 'colspan="' . $td_colspan . '"')) . '</table>' . addHidden('html_addr_search_done', '1') . '</form>';
}
Пример #9
0
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->form = new FormLegLength($_POST['id']);
     parent::populate_object($this->form);
     $this->form->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     if (empty($_POST['id'])) {
         addForm($GLOBALS['encounter'], "Extremities measurements", $this->form->id, "leg_length", $GLOBALS['pid'], $_SESSION['userauthorized']);
         $_POST['process'] = "";
     }
     return;
 }
Пример #10
0
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->ros = new FormROS($_POST['id']);
     parent::populate_object($this->ros);
     $this->ros->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     if (empty($_POST['id'])) {
         addForm($GLOBALS['encounter'], "Review Of Systems", $this->ros->id, "ros", $GLOBALS['pid'], $_SESSION['userauthorized']);
         $_POST['process'] = "";
     }
     return;
 }
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->form = new FormActivityImpact($_POST['id']);
     parent::populate_object($this->form);
     $this->form->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     if (empty($_POST['id'])) {
         addForm($GLOBALS['encounter'], "Impact of Activities of Daily Living", $this->form->id, "activity_impact", $GLOBALS['pid'], $_SESSION['userauthorized']);
         $_POST['process'] = "";
     }
     return;
 }
Пример #12
0
function put_print_form()
{
    global $DB, $pagename;
    $langs = $DB->q('KEYTABLE SELECT langid AS ARRAYKEY, name, extensions FROM language
	                 WHERE allow_submit = 1 ORDER BY name');
    echo "<script type=\"text/javascript\">\n<!--\n";
    echo "function detectLanguage(filename)\n\t{\n\t\tvar parts = filename.toLowerCase().split('.').reverse();\n\t\tif ( parts.length < 2 ) return;\n\n\t\t// language ID\n\n\t\tvar elt=document.getElementById('langid');\n\t\t// the 'autodetect' option has empty value\n\t\tif ( elt.value != '' ) return;\n\n\t\tvar langid = getMainExtension(parts[0]);\n\t\tfor (i=0;i<elt.length;i++) {\n\t\t\tif ( elt.options[i].value == langid ) {\n\t\t\t\telt.selectedIndex = i;\n\t\t\t}\n\t\t}\n\n\t}\n";
    putgetMainExtension($langs);
    echo "// -->\n</script>\n";
    echo addForm($pagename, 'post', null, 'multipart/form-data');
    ?>

	<table>
	<tr><td><label for="code">File</label>:</td>
	<td><input type="file" name="code" id="code" size="40" required onChange='detectLanguage(document.getElementById("code").value);' /></td>
	</tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<tr><td><label for="langid">Language</label>:</td>
	    <td><?php 
    $langlist = array();
    foreach ($langs as $langid => $langdata) {
        $langlist[$langid] = $langdata['name'];
    }
    $langlist[''] = 'plain text';
    echo addSelect('langid', $langlist, '', true);
    ?>
</td>
	</tr>
	<tr><td colspan="2">&nbsp;</td></tr>
	<tr><td></td>
	    <td><?php 
    echo addSubmit('Print code', 'submit');
    ?>
</td>
	</tr>
	</table>

	<?php 
    echo addEndForm();
}
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->evaluation = new FormEvaluation($_POST['id']);
     parent::populate_object($this->evaluation);
     $this->evaluation->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     addForm($GLOBALS['encounter'], "Evaluation Form", $this->evaluation->id, "evaluation", $GLOBALS['pid'], $_SESSION['userauthorized']);
     if (!empty($_POST['cpt_code'])) {
         $sql = "select * from codes where code ='" . add_escape_custom($_POST['cpt_code']) . "' order by id";
         $results = sqlQ($sql);
         $row = sqlFetchArray($results);
         if (!empty($row)) {
             addBilling(date("Ymd"), 'CPT4', $row['code'], $row['code_text'], $_SESSION['pid'], $_SESSION['userauthorized'], $_SESSION['authUserID'], $row['modifier'], $row['units'], $row['fee']);
         }
     }
     $_POST['process'] = "";
     return;
 }
function todaysEncounter($patient_id, $reason = '')
{
    global $today, $userauthorized;
    if (empty($reason)) {
        $reason = xl('Please indicate visit reason');
    }
    // Was going to use the existing encounter for today if there is one, but
    // decided it's right to always create a new one.  Leaving the code here
    // (and corresponding function above) in case it is ever wanted later.
    /*******************************************************************
      $encounter = todaysEncounterIf($patient_id);
      if ($encounter) return $encounter;
      *******************************************************************/
    $tmprow = sqlQuery("SELECT username, facility, facility_id FROM users " . "WHERE id = ?", array($_SESSION["authUserID"]));
    $username = $tmprow['username'];
    $facility = $tmprow['facility'];
    $facility_id = $tmprow['facility_id'];
    $conn = $GLOBALS['adodb']['db'];
    $encounter = $conn->GenID("sequences");
    $provider_id = $userauthorized ? $_SESSION['authUserID'] : 0;
    addForm($encounter, "New Patient Encounter", sqlInsert("INSERT INTO form_encounter SET date = ?, onset_date = ?, " . "reason = ?, facility = ?, facility_id = ?, pid = ?, encounter = ?, " . "provider_id = ?", array($today, $today, $reason, $facility, $facility_id, $patient_id, $encounter, $provider_id)), "newpatient", $patient_id, $userauthorized, "NOW()", $username);
    return $encounter;
}
 function default_action_process()
 {
     if ($_POST['process'] != "true") {
         return;
     }
     $this->prosthesis = new FormProsthesis($_POST['id']);
     parent::populate_object($this->prosthesis);
     $this->prosthesis->persist();
     if ($GLOBALS['encounter'] == "") {
         $GLOBALS['encounter'] = date("Ymd");
     }
     addForm($GLOBALS['encounter'], "Prosthesis & Orthotics Form", $this->prosthesis->id, "prosthesis", $GLOBALS['pid'], $_SESSION['userauthorized']);
     if (!empty($_POST['cpt_code'])) {
         $sql = "select * from codes where code ='" . mysql_real_escape_string($_POST['cpt_code']) . "' order by id";
         $results = sqlQ($sql);
         $row = mysql_fetch_array($results);
         if (!empty($row)) {
             addBilling(date("Ymd"), 'CPT4', $row['code'], $row['code_text'], $_SESSION['pid'], $_SESSION['userauthorized'], $_SESSION['authUserID'], $row['modifier'], $row['units'], $row['fee']);
         }
     }
     $_POST['process'] = "";
     return;
 }
Пример #16
0
/**
 * Returns a form to rejudge all judgings based on a (table,id)
 * pair. For example, to rejudge all for language 'java', call
 * as rejudgeForm('language', 'java').
 */
function rejudgeForm($table, $id)
{
    $ret = addForm('rejudge.php') . addHidden('table', $table) . addHidden('id', $id);
    $button = 'REJUDGE this submission';
    $question = "Rejudge submission s{$id}?";
    $disabled = false;
    $allbutton = false;
    // special case submission
    if ($table == 'submission') {
        // disable the form button if there are no valid judgings anyway
        // (nothing to rejudge) or if the result is already correct
        global $DB;
        $validresult = $DB->q('MAYBEVALUE SELECT result FROM judging WHERE
		                       submitid = %i AND valid = 1', $id);
        if (IS_ADMIN) {
            if (!$validresult) {
                $question = "Restart judging of PENDING submission s{$id}, " . 'are you sure?';
                $button = 'RESTART judging';
            } elseif ($validresult == 'correct') {
                $question = "Rejudge CORRECT submission s{$id}, " . 'are you sure?';
            }
        } else {
            if (!$validresult || $validresult == 'correct') {
                $disabled = true;
            }
        }
    } else {
        $button = "REJUDGE ALL for {$table} {$id}";
        $question = "Rejudge all submissions for this {$table}?";
        if (IS_ADMIN) {
            $allbutton = true;
        }
    }
    $ret .= '<input type="submit" value="' . htmlspecialchars($button) . '" ' . ($disabled ? 'disabled="disabled"' : 'onclick="return confirm(\'' . htmlspecialchars($question) . '\');"') . " />\n" . ($allbutton ? addCheckBox('include_all') . '<label for="include_all">include pending/correct submissions</label>' : '') . addCheckBox('full_rejudge') . '<label for="full_rejudge">create rejudging with reason: </label>' . addInput('reason', '', 0, 255) . addEndForm();
    return $ret;
}
Пример #17
0
    $restrictions['judged'] = 0;
}
if ($viewtypes[$view] == 'diff') {
    $restrictions['rejudgingdiff'] = 1;
}
if (isset($_REQUEST['old_verdict']) && $_REQUEST['old_verdict'] != 'all') {
    $restrictions['old_result'] = $_REQUEST['old_verdict'];
}
if (isset($_REQUEST['new_verdict']) && $_REQUEST['new_verdict'] != 'all') {
    $restrictions['result'] = $_REQUEST['new_verdict'];
}
echo "<p>Show submissions:</p>\n" . addForm($pagename, 'get') . addHidden('id', $id);
for ($i = 0; $i < count($viewtypes); ++$i) {
    echo addSubmit($viewtypes[$i], 'view[' . $i . ']', null, $view != $i);
}
if (isset($_REQUEST['old_verdict'])) {
    echo addHidden('old_verdict', $_REQUEST['old_verdict']);
}
if (isset($_REQUEST['new_verdict'])) {
    echo addHidden('new_verdict', $_REQUEST['new_verdict']);
}
echo addEndForm() . "<br />\n";
echo addForm($pagename, 'get') . addHidden('id', $id) . addHidden("view[{$view}]", $viewtypes[$view]);
$verdicts = array_keys($verdicts);
array_unshift($verdicts, 'all');
echo "old verdict: " . addSelect('old_verdict', $verdicts, isset($_REQUEST['old_verdict']) ? $_REQUEST['old_verdict'] : 'all');
echo ", new verdict: " . addSelect('new_verdict', $verdicts, isset($_REQUEST['new_verdict']) ? $_REQUEST['new_verdict'] : 'all');
echo addSubmit('filter') . addEndForm();
echo addForm($pagename, 'get') . addHidden('id', $id) . addHidden("view[{$view}]", $viewtypes[$view]) . addSubmit('clear') . addEndForm() . "<br /><br />\n";
putSubmissions($cdatas, $restrictions);
require LIBWWWDIR . '/footer.php';
Пример #18
0
        }
        if ($use_folder == true) {
            $box[$q] = htmlspecialchars($boxes_all[$i]['unformatted-dm']);
            $box2[$q] = htmlspecialchars(imap_utf7_decode_local($boxes_all[$i]['unformatted-disp']));
            $q++;
        }
    }
    if ($box && $box2) {
        echo addForm('folders_subscribe.php?method=sub') . '<tt><select name="mailbox[]" multiple="multiple" size="8">';
        for ($q = 0; $q < count($box); $q++) {
            echo '         <option value="' . $box[$q] . '">' . $box2[$q] . "</option>\n";
        }
        echo '</select></tt><br /><br />' . '<input type="submit" value="' . _("Subscribe") . "\" />\n" . "</form></td></tr></table><br />\n";
    } else {
        echo _("No folders were found to subscribe to!") . '</td></tr></table>';
    }
} else {
    /* don't perform the list action -- this is much faster */
    echo addForm('folders_subscribe.php?method=sub') . _("Subscribe to:") . '<br />' . '<tt><input type="text" name="mailbox[]" size="35" />' . '<input type="submit" value="' . _("Subscribe") . "\" />\n" . "</form></td></tr></table><br />\n";
}
do_hook('folders_bottom');
?>
    </td></tr>
    </table>
</td></tr>
</table>
<?php 
sqimap_logout($imapConnection);
?>
</body></html>
Пример #19
0
include_once "{$srcdir}/api.inc";
include_once "{$srcdir}/forms.inc";
include_once "{$srcdir}/calendar.inc";
include_once "{$srcdir}/lists.inc";
$frmn = 'form_plist';
$ftitle = 'Problem list';
$old = sqlStatement("select form_id, formdir from forms where (form_name='{$ftitle}') and (pid={$pid}) order by date desc limit 1");
if ($old) {
    $dt = sqlFetchArray($old);
    $fid = $dt['form_id'];
    if ($fid && $fid != 0 && $fid != '') {
        $fdir = $dt['formdir'];
        unset($dt);
        $dt = formFetch($frmn, $fid);
        $newid = formSubmit($frmn, array_slice($dt, 7), $id, $userauthorized);
        addForm($encounter, $ftitle, $newid, $fdir, $pid, $userauthorized);
        $id = $newid;
        formJump("{$rootdir}/patient_file/encounter/view_form.php?formname={$fdir}&id={$newid}");
        exit;
    }
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<?php 
html_header_show();
?>
<link rel="stylesheet" href="<?php 
Пример #20
0
sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
sqgetGlobalVar('mailbox', $mailbox, SQ_POST);
/* end globals */
if ($mailbox == '') {
    displayPageHeader($color, 'None');
    plain_error_message(_("You have not selected a folder to delete. Please do so.") . '<br /><a href="../src/folders.php">' . _("Click here to go back") . '</a>.', $color);
    exit;
}
if (sqgetGlobalVar('backingout', $tmp, SQ_POST)) {
    $location = get_location();
    header("Location: {$location}/folders.php");
    exit;
}
if (!sqgetGlobalVar('confirmed', $tmp, SQ_POST)) {
    displayPageHeader($color, 'None');
    echo '<br />' . html_tag('table', '', 'center', '', 'width="95%" border="0"') . html_tag('tr', html_tag('td', '<b>' . _("Delete Folder") . '</b>', 'center', $color[0])) . html_tag('tr') . html_tag('td', '', 'center', $color[4]) . sprintf(_("Are you sure you want to delete %s?"), str_replace(array(' ', '<', '>'), array('&nbsp;', '&lt;', '&gt;'), imap_utf7_decode_local($mailbox))) . addForm('folders_delete.php', 'post') . "<p>\n" . addHidden('mailbox', $mailbox) . addSubmit(_("Yes"), 'confirmed') . addSubmit(_("No"), 'backingout') . '</p></form><br /></td></tr></table>';
    exit;
}
$imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
$boxes = sqimap_mailbox_list($imap_stream);
$numboxes = count($boxes);
global $delete_folder;
if (substr($mailbox, -1) == $delimiter) {
    $mailbox_no_dm = substr($mailbox, 0, strlen($mailbox) - 1);
} else {
    $mailbox_no_dm = $mailbox;
}
/** lets see if we CAN move folders to the trash.. otherwise,
 ** just delete them **/
if (isset($delete_folder) && $delete_folder || eregi('^' . $trash_folder . '.+', $mailbox)) {
    $can_move_to_trash = FALSE;
Пример #21
0
}
?>

<?php 
// If the user requested attachment of any orphaned procedure orders, do it.
if (!empty($_GET['attachid'])) {
    $attachid = explode(',', $_GET['attachid']);
    foreach ($attachid as $aid) {
        $aid = intval($aid);
        if (!$aid) {
            continue;
        }
        $tmp = sqlQuery("SELECT COUNT(*) AS count FROM procedure_order WHERE " . "procedure_order_id = ? AND patient_id = ? AND encounter_id = 0 AND activity = 1", array($aid, $pid));
        if (!empty($tmp['count'])) {
            sqlStatement("UPDATE procedure_order SET encounter_id = ? WHERE " . "procedure_order_id = ? AND patient_id = ? AND encounter_id = 0 AND activity = 1", array($encounter, $aid, $pid));
            addForm($encounter, "Procedure Order", $aid, "procedure_order", $pid, $userauthorized);
        }
    }
}
?>

<script type="text/javascript">
$.noConflict();
jQuery(document).ready( function($) {
	var formConfig = <?php 
echo $esignApi->formConfigToJson();
?>
;
    $(".esign-button-form").esign( 
    	formConfig,
        { 	    
Пример #22
0
     }
     echo "</table>\n";
 }
 // Show JS toggle of previous submission results.
 if ($lastjud !== NULL) {
     echo "<span class=\"testcases_prev\">" . "<a href=\"javascript:togglelastruns();\">show/hide</a> results of previous " . "<a href=\"submission.php?id={$lastsubmitid}\">submission s{$lastsubmitid}</a>" . (empty($lastjud['verify_comment']) ? '' : "<span class=\"prevsubmit\"> (verify comment: '" . $lastjud['verify_comment'] . "')</span>") . "</span>";
 }
 // display following data only when the judging has been completed
 if ($judging_ended) {
     // display verification data: verified, by whom, and comment.
     // only if this is a valid judging, otherwise irrelevant
     if ($jud['valid'] || isset($jud['rejudgingid']) && $jud['rvalid']) {
         $verification_required = dbconfig_get('verification_required', 0);
         if (!($verification_required && $jud['verified'])) {
             $val = !$jud['verified'];
             echo addForm('verify.php') . addHidden('id', $jud['judgingid']) . addHidden('val', $val) . addHidden('redirect', @$_SERVER['HTTP_REFERER']);
         }
         echo "<p>Verified: " . "<strong>" . printyn($jud['verified']) . "</strong>";
         if ($jud['verified'] && !empty($jud['jury_member'])) {
             echo ", by " . specialchars($jud['jury_member']);
             if (!empty($jud['verify_comment'])) {
                 echo ' with comment "' . specialchars($jud['verify_comment']) . '"';
             }
         }
         if (!($verification_required && $jud['verified'])) {
             echo '; ' . addSubmit(($val ? '' : 'un') . 'mark verified', 'verify');
             if ($val) {
                 echo ' with comment ' . addInput('comment', '', 25);
             }
             echo "</p>" . addEndForm();
         } else {
Пример #23
0
<?php

//------------Forms generated from formsWiz
include_once "../../globals.php";
include_once "{$srcdir}/api.inc";
include_once "{$srcdir}/forms.inc";
foreach ($_POST as $k => $var) {
    $_POST[$k] = mysql_escape_string($var);
    echo "{$var}\n";
}
if ($encounter == "") {
    $encounter = date("Ymd");
}
if ($_GET["mode"] == "new") {
    $newid = formSubmit("form_dictation", $_POST, $_GET["id"], $userauthorized);
    addForm($encounter, "Speech Dictation", $newid, "dictation", $pid, $userauthorized);
} elseif ($_GET["mode"] == "update") {
    sqlInsert("update form_dictation set pid = {$_SESSION["pid"]},groupname='" . $_SESSION["authProvider"] . "',user='******',authorized={$userauthorized},activity=1, date = NOW(), dictation='" . $_POST["dictation"] . "', additional_notes='" . $_POST["additional_notes"] . "' where id={$id}");
}
$_SESSION["encounter"] = $encounter;
formHeader("Redirecting....");
formJump();
formFooter();
Пример #24
0
/**
 * Function to output a complete scoreboard.
 * This takes care of outputting the headings, start/endtimes and footer
 * of the scoreboard. It calls genScoreBoard to generate the data and
 * renderScoreBoardTable for displaying the actual table.
 *
 * Arguments:
 * $cdata       current contest data, as from an index in 'getCurContests(TRUE)'
 * $myteamid    set to highlight that teamid in the scoreboard
 * $static      generate a static scoreboard, e.g. for external use
 * $filter      set to TRUE to generate filter options, or pass array
 *              with keys 'affilid', 'country', 'categoryid' pointing
 *              to array of values to filter on these.
 * $sdata       if not NULL, use this as scoreboard data instead of fetching it locally
 */
function putScoreBoard($cdata, $myteamid = NULL, $static = FALSE, $filter = FALSE, $sdata = NULL)
{
    global $DB, $pagename;
    if (empty($cdata)) {
        echo "<p class=\"nodata\">No active contest</p>\n";
        return;
    }
    $fdata = calcFreezeData($cdata);
    if ($sdata === NULL) {
        $sdata = genScoreBoard($cdata, IS_JURY, $filter);
    }
    // page heading with contestname and start/endtimes
    echo '<div class="score-head">';
    echo "<h1>Scoreboard " . htmlspecialchars($cdata['name']) . "</h1>\n\n";
    if ($fdata['showfinal']) {
        echo "<h4>final standings</h4>\n\n";
    } elseif (!$fdata['cstarted']) {
        echo "<h4>" . printContestStart($cdata) . "</h4>\n\n";
        // Stop here (do not leak problem number, descriptions etc).
        // Alternatively we could only display the list of teams?
        if (!IS_JURY) {
            return;
        }
    } else {
        echo "<h4>starts: " . printtime($cdata['starttime']) . " - ends: " . printtime($cdata['endtime']);
        if ($fdata['showfrozen']) {
            echo " (";
            if (IS_JURY) {
                echo '<a href="../public/">the public scoreboard</a> is ';
            }
            echo "frozen since " . printtime($cdata['freezetime']) . ")";
        }
        echo "</h4>\n\n";
    }
    echo '</div>';
    // The static scoreboard does not support filtering
    if ($filter !== FALSE && $static !== TRUE) {
        $categids = $DB->q('KEYVALUETABLE SELECT categoryid, name FROM team_category ' . (IS_JURY ? '' : 'WHERE visible = 1 '));
        // show only affilids/countries with visible teams
        if (empty($categids)) {
            $affils = array();
        } else {
            $affils = $DB->q('KEYTABLE SELECT affilid AS ARRAYKEY,
			                  team_affiliation.name, country
			                  FROM team_affiliation
			                  LEFT JOIN team t USING (affilid)
			                  INNER JOIN contest c ON (c.cid = %i)
			                  LEFT JOIN contestteam ct ON (ct.teamid = t.teamid AND ct.cid = c.cid)
			                  WHERE categoryid IN (%As) AND c.cid = %i AND
			                  (c.public = 1 OR ct.teamid IS NOT NULL)
			                  GROUP BY affilid', $cdata['cid'], array_keys($categids), $cdata['cid']);
        }
        $affilids = array();
        $countries = array();
        foreach ($affils as $id => $affil) {
            $affilids[$id] = $affil['name'];
            if (isset($affil['country'])) {
                $countries[] = $affil['country'];
            }
        }
        $countries = array_unique($countries);
        sort($countries);
        $filteron = array();
        $filtertext = "";
        foreach (array('affilid' => 'affiliation', 'country' => 'country', 'categoryid' => 'category') as $type => $text) {
            if (isset($filter[$type])) {
                $filteron[] = $text;
            }
        }
        if (sizeof($filteron) > 0) {
            $filtertext = "(filtered on " . implode(", ", $filteron) . ")";
        }
        require_once LIBWWWDIR . '/forms.php';
        ?>

<table class="scorefilter">
<tr>
<td><a class="collapse" href="javascript:collapse('filter')"><img src="../images/filter.png" alt="filter&hellip;" title="filter&hellip;" class="picto" /></a></td>
<td><?php 
        echo $filtertext;
        ?>
</td>
<td><div id="detailfilter">
<?php 
        echo addForm($pagename, 'get') . (count($affilids) > 1 ? addSelect('affilid[]', $affilids, @$filter['affilid'], TRUE, 8) : "") . (count($countries) > 1 ? addSelect('country[]', $countries, @$filter['country'], FALSE, 8) : "") . (count($categids) > 1 ? addSelect('categoryid[]', $categids, @$filter['categoryid'], TRUE, 8) : "") . addSubmit('filter', 'filter') . addSubmit('clear', 'clear') . addEndForm();
        ?>
</div></td></tr>
</table>
<script type="text/javascript">
<!--
collapse("filter");
// -->
</script>
		<?php 
    }
    renderScoreBoardTable($sdata, $myteamid, $static);
    // last modified date, now if we are the jury, else include the
    // freeze time
    if (!IS_JURY && $fdata['showfrozen']) {
        $lastupdate = printtime($cdata['freezetime'], '%a %d %b %Y %T %Z');
    } else {
        $lastupdate = printtime(now(), '%a %d %b %Y %T %Z');
    }
    echo "<p id=\"lastmod\">Last Update: {$lastupdate}<br />\n" . "using <a href=\"https://www.domjudge.org/\">DOMjudge</a></p>\n\n";
    return;
}
Пример #25
0
            }
            sqlStatement($query);
        } else {
            // new form
            if ($value !== '') {
                if ($newid) {
                    sqlStatement("INSERT INTO lbf_data " . "( form_id, field_id, field_value ) " . " VALUES ( '{$newid}', '{$field_id}', '{$value}' )");
                } else {
                    $newid = sqlInsert("INSERT INTO lbf_data " . "( field_id, field_value ) " . " VALUES ( '{$field_id}', '{$value}' )");
                }
            }
            // Note that a completely empty form will not be created at all!
        }
    }
    if (!$formid && $newid) {
        addForm($encounter, $formtitle, $newid, $formname, $pid, $userauthorized);
    }
    formHeader("Redirecting....");
    formJump();
    formFooter();
    exit;
}
if (empty($is_lbf)) {
    $fname = $GLOBALS['OE_SITE_DIR'] . "/LBF/{$formname}.plugin.php";
    if (file_exists($fname)) {
        include_once $fname;
    }
}
?>
<html>
<head>
Пример #26
0
            } else {
                if ($reltime < dbconfig_get('judgehost_critical', 120)) {
                    echo "judgehost-warn";
                } else {
                    echo "judgehost-crit";
                }
            }
            echo "\" title =\"last checked in {$reltime} seconds ago\">";
        }
        echo $link . CIRCLE_SYM . "</a></td>";
        echo "<td>" . $link . (is_null($row['name']) ? '<i>none</i>' : $row['name']) . '</a></td>';
        echo "<td title=\"load during the last 2 and 10 minutes and the whole contest\">" . $link . sprintf('%.2f&nbsp;%.2f&nbsp;%.2f', @$work2min[$row['hostname']] / (2 * 60), @$work10min[$row['hostname']] / (10 * 60), @$workcontest[$row['hostname']] / $clen) . "</a></td>";
        if (IS_ADMIN) {
            if ($row['active']) {
                $activepicto = "pause";
                $activecmd = "deactivate";
            } else {
                $activepicto = "play";
                $activecmd = "activate";
            }
            echo "<td><a href=\"judgehost.php?id=" . $row['hostname'] . "&amp;cmd=" . $activecmd . "\"><img class=\"picto\" alt=\"" . $activecmd . "\" title=\"" . $activecmd . " judgehost\" " . "src=\"../images/" . $activepicto . ".png\" /></a></td>";
            echo "<td>" . delLink('judgehost', 'hostname', $row['hostname']) . "</td>";
        }
        echo "</tr>\n";
    }
    echo "</tbody>\n</table>\n\n";
}
if (IS_ADMIN) {
    echo addForm($pagename) . "<p>" . addSubmit('Start all judgehosts', 'cmd-activate') . addSubmit('Stop all judgehosts', 'cmd-deactivate') . "<br /><br />\n\n" . addLink('judgehosts', true) . "\n" . editLink('judgehosts', null, true) . "</p>\n" . addEndForm();
}
require LIBWWWDIR . '/footer.php';
Пример #27
0
 if (empty($_POST['form_copy_sn_visit'])) {
     $info_msg .= "This patient has no visits! ";
 } else {
     $encounter_id = 0 + $_POST['form_copy_sn_visit'];
 }
 if (!$info_msg) {
     // Merge the selected pages.
     $info_msg .= mergeTiffs();
     $tmp_name = "{$faxcache}/temp.tif";
 }
 if (!$info_msg) {
     // The following is cloned from contrib/forms/scanned_notes/new.php:
     //
     $query = "INSERT INTO form_scanned_notes ( " . "notes " . ") VALUES ( " . "'" . $_POST['form_copy_sn_comments'] . "' " . ")";
     $formid = sqlInsert($query);
     addForm($encounter_id, "Scanned Notes", $formid, "scanned_notes", $patient_id, $userauthorized);
     //
     $imagedir = "{$webserver_root}/documents/{$patient_id}/encounters";
     $imagepath = "{$imagedir}/{$encounter_id}_{$formid}.jpg";
     //
     if (!is_dir($imagedir)) {
         $tmp0 = exec("mkdir -p '{$imagedir}'", $tmp1, $tmp2);
         if ($tmp2) {
             die("mkdir returned {$tmp2}: {$tmp0}");
         }
         exec("touch '{$imagedir}/index.html'");
     }
     if (is_file($imagepath)) {
         unlink($imagepath);
     }
     // TBD: There may be a faster way to create this file, given that
Пример #28
0
function DOBandEncounter()
{
    global $event_date, $info_msg;
    // Save new DOB if it's there.
    $patient_dob = trim($_POST['form_dob']);
    if ($patient_dob && $_POST['form_pid']) {
        sqlStatement("UPDATE patient_data SET DOB = '{$patient_dob}' WHERE " . "pid = '" . $_POST['form_pid'] . "'");
    }
    // Auto-create a new encounter if appropriate.
    //
    if ($GLOBALS['auto_create_new_encounters'] && $_POST['form_apptstatus'] == '@' && $event_date == date('Y-m-d')) {
        $tmprow = sqlQuery("SELECT count(*) AS count FROM form_encounter WHERE " . "pid = '" . $_POST['form_pid'] . "' AND date = '{$event_date} 00:00:00'");
        if ($tmprow['count'] == 0) {
            $tmprow = sqlQuery("SELECT username, facility, facility_id FROM users WHERE id = '" . $_POST['form_provider'] . "'");
            $username = $tmprow['username'];
            $facility = $tmprow['facility'];
            // $facility_id = $tmprow['facility_id'];
            // use the session facility if it is set, otherwise the one from the provider.
            $facility_id = $_SESSION['pc_facility'] ? $_SESSION['pc_facility'] : $tmprow['facility_id'];
            $conn = $GLOBALS['adodb']['db'];
            $encounter = $conn->GenID("sequences");
            addForm($encounter, "New Patient Encounter", sqlInsert("INSERT INTO form_encounter SET " . "date = '{$event_date}', " . "onset_date = '{$event_date}', " . "reason = '" . formData("form_comments") . "', " . "facility = '{$facility}', " . "facility_id = '" . (int) $_POST['facility'] . "', " . "billing_facility = '" . (int) $_POST['billing_facility'] . "', " . "provider_id = '" . (int) $_POST['form_provider'] . "', " . "pid = '" . $_POST['form_pid'] . "', " . "encounter = '{$encounter}'"), "newpatient", $_POST['form_pid'], "1", "NOW()", $username);
            $info_msg .= "New encounter {$encounter} was created. ";
        }
    }
}
Пример #29
0
    displayPageHeader($color, 'None');
    plain_error_message(_("You have not selected a folder to rename. Please do so.") . '<br /><a href="../src/folders.php">' . _("Click here to go back") . '</a>.', $color);
    exit;
}
if (substr($old, strlen($old) - strlen($delimiter)) == $delimiter) {
    $isfolder = TRUE;
    $old = substr($old, 0, strlen($old) - 1);
} else {
    $isfolder = FALSE;
}
$old = imap_utf7_decode_local($old);
// displayable mailbox format is without folder prefix on front
global $folder_prefix;
if (substr($old, 0, strlen($folder_prefix)) == $folder_prefix) {
    $displayable_old = substr($old, strlen($folder_prefix));
} else {
    $displayable_old = $old;
}
if (strpos($displayable_old, $delimiter)) {
    $old_name = substr($displayable_old, strrpos($displayable_old, $delimiter) + 1);
    $parent = htmlspecialchars(substr($displayable_old, 0, strrpos($displayable_old, $delimiter)) . ' ' . $delimiter);
} else {
    $old_name = $displayable_old;
    $parent = '';
}
displayPageHeader($color, 'None');
echo '<br />' . html_tag('table', '', 'center', '', 'width="95%" border="0"') . html_tag('tr', html_tag('td', '<b>' . _("Rename a folder") . '</b>', 'center', $color[0])) . html_tag('tr') . html_tag('td', '', 'center', $color[4]) . addForm('folders_rename_do.php') . _("New name:") . '<br /><b>' . $parent . '</b>' . addInput('new_name', $old_name, 25) . '<br />' . "\n";
if ($isfolder) {
    echo addHidden('isfolder', 'true');
}
echo addHidden('orig', $old) . addHidden('old_name', $old_name) . '<input type="submit" value="' . _("Submit") . "\" />\n" . '</form><br /></td></tr></table>';
Пример #30
0
if (checkrole('team')) {
    echo "<a target=\"_top\" href=\"../team/\" accesskey=\"t\"><span class=\"octicon octicon-arrow-right\"></span> team</a>\n";
}
?>
</div>

<div id="menutopright">
<?php 
putClock();
$notify_flag = isset($_COOKIE["domjudge_notify"]) && (bool) $_COOKIE["domjudge_notify"];
$refresh_flag = !isset($_COOKIE["domjudge_refresh"]) || (bool) $_COOKIE["domjudge_refresh"];
echo "<div id=\"toggles\">\n";
if (isset($refresh)) {
    $text = $refresh_flag ? 'Disable' : 'Enable';
    echo '<input id="refresh-toggle" type="button" value="' . $text . ' refresh" />';
}
// Default hide this from view, only show when javascript and
// notifications are available:
echo '<div id="notify" style="display: none">' . addForm('toggle_notify.php', 'get') . addHidden('enable', $notify_flag ? 0 : 1) . addSubmit(($notify_flag ? 'Dis' : 'En') . 'able notifications', 'toggle_notify', 'return toggleNotifications(' . ($notify_flag ? 'false' : 'true') . ')') . addEndForm() . "</div>";
?>
<script type="text/javascript">
<!--
    if ( 'Notification' in window ) {
		document.getElementById('notify').style.display = 'block';
	}
// -->
</script>

</div>
</div></nav>