Solved

Why does this switch / case not work?

Posted on 2016-08-02
7
72 Views
Last Modified: 2016-08-04
Here's my code:

<?
      switch($eventtype){
        case "comment":
        case "text":
        case "note":
        ?>
          <?=$content?>
        <?
          break;
        case "statement":
            $dir_exists = $demo ? true : is_dir($dir);
            $file_exists = $demo ? true : file_exists($dir . $file);

            if($file_exists && $dir_exists) {
        ?>
            <a href='<?=$demo?'/admin/statement/?accountid='.$demo:'/admin/statement/load/'.$content?>' target='_statement'><img src='/assets/images/pdf_hover.png'/>View Statement</a>
        <?
            } else if($dir_exists) {
        ?>  
            <span class="error">Failed to send.</span>
        <? 
            } else {
        ?> 
            <span class="pending">Attempted to send... Pending feedback.</span>
        <?
            }
          break;
        case "transaction":
        ?>
        <div class='amount'><?=GlobalFunctions::formatMoney($amount)?><span class='float'>
          <span class='payer <?=$payer?>'><?=$payer?></span><span class='transtype <?=$transactiontype?>'><?=$transactiontype?></span>
        </div>
        <?if($dos !== null && $dos !=='1900-01-01'){?><div class="dos"><?='DOS : ' . date('M d, Y',strtotime($dos))?></div><?}?>
        <div class='encounter'><?if($encountercode != null){?>Encounter Code <?=$encountercode?><?}else{?>No encounter<?}?></div>
        <div class='description'>
          <?=$content?>
        </div>
        <?
          break;
        case "transactions":
        ?>
        <ul>
        <?foreach($transactions as $txn){
        ?>
        <li>
          <div class='amount'><?=GlobalFunctions::formatMoney($txn['amount'])?><span class='float'>
            <span class='payer <?=$txn['payer']?>'><?=$txn['payer']?></span><span class='transtype <?=$txn['transactiontype']?>'><?=$txn['transactiontype']?></span>
          </div>
          <?if($txn['dos'] !== null && $txn['dos'] !=='1900-01-01'){?><div class="dos"><?='DOS : ' . date('M d, Y',strtotime($txn['dos']))?></div><?}?>
          <div class='encounter'><?if($txn['encountercode'] != null){?>Encounter Code <?=$txn['encountercode']?><?}else{?>No encounter<?}?></div>
          <div class='description'>
            <?=$txn['content']?>
          </div>
          <div class='txntime'><?=Date('h:i A',strtotime($txn['eventdate']))?></div>
          <?/*if(isset($txn['runningbal'])){?>
           <div class='runningbal'>Running balance : <span><?=$txn['runningbal']?></span></div>
          <?}*/?>
        </li>
        <?}?>
        </ul>
		<?
		break;
		case "personal_payments":
		?>
		<ul>
        <?foreach($transactions as $txn_payer){
		if($txn_payer['payer']<>"I")
		{
			continue;
		}
		else
		{		
        ?>
        <li>
          <div class='amount'><?=GlobalFunctions::formatMoney($txn_payer['amount'])?><span class='float'>
            <span class='payer <?=$txn_payer['payer']?>'><?=$txn_payer['payer']?></span><span class='transtype <?=$txn_payer['transactiontype']?>'><?=$txn_payer['transactiontype']?></span>
          </div>
          <?if($txn_payer['dos'] !== null && $txn_payer['dos'] !=='1900-01-01'){?><div class="dos"><?='DOS : ' . date('M d, Y',strtotime($txn_payer['dos']))?></div><?}?>
          <div class='encounter'><?if($txn_payer['encountercode'] != null){?>Encounter Code <?=$txn_payer['encountercode']?><?}else{?>No encounter<?}?></div>
          <div class='description'>
            <?=$txn_payer['content']?>
          </div>
          <div class='txntime'><?=Date('h:i A',strtotime($txn_payer['eventdate']))?></div>
          <?/*if(isset($txn_payer['runningbal'])){?>
           <div class='runningbal'>Running balance : <span><?=$txn_payer['runningbal']?></span></div>
          <?}*/?>
        </li>
        <?
		}
		}?>
        </ul>
		<?php
      }
	?>

