Date Posted : 21/12/2018 How to install docker-compose in Centos -7.6 Docker is a most handy DevOps tool used nowadays. In this post we are gonna explain about docker-composer installation steps. Prerequisites We assume that Docker is already installed on your server. For instance, you can verify the docker version… Continue Reading How to install docker-compose in Centos -7.6

Testimonial using Bootstrap Date:14/12/2018 What is a Testimonial? Testimonials are written or recorded statements that support your credibility and level of expertise. They also strengthen your reputation by expressing the trust that other people have in you and your business offerings. They are a wonderful tool that helps you to… Continue Reading Testimonial using bootstrap

Date Posted : 10-12-2018

What is Dompdf?

Dompdf  is a HTML to PDF converter. It is a great library and can create a PDF from HTML markup and CSS styles (it’s mostly CSS 2.1 compliant and has support for some CSS3 properties).

Step 1: Initially, download the fresh version of Codeigniter 3 and configure it in xampp.

Step 2: Create the file   name called “ Pdf.php ” . Place this file inside the application/libraries/ and copy the following code.

<?php defined('BASEPATH') OR exit('No direct script access allowed');
	require_once(dirname(__FILE__) . '/dompdf/dompdf_config.inc.php');
	class Pdf extends DOMPDF
	{
		/**
		 * Get an instance of CodeIgniter
		 *
		 * @access	protected
		 * @return	void
		 */
		protected function ci()
		{
			return get_instance();
		}
		/**
		 * Load a CodeIgniter view into domPDF
		 *
		 * @access	public
		 * @param	string	$view The view to load
		 * @param	array	$data The view data
		 * @return	void
		 */
		public function load_view($view, $data = array())
		{
			$html = $this->ci()->load->view($view, $data, TRUE);
			$this->load_html($html);
		}
	}

Step 3: Dompdf: we have to download dompdf library from GitHub, So let’s download from here : Click Here to download dompdf. After download extract it to your “application/libraries” folder and rename it to “dompdf”.

Step 4: In this step, we will add one route “mypdf” for demo, that way when we run this route we will download pdf file, So let’s add following route on your routes.php file.

application/config/routes.php

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


$route['default_controller'] = 'welcome';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;
$route['mypdf'] = "welcome/mypdf";

Step 5: In this step we require to add “mypdf” method on welcome controller, So let’s add with following code. you have to just copy of welcome.php controller file:

application/controllers/Welcome.php

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


class Welcome extends CI_Controller {


  /**
    * Get All Data from this method.
    *
    * @return Response
   */
   public function index()
   {
	$this->load->view('welcome_message');
   }


   /**
    * Get Download PDF File
    *
    * @return Response
   */
   function mypdf(){


	$this->load->library('pdf');


  	$this->pdf->load_view('mypdf');
  	$this->pdf->render();


  	$this->pdf->stream("welcome.pdf");
   }
}

Step 6: Adding View File

Now at last step we require to create “mypdf.php” view file for generate pdf file. So now as below i created “mypdf.php” with some html code, so you have to copy below code and create on view folder:

application/views/mypdf.php

<!DOCTYPE html>
<html>
<head>
	<title>Codeigniter 3 - Generate PDF from view using dompdf library with example</title>
</head>
<body>


<h1>Codeigniter 3 - Generate PDF from view using dompdf library with example</h1>
<table style="border:1px solid red;width:100%;">
	<tr>
		<th style="border:1px solid red">Id</th>
		<th style="border:1px solid red">Name</th>
		<th style="border:1px solid red">Email</th>
	</tr>
	<tr>
		<td style="border:1px solid red">1</td>
		<td style="border:1px solid red">Hardik</td>
		<td style="border:1px solid red">user@email.com</td>
	</tr>
	<tr>
		<td style="border:1px solid red">2</td>
		<td style="border:1px solid red">Paresh</td>
		<td style="border:1px solid red">user@email.com</td>
	</tr>
</table>


</body>
</html>

Ok, now we are ready to run our PDF generator example. So let’s run below command on your root directory for quick run:

http://localhost/mypdf

PHP Script for CRUD Application Date :06/12/2018 What is CRUD? CRUD refers to the four basic types of Database operations: Create, Read, Update, Delete. Most applications and projects perform  CRUD functionality. This is a important script for all PHP beginners. Once you learn about these CRUD operations, you can use them… Continue Reading PHP Script for CRUD Application

Convert XML to Json format and store in Database using Python Date posted:23 /11 / 2018 Introduction: In this article, it is applicable to convert only a very small Xml file format  in to Json  format. The converted Json format will be inserted in to a  existing database in Mysql. … Continue Reading Convert xml to Json format and store in DB using Python

CCAvenue CCNon-Seamless PG Integration Date Posted: 22 Nov 2018 Prerequisite  :PHP Basics SEAMLESS INTEGRATION This is for Large Scale Product and organisations who have good finance team to jolt down the financials with the Banks for the DIRECT integrations and with PG Aggregators for the INDIRECT integrations and a good Dev team… Continue Reading CCAvenue CCNon-Seamless PG Integration

How Class of Bootstrap 4 differ from Bootstrap 3 Date posted:16-11-2018 Introduction: Basically, many  classes  used in Bootstrap 3, not used  in Bootstrap 4 and some class used in both the version; But, the new class ruling Bootstrap 4 which is replacing a old component of  Bootstrap 3. Like this, here… Continue Reading How Class of Bootstrap 4 differ from Bootstrap 3

How to Install Apache on macOS via Homebrew Date Posted : 25-Oct-2018 Installation steps as follows, Loginas root user or super user to perform this task, Step 1 – Install Apache on macOS Remove built-in Apache server (if any) from your system. Open a terminal and execute commands to stop… Continue Reading How to Install Apache on macOS via Homebrew

How to Install Redis cache server in centos 7. Date Posted: 02 -09-2018 Redis is an in-memory data structure store, used as a database server, cache, and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps and streams. It also provides… Continue Reading How to Install Redis cache server in centos 7.

How to migrate CPanel Account manually from backend Posted on : 03-11-2018 In this article, we are going to see about the efficient and fastest method to transfer WHM accounts from one server to another and restoring the same in new server. Assumption : If we need to migrate all… Continue Reading How to migrate CPanel Account manually from backend