Codeigniter

Codeigniter

Easy and Best Framework of PHP
Write

Recent Post's in Profession

How to start successful rental startup like airbnb
Airbnb has become a popular vacation rental platform to bring great travelling experience. This extremely popular vacation rental space has become a true community with enormous options for business people & Global travelers. The success story of airbnb and its journey makes the most for establishing a profitable startup business in vacation rental. Here I have shared the vacation rental business trends and business opportunities within the industry to build business like airbnb.


Organize your knowledge in developing Airbnb like website & app and important features. Make segments of your work and explore each individually

·         Global travelling trends

·         Airbnb market share & business competitors

·         Overall Airbnb like web & app cost factors

Global traveling trends


Bleisure

Business people used to add more independent time to business trips

New experiences

Common formats become less popular whereas unusual destinations and experiences are emerging. Nearly 70 % of travelers are implementing this.

Worldwide airbnb course

·         192 countries 57000 cities airbnb are active in

·         60 million registered active users

·         500000 guests stay per night in Airbnb

·         More than 700000 hosts

·         2 million listings

·         Estimated revenue around $ 900 million

·         People traveled about 10 billion miles to airbnb destination

Airbnb Competitors

The game changing vacation rental platform becomes immensely  popular and airbnb appears to be not the only platform for listing and booking accommodations globally.

Major players in market are

·         Home Away

With over 1 million global listing, it has the same range of services and operates on more regional sites in niche VRBO

·         Flipkey

Largest company owned by TripAdvisor has lot of users and highest quality rates because of manual verification program by website employees.

Airbnb like Web & app pricing factors & features

There are some important factors which influence the cost to create and develop web & app like airbnb. Diverse modes of crafting it will project on airbnb app development cost.

Major aspects

Size of development team

If you are skilled person in web & app development you can administer whole process with minimum team size. Otherwise, consult with expert development team to build a successful vacation rental script like airbnb. Types of platforms and devices app are being built for IOS, Android. You should consider this beforehand based on target audience location, preferred device and more.

Technical complexity of features

You should decide what range of elements you want within your mobile application and rate them from simple to medium and high complexity. Pricing to develop web & app purely depends on how long it takes developers to implement each of these

Design

Custom V/s Standard

If you prefer some unique visuals and tools instead of one’s based on pre built sets, it will change price even more. Moving to specific features, it’s important to mention rough time to cover all stages of creating feature.

Must have features

• Advanced filters

• Responsive Design

• Properties Management

ʉۢ Google Map Integration

• Currency Converter

• Single/Multiple Payment Gateways

• Multi-lingual Support

• Calendar Settings

• Enhanced Admin Dashboard

• Site Info Settings

ʉۢ Featured Properties

• Social Sharing

• Email Notification Alert

ʉۢ Plug-in friendly

Setting framework

·         This feature allows users customize and configure all personal data and preference as

·         Update notifications via email notifications

·         Wish lists

     Payment gateways

Do you want to start vacation rental business like airbnb in above mentioned list and facing challenges in developing software? Consult with experts today.With all such speculation, HomestayDNN airbnb clone script  gives perfect opportunity to startup entrepreneurs to start their business in vacation rentals.

