Receptionist / Inquiry Management system in Codeigniter.

dms

Receptionist / Inquiry Management system in Codeigniter.

 

A receptionist is an operator who has to take calls, enter record than make calls to all those. Some companies have more than one computer operator as receptionist. They have to mention their names who took the call or added the name of client or inquiry in the table or sheet on which they keep record.

For Starting this application we will first create the database for this application. We need two tables, users and clients. We will store credentials of users who will login to this application in users table and will store record of inquiries in clients table.

Creating Database

First of all we create a database. I leave the choice of local testing server on you. I am using WAMP you can choose whatever you feel comfortable.

db1

Alright in the above image you can see my phpmyadmin in which I have created a database by the name of dms and have created two tables in it users and clients. Following are their structure

Codeigniter

E-Office system in Codeigniter

You can see the field names, data types and their length value. You can choose to change them at your will it’s up to you.

Installing Codeigniter

Now is the time to setup our working environment. We require a Codeigniter installation along with bootstrap for a little styling and page layout. So I have downloaded and uncompressed codeigniter from its website. Created three folders css, js and img respectively. Following is my folder structure

ci

The .idea folder on the top of the list is because I work in PHPStorm. The applicaton, system and user_guide folders are basic codeigniter folders and the rest is bootstrap folder structure. Now experience Codeigniter developers, after installing the framework set the environment first but we are not going to do that as it can confuse you. So I will go to some basic configurations. The initial configurations are all made from the config folder in the application folder. We will stay in the application folder for rest of our development except for bootstrap folders. Alright the first thing we need to do is to go to the config folder and open the autoload.php in our editor

ci2

Watch closely, in your autoload file when you open it first time the array index libraries and helpers would be empty. I have changed it and have autoloaded some libraries and helpers. Now to use session library I have to provide an encryption key which is in config.php. Let’s open that

E-Office in PHP Codeigniter

You can see I have updated the security key. You can put any kind of crap here, Make it complex make it dirty that’s all up to you.

The next thing which is very important is to remove index.php from the url which codeigniter uses by default and we can do it by create an .htaccess file and putting the following it. The .htaccess file is created on root

 

 

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

 

Now there is only one last entry you need to change and that is in routes.php which is default controller at the end of the file. But we have to create a controller first

What is a Controller? You need to learn about MVC or google it.

Because it is a very small application so I have created only one controller, but in normal practice there is a different controller for every entity or module like search, items, products, pages, blog and admin. I have created only Admin Controller, Following is my Admin Controller Code.

<?php
/**
* Created by PhpStorm.
* User: Mudassar
* Date: 3/1/2016
* Time: 2:53 PM
*/

