Thursday, April 24, 2014

rearrange committee menu in canhealth




 C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_canhealth\canhealth\_templates\cesei_nav0.tmpl.php, line 185 change to

  <li  class="tier0"><a href="">Committees</a>      
      <ul>
        <?php
            // Get all committees from database or session variable. Function defined in cesei_globals.inc.php
            $committee_list = get_committees();           
            $committee_list_new = get_committees_new($_SESSION['member_id']);   
            foreach( $committee_list as $committee){   
                echo "<li><a href='/committee/".$committee['committee_description']."'>".htmlspecialchars($committee['committee_name'])."</a>";
               
               if (isset($_SESSION['portal_status']) &&$_SESSION['portal_status']['cesei'] == STATUS_ADMIN){
                  if( is_admin() || $committee['committee_name']==$_SESSION['member_committee']) {
                   echo "<ul>";
                   echo "<li><a href='/committee/collaboratives.php?committee=".htmlspecialchars($committee['committee_name'])."'>Collaborative Document</a></li>" ;
                   echo "<li><a href='/committee/forums/index.php?committee=".htmlspecialchars($committee['committee_name'])."'>Discussion Board</a></li>";
                   echo "<li><a href='/committee/meeting_room/index.php?committee=".htmlspecialchars($committee['committee_name'])."'>Meeting Rooms</a></li>    ";
                   echo "<li><a href='/committee/calendar/calendar.php?committee=".htmlspecialchars($committee['committee_name'])."'>Calendar</a></li>    ";
                   echo "</ul>";
                 }
              } else{
                 if(isset($_SESSION['member_committee'])&&htmlspecialchars($_SESSION['member_committee'])!="Not Applicable" &&htmlspecialchars($_SESSION['member_committee'])!="All Committees")
                 {
                   foreach( $committee_list_new as $key =>$committee1){   
                    if(($committee1[$key]>3)&&($key==$committee['committee_name'])) {
                      echo "<ul><li><a href='/committee/collaboratives.php?committee=".htmlspecialchars($key)."'>Collaborative Document</a></li>" ;
                      echo "<li><a href='/committee/forums/index.php?committee=".htmlspecialchars($key)."'>Discussion Board</a></li>";
                      echo "<li><a href='/committee/meeting_room/index.php?committee=".htmlspecialchars($key)."'>Meeting Rooms</a></li>    ";
                      echo "<li><a href='/committee/calendar/calendar.php?committee=".htmlspecialchars($key)."'>Calendar</a></li>    ";  
                      echo "</ul>";
                     }
                    }
                  }
               }

              echo "</li>";
           }
        ?>
       </ul>
  </li>

C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_canhealth\canhealth\_templates\cesei_nav_lang.tmpl.php 
<li class="tier0"><a href=" "><?php echo $map['Committees']; ?></a>      
      <ul>
        <?php
            // Get all committees from database or session variable. Function defined in cesei_globals.inc.php
            $committee_list = get_committees();          
            $committee_list_new = get_committees_new($_SESSION['member_id']);  
            foreach( $committee_list as $committee){  
                if(htmlspecialchars($committee['committee_name']) =='Technology'){
                    echo "<li><a href='/committee/".$committee['committee_description']."'>".$map['Technology']."</a>";              
               }
               elseif(htmlspecialchars($committee['committee_name']) =='Fundraising and Sponsorship'){
                    echo "<li><a href='/committee/".$committee['committee_description']."'>".$map['Fundraising']."</a>";              
               }
               elseif(htmlspecialchars($committee['committee_name']) =='Education'){
                    echo "<li><a href='/committee/".$committee['committee_description']."'>".$map['Education']."</a>";              
               }
               elseif(htmlspecialchars($committee['committee_name']) =='Research'){
                    echo "<li><a href='/committee/".$committee['committee_description']."'>".$map['Research']."</a>";              
               }
                else echo "<li><a href='/committee/".$committee['committee_description']."'>".htmlspecialchars($committee['committee_name'])."</a>";  
          
              
               if (isset($_SESSION['portal_status']) &&$_SESSION['portal_status']['cesei'] == STATUS_ADMIN){
                  if( is_admin() || $committee['committee_name']==$_SESSION['member_committee']) {
                   echo "<ul>";
                   echo "<li><a href='/committee/collaboratives.php?committee=".htmlspecialchars($committee['committee_name'])."'>".$map['Collaborative_Document']."</a></li>" ;
                   echo "<li><a href='/committee/forums/index.php?committee=".htmlspecialchars($committee['committee_name'])."'>".$map['Discussion Board']."</a></li>";
                   echo "<li><a href='/committee/meeting_room/index.php?committee=".htmlspecialchars($committee['committee_name'])."'>".$map['Meeting_Rooms']."</a></li>    ";
                   echo "<li><a href='/committee/calendar/calendar.php?committee=".htmlspecialchars($committee['committee_name'])."'>".$map['Calendar']."</a></li>    ";
                   echo "</ul>";
                 }
              } else{
                 if(isset($_SESSION['member_committee'])&&htmlspecialchars($_SESSION['member_committee'])!="Not Applicable" &&htmlspecialchars($_SESSION['member_committee'])!="All Committees")
                 {
                   foreach( $committee_list_new as $key =>$committee1){  
                    if(($committee1[$key]>3)&&($key==$committee['committee_name'])) {
                      echo "<ul><li><a href='/committee/collaboratives.php?committee=".htmlspecialchars($key)."'>".$map['Collaborative_Document']."</a></li>" ;
                      echo "<li><a href='/committee/forums/index.php?committee=".htmlspecialchars($key)."'>".$map['Discussion Board']."</a></li>";
                      echo "<li><a href='/committee/meeting_room/index.php?committee=".htmlspecialchars($key)."'>".$map['Meeting_Rooms']."</a></li>    ";
                      echo "<li><a href='/committee/calendar/calendar.php?committee=".htmlspecialchars($key)."'>".$map['Calendar']."</a></li>    ";  
                      echo "</ul>";
                     }
                    }
                  }
               }

              echo "</li>";
           }
        ?>
       </ul>
  </li>
 

