예제 #1
0
function rebuild_xsl_nomina($ids, $xls = '')
{
    global $usuario, $cfg;
    $sqlData = array(auth => 1, id_horas_extra => $ids, xls => $xls, orden => 'a.id_horas_extra DESC');
    $tabla = nomina_xls($sqlData);
    $nameArchivo = 'HE_Horas-Extra';
    $tituloTabla = false;
    $titulos = array('ID', 'Semana', 'Concepto', 'Cantidad');
    $directorio = $cfg[path_tmp];
    $xlsData = array(descarga => false, datos => $tabla, colsTitulos => $titulos, archivo => $nameArchivo, tituloTabla => $tituloTabla, hoja => '', directorio => $directorio, id_empresa => $usuario[id_empresa]);
    $xls = xls($xlsData);
    return $xls;
}
예제 #2
0
function xls_nomina_rebuild($data = array())
{
    global $usuario, $cfg;
    // Extrae datos para crear xls
    $sqlData = array(auth => 1, xls => $data[xls], orden => 'a.id_horas_extra DESC');
    $tabla = select_xls_nomina_rebuild($sqlData);
    $nameArchivo = 'HE_Horas-Extra_Nomina_' . $usuario[empresa];
    $tituloTabla = false;
    $titulos = array('ID Empleado', 'Semana', 'Concepto', 'Cantidad');
    $directorio = $cfg[path_tmp];
    $xlsData = array(descarga => false, datos => $tabla, colsTitulos => $titulos, archivo => $nameArchivo, tituloTabla => $tituloTabla, hoja => '', directorio => $directorio, id_empresa => $usuario[id_empresa]);
    // Crea xls
    $xls = xls($xlsData);
    return $xls;
}
예제 #3
0
        parent.location.href = "<?php 
echo $rootdir;
?>
/patient_file/encounter/view_form.php?formname="+parts[0]+"&id="+parts[1];
    }