How to start a profitable online dating business?
With a hectic marketplace, if you are considering to start an online dating business, you’ll need a clear and practical revenue model. In addition, due to the apparent sensitive nature of dating, great importance must be placed on a specialized and clear product. However, if you’ve felt you’ve got a proposal that could take the current dating world reach new heights, there’re a number of opportunities to create a successful and profitable online dating business. Here are our simple steps to begin your love with online dating now:-
Finding a hot marketplace
One of the most vital elements in any flourishing business is recognizing your target marketplace. With a wide range of well-known market leaders, it’s amazingly significant that you offer an exclusive service that sets you distant from competitors. Creating a site for particular tastes is an excellent means of setting up a target audience and finding a place in the hot marketplace. 
Build a friendly environment
In spite of the dating fondness of your site’s visitors, it’s vital to keep in mind its members are all real persons with sentiments and passions. While no doubt an individual’s profile will demonstrate them in a convinced light, many might be uneasy as first-time users or individuals upset from the preceding terrible experiences. Create a friendly, easy to use environment that makes online dating an enjoyable experience. 
Entice your customers
No one wishes for joining a dating site that has very few individuals. Thus, you’ll want to begin a strong promotion campaign and offer added incentives to sign up first members. Request all of your single buddies and associates to join the site, and, if your site layout is subscription-based; propose discounted memberships to the initial several hundred individuals who sign up. Just the once your site turns out to be popular, you’ll be able to support it more profitably through targeted promotion methods. 
Maintain quality control
No, that doesn’t signify kicking out the unattractive people. Online dating sites must be ready to deal with sexual harassment and other forms of online mistreatment, in addition to confidentiality concerns. Set up an arrangement that permits users to flag others for shocking behavior, and withdraw the alliance rights of abusers. Certainly, you can’t manage what people do after they come to a decision to go out on a date, so work with an attorney to make an alliance contract that will let go you of any responsibility for the actual-world outcomes of your online matchmaking.
Importance of software
Understanding the importance of software is supreme to the success of any online dating business. In reality, the building of app will most likely need support from an experienced developer and you may also need to contract out core functions to a reliable company like 
Smitiv.Co, one of the leading mobile app development companies, based in Singapore.
Simply because you begin as a free dating website doesn't indicate you have to continue that way. If you are in a position with very modest competition, you can easily begin to get profit from the online dating site.Tinder Clone Script
How to start a profitable online dating business?
With a hectic marketplace, if you are considering to start an online dating business, you’ll need a clear and practical revenue model. In addition, due to the apparent sensitive nature of dating, great importance must be placed on a specialized and clear product. However, if you’ve felt you’ve got a proposal that could take the current dating world reach new heights, there’re a number of opportunities to create a successful and profitable online dating business. Here are our simple steps to begin your love with online dating now:-
Finding a hot marketplace
One of the most vital elements in any flourishing business is recognizing your target marketplace. With a wide range of well-known market leaders, it’s amazingly significant that you offer an exclusive service that sets you distant from competitors. Creating a site for particular tastes is an excellent means of setting up a target audience and finding a place in the hot marketplace. 
Build a friendly environment
In spite of the dating fondness of your site’s visitors, it’s vital to keep in mind its members are all real persons with sentiments and passions. While no doubt an individual’s profile will demonstrate them in a convinced light, many might be uneasy as first-time users or individuals upset from the preceding terrible experiences. Create a friendly, easy to use environment that makes online dating an enjoyable experience. 
Entice your customers
No one wishes for joining a dating site that has very few individuals. Thus, you’ll want to begin a strong promotion campaign and offer added incentives to sign up first members. Request all of your single buddies and associates to join the site, and, if your site layout is subscription-based; propose discounted memberships to the initial several hundred individuals who sign up. Just the once your site turns out to be popular, you’ll be able to support it more profitably through targeted promotion methods. 
Maintain quality control
No, that doesn’t signify kicking out the unattractive people. Online dating sites must be ready to deal with sexual harassment and other forms of online mistreatment, in addition to confidentiality concerns. Set up an arrangement that permits users to flag others for shocking behavior, and withdraw the alliance rights of abusers. Certainly, you can’t manage what people do after they come to a decision to go out on a date, so work with an attorney to make an alliance contract that will let go you of any responsibility for the actual-world outcomes of your online matchmaking.
Importance of software
Understanding the importance of software is supreme to the success of any online dating business. In reality, the building of app will most likely need support from an experienced developer and you may also need to contract out core functions to a reliable company like 
Smitiv.Co, one of the leading mobile app development companies, based in Singapore.
Simply because you begin as a free dating website doesn't indicate you have to continue that way. If you are in a position with very modest competition, you can easily begin to get profit from the online dating site.Tinder Clone Script
How to start a profitable online dating business?
With a hectic marketplace, if you are considering to start an online dating business, you’ll need a clear and practical revenue model. In addition, due to the apparent sensitive nature of dating, great importance must be placed on a specialized and clear product. However, if you’ve felt you’ve got a proposal that could take the current dating world reach new heights, there’re a number of opportunities to create a successful and profitable online dating business. Here are our simple steps to begin your love with online dating now:-
Finding a hot marketplace
One of the most vital elements in any flourishing business is recognizing your target marketplace. With a wide range of well-known market leaders, it’s amazingly significant that you offer an exclusive service that sets you distant from competitors. Creating a site for particular tastes is an excellent means of setting up a target audience and finding a place in the hot marketplace. 
Build a friendly environment
In spite of the dating fondness of your site’s visitors, it’s vital to keep in mind its members are all real persons with sentiments and passions. While no doubt an individual’s profile will demonstrate them in a convinced light, many might be uneasy as first-time users or individuals upset from the preceding terrible experiences. Create a friendly, easy to use environment that makes online dating an enjoyable experience. 
Entice your customers
No one wishes for joining a dating site that has very few individuals. Thus, you’ll want to begin a strong promotion campaign and offer added incentives to sign up first members. Request all of your single buddies and associates to join the site, and, if your site layout is subscription-based; propose discounted memberships to the initial several hundred individuals who sign up. Just the once your site turns out to be popular, you’ll be able to support it more profitably through targeted promotion methods. 
Maintain quality control
No, that doesn’t signify kicking out the unattractive people. Online dating sites must be ready to deal with sexual harassment and other forms of online mistreatment, in addition to confidentiality concerns. Set up an arrangement that permits users to flag others for shocking behavior, and withdraw the alliance rights of abusers. Certainly, you can’t manage what people do after they come to a decision to go out on a date, so work with an attorney to make an alliance contract that will let go you of any responsibility for the actual-world outcomes of your online matchmaking.
Importance of software
Understanding the importance of software is supreme to the success of any online dating business. In reality, the building of app will most likely need support from an experienced developer and you may also need to contract out core functions to a reliable company like 
Smitiv.Co, one of the leading mobile app development companies, based in Singapore.
Simply because you begin as a free dating website doesn't indicate you have to continue that way. If you are in a position with very modest competition, you can easily begin to get profit from the online dating site.Tinder Clone Script
Javascript sort array of object
Follow the below code for sort array of objects in java-script