class Admin extends CI_Controller {
function __construct(){
parent::__construct();
$this->load->model(‘admin_model’);
$this->load->library(‘form_validation’);

}

public function index()
{
if(empty($this->session->userdata[‘id’])){
redirect(base_url().‘admin/signin’);

}
if($_POST)
{
$config=array(
array(
‘field’ => ‘fullname’,
‘label’ => ‘Full Name’,
‘rules’ => ‘trim|required’
),
array(
‘field’ => ‘username’,
‘label’ => ‘User Name’,
‘rules’ => ‘trim|required’
),
array(
‘field’ => ‘password’,
‘label’ => ‘Password’,
‘rules’ => ‘trim|required’
)
);
$this->form_validation->set_rules($config);
if($this->form_validation->run()==FALSE){
$data[‘errors’]=validation_errors();
$data[‘title’]=‘Admin Panel’;
$data[‘users’]=$this->admin_model->getUsers();
$this->load->view(‘static/head’,$data);
$this->load->view(‘static/header’);
$this->load->view(‘content/add_user’);
}
else
{
$this->admin_model->addUser($_POST);
$data[‘title’]=‘Admin Panel’;
$data[‘success’]=‘User Added’;
$data[‘users’]=$this->admin_model->getUsers();
$this->load->view(‘static/head’,$data);
$this->load->view(‘static/header’);
$this->load->view(‘content/add_user’);
}
}
else
{
$data[‘users’]=$this->admin_model->getUsers();
$data[‘title’]=‘Admin Panel’;
$this->load->view(‘static/head’,$data);
$this->load->view(‘static/header’);
$this->load->view(‘content/add_user’);
}

}
public function add_clients()
{
if(empty($this->session->userdata[‘id’])){
redirect(base_url().‘admin/signin’);
}
if($_POST)
{
$st=$this->admin_model->add_client($_POST);
if($st)
{
redirect(base_url().‘admin/clients’);
}
}
else
{
//

$data[‘title’]=‘Admin Panel’;
$data[‘users’]=$this->admin_model->getUsers();
$this->load->view(‘static/head’,$data);
$this->load->view(‘static/header’);
$this->load->view(‘content/add_client’,$data);
}

}

public function clients()
{
if(empty($this->session->userdata[‘id’])){
redirect(base_url().‘admin/signin’);

}
$data[‘clients’]=$this->admin_model->getClients();
$data[‘title’]=‘Admin Panel’;
$this->load->view(‘static/head’,$data);
$this->load->view(‘static/header’);
$this->load->view(‘content/clients’);
}

public function signin()
{
if($_POST){
$config=array(
array(
‘field’ => ‘username’,
‘label’ => ‘Username’,
‘rules’ => ‘trim|required’
),
array(
‘field’ => ‘password’,
‘label’ => ‘Password’,
‘rules’ => ‘trim|required’
)
);
$this->form_validation->set_rules($config);
if($this->form_validation->run()==FALSE){
$data[‘errors’]=validation_errors();
$data[‘title’]=‘Admin Panel’;
$this->load->view(‘static/head’,$data);
$this->load->view(‘content/login’);
}
else {
$user=$this->admin_model->checkUser($_POST);
if(!empty($user))
{
$this->session->set_userdata($user);
redirect(base_url().‘admin’);
}
else
{
$data[‘errors’]=‘Sorry, Incorrect Credentials or User does not exist’;
$data[‘title’]=‘Admin Panel’;
$this->load->view(‘static/head’,$data);
$this->load->view(‘content/login’);
}
}
}
else
{
$data[‘title’]=‘Admin Panel’;
$this->load->view(‘static/head’,$data);
$this->load->view(‘content/login’);
}
}

public function call_clients()
{
if(empty($this->session->userdata[‘id’])){
redirect(base_url().‘admin/signin’);

}
$data[‘clients’]=$this->admin_model->getAllClients();
$data[‘title’]=‘Admin Panel’;
$this->load->view(‘static/head’,$data);
$this->load->view(‘static/header’);
$this->load->view(‘content/call_clients’);
}
public function edit_client()
{
if(empty($this->session->userdata[‘id’])){
redirect(base_url().‘admin/signin’);

}
$clientId=$this->uri->segment(3);
if($_POST)
{
$st=$this->admin_model->update_client($_POST,$clientId);
if($st)
{
redirect(base_url().‘admin/clients’);
}
}
else
{
$data[‘client’]=$this->admin_model->getClientById($clientId);
$data[‘users’]=$this->admin_model->getUsers();
$data[‘title’]=‘Admin Panel’;
$this->load->view(‘static/head’,$data);
$this->load->view(‘static/header’);
$this->load->view(‘content/edit_client’);
}
}

public function client_detail()
{
if(empty($this->session->userdata[‘id’])){
redirect(base_url().‘admin/signin’);

}
$clientId=$this->uri->segment(3);
$data[‘client’]=$this->admin_model->getClientById($clientId);

$data[‘title’]=‘Admin Panel’;
$this->load->view(‘static/head’,$data);
$this->load->view(‘static/header’);
$this->load->view(‘content/client_details’);
}

public function client_called(){
$clientId=$this->uri->segment(3);
$this->admin_model->markClientCalled($clientId);
redirect($_SERVER[‘HTTP_REFERER’]);
}

public function logout()
{
$this->session->sess_destroy();
redirect(base_url());
}
}

 

Of course I didn’t write all this crap in the beginning, it was all step by step I created the login page, and login function, then I wrote the admin_model and its functions to screw with database and then perform rest of functions. Following is my admin model

<?php
/**
* Created by PhpStorm.
* User: Mudassar
* Date: 3/2/2016
* Time: 9:35 AM
*/