Open in new window


What you see is put into motion with a JavaScript code that changes the class assignment to different "<li>'s." That looks like this:

      $('input[name="filt"]').on('change',function(){
        if(this.value=='all'){
          if($(this).is(':checked')) $('input[name="filt"]').attr('checked', true);
          else $('input[name="filt"]').attr('checked', false);
        } else {
          $('input[name="filt"][value="all"]').attr('checked', false);
        }
        var show = [];
        var left = true;
        $('input[name="filt"]:checked').each(function(){
          show.push($(this).val());
        });
        var year = '';
        var month = '';
        $('.at_timeline_list li').each(function(){
          if($(this).hasClass('yearheader')){
            if(year && year.data('delete')) year.slideUp();
            else if(year) year.slideDown();
            year = $(this);
            year.data('delete', true);
          } else if($(this).hasClass('monthheader')){
            if(month && month.data('delete')) month.slideUp();
            else if(month) month.slideDown();
            month = $(this);
            month.data('delete', true);
          } else if($(this).hasClass('event')){
            if(show.indexOf($(this).data('type'))!=-1){
              $(this).removeClass('left').removeClass('right');
              $(this).addClass(left?'left':'right');
              left=!left;
              if($(this).css('display')!='list-item') $(this).slideDown();
              year.data('delete',false);
              month.data('delete',false);
            } else {
              if($(this).css('display')=='list-item') $(this).slideUp();
            }
          }
        });
        if(year && year.data('delete')) year.slideUp();
        else if(year) year.slideDown();
        if(month && month.data('delete')) month.slideUp();
        else if(month) month.slideDown();
      });

Open in new window


When I say "Everything works," I'm talking about all of the cases except for the one that I've been asked to add to the mix. That one is "personal_payments." When I click on the box like what you see pictured below...

screenshot of timeline app
Nothing happens. I'm needing all of the transactions that don't have a green "P" to slip out of sight and nothing happens.

What am I missing?
0
Comment
Question by:brucegust
7 Comments
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 150 total points
ID: 41739785
I don't know if this is part of it, but it's clearly wrong so I would change it right now before you do anything else.  Don't use the PHP short open tag.  It's like driving on the wrong side of the road.  You have to be lucky to get things to work out well.

Don't do this: <?

Instead do: <?php
0
 
LVL 21

Assisted Solution

by:Kim Walker
Kim Walker earned 50 total points
ID: 41739786
Is it safe to assume that the Personal Payments checkbox is named filt? If so, then the javascript you've supplied should be executed when it is checked. However, there's nothing in the javascript code that would submit the form in order for the PHP switch to be executed. The PHP switch is executed when the page source code is generated. The javascript code and PHP code work independently; only the javascript code is tied to the Personal Payments checkbox change event but only if the checkbox is named filt.

If the switch is not generating the expected HTML source code, we'd need to know more about how the PHP $eventtype variable is defined.

On a side note, switching in and out of PHP is similar to switching vehicles while traveling across the country. You have to park the car and maneuver to the airplane, then disembark the plane and maneuver to the car. Constantly switching in and out of PHP is somewhat taxing on the server. I highly recommend learning to use Heredoc string syntax with embedded PHP variables.
1
 
LVL 51

Accepted Solution

by:
Julian Hansen earned 300 total points
ID: 41740171
If I understand the question correctly - you have added the following to the code

Personal Payments checkbox in the header
The PP icon in the legend
The PP icon in the transactions

When you uncheck the PP checkbox you want the transactions with the P icon to slideup (hide themselves) when you check it they must show?

If so this is not a PHP question - it is a JavaScript question - the HTML has already been rendered - all transactions are in the page - displayed or hidden by classes applied by JavaScript linked to the state of the check boxes at the top of the page

I am trying to see how the JavaScript provided links to the generated code - either I am missing something or not all of the code is there.

