<?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>Okada Design Blog</title>
	<atom:link href="http://www.okadadesign.no/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.okadadesign.no/blog</link>
	<description>Welcome to Okada Design Web Development Blog</description>
	<lastBuildDate>Fri, 03 Sep 2010 05:24:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Creating Customer Support Time Tracking Application with Codeigniter Part 5</title>
		<link>http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-with-codeigniter-part-5/</link>
		<comments>http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-with-codeigniter-part-5/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 05:00:39 +0000</pubDate>
		<dc:creator>shinokada</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[daikon]]></category>

		<guid isPermaLink="false">http://www.okadadesign.no/blog/?p=2220</guid>
		<description><![CDATA[ <p>This will be the final article of Customer Support Time Tracking app. And we are going to create Customersupport module for customers.</p> Redirecting members from home <p>Firstly we are going change customer login. After logging in it leads to dashboard. But we need to redirect members to customersupport/admin. Open system/application/controllers/admin/home.php and add the [...]


Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-2/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-with-codeigniter-part-4/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application with Codeigniter Part 4'>Creating Customer Support Time Tracking Application with Codeigniter Part 4</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-1/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fcodeigniter%2Fcreating-customer-support-time-tracking-application-with-codeigniter-part-5%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fcodeigniter%2Fcreating-customer-support-time-tracking-application-with-codeigniter-part-5%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>This will be the final article of Customer Support Time Tracking app. And we are going to create Customersupport module for customers.</p>
<h2>Redirecting members from home</h2>
<p>Firstly we are going change customer login.<br />
After logging in it leads to dashboard. But we need to redirect members to customersupport/admin.<br />
Open system/application/controllers/admin/home.php and add the following at the line 34.</p>
<p><span id="more-2220"></span></p>
<div class="clearboth">&nbsp;</div>
<h4 class="download"><a href="http://websiteclub.skagerak.org/daikon/index.php/auth/login" target="_blank">Demo</a></h4>
<h4>Note: Demo is available for Customer Pages Only. </h4>
<p><u>Login details</u><br />
email 1: cus7(a)gmail.com and pw: anneanne <br /> <br />
email 2: cus2(a)gmail.com and pw: tonjetonje</p>
<h4 class="download"><a href="http://www.okadadesign.no/blog/downloads/#daikon">Download page</a></h4>
<pre class="brush: php;">
// if group is not admin then redirect to customersupport/admin
	// group 1 is member 2 is admin
	$data['username']=$this-&gt;session-&gt;userdata('username');
	$username = $this-&gt;session-&gt;userdata('username');
	//$data['support_customers'] = $this-&gt;MSupport-&gt;getAllCustomerRecord($username);			

	$this-&gt;load-&gt;module_model('customersupport','MCustomer_support');
	$customer_records = $this-&gt;MCustomer_support-&gt;getCustomerGroupByUsername($username);
	$group = $customer_records['group'];

	if($group == 1){
	  	redirect('customersupport/admin','refresh');
	}
</pre>
<h2>Creating customersupport module</h2>
<p>Create folders and files as you see in the image.</p>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/customer_support1.jpg" alt="" title="customer_support1" width="306" height="303" class="alignleft size-full wp-image-2409" /></p>
<div class="clearboth">&nbsp;</div>
<p><!--more--></p>
<h2>Controllers</h2>
<p>modules/customersupport/controllers/admin/admin.php</p>
<pre class="brush: php;">
&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Admin extends Support_Controller {
  function Admin(){
   	parent::Support_Controller();
		   // Check for access permission
			 check('Customer Support');

			// Load model
			$this-&gt;load-&gt;module_model('customersupport','MCustomer_support');
			$this-&gt;load-&gt;module_model('support','MSupport');
			$this-&gt;load-&gt;language('customer');
	}

	function index(){
			//check('Customer Support');
			$data['title'] = &quot;Customer Support Home&quot;;
			// get the username and pull the customer records for the user
			$data['username']=$this-&gt;session-&gt;userdata('username');
			$username = $this-&gt;session-&gt;userdata('username');
			$customer_records = $this-&gt;MCustomer_support-&gt;getAllCustomerRecordByUsername($username);
			$data['customer_records'] = $customer_records;

			$data['totaltime'] = $this-&gt;MCustomer_support-&gt; totalColumn($username,'time');
			$data['totalcredit'] = $this-&gt;MCustomer_support-&gt; totalColumn($username, 'point_credit');
			$totaltime = $this-&gt;MCustomer_support-&gt; totalColumn($username,'time');
			$totalcredit = $this-&gt;MCustomer_support-&gt; totalColumn($username, 'point_credit');
			$data['total'] = $totalcredit['point_credit'] - $totaltime['time'];

			$data['header'] = $this-&gt;lang-&gt;line('customer_record');

			// This how Bep load views
			$data['page'] = $this-&gt;config-&gt;item('backendpro_template_admin') . &quot;support_home&quot;;
			$data['module'] = 'customersupport';
			$this-&gt;load-&gt;view($this-&gt;_container,$data); 

	}

	function details($id){
		check('Customer Record');
		// we use the following variables in the view
		$data['title'] = &quot;Support Details&quot;;
		$data['header'] = &quot;Support Details&quot; ;

		// get user name from the session, just to say Hi username!
		$data['username']=$this-&gt;session-&gt;userdata('username');
		$username = $this-&gt;session-&gt;userdata('username');

		// we should show details where customer_id matches. Otherwise a customer can see other customer's record as well
		$customer_records = $this-&gt;MCustomer_support-&gt;getAllCustomerRecordByUsername($username);
		$customer_id = $customer_records['0']['customer_id'];// this will give 2 or 3 etc.
		$id = $this-&gt;uri-&gt;segment(4);
		$details= $this-&gt;MCustomer_support-&gt;getRecordDetails($id, $customer_id);
		$data['details'] = $details;
		// when you type details/33 which is not the customer's record then it returns nothing
		// so if $data['details'] is empty  then redirect
		if (empty($details)){
			flashMsg('warning','The requested record does not exist');
		  	redirect('customersupport/admin/','refresh');
		}
		// Set breadcrumb
		$this-&gt;bep_site-&gt;set_crumb('Details','customersupport/admin/details');

		// This how Bep load views
		$data['page'] = $this-&gt;config-&gt;item('backendpro_template_admin') . &quot;details&quot;;
		$data['module'] = 'customersupport';
		$this-&gt;load-&gt;view($this-&gt;_container,$data); 

	}

	function purchase_credit(){
		if ($this-&gt;input-&gt;post('order_support')){
			$customer_id = $this-&gt;input-&gt;post('customer_id');
			// info is filled out, do the followings
			// you need to send email
			$this-&gt;load-&gt;library('email');
			$company_name = $this-&gt;input-&gt;post('company_name');
			$customer_email = $this-&gt;input-&gt;post('email');
			$full_name = $this-&gt;input-&gt;post('full_name');
			$credit_purchased = $this-&gt;input-&gt;post('order_support');
			// Change to your email address
			$admin_email = 'admin(at)gmail.com';
			// Or pull from DB if you have the field
			// See Kaimono Kago for this
			// $admin_email = $this-&gt;preference-&gt;item('admin_email');

			$this-&gt;email-&gt;from($customer_email, $full_name);
			$this-&gt;email-&gt;to($admin_email);
			$this-&gt;email-&gt;subject('Customer Support Purchase');

			$body = $company_name . &quot; purchase Customer Service with the amount of &quot;.$credit_purchased;  

			$this-&gt;email-&gt;message($body);	

			$this-&gt;email-&gt;send();
			flashMsg('success','Thank you for your purchase. Your Support Purchase is emailed to Okada Design AS. We will get in touch as soon as possible. ');
		  	redirect('customersupport/admin/','refresh');

		}else{
			//check('Purchase Support');
			$data['title'] = &quot;Order support credit&quot;;
			$data['header'] = &quot;Order support credit&quot;;
			$username = $this-&gt;session-&gt;userdata('username');
			$data['customer_details']= $this-&gt;MCustomer_support-&gt;getSingleMemberProfileByUsername($username);

			// Set breadcrumb
				$this-&gt;bep_site-&gt;set_crumb('Purchase Support','customersupport/admin/purchase _credit');
			// This how Bep load views
			$data['page'] = $this-&gt;config-&gt;item('backendpro_template_admin') . &quot;order_credit&quot;;
			$data['module'] = 'customersupport';
			$this-&gt;load-&gt;view($this-&gt;_container,$data);
		}
	}

}//end class
?&gt;
</pre>
<h2>Models</h2>
<p>modules/customersupport/models/mcustomer_support.php</p>
<pre class="brush: php;">
&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MCustomer_support extends Base_model{

	function MCustomer_support(){
		parent::Base_model();
		$this-&gt;_TABLES = array( 'web_customer' =&gt; 'web_customer',
								'support_details' =&gt; 'support_details'
                                    );
	}

	function getAllCustomerRecordByUsername($username){
		$data = array();
		$this-&gt;db-&gt;select('support_details.customer_id, support_details.date, support_details.time, support_details.point_credit, support_details.note
		, support_details.id, support_details.details, support_details.by, be_users.username, be_users.group');
		$this-&gt;db-&gt;from('support_details');
		$this-&gt;db-&gt;join('be_users', 'be_users.id = support_details.customer_id');
		$this-&gt;db-&gt;where('be_users.username', $username);
		$query = $this-&gt;db-&gt;get();
		if ($query-&gt;num_rows() &gt; 0){
	       foreach ($query-&gt;result_array() as $row){
	         $data[]=$row;
	       }
	    }
	    $query-&gt;free_result();
	    return $data; 

	}

	function totalColumn($username,$column){
		$data = array();
		$this-&gt;db-&gt;select_sum($column);
		$this-&gt;db-&gt;from('support_details');
		$this-&gt;db-&gt;join('be_users', 'be_users.id = support_details.customer_id');
		$this-&gt;db-&gt;where('be_users.username', $username);
		$query = $this-&gt;db-&gt;get();
		if ($query-&gt;num_rows() &gt; 0){
	       foreach ($query-&gt;result_array() as $row){
	         $data=$row;
	       }
	    }
	    $query-&gt;free_result();
	    return $data;
	}

	function getRecordDetails($id, $customer_id){
		$data = array();
		$query = $this-&gt;fetch('support_details','*',NULL,array('id'=&gt; $id, 'customer_id'=&gt;$customer_id));
		 if ($query-&gt;num_rows() &gt; 0){
	      	$data = $query-&gt;row_array();
	    }
	    $query-&gt;free_result();
	    return $data;
	}

	function admingetRecordDetails($id){
		$data = array();
		$query = $this-&gt;fetch('support_details','*',NULL,array('id'=&gt; $id));
		 if ($query-&gt;num_rows() &gt; 0){
	      	$data = $query-&gt;row_array();
	    }
	    $query-&gt;free_result();
	    return $data;
	}

	function getSingleMemberProfileByUsername($username){
		$data = array();
		$this-&gt;db-&gt;from('be_user_profiles');
		$this-&gt;db-&gt;join('be_users', 'be_users.id = be_user_profiles.user_id');
		$this-&gt;db-&gt;where('be_users.username', $username);
		$query = $this-&gt;db-&gt;get();
		if ($query-&gt;num_rows() &gt; 0){
	       foreach ($query-&gt;result_array() as $row){
	         $data[]=$row;
	       }
	    }
	    $query-&gt;free_result();
	    return $data; 	    

	}

	function getCustomerGroupByUsername($username){
		$data = array();
		$this-&gt;db-&gt;select('group')-&gt;from('be_users')-&gt;where('username', $username);
		$query = $this-&gt;db-&gt;get();

		 if ($query-&gt;num_rows() &gt; 0){
	      	$data = $query-&gt;row_array();
	    }
	    $query-&gt;free_result();
	    return $data;
	}

}
</pre>
<h2>Views</h2>
<p>modules/customersupport/views/admin/details.php</p>
<pre class="brush: php;">
&lt;?php print displayStatus();?&gt;
&lt;h2&gt;&lt;?php echo $title;?&gt;&lt;/h2&gt;
&lt;p&gt;
&lt;?php
echo &quot;Hello &quot;. ucwords ($username). &quot;!&quot;;
?&gt;
&lt;/p&gt;
&lt;?php

/*
 This is how CI display flash data. but we don't use it. 

if ($this-&gt;session-&gt;flashdata('message')){
	echo &quot;&lt;div class='status_box'&gt;&quot;.$this-&gt;session-&gt;flashdata('message').&quot;&lt;/div&gt;&quot;;
}
*/

if (count($details)){
	echo &quot;&lt;table id='tablesorter' class='tablesorter' border='1' cellspacing='0' cellpadding='3' width='100%'&gt;\n&quot;;
	echo &quot;&lt;thead&gt;\n&lt;tr valign='top'&gt;\n&quot;;
	echo &quot;&lt;th&gt;By&lt;/th&gt;\n&lt;th&gt;Date&lt;/th&gt;&lt;th&gt;Time&lt;/th&gt;&lt;th&gt;Point Credit&lt;/th&gt;&lt;th&gt;Note&lt;/th&gt;\n&quot;;
	echo &quot;&lt;/tr&gt;\n&lt;/thead&gt;\n&lt;tbody&gt;\n&quot;;

		// print_r ($total);
		echo &quot;&lt;tr valign='top'&gt;\n&quot;;
		echo &quot;&lt;td align='center'&gt;&quot;.$details['by'].&quot;&lt;/td&gt;\n&quot;;
		echo &quot;&lt;td&gt;&quot;.$details['date'].&quot;&lt;/td&gt;\n&quot;;

		echo &quot;&lt;td&gt;&quot;.$details['time']. &quot;&lt;/td&gt;&quot;;
		echo &quot;&lt;td&gt;&quot;.$details['point_credit']. &quot;&lt;/td&gt;&quot;;
		echo &quot;&lt;td&gt;&quot;.$details['note']. &quot;&lt;/td&gt;&quot;;

		echo &quot;&lt;/tr&gt;\n&quot;;

	echo &quot;&lt;/tbody&gt;\n&lt;/table&gt;&quot;;
	echo &quot;&lt;h4&gt;Details&lt;/h4&gt;&quot;;
	echo $details['details'];
}
?&gt;
</pre>
<p>support_home.php</p>
<pre class="brush: php;">
&lt;?php print displayStatus();?&gt;
&lt;h2&gt;&lt;?php echo $title;?&gt;&lt;/h2&gt;
&lt;p&gt;
&lt;?php
echo &quot;Hello &quot;. ucwords ($username). &quot;!&quot;;
?&gt;
&lt;/p&gt;
&lt;?php

echo &quot;&lt;h3&gt;Total time spent: &quot;.$totaltime['time'].&quot;&lt;/h3&gt;&quot;;
echo &quot;&lt;h3&gt;Total credit purchased: &quot;.$totalcredit['point_credit'].&quot;&lt;/h3&gt;&quot;;
echo &quot;&lt;h3&gt;Total Points/Time Left: &quot;.$total.&quot;&lt;/h3&gt;&quot;;
echo &quot;&lt;h4&gt;Support Details&lt;/h4&gt;&quot;;

if (count($customer_records)){
	echo &quot;&lt;table id='tablesorter' class='tablesorter' border='1' cellspacing='0' cellpadding='3' width='100%'&gt;\n&quot;;
	echo &quot;&lt;thead&gt;\n&lt;tr valign='top'&gt;\n&quot;;
	echo &quot;&lt;th&gt;By&lt;/th&gt;\n&lt;th&gt;Date&lt;/th&gt;&lt;th&gt;Time&lt;/th&gt;&lt;th&gt;Point Credit&lt;/th&gt;&lt;th&gt;Note&lt;/th&gt;&lt;th&gt;Details&lt;/th&gt;\n&quot;;
	echo &quot;&lt;/tr&gt;\n&lt;/thead&gt;\n&lt;tbody&gt;\n&quot;;
	foreach ($customer_records as $list){
		// print_r ($total);
		echo &quot;&lt;tr valign='top'&gt;\n&quot;;
		echo &quot;&lt;td align='center'&gt;&quot;.$list['by'].&quot;&lt;/td&gt;\n&quot;;
		echo &quot;&lt;td&gt;&quot;.$list['date'].&quot;&lt;/td&gt;\n&quot;;

		echo &quot;&lt;td&gt;&quot;.$list['time']. &quot;&lt;/td&gt;&quot;;
		echo &quot;&lt;td&gt;&quot;.$list['point_credit']. &quot;&lt;/td&gt;&quot;;
		echo &quot;&lt;td&gt;&quot;.$list['note']. &quot;&lt;/td&gt;&quot;;
		echo &quot;&lt;td&gt;&lt;a href=\&quot;admin/details/&quot;.$list['id']. &quot;\&quot;&gt;Details&lt;/a&gt;&lt;/td&gt;&quot;;
		echo &quot;&lt;/tr&gt;\n&quot;;
	}
	echo &quot;&lt;/tbody&gt;\n&lt;/table&gt;&quot;;

}

?&gt;
</pre>
<p>order_credit.php</p>
<pre class="brush: php;">

&lt;?php
echo &quot;&lt;h3&gt;Order Credit&lt;/h3&gt;&quot;;
echo $title.&quot;&lt;br /&gt;&quot;;
foreach ($customer_details as $detail){
echo &quot;Your company: &quot;.$detail['company_name'].&quot;&lt;br /&gt;\n&quot;;
echo &quot;Your name: &quot;.$detail['full_name'].&quot;&lt;br /&gt;\n&quot;;
echo &quot;Your email: &quot;.$detail['email'].&quot;&lt;br /&gt;\n&quot;;

echo form_open('customersupport/admin/purchase_credit');

echo form_radio('order_support', '60min 700Kr');
echo &quot;60min 700Kr&quot;;
echo &quot;&lt;br/&gt;\n&quot;;

echo form_radio('order_support', '120min 1300Kr');
echo &quot;120min 1300Kr&quot;;
echo &quot;&lt;br/&gt;\n&quot;;

echo form_radio('order_support', '180min 1800Kr');
echo &quot;180min 1800Kr&quot;;
echo &quot;&lt;br/&gt;\n&quot;;
echo form_hidden('id',$detail['id']);
echo form_hidden('company_name',$detail['company_name']);
echo form_hidden('full_name',$detail['full_name']);
echo form_hidden('email',$detail['email']);
echo form_submit('submit','Order Support Credit');
echo form_close();
}
</pre>
<h2>Test Drive</h2>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/cussup1.jpg" alt="" title="cussup1" width="700" height="392" class="alignleft size-full wp-image-2475" /></p>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/cussup2.jpg" alt="" title="cussup2" width="683" height="289" class="alignleft size-full wp-image-2476" /></p>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/cussup3.jpg" alt="" title="cussup3" width="681" height="268" class="alignnone size-full wp-image-2477" /></p>
<div class="clearboth">&nbsp;</div>


<p>Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-2/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-with-codeigniter-part-4/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application with Codeigniter Part 4'>Creating Customer Support Time Tracking Application with Codeigniter Part 4</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-1/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-with-codeigniter-part-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install Save-for-Web in Gimp</title>
		<link>http://www.okadadesign.no/blog/ubuntu/how-to-install-save-for-web-in-gimp/</link>
		<comments>http://www.okadadesign.no/blog/ubuntu/how-to-install-save-for-web-in-gimp/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 15:54:24 +0000</pubDate>
		<dc:creator>shinokada</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[GIMP]]></category>

		<guid isPermaLink="false">http://www.okadadesign.no/blog/?p=2490</guid>
		<description><![CDATA[ <p>This is how to install Save-for-web in Gimp.</p> <p>There is a how to install in one of comments. But I needed to install in intltool as well.</p> <p>If you don&#8217;t see hidden files such as .gimp-2.6, then this post will tell you how.</p> <p>So here is my version of how to.</p> Unzip the [...]


Related posts:<ol><li><a href='http://www.okadadesign.no/blog/ubuntu/installing-lamp-and-phpmyadmin-on-ubuntu/' rel='bookmark' title='Permanent Link: Installing LAMP and phpMyAdmin on Ubuntu'>Installing LAMP and phpMyAdmin on Ubuntu</a></li>
<li><a href='http://www.okadadesign.no/blog/python/how-to-install-django-in-python-on-windows-vista/' rel='bookmark' title='Permanent Link: How to install Django in Python on Windows Vista'>How to install Django in Python on Windows Vista</a></li>
<li><a href='http://www.okadadesign.no/blog/ie/how-to-install-and-control-iis-on-vista/' rel='bookmark' title='Permanent Link: How to install and control IIS on Vista'>How to install and control IIS on Vista</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fubuntu%2Fhow-to-install-save-for-web-in-gimp%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fubuntu%2Fhow-to-install-save-for-web-in-gimp%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>This is how to install <a href="http://registry.gimp.org/node/33">Save-for-web in Gimp</a>.</p>
<p>There is a how to install in one of comments. But I needed to install in intltool as well.</p>
<p>If you don&#8217;t see hidden files such as .gimp-2.6, then <a href="http://www.howtogeek.com/howto/ubuntu/view-hidden-files-and-folders-in-ubuntu-file-browser/">this post will tell you how.</a></p>
<p>So here is my version of how to.</p>
<ol>
<li>Unzip the .tar.gz in /home/your_directory/.gimp-2.6/plug-ins/</li>
<li>$ sudo apt-get install libgimp2.0-dev </li>
<li>Go to Applications > Ubuntu software center and check if you have installed intltool. If not install it.</li>
<li>$ cd /home/your_directory/.gimp-2.6/plug-ins/gimp-save-for-web-0.28.6/ </li>
<li>$ ./configure make </li>
<li>$ sudo make install </li>
<li>Restart Gimp </li>
</ol>
<p>A new option is created at File>Save for web.</p>


<p>Related posts:<ol><li><a href='http://www.okadadesign.no/blog/ubuntu/installing-lamp-and-phpmyadmin-on-ubuntu/' rel='bookmark' title='Permanent Link: Installing LAMP and phpMyAdmin on Ubuntu'>Installing LAMP and phpMyAdmin on Ubuntu</a></li>
<li><a href='http://www.okadadesign.no/blog/python/how-to-install-django-in-python-on-windows-vista/' rel='bookmark' title='Permanent Link: How to install Django in Python on Windows Vista'>How to install Django in Python on Windows Vista</a></li>
<li><a href='http://www.okadadesign.no/blog/ie/how-to-install-and-control-iis-on-vista/' rel='bookmark' title='Permanent Link: How to install and control IIS on Vista'>How to install and control IIS on Vista</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.okadadesign.no/blog/ubuntu/how-to-install-save-for-web-in-gimp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile detection, redirection and testing tools</title>
		<link>http://www.okadadesign.no/blog/plug-ins/mobile-detection-redirection-and-testing-tools/</link>
		<comments>http://www.okadadesign.no/blog/plug-ins/mobile-detection-redirection-and-testing-tools/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 09:36:29 +0000</pubDate>
		<dc:creator>shinokada</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[plug-ins]]></category>
		<category><![CDATA[User Agent]]></category>

		<guid isPermaLink="false">http://www.okadadesign.no/blog/?p=2482</guid>
		<description><![CDATA[ <p>I found this website useful. http://www.handsetdetection.com/ It is free upto 10000 detection.</p> <p>Sign up an follow the instruction to create your javascript. It will detect the visitor&#8217;s mobile and redirect to other website.</p> <p>I created the following html and uploaded.</p> &#60;!DOCTYPE html&#62; &#60;html&#62; &#60;head&#62; &#60;script type='text/javascript' src='http://www.handsetdetection.com/sites/js/yournumber.js'&#62;&#60;/script&#62; &#60;/head&#62; &#60;body&#62; &#60;h1&#62;You are accessing from [...]


Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/codeigniter-image-manipulation-class/' rel='bookmark' title='Permanent Link: Testing CodeIgniter Image Manipulation Class'>Testing CodeIgniter Image Manipulation Class</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fplug-ins%2Fmobile-detection-redirection-and-testing-tools%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fplug-ins%2Fmobile-detection-redirection-and-testing-tools%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I found this website useful. <a href="http://www.handsetdetection.com/">http://www.handsetdetection.com/</a> It is free upto 10000 detection.</p>
<p>Sign up an follow the instruction to create your javascript. It will detect the visitor&#8217;s mobile and redirect to other website.</p>
<p>I created the following html and uploaded.</p>
<pre class="brush: xml;">

&lt;!DOCTYPE html&gt;

&lt;html&gt;

&lt;head&gt;
   &lt;script type='text/javascript' src='http://www.handsetdetection.com/sites/js/yournumber.js'&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;h1&gt;You are accessing from a normal browser&lt;/h1&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Then you need to download Firefox addon called <a href="https://addons.mozilla.org/en-US/firefox/addon/59/">User Agent Switcher</a>.</p>
<p>Also you need to download <a href="http://pastebin.com/CpmdwcVc">this text file</a> and change the extension to xml and import to the User Agent Switcher.</p>
<p>You may find updated User Agent files in <a href="http://chrispederick.com/forums/viewtopic.php?id=1772&#038;p=1">this forum</a>. </p>
<p>Change your User Agent from Tools > Default User Agent to any mobile device and visit your website if it works.</p>


<p>Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/codeigniter-image-manipulation-class/' rel='bookmark' title='Permanent Link: Testing CodeIgniter Image Manipulation Class'>Testing CodeIgniter Image Manipulation Class</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.okadadesign.no/blog/plug-ins/mobile-detection-redirection-and-testing-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Customer Support Time Tracking Application with Codeigniter Part 4</title>
		<link>http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-with-codeigniter-part-4/</link>
		<comments>http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-with-codeigniter-part-4/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 08:00:36 +0000</pubDate>
		<dc:creator>shinokada</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[daikon]]></category>

		<guid isPermaLink="false">http://www.okadadesign.no/blog/?p=2233</guid>
		<description><![CDATA[ <p>In this article we are going to create Support Template for customers. </p> Creating Support Template <p>This template is used for customers. It has different sub-menus from admin. The reason to create this template is to make the navigation simple for customers when they log in. It could be done without this template [...]


Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-with-codeigniter-part-5/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application with Codeigniter Part 5'>Creating Customer Support Time Tracking Application with Codeigniter Part 5</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-2/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-1/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fcodeigniter%2Fcreating-customer-support-time-tracking-application-with-codeigniter-part-4%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fcodeigniter%2Fcreating-customer-support-time-tracking-application-with-codeigniter-part-4%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In this article we are going to create Support Template for customers. </p>
<h2>Creating Support Template</h2>
<p>This template is used for customers. It has different sub-menus from admin. The reason to create this template is to make the navigation simple for customers when they log in. It could be done without this template but there will be unnecessary menus on the left column.</p>
<p>The following codes should be placed in system/application/views/support folder.</p>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/support_views.jpg" alt="" title="support_views" width="286" height="580" class="alignleft size-full wp-image-2240" /></p>
<div class="clearboth">&nbsp;</div>
<p><span id="more-2233"></span></p>
<div class="clearboth">&nbsp;</div>
<h4 class="download"><a href="http://websiteclub.skagerak.org/daikon/index.php/auth/login" target="_blank">Demo</a></h4>
<h4>Note: Demo is available for Customer Pages Only. </h4>
<p><u>Login details</u><br />
email 1: cus7(a)gmail.com and pw: anneanne <br /> <br />
email 2: cus2(a)gmail.com and pw: tonjetonje</p>
<h4 class="download"><a href="http://www.okadadesign.no/blog/downloads/#daikon">Download page</a></h4>
<pre class="brush: php;">
// container.php
&lt;?php
$this-&gt;load-&gt;view($this-&gt;config-&gt;item('backendpro_template_support') . 'header');
$this-&gt;load-&gt;view($this-&gt;config-&gt;item('backendpro_template_support') . 'content');
$this-&gt;load-&gt;view($this-&gt;config-&gt;item('backendpro_template_support') . 'footer');
?&gt;
</pre>
<pre class="brush: php;">
// content.php
&lt;div id=&quot;navigation&quot;&gt;
    &lt;?php print $this-&gt;load-&gt;view($this-&gt;config-&gt;item('backendpro_template_support') . 'menu');?&gt;
&lt;/div&gt;
&lt;div id=&quot;breadcrumb&quot;&gt;
        &lt;?php print $this-&gt;bep_site-&gt;get_breadcrumb();?&gt;
    &lt;/div&gt;
&lt;div id=&quot;content&quot;&gt;
    &lt;a name=&quot;top&quot;&gt;&lt;/a&gt;
    &lt;?php print displayStatus();?&gt;
    &lt;?php print (isset($content)) ? $content : NULL; ?&gt;
    &lt;?php
    if( isset($page)){
    if( isset($module)){
            $this-&gt;load-&gt;module_view($module,$page);
        } else {
            $this-&gt;load-&gt;view($page);
        }}
    ?&gt;
    &lt;br style=&quot;clear: both&quot; /&gt;
&lt;/div&gt;
</pre>
<pre class="brush: php;">
//footer.php
    &lt;div id=&quot;footer&quot;&gt;
        &lt;div id=&quot;copyright&quot;&gt;
            &lt;a href=&quot;http://www.kaydoo.co.uk/projects/backendpro&quot;&gt;BackendPro&lt;/a&gt; &amp;copy; Copyright 2008 - &lt;a href=&quot;http://www.kaydoo.co.uk&quot;&gt;Adam Price&lt;/a&gt; -  All rights Reserved
        &lt;/div&gt;
        &lt;div id=&quot;version&quot;&gt;
            &lt;a href=&quot;#top&quot;&gt;&lt;?php print $this-&gt;lang-&gt;line('general_top')?&gt;&lt;/a&gt; |
            &lt;a href=&quot;&lt;?php print base_url()?&gt;user_guide&quot;&gt;&lt;?php print $this-&gt;lang-&gt;line('general_documentation')?&gt;&lt;/a&gt; |
            Version &lt;?php print BEP_VERSION?&gt;&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;?php print $this-&gt;bep_assets-&gt;get_footer_assets();?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<pre class="brush: php;">
// header.php
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
	&lt;?php print $this-&gt;bep_site-&gt;get_metatags();?&gt;
	&lt;title&gt;&lt;?php print $header.' | '.$this-&gt;preference-&gt;item('site_name');?&gt;&lt;/title&gt;
	&lt;?php print $this-&gt;bep_site-&gt;get_variables();?&gt;
	&lt;?php print $this-&gt;bep_assets-&gt;get_header_assets();?&gt;
	&lt;?php print $this-&gt;bep_site-&gt;get_js_blocks();?&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;div id=&quot;wrapper&quot;&gt;
    &lt;div id=&quot;header&quot;&gt;
        &lt;div id=&quot;site&quot;&gt;&lt;?php print $this-&gt;preference-&gt;item('site_name')?&gt;&lt;/div&gt;
        &lt;div id=&quot;info&quot;&gt;
            &lt;?php print anchor('',$this-&gt;lang-&gt;line('backendpro_view_website'),array('class'=&gt;'icon_world_go'))?&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
            &lt;?php print anchor('auth/logout',$this-&gt;lang-&gt;line('userlib_logout'),array('class'=&gt;'icon_key_go'))?&gt;
        &lt;/div&gt;
    &lt;/div&gt;
</pre>
<pre class="brush: php;">
// home.php
&lt;h2&gt;&lt;?php print $header?&gt;&lt;/h2&gt;

&lt;?php print $dashboard ?&gt;

&lt;div class=&quot;buttons&quot; style=&quot;clear: both&quot;&gt;
	&lt;a href=&quot;javascript:void(0);&quot; id=&quot;edit_dashboard&quot;&gt;
		&lt;?php print $this-&gt;bep_assets-&gt;icon('pencil') ?&gt;
		&lt;?php print $this-&gt;lang-&gt;line('general_edit') ?&gt; &lt;?php print $this-&gt;lang-&gt;line('backendpro_dashboard') ?&gt;
	&lt;/a&gt;

	&lt;a href=&quot;javascript:void(0);&quot; id=&quot;save_dashboard&quot;&gt;
		&lt;?php print $this-&gt;bep_assets-&gt;icon('disk') ?&gt;
		&lt;?php print $this-&gt;lang-&gt;line('general_save') ?&gt;
	&lt;/a&gt;
&lt;/div&gt;
</pre>
<pre class="brush: php;">
// menu_support.php
 &lt;?php if(check('Customer Support',NULL,FALSE)):?&gt;
&lt;li id=&quot;menu_bep_support&quot;&gt;&lt;span class=&quot;icon_user_green&quot;&gt;&lt;?php print $this-&gt;lang-&gt;line('customer_support')?&gt;&lt;/span&gt;
        &lt;ul&gt;

            &lt;?php if(check('Customer Record',NULL,FALSE)):?&gt;&lt;li&gt;&lt;?php print anchor('customersupport/admin','Support Home',array('class'=&gt;'icon_user_orange'))?&gt;&lt;/li&gt;&lt;?php echo &quot;\n&quot;; endif;?&gt;
            &lt;?php if(check('Purchase Support',NULL,FALSE)):?&gt;&lt;li&gt;&lt;?php print anchor('customersupport/admin/purchase_credit',$this-&gt;lang-&gt;line('customer_purchase_support'),array('class'=&gt;'icon_user_orange'))?&gt;&lt;/li&gt;&lt;?php echo &quot;\n&quot;; endif;?&gt;

        &lt;/ul&gt;
&lt;/li&gt;
&lt;?php endif;?&gt;
</pre>
<pre class="brush: php;">
// menu.php
&lt;!--
When creating a new menu item on the top-most level
Please ensure that you assign the LI a unique ID

Examples can be seen below for menu_bep_system
--&gt;
&lt;ul id=&quot;menu&quot;&gt;

    &lt;?php
    $this-&gt;load-&gt;view($this-&gt;config-&gt;item('backendpro_template_support') . 'menu_support');
   ?&gt;

&lt;/ul&gt;
</pre>
<pre class="brush: php;">
// popup.php
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
	&lt;title&gt;&lt;?php print $header.' | '.$this-&gt;preference-&gt;item('site_name')?&gt;&lt;/title&gt;
	&lt;?php print $this-&gt;bep_site-&gt;get_variables()?&gt;
	&lt;?php print $this-&gt;bep_assets-&gt;get_header_assets();?&gt;
&lt;/head&gt;
&lt;body style=&quot;padding: 2em;&quot;&gt;
    &lt;a name=&quot;top&quot;&gt;&lt;/a&gt;
    &lt;?php print displayStatus();?&gt;
    &lt;?php print (isset($content)) ? $content : NULL; ?&gt;
    &lt;?php
    if( isset($page)){
    if( isset($module)){
            $this-&gt;load-&gt;module_view($module,$page);
        } else {
            $this-&gt;load-&gt;view($page);
        }}
    ?&gt;
	&lt;?php print $this-&gt;bep_assets-&gt;get_footer_assets();?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<pre class="brush: xml;">
//indes.html
&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;403 Forbidden&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;p&gt;Directory access is forbidden.&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>


<p>Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-with-codeigniter-part-5/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application with Codeigniter Part 5'>Creating Customer Support Time Tracking Application with Codeigniter Part 5</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-2/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-1/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-with-codeigniter-part-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating Customer Support Time Tracking Application Daikon with Codeigniter Part 3</title>
		<link>http://www.okadadesign.no/blog/uncategorized/creating-customer-support-time-tracking-application-with-codeigniter-part-3/</link>
		<comments>http://www.okadadesign.no/blog/uncategorized/creating-customer-support-time-tracking-application-with-codeigniter-part-3/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 09:00:54 +0000</pubDate>
		<dc:creator>shinokada</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.okadadesign.no/blog/?p=2221</guid>
		<description><![CDATA[ Adding Profiles <p>So far we created Cutomer Admin page. In this article we are going to add profiles. Then support_details table to DB. We also modify userlib.php, members.php. and form_member.php as well.</p> <p>In our profile, we are going to add Company name, Full name, Web address, Phone number, Address, City and Post code. [...]


Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-2/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-1/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-with-codeigniter-part-4/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application with Codeigniter Part 4'>Creating Customer Support Time Tracking Application with Codeigniter Part 4</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Funcategorized%2Fcreating-customer-support-time-tracking-application-with-codeigniter-part-3%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Funcategorized%2Fcreating-customer-support-time-tracking-application-with-codeigniter-part-3%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<h3>Adding Profiles</h3>
<p>So far we created Cutomer Admin page. In this article we are going to add profiles. Then support_details table to DB. We also modify userlib.php, members.php. and form_member.php as well.</p>
<p>In our profile, we are going to add Company name, Full name, Web address, Phone number, Address, City and Post code. You can add more if your application needs them.</p>
<p>Please read this backendpro manual, <a href="http://www.kaydoo.co.uk/backendpro/user_guide/features/userauth.html">http://www.kaydoo.co.uk/backendpro/user_guide/features/userauth.html</a> for the reference.</p>
<p><span id="more-2221"></span></p>
<div class="clearboth">&nbsp;</div>
<h4 class="download"><a href="http://websiteclub.skagerak.org/daikon/index.php/auth/login" target="_blank">Demo</a></h4>
<h4>Note: Demo is available for Customer Pages Only. </h4>
<p><u>Login details</u><br />
email 1: cus7(a)gmail.com and pw: anneanne <br /> <br />
email 2: cus2(a)gmail.com and pw: tonjetonje</p>
<h4 class="download"><a href="http://www.okadadesign.no/blog/downloads/#daikon">Download page</a></h4>
<h2>Update the database be_user_profiles</h2>
<p>Run the following sql to alter the table be_user_profiles.</p>
<pre class="brush: sql;">
ALTER TABLE `be_user_profiles`
 ADD COLUMN `company_name` varchar(100) NOT NULL,
 ADD COLUMN `full_name` varchar(50) NOT NULL,
 ADD COLUMN `web_address` varchar(100) NOT NULL,
 ADD COLUMN `phone_number` varchar(50) NOT NULL,
 ADD COLUMN `address` varchar(50) NOT NULL,
 ADD COLUMN `city` varchar(30) NOT NULL,
 ADD COLUMN `post_code` int(10) NOT NULL
</pre>
<p>You now have the following structure.</p>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/db1.jpg" alt="" title="db1" width="569" height="243" class="alignleft size-full wp-image-2353" /></p>
<div class="clearboth">&nbsp;</div>
<h2>Adding support_details table to DB</h2>
<p>Run the following sql in phpMyAdmin to create table &#8216;support_details.</p>
<pre class="brush: sql;">
CREATE TABLE IF NOT EXISTS `support_details` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `customer_id` int(10) NOT NULL,
  `date` date NOT NULL,
  `time` int(10) NOT NULL,
  `point_credit` int(10) NOT NULL,
  `note` text NOT NULL,
  `details` text NOT NULL,
  `by` varchar(40) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;
</pre>
<p>You should have structure as in the following image.</p>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/db2.jpg" alt="" title="db2" width="685" height="243" class="alignleft size-full wp-image-2357" /></p>
<div class="clearboth">&nbsp;</div>
<h2>Update the Userlib config file.</h2>
<p>Open modules/auth/config/userlib.php and replace with the following.</p>
<pre class="brush: php;">

&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Userlib Configurations
 *
 * Contains all config settings for the Userlib class
 *
 * @package		BackendPro
 * @subpackage 	Configurations
 * @author		Adam Price
 * @copyright	Copyright (c) 2008, Adam Price
 * @license		http://www.gnu.org/licenses/lgpl.html
 * @link		http://www.kaydoo.co.uk/projects/backendpro
 * @filesource
 */

// ------------------------------------------------------------------------

/**
 * Authentication Actions
 *
 * These are all the actions performed when an auth process
 * has been completed DO NOT SEND THE LOGIN ACTIONS BACK TO
 * THE LOGIN CONTROLLER, IT WILL CAUSE AN INFINITE LOOP
 */
$config['userlib_action_login'] = '';
$config['userlib_action_logout'] = '';
$config['userlib_action_register'] ='';
$config['userlib_action_activation'] ='';
$config['userlib_action_forgotten_password'] = 'auth/login';
$config['userlib_action_admin_login'] = 'admin';
$config['userlib_action_admin_logout'] = '';

/**
 * User Profile Fields
 *
 * Define here all custom user profile fields and their respective rules.
 * To define a new custom profile field, you must specify an
 * associative array from the database column name =&gt; Full Name/Rule.
 * If no rule is given for a specific field it will not be validated.
 */

$config['userlib_profile_fields'] = array('company_name' =&gt; 'Company Name');
$config['userlib_profile_rules'] = array('company_name' =&gt; 'required|alpha_numeric'); 

$config['userlib_profile_fields'] = array('full_name' =&gt; 'full name');
$config['userlib_profile_rules'] = array('full_name' =&gt; 'required|alpha');

$config['userlib_profile_fields'] = array('web_address' =&gt; 'Web Address');
$config['userlib_profile_rules'] = array('web_address' =&gt; 'required|alpha_numeric');

$config['userlib_profile_fields'] = array('company_name' =&gt; 'Company Name');
$config['userlib_profile_rules'] = array('company_name' =&gt; 'required|alpha_numeric');

$config['userlib_profile_fields'] = array('phone_number' =&gt; 'Phone Number');
$config['userlib_profile_rules'] = array('phone_number' =&gt; 'alpha_numeric');

$config['userlib_profile_fields'] = array('address' =&gt; 'Address');
$config['userlib_profile_rules'] = array('address' =&gt; 'alpha_numeric');

$config['userlib_profile_fields'] = array('city' =&gt; 'City');
$config['userlib_profile_rules'] = array('city' =&gt; 'alpha');

$config['userlib_profile_fields'] = array('post_code' =&gt; 'Post Code');
$config['userlib_profile_rules'] = array('post_code' =&gt; 'numeric');

/* End of file userlib.php */
/* Location: ./modules/auth/config/userlib.php */</pre>
<h2>Allow User Profiles</h2>
<p>Log into the control panel and go to the Settings -> Member Settings page.<br />
Then Yes to  &#8216;Allow User Profile&#8217; and save.</p>
<h2>Update the Member area in the Control Panel</h2>
<p>We have done this in the previous article. It allows administrators to manage these new fields. We have modified the file modules/auth/controllers/admin/members.php.</p>
<h2>Update form_member.php</h2>
<p>The last thing we must do is update the form which data can be entered into, locate and open the file modules/auth/views/admin/members/form_member.php</p>
<p>Replace the file with the following code.</p>
<pre class="brush: php;">

&lt;div id=&quot;generatePasswordWindow&quot;&gt;
	&lt;table&gt;
		&lt;tr&gt;&lt;th width=&quot;50%&quot;&gt;&lt;?php print $this-&gt;lang-&gt;line('userlib_generate_password'); ?&gt;&lt;/th&gt;&lt;th class=&quot;right&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; id=&quot;gpCloseWindow&quot;&gt;&lt;?php print $this-&gt;bep_assets-&gt;icon('cross') ?&gt;&lt;/a&gt;&lt;/th&gt;&lt;/tr&gt;
		&lt;tr&gt;&lt;td rowspan=&quot;3&quot;&gt;&lt;?php print $this-&gt;lang-&gt;line('userlib_password'); ?&gt;:&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b id=&quot;gpPassword&quot;&gt;PASSWORD&lt;/b&gt;&lt;/td&gt;&lt;td class=&quot;right&quot;&gt;&lt;?php print $this-&gt;lang-&gt;line('general_uppercase'); ?&gt; &lt;?php print form_checkbox('uppercase','1',TRUE); ?&gt;&lt;/td&gt;&lt;/tr&gt;
		&lt;tr&gt;&lt;td class=&quot;right&quot;&gt;&lt;?php print $this-&gt;lang-&gt;line('general_numeric'); ?&gt; &lt;?php print form_checkbox('numeric','1',TRUE); ?&gt;&lt;/td&gt;&lt;/tr&gt;
		&lt;tr&gt;&lt;td class=&quot;right&quot;&gt;&lt;?php print $this-&gt;lang-&gt;line('general_symbols'); ?&gt; &lt;?php print form_checkbox('symbols','1',FALSE); ?&gt;&lt;/td&gt;&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;a href=&quot;javascript:void(0);&quot; class=&quot;icon_arrow_refresh&quot; id=&quot;gpGenerateNew&quot;&gt;&lt;?php print $this-&gt;lang-&gt;line('general_generate'); ?&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
		&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;javascript:void(0);&quot; class=&quot;icon_tick&quot; id=&quot;gpApply&quot;&gt;&lt;?php print $this-&gt;lang-&gt;line('general_apply'); ?&gt;&lt;/a&gt;&lt;/td&gt;&lt;td class=&quot;right&quot;&gt;&lt;?php print $this-&gt;lang-&gt;line('general_length'); ?&gt; &lt;input type=&quot;text&quot; name=&quot;length&quot; value=&quot;12&quot; maxlength=&quot;2&quot; size=&quot;4&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
	&lt;/table&gt;
&lt;/div&gt;

&lt;h2&gt;&lt;?php print $header?&gt;&lt;/h2&gt;
&lt;p&gt;&lt;?php print $this-&gt;lang-&gt;line('userlib_password_info')?&gt;&lt;/p&gt;

&lt;?php print form_open('auth/admin/members/form/'.$this-&gt;validation-&gt;id,array('class'=&gt;'horizontal'))?&gt;
    &lt;fieldset&gt;
        &lt;ol&gt;
            &lt;li&gt;
                &lt;?php print form_label($this-&gt;lang-&gt;line('userlib_username'),'username')?&gt;
                &lt;?php print form_input('username',$this-&gt;validation-&gt;username,'id=&quot;username&quot; class=&quot;text&quot;')?&gt;
            &lt;/li&gt;
            &lt;li&gt;
                &lt;?php print form_label($this-&gt;lang-&gt;line('userlib_email'),'email')?&gt;
                &lt;?php print form_input('email',$this-&gt;validation-&gt;email,'id=&quot;email&quot; class=&quot;text&quot;')?&gt;
            &lt;/li&gt;
            &lt;li&gt;
                &lt;?php print form_label($this-&gt;lang-&gt;line('userlib_password'),'password')?&gt;
                &lt;?php print form_password('password','','id=&quot;password&quot; class=&quot;text&quot;')?&gt;
            &lt;/li&gt;
            &lt;li&gt;
                &lt;?php print form_label($this-&gt;lang-&gt;line('userlib_confirm_password'),'confirm_password')?&gt;
                &lt;?php print form_password('confirm_password','','id=&quot;confirm_password&quot; class=&quot;text&quot;')?&gt;
            &lt;/li&gt;
            &lt;li&gt;
                &lt;?php print form_label($this-&gt;lang-&gt;line('userlib_group'),'group')?&gt;
                &lt;?php print form_dropdown('group',$groups,$this-&gt;validation-&gt;group,'id=&quot;group&quot; size=&quot;10&quot; style=&quot;width:20.3em;&quot;')?&gt;
            &lt;/li&gt;
            &lt;li&gt;
                &lt;?php print form_label($this-&gt;lang-&gt;line('userlib_active'),'active')?&gt;
                &lt;?php print $this-&gt;lang-&gt;line('general_yes')?&gt; &lt;?php print form_radio('active','1',$this-&gt;validation-&gt;set_radio('active','1'),'id=&quot;active&quot;')?&gt;
                &lt;?php print $this-&gt;lang-&gt;line('general_no')?&gt; &lt;?php print form_radio('active','0',$this-&gt;validation-&gt;set_radio('active','0'))?&gt;
            &lt;/li&gt;
            &lt;li class=&quot;submit&quot;&gt;
                &lt;?php print form_hidden('id',$this-&gt;validation-&gt;id)?&gt;
                &lt;div class=&quot;buttons&quot;&gt;
	                &lt;button type=&quot;submit&quot; class=&quot;positive&quot; name=&quot;submit&quot; value=&quot;submit&quot;&gt;
	                	&lt;?php print  $this-&gt;bep_assets-&gt;icon('disk');?&gt;
	                	&lt;?php print $this-&gt;lang-&gt;line('general_save')?&gt;
	                &lt;/button&gt;

	                &lt;a href=&quot;&lt;?php print  site_url('auth/admin/members')?&gt;&quot; class=&quot;negative&quot;&gt;
	                	&lt;?php print  $this-&gt;bep_assets-&gt;icon('cross');?&gt;
	                	&lt;?php print $this-&gt;lang-&gt;line('general_cancel')?&gt;
	                &lt;/a&gt;

	                &lt;a href=&quot;javascript:void(0);&quot; id=&quot;generate_password&quot;&gt;
	                	&lt;?php print  $this-&gt;bep_assets-&gt;icon('key');?&gt;
	                	&lt;?php print $this-&gt;lang-&gt;line('userlib_generate_password'); ?&gt;
	                &lt;/a&gt;
	            &lt;/div&gt;
            &lt;/li&gt;
        &lt;/ol&gt;
    &lt;/fieldset&gt;
&lt;h2&gt;&lt;?php print $this-&gt;lang-&gt;line('userlib_user_profile')?&gt;&lt;/h2&gt;
&lt;?php
    if( ! $this-&gt;preference-&gt;item('allow_user_profiles')):
        print &quot;&lt;p&gt;&quot;.$this-&gt;lang-&gt;line('userlib_profile_disabled').&quot;&lt;/p&gt;&quot;;
    else:

?&gt;
&lt;fieldset&gt;
        &lt;ol&gt;
        	&lt;li&gt;
                &lt;?php print form_label('Company Name','company_name')?&gt;
                &lt;?php $value = (empty($profiles['company_name']))? '' : $profiles['company_name'];  ?&gt;
                &lt;?php print form_input('company_name',$value,'id=&quot;company_name&quot; class=&quot;text&quot;')?&gt;

            &lt;/li&gt;
            &lt;li&gt;
                &lt;?php print form_label('Full Name','full_name')?&gt;
                 &lt;?php $value = (empty($profiles['full_name']))? '' : $profiles['full_name'];  ?&gt;
                &lt;?php print form_input('full_name',$value,'id=&quot;full_name&quot; class=&quot;text&quot;')?&gt;
            &lt;/li&gt;
            &lt;li&gt;
                &lt;?php print form_label('Web Address','web_address')?&gt;
                 &lt;?php $value = (empty($profiles['web_address']))? '' : $profiles['web_address'];  ?&gt;
                &lt;?php print form_input('web_address',$value,'id=&quot;web_address&quot; class=&quot;text&quot;')?&gt;
            &lt;/li&gt;
            &lt;li&gt;
                &lt;?php print form_label('Phone Number','phone_number')?&gt;
                 &lt;?php $value = (empty($profiles['phone_number']))? '' : $profiles['phone_number'];  ?&gt;
                &lt;?php print form_input('phone_number',$value,'id=&quot;phone_number&quot; class=&quot;text&quot;')?&gt;
            &lt;/li&gt;
            &lt;li&gt;
                &lt;?php print form_label('Address','address')?&gt;
                 &lt;?php $value = (empty($profiles['address']))? '' : $profiles['address'];  ?&gt;
                &lt;?php print form_input('address',$value,'id=&quot;address&quot; class=&quot;text&quot;')?&gt;
            &lt;/li&gt;
            &lt;li&gt;
                &lt;?php print form_label('City','city')?&gt;
                 &lt;?php $value = (empty($profiles['city']))? '' : $profiles['city'];  ?&gt;
                &lt;?php print form_input('city',$value,'id=&quot;city&quot; class=&quot;text&quot;')?&gt;
            &lt;/li&gt;
            &lt;li&gt;
                &lt;?php print form_label('Post Code','post_code')?&gt;
                 &lt;?php $value = (empty($profiles['post_code']))? '' : $profiles['post_code'];  ?&gt;
                &lt;?php print form_input('post_code',$value,'id=&quot;post_code&quot; class=&quot;text&quot;')?&gt;
            &lt;/li&gt;

            &lt;li class=&quot;submit&quot;&gt;
                &lt;div class=&quot;buttons&quot;&gt;
	                &lt;button type=&quot;submit&quot; class=&quot;positive&quot; name=&quot;submit&quot; value=&quot;submit&quot;&gt;
	                	&lt;?php print  $this-&gt;bep_assets-&gt;icon('disk');?&gt;
	                	&lt;?php print $this-&gt;lang-&gt;line('general_save')?&gt;
	                &lt;/button&gt;

	                &lt;a href=&quot;&lt;?php print  site_url('auth/admin/members')?&gt;&quot; class=&quot;negative&quot;&gt;
	                	&lt;?php print  $this-&gt;bep_assets-&gt;icon('cross');?&gt;
	                	&lt;?php print $this-&gt;lang-&gt;line('general_cancel')?&gt;
	                &lt;/a&gt;
	            &lt;/div&gt;
            &lt;/li&gt;

        &lt;/ol&gt;
    &lt;/fieldset&gt;
&lt;?php endif;?&gt;
&lt;?php print form_close()?&gt;
</pre>
<h2>Test Drive</h2>
<p>You should be able to create, edit, enter new credit and enter work done at this stage.</p>
<h3>Customer Page</h3>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/admin_edit2.jpg" alt="" title="admin_edit2" width="876" height="243" class="alignleft size-full wp-image-2393" /></p>
<div class="clearboth">&nbsp;</div>
<h3>Customer Record</h3>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/customer_record.jpg" alt="" title="customer_record" width="612" height="543" class="alignleft size-full wp-image-2396" /></p>
<div class="clearboth">&nbsp;</div>
<h3>Enter Credit</h3>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/admin_edit1.jpg" alt="" title="admin_edit1" width="644" height="646" class="alignleft size-full wp-image-2388" /></p>
<div class="clearboth">&nbsp;</div>
<h3>Enter Work Done</h3>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/enter_work_done.jpg" alt="" title="enter_work_done" width="474" height="836" class="alignleft size-full wp-image-2394" /></p>
<div class="clearboth">&nbsp;</div>


<p>Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-2/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-1/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-with-codeigniter-part-4/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application with Codeigniter Part 4'>Creating Customer Support Time Tracking Application with Codeigniter Part 4</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.okadadesign.no/blog/uncategorized/creating-customer-support-time-tracking-application-with-codeigniter-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing LAMP and phpMyAdmin on Ubuntu</title>
		<link>http://www.okadadesign.no/blog/ubuntu/installing-lamp-and-phpmyadmin-on-ubuntu/</link>
		<comments>http://www.okadadesign.no/blog/ubuntu/installing-lamp-and-phpmyadmin-on-ubuntu/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 21:08:53 +0000</pubDate>
		<dc:creator>shinokada</dc:creator>
				<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.okadadesign.no/blog/?p=2463</guid>
		<description><![CDATA[ <p></p> <p>This is a quick note about how to install LAMP and phpMyAdmin on Ubuntu 10.04.</p> <p>In terminal, </p> sudo tasksel install lamp-server <p>Then follow the installation. It will ask you to enter mysql password.</p> <p>Then install phpmyadmin</p> sudo apt-get install phpmyadmin <p>It will also ask you passwords.</p> <p>Then open apache2.conf to edit.</p> [...]


Related posts:<ol><li><a href='http://www.okadadesign.no/blog/xampp/how-to-add-httpd-conf-to-xampp/' rel='bookmark' title='Permanent Link: How to add httpd.conf to XAMPP'>How to add httpd.conf to XAMPP</a></li>
<li><a href='http://www.okadadesign.no/blog/ubuntu/how-to-install-save-for-web-in-gimp/' rel='bookmark' title='Permanent Link: How to install Save-for-Web in Gimp'>How to install Save-for-Web in Gimp</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/kaimono-kago-installation-added/' rel='bookmark' title='Permanent Link: Kaimono Kago: Installation added'>Kaimono Kago: Installation added</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fubuntu%2Finstalling-lamp-and-phpmyadmin-on-ubuntu%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fubuntu%2Finstalling-lamp-and-phpmyadmin-on-ubuntu%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/footer_logo.png" alt="" title="footer_logo" width="118" height="27" class="alignleft size-full wp-image-2464" /></p>
<p>This is a quick note about how to install LAMP and phpMyAdmin on Ubuntu 10.04.</p>
<p>In terminal, </p>
<div class="codesnip-container" >sudo tasksel install lamp-server</div>
<p>Then follow the installation. It will ask you to enter mysql password.</p>
<p>Then install phpmyadmin</p>
<div class="codesnip-container" >sudo apt-get install phpmyadmin</div>
<p>It will also ask you passwords.</p>
<p>Then open apache2.conf to edit.</p>
<div class="codesnip-container" >sudo gedit /etc/init.d/apache2.conf</div>
<p>Add the following around line 210.</p>
<div class="codesnip-container" ># Include phpmyadmin<br />
Include /etc/phpmyadmin/apache.conf</div>
<p>Then restart apache.</p>
<div class="codesnip-container" >sudo /etc/init.d/apache2 restart</div>
<p>Then visit http://localhost/ and http://localhost/phpmyadmin to see them.</p>


<p>Related posts:<ol><li><a href='http://www.okadadesign.no/blog/xampp/how-to-add-httpd-conf-to-xampp/' rel='bookmark' title='Permanent Link: How to add httpd.conf to XAMPP'>How to add httpd.conf to XAMPP</a></li>
<li><a href='http://www.okadadesign.no/blog/ubuntu/how-to-install-save-for-web-in-gimp/' rel='bookmark' title='Permanent Link: How to install Save-for-Web in Gimp'>How to install Save-for-Web in Gimp</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/kaimono-kago-installation-added/' rel='bookmark' title='Permanent Link: Kaimono Kago: Installation added'>Kaimono Kago: Installation added</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.okadadesign.no/blog/ubuntu/installing-lamp-and-phpmyadmin-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2</title>
		<link>http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-2/</link>
		<comments>http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-2/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 08:00:49 +0000</pubDate>
		<dc:creator>shinokada</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[daikon]]></category>

		<guid isPermaLink="false">http://www.okadadesign.no/blog/?p=2217</guid>
		<description><![CDATA[ <p>In this article we are going to create Support Module for Admin. Firstly we are going to create menu for admin then proceed to creating support files.</p> <p></p> &#160; <p></p> &#160; Demo Note: Demo is available for Customer Pages Only. <p>Login details email 1: cus7(a)gmail.com and pw: anneanne email 2: cus2(a)gmail.com and pw: [...]


Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-1/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-with-codeigniter-part-5/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application with Codeigniter Part 5'>Creating Customer Support Time Tracking Application with Codeigniter Part 5</a></li>
<li><a href='http://www.okadadesign.no/blog/uncategorized/creating-customer-support-time-tracking-application-with-codeigniter-part-3/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application Daikon with Codeigniter Part 3'>Creating Customer Support Time Tracking Application Daikon with Codeigniter Part 3</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fcodeigniter%2Fcreating-customer-support-time-tracking-application-daikon-with-codeigniter-part-2%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fcodeigniter%2Fcreating-customer-support-time-tracking-application-daikon-with-codeigniter-part-2%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In this article we are going to create Support Module for Admin.<br />
Firstly we are going to create menu for admin then proceed to creating support files.</p>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/admin_support1.jpg" alt="" title="admin_support1" width="688" height="285" class="alignleft size-full wp-image-2330" /></p>
<div class="clearboth">&nbsp;</div>
<p><span id="more-2217"></span></p>
<div class="clearboth">&nbsp;</div>
<h4 class="download"><a href="http://websiteclub.skagerak.org/daikon/index.php/auth/login" target="_blank">Demo</a></h4>
<h4>Note: Demo is available for Customer Pages Only. </h4>
<p><u>Login details</u><br />
email 1: cus7(a)gmail.com and pw: anneanne <br /> <br />
email 2: cus2(a)gmail.com and pw: tonjetonje</p>
<h4 class="download"><a href="http://www.okadadesign.no/blog/downloads/#daikon">Download page</a></h4>
<h2>Creating Support menu for Admin</h2>
<p>Open system/application/views/admin/menu.php and add the following just before ul-closing tag at the end.</p>
<pre class="brush: php;">
 &lt;?php
    $this-&gt;load-&gt;view($this-&gt;config-&gt;item('backendpro_template_admin') . 'menu_support');
   ?&gt;
</pre>
<p>Here we are loading menu_support.php, so we are going to create next.</p>
<p>system/application/views/admin/menu_support.php</p>
<pre class="brush: php;">
 &lt;?php if(check('Customer Support',NULL,FALSE)):?&gt;
&lt;li id=&quot;menu_bep_support&quot;&gt;&lt;span class=&quot;icon_user_green&quot;&gt;&lt;?php print $this-&gt;lang-&gt;line('customer_support')?&gt;&lt;/span&gt;
        &lt;ul&gt;

            &lt;?php if(check('Customers Admin',NULL,FALSE)):?&gt;&lt;li&gt;&lt;?php print anchor('support/admin',$this-&gt;lang-&gt;line('customer_customers_admin'),array('class'=&gt;'icon_user_orange'))?&gt;&lt;/li&gt;&lt;?php echo &quot;\n&quot;; endif;?&gt;

        &lt;/ul&gt;
&lt;/li&gt;
&lt;?php endif;?&gt;
</pre>
<p>We are showing only Customer Support and sub-menu Cusotmers Admin as you see the image above.</p>
<h2>Creating Resources</h2>
<p>You are not able to see the menu yet. You need to create Resources in the back-end.</p>
<p>Login to the back-end and System > Access Control > Resources and click &#8216;Create Resources&#8217;. </p>
<p>Create Customer Support, Purchase Support, Customer Record and Customers Admin as you see in the next image. </p>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/admin_menu1.jpg" alt="" title="admin_menu1" width="501" height="545" class="alignleft size-full wp-image-2344" /></p>
<div class="clearboth">&nbsp;</div>
<h2>Adding jquery calender js and css</h2>
<p>Open modules/site/config/bep_assets.php</p>
<pre class="brush: php;">

// Back-end Calendar CSS
$config['asset'][] = array('file'=&gt;'jquery.datepick.css');

// Back-end Calendar JS
$config['asset'][] = array('file'=&gt;'jquery.datepick.pack.js', 'needs'=&gt;'jquery');
$config['asset'][] = array('file'=&gt;'site.js', 'needs'=&gt;'jquery');
</pre>
<p>And change $config['asset_group']['ADMIN'] to the following.</p>
<pre class="brush: php;">

$config['asset_group']['ADMIN'] = 'bep_admin_layout|bep_admin_style|FlashStatus|forms|buttons|bep_navigation|treeview|bep_icons|bep_select_all|jquery.datepick|jquery.datepick.pack|site';
</pre>
<p><a href="http://keith-wood.name/datepick.html" target="_blank">Download jquery datepicker from here</a>. Unzip it and place jquery.date.pick.css to assets/css folder.<br />
Place jquery.datepick.pack.js in assets/js folder.</p>
<p>Modify jquery.date.pick.css a bit to suit to Bep.</p>
<pre class="brush: css;">
.datepick {

	background-color: #fff;

	color: #000;

	border: 1px solid #444;

    border-radius: 0.25em;

    -moz-border-radius: 0.25em;

    -webkit-border-radius: 0.25em;

	font-family: Arial,Helvetica,Sans-serif;

	/*font-size: 90%;*/

}
</pre>
<p>Create assets/js/site.js and copy the following code.</p>
<pre class="brush: jscript;">

$(document).ready(function(){

	//configure the date format to match mysql date
	$('#date').datepick({dateFormat: 'yy-mm-dd'});

});
</pre>
<p>Now you can login to the back-end and see the menu you created as the previous image.</p>
<p>But clicking Customers Admin show nothing. We are going to create next.</p>
<h2>Cretaing Support Module</h2>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/admin_support2.jpg" alt="" title="admin_support2" width="259" height="500" class="alignleft size-full wp-image-2331" /></p>
<p>Create modules/support directory and other directories and files as you see on the left image.</p>
<p>Copy and past the following codes.</p>
<div class="clearboth">&nbsp;</div>
<h3>modules/support/controllers/admin/admin.php</h3>
<pre class="brush: php;">

&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Admin extends Admin_Controller {
  function Admin(){
   	parent::Admin_Controller();
		   // Check for access permission
			check('Customers Admin');
			// Load models and language
			$this-&gt;load-&gt;model('MSupport');
			$this-&gt;load-&gt;module_model('auth','User_model');
			$this-&gt;load-&gt;language('customer');
			// Set breadcrumb
			$this-&gt;bep_site-&gt;set_crumb($this-&gt;lang-&gt;line('customer_support_admin'),'support/admin');
	}

	function index(){
			// we use the following variables in the view
			$data['title'] = &quot;Customer Page&quot;;

			// get members details where group = 1 or not 2 from be_users
			$id = 1;
			$data['support_customers'] = $this-&gt;MSupport-&gt;getAllMemberProfile($id);
			$data['header'] = $this-&gt;lang-&gt;line('customer_support');

			// This how Bep load views
			$data['page'] = $this-&gt;config-&gt;item('backendpro_template_admin') . &quot;admin_support_home&quot;;
			$data['module'] = 'support';
			$this-&gt;load-&gt;view($this-&gt;_container,$data);
	}

	function customer_record($id= NULL){
		$data['title'] = &quot;Customer Record&quot;;
		$id = $this-&gt;uri-&gt;segment(4);

		$data['customer_records'] = $this-&gt;MSupport-&gt;getAllCustomerRecord($id);
		$totaltime = $this-&gt;MSupport-&gt; totalColumn($id,'time');
		$totalcredit = $this-&gt;MSupport-&gt; totalColumn($id, 'point_credit');
		$total = $totalcredit-&gt;point_credit - $totaltime-&gt;time;
		$data['totaltime']= $totaltime-&gt;time;
		$data['totalcredit']= $totalcredit-&gt;point_credit;
		$data['total']= $total;

		// Get customer name and username to display by using $id which is segment 4
		$data['customer_details']= $this-&gt;MSupport-&gt;getSingleMemberProfile($id);
		$data['header'] = $this-&gt;lang-&gt;line('customer_record');
		// Set breadcrumb
		$this-&gt;bep_site-&gt;set_crumb($this-&gt;lang-&gt;line('customer_support_customer'),'support/admin/customer');
		// This how Bep load views
		$data['page'] = $this-&gt;config-&gt;item('backendpro_template_admin') . &quot;admin_customer_home&quot;;
		$data['module'] = 'support';
		$this-&gt;load-&gt;view($this-&gt;_container,$data);
	}

	function enter_newcredit($id=0){
		$data['title'] = &quot;Enter Credit&quot;;

		$data['header'] = $this-&gt;lang-&gt;line('customer_enter_credit');
		// Set breadcrumb
		$this-&gt;bep_site-&gt;set_crumb($this-&gt;lang-&gt;line('customer_enter_credit'),'support/admin/newcredit');

		$data['id'] = $this-&gt;uri-&gt;segment(4);

		if ($this-&gt;input-&gt;post('point_credit')){
			$id = $this-&gt;input-&gt;post('id');
	  		// fields filled up so,
	  		$this-&gt;MSupport-&gt;enter_credit();
	  		// CI way to set flashdata, but we are not using it
	  		// $this-&gt;session-&gt;set_flashdata('message','Product updated');
	  		// we are using Bep function for flash msg
	  		flashMsg('success','Credit entered');
	  		redirect('support/admin/customer_record/'.$id,'refresh');
	  	}else{
	  		// pull admin for 'by' dropdown field
			// where group = 2 from be_users table
	  		$member_id = 2;
	  		$data['administrators'] = $this-&gt;MSupport-&gt;getMembersDropDown($member_id);
	  		$data['page'] = $this-&gt;config-&gt;item('backendpro_template_admin') . &quot;admin_enter_credit&quot;;
	  		// This how Bep load views
			$data['module'] = 'support';
			$this-&gt;load-&gt;view($this-&gt;_container,$data);
	  	}

	}

	function enter_workdone(){
		$data['title'] = &quot;Enter Work Done&quot;;

		$data['header'] = $this-&gt;lang-&gt;line('customer_work_done');
		// Set breadcrumb
		$this-&gt;bep_site-&gt;set_crumb($this-&gt;lang-&gt;line('customer_work_done'),'support/admin/workdone');

		$data['id'] = $this-&gt;uri-&gt;segment(4);

		if ($this-&gt;input-&gt;post('date')){
			$id = $this-&gt;input-&gt;post('id');
	  		// fields filled up so,
	  		$this-&gt;MSupport-&gt;enter_workdone();
	  		// CI way to set flashdata, but we are not using it
	  		// $this-&gt;session-&gt;set_flashdata('message','Product updated');
	  		// we are using Bep function for flash msg
	  		flashMsg('success','Work Done Entered');
	  		redirect('support/admin/customer_record/'.$id,'refresh');
	  	}else{

	  		// pull admin for 'by' dropdown field
			// where group = 2 from be_users table
	  		$member_id = 2;
	  		$data['administrators'] = $this-&gt;MSupport-&gt;getMembersDropDown($member_id);

	  		$data['page'] = $this-&gt;config-&gt;item('backendpro_template_admin') . &quot;admin_work_done&quot;;
	  		// This how Bep load views
			$data['module'] = 'support';
			$this-&gt;load-&gt;view($this-&gt;_container,$data);
	  	}

	}

	function update_record(){
		$id = $this-&gt;uri-&gt;segment(4);
		// if you are using TinyMCE here, load it.
		// $this-&gt;bep_assets-&gt;load_asset_group('TINYMCE');
		if ($this-&gt;input-&gt;post('date')){
			$customer_id = $this-&gt;input-&gt;post('customer_id');
			// info is filled out, do the followings

			$this-&gt;MSupport-&gt;updateRecord($id);
			// This is CI way to show flashdata
			// $this-&gt;session-&gt;set_flashdata('message','Page updated');
			// But here we use Bep way to display flash msg
	  		flashMsg('success','Customer updated');
		  	redirect('support/admin/customer_record/'.$customer_id,'refresh');
		}else{

			$data['title'] = &quot;Update Record&quot;;
			$data['page'] = $this-&gt;config-&gt;item('backendpro_template_admin') . &quot;admin_edit_record&quot;;
			$data['records'] = $this-&gt;MSupport-&gt;getRecord($id);

	  		// pull admin for 'by' dropdown field
			// where group = 2 from be_users table
	  		$member_id = 2;
	  		$data['administrators'] = $this-&gt;MSupport-&gt;getMembersDropDown($member_id);
			//Pull user_names from be_users
			// need to get user name and use them with dropdown to choose it
			// this will be used in customersupport module to display customer's own support records
			//$data['members'] = $this-&gt;user_model-&gt;getUsers();// not working at the moment

		if (!count($data['records'])){
			// if page is not specified redirect to index
			redirect('support/admin/','refresh');
			}
			// $data['menus'] = $this-&gt;MMenus-&gt;getAllMenusDisplay();
			// Set breadcrumb
			$this-&gt;bep_site-&gt;set_crumb($this-&gt;lang-&gt;line('customer_support_admin_edit'),'support/admin/update_record');
			$data['header'] = $this-&gt;lang-&gt;line('customer_edit_record');
			$data['module'] = 'support';
			$this-&gt;load-&gt;view($this-&gt;_container,$data);
		}

	}

	function delete_record($id = NULL){
		$customer_id = $this-&gt;uri-&gt;segment(4);
		$id = $this-&gt;uri-&gt;segment(5);
		$this-&gt;MSupport-&gt;deleteRecord($id);
		flashMsg('success','Record deleted');
		redirect('support/admin/customer_record/'.$customer_id,'refresh');
	}

	function supportDisplay(){

	}

	function details($id){

		// we use the following variables in the view
		$data['title'] = &quot;Support Details&quot;;
		$data['header'] = &quot;Support Details&quot; ;

		$data['username']=$this-&gt;session-&gt;userdata('username');
		$username = $this-&gt;session-&gt;userdata('username');

		$id = $this-&gt;uri-&gt;segment(4);
		$this-&gt;load-&gt;module_model('customersupport','MCustomer_support');
		$data['details']= $this-&gt;MCustomer_support-&gt;admingetRecordDetails($id);
		// Set breadcrumb
		$this-&gt;bep_site-&gt;set_crumb('Details','customersupport/admin/details');

		// This how Bep load views
		$data['page'] = $this-&gt;config-&gt;item('backendpro_template_admin') . &quot;details&quot;;
		$data['module'] = 'customersupport';
		$this-&gt;load-&gt;view($this-&gt;_container,$data); 

	}
}//end class
?&gt;
</pre>
<h3>modules/support/models/msupport.php</h3>
<pre class="brush: php;">

&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MSupport extends Base_model{

	function MSupport(){
		parent::Base_model();
		$this-&gt;_TABLES = array( 'support_details' =&gt; 'support_details'
                                    );
	}

	function getCustomer($id){
	    $data = array();

	    $Q = $this-&gt;fetch('be_users','*',1,array('id'=&gt;$id));
	    if ($Q-&gt;num_rows() &gt; 0){
	      	$data = $Q-&gt;row_array();
	    }
	    $Q-&gt;free_result();
	    return $data;
	}

	 function getAllCustomerRecord($id){
	 	$data = array();
	    $this-&gt;db-&gt;where('customer_id', $id);
	    $Q = $this-&gt;db-&gt;get('support_details');
	    if ($Q-&gt;num_rows() &gt; 0){
	       	foreach ($Q-&gt;result_array() as $row){
	        $data[] = $row;
	      }
	    }
	    $Q-&gt;free_result();
	    return $data;  

	 }

	 function totalColumn($id, $column){
	 	$data = array();
	 	$this-&gt;db-&gt;select_sum($column);
	    $this-&gt;db-&gt;where('customer_id', $id);
	    $Q = $this-&gt;db-&gt;get('support_details');
	    if ($Q-&gt;num_rows() &gt; 0){
	       	 $data = $Q-&gt;row();
	      }

	    $Q-&gt;free_result();
	    return $data;  

	 }

	 function enter_credit(){
	 	$data = array(
			'customer_id' =&gt; $this-&gt;input-&gt;post('id'),
			'date' =&gt; $this-&gt;input-&gt;post('date'),
			'point_credit' =&gt; $this-&gt;input-&gt;post('point_credit'),
			'note' =&gt; $this-&gt;input-&gt;post('note'),
	 		'by' =&gt; $this-&gt;input-&gt;post('by'),

		);

		$this-&gt;insert('support_details',$data);
	 }

 	function enter_workdone(){
	 	$data = array(
			'customer_id' =&gt; $this-&gt;input-&gt;post('id'),
			'date' =&gt; $this-&gt;input-&gt;post('date'),
			'time' =&gt; $this-&gt;input-&gt;post('time'),
			'note' =&gt; $this-&gt;input-&gt;post('note'),
	 		'details' =&gt; $this-&gt;input-&gt;post('details'),
	 		'by' =&gt; $this-&gt;input-&gt;post('by'),

		);

		$this-&gt;insert('support_details',$data);
	 }

	function getMembers($id){
		// admin id is 2 and member id is 1
	     $data = array();
	     $this-&gt;db-&gt;select('id,username');
	     $this-&gt;db-&gt;where('group', $id);
	     $Q = $this-&gt;db-&gt;get('be_users');
	     if ($Q-&gt;num_rows() &gt; 0){
	       foreach ($Q-&gt;result_array() as $row){
	         $data[]=$row;
	       }
	    }
	    $Q-&gt;free_result();
	    return $data;
	 } 

	function getAllMemberProfile($id=NULL){
		$data = array();
		$this-&gt;db-&gt;select('*');
		$this-&gt;db-&gt;from('be_user_profiles');
		$this-&gt;db-&gt;join('be_users', 'be_users.id = be_user_profiles.user_id');
		$this-&gt;db-&gt;where('be_users.group', $id);
		$query = $this-&gt;db-&gt;get();
		if ($query-&gt;num_rows() &gt; 0){
	       foreach ($query-&gt;result_array() as $row){
	         $data[]=$row;
	       }
	    }
	    $query-&gt;free_result();
	    return $data; 

	} 

	function getSingleMemberProfile($id=NULL){
		$data = array();
		$this-&gt;db-&gt;select('*');
		$this-&gt;db-&gt;from('be_user_profiles');
		$this-&gt;db-&gt;join('be_users', 'be_users.id = be_user_profiles.user_id');
		$this-&gt;db-&gt;where('be_user_profiles.user_id', $id);
		$query = $this-&gt;db-&gt;get();
		if ($query-&gt;num_rows() &gt; 0){
	       foreach ($query-&gt;result_array() as $row){
	         $data[]=$row;
	       }
	    }
	    $query-&gt;free_result();
	    return $data; 

	} 

	function getMembersDropDown($id){
		// admin id is 2 and member id is 1
	     $data = array();
	     $this-&gt;db-&gt;select('id,username');
	     $this-&gt;db-&gt;where('group', $id);
	     $Q = $this-&gt;db-&gt;get('be_users');
	     if ($Q-&gt;num_rows() &gt; 0){
	       foreach ($Q-&gt;result_array() as $row){
	         $data[$row['username']] = $row['username'];
	       }
	    }
	    $Q-&gt;free_result();
	    return $data;
	 }

	// not used delete
	function getAdminsDropDown(){
	     $data = array();
	     $admin= 2;
	     $this-&gt;db-&gt;select('id,username');
	     $this-&gt;db-&gt;where('group', $admin);
	     $Q = $this-&gt;db-&gt;get('be_users');
	     if ($Q-&gt;num_rows() &gt; 0){
	       foreach ($Q-&gt;result_array() as $row){
	         $data[$row['username']] = $row['username'];
	       }
	    }
	    $Q-&gt;free_result();
	    return $data;
	 }

	 function getRecord($id){
	 	$data = array();
	    $Q = $this-&gt;fetch('support_details',NULL ,NULL ,array('id'=&gt;$id));
	    if ($Q-&gt;num_rows() &gt; 0){
	      	$data = $Q-&gt;row_array();
	    }
	    $Q-&gt;free_result();
	    return $data;
	 }

	 function updateRecord($id){
	 	$data = array(
			'date' =&gt; $this-&gt;input-&gt;post('date'),
			'time' =&gt; $this-&gt;input-&gt;post('time'),
			'point_credit' =&gt; $this-&gt;input-&gt;post('point_credit'),
			'note' =&gt; $this-&gt;input-&gt;post('note'),
			'details' =&gt; $this-&gt;input-&gt;post('details'),
			'by' =&gt; $this-&gt;input-&gt;post('by'),

		);
		$id = $this-&gt;input-&gt;post('id');
		$this-&gt;update('support_details',$data,array('id'=&gt;$id));

	 }

	 function deleteRecord($id){
	 	$this-&gt;delete('support_details',array('id'=&gt;$id));
	 }

}
</pre>
<h3>modules/support/views/admin/admin_create_customers.php</h3>
<pre class="brush: php;">
&lt;h2&gt;&lt;?php echo $title;?&gt;&lt;/h2&gt;
&lt;div id=&quot;create_edit&quot;&gt;
&lt;?php

echo form_open('support/admin/create_customer');
echo &quot;\n&lt;p&gt;&lt;label for='username'&gt;User Name&lt;/label&gt;&lt;br/&gt;\n&quot;;
/*
foreach ($members-&gt;result_array() as $row){
         $options[$row['username']] = $row['username'];
       }
       */
echo form_dropdown('username',$members) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;\n&lt;p&gt;&lt;label for='comname'&gt;Company Name&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'company_name','id'=&gt;'comname','size'=&gt;40);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='customer_name'&gt;Cutomer Name&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'customer_name','id'=&gt;'customer_name','size'=&gt;40);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='web_address'&gt;Web Address&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'web_address','id'=&gt;'web_address','size'=&gt;40);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='password'&gt;Password for website&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'password','id'=&gt;'password','size'=&gt;40);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='phone'&gt;Phone&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'phone_number','id'=&gt;'phone','size'=&gt;40);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='email'&gt;email&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'email','id'=&gt;'email','size'=&gt;40);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='address'&gt;Address&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'address','id'=&gt;'address','size'=&gt;100);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='city'&gt;City&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'city','id'=&gt;'city','size'=&gt;40);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='postcode'&gt;Postcode&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'postcode','id'=&gt;'postcode','size'=&gt;10);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='status'&gt;Status&lt;/label&gt;&lt;br/&gt;\n&quot;;
$options = array('active' =&gt; 'active', 'inactive' =&gt; 'inactive');
echo form_dropdown('status',$options) .&quot;&lt;/p&gt;\n&quot;;

echo form_submit('submit','Create Customer');
echo form_close();

?&gt;
&lt;/div&gt;
</pre>
<h3>modules/support/views/admin/admin_customer_home.php</h3>
<pre class="brush: php;">

&lt;?php print displayStatus();?&gt;
&lt;h2&gt;&lt;?php echo $title;?&gt;&lt;/h2&gt;

&lt;?php
foreach ($customer_details as $detail){
echo &quot;&lt;p&gt;&quot;;
echo anchor(&quot;support/admin/enter_newcredit/&quot;.$detail['user_id'], &quot;Enter New Credits&quot;);
echo &quot;&lt;br /&gt;&quot;;
echo anchor(&quot;support/admin/enter_workdone/&quot;.$detail['user_id'], &quot;Enter Work Done&quot;);
echo &quot;&lt;br /&gt;&lt;/p&gt;&quot;;

/* Display the customer details */
echo &quot;&lt;h4&gt;Company Name: &quot;.$detail['company_name'].&quot;&lt;/h4&gt;&quot;;
echo &quot;&lt;h4&gt;Customer Name: &quot;.$detail['full_name'].&quot;&lt;/h4&gt;&quot;;
echo &quot;&lt;h4&gt;Web Address: &quot;.$detail['web_address'].&quot;&lt;/h4&gt;&quot;;
echo &quot;+++++++++++++++++++++++&quot;;
}
/*
 This is how CI display flash data. but we don't use it. 

if ($this-&gt;session-&gt;flashdata('message')){
	echo &quot;&lt;div class='status_box'&gt;&quot;.$this-&gt;session-&gt;flashdata('message').&quot;&lt;/div&gt;&quot;;
}
*/
	echo &quot;&lt;h4&gt;Total time spent: &quot;.$totaltime.&quot;&lt;/h4&gt;&quot;;
	echo &quot;&lt;h4&gt;Total credit purchased: &quot;.$totalcredit.&quot;&lt;/h4&gt;&quot;;
	echo &quot;&lt;h4&gt;Total Points/Time Left: &quot;.$total.&quot;&lt;/h4&gt;&quot;;
	echo &quot;&lt;h4&gt;Support Details&lt;/h4&gt;&quot;;
// print_r ($customer_records);
if (count($customer_records)){
	echo &quot;&lt;table id='tablesorter' class='tablesorter' border='1' cellspacing='0' cellpadding='3' width='100%'&gt;\n&quot;;
	echo &quot;&lt;thead&gt;\n&lt;tr valign='top'&gt;\n&quot;;
	echo &quot;&lt;th&gt;By&lt;/th&gt;\n&lt;th&gt;Date&lt;/th&gt;&lt;th&gt;Time&lt;/th&gt;&lt;th&gt;Point Credit&lt;/th&gt;&lt;th&gt;Note&lt;/th&gt;&lt;th&gt;Details&lt;/th&gt;&lt;th&gt;Action&lt;/th&gt;\n&quot;;
	echo &quot;&lt;/tr&gt;\n&lt;/thead&gt;\n&lt;tbody&gt;\n&quot;;
	foreach ($customer_records as $list){
		// print_r ($total);
		echo &quot;&lt;tr valign='top'&gt;\n&quot;;
		echo &quot;&lt;td align='center'&gt;&quot;.$list['by'].&quot;&lt;/td&gt;\n&quot;;
		echo &quot;&lt;td&gt;&quot;.$list['date'].&quot;&lt;/td&gt;\n&quot;;

		echo &quot;&lt;td&gt;&quot;.$list['time']. &quot;&lt;/td&gt;&quot;;
		echo &quot;&lt;td&gt;&quot;.$list['point_credit']. &quot;&lt;/td&gt;&quot;;
		echo &quot;&lt;td&gt;&quot;.$list['note']. &quot;&lt;/td&gt;&quot;;
		echo &quot;&lt;td&gt;&quot;;
		echo anchor('support/admin/details/'.$list['id'],'Details');
		echo &quot;&lt;/td&gt;&quot;;
		echo &quot;&lt;td&gt;&quot;;
		echo anchor('support/admin/update_record/'.$list['id'],'edit');
		echo &quot; | &quot;;
		foreach ($customer_details as $detail)
		echo anchor('support/admin/delete_record/'.$detail['user_id'].&quot;/&quot;.$list['id'],'delete');
		echo &quot;&lt;/td&gt;\n&quot;;
		echo &quot;&lt;/tr&gt;\n&quot;;
	}
	echo &quot;&lt;/tbody&gt;\n&lt;/table&gt;&quot;;

}

?&gt;
</pre>
<h3>modules/support/views/admin/admin_edit_customer.php</h3>
<pre class="brush: php;">

&lt;?php print displayStatus();?&gt;
&lt;h2&gt;&lt;?php echo $title;?&gt;&lt;/h2&gt;
&lt;div id=&quot;create_edit&quot;&gt;
&lt;?php

echo form_open('support/admin/edit_customer');
echo &quot;\n&lt;p&gt;&lt;label for='username'&gt;User Name&lt;/label&gt;&lt;br/&gt;\n&quot;;
foreach ($members-&gt;result_array() as $row){
         $options[$row['username']] = $row['username'];
       }
echo form_dropdown('username',$options, $customerdetails['username']) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;\n&lt;p&gt;&lt;label for='comname'&gt;Company Name&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'company_name','id'=&gt;'comname','size'=&gt;40, 'value' =&gt; $customerdetails['company_name']);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='customer_name'&gt;Cutomer Name&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'customer_name','id'=&gt;'customer_name','size'=&gt;40, 'value' =&gt; $customerdetails['customer_name']);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='web_address'&gt;Web Address&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'web_address','id'=&gt;'web_address','size'=&gt;40, 'value' =&gt; $customerdetails['web_address']);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='password'&gt;Password for website&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'password','id'=&gt;'password','size'=&gt;40, 'value' =&gt; $customerdetails['password']);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='phone'&gt;Phone&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'phone_number','id'=&gt;'phone','size'=&gt;40, 'value' =&gt; $customerdetails['phone_number']);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='email'&gt;email&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'email','id'=&gt;'email','size'=&gt;40, 'value' =&gt; $customerdetails['email']);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='address'&gt;Address&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'address','id'=&gt;'address','size'=&gt;100, 'value' =&gt; $customerdetails['address']);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='city'&gt;City&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'city','id'=&gt;'city','size'=&gt;40, 'value' =&gt; $customerdetails['city']);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='post_code'&gt;Postcode&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'post_code','id'=&gt;'postcode','size'=&gt;10, 'value' =&gt; $customerdetails['post_code']);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='status'&gt;Status&lt;/label&gt;&lt;br/&gt;\n&quot;;
$options = array('active' =&gt; 'active', 'inactive' =&gt; 'inactive');
echo form_dropdown('status',$options, $customerdetails['status']) .&quot;&lt;/p&gt;\n&quot;;

