Posts Tagged ‘PHP’

iBCScorp hires SEO marketing specialist

Posted on: June 3rd, 2011 by trina No Comments
Internet Business Consulting Services(iBCScorp) has added another SEO marketing specialist to its web development team. This SEO specialist has worked his way up in the company over the years to become the SEO Department Team Lead. He received a Post Graduate diploma in Information Technology from British Computer Society and has also received another Post Graduate diploma in Marketing Management from Sri Lanka Institute of Marketing. He is currently studying for his MBA in Marketing Management from Buckinghamshire New University, in the United Kingdom. He has had extensive experience with SEO/SEM/SMM techniques as a success Search Engine Optimizer for over 4 years now. He also has experience in web design and development. His web development knowledge includes: xHTML, HTML DOM, DHTML, CSS, Java Script, jQuery, XML,AJEX, VB Script, PHP, MySQL, SQL, and Active Server Page(ASP). He has experience in design with using programs such as: Photoshop, CorelDraw, Flash, and Fireworks. His in house experience with iBCScorp has been Managing/Administration in OpenERP and experience with Drupal, WordPress, and Joomla Content Management Systems. He also has experience with web hosting and web mastering. iBCScorp is continually expanding its company and is eager to add another qualified and experienced SEO marketing specialist to its team of developers. For questions concerning web development, please call 435-215-4674.

iBCScorp begins project for Landmark Real Estate

Posted on: May 18th, 2011 by trina No Comments
Internet Business Consulting Services(ibcscorp) contracted to complete a project for Landmark Real Estate(landmarkinsiders.com).  Landmark specializes in the sale of rented income properties.  Headquartered in SLC Utah this project will allow Landmark Insiders to promote and sale income generating properties through distribution channels in major metropolitan areas. The Landmark website enables buyers to purchase property that is already owned or managed(income property). The site will allow buyers, brokers and property owners to facilitate the sale of rental property under contract. The property is already earning income and is managed, so it’s an excellent investment opportunity. iBCScorp will be building the site using CodeIgniter, a PHP based framework. Initially Landmark had another web development company working on the project, but needed a web development company that had a little more expertise to complete the project. They turned to iBCScorp to finish the project. iBCScorp is a web development company based out of Saint George Utah.  Ibcscorp does web development projects using most open source web technologies.

MissionCards.com planning a website overhaul

Posted on: February 1st, 2011 by James Cluff No Comments
MissionCards.com, headquartered in Salt Lake City, Utah specializes in easy to order custom cards for LDS Missionaries.  If you’re not LDS, or a member of The Church of Jesus Christ of Latter Day Saints, but are still a missionary, this is still a great place to buy Missionary cards with themes focused on the Gospel of Jesus Christ. Missionary Business Cards feature the work of many famous artists including Chad Hawkins, Harry Anderson, Ted Henninger, Robert T. Barret, John Scott, Tom Lovell, and more. Missionaries purchase business cards because they want to re-locate people who they have become friends with and served with and be able to reach them. As anyone knows, the purpose of a Missionary’s Work is sharing the things that bring the most joy in their lives with other people. The result of that often is long lasting, loving relationships. If you want to learn more about Latter Day Saint Missionaries, or about the Church of Jesus Christ of Latter Day Saints, you can do that here mormon.org.  You could probably even have some Mormon Missionaries to come to your door, to share the message of Jesus Christ at no charge. There are over 50,000 full time missionaries from The Church of Jesus Christ of Latter Day Saints (The Mormons) serving people around the world. There are missionaries from many different denominations also serving missions to help other people. Because of this there is a large need for MissionCards.com to allow quick and easy printing of Business Cards for Missionaries. Missionarycards.com is putting forth this effort to redo their website and improve the business card ordering process on their website because as time passes sites seem to loose their impact as new better web based software and techniques become available. In order to make these changes happen, Missionary Cards has contracted with Saint George Utah Based Internet Business Consulting Services Corporation (ibcscorp.com). Internet Business Consulting Services looks forward to working with MissionCards.com to help improve their product offering, and to help them market their product with web marketing and SEO (Search Engine Optimization) Techniques.  The current site is done in PHP, and will likely stay PHP, or be migrated to Cake PHP, or to a CMS Content Management application in the future for easier maintenance and development. Look for new products and an easier to use interface coming soon at Missioncards.com