What would be more useful is if you did a Page Source of the rendered page and posted the HTML here so we can see what is going on.
0
Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:brucegust
ID: 41740587
Julian, here's the source code as well as a screen shot...

<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>  <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
  <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>PatientFocus: Client Portal</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="/assets/css/views/app2/bootstrap.min.css">
    <link rel="stylesheet" href="/assets/css/views/app2/bootstrap-responsive.min.css">
    <link rel="stylesheet" href="/assets/css/pepper-grinder/jquery-ui-1.8.21.custom.css">
    <link rel="stylesheet" href="/assets/css/views/app2/patientfocus.css">
    <link rel="stylesheet" href="/style/taskcolors/tasks.css">
    <link href='https://fonts.googleapis.com/css?family=Open+Sans:300,600,400italic,700italic,400,700|Titillium+Web:400,700,300,600' rel='stylesheet' type='text/css'>
    <link href='/assets/images/app/favicon.png' rel='icon'>
    
        <script data-main="/assets/js/views/app_ang/main" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.14/require.min.js"></script>
    <script type="text/javascript">

        //GLOBAL SPACING
        var PAGELOAD_TIMESTAMP = Date.now();

        // This is crazy that I have to do this much to make this happen.
        // Eventually the pf library will be rebuilt and made sensible, and I'll use a modular
        // and Angular approach to build iteration 2.
        require.config({
            baseUrl : '/assets/js/views/app_ang',
            urlArgs: "t="+PAGELOAD_TIMESTAMP,
            waitSeconds : 0,
            paths: {
                'jquery' : '/assets/js/views/app2/jquery-1.8.2.min',
                'pf' : '/assets/js/pf/pf',
                'pf.apps' : '/assets/js/pf/apps',
                'pf.accounts'     : '/assets/js/pf/accounts',
                'pf.tables'       : '/assets/js/pf/tables',
                'pf.tasks'        : '/assets/js/pf/tasks',
                'pf.user'         : '/assets/js/pf/user',
                'pf.util'         : '/assets/js/pf/util',
                'pf.calls'        : '/assets/js/pf/calls',
                'pf.tickets'      : '/assets/js/pf/tickets',
                'pf.sounds'       : '/assets/js/pf/sounds',
                'pf.transactions' : '/assets/js/pf/transactions',
                'jsMVC' : '/assets/js/mvc/mvc',
                'AppPortal' : '/assets/js/views/app_ang/modules/AppPortal',
                'angular' : "//ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min",
                'angularMocks' : "//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular-mocks",
                'angularRoutes' : "//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular-route.min"
            }
        });
        //TODO::
        requirejs.config({
            shim: {
                '/assets/js/jquery.caret.1.02.min.js': ['jquery'],
                '/assets/js/jquery.loadView.js': ['jquery'],
                '/assets/js/views/app2/jquery.placeholder.min.js': ['jquery'],
                '/assets/js/views/app2/jquery.tagsinput.js': ['jquery'],
                '/assets/js/views/app2/jquery.dropkick-1.0.0.js': ['jquery'],
                '/assets/js/jquery.sortElements.js': ['jquery'],
                '/assets/js/jquery.history.js': ['jquery'],
                '/assets/js/jqueryDynamicInput.js': ['jquery'],
                '/assets/js/custom_radio.js': ['jquery'],
                '/assets/js/views/app2/jquery-ui-1.10.2.custom.min.js' : ['jquery'],
                '/assets/js/views/app2/custom_checkbox_and_radio.js' : ['jquery'],
                '/assets/js/views/app2/custom_radio.js' : ['jquery'],
                'jsMVC': ['jquery'],
                'pf':['jquery'],
                'pf.apps':['pf'],
                'pf.accounts' : ['pf'],
                'pf.tables' : ['pf','jsMVC'],
                'pf.tasks' : ['pf'],
                'pf.user' : ['pf'],
                'pf.util' : ['pf', 'jquery', 'jsMVC'],
                "/assets/js/views/app2/bootstrap.min.js" : ['jquery'],
                "angular" : {
                    "exports" : "angular"
                },
                "angularRoute" : ["angular"],
                "angularMocks" : {
                    deps : ["angular"],
                    exports : "angular.mock"
                }
            }
        });
    </script>

      <!--[if IE 8]>
    <link rel="stylesheet" href="assets/css/ie8.css">
  <![endif]-->
  
  <script src="/assets/js/views/app2/modernizr-2.6.2.min.js" type="text/javascript" charset="utf-8"></script>
  
