<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David-Clark.net</title>
	<atom:link href="http://david-clark.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://david-clark.net</link>
	<description>Freelance Web Developer</description>
	<lastBuildDate>Tue, 27 Nov 2012 03:53:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>The Value Of Online Support</title>
		<link>http://david-clark.net/the-value-of-online-support/</link>
		<comments>http://david-clark.net/the-value-of-online-support/#comments</comments>
		<pubDate>Tue, 27 Nov 2012 03:53:27 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Online Services]]></category>

		<guid isPermaLink="false">http://david-clark.net/?p=159</guid>
		<description><![CDATA[Having a small web design and web hosting business I am very aware of the value of a strong support network for online hosting, software products, and design issues. I have always supplied support to clients hosted on one of my servers at no direct cost, figuring it into the base cost of their hosting [...]]]></description>
				<content:encoded><![CDATA[<p>Having a small web design and web hosting business I am very aware of the value of a strong support network for online hosting, software products, and design issues. I have always supplied support to clients hosted on one of my servers at no direct cost, figuring it into the base cost of their hosting package, and I also support any web design or application I have created for at least a year after it is deployed and do not charge extra unless the issue is outside of the realm of the original proposal. I would like to think that I supply a reasonable level of service and support with response times generally within two hours of the request and never longer than 4 hours. After all, how long does it take the cable company to come out and repair your internet connection? Under 4 hours? Most unlikely in my experience, I usually hope it will be under 4 days. I write this post more out of amazement of how far some are willing to take support, both for the better and for the worse.</p>
<p>Today I think I have come across the most blatant and excessive overcharging for services that I have seen to date. The offender? Ellis Lab (ellislab.com) and the structure they have placed around their Expression Engine product. I had just started exploring this product for possible use for future client needs as I have always had a strong like of and have built a number of sites and applications with the Codeigniter Framework, which was derived from the Expression Engine product. I was dumbfounded today when I saw the new Ellis Lab site with their new pricing structure. The product license itself has gone up to $299.00 per site license, which is a 300% increase from what it was, yet this is not what took my breath away. Ellis Lab support for THEIR product, has gone off into a land I have never heard of. The support menu;</p>
<p>Silver Support -> $49.00/month &#8211; includes 1 urgent ticket a month plus unlimited standard support tickets covering unlimited sites each month, AND you get a guaranteed first response to your ticket within 2 business days.</p>
<p>Gold Support -> $299.00/month &#8211; includes 2 urgent tickets a month plus unlimited standard support tickets covering unlimited sites each month, AND you get a guaranteed first response to your ticket within 1 business day.</p>
<p>Platinum Support -> $1,999.00/month &#8211; includes 8 urgent tickets a month plus unlimited standard support tickets covering unlimited sites each month, with a guaranteed first response to your ticket within 4 business hours.</p>
<p>Extra urgent tickets over your allotment for your service level will run you to the tune of $249.00 each&#8230;..</p>
<p><img src="http://david-clark.net/support.png" alt="Support Costs" style="max-width: 640px;" /></p>
<p>So, if I want a reasonable response time (within 4 hours) I am going to have to shell out $2k a month? That&#8217;s nuts. The client base they have, or I would believe that they have, is probably 95%+ web developers. With this, I would think that most support tickets would be of an urgent nature and a true issue versus a request for a tutorial on how to do something. Of course this gets my mind going, can I charge this kind of price to support my products? Are any of my clients going to pay that kind of money to me to support a product I am supplying? I don&#8217;t think so.</p>
<p>Now, I would be remiss in not mentioning that I have also found what I have experienced as the best support for any online product I have used. The host I work with, HostDime (<a href="http://hostdime.com" title="HostDime.com" target="_blank">hostdime.com</a>), offers consistent support supplied in a reasonable time frame, they have even diplomatically worked with me when I have gone off the deep end and become that client that no one wants, and yes, I think we can all be that person if the situation is right. Their business hours are 24/7, not 10am to 2pm on Tim Buk Too time. The cost? Included with all their fully managed packages! Are the package prices out of line? No, they are very competitive with the market. They seem to be surviving and actually prospering in today&#8217;s marketplace without charging an outrageous fee to support their product, so they are doing something right, and I believe that it is the fact that they have listened to and supported their clients in a reasonable manner.</p>
<p>Kudos to you HostDime, others (hint, Ellis Lab) should take a lesson from your group. I know I have, and I try to extend the same level of support to my own clients. More companies need to follow the lost tradition of taking care of the client, not just taking from the client.</p>
<p>End of my rant for today&#8230;..</p>
]]></content:encoded>
			<wfw:commentRss>http://david-clark.net/the-value-of-online-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpVMS Individual Aircraft Stats</title>
		<link>http://david-clark.net/phpvms-individual-aircraft-stats/</link>
		<comments>http://david-clark.net/phpvms-individual-aircraft-stats/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 08:11:01 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[phpVMS]]></category>

		<guid isPermaLink="false">http://david-clark.net/?p=149</guid>
		<description><![CDATA[Users of the phpVMS virtual airline system may want to display individual aircraft stats. An addition to the system follows to add this feature to your site. Create a file named Airframestatsdata.php in your /core/common/ folder and insert the following code. Then in the module function that you want to display the stats assign them [...]]]></description>
				<content:encoded><![CDATA[<p>Users of the phpVMS virtual airline system may want to display individual aircraft stats. An addition to the system follows to add this feature to your site.</p>
<p>Create a file named Airframestatsdata.php in your /core/common/ folder and insert the following code.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

//simpilotgroup addon for phpVMS virtual airline system
//
//simpilotgroup addons are licenced under the following license:
//Creative Commons Attribution Non-commercial Share Alike (by-nc-sa)
//To view full license text visit http://creativecommons.org/licenses/by-nc-sa/3.0/
//
//@author David Clark (simpilot)
//@copyright Copyright (c) 2012, David Clark
//@license http://creativecommons.org/licenses/by-nc-sa/3.0/

class Airframestatsdata extends CodonData   {
    
    function airframe_stats($id)    {
        $query = &quot;SELECT aircraft,
                COUNT(*) AS total_flights,
                SUM(distance) AS total_distance,
                SUM(flighttime) AS total_flighttime,
                SUM(fuelused) AS total_fuelused,
                SUM(revenue) AS total_revenue,
                &quot;.TABLE_PREFIX.&quot;aircraft.*
                FROM &quot;.TABLE_PREFIX.&quot;pireps
                JOIN &quot;.TABLE_PREFIX.&quot;aircraft ON &quot;.TABLE_PREFIX.&quot;pireps.aircraft = &quot;.TABLE_PREFIX.&quot;aircraft.id
                WHERE &quot;.TABLE_PREFIX.&quot;pireps.aircraft='$id'&quot;;
        
        $stats = DB::get_row($query);
        
        if($stats-&gt;aircraft != null)
        {
            $stats-&gt;average_distance = round($stats-&gt;total_distance/$stats-&gt;total_flights);
            $stats-&gt;average_flighttime = round($stats-&gt;total_flighttime/$stats-&gt;total_flights, 2);
        }
        else
        {
            $stats = null;
        }
        return $stats;
    }    
}
</pre>
<p>Then in the module function that you want to display the stats assign them to a variable ($aircraft_id is the database id of the aircraft you want to show)</p>
<pre class="brush: php; title: ; notranslate">
function aircraft_view($aircraft_id)    {
    $this-&gt;set('stats', Airframestatsdata::airframe_stats($aircraftid);
    $this-&gt;show('my_template');
}
</pre>
<p>In your view (template file) you then have an object named $stats that should include the following information</p>
<pre class="brush: php; title: ; notranslate">
object(stdClass)[13]
  public 'aircraft' =&gt; string '1' (length=1)
  public 'total_flights' =&gt; string '7' (length=1)
  public 'total_distance' =&gt; string '3895' (length=4)
  public 'total_flighttime' =&gt; string '10.47' (length=5)
  public 'total_fuelused' =&gt; string '68114.6000976563' (length=16)
  public 'total_revenue' =&gt; string '39751.0457420349' (length=16)
  public 'id' =&gt; string '1' (length=1)
  public 'icao' =&gt; string 'B737' (length=4)
  public 'name' =&gt; string 'BOEING 737' (length=10)
  public 'fullname' =&gt; string 'Boeing 737-700' (length=14)
  public 'registration' =&gt; string 'AVEB21' (length=6)
  public 'downloadlink' =&gt; string '' (length=0)
  public 'imagelink' =&gt; string '' (length=0)
  public 'range' =&gt; string '0' (length=1)
  public 'weight' =&gt; string '0' (length=1)
  public 'cruise' =&gt; string '0' (length=1)
  public 'maxpax' =&gt; string '120' (length=3)
  public 'maxcargo' =&gt; string '1000' (length=4)
  public 'minrank' =&gt; string '0' (length=1)
  public 'ranklevel' =&gt; string '0' (length=1)
  public 'enabled' =&gt; string '1' (length=1)
  public 'average_distance' =&gt; float 556
  public 'average_flighttime' =&gt; float 1.5
</pre>
<p>You can then display the data however you would like in your template using an echo command</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php echo $stats-&gt;name; ?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://david-clark.net/phpvms-individual-aircraft-stats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpVMS Content Module</title>
		<link>http://david-clark.net/phpvms-content-module/</link>
		<comments>http://david-clark.net/phpvms-content-module/#comments</comments>
		<pubDate>Sat, 17 Mar 2012 01:26:47 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[phpVMS]]></category>

		<guid isPermaLink="false">http://david-clark.net/?p=129</guid>
		<description><![CDATA[Some users of phpVMS often look for a way to add pages within the system without using the pages editor as sometimes it will break php code you are trying to use in the page. It can be done easily by creating a quick module to show the pages. For this example we will create [...]]]></description>
				<content:encoded><![CDATA[<p>Some users of <a title="phpVMS" href="http://phpvms.net" target="_blank">phpVMS</a> often look for a way to add pages within the system without using the pages editor as sometimes it will break php code you are trying to use in the page. It can be done easily by creating a quick module to show the pages.</p>
<p>For this example we will create a module named &#8220;Content&#8221; to display our custom pages for our phpVMS system.</p>
<p>First create a new folder in your /core/modules folder named <strong>Content </strong>(case sensitive) and inside of that folder create a blank php file named <strong>Content.php  </strong></p>
<p>Extend the core codon structure to start the module file,</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
class Content extends CodonModule {

}
</pre>
<p>Next create the index function within the class that the module will default to if there is no method declared in the url call.</p>
<pre class="brush: php; title: ; notranslate">
function index()     {

}
</pre>
<p>Within the index function create a call to show your custom template (view) for your site.</p>
<pre class="brush: php; title: ; notranslate">
$this-&gt;show('customfile');
</pre>
<p>Your Custom.php module (controller) file should look similar to this now,</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

class Content extends CodonModule     {

  function index()     {

     $this-&gt;show('customfile');

  }

}
</pre>
<p>Next, create your custom template (view) by creating a file in your skin folder named <strong>customfile.tpl</strong> . This file should contain everything that you want shown on the page you are creating. This file is the part of your webpage that is contained in between the &lt;body&gt; and the &lt;/body&gt; tags. The header and footer as well as all the css and js calls made in your template will also be included within this page, so no need to create new links to any of those items. You can use html or php or a combination of both within this file. An example might be;</p>
<pre class="brush: php; title: ; notranslate">
&lt;h1&gt;My Custom Content Page&lt;/h1&gt;
&lt;ul&gt;
  &lt;li&gt;List Item 1&lt;/li&gt;
  &lt;li&gt;List Item 2&lt;/li&gt;
  &lt;li&gt;List Item 3&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>To view this page create a link on your site pointing to the module;</p>
<pre class="brush: php; title: ; notranslate">

http://www.mysite.com/index.php/content

</pre>
<p>If you would like to add more pages to the module it can be done by using additional methods within the module(class). For example you could add a page for staff members;</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

class Content extends CodonModule     {

  function index()     {

     $this-&gt;show('customfile');

  }

 function staff()     {

     $this-&gt;show('staff');

  }

}
</pre>
<p>Then, create a file in your skin folder named <strong>staff.tpl</strong> and once again include the html and/or php code you want included in the page. To reach this page on your web site, add the method name to the end of the url we used earlier,</p>
<pre class="brush: php; title: ; notranslate">

http://www.mysite.com/index.php/content/staff

</pre>
<p>You can pass data in variables from the core system using these methods if it is required and also add access controls if needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://david-clark.net/phpvms-content-module/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>If your phpVMS site is slow to respond during phpvms.net outage</title>
		<link>http://david-clark.net/phpvms-site-slow-to-respond-during-phpvms-net-outage/</link>
		<comments>http://david-clark.net/phpvms-site-slow-to-respond-during-phpvms-net-outage/#comments</comments>
		<pubDate>Sun, 26 Feb 2012 23:47:18 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[phpVMS]]></category>

		<guid isPermaLink="false">http://david-clark.net/?p=50</guid>
		<description><![CDATA[If your site phpVMS based virtual airline is experiencing issues with timeouts and kACARS disconnects during the unfortunate outage of the phpVMS and VaCentral servers you can disable the functions in the framework that is calling back to the api server(s). &#160; In the /core/local.config.php file change the following code; &#160; so it looks like [...]]]></description>
				<content:encoded><![CDATA[<p>If your site phpVMS based virtual airline is experiencing issues with timeouts and kACARS disconnects during the unfortunate outage of the phpVMS and VaCentral servers you can disable the functions in the framework that is calling back to the api server(s).</p>
<p>&nbsp;</p>
<p>In the /core/local.config.php file change the following code;</p>
<p>&nbsp;</p>
<pre class="brush: php; title: ; notranslate">
Config::Set('VACENTRAL_ENABLED', true);
</pre>
<p>so it looks like this;</p>
<p>&nbsp;</p>
<pre class="brush: php; title: ; notranslate">
Config::Set('VACENTRAL_ENABLED', false);
</pre>
<p>and also</p>
<pre class="brush: php; title: ; notranslate">
Config::Set('CHECK_RELEASE_VERSION', true);
Config::Set('CHECK_BETA_VERSION', true);
</pre>
<p>to</p>
<p>&nbsp;</p>
<pre class="brush: php; title: ; notranslate">
Config::Set('CHECK_RELEASE_VERSION', false);
Config::Set('CHECK_BETA_VERSION', false);
</pre>
<p>This should bring your site back to normal except for there will be no data sent to VaCentral. Once the phpVMS sites are back online just change those lines back to the original settings and you should be back up and running.</p>
<p>&nbsp;</p>
<p>Also, if you have your VaCentral rank shown on your pages anywhere disable the function until phpVMS is restored.</p>
]]></content:encoded>
			<wfw:commentRss>http://david-clark.net/phpvms-site-slow-to-respond-during-phpvms-net-outage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpVMS Pilot Roster Module &#8211; Codon Framework</title>
		<link>http://david-clark.net/phpvms-codon-framework-modules/</link>
		<comments>http://david-clark.net/phpvms-codon-framework-modules/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 18:54:13 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[phpVMS]]></category>

		<guid isPermaLink="false">http://david-clark.net/?p=5</guid>
		<description><![CDATA[Many new users of the popular phpVMS system for Virtual Airlines developed as an opensource project by Nabeel Shazad question how to build a custom module to use within their own website. The phpVMS/Codon structure follows the MVC structure for building an application. (Model, View, Controller) A short example on how to generate a full [...]]]></description>
				<content:encoded><![CDATA[<p>Many new users of the popular <a href="http://phpvms.net" title="phpVMS" target="_blank">phpVMS</a> system for Virtual Airlines developed as an opensource project by <a href="http://nsslive.net" title="nsslive" target="_blank">Nabeel Shazad</a> question how to build a custom module to use within their own website.<br />
<br />
The phpVMS/Codon structure follows the <a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller" title="MVC" target="_blank">MVC</a> structure for building an application. (Model, View, Controller) A short example on how to generate a full pilots roster, not by hubs, follows.<br />
<br />
First we need to build the database query to collect all the pilots from the database, which would belong in a model. In your /core/common folder create a new php file, <strong>RosterData.class.php</strong> , notice the case sensitive naming structure.<br />
<br />
Start the file with an opening php tag, be sure there is no white space prior to the tag in the file, if there is a &#8220;headers Already Sent&#8221; error will become your latest nemesis, then extend the existing CodonData object. Remeber the case sensitive nature of the naming conventions.<br />
</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

class RosterData extends CodonData  {

}
</pre>
<p>Notice there is no closing php tag, this will help keep the &#8220;Headers Already Sent&#8221; error away as well. Next we need to write our SQL query to get the data we would like from the database, namely the pilot roster. Create a function &#8220;get_pilot_roster&#8221; in your new model.<br />
</p>
<pre class="brush: php; title: ; notranslate">
function get_pilot_roster()    {

}
</pre>
<p>Write the SQL query to get the data and place it inside your new function, using the TABLE_PREFIX constant to add the database table prefix to the table name. Just as a note, Codon automatically loads the database connection so you do not have to do it again within your model.<br />
</p>
<pre class="brush: php; title: ; notranslate">
$query = &quot;SELECT * FROM &quot;.TABLE_PREFIX.&quot;pilots&quot;;
</pre>
<p>This query will get ALL the pilots from the table. If you want to get only active pilots we can add a WHERE command to the query to look for pilots that are marked active using the retired column.<br />
</p>
<pre class="brush: php; title: ; notranslate">
$query = &quot;SELECT * FROM &quot;.TABLE_PREFIX.&quot;pilots WHERE retired = '0'&quot;;
</pre>
<p>Using the Codon DB class run the query and return the result in an array.<br />
</p>
<pre class="brush: php; title: ; notranslate">
return DB::get_results($query);
</pre>
<p>Your complete <strong>RosterData.class.php</strong> file should look like this.<br />
</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
//file RosterData.class.php
class RosterData extends CodonData  {

    function get_pilot_roster()    {
        $query = &quot;SELECT * FROM &quot;.TABLE_PREFIX.&quot;pilots WHERE retired = '0'&quot;;
        return DB::get_results($query);
    }

}
</pre>
<p>Next, we will create our controller file, which will be the core of our new module and will direct all the action. Create a new folder in your /core/modules folder named Roster, again notice the capital R. In that folder create a new php file <strong>Roster.php</strong> and use it to extend the CodonModule object.<br />
</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

class Roster extends CodonModule    {

}
</pre>
<p>Now lets create our index function that will display the full roster page.<br />
</p>
<pre class="brush: php; title: ; notranslate">
function index()    {

}
</pre>
<p>First we need to fill a variable with all the pilot data we want from the database to use in our final view using the data call we just built. We can use the Codon function SET.<br />
</p>
<pre class="brush: php; title: ; notranslate">
$this-&gt;set('pilots', RosterData::get_pilot_roster());
</pre>
<p>Now we need to send all the data to a view file and display it to the user. We can simply use the Codon SHOW function to accomplish this, it will send the data you set to the &#8216;pilots&#8217; variable along with it so it the data is available in our view when we get there.<br />
</p>
<pre class="brush: php; title: ; notranslate">
$this-&gt;show('roster.tpl');
</pre>
<p>At this point your Roster.php file should look like this.<br />
</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
//file Roster.php
class Roster extends CodonModule    {

    function index()    {
       $this-&gt;set('pilots', RosterData::get_pilot_roster());
       $this-&gt;show('roster.tpl');
    }

}
</pre>
<p>Now we need to build a view file to display our final output in the browser, it can be a combination of php and html. We will build a very basic display here, you can add html structure to it as you would like, we will just make a simple list. Create our template file in your skin folder, we will use the default crystal skin at /lib/skins/crystal/. Name the file <strong>roster.tpl</strong>. We will take the $pilots variable that is loaded with our data and create a loop to just display the pilot&#8217;s names in a list.<br />
</p>
<pre class="brush: php; title: ; notranslate">
//file roster.tpl
&lt;ul&gt;
&lt;?php
    foreach($pilots as $pilot)    {
        echo '&lt;li&gt;'.$pilot-&gt;firstname.' '.$pilot-&gt;lastname.'&lt;/li&gt;';
    }
?&gt;
&lt;/ul&gt;
</pre>
<p>A good tool to see what is available to you within the variable is to place a print_r or var_dump in the view files and run it this will show all the data that is in the variable and what you can use to build your display.<br />
</p>
<pre class="brush: php; title: ; notranslate">
var_dump($pilots);
//or
print_r($pilots);
</pre>
<p>You can creative as you would like with the view file and the new pilot roster you have just built.</p>
]]></content:encoded>
			<wfw:commentRss>http://david-clark.net/phpvms-codon-framework-modules/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
