Saturday, 19 September 2015

Ordering table list on database using Codeigniter

How to ordering table list on database using Codeigniter

Step 1 : First create order table in database.

step 2 : In model folder just copy and paste the below code.
 public function view_order()  
      {  
           $this->db->select('*');  
           $this->db->from('list');  
           $this->db->where('removed','0');  
           return $this->db->count_all_results();  
      }  

Step 3 : you just copy and paste the code on controller folder at any page.

Insert data with image to Database using Codeigniter

How to Insert data with image to Database using Codeigniter

First of all we will create form on PHP page That placed in View Folder
 <form method="post" action="<?php echo site_path?>add/add_project" enctype="multipart/form-data" class="form col-lg-12 col-md-12 col-sm-12 col-sx-12">  
                                    <input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" id="csrf_token" value="<?php echo $this->security->get_csrf_hash(); ?>"/>  
                                         <div class="col-lg-12">  
                                              <div class="col-lg-2 text-left lable"><label for="title">Title</label></div>  
                                              <input type="text" placeholder="Name" class="text col-lg-6" name="title" id="title"/>  
                                              </div>  
                                              <div class="col-lg-12">  
                                              <div class="col-lg-2 text-left lable"><label for="title">Descrption</label></div>  
                                              <textarea placeholder="Description" class="text col-lg-6" rows="6" name="desc" id="title"></textarea>  
                                              </div>  
                                              <div class="col-lg-12">  
                                              <div class="col-lg-2 text-left lable"><label for="image">Image</label></div>  
                                              <input type="file" placeholder="Image" name="image" class="col-lg-6 text"/>  
                                              </div>  
                                              <div class="col-lg-6 pull-right">  
                                              <input type="submit" placeholder="Image" class="submit col-lg-5 pull-left" value="Submit"/>  
                                              </div>  
                                              <div class="col-lg-6 pull-right">  

Friday, 18 September 2015

Fix the Menubar using Jquery

How to Fix the Menubar using Jquery

 <script type="text/javascript">  
 $(document).ready(function(){  
  var nav = $('.hemo');  
  var nav1 = $('.hemo1');  
  var logo = $('.logo');  
  var logo1 = $('.logo1');  
      $(window).scroll(function () {  
           if ($(this).scrollTop() > 200) {  
                $('.fixed').css('position','fixed');  
                $('.fixed').css('top','50px');  
           } else {  
                $('.fixed').css('position','relative');  
           $('.fixed').css('top','0px');  
           }  
      });  
      });  
 </script>  

Menu Bar

Translate effect for box using CSS

How to give Translate effect for box using CSS

 .box {  
  transform: translate(20px, 10px);  
 }  

 transform: translateX(value);  
 transform: translateY(value);  

Values

translate(): moves an element sideways or up and down.

Rotate the box in css

How to Rotate the box in css

 .box {  
  transform: rotate(25deg);  
 }  

Values


rotate(): rotates the element clockwise from its current position.

Make the design with Skew in CSS

How to make the design with Skew in CSS

 .element {  
  transform: skewX(25deg);  
 }  
 .element {  
  transform: skewY(25deg);  
 }  

Values

skewX() and skewY(): tilts an element to the left or right, like turning a triangle into a parallelogram. There is no shorthand skew property.

Use scale in CSS

How to use scale in CSS

 .element {  
  transform: scale(1, 1.5);  
 }  

 transform: scaleX(2);  
 transform: scaleY(.5);  

Values


scale(): affects the size of the element. This also applies to the font-size, padding, height, and width of an element, too. It’s also a a shorthand function for the scaleX and scaleY functions.

Thursday, 17 September 2015

Set footer put down on the page

How to set footer put down on the page

 

Wednesday, 16 September 2015

Validate form in Validate.JS

How to validate form in Validate.JS

Just download the following link.

 http://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.js  

Add following code for particular form.


 <script>  
 $(document).ready(function(){  

Login with database using MYSQL-I

How to login with database using MYSQL-I

 <?php   
 $conn1=new MySQLi("localhost","root","","mysqli");  
 if(isset($_POST['btnsubmit']))  
 {  
      if(empty($_POST['txtname']))  
      {  
           $message="Invalid user name";  
      }  
      elseif(strlen($_POST['txtpass'])<8 || empty($_POST['txtpass']))  
      {  
           $message="Invalid password";  
      }  
      else  
      {  

Connect database Using PDO

How to connect database Using PDO

 function __construct()  
      {  
           try  
           {  
                $serverName="localhost";  
                $this->db = new PDO('mysql:host=localhost;dbname=xxx', "db_username", "db_password");  
                $this->db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );  
           }  
           catch(Exception $e)  
           {  
                die( print_r( $e->getMessage() ) );   
           }  
      }  

Tuesday, 15 September 2015

Insert row Using MYSQL-I

How to insert row Using MYSQL-I

 <?php  
 //values to be inserted in database table  
 $product_code = '"'.$mysqli->real_escape_string('P1234').'"';  
 $product_name = '"'.$mysqli->real_escape_string('42 inch TV').'"';  
 $product_price = '"'.$mysqli->real_escape_string('600').'"';  
 //MySqli Insert Query  
 $insert_row = $mysqli->query("INSERT INTO products (product_code, product_name, price) VALUES($product_code, $product_name, $product_price)");  
 if($insert_row){  
   print 'Success! ID of last inserted record is : ' .$mysqli->insert_id .'<br />';   
 }else{  
   die('Error : ('. $mysqli->errno .') '. $mysqli->error);  
 }  
 ?>  

Make Mail function in PHP

This summary is not available. Please click here to view the post.