</head>
<body class="development">
  <div class='devnot'>DEV ENVIRONMENT: Data is not live.</div>
    <header>
    <div class="container clearfix">
      <h1 class="home hide-text">PatientFocus <span class="entypo">⌂</span></h1>
      <h2 class="client" ng-controller="ClientSelector">
        <div class="dropdown select">
          <ul class="dropdown-menu">
              <li><a href="" data-value='' ng-click="changeClient('')">All Clients</a></li>
              <li><a href="" data-value='AIRCARE' ng-click="changeClient('AIRCARE')">Aircare Home Respiratory, a Verus Company</a></li><li><a href="" data-value='ALLEN' ng-click="changeClient('ALLEN')">Allen Parish Hospital</a></li><li><a href="" data-value='Amsurg' ng-click="changeClient('Amsurg')">Amsurg</a></li><li><a href="" data-value='AMG' ng-click="changeClient('AMG')">Anesthesia Medical Group</a></li><li><a href="" data-value='BCMH' ng-click="changeClient('BCMH')">Barton County Memorial Hospital, Lamar, MO</a></li><li><a href="" data-value='BBGH' ng-click="changeClient('BBGH')">Box Butte General Hospital</a></li><li><a href="" data-value='CMI' ng-click="changeClient('CMI')">Choice Medical</a></li><li><a href="" data-value='DALE' ng-click="changeClient('DALE')">Dale Medical Center</a></li><li><a href="" data-value='DHDC' ng-click="changeClient('DHDC')">Deer Creek</a></li><li><a href="" data-value='DCC' ng-click="changeClient('DCC')">Diabetes Care Club</a></li><li><a href="" data-value='DMH' ng-click="changeClient('DMH')">Doctors Memorial Hospital</a></li><li><a href="" data-value='ECH' ng-click="changeClient('ECH')">Elmore Community Hospital</a></li><li><a href="" data-value='EDA' ng-click="changeClient('EDA')">Endocrinology-Diabetes Associates</a></li><li><a href="" data-value='FCH' ng-click="changeClient('FCH')">Fishermen's Community Hospital</a></li><li><a href="" data-value='GAH' ng-click="changeClient('GAH')">Georgiana Hospital</a></li><li><a href="" data-value='DEMO' ng-click="changeClient('DEMO')">Gotham General Hospital</a></li><li><a href="" data-value='HCH' ng-click="changeClient('HCH')">Harrison County Hospital</a></li><li><a href="" data-value='HRMC' ng-click="changeClient('HRMC')">Hendry Regional Medical Center</a></li><li><a href="" data-value='DSCHD2' ng-click="changeClient('DSCHD2')">Hereford Regional Medical Center (DSCHD2)</a></li><li><a href="" data-value='DSCHD' ng-click="changeClient('DSCHD')">Hereford Regional Medical Center (DSCHD)</a></li><li><a href="" data-value='HOUCOHO' ng-click="changeClient('HOUCOHO')">Houston County Hospital</a></li><li><a href="" data-value='LMCH' ng-click="changeClient('LMCH')">Lake Martin Community Hospital</a></li><li><a href="" data-value='MCGH' ng-click="changeClient('MCGH')">Macon County General Hospital</a></li><li><a href="" data-value='SDP' ng-click="changeClient('SDP')">Medina Surgery Center</a></li><li><a href="" data-value='MERCY' ng-click="changeClient('MERCY')">Mercy Community Healthcare</a></li><li><a href="" data-value='NLI' ng-click="changeClient('NLI')">New Light Imaging</a></li><li><a href="" data-value='NWL' ng-click="changeClient('NWL')">Northwestern Louisiana Cancer Center</a></li><li><a href="" data-value='OVSH' ng-click="changeClient('OVSH')">Ohio Valley Surgical Hospital</a></li><li><a href="" data-value='ONCO' ng-click="changeClient('ONCO')">Oncologics</a></li><li><a href="" data-value='OHOI' ng-click="changeClient('OHOI')">One Hundred Oaks Imaging, LLC</a></li><li><a href="" data-value='OPTI' ng-click="changeClient('OPTI')">Optimal Radiology</a></li><li><a href="" data-value='PF' ng-click="changeClient('PF')">PatientFocuses</a></li><li><a href="" data-value='PCMG' ng-click="changeClient('PCMG')">Pecos County Memorial Hospital</a></li><li><a href="" data-value='EPLUS' ng-click="changeClient('EPLUS')">PET Imaging</a></li><li><a href="" data-value='PORTHO' ng-click="changeClient('PORTHO')">Premier Orthopaedics</a></li><li><a href="" data-value='RCC' ng-click="changeClient('RCC')">RxCareClub A-Z DiabetesCareClub</a></li><li><a href="" data-value='SMC' ng-click="changeClient('SMC')">Shoshone Medical Center</a></li><li><a href="" data-value='SHIC' ng-click="changeClient('SHIC')">Spring Hill Imaging Center</a></li><li><a href="" data-value='SMH' ng-click="changeClient('SMH')">Stephens Memorial Hospital</a></li><li><a href="" data-value='TRAD' ng-click="changeClient('TRAD')">Tennessee Oncology (TRAD)</a></li><li><a href="" data-value='TONC' ng-click="changeClient('TONC')">Tennessee Oncology (TONC)</a></li><li><a href="" data-value='TPS' ng-click="changeClient('TPS')">Tennessee PET Scan Company</a></li><li><a href="" data-value='TNRETINA' ng-click="changeClient('TNRETINA')">Tennessee Retina</a></li><li><a href="" data-value='TTT' ng-click="changeClient('TTT')">Test Transaction Transition</a></li><li><a href="" data-value='00077793111' ng-click="changeClient('00077793111')">TestClient2</a></li><li><a href="" data-value='TSC' ng-click="changeClient('TSC')">The Surgical Clinic</a></li><li><a href="" data-value='UGLA' ng-click="changeClient('UGLA')">Union General Hospital (UGLA)</a></li><li><a href="" data-value='UGH' ng-click="changeClient('UGH')">Union General Hospital (UGH)</a></li><li><a href="" data-value='URMC' ng-click="changeClient('URMC')">United Regional Medical Center</a></li><li><a href="" data-value='UTH' ng-click="changeClient('UTH')">United Telehealth Services (UTH)</a></li><li><a href="" data-value='UTS' ng-click="changeClient('UTS')">United Telehealth Services (UTS)</a></li><li><a href="" data-value='VIBM' ng-click="changeClient('VIBM')">Vanderbilt Belle Meade Imaging</a></li><li><a href="" data-value='CPAP' ng-click="changeClient('CPAP')">Verus Healthcare</a></li><li><a href="" data-value='CPAPNew' ng-click="changeClient('CPAPNew')">Verus Healthcare - NEW</a></li><li><a href="" data-value='WCH' ng-click="changeClient('WCH')">Wagoner Community Hospital</a></li><li><a href="" data-value='WMC' ng-click="changeClient('WMC')">Wiregrass Medical Center</a></li>          </ul>
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" data-value='TONC'>Tennessee Oncology (TONC)</a>
          <b class="active-icon"></b>
        </div><!-- end dropdown -->
      </h2><!-- end client -->
      <h3 class="user">
        <div class="dropdown">
          <a href="" class="dropdown-toggle" data-toggle="dropdown">Bruce Gust</a>
          <b class="active-icon"></b>
          <ul class="dropdown-menu">
                        <li><a id="spoofer" href="">Spoof</a></li>            <li><a id="manage_users">Manage Users</a></li>            <li><a id="my_settings" href="">My Settings</a></li>
            <li><a href="/logout">Logout</a></li>
          </ul>
        </div><!-- end dropdown -->
      </h3> 
    </div><!-- end container -->
  </header>
  <nav>
    <ul class="container clearfix openapps">
      <li>
        <div class="app-dropdown dropdown">
          <a href="" class="app-menu dropdown-toggle" data-toggle="dropdown">Apps</a>
          <ul class="dropdown-menu">
            <li><a class="demographics account-timeline" href="" endpoint="/app/accounttimeline" data-name="Account Timeline" data-category="demographics" data-description="View the communication and payment history of any patient in the system.">Account Timeline</a></li><li><a class="demographics communications" href="" endpoint="/app/communications" data-name="Communications" data-category="demographics" data-description="A breakdown of patient communications by day.">Communications</a></li><li><a class="demographics par-status" href="" endpoint="/app/parstatus" data-name="Par Status" data-category="demographics" data-description="View par collection and status information">Par Status</a></li><li><a class="financial invoices" href="" endpoint="/app/invoices" data-name="Invoices" data-category="financial" data-description="View your monthly invoices by opening this app.">Invoices</a></li><li><a class="financial posting" href="" endpoint="/app/posting" data-name="Posting" data-category="financial" data-description="This app displays real-time payments posted to our system. You may begin posting from this App instead of the invoice once you have spoken with your account representative. Give us a call when you are ready to start.">Posting</a></li><li><a class="financial weekly-collections-and-ar" href="" endpoint="/app/weeklycollectionsandar" data-name="Weekly Collections and AR" data-category="financial" data-description="View Placements, Adjustments and Overall AR by Week">Weekly Collections and AR</a></li><li><a class="tasks account-review" href="" endpoint="/app/accountreview" data-name="Account Review" data-category="tasks" data-description="View all the accounts we have reviews open on, and check them off one at a time.">Account Review</a></li><li><a class="tasks insurance-review" href="" endpoint="/app/insurancereview" data-name="Insurance Review" data-category="tasks" data-description="When a patient claims there is more insurance to be remitted on a claim, that account ends up in this list. If you go through on a line-by-line basis and clarify the situation for us, we can proceed with the billing process!">Insurance Review</a></li>          </ul>
        </div>
      </li><li class="demographics account-timeline navtab active">
        <a class="open" href="" data-endpoint="/app/accounttimeline">
          <span class="shift_baseline">Account Timeline</span>
        </a>
        <a href="" class="closeapp"> - Close</a>
      </li></ul>
  </nav>
  <div class="stage"><div class="tab" data-endpoint="/app/accounttimeline"><div class="widget app_account_timeline demographics  subheaded "
  data-appurl='/app/accounttimeline'
  >
  <div class="widget_header catbg"><div class="container">
    <span class="wh_appname" title="View the communication and payment history of any patient in the system."><!--Account Timeline-->Account Timeline</span>
    <!--<span id="wh_apptemplatename" title="View the communication and payment history of any patient in the system.">View the communication and payment history of any patient in the system.</span>-->
         <div class='rightcontrols'>
      <a href='' class="right pintodash"><span class='copy'>Pin to dashboard</span><span class='icon'></span></a>
          </div>
  </div>
  </div>
  <div class='widget_subhead catbg2'><div class="container">
    <div class="at_searchwrap clearfix"><input class="at_search" placeholder="Search by first name, last name, or accountid."/><span class="magnificon"></span></div>
    <ul class="at_filters">
      <li>
        <span class="checkbox">
          <input type="checkbox" name="filt" value="all" checked/>
        </span><label>All</label>
      </li>
      <li>
        <span class="checkbox">
          <input type="checkbox" name="filt" value="transaction" checked/>
        </span><label>Transactions</label>
      </li>
      <li>
        <span class="checkbox">
          <input type="checkbox" name="filt" value="statement" checked/>
        </span><label>Statements</label>
      </li>
      <li>
        <span class="checkbox">
          <input type="checkbox" name="filt" value="note" checked/>
        </span><label>Notes</label>
      </li>
      <li>
        <span class="checkbox">
          <input type="checkbox" name="filt" value="comment" checked/>
        </span><label>Task Comments</label>
      </li>
	  <li>
        <span class="checkbox">
          <input type="checkbox" name="filt" value="personal_payments" checked/>
        </span><label>Personal Payments</label>
      </li>
    </ul>