class Admin_model extends CI_Model {
function __construct() {
parent::__construct();
}

public function getUsers(){
$st=$this->db->query(‘select * from users’);
return $st->result_array();
}

public function addUser($data)
{
$user=array(
‘name’     => $data[‘fullname’],
‘username’ => $data[‘username’],
‘password’ => md5($data[‘password’])
);
$this->db->insert(‘users’,$user);
return true;
}
public function checkUser($data)
{
$st=$this->db->select(‘*’)->from(‘users’)->WHERE(‘username’,$data[‘username’])->WHERE(‘password’,md5($data[‘password’]))->get();
$data=$st->result_array();
return $data[0];

}

public function getUserById($userId){
$st=$this->db->select(‘*’)->from(‘users’)->where(‘users.id’,$userId)->get();
$data=$st->result_array();
return $data[0];
}

public function delUser($userId){
$this->db->query(‘delete from users where users.id=’.$userId);
return true;
}

public function add_client($data){
$client=array(
‘name’                 =>$data[‘name’],
‘industry’             =>$data[‘industry’],
‘website’               =>$data[‘website’],
‘phone’                 =>$data[‘phone’],
‘location’             =>$data[‘location’],
‘address’               =>$data[‘address’],
‘client_need’           =>$data[‘client_need’],
‘proposed_solution’     =>$data[‘proposed_solution’],
‘collaboration_prospect’=>$data[‘collaboration_prospect’],
‘remarks’               =>$data[‘remarks’],
‘contact_person’       =>$data[‘contact_person’],
‘assigned_to’           =>$data[‘assigned_to’],
‘added_by’             =>$this->session->userdata[‘id’]
);
$this->db->insert(‘clients’,$client);
return true;
}
public function update_client($data,$clientId){
$client=array(
‘name’                 =>$data[‘name’],
‘industry’             =>$data[‘industry’],
‘website’               =>$data[‘website’],
‘phone’                 =>$data[‘phone’],
‘location’             =>$data[‘location’],
‘address’               =>$data[‘address’],
‘client_need’           =>$data[‘client_need’],
‘proposed_solution’     =>$data[‘proposed_solution’],
‘collaboration_prospect’=>$data[‘collaboration_prospect’],
‘remarks’               =>$data[‘remarks’],
‘contact_person’       =>$data[‘contact_person’],
‘assigned_to’           =>$data[‘assigned_to’]
);

$this->db->WHERE(‘clients.id’,$clientId)->update(‘clients’,$client);
return true;
}

public function getClients()
{
$st=$this->db->query(‘SELECT clients.id, clients.name, clients.industry, clients.phone, clients.date, users.name as added_by
from clients
inner join users on users.id=clients.added_by’
);
return $st->result_array();
}
public function getAllClients()
{
$st=$this->db->query(‘SELECT * from clients ‘);
return $st->result_array();
}

public function markClientCalled($clientId)
{
$this->db->query(‘Update clients SET call_made=1, last_call_date=CURDATE() WHERE clients.id=’.$clientId);
return true;
}

public function getClientById($clientId){
$st=$this->db->query(‘SELECT clients.*, users.username as assigned_to, u.username as added_by from clients
inner join users on users.id=clients.assigned_to
inner join users u on u.id=clients.added_by
WHERE clients.id=’
.$clientId);
$data=$st->result_array();
return $data[0];
}

}

 

Now that we have the controller and the model we have to create the views. I have two folders in the view static and content I have placed head.php and header.php in static and rest of all views in content. The head.php contains links to css and js. The header.php has the navigation in it. Following is the head.php

You can see the folder structure of my view folder and the files in it. The code in them are as follow

Head.php

<?php
/**
* Created by PhpStorm.
* User: Mudassar
* Date: 3/2/2016
* Time: 10:22 AM
*/
?>
<html>

<head>
<link rel=“stylesheet” type=“text/css” href=<?php echo base_url()?>css/bootstrap.min.css”>
<script src=<?php echo base_url()?>js/bootstrap.min.js”></script>
<title><?php echo $title;?></title>
</head>

 

Header.php

 
<div class=“container”>
<div >
<div class=“col-md-12” style=background: url(<?php echo base_url()?>img/header-receptionist.jpg’); height: 200px; ></div>
</div>
<div class=“clearfix”></div>
<div >
<ul class=nav nav-pills “>
<li role=“presentation” class=“active”><a href=<?php echo base_url()?>admin”>Home</a> </li>
<li role=“presentation”><a href=<?php echo base_url()?>admin/clients”>Clients</a> </li>
<li role=“presentation”><a href=<?php echo base_url()?>admin/add_clients”>Add Clients</a> </li>
<li role=“presentation”><a href=<?php echo base_url()?>admin/call_clients”>Call Clients</a> </li>
<li role=“presentation”><a href=<?php echo base_url()?>admin/logout”>Logout</a> </li>
</ul>
</div>
<div class=“clearfix”></div>

</div>

 

Content/login.php

<?php
/**
* Created by PhpStorm.
* User: Mudassar
* Date: 3/2/2016
* Time: 12:11 PM
*/
?>
<div class=“container”>
<div class=“col-md-4”></div>
<div class=“col-md-4” >
<h2>Login Here</h2>
<?php
if
(isset($errors)){
?>
<div class=“alert alert-danger fade in”>
<a href=“#” class=“close” data-dismiss=“alert”>&times;</a>
<strong>Error!</strong> <?php echo ($errors);?>
</div>
<?php }?>
<form action=“” method=“post”>
<table class=“table” style=background-color: #C3C6CF>
<tr>
<td>
<input type=“text” name=“username” placeholder=“Username” class=“form-control”/>
</td>
</tr>
<tr>
<td>
<input type=“password” name=“password” placeholder=“********” class=“form-control”/>
</td>
</tr>
<tr>
<td>
<button type=“submit” class=“btn btn-danger btn-success”>LOGIN</button>
</td>
</tr>
</table>
</form>
</div>
</div>

 