Add RCCI committee





Add RCCI committee at Canhealth. In cesei_committee table
add committee_id: 5, committee_name: RCCI; committee_description: rcci.php
create rcci.php under committee
modify /_lib/edit_webcontent.php, line 25 add
       if (preg_match("/rcci.php/i",$_SERVER['PHP_SELF']))  $content_id=14;
line 71 add:
    else if($content_id==14)
    $sql_11="INSERT INTO web_content(content_id, revision, title, text) VALUES (14,0, '/committee/rcci.php', 'TBD')";   
line 153 add
       else if ($content_id==14) {
           header('Location: /committee/rcci.php');
           exit();
        }


C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_canhealth\canhealth\_templates\cesei_nav0.tmpl.php, line 148 add:
               <li><a href="/committee/rcci.php?edit=1&content_id=14">RCCI Committee</a></li>

Wednesday, April 23, 2014

update canhealth




1) Only keep member directory of global:
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_canhealth\canhealth\_templates\cesei_nav0.tmpl.php, line 246 commented out
     echo "<li><a href='/member_directory/index.php?committee=".htmlspecialchars($committee['committee_name'])."'>Member Directory</a></li>";
line 270 commented out
echo "<li><a href='/member_directory/index.php?committee=".htmlspecialchars($key)."'>Member Directory</a></li>";
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_canhealth\canhealth\_templates\cesei_nav_lang.tmpl.php, line 257 commented out
echo "<li><a href='/member_directory/index.php?committee=".htmlspecialchars($committee['committee_name'])."'>".$map['Member_Directory']."</a></li>";
line 281 commented out
 echo "<li><a href='/member_directory/index.php?committee=".htmlspecialchars($key)."'>Member Directory</a></li>";
Add institute membership
2) C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_canhealth\canhealth\membership.php
line 15 change
<p><strong>Click the link below to apply for '.INSTITUTION_FULL_NAME.' membership:</strong></p>
<a href="registration.php?type=2"><strong>Apply for  '.INSTITUTION_SHORT_NAME.' Membership</strong></a><br />
<br />
<div class="horizontal-rule"></div>

to

<p><strong>Individual Memberships are available for:</strong></p>
<ol>
   <li>Physicians, and surgeons</li>
   <li>Post graduate and undergraduate medical students</li>
   <li>Nurses, and allied professionals</li>
</ol>
<a href="registration.php?type=2"><strong>Apply for an Individual Membership</strong></a><br />
<br />
<div class="horizontal-rule"></div>

<p><strong>Institutional Memberships are available for:</strong></p>
<ol>
   <li>Universities, colleges, and other medically or technology related non-profit organizations</li>
   <li>Hospitals, primary, secondary, and tertiary health care units, private clinics, and other health and technology related associations</li>
</ol>
<a href="registration.php?type=3"><strong>Apply for an Institutional Membership</strong></a><br />
<br />

FreeBSD network setup





1)ifconfig
ifconfig em0 192.168.0.77 netMask 255.255.255.0
dhclient em0 to find gateway
add a gateway
route add default 192.168.0.25
vi /etc/resolv.conf
to configure  DNS
virtual box menu:
 http://dlc.sun.com.edgesuite.net/virtualbox/3.2.6_BETA1/UserManual.pdf