</div></div>  <div class="widget_wrapper"><!--<div class="account_timeline widget">
  <div class="at_title">
    <span class="widgetname">Patient History</span>
    <div class="searchbar">
      <input name="accountid"/>
      <div class="appicons search"></div>
    </div>
    <div class="closer"></div>
  </div>
  <div class="at_filters">
    <ul class="at_filterlist">
      <li>All</li>
      <li>Transactions</li>
      <li>Statements</li>
      <li>Notes</li>
    </ul>
  </div>-->
  <div class="container height100">
      <div class="bigwelcome">
      Begin by searching for a patient by name and/or account id, then press enter.
    </div>
  </div>
  </div>
</div><script type='text/javascript'>
  /*pf.onReady(function(){
    pf.util.loadViewAssets([
      '/assets/css/views/app/templates/accounttimeline.css',
      '/assets/js/views/app/templates/accounttimeline.js'
      ],'initTimeline');
  });*/
    require(['/assets/js/views/app/templates/accounttimeline.js'], function(init) {
        init();
    });
</script>
    </div></div>


    <script>
        var _gaq=[['_setAccount','UA-XXXXXXX-X'],['_trackPageview']];
        (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
        g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
        s.parentNode.insertBefore(g,s)}(document,'script'));
    </script>
    <div class="copyright">Copyright © 2016 PatientFocus</div>
