Jump to content

How to get WHMCS Projects on the Client Area Home


webjive

Recommended Posts

Hey gang, just wanted to pass this code along that we scrounged up to show active WHMCS projects on the client area home page. Insert this code wherever you want it to show in the clientareahome.php file in the template directory your using.

 

P.S. Don't have time to support this so, use as you want and customize to your liking :)

 

			<!-- show projects -->
		{php}
		$userid = $this->_tpl_vars['clientsdetails']['id'];
		$result = mysql_query("SELECT *, mod_project.id as projectid FROM mod_project WHERE userid =$userid");
		$projects = array();
		while ($data = mysql_fetch_array($result)) {
		 array_push($projects, $data);
		}
		$this->_tpl_vars['projects'] = $projects;
		{/php}

		<div class="table_title">
	    <h3>Active Projects</h3><strong style="color: red;">View project details</strong>
		</div>

		<table class="table table-striped table-framed table-centered no-more-tables">
		<thead>
		        <tr>
		            <th>{$LANG.projecttitle}</th>
		            <th>{$LANG.projectcreated}</th>
		            <th>{$LANG.projectdue}</th>
		            <th>{$LANG.projectstatus}</th>
		            <th>{$LANG.projectmodified}</th>
		            <th> </th>
		        </tr>

		</thead>
		<tbody>
		{foreach from=$projects item=project}
		<tr>
		<td>{$project.title}</td>
		<td>{$project.created|date_format:"%m/%d/%Y"}</td>
		<td>{$project.duedate|date_format:"%m/%d/%Y"}</td>
		<td>{$project.status}</td>
		<td>{$project.lastmodified|date_format:"%m/%d/%Y"}</td>
		<td class="textcenter">
			<form method="post" action="index.php?m=project_management&a=view&id={$project.projectid}">
				<input type="submit" value="{$LANG.clientareaviewdetails}" class="btn info" />
			</form>
		</td>
		</tr>{foreachelse}
		<tr>
		<td colspan="6" class="textcenter">{$LANG.norecordsfound}</td>
		</tr>
		{/foreach}
		</tbody>
		</table>
		<!-- end show projects -->	

Link to comment
Share on other sites

P.S. Forgot to add this.. In your languages directory/overrides, create an english.php file (if there isn't one already) and put this in there.

 

<?php
$_LANG['projecttitle'] = "Title";
$_LANG['projectcreated'] = "Created";
$_LANG['projectdue'] = "Due";
$_LANG['projectstatus'] = "Status";
$_LANG['projectmodified'] = "Last Modified";
?>

Link to comment
Share on other sites

  • 1 month later...

So happy to find this, thanks a lot for sharing :)

 

The table appears fine, but the "View Details" button doesn't do anything. Should I customize the path? Is it supposed to show each project when I click on it? <form method="post" action="index.php?m=project_management&a=view&id={$project.projectid}">

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated