SELECT
ac.AccountID,
clt.ClientName,
clt.ClientTetrisID,
clt.ClientID,
cast(dbo.ufn_ClientPreference(clt.ClientID, 'StatementRollUp') as int) as StatementRollUp
from Statement st with (nolock)
Join Account ac with (nolock) on st.Accountid = ac.AccountID
join Patient pat with (nolock) on pat.AccountID = ac.AccountID
join Practice prt with (nolock) on ac.PracticeID = prt.PracticeID
join Client clt with (nolock) on prt.ClientID = clt.ClientID
left join
(select pmtplanamount, pmtplanday, primarypatientid, startingplanbalance from PaymentPlan
where planendeddate is null
and iscurrentplan = 1) pp
on pp.primarypatientid = pat.patientid
where ac.accountid=10093227
<?php
date_default_timezone_set('America/Chicago');
$mssql_pdo=new PDO("");
$mssql_pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
if(!$mssql_pdo)
{
echo "no connection";
}
function test(){
global $mssql_pdo;
//$sql="select TOP 5 patientcode from txn where accountid=10001124";
$sql="
SELECT
ac.AccountID,
clt.ClientName,
clt.ClientTetrisID,
clt.ClientID,
cast(dbo.ufn_ClientPreference(clt.ClientID, 'StatementRollUp') as int) as StatementRollUp
from Statement st with (nolock)
Join Account ac with (nolock) on st.Accountid = ac.AccountID
join Patient pat with (nolock) on pat.AccountID = ac.AccountID
join Practice prt with (nolock) on ac.PracticeID = prt.PracticeID
join Client clt with (nolock) on prt.ClientID = clt.ClientID
left join
(select pmtplanamount, pmtplanday, primarypatientid, startingplanbalance from PaymentPlan
where planendeddate is null
and iscurrentplan = 1) pp
on pp.primarypatientid = pat.patientid
where ac.accountid=10093227";
//echo $sql;
$query=$mssql_pdo->query($sql);
if(!$query){
echo "nope";
}
$result_array=array();
while($row=$query->fetch(PDO::FETCH_ASSOC) )
{
$result_array[]=$row;
}
return $result_array;
}
//$test_sql=getOldTransactions();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Patient Focus | SQL Machine</title>
<script language="JavaScript"><!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
window.open(selObj.options[selObj.selectedIndex].value, "_blank");
if (restore) selObj.selectedIndex=0;
}
// -->
</script>
<script type="text/javascript">
<!--
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'none')
e.style.display = 'block';
else
e.style.display = 'none';
}
//-->
</script>
<style>
body {
font-family:Arial;
size:12pt;
color:#000000;
}
.content {
margin:auto;
width:900px;
height:auto;
border:1px solid #cccccc;
border-radius:10px;
}
.wysiwyg {
white-space: pre-line;
padding-left:10px;
padding-right:10px;
}
.code_container {
border:1px solid #000000;
width:807px;
height:250px;
overflow:auto;
background-color: #013c76;
font-family:Arial;
color:#ffffff;
font-size:10pt;
margin:auto;
white-space:pre;
}
ol {
white-space: normal;
word-wrap: break-word;
width:750px;
margin:auto;
background-color:#036; background-repeat:repeat-y;background-position:center;
font-family:Helevtica, Arial;
font-size:10pt;
color:#ffffff;
}
ol li {
padding:6px;
background-color:#ffc;
color:#ffffff;
}
ol li span{
color:#000000; }
.blue {
color:blue;
}
</style>
</head>
<body>
<br><br>
<div class="content">
<div class="wysiwyg">
<table border="1" cellspacing="5" cellpadding="5" width="100%">
<tr>
<td>Account ID</td>
<td>Client Name</td>
<td>Client Tetris ID</td>
<td>Client ID</td>
<td>Statement Roll Up</td>
</tr>
<?php
$test_stuff=test();
//echo $test_stuff;
if($test_stuff){
//echo "yes";
}
foreach($test_stuff as $row)
{
echo "<tr><td>";
echo $row['AccountID'];
echo "</td><td>";
echo $row['ClientName'];
echo "</td><td>";
echo $row['ClientTetrisID'];
echo "</td><td>";
echo $row['ClientID'];
echo "</td><td>";
echo $row['StatementRollUp'];
echo "</td></tr>";
}
?>
</table>
</div>
</div>
</body>
</html>
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Fellow title is reserved for select members who demonstrate sustained contributions, industry leadership, and outstanding performance. We will announce the experts being inducted into the Experts Exchange Fellowship during the annual Expert Awards, but unlike other awards, Fellow is a lifelong status. This title may not be given every year if there are no obvious candidates.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.