check which shell
echo $0
To add a user:
oot@myzone:~# useradd -m -d /bleonard -s /usr/bin/bash bleonard
80 blocks

root@myzone:~# passwd bleonard
New Password: 
Re-enter new Password: 
passwd: password successfully changed for bleonard

install firefox
pkg install firefox
no display specified

setup graph interface for freebsd
pkg install xorg

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x11.html

another way
pkg install gdm
vi /etc/rc.conf
gdm_enable="YES"

pkg install gnome2
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x11-wm.html 

6.7.1.2. Installing GNOME

The software can be easily installed from a package or the Ports Collection:
To install the GNOME package, type:
# pkg install gnome2
 

For proper operation, GNOME requires the /proc filesystem to be mounted. Add
proc           /proc       procfs  rw  0   0
to /etc/fstab to mount procfs(5) automatically during startup.
Once GNOME is installed, the X server must be told to start GNOME instead of a default window manager.
The easiest way to start GNOME is with GDM, the GNOME Display Manager. GDM is installed as part of the GNOME desktop, although it is disabled by default. It can be enabled by adding this line to /etc/rc.conf:
gdm_enable="YES"
Once you have rebooted, GDM will start automatically.
It is often desirable to start all GNOME services together with GDM. To achieve this, add the following line to /etc/rc.conf:
gnome_enable="YES"
GNOME may also be started from the command-line by properly configuring a file named .xinitrc. If a custom .xinitrc is already in place, simply replace the line that starts the current window manager with one that starts /usr/local/bin/gnome-session instead. If nothing special has been done to the configuration file, then it is enough simply to type:
% echo "/usr/local/bin/gnome-session" > ~/.xinitrc
Next, type startx, and the GNOME desktop environment will be started.

Install FreeBSD in virtual box in Windows 7





1. Oracle VM Virtual Box:
https://www.virtualbox.org/
2.  freebsd
https://www.freebsd.org/
I use Intel I5, according to freebsd installation menu:
https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/bsdinstall-hardware.html
FreeBSD/amd64 should be used for AMD64 processors, Intel® Core™ i3, i5 and i7 processors and more.
https://www.freebsd.org/releases/10.0R/announce.html
 ftp://ftp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/10.0/
get and save around 2.3GB
FreeBSD-10.0-RELEASE-amd64-dvd1.iso
I put it in (any directory is fine)
C:\Users\jiansen\VirtualBox VMs\iso
Open Oracle VM VirtualBox Manager
New
Name: FreeBSD 10 AMD64
Type BSD
Version: FreeBSD (64 bit)
The recommended of memory size is 128 MB, I set it 256 MB
create a virtual hard drive now
select VDI
dynamic allocated
chose 20GB
In Virtual box

go to Settings->Storage
Beside CD/DVD Drive, choose a virtual  CD/DVD file
got to the directory FreeBSD-10.0-RELEASE-amd64-dvd1.iso is located
and select FreeBSD-10.0-RELEASE-amd64-dvd1.iso
check live CD/DVD
Start or reset FreeBSD 10 AMD 64  (my name for this virtual server)
You need to type your hostname in the Set Hostname screen, I suggest "freebsd" but you might want another name for it. If you plan to use this system to host a network service like Kerberos or LDAP you might want to use a full qualified domain name here.
then choose default and click OK
hostname can be changed later:
As root, type "hostname <new hostname>", and the hostname will be changed
immediately. To make this change permanent across reboots, edit the file
'/etc/rc.conf', and add the following line:

 hostname="new.host.name"

The '/etc/rc.conf' file is described here:
set root password (I temporaly set it as password)password
 
 In the Network Configuration screen, select "<Yes>" for "IPv4", 
select "<Yes>" for "DHCP", select "<No>" for IPv6 
(VirtualBox 4.1.10 has limited support for IPv6) and select "<OK>"
 in the resolver configuration (your DNS servers should be there already
 but be sure to type at least one IP address if your fields are blank), in my case
Resolver configuration user network configuration, the following is already there
Search vchri.med.ubc.ca
IPV4 DNS #1: 142.103.1.1 
UTC time, select NO
select America, select 11 Canada
27 Pacific Time - West British Columbia (PDT)
create user jiansen jiansen  uncapture mouse right+ctrl
remember to unmount your virtual CD when the VirtualBox logo appears or it might boot from it again.  Devices->CD/DVD device uncheck bsd, force unmount

Post-Installation:

A minimal system is running, here is what you need to know in order to get started in the FreeBSD world.

Keep your Kernel updated