</body>
</html> 

Open in new window


screenshot
I'm looking for the JavaScript code that coincides with the "filt" variable (Kim, I see your observation and I'll look into that here in a little bit).

Ray, you're right. I'll change that. That's peppered throughout this entire app.

Thank you, gentlemen. We are poised on the threshold of great things!
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41740683
Ok, everything under the sun in there including angular .... and judging by the code submitted this is not really a proper Angular application - there is only one controller in that source and it is confined to the <h2> - I can't even begin to imagine how the rest of the code has been structured.

Bottom line without a working link or the full code base we are going to be hard pressed to help you.

From the source
// This is crazy that I have to do this much to make this happen.
// Eventually the pf library will be rebuilt and made sensible, and I'll use a modular
// and Angular approach to build iteration 2.

Open in new window

0
 

Author Comment

by:brucegust
ID: 41742625
Julian!

I'm going to close this question, just because there's more to it than what's fair to ask any ninja to deconstruct, however... And Kim, this is for you as well:

I still need to understand what's in front of me, so I'm breaking the JS that I have down bit by bit. The first question is at https://www.experts-exchange.com/questions/28961513/How-does-this-Javascript-work.html. Feel free to weigh in.

And Julian, where is the Angular? I looked that up to see what it is, but I don't recognize what I've got above as having anything than just your basic JS. Let me know if you would.

Thanks, guys!
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41742743
Take a look at line 48 - require is trying to load the angular 1.2.6 library. Also refer to the comment I cut from the code - in my previous post.

Angular in 10 seconds ...
It is a JavaScript framework for building client side applications (often called Single Page Applications). It is based on an MVC framework and a methodology called 2 way binding - you create your model (basically JS objects) and you bind those to the view (HTML Templates) - Angular handles the two way interaction between the two. So if you change the model - say with an AJAX call - the view automatically updates. Likewise - if you change the view (click something or type something into a control) it automatically updates the model.  It takes a bit of getting used to but once you have a handle on it there is no other way to build web based applications (in my view).

This project looks like something that has grown and been added to overtime and is overdue for a refactor - or rewrite.

If the page you are wanting to change is Angular based - then you would need to look in the model and controller for the page to see how to interact with the new checkbox.

If it is not using Angular then you would need to find where the click on the filt checkboxes is handled and deal with it there.
1

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
echo button 13 47
Phone Dialer 5 36
Test ddwrt:UserLookup 1 21
Link to SharePoint 2010 NewForm in modal dialog from regular site 4 22
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now