<?php 
// If the user was not just asked about orphaned orders, build javascript for that.
if (!isset($_GET['attachid'])) {
    $ares = sqlStatement("SELECT procedure_order_id, date_ordered " . "FROM procedure_order WHERE " . "patient_id = ? AND encounter_id = 0 AND activity = 1 " . "ORDER BY procedure_order_id", array($pid));
    echo "  // Ask about attaching orphaned orders to this encounter.\n";
    echo "  var attachid = '';\n";
    while ($arow = sqlFetchArray($ares)) {
        $orderid = $arow['procedure_order_id'];
        $orderdate = $arow['date_ordered'];
        echo "  if (confirm('" . xls('There is a lab order') . " {$orderid} " . xls('dated') . " {$orderdate} " . xls('for this patient not yet assigned to any encounter.') . " " . xls('Assign it to this one?') . "')) attachid += '{$orderid},';\n";
    }
    echo "  if (attachid) location.href = 'forms.php?attachid=' + attachid;\n";
}
?>

});

 // Process click on Delete link.
 function deleteme() {
  dlgopen('../deleter.php?encounterid=<?php 
echo $encounter;
?>
', '_blank', 500, 450);
  return false;
 }
예제 #4
0
                ccr_form.setAttribute("target", "");
        });
        $(".generateCCR_download_h").click(
        function() {
                var ccrAction = document.getElementsByName('ccrAction');
                ccrAction[0].value = 'generate';
                var raw = document.getElementsByName('raw');
                raw[0].value = 'hybrid';
                $("#ccr_form").submit();
        });
        $(".generateCCR_download_p").click(
        function() {
                if(document.getElementById('show_date').checked == true){
                        if(document.getElementById('Start').value == '' || document.getElementById('End').value == ''){
                                alert('<?php 
echo xls('Please select a start date and end date');
?>
');
                                return false;
                        }
                }
                var ccrAction = document.getElementsByName('ccrAction');
                ccrAction[0].value = 'generate';
                var raw = document.getElementsByName('raw');
                raw[0].value = 'pure';
                $("#ccr_form").submit();
        });
        $(".viewCCD").click(
        function() {
                var ccrAction = document.getElementsByName('ccrAction');
                ccrAction[0].value = 'viewccd';
예제 #5
0
   alert('<?php 
xl('You must first select or add a patient.', 'e');
?>
');
   return false;
  }
  if (active_encounter == 0 && (topusage > '1' || botusage > '1')) {
   alert('<?php 
xl('You must first select or create an encounter.', 'e');
?>
');
   return false;
  }
  if (encounter_locked  && (topusage > '1' || botusage > '1')) {
   alert('<?php 
echo xls('This encounter is locked. No new forms can be added.');
?>
');
   return false;
  }
  var f = document.forms[0];
  forceDual();
  top.restoreSession();
  var i = topurl.indexOf('{PID}');
  if (i >= 0) topurl = topurl.substring(0,i) + active_pid + topurl.substring(i+5);
  i = boturl.indexOf('{PID}');
  if (i >= 0) boturl = boturl.substring(0,i) + active_pid + boturl.substring(i+5);
  top.frames.RTop.location = '<?php 
echo "{$web_root}/interface/";
?>
' + topurl;
예제 #6
0
     { amc_id: "send_sum_amc",
       complete: true,
       mode: mode,
       patient_id: patient_id,
       object_category: "transactions",
       object_id: transaction_id
     }
   );
 }

 function send_sum_elec(patient_id,transaction_id) {
   if ( $('#send_sum_elec_flag_' + patient_id + '_' + transaction_id).attr('checked') ) {
     if ( !$('#send_sum_flag_' + patient_id + '_' + transaction_id).attr('checked') ) {
       $('#send_sum_elec_flag_' + patient_id + '_' + transaction_id).removeAttr("checked");  
       alert("<?php 
echo xls('Can not set this unless the Summary of Care Sent toggle is set.');
?>
");
       return false;
     }
     var mode = "add";
   }
   else {
     var mode = "remove";
   }
   top.restoreSession();
   $.post( "../../library/ajax/amc_misc_data.php",
     { amc_id: "send_sum_elec_amc",
       complete: true,
       mode: mode,
       patient_id: patient_id,
예제 #7
0
 dlgopen('find_code_popup.php?codetype=<?php 
echo attr(collect_codetypes("diagnosis", "csv"));
?>
', '_blank', 500, 400);
}

var transmitting = false;

// Issue a Cancel/OK warning if a previously transmitted order is being transmitted again.
function validate(f) {
<?php 
if (!empty($row['date_transmitted'])) {
    ?>
 if (transmitting) {
  if (!confirm('<?php 
    echo xls('This order was already transmitted on') . ' ' . addslashes($row['date_transmitted']) . '. ' . xls('Are you sure you want to transmit it again?');
    ?>
')) {
    return false;
  }
 }
<?php 
}
?>
 top.restoreSession();
 return true;
}

</script>

</head>
예제 #8
0
        }
        ?>
opener.top.restoreSession();
opener.document.forms[0].submit();
window.close();
}
<?php 
    } else {
        if ($isProv) {
            ?>
alert('<?php 
            echo xls('Provider not available, please choose another.');
            ?>
');
<?php 
        } else {
            ?>
alert('<?php 
            echo xls('This appointment slot is already used, please choose another.');
            ?>
');
<?php 
        }
    }
}
?>

</script>

</html>
예제 #9
0
  var f = document.forms[0];
  var target = 'fld[' + lino + '][condition_itemid][' + seq + ']';
  // field_id is the ID of the field that the condition will test.
  var field_id = f['fld[' + lino + '][condition_id][' + seq + ']'].value;
  if (!field_id) {
    f[target].options.length = 0;
    f[target].style.display = 'none';
    return;
  }
  // Find the occurrence of that field in the layout.
  var i = 1;
  while (true) {
    var idname = 'fld[' + i + '][id]';
    if (!f[idname]) {
      alert('<?php 
echo xls('Condition field not found');
?>
: ' + field_id);
      return;
    }
    if (f[idname].value == field_id) break;
    ++i;
  }
  // If this is startup initialization then preserve the current value.
  var current = init ? f[target].value : '';
  f[target].options.length = 0;
  // Get the corresponding data type and list ID.
  var data_type = f['fld[' + i + '][data_type]'].value;
  var list_id   = f['fld[' + i + '][list_id]'].value;
  // WARNING: If new data types are defined the following test may need enhancing.
  // We're getting out if the type does not generate multiple fields with different names.
예제 #10
0
require_once "{$srcdir}/options.js.php";
////////////
require_once dirname(__FILE__) . "/../../../library/appointments.inc.php";
if ($GLOBALS['concurrent_layout'] && isset($_GET['set_pid'])) {
    include_once "{$srcdir}/pid.inc";
    setpid($_GET['set_pid']);
}
$active_reminders = false;
$all_allergy_alerts = false;
if ($GLOBALS['enable_cdr']) {
    //CDR Engine stuff
    if ($GLOBALS['enable_allergy_check'] && $GLOBALS['enable_alert_log']) {
        //Check for new allergies conflicts and throw popup if any exist(note need alert logging to support this)
        $new_allergy_alerts = allergy_conflict($pid, 'new', $_SESSION['authUser']);
        if (!empty($new_allergy_alerts)) {
            $pop_warning = '<script type="text/javascript">alert(\'' . xls('WARNING - FOLLOWING ACTIVE MEDICATIONS ARE ALLERGIES') . ':\\n';
            foreach ($new_allergy_alerts as $new_allergy_alert) {
                $pop_warning .= addslashes($new_allergy_alert) . '\\n';
            }
            $pop_warning .= '\')</script>';
            echo $pop_warning;
        }
    }
    if ((!isset($_SESSION['alert_notify_pid']) || $_SESSION['alert_notify_pid'] != $pid) && isset($_GET['set_pid']) && $GLOBALS['enable_cdr_crp']) {
        // showing a new patient, so check for active reminders and allergy conflicts, which use in active reminder popup
        $active_reminders = active_alert_summary($pid, "reminders-due", '', 'default', $_SESSION['authUser'], TRUE);
        if ($GLOBALS['enable_allergy_check']) {
            $all_allergy_alerts = allergy_conflict($pid, 'all', $_SESSION['authUser'], TRUE);
        }
    }
}
예제 #11
0
    // Logic to accumulate multiple conditions for the same target.
    // alert('target = ' + target + ' prevandor = ' + prevandor + ' prevcond = ' + prevcond); // debugging
    if (prevandor == 'and') condition = condition && prevcond; else
    if (prevandor == 'or' ) condition = condition || prevcond;
    prevandor = skipArray[i].andor;
    prevcond = condition;
    var j = i + 1;
    if (j < skipArray.length && skipArray[j].target == target) continue;

    // At this point condition indicates if the target should be hidden.

    var trgelem1 = document.getElementById('label_id_' + target);
    var trgelem2 = document.getElementById('value_id_' + target);
    if (trgelem1 == null && trgelem2 == null) {
      if (!cskerror) alert('<?php 
echo xls('Cannot find a skip target field for');
?>
 "' + target + '"');
      myerror = true;
      continue;
    }
    // If the item occupies a whole row then undisplay its row, otherwise hide its cells.
    var colspan = 0;
    if (trgelem1) colspan += trgelem1.colSpan;
    if (trgelem2) colspan += trgelem2.colSpan;
    if (colspan < 4) {
      if (trgelem1) trgelem1.style.visibility = condition ? 'hidden' : 'visible';
      if (trgelem2) trgelem2.style.visibility = condition ? 'hidden' : 'visible';
    }
    else {
      if (trgelem1) trgelem1.parentNode.style.display = condition ? 'none' : '';
예제 #12
0
           counter++;
       }
    }
    return counter;
}

/*
* validation on the form with new client side validation (using validate.js).
* this enable to add new rules for this form in the pageValidation list.
* */
var collectvalidation = <?php echo($collectthis); ?>;
function validateform(valu){

    //Make sure if days_every_week is checked that at least one weekday is checked.
    if($('#days_every_week').is(':checked') && !are_days_checked()){
        alert('<?php echo xls("Must choose at least one day!"); ?>');
        return false;
    }

    //add rule if choose repeating event
    if ($('#form_repeat').is(':checked') || $('#days_every_week').is(':checked')){
        collectvalidation.form_enddate = {
            datetime: {
                dateOnly: true,
                earliest: $('#form_date').val(),
                message: "An end date later than the start date is required for repeated events!"
            },
            presence: true
        }
    } else {
        if(typeof (collectvalidation) != 'undefined'){
예제 #13
0
				$(this).attr("checked", checked);
			});
		});
	});
	
	function downloadSelected() {
		zipFileArray.length = 0;
		var criteriaArray = new Array();
		$("#thisForm input:checkbox:checked").each(function() {
			if ( $(this).attr("id") == "checkAll")
				return;
			criteriaArray.push($(this).attr("id"));
		});
		if ( criteriaArray.length == 0 ) {
			alert("<?php 
echo xls('Please select at least one criteria to download');
?>
");
			return false;
		}
		for( var i=0 ; i < criteriaArray.length ; i++) {
			var checkBoxCounterArray = criteriaArray[i].split("check");
			var ruleID = $("#text" + checkBoxCounterArray[1]).val();
			//console.log(ruleID);
			var lastOne = ( ( i + 1 ) == criteriaArray.length ) ? 1 : 0;
			downloadXML(checkBoxCounterArray[1],lastOne,ruleID);
		}
	}
	
	function downloadXML(counter,lastOne) {
		$("#download" + counter).css("display","none");
예제 #14
0
 public function jsLineItemValidation($bill = 'bill', $prod = 'prod')
 {
     $s = "\nfunction jsLineItemValidation(f) {\n var max_contra_cyp = 0;\n var max_contra_code = '';\n var required_code_count = 0;\n // Loop thru the services.\n for (var lino = 0; f['{$bill}['+lino+'][code_type]']; ++lino) {\n  var pfx = '{$bill}[' + lino + ']';\n  if (f[pfx + '[del]'] && f[pfx + '[del]'].checked) continue;\n  if (f[pfx + '[ndcnum]'] && f[pfx + '[ndcnum]'].value) {\n   // Check NDC number format.\n   var ndcok = true;\n   var ndc = f[pfx + '[ndcnum]'].value;\n   var a = ndc.split('-');\n   if (a.length != 3) {\n    ndcok = false;\n   }\n   else if (a[0].length < 1 || a[1].length < 1 || a[2].length < 1 ||\n    a[0].length > 5 || a[1].length > 4 || a[2].length > 2) {\n    ndcok = false;\n   }\n   else {\n    for (var i = 0; i < 3; ++i) {\n     for (var j = 0; j < a[i].length; ++j) {\n      var c = a[i].charAt(j);\n      if (c < '0' || c > '9') ndcok = false;\n     }\n    }\n   }\n   if (!ndcok) {\n    alert('" . xls('Format incorrect for NDC') . "\"' + ndc +\n     '\", " . xls('should be like nnnnn-nnnn-nn') . "');\n    if (f[pfx+'[ndcnum]'].focus) f[pfx+'[ndcnum]'].focus();\n    return false;\n   }\n   // Check for valid quantity.\n   var qty = f[pfx+'[ndcqty]'].value - 0;\n   if (isNaN(qty) || qty <= 0) {\n    alert('" . xls('Quantity for NDC') . " \"' + ndc +\n     '\" " . xls('is not valid (decimal fractions are OK).') . "');\n    if (f[pfx+'[ndcqty]'].focus) f[pfx+'[ndcqty]'].focus();\n    return false;\n   }\n  }\n  if (f[pfx+'[method]'] && f[pfx+'[method]'].value) {\n   // The following applies to contraception for family planning clinics.\n   var tmp_cyp = parseFloat(f[pfx+'[cyp]'].value);\n   var tmp_meth = f[pfx+'[method]'].value;\n   var tmp_methtype = parseInt(f[pfx+'[methtype]'].value);\n   if (tmp_cyp > max_contra_cyp && tmp_methtype == 2) {\n    // max_contra_* tracks max cyp for initial consults only.\n    max_contra_cyp = tmp_cyp;\n    max_contra_code = tmp_meth;\n   }\n";
     if ($this->patient_male) {
         $s .= "\n   var male_compatible_method = (\n    // TBD: Fix hard coded dependency on IPPFCM codes here.\n    tmp_meth == '4450' || // male condoms\n    tmp_meth == '4570');  // male vasectomy\n   if (!male_compatible_method) {\n    if (!confirm('" . xls('Warning: Contraceptive method is not compatible with a male patient.') . "'))\n     return false;\n   }\n";
     }
     // end if male patient
     if ($this->patient_age < 10 || $this->patient_age > 50) {
         $s .= "\n   if (!confirm('" . xls('Warning: Contraception for a patient under 10 or over 50.') . "'))\n    return false;\n";
     }
     // end if improper age
     if ($this->match_services_to_products) {
         $s .= "\n   // Nonsurgical methods should normally include a corresponding product.\n   // This takes advantage of the fact that only nonsurgical methods have CYP\n   // less than 10, in both the old and new frameworks.\n   if (tmp_cyp < 10.0) {\n   // Was: if (tmp_meth.substring(0, 2) != '12') {\n    var got_prod = false;\n    for (var plino = 0; f['{$prod}['+plino+'][drug_id]']; ++plino) {\n     var ppfx = '{$prod}[' + plino + ']';\n     if (f[ppfx+'[del]'] && f[ppfx+'[del]'].checked) continue;\n     if (f[ppfx+'[method]'] && f[ppfx+'[method]'].value) {\n      if (f[ppfx+'[method]'].value == tmp_meth) got_prod = true;\n     }\n    }\n    if (!got_prod) {\n     if (!confirm('" . xls('Warning: There is no product matching the contraceptive service.') . "'))\n      return false;\n    }\n   }\n";
     }
     // end match services to products
     $s .= "\n  }\n  ++required_code_count;\n }\n";
     if ($this->match_services_to_products) {
         $s .= "\n // The following applies to contraception for family planning clinics.\n // Loop thru the products.\n for (var lino = 0; f['{$prod}['+lino+'][drug_id]']; ++lino) {\n  var pfx = '{$prod}[' + lino + ']';\n  if (f[pfx + '[del]'] && f[pfx + '[del]'].checked) continue;\n  if (f[pfx + '[method]'] && f[pfx + '[method]'].value) {\n   var tmp_meth = f[pfx + '[method]'].value;\n   // Contraceptive products should normally include a corresponding method.\n   var got_svc = false;\n   for (var slino = 0; f['{$bill}[' + slino + '][code_type]']; ++slino) {\n    var spfx = '{$bill}[' + slino + ']';\n    if (f[spfx + '[del]'] && f[spfx + '[del]'].checked) continue;\n    if (f[spfx + '[method]'] && f[spfx + '[method]'].value) {\n     if (f[spfx + '[method]'].value == tmp_meth) got_svc = true;\n    }\n   }\n   if (!got_svc) {\n    if (!confirm('" . xls('Warning: There is no service matching the contraceptive product.') . "'))\n     return false;\n   }\n  }\n  ++required_code_count;\n }\n";
     }
     // end match services to products
     if (isset($GLOBALS['code_types']['MA'])) {
         $s .= "\n if (required_code_count == 0) {\n  if (!confirm('" . xls('You have not entered any clinical services or products. Click Cancel to add them. Or click OK if you want to save as-is.') . "')) {\n   return false;\n  }\n }\n";
     }
     $s .= "\n // End contraception validation.\n if (f.ippfconmeth) {\n  // Save the primary contraceptive method to its hidden form field.\n  f.ippfconmeth.value = max_contra_code;\n }\n return true;\n}\n";
     return $s;
 }
예제 #15
0
    ?>
";
    var pid=<?php 
    echo $pid;
    ?>
;
    var enc=<?php 
    echo $encounter;
    ?>
;
    var review_tag="<?php 
    echo xls('Review');
    ?>
";
    var justify_click_title="<?php 
    echo xls('Click to choose diagnoses to justify.');
    ?>
";
    var fee_sheet_options=[];
    var diag_code_types=<?php 
    echo diag_code_types('json');
    ?>
;  // This is a list of diagnosis code types to present for as options in the justify dialog, for now, only "internal codes" included.
</script>
<script type="text/javascript" src="<?php 
    echo $web_root;
    ?>
/library/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<?php 
    echo $web_root;
    ?>
예제 #16
0
                              alert('<?php 
echo xls('Plan Status Changed');
?>
');
                             }
                           if (obj == '002') {
                              alert('<?php 
echo xls('Plan Status Failed to Change');
?>
');
                             }
	    })
	    .fail(function(jqXHR, textStatus) {
		    console.log(textStatus);
			alert('<?php 
echo xls('Error');
?>
');
	    });
	}

	$activatePlan = function() {
        $("#plan-status-label").text('<?php 
echo out(xl('Status')) . ': ' . out(xl('Active'));
?>
');
        window.buttonStatus = "active";
        $("#cdr-status").removeAttr("disabled");
        $("#cdr-status").text('<?php 
echo out(xl('Deactivate'));
?>
예제 #17
0
		var rspElem = jQuery('#archiversp');
		//var archf = jQuery('#archrestoresel').val();
		//archrstdata = { archrestore: 'yes', archfile: archf };
		jQuery.ajax({
			url: jQuery('#formarchrestore').attr('action'),
			type: 'POST', 
			data: archrstdata,
			dataType: 'html',
			processData: false,
			contentType: false,
			success: function(data) {
				rspElem.html('');
				rspElem.html(data);
			},
			error: function( xhr, status ) { alert( "<?php 
echo xls('Sorry, there was a problem!');
?>
" ); },
		});
	    archlist();
	    csvlist();
	    archrstForm.reset();
		return false;
	});

/* ************ 
 * end of javascript block
 */             
</script>     

</body>
예제 #18
0
</form>

</body>

<script language="javascript">
// jQuery stuff to make the page a little easier to use

$(document).ready(function(){
    $("#confirmbtn").click(function() { return ConfirmDelete(); });
    $("#cancel").click(function() { location.href='<?php 
echo "{$rootdir}/patient_file/encounter/{$returnurl}";
?>
'; });
});

function ConfirmDelete() {
    if (confirm('<?php 
echo xls('This action cannot be undone. Are you sure you wish to delete this form?');
?>
')) {
        top.restoreSession();
        $("#my_form").submit();
        return true;
    }
    return false;
}

</script>

</html>
예제 #19
0
?>
];

<?php 
echo $date_init;
if (function_exists($formname . '_javascript_onload')) {
    call_user_func($formname . '_javascript_onload');
}
// TBD: If $alertmsg, display it with a JavaScript alert().
// New form and this patient has a portal login and we have not loaded portal data.
// Check if there is portal data pending for this patient and form type.
if (!$formid && $GLOBALS['gbl_portal_cms_enable'] && $cmsportal_login && !$portalid) {
    $portalres = cms_portal_call(array('action' => 'checkptform', 'form' => $formname, 'patient' => $cmsportal_login));
    if ($portalres['errmsg']) {
        die(text($portalres['errmsg']));
        // TBD: Change to alertmsg
    }
    $portalid = $portalres['postid'];
    if ($portalid) {
        echo "if (confirm('" . xls('The portal has data for this patient and form. Load it now?') . "')) {\n";
        echo " top.restoreSession();\n";
        echo " document.location.href = 'load_form.php?formname={$formname}&portalid={$portalid}';\n";
        echo "}\n";
    }
}
?>
</script>

</body>
</html>
예제 #20
0
    $table .= "</table>";
    $table = "" . $table;
    //	$table=chr(255).chr(254).$table;
    $nome_arquivo = "arquivo." . $formato;
    $file = fopen($nome_arquivo, "wb");
    fwrite($file, $table);
    fclose($file);
    echo "<a href='php/temp/" . $nome_arquivo . "' download='" . $nome_arquivo . "' class='uk-text-success' style='color: rgb(255, 255, 255); padding: 2px 15px;'><i class='uk-icon-cloud-download'></i> download (" . $nome_arquivo . ")</a>";
}
//css_($_POST['json']);
function html($formato, $html)
{
    $html = "" . $html;
    $nome_arquivo = "arquivo." . $formato;
    $file = fopen($nome_arquivo, "w");
    fwrite($file, $html);
    fclose($file);
    echo "<a href='php/temp/" . $nome_arquivo . "' download='" . $nome_arquivo . "' class='uk-text-success' style='color: rgb(255, 255, 255); padding: 2px 15px;'><i class='uk-icon-cloud-download'></i>  download (" . $nome_arquivo . ")</a>";
}
if ($_POST['formato'] == 'xls' or $_POST['formato'] == 'doc') {
    if (isset($_POST) and $_POST['base'] == "json") {
        xls($_POST['formato'], $_POST['json']);
    }
    if (isset($_POST) and $_POST['base'] == "html") {
        html($_POST['formato'], $_POST['json']);
    }
}
if ($_POST['formato'] == 'pdf') {
}
?>
 
#
#
#
#
#
#
require "../settings.php";
require "../core-settings.php";
# decide what to do
if (isset($_POST["key"])) {
    switch ($_POST["key"]) {
        case "viewtrans":
            $OUTPUT = viewtrans($_POST);
            break;
        case "xls":
            $OUTPUT = xls($_POST);
            break;
        default:
            $OUTPUT = view();
    }
} else {
    # Display default output
    $OUTPUT = view();
}
# get templete
require "../template.php";
# Default view
function view()
{
    //layout
    $view = "\n\t\t<center>\n\t\t<h3>Detailed General ledger Report</h3>\n\t\t<table cellpadding='5' width='80%'>\n\t\t<tr>\n\t\t\t<td width='60%' align='center'>\n\t\t\t\t<form action='" . SELF . "' method='POST' name='form'>\n\t\t\t\t\t<input type='hidden' name='key' value='viewtrans'>\n\t\t\t\t\t<input type='hidden' name='search' value='date'>\n\t\t\t\t<table " . TMPL_tblDflts . " width='470'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='err' colspan='2'>All transactions from selected period posted between the specified dates.</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th colspan='2'>By Date Range</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t<td width='95%' align='center'>\n\t\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td nowrap='t'>" . mkDateSelect("from", date("Y"), date("m"), "01") . "</td>\n\t\t\t\t\t\t\t\t\t<td>&nbsp;&nbsp;TO&nbsp;&nbsp;</td>\n\t\t\t\t\t\t\t\t\t<td nowrap='t'>" . mkDateSelect("to") . "</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td rowspan='2' valign='bottom'><input type='submit' value='Search &raquo;'></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<!--<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t<td>Select Period: " . finMonList("prd", PRD_DB) . "</td>\n\t\t\t\t\t</tr>-->\n\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='center'>\n\t\t\t\t<form action='" . SELF . "' method='POST' name='form'>\n\t\t\t\t\t<input type='hidden' name='key' value='viewtrans'>\n\t\t\t\t\t<input type='hidden' name='search' value='refnum'>\n\t\t\t\t<table " . TMPL_tblDflts . " width='370'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='err' colspan='2'>All transactions from selected period with reference numbers within the specified range.</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th colspan='2'>By Journal number</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t<td width='80%' align='center'>\n\t\t\t\t\t\t\tFrom <input type='text' size='5' name='fromnum'>\n\t\t\t\t\t\t\tto <input type='text' size='5' name='tonum'>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td rowspan='2' valign='bottom'><input type='submit' value='Search &raquo;'></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr class='" . bg_class() . "'>\n\t\t\t\t\t\t<td>Select Period: " . finMonList("prd", PRD_DB) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='center'>\n\t\t\t\t<form action='" . SELF . "' method='POST' name='form'>\n\t\t\t\t\t<input type='hidden' name='key' value='viewtrans'>\n\t\t\t\t\t<input type='hidden' name='search' value='all'>\n\t\t\t\t<table " . TMPL_tblDflts . " width='370'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='err' colspan='2'>All transactions from selected period.</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th colspan='2'>View All</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr class='bg-even'>\n\t\t\t\t\t\t<td>Select Period: " . finMonList("prd", PRD_DB) . "</td>\n\t\t\t\t\t\t<td rowspan='2' valign='bottom'><input type='submit' value='View All &raquo;'></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t</tr>\n\t</table>" . mkQuickLinks(ql("index-reports.php", "Financials"), ql("index-reports-journal.php", "Current Year Details General Ledger Reports"), ql("../core/acc-new2.php", "Add New Account"));
예제 #22
0
		<script type="text/javascript" src="../../library/dialog.js"></script>
		<script type="text/javascript" src="../../library/js/jquery.1.3.2.js"></script>
		<script language="JavaScript">
		var mypcc = '<?php 
echo $GLOBALS['phone_country_code'];
?>
';
		var global_date_format = '%Y-%m-%d';				
		function Form_Validate() {
			var d = document.forms[0];		 
			FromDate = d.date_from.value;
			ToDate = d.date_to.value;
			if ( (FromDate.length > 0) && (ToDate.length > 0) ) {
				if ( FromDate > ToDate ){
					alert("<?php 
echo xls('To date must be later than From date!');
?>
");
					return false;
				}
			}	
			$("#processing").show();
			return true;
		}
		
		</script>
		<script type="text/javascript" src="../../library/dialog.js"></script>
		<link rel="stylesheet" href="<?php 
echo $css_header;
?>
" type="text/css">
예제 #23
0
    // Initialize the list item selectors in skip conditions.
    var f = document.forms[0];
    for (var lino = 1; f['fld[' + lino + '][id]']; ++lino) {
      for (var seq = 0; f['fld[' + lino + '][condition_itemid][' + seq + ']']; ++seq) {
        setListItemOptions(lino, seq, true);
      }
    }

  // Support for beforeunload handler.
  $('tbody input, tbody select, tbody textarea').not('.selectfield').change(function() {
    somethingChanged = true;
  });
  window.addEventListener("beforeunload", function (e) {
    if (somethingChanged && !top.timed_out) {
      var msg = "<?php 
echo xls('You have unsaved changes.');
?>
";
      e.returnValue = msg;     // Gecko, Trident, Chrome 34+
      return msg;              // Gecko, WebKit, Chrome <34
    }
  });

});

function NationNotesContext(lineitem,val){
  if(val==34){
    document.getElementById("fld["+lineitem+"][contextName]").style.display='';
    document.getElementById("fld["+lineitem+"][list_id]").style.display='none';
    document.getElementById("fld["+lineitem+"][list_id]").value='';
  }
예제 #24
0
  var f = document.forms[0];
  if (!f.form_date.value) return;
  var d = new Date(f.form_date.value);
  var downame = Calendar._DN[d.getUTCDay()];
  var nthtext = '';
  var occur = Math.floor((d.getUTCDate() - 1) / 7);
  if (occur < 4) { // 5th is not allowed
   nthtext = occurNames[occur] + ' ' + downame;
  }
  var lasttext = '';
  var tmp = new Date(d.getUTCFullYear(), d.getUTCMonth() + 1, 0);
  if (tmp.getUTCDate() - d.getUTCDate() < 7) {
   // This is a last occurrence of the specified weekday in the month,
   // so permit that as an option.
   lasttext = '<?php 
echo xls("Last");
?>
 ' + downame;
  }
  var si = f.form_repeat_type.selectedIndex;
  var opts = f.form_repeat_type.options;
  opts.length = 5; // remove any nth and Last entries
  if (nthtext ) opts[opts.length] = new Option(nthtext , '5');
  if (lasttext) opts[opts.length] = new Option(lasttext, '6');
  if (si < opts.length) f.form_repeat_type.selectedIndex = si;
 }

 // This is for callback by the find-available popup.
 function setappt(year,mon,mday,hours,minutes) {
  var f = document.forms[0];
  f.form_date.value = '' + year + '-' +
예제 #25
0
  dlgopen('../../patient_file/summary/add_edit_issue.php', '_blank', 800, 600);
  return false;
 }

 // callback from add_edit_issue.php:
 function refreshIssue(issue, title) {
  var s = document.forms[0]['issues[]'];
  s.options[s.options.length] = new Option(title, issue, true, true);
 }

 function saveClicked() {
  var f = document.forms[0];
  var category = document.forms[0].pc_catid.value;
  if ( category == '_blank' ) {
   alert("<?php 
echo xls('You must select a visit category');
?>
");
   return;
  }
  top.restoreSession();
  f.submit();
 }

$(document).ready(function(){
  enable_big_modals();
});
function bill_loc(){
var pid=<?php 
echo attr($pid);
?>
예제 #26
0
 return true;
}

function openPatient(ptid) {
 var f = opener.document.forms[0];
 var ename = '<?php 
echo addslashes("select[{$form_key}]");
?>
';
 if (f[ename]) {
  f[ename].value = ptid;
  window.close();
 }
 else {
  alert('<?php 
echo xls('Form element not found');
?>
: ' + ename);
 }
}

</script>
</head>

<body class="body_top">
<center>
<form method='post' action='patient_select.php' onsubmit='return myRestoreSession()'>

<?php 
if ($form_key) {
    $clarr = array();
예제 #27
0
include_once "{$GLOBALS['srcdir']}/dynarch_calendar_en.inc.php";
?>
<script type="text/javascript" src="<?php 
echo $GLOBALS['webroot'];
?>
/library/dynarch_calendar_setup.js"></script>
<script type="text/javascript">
	function checkForAmendments() {
		var amendments = "";
		$("#list_amendments input:checkbox:checked").each(function() {
				amendments += $(this).val() + ",";
		});
		
		if ( amendments == '' ) {
			alert("<?php 
echo xls('Select amendments to print');
?>
");
			return;
		}
		
		// Call the function to print
		var url = "print_amendments.php?ids=" + amendments;
		window.open(url);
	}
	
	function checkUncheck(option) {
		$("input[name='check_list[]']").each( function () {
			var optionFlag = ( option ) ? true : false;
			$(this).attr('checked',optionFlag);
		});
예제 #28
0
/**
 * Display the clinical summary widget.
 *
 * @param  integer  $patient_id     pid of selected patient
 * @param  string   $mode           choose either 'reminders-all' or 'reminders-due' (required)
 * @param  string   $dateTarget     target date (format Y-m-d H:i:s). If blank then will test with current date as target.
 * @param  string   $organize_mode  Way to organize the results (default or plans)
 * @param  string   $user           If a user is set, then will only show rules that user has permission to see.
 */
function clinical_summary_widget($patient_id, $mode, $dateTarget = '', $organize_mode = 'default', $user = '')
{
    // Set date to current if not set
    $dateTarget = $dateTarget ? $dateTarget : date('Y-m-d H:i:s');
    // Collect active actions
    $actions = test_rules_clinic('', 'passive_alert', $dateTarget, $mode, $patient_id, '', $organize_mode, array(), 'primary', NULL, NULL, $user);
    // Display the actions
    $current_targets = array();
    foreach ($actions as $action) {
        // Deal with plan names first
        if (isset($action['is_plan']) && $action['is_plan']) {
            echo "<br><b>";
            echo htmlspecialchars(xl("Plan"), ENT_NOQUOTES) . ": ";
            echo generate_display_field(array('data_type' => '1', 'list_id' => 'clinical_plans'), $action['id']);
            echo "</b><br>";
            continue;
        }
        // Collect the Rule Title, Rule Developer, Rule Funding Source, and Rule Release and show it when hover over the item.
        $tooltip = '';
        if (!empty($action['rule_id'])) {
            $rule_title = getListItemTitle("clinical_rules", $action['rule_id']);
            $ruleData = sqlQuery("SELECT `developer`, `funding_source`, `release_version`, `web_reference` " . "FROM `clinical_rules` " . "WHERE  `id`=? AND `pid`=0", array($action['rule_id']));
            $developer = $ruleData['developer'];
            $funding_source = $ruleData['funding_source'];
            $release = $ruleData['release_version'];
            $web_reference = $ruleData['web_reference'];
            if (!empty($rule_title)) {
                $tooltip = xla('Rule Title') . ": " . attr($rule_title) . "&#013;";
            }
            if (!empty($developer)) {
                $tooltip .= xla('Rule Developer') . ": " . attr($developer) . "&#013;";
            }
            if (!empty($funding_source)) {
                $tooltip .= xla('Rule Funding Source') . ": " . attr($funding_source) . "&#013;";
            }
            if (!empty($release)) {
                $tooltip .= xla('Rule Release') . ": " . attr($release);
            }
            if (!empty($tooltip) || !empty($web_reference)) {
                if (!empty($web_reference)) {
                    $tooltip = "<a href='" . attr($web_reference) . "' target='_blank' style='white-space: pre-line;' title='" . $tooltip . "'>?</a>";
                } else {
                    $tooltip = "<span style='white-space: pre-line;' title='" . $tooltip . "'>?</span>";
                }
            }
        }
        if ($action['custom_flag']) {
            // Start link for reminders that use the custom rules input screen
            $url = "../rules/patient_data.php?category=" . htmlspecialchars($action['category'], ENT_QUOTES);
            $url .= "&item=" . htmlspecialchars($action['item'], ENT_QUOTES);
            echo "<a href='" . $url . "' class='iframe medium_modal' onclick='top.restoreSession()'>";
        } else {
            if ($action['clin_rem_link']) {
                // Start link for reminders that use the custom rules input screen
                $pieces_url = parse_url($action['clin_rem_link']);
                $url_prefix = $pieces_url['scheme'];
                if ($url_prefix == 'https' || $url_prefix == 'http') {
                    echo "<a href='" . $action['clin_rem_link'] . "' class='iframe  medium_modal' onclick='top.restoreSession()'>";
                } else {
                    echo "<a href='../../../" . $action['clin_rem_link'] . "' class='iframe  medium_modal' onclick='top.restoreSession()'>";
                }
            } else {
                // continue since no link is needed
            }
        }
        // Display Reminder Details
        echo generate_display_field(array('data_type' => '1', 'list_id' => 'rule_action_category'), $action['category']) . ": " . generate_display_field(array('data_type' => '1', 'list_id' => 'rule_action'), $action['item']);
        if ($action['custom_flag'] || $action['clin_rem_link']) {
            // End link for reminders that use an html link
            echo "</a>";
        }
        // Display due status
        if ($action['due_status']) {
            // Color code the status (red for past due, purple for due, green for not due and black for soon due)
            if ($action['due_status'] == "past_due") {
                echo "&nbsp;&nbsp;(<span style='color:red'>";
            } else {
                if ($action['due_status'] == "due") {
                    echo "&nbsp;&nbsp;(<span style='color:purple'>";
                } else {
                    if ($action['due_status'] == "not_due") {
                        echo "&nbsp;&nbsp;(<span style='color:green'>";
                    } else {
                        echo "&nbsp;&nbsp;(<span>";
                    }
                }
            }
            echo generate_display_field(array('data_type' => '1', 'list_id' => 'rule_reminder_due_opt'), $action['due_status']) . "</span>)";
        }
        // Display the tooltip
        if (!empty($tooltip)) {
            echo "&nbsp;" . $tooltip . "<br>";
        } else {
            echo "<br>";
        }
        // Add the target(and rule id and room for future elements as needed) to the $current_targets array.
        // Only when $mode is reminders-due
        if ($mode == "reminders-due" && $GLOBALS['enable_alert_log']) {
            $target_temp = $action['category'] . ":" . $action['item'];
            $current_targets[$target_temp] = array('rule_id' => $action['rule_id'], 'due_status' => $action['due_status']);
        }
    }
    // Compare the current with most recent action log (this function will also log the current actions)
    // Only when $mode is reminders-due
    if ($mode == "reminders-due" && $GLOBALS['enable_alert_log']) {
        $new_targets = compare_log_alerts($patient_id, $current_targets, 'clinical_reminder_widget', $_SESSION['authId']);
        if (!empty($new_targets) && $GLOBALS['enable_cdr_new_crp']) {
            // If there are new action(s), then throw a popup (if the enable_cdr_new_crp global is turned on)
            //  Note I am taking advantage of a slight hack in order to run javascript within code that
            //  is being passed via an ajax call by using a dummy image.
            echo '<img src="../../pic/empty.gif" onload="alert(\'' . xls('New Due Clinical Reminders') . '\\n\\n';
            foreach ($new_targets as $key => $value) {
                $category_item = explode(":", $key);
                $category = $category_item[0];
                $item = $category_item[1];
                echo generate_display_field(array('data_type' => '1', 'list_id' => 'rule_action_category'), $category) . ': ' . generate_display_field(array('data_type' => '1', 'list_id' => 'rule_action'), $item) . '\\n';
            }
            echo '\\n' . '(' . xls('See the Clinical Reminders widget for more details') . ')';
            echo '\');this.parentNode.removeChild(this);" />';
        }
    }
}
예제 #29
0
 myRestoreSession();
 if (f.form_cmsportal_login_pass) {
  var login = encodeURIComponent(f.form_cmsportal_login.value);
  var pass  = encodeURIComponent(f.form_cmsportal_login_pass.value);
  var email = encodeURIComponent(f.form_email.value);
  if (login) {
   if (!pass) {
    alert('<?php 
echo xls('Portal password is missing');
?>
');
    return false;
   }
   if (!email) {
    alert('<?php 
echo xls('Email address is missing');
?>
');
    return false;
   }
   // Need a *synchronous* ajax request here. Successful updating of the portal
   // is required before we can submit the form.
   $.ajax({
    type: "GET",
    dataType: "text",
    url: 'patient_form_ajax.php?login='******'&pass='******'&email=' + email,
    async: false,
    success: function(data) {
     if (data) {
      alert(data);
      errmsg = data;
예제 #30
0
파일: cqm.php 프로젝트: mi-squared/openemr
}
?>
 }
 
 function Form_Validate() {
	 <?php 
if (empty($report_id) && ($type_report == "amc" || $type_report == "amc_2011" || $type_report == "amc_2014_stage1" || $type_report == "amc_2014_stage2")) {
    ?>
	
		 var d = document.forms[0];		 
		 FromDate = d.form_begin_date.value;
		 ToDate = d.form_target_date.value;
		  if ( (FromDate.length > 0) && (ToDate.length > 0) ) {
			 if (FromDate > ToDate){
				  alert("<?php 
    echo xls('End date must be later than Begin date!');
    ?>
");
				  return false;
			 }
		 }
	<?php 
}
?>

	//For Results are in Gray Background & disabling anchor links
	<?php 
if ($report_id != "") {
    ?>
	$("#report_results").css("opacity", '0.4');
	$("#report_results").css("filter", 'alpha(opacity=40)');