You probably want to check if there are updates (especially security ones) for your Kernel, use the following command to get the updates available:

 freebsd-update fetch
If updates are found, use the following command to install them:
 freebsd-update install

To install an application, using
pkg install curl



Tuesday, April 15, 2014

The Heartbleed Bug





As you may be aware, a security issue in OpenSSL known as Heartbleed has affected servers and services across the entire Internet. There is the potential to read all data including usernames and passwords. Fixed OpenSSL has been released and now it has to be deployed.
To be safe you should change passwords on any service AFTER it has been updated with new versions of OpenSSL.

Detail of  the Heartbleed Bug:
 http://heartbleed.com/

Update welcome message in Canhealth modules






http://localhost:8083/education/courses/users/create_module.php
http://localhost:8083/education/courses/index.php
SELECT * FROM edu_news e;
"Welcome to CESEI" is found
Go to manage module->Announcement->Edit
Go to manage module->Content->Edit
edu_language_text
SELECT * FROM edu_language_text WHERE text like "This%";
default_announcement in term in edu_language_txt
change text column:
"This is a welcome announcement. You can access additional help by using the Help link available throughout CESEI."
to
"This is a welcome announcement. You can access additional help by using the Help link available throughout CanHealth".
SELECT * FROM edu_language_text WHERE text like "Welcome%";
this_is_content in term column in edu_language_txt
Change
"Welcome to the CESEI LMS"
to
"Welcome to the CanHealth LMS"
welcome_to_atutor in term column in edu_language_txt
change
"Welcome to the CESEI"
to
"Welcome to the CanHealth"

SELECT * FROM edu_language_text WHERE text like "%cesei%";
change all CESEI to CanHealth

Tuesday, April 8, 2014

free pdf editor software




pdfedit: free pdf editor software for Windows and Linux
http://pdfedit.cz/en/index.html

Sunday, April 6, 2014

PHP, upload multiple files and progress bar




main.html
<!DOCTYPE html> 
<html>
 <head>
 <meta charset="UTF-8">
 </head> 
<body> 
<form action="upload.php" method="post" enctype="multipart/form-data">
 <p><input type="file" name="file_array[]">
 <input type="submit" value="Upload all files">
 </form> 
</body>
 </html>

upload.php
<?php /
 if(isset($_FILES['file_array'])){
 $name_array = $_FILES['file_array']['name']; 
$tmp_name_array = $_FILES['file_array']['tmp_name']; 
 $type_array = $_FILES['file_array']['type'];
 $size_array = $_FILES['file_array']['size']; 
$error_array = $_FILES['file_array']['error']; 
for($i = 0; $i < count($tmp_name_array); $i++){
 if(move_uploaded_file($tmp_name_array[$i], "test_uploads/".$name_array[$i]))
{ echo $name_array[$i]." upload is complete<br>"; }
 else {
 echo "move_uploaded_file function failed for ".$name_array[$i]."<br>"; } }
 } ?>

About upload progress bar, reference:
File Upload Progress Bar Meter Tutorial HTML5 Ajax PHP 
http://www.developphp.com/view.php?tid=1351

Thursday, April 3, 2014

Get WAMP running on EC2




Tutorial explaining the different problems you run into installing wamp on a windows machine on the EC2 cloud.
Reference:
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-hostname.html 
http://www.rndmr.com/amazon-aws-ec2-easy-web-serverset-up-guide-with-a-mac-and-coda-2-256/
video: Get WAMP running on EC2

Create Amazon AWS server Tutorial




Step by step to create a windows virtual machine in the Amazon Ec2 cloud
Video: Create Amazon AWS server Tutorial

Wednesday, April 2, 2014

Convert mp4 to flv using Sorenson Squeeze 4.5




Convert mp4 to flv using Sorenson Squeeze 4, choose 768K bit rate under Format & Compression settings and click apply, under right panel, click squeeze it

Converting Audio/Video .ogv file to .mp4 using VLC Media Player in WIndows 7




Double click ogv file, VLC media player will start.
Click Media->Convert/Save
Under File, click Add, and find ogv file to add, click convert save.
browse Destination file and create new file name with .mp4,
under Profile using Video-H.264 +AAC(MP4)
and click start
reference:
 https://www.youtube.com/watch?v=DZRlVq-aQ94

Tuesday, April 1, 2014

PHP in Netbean




PHP in Netbean
 https://netbeans.org/kb/docs/php/quickstart.html

Netbean IDE download, including Apache Tomcat
https://netbeans.org/downloads/index.html

First install Java b6 bits JDK
 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
jdk-8-windows-x64.exe

Create a simple Java Web application using MySQL
https://netbeans.org/kb/docs/web/mysql-webapp.html