Content/add_client.php

<?php
/**
* Created by PhpStorm.
* User: Mudassar
* Date: 3/2/2016
* Time: 10:26 AM
*/
?>
<div class=“container”>
<div class=“col-md-12”>
<h3>Add Client</h3>

</div>
<div class=“clearfix”>

</div>
<div class=“col-md-6”>
<?php
if
(isset($errors)){
?>
<div class=“alert alert-danger fade in”>
<a href=“#” class=“close” data-dismiss=“alert”>&times;</a>
<strong>Error!</strong> <?php echo ($errors);?>
</div>
<?php }?>
<form action=“” method=“post”>
<table class=“table table-responsive table-bordered table-striped table-hover”>
<tr>
<td>Name</td>
<td>
<input type=“text” class=“form-control” name=“name” required=“required” />
</td>
</tr>
<tr>
<td>Industry</td>
<td>
<input type=“text” class=“form-control” name=“industry” required=“required” />
</td>
</tr>
<tr>
<td>Website</td>
<td>
<input type=“text” class=“form-control” name=“website” required=“required” />
</td>
</tr>
<tr>
<td>Phone</td>
<td>
<input type=“text” class=“form-control” name=“phone” required=“required” />
</td>
</tr>
<tr>
<td>Location</td>
<td>
<input type=“text” class=“form-control” name=“location” required=“required” />
</td>
</tr>
<tr>
<td>Address</td>
<td>
<textarea name=“address” rows=“2” class=“form-control” required=“required”></textarea>
</td>
</tr>
<tr>
<td>Client Needs</td>
<td>
<textarea name=“client_need” rows=“2” class=“form-control” required></textarea>
</td>
</tr>
<tr>
<td>Proposed Solution</td>
<td>
<textarea name=“proposed_solution” rows=“2” class=“form-control” required></textarea>
</td>
</tr>
<tr>
<td>Collaboration Prospects</td>
<td>
<textarea name=“collaboration_prospect” rows=“2” class=“form-control” required></textarea>
</td>
</tr>
<tr>
<td>Remarks</td>
<td>
<textarea name=“remarks” rows=“2” class=“form-control” required></textarea>
</td>
</tr>
<tr>
<td>Contact Person</td>
<td>
<input type=“text” class=“form-control” name=“contact_person” required=“required” />
</td>
</tr>
<tr>
<td>Assigned to</td>
<td>
<select name=“assigned_to” class=“form-control” required>
<option value=“”>Assign User</option>
<?php
for
($i=0;$i<count($users);$i++){
?>
<option value=<?php echo $users[$i][‘id’]?>><?php echo $users[$i][‘name’]?></option>
<?php }?>
</select>
</td>
</tr>

</table>
<button type=“submit” class=“btn btn-success”>ADD CLIENT</button>
<a href=<?php echo base_url()?>class=“btn btn-danger”>CANCEL</a>
</form>
</div>

</div>

 

Content/add_user.php

<?php
/**
* Created by PhpStorm.
* User: Mudassar
* Date: 3/2/2016
* Time: 10:26 AM
*/
?>
<div class=“container”>
<div class=“col-md-12”>
<h3>Add User</h3>

</div>
<div class=“clearfix”>

</div>
<div class=“col-md-5”>
<?php
if
(isset($errors)){
?>
<div class=“alert alert-danger fade in”>
<a href=“#” class=“close” data-dismiss=“alert”>&times;</a>
<strong>Error!</strong> <?php echo ($errors);?>
</div>
<?php }?>
<form action=“” method=“post”>
<input type=“text” class=“form-control” name=“fullname” placeholder=“Full Name”><br>
<input type=“text” class=“form-control” name=“username” placeholder=“Username”><br>
<input type=“password” class=“form-control” name=“password” placeholder=“********”><br>
<button type=“submit” class=“btn btn-block btn-primary”>ADD USER</button>
<a href=<?php echo base_url()?>class=“btn btn-block btn-danger”>CANCEL</a>
</form>
</div>
<div class=“col-md-7”>
<table class=table ta”>
<tr style=background-color: #C3C6CF>
<td>User</td>
<td>Username</td>
<td>
Action
</td>
</tr>
<?php
for
($i=0;$i<count($users);$i++)
{?>
<tr>
<td><?php echo $users[$i][‘name’]?></td>
<td><?php echo $users[$i][‘username’]?></td>
<td>
<a href=“” class=“glyphicon glyphicon-edit” data=“Edit” title=“Edit”></a> |
<a style=color: red;href=“” class=“glyphicon glyphicon-remove-circle” data=“Delete” title=“Delete”> </a>
</td>
</tr>
<?php
}?>
</table>
</div>
</div>

 