Code Sample: 

<!doctype html>
<head></head>
<body>
<script>
var arr_objects = [   
    {
        name: 'Devil',       
        age: 36
    },
    {
       name: 'Prashad',       
        age: 20
    },
    {            
       name: 'Rajendra',       
        age: 26
    },    
    {
      name: 'Allu',       
       age: 30
    }
];

var names = arr_objects.slice(0);
names.sort(function(a,b) {
    var x = a.name.toLowerCase();
    var y = b.name.toLowerCase();
    return x < y ? -1 : x > y ? 1 : 0;
});
console.log("Sorted array of objects:");
console.log(names);
</script>
</body>
</html>	
Sorted array result: 






Export data from mysql to csv file using php codeigniter
This tutorial is shows how to export data into csv file using codeigniter. Below are the step by step implementation to download mysql data into csv file.



This tutorial uses employee table :
employee mysql table:
CREATE TABLE IF NOT EXISTS `employee` (
  `id` int(11) NOT NULL,
  `first_name` varchar(50) NOT NULL,
  `last_name` varchar(50) NOT NULL,
  `email` varchar(100) NOT NULL,
  `age` int(11) NOT NULL,
  `status` enum('A','D') NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

Table structure and data looks like :

Employee Details View 

<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Employee Listing</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
        <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    </head>
    <body>
        <form name="export_data" id="export_data" method="post" action="<?php echo base_url("employee/export_csv"); ?>">
            <div class="container">
                <h2>Employee Listing</h2>
                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <th>Id</th>
                            <th>First Name</th>
                            <th>Last Name</th>                        
                            <th>Email</th>
                            <th>Age</th>
                            <th>Status</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        if (isset($employee_details) && !empty($employee_details)) {
                            foreach ($employee_details as $employee) {
                                ?>
                                <tr>
                                    <td><?php echo $employee->id; ?></td>
                                    <td><?php echo $employee->first_name; ?></td>
                                    <td><?php echo $employee->last_name; ?></td>
                                    <td><?php echo $employee->email; ?></td>
                                    <td><?php echo $employee->age; ?></td>
                                    <td><?php
                                        if ($employee->status == "A")
                                            echo "Active";
                                        else
                                            "Inactive";
                                        ?></td>
                                </tr>
                                <?php
                            }
                        }
                        ?>
                    </tbody>
                </table>
                <button class="btn btn-primary pull-right">Export</button>
            </div>
        </form>
    </body>
</html>



This view displays the employee details in table format.

Employee Controller: 

<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Employee extends CI_Controller {

    public $page_data;

    public function __construct() {
        parent::__construct();
        $this->load->model('employee_m');
    }

    public function listing() {
        $this->page_data['employee_details'] = $this->employee_m->get();
        $this->load->view('display_employee', $this->page_data);
    }

    public function export_csv() {
        $this->load->helper('csv');
        $export_arr = array();
        $employee_details = $this->employee_m->get();
        $title = array("Id", "First Name", "Last Name", "Email", "Age", "Status");
        array_push($export_arr, $title);
        if (!empty($employee_details)) {
            foreach ($employee_details as $employee) {
                $status = $employee->status == "A" ? "Active" : "Inactive";
                array_push($export_arr, array($employee->id, $employee->first_name, $employee->last_name, $employee->email, $employee->age, $status));
            }
        }
        convert_to_csv($export_arr, 'employee' . date('F d Y') . '.csv', ',');
    }

}

This controller has two methods: 1] listing method is used to fetch data from mysql table and display it on browser. 2] export_csv function is used to export the data into csv. After clicking on export button this function gets executed. For exporting data, here csv helper is used.