echo form_hidden('id',$customerdetails['id']);
echo form_submit('submit','Update Customer');
echo form_close();

?&gt;
&lt;/div&gt;
</pre>
<h3>modules/support/views/admin/admin_edit_record.php</h3>
<pre class="brush: php;">

&lt;?php print displayStatus();?&gt;
&lt;h2&gt;&lt;?php echo $title;?&gt;&lt;/h2&gt;
&lt;div id=&quot;editrecord&quot;&gt;
&lt;?php

echo form_open('support/admin/update_record');

echo &quot;\n&lt;p&gt;&lt;label for='date'&gt;Date&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'date','id'=&gt;'date','size'=&gt;40, 'value' =&gt; $records['date']);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='time'&gt;Time&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'time','id'=&gt;'time','size'=&gt;40, 'value' =&gt; $records['time']);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='point_credit'&gt;Point Credit&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'point_credit','id'=&gt;'point_credit','size'=&gt;40, 'value' =&gt; $records['point_credit']);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='note'&gt;Note&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'note','id'=&gt;'note', 'value' =&gt; $records['note']);
echo form_textarea($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='details'&gt;Details&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'details','id'=&gt;'details', 'value' =&gt; $records['details']);
echo form_textarea($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='by'&gt;By&lt;/label&gt;&lt;br/&gt;\n&quot;;
echo form_dropdown('by',$administrators,$records['by']) .&quot;&lt;/p&gt;\n&quot;;

echo form_hidden('id',$records['id']);
echo form_hidden('customer_id',$records['customer_id']);
echo form_submit('submit','Update Record');
echo form_close();

?&gt;
&lt;/div&gt;
</pre>
<h3>modules/support/views/admin/admin_enter_credit.php</h3>
<pre class="brush: php;">

&lt;?php print displayStatus();?&gt;
&lt;h2&gt;&lt;?php echo $title;?&gt;&lt;/h2&gt;

&lt;?php
echo form_open('support/admin/enter_newcredit/');

echo &quot;\n&lt;p&gt;&lt;label for='date'&gt;Date&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'date','id'=&gt;'date','size'=&gt;40);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='point_credit'&gt;Point Credit&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'point_credit','id'=&gt;'point_credit','size'=&gt;40);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='note'&gt;Note&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'note','id'=&gt;'note');
echo form_textarea($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;\n&lt;p&gt;&lt;label for='by'&gt;By&lt;/label&gt;&lt;br/&gt;\n&quot;;
echo form_dropdown('by',$administrators) .&quot;&lt;/p&gt;\n&quot;;

echo form_hidden('id',$id);
echo form_submit('submit','Enter Credit');
echo form_close();
	?&gt;
</pre>
<h3>modules/support/views/admin/admin_support_home.php</h3>
<pre class="brush: php;">

&lt;?php print displayStatus();?&gt;
&lt;h2&gt;&lt;?php echo $title;?&gt;&lt;/h2&gt;
&lt;p&gt;
&lt;?php
echo anchor(&quot;auth/admin/members/form&quot;, &quot;Create new customer&quot;);
?&gt;
&lt;/p&gt;
&lt;?php

/*
 This is how CI display flash data. but we don't use it. 

if ($this-&gt;session-&gt;flashdata('message')){
	echo &quot;&lt;div class='status_box'&gt;&quot;.$this-&gt;session-&gt;flashdata('message').&quot;&lt;/div&gt;&quot;;
}
*/
if (count($support_customers)){
	echo &quot;&lt;table id='tablesorter' class='tablesorter' border='1' cellspacing='0' cellpadding='3' width='100%'&gt;\n&quot;;
	echo &quot;&lt;thead&gt;\n&lt;tr valign='top'&gt;\n&quot;;
	echo &quot;&lt;th&gt;ID&lt;/th&gt;\n&lt;th&gt;Company Name&lt;/th&gt;&lt;th&gt;Customer Name&lt;/th&gt;&lt;th&gt;User Name&lt;/th&gt;&lt;th&gt;Web Address&lt;/th&gt;&lt;th class='middle'&gt;Active&lt;/th&gt;&lt;th&gt;Actions&lt;/th&gt;\n&quot;;
	echo &quot;&lt;/tr&gt;\n&lt;/thead&gt;\n&lt;tbody&gt;\n&quot;;
	foreach ($support_customers as $key =&gt; $list){
		echo &quot;&lt;tr valign='top'&gt;\n&quot;;
		echo &quot;&lt;td align='center'&gt;&quot;.$list['id'].&quot;&lt;/td&gt;\n&quot;;
		echo &quot;&lt;td&gt;&lt;a href=\&quot;admin/customer_record/&quot;.$list['id'].&quot;\&quot;&gt;&quot;.$list['company_name'].&quot;&lt;/a&gt;&lt;/td&gt;\n&quot;;

		echo &quot;&lt;td&gt;&quot;.$list['full_name']. &quot;&lt;/td&gt;&quot;;
		echo &quot;&lt;td&gt;&quot;.$list['username']. &quot;&lt;/td&gt;&quot;;
		echo &quot;&lt;td&gt;&lt;a href=\&quot;&quot;.$list['web_address'].&quot;\&quot; target=\&quot;_blank\&quot;&gt;&quot;.$list['web_address'].&quot;&lt;/a&gt;&lt;/td&gt;\n&quot;;

		$active =  ($list['active']?'tick':'cross');
		echo '&lt;td class=&quot;middle&quot;&gt;'.$this-&gt;bep_assets-&gt;icon($active).&quot;&lt;/td&gt;&quot;;
		echo &quot;&lt;td&gt;&quot;;
		echo anchor('auth/admin/members/form/'.$list['id'],'edit');
		echo &quot;&lt;/td&gt;\n&quot;;
		echo &quot;&lt;/tr&gt;\n&quot;;
	}
	echo &quot;&lt;/tbody&gt;\n&lt;/table&gt;&quot;;
}
</pre>
<h3>modules/support/views/admin/admin_work_done.php</h3>
<pre class="brush: php;">

&lt;?php print displayStatus();?&gt;
&lt;h2&gt;&lt;?php echo $title;?&gt;&lt;/h2&gt;

&lt;?php
echo form_open('support/admin/enter_workdone/');

echo &quot;\n&lt;p&gt;&lt;label for='date'&gt;Date&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'date','id'=&gt;'date','size'=&gt;40);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='time'&gt;Time&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'time','id'=&gt;'time','size'=&gt;40);
echo form_input($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='note'&gt;Note&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'note','id'=&gt;'note');
echo form_textarea($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;&lt;p&gt;&lt;label for='details'&gt;Details&lt;/label&gt;&lt;br/&gt;\n&quot;;
$data = array('name'=&gt;'details','id'=&gt;'details');
echo form_textarea($data) .&quot;&lt;/p&gt;\n&quot;;

echo &quot;\n&lt;p&gt;&lt;label for='by'&gt;By&lt;/label&gt;&lt;br/&gt;\n&quot;;
echo form_dropdown('by',$administrators) .&quot;&lt;/p&gt;\n&quot;;

echo form_hidden('id',$id);
echo form_submit('submit','Enter Work Done');
echo form_close();

?&gt;
</pre>
<p>By this time you can see the Customers Admin page. However since we have not added profiles yet, we are not able to create customers.</p>
<p>In the next article we are going to add profiles.</p>


<p>Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-1/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-with-codeigniter-part-5/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application with Codeigniter Part 5'>Creating Customer Support Time Tracking Application with Codeigniter Part 5</a></li>
<li><a href='http://www.okadadesign.no/blog/uncategorized/creating-customer-support-time-tracking-application-with-codeigniter-part-3/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application Daikon with Codeigniter Part 3'>Creating Customer Support Time Tracking Application Daikon with Codeigniter Part 3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax To Do Manager Demo</title>
		<link>http://www.okadadesign.no/blog/codeigniter/ajax-to-do-manager-demo/</link>
		<comments>http://www.okadadesign.no/blog/codeigniter/ajax-to-do-manager-demo/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 17:03:02 +0000</pubDate>
		<dc:creator>shinokada</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[To Do Manager]]></category>
		<category><![CDATA[demo]]></category>

		<guid isPermaLink="false">http://www.okadadesign.no/blog/?p=2432</guid>
		<description><![CDATA[ <p></p> <p>We have added Ajax To Do Demo today. It will be reset every 30 minutes.</p> <p>You can add, move and delete &#8216;To Do List&#8217;.</p> Download page &#160; <p>Related posts:Event Calendar Demo Adding Ajax File/Image Manager to Codeigniter+BackendPro How to install Customer Support Time Manager: Daikon </p>


Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/event-calendar-demo/' rel='bookmark' title='Permanent Link: Event Calendar Demo'>Event Calendar Demo</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/adding-ajax-fileimage-manager-to-codeigniterbackendpro/' rel='bookmark' title='Permanent Link: Adding Ajax File/Image Manager to Codeigniter+BackendPro'>Adding Ajax File/Image Manager to Codeigniter+BackendPro</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/how-to-install-customer-support-time-manager-daikon/' rel='bookmark' title='Permanent Link: How to install Customer Support Time Manager: Daikon'>How to install Customer Support Time Manager: Daikon</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fcodeigniter%2Fajax-to-do-manager-demo%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fcodeigniter%2Fajax-to-do-manager-demo%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/ajaxtodo.jpg" alt="" title="ajaxtodo" width="200" height="200" class="alignleft size-full wp-image-2433" /></p>
<p>We have added <a href="http://websiteclub.skagerak.org/todo/index.php/message">Ajax To Do Demo</a> today. It will be reset every 30 minutes.</p>
<p>You can add, move and delete &#8216;To Do List&#8217;.</p>
<h4 class="download floatleft"><a href="http://www.okadadesign.no/blog/downloads/#kyuuri">Download page</a></h4>
<div class="clearboth">&nbsp;</div>


<p>Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/event-calendar-demo/' rel='bookmark' title='Permanent Link: Event Calendar Demo'>Event Calendar Demo</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/adding-ajax-fileimage-manager-to-codeigniterbackendpro/' rel='bookmark' title='Permanent Link: Adding Ajax File/Image Manager to Codeigniter+BackendPro'>Adding Ajax File/Image Manager to Codeigniter+BackendPro</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/how-to-install-customer-support-time-manager-daikon/' rel='bookmark' title='Permanent Link: How to install Customer Support Time Manager: Daikon'>How to install Customer Support Time Manager: Daikon</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.okadadesign.no/blog/codeigniter/ajax-to-do-manager-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Event Calendar Demo</title>
		<link>http://www.okadadesign.no/blog/codeigniter/event-calendar-demo/</link>
		<comments>http://www.okadadesign.no/blog/codeigniter/event-calendar-demo/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 16:17:23 +0000</pubDate>
		<dc:creator>shinokada</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[demo]]></category>

		<guid isPermaLink="false">http://www.okadadesign.no/blog/?p=2418</guid>
		<description><![CDATA[ <p>One of our popular article is about &#8216;Event Calendar&#8217; articles. This and this.</p> <p>Today we added the demo. The demo database will be reset every 30 minutes.</p> <p> </p> &#160; <p>Related posts:Ajax To Do Manager Demo Event calendar using Codeigniter and jQuery without BackendPro Event Calendar on Codeigniter update </p>


Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/ajax-to-do-manager-demo/' rel='bookmark' title='Permanent Link: Ajax To Do Manager Demo'>Ajax To Do Manager Demo</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/event-calendar-using-codeigniter-and-jquery-without-backendpro/' rel='bookmark' title='Permanent Link: Event calendar using Codeigniter and jQuery without BackendPro'>Event calendar using Codeigniter and jQuery without BackendPro</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/codeigniter-event-calendar-update/' rel='bookmark' title='Permanent Link: Event Calendar on Codeigniter update'>Event Calendar on Codeigniter update</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fcodeigniter%2Fevent-calendar-demo%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fcodeigniter%2Fevent-calendar-demo%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>One of our popular article is about &#8216;Event Calendar&#8217; articles. <a href="http://www.okadadesign.no/blog/codeigniter/codeigniter-event-calendar-update/">This</a> and <a href="http://www.okadadesign.no/blog/codeigniter/create-an-event-calendar-using-codeigniter-and-jquery/">this</a>.</p>
<p>Today <a href="http://websiteclub.skagerak.org/calendar/index.php/calendar/index">we added the demo</a>. The demo database will be reset every 30 minutes.</p>
<p>
<a href="http://websiteclub.skagerak.org/calendar/index.php/calendar/index"><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/event_cal_calendar_main_200x200.jpg" alt="" title="event_cal_calendar_main_200x200" width="200" height="200" class="alignleft size-full wp-image-2421" /></a></p>
<div class="clearboth">&nbsp;</div>


<p>Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/ajax-to-do-manager-demo/' rel='bookmark' title='Permanent Link: Ajax To Do Manager Demo'>Ajax To Do Manager Demo</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/event-calendar-using-codeigniter-and-jquery-without-backendpro/' rel='bookmark' title='Permanent Link: Event calendar using Codeigniter and jQuery without BackendPro'>Event calendar using Codeigniter and jQuery without BackendPro</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/codeigniter-event-calendar-update/' rel='bookmark' title='Permanent Link: Event Calendar on Codeigniter update'>Event Calendar on Codeigniter update</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.okadadesign.no/blog/codeigniter/event-calendar-demo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 1</title>
		<link>http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-1/</link>
		<comments>http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-1/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 08:53:19 +0000</pubDate>
		<dc:creator>shinokada</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[daikon]]></category>

		<guid isPermaLink="false">http://www.okadadesign.no/blog/?p=2141</guid>
		<description><![CDATA[ <p>This time we are going to develop a customer time tracking application with Codeigniter. This allows admin to enter tickets purchased by customers and work done for customers. Customer can see the details of support including tickets purchase, work done and its time, total remaining tickets in minutes.</p> &#160; Demo Note: Demo is [...]


Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-2/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2</a></li>
<li><a href='http://www.okadadesign.no/blog/uncategorized/creating-customer-support-time-tracking-application-with-codeigniter-part-3/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application Daikon with Codeigniter Part 3'>Creating Customer Support Time Tracking Application Daikon with Codeigniter Part 3</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/how-to-install-customer-support-time-manager-daikon/' rel='bookmark' title='Permanent Link: How to install Customer Support Time Manager: Daikon'>How to install Customer Support Time Manager: Daikon</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fcodeigniter%2Fcreating-customer-support-time-tracking-application-daikon-with-codeigniter-part-1%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.okadadesign.no%2Fblog%2Fcodeigniter%2Fcreating-customer-support-time-tracking-application-daikon-with-codeigniter-part-1%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="http://www.okadadesign.no/blog/wp-content/uploads/2010/08/daikon1.gif" alt="" title="daikon" width="200" height="200" class="alignleft size-full wp-image-2210" />This time we are going to develop a customer time tracking application with Codeigniter. This allows admin to enter tickets purchased by customers and work done for customers. Customer can see the details of support including tickets purchase, work done and its time, total remaining tickets in minutes.</p>
<div class="clearboth">&nbsp;</div>
<h4 class="download"><a href="http://websiteclub.skagerak.org/daikon/index.php/auth/login" target="_blank">Demo</a></h4>
<h4>Note: Demo is available for Customer Pages Only. </h4>
<p><u>Login details</u><br />
email 1: cus7(a)gmail.com and pw: anneanne <br /> <br />
email 2: cus2(a)gmail.com and pw: tonjetonje</p>
<h4 class="download"><a href="http://www.okadadesign.no/blog/downloads/#daikon">Download page</a></h4>
<p><span id="more-2141"></span><br />
This article is for myself. However if you are interested in developing an application with Codeigniter, reading or following these steps may help you.<br />
Note: I used to develop on Windows, but recently I am using Ubuntu/Linux. And I love it.</p>
<h2>Installing CodeIgniter</h2>
<p>Download Codeigniter, unzip, rename is as daikon and move to var/www folder. If you are using XAMPP, then in htdocs.</p>
<h2>Preparing BackendPro</h2>
<p><a href="http://www.kaydoo.co.uk/projects/backendpro">Download BackendPro</a> and unzip it to var/www/daikon folder.<br />
As we have done in <a href="http://www.okadadesign.no/blog/codeigniter/creating-a-portofolio-cms-with-codeigniter/">our Portfolio CMS</a>. we update BeP for php5.3.  </p>
<p>If you want to use BeP for PHP5.3 environment such as XAMPP 1.7.3, you need to modify BeP.</p>
<p>1. remove the &#8216;&#038;&#8217; sign from line 414 in system/application/libraries/loader.php</p>
<p>2. Change line 100 of /modules/preferences/libraries/Preference_form.php </p>
<pre class="brush: php;">
$this-&gt;field[$field]['label'] = ucwords(preg_replace('/_/',' ',$field));
</pre>
<p>3. Line 42 modules/auth/views/admin/access_control/resources.php<br />
Change to </p>
<pre class="brush: php;">
$offset = $this-&gt;access_control_model-&gt;buildPrettyOffset($obj,$tree);
</pre>
<p>3. If you are using LINUX, then you need to change chmod of BeP. Windows user ignore this.<br />
I guess the author of Bep created it with Windows. So all the directory has chmod of drwx&#8212;&#8212;.<br />
You need to change this to drwxr-xr-x by the following in shell.</p>
<pre class="brush: php;">
sudo find /var/www/daikon/ -type f -print0 | xargs -0 sudo chmod 644
sudo find /var/www/daikon/ -type d -print0 | xargs -0 sudo chmod 755
chmod -R a+w /var/www/daikon/install
chmod -R a+w /var/www/daikon/system/logs
chmod -R a+w /var/www/daikon/assets/cache
chmod -R a+w /var/www/daikon/system/cache
chmod  a+w /var/www/daikon/system/application/config/config.php
chmod  a+w /var/www/daikon/system/application/config/database.php
chmod  a+w /var/www/daikon/modules/recaptcha/config/recaptcha.php
</pre>
<p>The first line changes all files in daikon folder to 644. The second line changes all directory to 755.<br />
install directory need to be writeable for installation which coming to next.</p>
<h2>Installing BeP on Codeigniter</h2>
<p>Go to http://localhost/daikon/install and enter necessary information.<br />
Use this website to create an encryption key. <a href="http://www.ideaspace.net/misc/hash/" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','www.ideaspace.net']);">http://www.ideaspace.net/misc/hash/</a>.<br />
Keep all the field of System Folder, Application Folder, Modules Folder, Log Folder and Cache folder as they are.<br />
Since we are not using Recaptcha in this app, leave it blank.<br />
After a successful installation, delete the /install directory.</p>
<p>Open application/config.php and check your $config['base_url'].</p>
<pre class="brush: php;">
$config['base_url']= &quot;http://localhost/daikon/&quot;;
</pre>
<p>By now you should be able to login to the backend. Login page is <a href="http://localhost/daikon/index.php/auth/login">http://localhost/daikon/index.php/auth/login</a></p>
<p>Use your login email and password which you input during the installation.</p>
<p>Now you need to change file permission of config.php, database.php and recaptcha.php.</p>
<pre class="brush: php;">
chmod /var/www/daikon/system/application/config/config.php 644
chmod  /var/www/daikon/system/application/config/database.php 644
chmod  /var/www/daikon/modules/recaptcha/config/recaptcha.php 644
</pre>
<p>or with two lines like this.</p>
<pre class="brush: php;">
sudo find /var/www/daikon/system/application/config -type f -print0 | xargs -0 sudo chmod 644
chmod  /var/www/daikon/modules/recaptcha/config/recaptcha.php 644
</pre>
<h2>Adding autoload files</h2>
<p>Modify system/application/config/autoload.php and set up autoload files.</p>
<pre class="brush: php;">

$autoload['libraries'] = array('form_validation','validation');

$autoload['helper'] = array('form','security','language');

$autoload['language'] = array('customer');
</pre>
<h2>Creating customer.php</h2>
<p>We are going add system/application/language/english/customer_lang.php</p>
<pre class="brush: php;">
&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/* Strings used on Customer Support page */
$lang['customer_support_admin'] = 'Customer Admin';
$lang['customer_customers_admin'] = 'Customers Admin';
$lang['customer_customer_record'] = 'Customer Record';
$lang['customer_purchase_support'] = 'Purchase Support';

$lang['customer_support'] = 'Customer Support';
$lang['customer_customers'] = 'Customers';
$lang['customer_record'] = 'Support Details';
$lang['customer_support_record'] = 'Customer Support Records';

/* For breadcrumb */
$lang['customer_support_admin'] = 'Customer Support Admin';
$lang['customer_support_admin_create'] = 'Create Customer';
$lang['customer_support_admin_edit'] = 'Edit Customer';
$lang['customer_support_customer'] = 'Customer Support Details';
$lang['customer_support_record'] = 'Customer Record';
$lang['customer_enter_credit'] = 'Enter Credits';
$lang['customer_work_done'] = 'Work Done';
$lang['customer_edit_record'] = 'Edit Record';
</pre>
<p> We are going to use it in our modules later.</p>
<h2>Creating Support_Controller.php</h2>
<p>We will create different menus for members.<br />
I have two reasons. 1. it will make it simpler for members without other menus. 2. We don&#8217;t want to show admin links.</p>
<p>In order to do that we are going to create system/application/libraries/Support_controller.php. We will extend this in modules/customersupport/controllers/admin/admin.php. Please copy and paste it.</p>
<pre class="brush: php;">
&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Support_Controller
 *
 * Extends the Site_Controller class so I can declare special Support Admin controllers
 *
 */
class Support_Controller extends Site_Controller
{
	function Support_Controller()
	{
		parent::Site_Controller();

		// Set base crumb
		$this-&gt;bep_site-&gt;set_crumb('Support Home','customersupport/admin');

		// Set container variable
               // here we set which container to use so that it will be different from admin container.
		$this-&gt;_container = $this-&gt;config-&gt;item('backendpro_template_support') . &quot;container.php&quot;;

		// Set Pop container variable
		$this-&gt;_popup_container = $this-&gt;config-&gt;item('backendpro_template_support') . &quot;popup.php&quot;;

		// Make sure user is logged in
		// check('Control Panel');

		// Check to see if the install path still exists
		if( is_dir('install'))
		{
			flashMsg('warning',$this-&gt;lang-&gt;line('backendpro_remove_install'));
		}

		// Set private meta tags
		//$this-&gt;bep_site-&gt;set_metatag('name','content',TRUE/FALSE);
		$this-&gt;bep_site-&gt;set_metatag('robots','nofollow, noindex');
		$this-&gt;bep_site-&gt;set_metatag('pragma','nocache',TRUE);

		// Load the ADMIN asset group
		$this-&gt;bep_assets-&gt;load_asset_group('ADMIN');

		log_message('debug','BackendPro : Admin_Controller class loaded');
	}
}

/* End of Admin_controller.php */
/* Location: ./system/application/libraries/Admin_controller.php */
</pre>
<p>We will extend this in a future article.</p>
<h2>Adding Support_Controller.php to MY_Controller.php</h2>
<p>Since we extended Site_Controller. We need to register in MY_Controller.php so that we can use it. Site_Controller&#8217;s file name is actually MY_Controller.php.<br />
So we need to add the following line to the end of system/application/libraries/MY_Controller.php </p>
<pre class="brush: php;">
include_once(&quot;Support_controller.php&quot;);
</pre>
<h2>Modifying BeP</h2>
<p>We are going to modify system/application/controllers/admin/settings.php. The reason is that we need to check the permission of &#8216;Settings&#8217;, otherwise member can see the Setting pages and the member can change the Settings. We don&#8217;t want it to happen. Even though we are not showing the link to members, we need to avoid this.</p>
<pre class="brush: php;">

class Settings extends Admin_Controller
{
	function Settings()
	{
		parent::Admin_Controller();

		$this-&gt;lang-&gt;module_load('preferences','preferences');

		// Check for access permission
		check('Settings');

		log_message('debug','BackendPro : Settings class loaded');
	}
</pre>
<h2>Creating Permissions for Member</h2>
<p>Login to the backend and go to system > Access Control > Permissions.<br />
Click &#8216;Create Permissions&#8217;, and select &#8216;Members&#8217; under Groups, &#8216;Settings&#8217; under Resources and &#8216;Deny&#8217; under Access at the bottom, then save.</p>
<p>We are going to create more Resources and Permissions in future article.</p>
<h2>CSS change</h2>
<p>We modify line 16 in assets/css/forms.css for a bigger form area.</p>
<pre class="brush: css;">
form input.text, form textarea {/* width: 20em;*/ }
</pre>
<h2>Adding method to Bep members.php</h2>
<p>Modify following functions in modules/auth/controllers/admin/members.php and add function _pull_profile_details().</p>
<p>We are going to use the method in our module later.</p>
<pre class="brush: php;">

function _set_profile_defaults()
	{
		$this-&gt;validation-&gt;set_default_value('company_name','Company Name');
		$this-&gt;validation-&gt;set_default_value('full_name','Full Name');
		$this-&gt;validation-&gt;set_default_value('web_address','Web Address');
		$this-&gt;validation-&gt;set_default_value('phone_number','Phone Number');
		$this-&gt;validation-&gt;set_default_value('address','Address');
		$this-&gt;validation-&gt;set_default_value('city','City');
		$this-&gt;validation-&gt;set_default_value('post_code','Post Code');

	}
...
...
function _get_profile_details()
	{
		$data = array();
		$data['company_name'] = $this-&gt;input-&gt;post('company_name');
		$data['full_name'] = $this-&gt;input-&gt;post('full_name');
		$data['web_address'] = $this-&gt;input-&gt;post('web_address');
		$data['phone_number'] = $this-&gt;input-&gt;post('phone_number');
		$data['address'] = $this-&gt;input-&gt;post('address');
		$data['city'] = $this-&gt;input-&gt;post('city');
		$data['post_code'] = $this-&gt;input-&gt;post('post_code');
		return $data;
	}

...
...

function _pull_profile_details($id){

		$query=$this-&gt;user_model-&gt;fetch('UserProfiles','*','',array('user_id'=&gt;$id));
		$row = $query-&gt;row_array();
		return $row;
	}

...
...
// Construct Groups dropdown
			$this-&gt;load-&gt;model('access_control_model');
			$data['groups'] = $this-&gt;access_control_model-&gt;buildAClDropdown('group','id');
// after the above line, add the following lines.
// get profile details
			$data['profiles']= $this-&gt;_pull_profile_details($id);
</pre>
<h2>Adding icons</h2>
<p>You can <a href="http://www.famfamfam.com/lab/icons/silk/" target="_blank">download icons from here</a> and add user_green.png and user_orange.png icons in assets/icons</p>
<p>Now we are finished the basic preparation. We proceed to creating admin area in the next article.</p>


<p>Related posts:<ol><li><a href='http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-2/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2'>Creating Customer Support Time Tracking Application &#8216;Daikon&#8217; with Codeigniter Part 2</a></li>
<li><a href='http://www.okadadesign.no/blog/uncategorized/creating-customer-support-time-tracking-application-with-codeigniter-part-3/' rel='bookmark' title='Permanent Link: Creating Customer Support Time Tracking Application Daikon with Codeigniter Part 3'>Creating Customer Support Time Tracking Application Daikon with Codeigniter Part 3</a></li>
<li><a href='http://www.okadadesign.no/blog/codeigniter/how-to-install-customer-support-time-manager-daikon/' rel='bookmark' title='Permanent Link: How to install Customer Support Time Manager: Daikon'>How to install Customer Support Time Manager: Daikon</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.okadadesign.no/blog/codeigniter/creating-customer-support-time-tracking-application-daikon-with-codeigniter-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