Content/call_client.php

<?php
/**
* Created by PhpStorm.
* User: Mudassar
* Date: 3/2/2016
* Time: 11:58 AM
*/

?>
<div class=“container”>

<table class=“table”>
<tr style=background-color: #9cacc2; color:#fff>
<td>Name</td>
<td>Industry</td>
<td>Phone</td>
<td>Added Date</td>
<td>Action</td>
</tr>
<?php
for
($i=0;$i<count($clients);$i++) {
?>
<tr >
<td><?php echo $clients[$i][‘name’]?></td>
<td><?php echo $clients[$i][‘industry’]?></td>
<td><?php echo $clients[$i][‘phone’]?></td>
<td><?php echo date(‘jS F, Y’,strtotime($clients[$i][‘date’]))?></td>
<td>
<?php
if
($clients[$i][‘call_made’]==0) {
?>
<a href=<?php echo base_url().‘admin/client_called/’.$clients[$i][‘id’]?>class=“btn btn-xs btn-success”>Call Client</a>
<?php
}else {
?>
Called on <?php echo date(‘jS F, Y’,strtotime($clients[$i][‘last_call_date’])) ?>
<a href=<?php echo base_url().‘admin/client_called/’.$clients[$i][‘id’]?>class=“btn btn-xs btn-danger”>Call Again</a>
<?php
}
?>
</td>
</tr>
<?php
}
?>
</table>

</div>

 

Content/client_details.php

<?php
/**
* Created by PhpStorm.
* User: Mudassar
* Date: 3/3/2016
* Time: 10:23 AM
*/

?>
<div class=“container”>
<div style=background-color: #005580; color: #fff; text-transform: uppercase; height: 90px; padding: 10px;>
<h3><?php echo $client[‘name’]?></h3>
</div>

<table class=“table table-striped table-hover”>
<tr>
<td>Industry</td>
<td>
<?php echo $client[‘industry’]?>
</td>
</tr>
<tr>
<td>Website</td>
<td>
<?php echo $client[‘website’]?>
</td>
</tr>
<tr>
<td>Phone</td>
<td>
<?php echo $client[‘phone’]?>
</td>
</tr>
<tr>
<td>Date Added</td>
<td>
<?php echo $client[‘date’]?>
</td>
</tr>
<tr>
<td>Location </td>
<td>
<?php echo $client[‘location’]?>
</td>
</tr>
<tr>
<td>Address</td>
<td>
<?php echo $client[‘address’]?>
</td>
</tr>
<tr>
<td>Client Needs</td>
<td>
<?php echo $client[‘client_need’]?>
</td>
</tr>
<tr>
<td>Proposed Solution</td>
<td>
<?php echo $client[‘proposed_solution’]?>
</td>
</tr>
<tr>
<td>Collaboration Prospect</td>
<td>
<?php echo $client[‘collaboration_prospect’]?>
</td>
</tr>
<tr>
<td>Call Made</td>
<td>
<?php if($client[‘call_made’]==0){
echo ‘No’;
}else{
echo ‘Yes’;
}?>
</td>
</tr>
<tr>
<td>Last Called on</td>
<td>
<?php if($client[‘call_made’]==0){
echo ‘Not Called Yet’;
}else{
echo $client[‘last_call_date’];
}?>
</td>
</tr>
<tr>
<td>Remarks</td>
<td>
<?php echo $client[‘remarks’]?>
</td>
</tr>
<tr>
<td>Contact Person</td>
<td>
<?php echo $client[‘contact_person’]?>
</td>
</tr>
<tr>
<td>Assigned to</td>
<td>
<?php echo $client[‘assigned_to’]?>
</td>
</tr>
<tr>
<td>Added By</td>
<td>
<?php echo $client[‘added_by’]?>
</td>
</tr>

</table>
</div>

 

Content / clients.php

<?php
/**
* Created by PhpStorm.
* User: Mudassar
* Date: 3/2/2016
* Time: 11:58 AM
*/

?>
<div class=“container”>

<table class=“table”>
<tr style=background-color: #9cacc2; color:#fff>
<td>Name</td>
<td>Industry</td>
<td>Phone</td>
<td>Added Date</td>
<td>Added By</td>
<td>Action</td>
</tr>
<?php
for
($i=0;$i<count($clients);$i++) {
?>
<tr >
<td><?php echo $clients[$i][‘name’]?></td>
<td><?php echo $clients[$i][‘industry’]?></td>
<td><?php echo $clients[$i][‘phone’]?></td>
<td><?php echo date(‘jS F, Y’,strtotime($clients[$i][‘date’]))?></td>
<td><?php echo $clients[$i][‘added_by’]?></td>
<td>
<a href=<?php echo base_url().‘admin/client_detail/’.$clients[$i][‘id’].‘/’.implode(‘-‘,explode(‘ ‘,$clients[$i][‘name’]))?>>View</a> //
<a href=<?php echo base_url().‘admin/edit_client/’.$clients[$i][‘id’].‘/’.implode(‘-‘,explode(‘ ‘,$clients[$i][‘name’]))?>>Edit</a> //
<a href=“” >Delete</a>
</td>
</tr>
<?php
}
?>
</table>