Employee_m model:

<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Employee_m extends CI_Model {

    public function get() {
        $sql = "SELECT * FROM employee";
        $q = $this->db->query($sql);
        if ($q->num_rows() > 0) {
            foreach ($q->result() as $row) {
                $data[] = $row;
            }
            return $data;
        }
    }

}

This model is used for getting employee data from mysql table and passes that data to the controller.

CSV Helper :

<?php

defined('BASEPATH') OR exit('No direct script access allowed');


if (!function_exists('convert_to_csv')) {

    function convert_to_csv($input_array, $output_file_name, $delimiter) {
        /** open raw memory as file, no need for temp files */
        $temp_memory = fopen('php://memory', 'w');
        /** loop through array */
        foreach ($input_array as $line) {
            /** default php csv handler * */
            fputcsv($temp_memory, $line, $delimiter);
        }
        /** rewrind the "file" with the csv lines * */
        fseek($temp_memory, 0);
        /** modify header to be downloadable csv file * */
        header('Content-Type: application/csv');
        header('Content-Disposition: attachement; filename="' . $output_file_name . '";');
        /** Send file to browser for download */
        fpassthru($temp_memory);
    }

}


This is the final output you see in csv file.

This tutorial may be helpful for you:)
Upload file, image using curl in codeigniter with ajax call
This is tutorial regarding upload image on third party server using curl in codeigniter php framework also used ajax call to upload.
View file code looks like :
<form name="file_upload_form" id="file_upload_form" method="post" action="" enctype="multipart/form-data" onsubmit="return false;">
<input type="file" name="file_upload" id="file_upload" class="file-input" />
<input type="submit" name="file" id="file_save" value="Upload File"> 
</form>
Jquery code :

$(document).on("click", "file_save", function () {
    formData = new FormData(document.forms.namedItem("file_upload_form"));
    $.ajax({
        url: base_url + '/user/upload_file',
        type: 'POST',
        data: formData,
        cache: false,
        contentType: false,
        processData: false,
        dataType: 'json',
        success: function (data) {
            if (data.Result == "Success") {
                console.log("File uploaded successfully");
            } else {
                console.log("Server problem try again");
            }

        }
    });
});
User Controller code:
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class User extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->library('uploadFiles');
    }

    public function upload_file() {
        $file = $_FILES['file'];
        $data = array('apikey' => 'key',
            'mode' => 'document_photo',
            'file' => new CurlFile($file['tmp_name']));
        $output = $this->uploadFiles->upload_userdata($data);
        echo json_encode(array("Result" => "Success", "msg" => $output));
    }

}

?>
Create Library for CURL call this lib contains reusable code
 uploadFiles.php lib code:
<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class uploadFiles {

    private $CI_instance;  // CI Instance created
    private $curl_base_url; //This is curl base url where you store your images[Server path]

    public function __construct() {

        $this->CI_instance = & get_instance();
        $this->curl_base_url = $this->CI_instance->config->item('curl_base_url'); //Actual path is stored in config/config.php file
    }

    public function upload_userdata($data, $url = "your server file name") {
        $content = $data;
        $url = $this->curl_base_url . $url;
        $curl_handle = curl_init();
        curl_setopt($curl_handle, CURLOPT_URL, $url);
        curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array("Content-Type:multipart/form-data"));
        curl_setopt($curl_handle, CURLOPT_POST, 1);
        curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $content);
        curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);
        $output = curl_exec($curl_handle);
        $status = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);
        if ($status != 200) {
            die("Error: call to URL $url failed with status $status, curl_error " . curl_error($curl_handle) . ", curl_errno " . curl_errno($curl_handle));
        }
        curl_close($curl_handle);
        return json_decode($output);
    }

}
and this works perfectly :), this might be helpful for you , Thank you :)
×