CakePHP Samples

Posted on: December 2nd, 2010 by Keerthi Bandara 1 Comment
This post provides some sample source code segment, extracted from our previously developed systems. The intention here is to depict the coding practices we apply within iBCScorp. Samples given below are based on CakePHP MVC framework. iBCScorp has involved in CakePHP development since the version 1.1. After that we have continued with 1.2.x releases and then absorbed 1.3.x releases into our developments later on. iBCScorp started using CakePHP 1.3 in projects since its pre-stable releases. Adopting the new version early helped iBCScorp to keep its source code clean and tight with new syntactical improvements, while avoiding version upgrades in near future. FreedomTravel4You.com is one of the sites built on CakePHP 1.3. Following code segment is extracted from its codebase. (agent_tree_controller.php). [php] <?php /** * Short description for file * This file handles the Agent Tree View functionality * * PHP versions > 5.0, CakePHP versions > 1.3 * * @package FreedomTravel4You.com * @author iBCScorp. * @copyright iBCScorp. * @license As described below * @version 1.0.0 * @since File available since Release 1.1.0 dt. Friday, 04 December, 2009 */ /********************************************************* * Licence: * This file is sole property of the installer. * Any type of copy or reproduction without the consent * of owner is prohibited. * If in any case used leave this part intact without * any modification. * All Rights Reserved * Copyright 2009 Owner *******************************************************/ class AgentTreeController extends AppController { var $name = ‘AgentTree’; var $uses = array(‘User’, ‘UserTree’); var $components = array(‘Auth’); var $helpers = array(‘Html’, ‘Javascript’, ‘TreeView’); function beforeFilter() { if($this->Session->read(‘user_info.admin’)){ $this->set(‘menu_type’, ‘admin’); } else { $this->set(‘menu_type’, ‘agent’); } $this->set(‘show_side_bar’, 0); } function index($element_id = null) { $this->common_tree_info($element_id); $this->set(‘page_title’, ‘Agent’); } // Action to display unassigned users for logged in agent function assign_agent() { $curr_user_id = $this->Session->read(‘Auth.User.id’); $unassigned_childrens = $this->User->get_unassigned_children($curr_user_id); $this->set(‘unassigned_childrens’, $unassigned_childrens); $this->set(‘page_title’, ‘Agent’); } // Display tree view to assign new agents to tree function add_to_tree($element_id = null) { $new_child_id; if(isset($this->params['form']['child_id'])){ $new_child_id = $this->params['form']['child_id']; // Store selected child-id to be assigned to tree $this->Session->write(‘child_to_be_assigned’, $new_child_id); } elseif($this->Session->check(‘child_to_be_assigned’)) { $new_child_id = $this->Session->read(‘child_to_be_assigned’); } else { $this->redirect(‘/agent_tree/assign_agent’); exit(0); } // get the child name for particular id $new_child_info = $this->User->find(‘first’, array( ‘conditions’ => array(‘id’ => $new_child_id), ‘fields’ => array(‘first_name’) )); // Call the common function to initialize tree $this->common_tree_info($element_id); $this->set(‘new_agent_name’, $new_child_info['User']['first_name']); $this->set(‘page_title’, ‘Agent’); } // Funtion to apend child to tree (last step) function append_child() { $child = explode("_", trim($this->params['form']['child_id'])); $tree_data = array(); $tree_data['UserTree']['parent_id'] = $child[0]; $tree_data['UserTree']['child_position'] = $child[1]; $tree_data['UserTree']['child_id'] = $child[2]; // Tree ID of the new Agent $this->UserTree->create(); $this->UserTree->save($tree_data); $new_user_id = $this->Session->read(‘child_to_be_assigned’); $this->User->id = $new_user_id; $this->User->saveField(‘tree_id’, $child[2]); $this->redirect(‘/agent_tree/index’); exit(0); } // Common function to initialize tree view. private function common_tree_info($element_id = null) { // Get user tree ID $curr_user_id = $this->Session->read(‘Auth.User.id’); $curr_user_info = $this->User->find(‘first’, array( ‘conditions’ => array(‘id’=> $curr_user_id), ‘fields’ => array(‘first_name’, ‘tree_id’, ‘parent_available’) )); // If this user is not yet appended to the tree disable this functionality if($curr_user_info['User']['parent_available'] == 0) { $this->redirect(‘/agent_tree/user_not_assigned’); exit(0); } $tree_id = ”; // tree id of the current root node // Get the user info for root element i.e. logged in or requested if(isset($element_id)){ $tree_id = $element_id; } else { $tree_id = $curr_user_info['User']['tree_id']; } $root_info = $this->User->get_root_node_info($tree_id); //reference_id of the current user or requested root element $this->set(‘root_reference_id’, $root_info['u']['reference_id']); // first name of the current root element $root_name = $root_info['u']['first_name'] . ‘ ‘ . $root_info['u']['last_name']; $this->set(‘root_name’, $root_name); //id of the current root node $this->set(‘root_id’, $root_info['u']['id']); //logged in user’s id $this->set(‘user_id’, $curr_user_id); //tree_id of the current user or requested root element $this->set(‘root_node’, $root_info['u']['tree_id']); // Used to display move up link $this->set(‘up_level_id’, $root_info['t']['parent_id']); } // Action to display on tree view, when logged in user is not assigned to the tree function user_not_assigned() { $this->set(‘page_title’, ‘Agent’); } function search_agent() { $this->layout = ‘ajax’; Configure::write(‘debug’, 0); $search_value = trim($this->params['named']['q']); // Check the type of search criteria $search_type = ”; // Check whether it is an email if(stripos($search_value, ‘@’) !== FALSE) { $search_type = ‘TYPE_EMAIL’; } elseif (!is_numeric(substr($search_value, 0 , 2)) && is_numeric(substr($search_value, 2 , 6))){ // Check for reference number $search_type = ‘TYPE_REF’; } else { // Value is a name $search_type = ‘TYPE_NAME’; } $conditions = array(); // Check whether email or reference # to be searched if($search_type == ‘TYPE_REF’) { // ref # $conditions['and'] = array( ‘reference_id’ => $search_value, ‘tree_id not’ => ‘NULL’ ); } elseif($search_type == ‘TYPE_EMAIL’) { // email $conditions['and'] = array( ‘email’ => $search_value, ‘tree_id not’ => ‘NULL’ ); } elseif($search_type == ‘TYPE_NAME’) { $conditions['and'] = array( ‘or’ => array(‘first_name like’ => ‘%’ . $search_value . ‘%’, ‘last_name like’ => ‘%’ . $search_value . ‘%’ ), ‘tree_id not’ => ‘NULL’ ); } $result = $this->User->find(‘all’, array( ‘fields’ => array(‘reference_id’, ‘first_name’, ‘last_name’, ‘email’, ‘tree_id’), ‘conditions’ => $conditions )); $output = ""; if(sizeof($result)) { foreach($result as $r) { $output .= $r['User']['tree_id'] . "|" . $r['User']['first_name'] . " " . $r['User']['last_name'] . "|" . $r['User']['email'] . "|" . $r['User']['reference_id']; $output .= ‘^’; } $output = rtrim($output, ‘^’); // Removing the trailing ^ character at the end of output text } else { $output = "NO"; } $this->set(‘search_result’, $output); } } ?> [/php]

How to create a module in Joomla

Posted on: November 24th, 2010 by sugith 1 Comment
Basic Hello World Module A Joomla! 1.5 Module is a most basic form; two files: an XML configuration file and a PHP controller file. The XML configuration file contains general information about the module (as will be displayed in the Module Manager in the Joomla! administration interface), as well as module parameters which may be supplied to fine tune the appearance / functionality of the module. The PHP file provides the controlling logic for the module. A very simple “Hello World” module might look something like this: /modules/mod_hello_world/mod_hello_world.xml: !!! Note: it is very important, that XML file name matches module name. Otherwise, the installer will install the module, but Joomla wouldn’t show parameters and additional info stored in XML.
<?xml version="1.0" encoding="utf-8"?>

<install version="1.5.0">

<!-- Name of the Module -->

<name>Hello World - Hello</name>

<!-- Name of the Author -->

<author>IBCScorp</author><!-- Version Date of the Module -->

<creationDate>2010-11-23</creationDate>

<!-- Copyright information -->

<copyright>All rights reserved by Ibcscorp.</copyright>

<!-- License Information -->

<license>GPL 2.0</license>

<!-- Author's email address -->

<authorEmail>info@ibcscorp.com</authorEmail>

<!-- Author's website -->

<authorUrl>www.ibcscorp.com</authorUrl>

<!-- Module version number -->

<version>1.0.0</version>

<!-- Description of what the module does -->

<description>Provides a basic "Hello World" notice</description>

<!-- Listing of all files that should be installed for the module to function -->

<files>

<!-- The "module" attribute signifies that this is the main controller file -->

<filename module="mod_hello_world">mod_hello_world.php</filename>

<filename>index.html</filename>

</files>

<!-- Optional parameters -->

<params />

</install>
Basically, this XML file just lines out basic information about the module such as the owner, version, etc. for identification by the Joomla! installer and then provides optional parameters which may be set in the Module Manager and accessed from within the module’s logic to fine tune its behavior. Additionally, this file tells the installer which files should be copied and installed. Notice that we DO NOT include a reference in the files section for the XML file.
/modules/mod_hello_world/mod_hello_world.php:

<?php

//don't allow other scripts to grab and execute our file

defined('_JEXEC') or die('Direct Access to this location is not allowed.');

?>

<p>

Hello World

</p>
What happens when this module is loaded is that Joomla! includes (via the PHP include directive) the mod_hello_world.php file and stores the output into an output buffer which is then rendered onto the page output. This file would simply produce
Hello World
to the final page. /modules/mod_hello_world/index.html: <html><body bgcolor=”#FFFFFF”></body></html> This really just helps to ensure that a default page is displayed if direct access to the directory is attempted without listing all of the other files in the directory. It’s not necessary, but is good practice. To package this module for distribution and installation, simply zip the files together, e.g., % cd mod_hello_world % zip mod_hello_world.zip mod_hello_world.php mod_hello_world.xml index.html The resulting mod_hello_world.zip file may be uploaded and installed through the standard Joomla! 1.5 Extension Manager. Real Joomla! 1.5 Style Module Implementation Now that was easy…too easy. In fact, that was pretty much the simplest form of a module possible. In reality a module will probably be doing something much more substantial. Let’s assume that our modules are going to be more complex – we need to take advantage of the MVC (Model View Controller) design pattern and consider using the following file layout for a “Hello World 2″ module instead: /modules/mod_hello_world2/index.html /modules/mod_hello_world2/mod_hello_world2.php /modules/mod_hello_world2/mod_hello_world2.xml /modules/mod_hello_world2/helper.php /modules/mod_hello_world2/en-GB.mod_hello_world2.ini /modules/mod_hello_world2/tmpl/index.html /modules/mod_hello_world2/tmpl/default.php The differences to note here are that there are three additional files beyond what the “Hello World” module had namely helper.php, tmpl/default.php, and the en-GB.mod_hello_world2.ini file. The purpose in adding the first two files is two-fold. First, we separate the module’s logic into the helper.php file to ensure that all of the thinking and data access is performed here and separate out the module’s presentation / template into the tmpl/default.php file (the (X)HTML). I argue that this is just good programming – separating logic from presentation. The second advantage to this, however, which is that it will allow the HTML / presentation to be overridden easily by any Joomla! 1.5 template for optimal integration into any site. (Overriding module and component presentation in templates is beyond the scope of this article; however it should be addressed as it’s really useful). Let’s take a look at what these files might look like and discuss what’s going on. /modules/mod_hello_world2/mod_hello_world2.php: <?php //no direct access defined(‘_JEXEC’) or die(‘Direct Access to this location is not allowed.’); // include the helper file require_once(dirname(__FILE__).DS.’helper.php’); // get a parameter from the module’s configuration $userCount = $params->get(‘usercount’); // get the items to display from the helper $items = ModHelloWorld2Helper::getItems($userCount); // include the template for display require(JModuleHelper::getLayoutPath(‘mod_hello_world2′)); ?> The important differences to note are that:
  1. We include a helper file which will be the work-horse of our logic and data access.
  2. Once we have our data, we just load a template which will use our data and render it as it sees fit.
/modules/mod_hello_world2/mod_hello_world2.xml <?xml version=”1.0″ encoding=”utf-8″?> <install version=”1.5.0″> <!– Name of the Module –> <name>Hello World 2 – Hello</name> <!– Name of the Author –> <author>Ambitionality Software LLC</author> <!– Version Date of the Module –> <creationDate>2008-06-23</creationDate> <!– Copyright information –> <copyright>All rights reserved by Ambitionality Software LLC 2008.</copyright> <!– License Information –> <license>GPL 2.0</license> <!– Author’s email address –> <authorEmail>info@ambitionality.com</authorEmail> <!– Author’s website –> <authorUrl>www.ambitionality.com</authorUrl> <!– Module version number –> <version>1.0.0</version> <!– Description of what the module does –> <description>Provides a random listing of registered users</description> <!– Listing of all files that should be installed for the module to function –> <files> <!– The “module” attribute signifies that this is the main controller file –> <filename module=”mod_hello_world2″>mod_hello_world2.php</filename> <filename>index.html</filename> <filename>helper.php</filename> <filename>tmpl/default.php</filename> <filename>tmpl/index.html</filename> </files> <languages> <!– Any language files included with the module –> <language tag=”en-GB”>en-GB.mod_hello_world2.ini</language> </languages> <!– Optional parameters –> <params> <!– parameter to allow placement of a module class suffix for the module table / xhtml display –> <param type=”text” default=”" label=”Module Class Suffix” description=”PARAMMODULECLASSSUFFIX” /> <!– just gives us a little room between the previous parameter and the next –> <param type=”spacer” default=”" label=”" description=”" /> <!– A parameter that allows an administrator to modify the number of users that this module will display –> <param default=”5″ label=”LABEL USER COUNT” description=”DESC USER COUNT” /> </params> </install> The main differences to note here are that we have added a language file reference (we could have added more) and we added some parameters. /modules/mod_hello_world2/helper.php: <?php defined(‘_JEXEC’) or die(‘Direct Access to this location is not allowed.’); class ModHelloWorld2Helper { /** * Returns a list of post items */ public function getItems($userCount) { // get a reference to the database $db = &JFactory::getDBO(); // get a list of $userCount randomly ordered users $query = ‘SELECT a.name FROM `#__users` AS a ORDER BY rand() LIMIT ‘ . $userCount  . ”; $db->setQuery($query); $items = ($items = $db->loadObjectList())?$items:array(); return $items; } //end getItems } //end ModHelloWorld2Helper ?> This helper class (note that it is named for the module name so that it doesn’t collide with other class names) simply retrieves a list of all users in the database and randomly selects a subset of those based upon the number supplied as $userCount. /modules/mod_hello_world2/tmpl/default.php: <?php defined(‘_JEXEC’) or die(‘Restricted access’); // no direct access ?> <?php echo JText::_(‘RANDOM USERS’); ?> <ul> <?php foreach ($items as $item) { ?> <li> <?php echo JText::sprintf(‘USER LABEL’, $item->name); ?> </li> <?php } ?> </ul> Here we simply create an unordered HTML list and then iterate through the items returned by our helper (in mod_hello_world2.php), printing out a message with each user’s name. /modules/mod_hello_world2/en-GB.mod_hello_world2.ini: LABEL USER COUNT=User Count DESC USER COUNT=The number of users to display RANDOM USERS=Random Users for Hello World2 USER LABEL=%s is a randomly selected user Here we simply identify strings which appear in the module configuration file and the module template which appear in JText::_ or JText::sprintf statements. This allows someone to easily write a new language file without editing any of the HTML or code for the module. Now all we have to do is zip up these files, as in: % pwd /somesite/modules/mod_hello_world2 % zip -r ../mod_hello_world2.zip * % ls .. mod_hello_world2.zip The resulting mod_hello_world2.zip file is ready for installation and distribution. When the ZIP file is installed, the en-GB.mod_hello_world2.ini file is copied to /language/en-GB/en-GB.mod_hello_world2.ini and is loaded each time the module is loaded. All of the other files are copied to the /modules/mod_hello_world2 subfolder of the Joomla! installation. Joomla! 1.5 Database installation usage Modules should in general not interact with the database except for normal operations (SELECT, UPDATE, INSERT, DELETE). But in some cases it might be needed to ALTER or even CREATE tables, even though it is not recommended. There is no common practice to this, but here is one way of doing just that: Add a module parameter that to the manifest: <params group=”advanced”> <param type=”radio” default=”0″ label=”Is module installed?” description=”Only use this if you know the consequences! Click No to recreate database”> <option value=”0″>No</option> <option value=”1″>Yes</option> </param> </params> Then you can use the parameter to switch the state. Since the module parameters is already loaded from the database at this point, any overhead should not be noticeable this way. // put this in the module function. function myModuleReInstall() { if (!$params->get(‘is_installed’)) { $database =& JFactory::getDBO(); $query = “CREATE TABLE IF NOT EXISTS `example` ( `id` INT, `data` VARCHAR(100) );”; $database->setQuery($query); $result = $database->query(); $params->set(‘is_installed’, 1); } }

iBCScorp to help DixieLegal.com to provide web based services

Posted on: November 15th, 2010 by James Cluff 1 Comment
The Justice Firm Dixie Legal <dixielegal.com>  is a legal services firm located in Saint George Utah. Dixie Legal has contracted with IBCScorp <ibcscorp.com> to provide web based services for its clients in order to expedite some legal services and to reduce costs for its clients.  On completion of this project customers in Saint George Utah, or elsewhere in Washington County Utah who need a Divorce Attorney, Bankruptcy Attorney, Estate Planning or similar services can perform these legal services faster and for less money by utilizing web based legal services at dixielegal.com. Dixie Legal <dixielegal.com> contacted IBCScorp <ibcscorp.com> to have these web based services created which will allow DixieLegal to provide consultation and forms via the internet. This legal consultation service and legal forms will allow clients to reduce costs of their services by: 1.  Becoming educated on the legal work they are performing. 2.  Guiding them to collecting the information that they need to expedite service before sitting down with an attorney. 3.  Filling out much of their legal document themselves which will later be reviewed by an attorney who can then provide advice and counseling as necessary to a well prepared and educated consumer. By doing this initial process themselves, most of the work is done before meeting with legal counsel.  In fact in many cases it may be as simple as having a professional Divorce Attorney give a legal review to the work done by the client, and filing it with the state. This is much cheaper than sitting down with an attorney to go through the above three steps which could result in thousands of dollars of work to accomplish what the clients can do themselves. This process will greatly reduce legal costs for clients in Washington County, Utah while providing them better services.  Much of the initial consultation, educational and fact finding work will be done early on in the process by the client themselves reducing the cost while allowing the professional legal adviser to provide the most important work of reviewing and advising on specialized situations discovered during the fact finding phases rather than spending their time giving the same general overview to all clients. These legal web services will provide high-quality, lower cost Divorce, Bankruptcy, Estate Planning, Business, and other legal services to consumers in Saint George, Utah, Washington, Utah and other cities in Washington County. To make it easy for DixieLegal.com to keep the content current and relevant for clients a Content Management System (CMS) will be used while the interview portions will be custom code done using the Cake PHP Framework. iBCScorp.com is an Internet Business Consulting Services Company helping businesses successfully use the Internet to meet the needs of their clients.

Magento Developer

Posted on: June 22nd, 2010 by ryan No Comments
The ideal developer should have broad knowledge of web development technologies and experience in CMS based PHP development. Skills required 2+ years working experience as an advanced PHP developer with PHP5 & MySql5. Extensive experience in using Magento is a must. Excellent Knowledge of MVC architectures such as Zend, CakePHP and CMS such as or SilverStripe are added advantage.

ibcscorp helps Pacific Blue with their website

Posted on: March 13th, 2010 by James Cluff No Comments
Internet Business Consulting Services Corporation (iBCScorp.com) helps Pacific Blue with a great website.  This is a mostly static site done custom with PHP and HTML.  The simple design makes it easy to navigate and easy for their clients to find information about their products and services.