</div>

 

Content/edit_client.php

<?php
/**
* Created by PhpStorm.
* User: Mudassar
* Date: 3/2/2016
* Time: 10:26 AM
*/

?>
<div class=“container”>
<div class=“col-md-12”>
<h3>Edit Client</h3>

</div>
<div class=“clearfix”>

</div>
<div class=“col-md-6”>
<?php
if
(isset($errors)){
?>
<div class=“alert alert-danger fade in”>
<a href=“#” class=“close” data-dismiss=“alert”>&times;</a>
<strong>Error!</strong> <?php echo ($errors);?>
</div>
<?php }?>
<form action=“” method=“post”>
<table class=“table table-responsive table-bordered table-striped table-hover”>
<tr>
<td>Name</td>
<td>
<input type=“text” class=“form-control” name=“name” required=“required” value=<?php echo $client[‘name’]?>/>
</td>
</tr>
<tr>
<td>Industry</td>
<td>
<input type=“text” class=“form-control” name=“industry” required=“required” value=<?php echo $client[‘industry’]?>/>
</td>
</tr>
<tr>
<td>Website</td>
<td>
<input type=“text” class=“form-control” name=“website” required=“required” value=<?php echo $client[‘website’]?>/>
</td>
</tr>
<tr>
<td>Phone</td>
<td>
<input type=“text” class=“form-control” name=“phone” value=<?php echo $client[‘phone’]?>required=“required” />
</td>
</tr>
<tr>
<td>Location</td>
<td>
<input type=“text” class=“form-control” name=“location” value=<?php echo $client[‘location’]?>required=“required” />
</td>
</tr>
<tr>
<td>Address</td>
<td>
<textarea name=“address” rows=“2” class=“form-control” value=“” required=“required”><?php echo $client[‘address’]?></textarea>
</td>
</tr>
<tr>
<td>Client Needs</td>
<td>
<textarea name=“client_need” rows=“2” class=“form-control” value=“” required><?php echo $client[‘client_need’]?></textarea>
</td>
</tr>
<tr>
<td>Proposed Solution</td>
<td>
<textarea name=“proposed_solution” rows=“2” class=“form-control” value=“” required><?php echo $client[‘proposed_solution’]?></textarea>
</td>
</tr>
<tr>
<td>Collaboration Prospects</td>
<td>
<textarea name=“collaboration_prospect” rows=“2” class=“form-control” required value=“”><?php echo $client[‘collaboration_prospect’]?></textarea>
</td>
</tr>
<tr>
<td>Remarks</td>
<td>
<textarea name=“remarks” rows=“2” class=“form-control” required><?php echo $client[‘remarks’]?></textarea>
</td>
</tr>
<tr>
<td>Contact Person</td>
<td>
<input type=“text” class=“form-control” name=“contact_person” value=<?php echo $client[‘contact_person’]?>required=“required” />
</td>
</tr>
<tr>
<td>Assigned to</td>
<td>
<select name=“assigned_to” class=“form-control” required>
<option value=“”>Assign User</option>
<?php
for
($i=0;$i<count($users);$i++){
?>
<option <?php
if
($users[$i][‘name’]==$client[‘assigned_to’]){
echo ‘selected’;
}
?> value=<?php echo $users[$i][‘id’]?>><?php echo $users[$i][‘name’]?></option>
<?php }?>
</select>
</td>
</tr>

</table>
<button type=“submit” class=“btn btn-primary>UPDATE CLIENT</button>
<a href=<?php echo base_url()?>class=“btn btn-danger”>CANCEL</a>
</form>
</div>

</div>

 

Alright Folks! Your basic application is complete, you can copy paste all the code in your codeigniter, if you get stuck call me on skype malik_cozmuler or mail me malikmudassar@gmail.com . The only stunt here is that if you have empty database you can’t login because to login you require username and password, I can give you a solution, create an empty database and in your SQL editor paste the following

 

 

CREATE TABLE IF NOT EXISTS `clients` (

`id` int(10) NOT NULL AUTO_INCREMENT,

`name` varchar(55) NOT NULL,

`industry` varchar(100) NOT NULL,

`website` varchar(100) NOT NULL,

`phone` varchar(18) NOT NULL,

`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,

`location` varchar(150) NOT NULL,

`address` varchar(250) NOT NULL,

`client_need` text NOT NULL,

`proposed_solution` text NOT NULL,

`collaboration_prospect` text NOT NULL,

`call_made` int(1) NOT NULL,

`last_call_date` date NOT NULL,

`remarks` text NOT NULL,

`contact_person` varchar(50) NOT NULL,

`assigned_to` int(11) NOT NULL,

`added_by` int(3) NOT NULL,

PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

 

— Dumping data for table `clients`

 

INSERT INTO `clients` (`id`, `name`, `industry`, `website`, `phone`, `date`, `location`, `address`, `client_need`, `proposed_solution`, `collaboration_prospect`, `call_made`, `last_call_date`, `remarks`, `contact_person`, `assigned_to`, `added_by`) VALUES

(1, ‘Ali Raza Shah’, ‘Information Technology’, ‘www.getrishta.com’, ‘54654654’, ‘2016-03-02 09:57:54’, ‘islamabad, pakistan’, ‘Blue Area’, ‘Website’, ‘Web Portal’, ‘somethign’, 1, ‘2016-03-03’, ‘something’, ‘ali paracha’, 1, 2),

(2, ‘mudassar’, ‘IT’, ‘website’, ‘564654654’, ‘2016-03-02 11:36:47’, ‘Sargodah’, ‘Pakistan’, ‘proposal’, ‘not probided’, ‘not yet decided’, 1, ‘2016-03-02’, ‘asdlfjasdkfj’, ‘mudassar’, 2, 1);

 

— ——————————————————–

 

— Table structure for table `users`

 

CREATE TABLE IF NOT EXISTS `users` (

`id` int(3) NOT NULL AUTO_INCREMENT,

`name` varchar(50) NOT NULL,

`username` varchar(50) NOT NULL,

`password` varchar(128) NOT NULL,

`status` int(1) NOT NULL,

PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

 

— Dumping data for table `users`

 

INSERT INTO `users` (`id`, `name`, `username`, `password`, `status`) VALUES

(1, ‘Malik Mudassar’, ‘malikmudassar’, ‘a7777999e260290f68a1455cacdabf6c’, 0),

(2, ‘Nouman’, ‘nouman’, ‘a7777999e260290f68a1455cacdabf6c’, 0);

 

Alright, this will give you basic two tables and will dump some data in it you can login by username malikmudassar and password Muhammad rest you can add as many users you can

 

Best of Luck Folks

 

Types of Wireless Services

Broadcast

One of the first Radio Service and has been used widely across the globe for decades prior to the invention of cellular telephony. Following are the properties which differs wireless broadcasts from cellular telephony;

  • The transmission is uni-directional, sent from the station towards users.
  • The transmission information is same for all users
  • The information is transmitted continuously
  • In many cases, many transmitters transmit the same information at one time.

Examples are pay-TV or Pay-per-view services.

Paging

Similar like Broadcast service, the paging works unidirectional as well but unlike Radio broadcast there are some limitations. Following are the points regarding paging;

  • The user can only receive the message and cannot reply to this message.
  • The message is mostly initiated by call center, intended to and received by only single user.
  • The amount of transmitted information is very small mostly in bits.

Examples are notifications from call centers to subscribers about receiving a text message or an image file or an audio file from any link or call number.

Cellular Telephony

This is the most widely used wireless service so far and has been used for past decade with a persistent increase in subscription rate. Following are the properties of this service

  • The transmission of information is bi-directional
  • The user can initiate a session by calling or receiving a call from other user.
  • The information transmitted is only between the users who are in active session.

Examples are mobile services

 

Siemens BTS BS240

Siemens BTS BS240

Trunking Radio System

An independent radio system which is not connected to the PSTN or any other public network mostly intended for designated purposes and designated individuals only. This kind of network is limited to the circle of its transmission. Most widely used by Government departments like Fire Brigade, Police, Emergency and Rescue etc. Following are the properties of this system;

  • Group Calls – Conference Calls
  • Call Priorities – Set priorities to calls like low, medium and high so the switch can drop low priority call against a high priority in case of emergency
  • Relay Networks – The range can be extended by relaying the call to other BS and MS
Alcatel Microwave IDU

Alcatel Microwave IDU

Cordless Telephony

The handset is directly connected to BS (Base set) with a wireless link which is further connected to PSTN. Following are the properties of this telephony

  • The Base set doesn’t need to have any network functionality
  • There is no central system, as the call doesn’t need to find the location of the user.
  • There is no fees for the wireless link with the Base Set

Cordless systems have now evolved into wireless private branch exchanges wPABX.

Wireless LANs

Also known as Wi-Fi networks allow up to 11Mbits/s data rate and 802.11a standard extended this data rate up to 55Mbit/s

Personal Area Networks (PAN)

PANs are created for very smaller distances mostly less than a meter using blue tooth or body sensors.

Fixed Wireless Access (FWA)

Derived from Cordless or WLANs . Following are the properties of FWA

  • There is no mobility of user device
  • The BS must always serves multiple users over longer distances

Adhoc Networks

Created over smaller distances without the use of any infrastructure with similar devices mostly laptops or mobiles. The advantage is that it is handy in emergency and is very fast to create. The disadvantage however, is the decreased performance.

Requirements for the Services

  1. Data Rate
  2. Range and number of users
  3. Mobility
  4. Energy Consumption
  5. Use of Spectrum
  6. Direction of transmission
  7. Service quality

Installing Android ADT SDK: Fixing JAVA_HOME Variable Issue

Android Studio ADT

Hi Folks!

I am teaching some students of University of Sargodha, they are in their 7th semester next will be their last. They are taking Android Development course in this semester and Unfortunately there is huge communication gap between their teacher and the students and most of the students complained that the behavior and teaching style of the teacher is so awkward and hilarious that 80% of the class is still not able to install Android Studio on their laptops. Imagine you have taken almost entire course and you still haven’t installed your programming editor, how do you think you can pass the finals. Anyway I personally thank that teacher, because of this attitude of his I had to research a little and I learned the bug fix. So for all of those students and newbies in Android development if you are installing Android Studio and having the JAVA_HOME Environment Variable issue then here is what I suggest you should do;

Android Studio ADT

Step-1

Download Android Studio ADT

Android Studio is a new Android development environment based on IntelliJ IDEA. Similar to Eclipse with the ADT Plugin, Android Studio provides integrated Android developer tools for development and debugging. It can be downloaded from here

Step-2

Installing Android Studio ADT

The file you have downloaded will be something like this android-studio-bundle-132.883541-windows.exe where the numeric in the name is the version of the file. It can vary from time to time as the team keeps upgrading the utility. Remember before installing Android Studio Bundle download and install latest JDK

Download JDK from here

Once JDK is installed then proceed to installing Android Studio. It is not a rocket science just run the installer file and then it will be just a next-next wizard. Once Android Studio Bundle is installed run it from the shortcut it created in your programs

If it gives you this error : Cannot load JVM DLL C:\Program files\Java\Jdk(version)\Jre where version is the one you installed on your machine then don’t panic. The operating system couldn’t find a mean to run the Java Virtual Machine on your machine. You need to download a patch from Microsoft Which is Microsoft Visual C++ 2010 Redistributable Package

Once you have downloaded the Visual C++ 2010 Redistributable Package you can now restart your machine and run  the Android Studio. This time it will load the IntelliJIDEA Editor and you can start programming

Android ADT with IntelliJ

This will be your first hello world app.

Android for Beginners

 

I hope you’d have learned something useful from this post. Let me know if you have any questions in installation of Android Studio on any version of windows.

 

 

 

Isohunt.com shuts down due to Piracy Charges from Californian Court

I was shocked when I opened isohunt.com a while ago to download a software crack which was one of my favorite hobby to do whenever I needed a crack of some software which I couldn’t find for free on the internet.

Isohunt.com shuts down

When I saw news on BBC that Isohunt.com shut down and fined $110 million and the owner has decided to shutdown the project. I started wondering why and how is this possible. The owner of the isohunt.com had earned more than this amount from this website from last 10.5 years and when I see alexa ranking of isohunt.com which has been less than 300 for a pretty long period and when I estimate the earnings this site was making from Ads and affiliates, Gary Fung was easily able to pay the fine and keep the site running. But seriously who was responsible for this site to end up like this.

isohunt.com shuts down due to piracy charges

Tell you what I hauled into details and narrowed down my search results and Guess where the pointer narrowed to? Me, myself, I was the one who was always looking for pirated stuff, cracks and hacks of software, and pretty much anything which is out there in the market with a lot of price which the manufacturer of that product deserves to be paid and I am stealing that right from them.

isohunt.com shuts down due to piracy charges

Just like me, there are millions of other people on the internet who have been using isohunt.com and piratebay services for the same reason I did, which resulted in shutting down this site or a huge online business I am not sure what Gary Fung has now in my mind but there was a huge crowd and a huge community connected together via isohunt.com and for them this news was a sudden shock just like I had a while ago.

Gary Fung said in his posting on his page, that during this journey he had met a lot of skilled people and this journey had changed his life forever, I too wanted to confess to Gary Fung that all of us have met a lot of skilled people in our lives but Gary Fung’s effort in form of isohunt.com was priceless.

The level of knowledge and data sharing which was possible through isohunt.com could never have been possible through any other torrent community. We are sorry for your loss Gary Fung. I wish we could have stop ourselves a bit earlier to use your website for pirate materials so this incident could never had happened.

Good Bye Isohunt.com