Step by Step Laravel 5.2

Step by Step Laravel 5.2

Step 1 : Install Laravel

    Create a Directory // larabelApp
 d:\xampp\htdocs\foldername>
 Command run :
 php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

step 2 : create a project

composer create-project laravel/laravel projectname
composer create-project laravel/laravel test-laravel-5-project –prefer-dist

step 3 : php artisan app:name <name-of-your-application>

step 4 : create a php artisan

         d:\xampp\htdocs\foldername\appname>
         cmd > php artisan


step 5 :change database configuration

D:\xampp\htdocs\laravel\myapp
 .env file open----------------->

APP_ENV=local
APP_DEBUG=true
APP_KEY=base64:Z1S9gGYOFhYO0AqmcLMlPEFcDRe7zcomGfHCAbxm8bA=
APP_URL=http://localhost

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=myapp
DB_USERNAME=root
DB_PASSWORD=

step 6 : setting

php artisan migrate
crate a database table

automatically genrate form
php artisan make : auth
Step by Step Install Ionic

Step by Step Install Ionic

first of all

Step 1 :     you should install nodejs in your system


Step 2 :    open cmd


step 3 :    cordova install your system
           
            npm install -g cordova ionic


step 4 :     cordova update your system

            npm update -g cordova ionic
How to link an image and target a new window?

How to link an image and target a new window?

Solution 1:
   
    <a href="http://w3package.blogspot.in/" target="_blank">
      <img width="220" height="250" border="0" align="center" alt="HTML with PHP"  src="your images pathwith name"/>
    </a>


Solution 2:

    Sort and Sweet Way
    <a href="http://w3package.blogspot.in/" target="_blank">w3package</a>
   
Solution 3:

    <a href="Your link url" target="_blank"><img src="path/folder" height="150" width="150" alt="html target"/></a>
Prototype and jQuery conflict issue in Magento?

Prototype and jQuery conflict issue in Magento?

<action method="addJs"><script>jquery/jquery-1.3.2.min.js</script></action>
<action method="addJs"><script>prototype/prototype.js</script></action>

Solution 1:

    var $j = jQuery.noConflict();

Solution 2:

    <script type="text/javascript">
      $.noConflict(); //Use no conflict here instead of js file
      // Code ........
      // Code ........
    </script>
   
Solution 3:

    $.noConflict();
    jQuery(document).ready(function(){
        jQuery("button").click(function(){
            jQuery("div").text("jQuery is still working!");
        });
    });
jquery conflict issue in Magento

jquery conflict issue in Magento

Solution 1 :

    var j = jQuery.noConflict();
   
    j( "div table" ).hide();
   
    $( "mytestid" ).style.display = "none";

Solution 2 :

    jQuery.noConflict();

    jQuery( "div table" ).hide();

    $( "mytestid" ).style.display = "none";

Solution 3 :

    jQuery.noConflict();
    (function( $ ) {
      $(function() {
        --------
        -------
        -----
      });
    })(jQuery);
jquery conflict issue in php

jquery conflict issue in php

Solution 1 :

    Open your jquery.js file and add this to the very bottom of it: jQuery.noConflict();
   
Solution 2 :

    jQuery(function($){
    // Use jQuery with $(...)

        $('#mySelector').hide();

        /* your jquery code....*/

    });

Solution 3 :

    var test = {};
    test.query = jQuery.noConflict( true );
   
jquery conflict issue in wordpress

jquery conflict issue in wordpress

Solution 1 :

    var $j = jQuery.noConflict();

    $j(document).ready(function() {
        $j( "idname" ).hide();
    });

Solution 2 :

    jQuery.noConflict();

    jQuery( document ).ready(function( $ ) {
      
        $( "idname" ).hide();
    });

Solution 3 :


    jQuery.noConflict();

    (function( $ ) {
       
    })( jQuery );
   
All SESSION Data Print in Angularjs

All SESSION Data Print in Angularjs

Solution 1 :

var app = angular.module('angularjs-starter', []);

app.controller('MainCtrl', function($scope, Session) {
  $scope.name = 'World';
  $scope.session = Session;
});

app.run(function(Session) {}); //bootstrap session;

app.factory('Session', function($http) {
  var Session = {
    data: {},
    saveSession: function() { /* save session data to db */ },
    updateSession: function() {
      /* load data from db */
      $http.get('session.json')
        .then(function(r) { return Session.data = r.data;})
    }
  };
  Session.updateSession();
  return Session;
});

session.json
------------
{
  "username": "John Smith"
}

HTML PART
----------------

<body ng-controller="MainCtrl">
    <h1>Hello {{name}}</h1>
    Session object:
    <pre ng-bind='session.data | json'></pre>
 </body>
Showing all session data in CodeIgniter

Showing all session data in CodeIgniter

Solution 1 :

                   print_r($this->session->userdata);

Solution 2 :

                  print_r($this->session->all_userdata());

Solution 3 :

               echo '<pre>'; print_r($this->session->all_userdata());exit;

              All SESSION Data Print in CodeIgniter
How to Write data to file in angularJS

How to Write data to file in angularJS

index.html
----------
<div ng-controller="MyCtrl">
  <input type="file" id="fileid" name="fileid"/>
  <br>
  <button ng-click="addfile()">Add_Button</button>
  <p>{{myfilecontent}}</p>
</div>


App.js
------
var myApp = angular.module('myApp',[]);

function MyCtrl($scope) {
    $scope.myfilecontent = 'Here....';
    $scope.addfile = function(){
      var f = document.getElementById('fileid').files[0],
          r = new FileReader();
      r.onloadend = function(e){
        $scope.myfilecontent = e.target.result;
      }
      r.readAsBinaryString(f);
    }
}

How to Add Active Class to a Navigation Menu Based on URL using PHP

How to Add Active Class to a Navigation Menu Based on URL using PHP
<div class="page-content">
    <div class="row">
        <div class="col-md-2">
            <div class="sidebar content-box" style="display: block;">
                <ul class="nav">
                    <?php $page_name=b asename($_SERVER[ 'PHP_SELF']); ?>
                    <!-- Main menu -->
                    <li class="<?php echo ($page_name=='dashboard.php')?'current':'';?>"><a href="dashboard.php"><i class="glyphicon glyphicon-home"></i> Dashboard</a>
                    </li>

                    <li class="submenu <?php echo ($page_name=='welcome_note.php' || $page_name=='corporate_profile.php' || $page_name=='introduction_of_the_township.php' || $page_name=='location_map.php')?'current open':'';?>">
                        <a href="#">
                            <i class="glyphicon glyphicon-list"></i> Pages
                            <span class="caret pull-right"></span>
                        </a>
                        <!-- Sub menu -->
                        <ul>
                            <li class="<?php echo ($page_name=='welcome_note.php')?'current':'';?>"><a href="welcome_note.php">Welcome Note</a>
                            </li>
                            <li class="<?php echo ($page_name=='corporate_profile.php')?'current':'';?>"><a href="corporate_profile.php">Corporate Profile</a>
                            </li>
                            <li class="<?php echo ($page_name=='introduction_of_the_township.php')?'current':'';?>"><a href="introduction_of_the_township.php">The Township</a>
                            </li>
                            <li class="<?php echo ($page_name=='location_map.php')?'current':'';?>"><a href="location_map.php">Location Map</a>
                            </li>

                        </ul>
                    </li>
                    <li class="<?php echo ($page_name=='consultants.php')?'current':'';?>"><a href="consultants.php"><i class="glyphicon glyphicon-move"></i>Consultants</a>
                    </li>
                    <li class="<?php echo ($page_name=='suppliers.php')?'current':'';?>"><a href="suppliers.php"><i class="glyphicon glyphicon-gift"></i>Suppliers</a>
                    </li>

                    <li class="submenu <?php echo ($page_name=='main_contractor.php' || $page_name=='sub_contractor.php')?'current open':'';?>">
                        <a href="#">
                            <i class="glyphicon glyphicon-list-alt"></i>Contractor
                            <span class="caret pull-right"></span>
                        </a>
                        <!-- Sub menu -->
                        <ul>
                            <li class="<?php echo ($page_name=='main_contractor.php')?'current':'';?>"><a href="main_contractor.php">Main-Contractor</a>
                            </li>
                            <li class="<?php echo ($page_name=='sub_contractor.php')?'current':'';?>"><a href="sub_contractor.php">Sub-Contractor</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>

Pass id value from a href to bootstrap modal php

Pass id value from a href to bootstrap modal php
Pass id value from a href to bootstrap modal php
<!-- Edit Modal -->

<div class="modal fade" id="myModalNorm1" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <!-- Modal Header -->
            <div class="modal-header">
                <button type="button" class="close"
                   data-dismiss="modal">
                       <span aria-hidden="true">&times;</span>
                       <span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    Edit CONSULTANTS
                </h4>
            </div>
           
            <!-- Modal Body -->
            <div class="modal-body">
                <div class="fetched-data"></div>
            </div>
          
        </div>
    </div>
</div>
<!-- End Modal -->

Javascript


<script>
$(document).ready(function(){
    $('#myModalNorm1').on('show.bs.modal', function (e) {
        var rowid = $(e.relatedTarget).data('id');
        $.ajax({
            type : 'post',
            url : 'fetch_record.php', //Here you will fetch records
            data :  'rowid='+ rowid, //Pass $id
            success : function(data){
            $('.fetched-data').html(data);//Show fetched data from database
            }
        });
     });
});
</script>

fetch_record.php


<?php include 'include/config.php';
if($_REQUEST['rowid']) {
    $con_id = $_REQUEST['rowid']; //escape string
    $sql_content1="select * from list_of_consultants where consultants_id='$con_id'";
    $sql_content_res1=mysql_query($sql_content1);
    $content_data=mysql_fetch_array($sql_content_res1);
   
   
    echo "<form method='POST'>
                  <div class='form-group'>
                    <label for='exampleInputEmail1'>Consultants Name</label>
                   
                      <input type='text' class='form-control'
                      id='exampleInputEmail1' name='conname' value='".$content_data['consultants_name']."' placeholder='Consultants Name'/>
                  </div>
                 
                  <div class='form-group'>
                    <label for='exampleInputEmail1'>Address(Title)</label>
                      <input type='text' class='form-control'
                      id='exampleInputEmail1' name='addtitle' value='".$content_data['consultants_address_title']." ' placeholder='Address(Title)'/>
                  </div>
                  <div class='form-group'>
                    <label for='exampleInputEmail1'>Address</label>
                      <textarea placeholder='Address' name='address' class='form-control'>".$content_data['consultants_address']."</textarea>
                  </div>
                  <div class='form-group'>
                    <label for='exampleInputEmail1'>Telephone No</label>
                      <input type='text' class='form-control'
                      id='exampleInputEmail1' name='telno' value='".$content_data['consultants_telephone']."' placeholder='Telephone No'/>
                  </div>
                  <div class='form-group'>
                    <label for='exampleInputEmail1'>Residence No</label>
                      <input type='text' class='form-control'
                      id='exampleInputEmail1' name='resino' value='".$content_data['consultants_recedence']."' placeholder='Residence No'/>
                  </div>
                  <input type='hidden' name='c_id' value='".$content_data['consultants_id']."'/>
                  <input type='submit'  class='btn btn-primary' name='consult_update' value='Update'/>
                    <button type='button' class='btn btn-default'
                            data-dismiss='modal'>
                                Close
                    </button>
                
                </form>";
 }
?>

Access-Control-Allow-Origin

 
Access-Control-Allow-Origin
Solution No 1


 <?php
 header('Access-Control-Allow-Origin: *'); 
 -------
 ------
 -------
 your code
 --------
 ?>

 Solution No 2


 <?php

 header('content-type: application/json; charset=utf-8');
 header("access-control-allow-origin: *");

 ?>

Solution No 3


<?php
    header('Content-type: text/html');
    header('Access-Control-Allow-Origin: *');
?>

angularjs with php

 
php with angularjs

index.html

<!-- Learn AngularJS-->
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>

 <div ng-app="myApp" ng-controller="customersCtrl">

<table border="2">
  <tr ng-repeat="x in names">
    <td>{{ x.First }}</td>
    <td>{{ x.Last_Name }}</td>
     <td>{{ x.Email }}</td>
  </tr>
</table>

</div>

<script>
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
    $http.get("customers_mysql.php")
    .then(function (response) {
    console.log(response);
    $scope.names = response.data.records;
    });
});
</script>

</body>
</html>

customers_mysql.php

<?php
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
$conn = new mysqli("localhost", "root", "", "mydatabase");
$result = $conn->query("SELECT *  FROM contacts");
$outp = "";
while($rs = $result->fetch_array(MYSQLI_ASSOC)) {
    if ($outp != "") {$outp .= ",";}
    $outp .= '{"First":"'  . $rs["contact_first"] . '",';
    $outp .= '"Last_Name":"'   . $rs["contact_last"]        . '",';
    $outp .= '"Email":"'. $rs["contact_email"]     . '"}';
}
$outp ='{"records":['.$outp.']}';
$conn->close();
echo($outp);
?>
php with angularjs

How to connect to MySQL database using PHP

How to connect to MySQL database using PHP
<?php

$username = "root"; //your_name
$password = ""; //your_password
$hostname = "localhost";  //Hostname

//connection to the database
$dbhandle = mysql_connect($hostname, $username, $password)
 or die("Unable to connect to MySQL");
echo "Connected to MySQL<br>";

//select a database to work with
$selected = mysql_select_db("mydatabase",$dbhandle)
  or die("Could not select mydatabase");

//execute the SQL query and return records
$result = mysql_query("SELECT *  FROM contacts");

//fetch tha data from the database
while ($row = mysql_fetch_array($result)) {
   echo "ID:".$row{'contact_id'}." Name:".$row{'contact_first'}."contact_last: ". //display the results
   $row{'contact_last'}."<br>";
}
//close the connection
mysql_close($dbhandle);
?>

Learn AngularJS

<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>
<div ng-app="">
        <p>Please Enter Your name:</p>
        <p>Name: <input type="text" ng-model="myname"></p>
         <p ng-bind="myname">Wel-come :</p>
         Welcome {{myname}}
</div>
</body>
</html>

dynemic value change in table jquery

dynemic value change in table jquery
<!DOCTYPE html>
<html>

<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

</head>

<body>
    <table class="table" id="tableCompleted" border="2">
        <thead>
            <tr>
                <th>Name</th>
                <th>Language</th>
                <th>Databased</th>
                <th>Script</th>
                <th>Programming</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Laravel</td>
                <td>PHP</td>
                <td>MySQL</td>
                <td>mysqli</td>
                <td>Javascript</td>
            </tr>
            <tr>
                <td>Java</td>
                <td>c</td>
                <td>c++</td>
                <td>c#</td>
                <td>Oracle</td>
            </tr>
            <tr>
                <td>Mean.js</td>
                <td>Android</td>
                <td>IOS</td>
                <td>Magento</td>
                <td>HTML</td>
            </tr>
        </tbody>
    </table>
    <script>
        $('td').on('click', function() {
            var $this = $(this);
            var $input = $('<input>', {
                value: $this.text(),
                type: 'text',
                blur: function() {
                    $this.text(this.value);
                },
                keyup: function(e) {
                    if (e.which === 13) $input.blur();
                }
            }).appendTo($this.empty()).focus();
        });
    </script>
</body>

</html>

Your Link Multiple time open in every Browser

Your Link Multiple time open in every Browser
<html>
<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
</head>

<body>
    <a href="#" class="yourlink" target="_blank" id="startrunning">Click here</a>
</body>
<script type="text/javascript">
    $('a.yourlink').click(function(e) {
        e.preventDefault();
        var i = 0;
        while (i < 23) {
            window.open('http://w3free.blogspot.in/2016/06/smtp-send-mail-in-php.html');

            i++;
        }
    });
</script>
</html>

checkbox cheked row value in json

checkbox cheked row value in json
checkbox cheked row value in json
<!doctype html>
<html lang="en">
<body>
    <table id="myTable">
        <tr>
            <td>Date</td>
            <td>Activity</td>
            <td>Time</td>
            <td>Done?</td>
        </tr>
        <tr>
            <td>test</td>
            <td>test</td>
            <td>test</td>
            <td>test</td>
            <td><input type="checkbox" class="checks" /></td>
        </tr>
        <tr>
            <td>dhaval</td>
            <td>sss</td>
            <td>test</td>
            <td>test</td>
            <td><input type="checkbox" class="checks" /></td>
        </tr>
        <tr>
            <td>jaty</td>
            <td>dddd</td>
            <td>test</td>
            <td>test</td>
            <td><input type="checkbox" class="checks" /></td>
        </tr>
        <tr>
            <td>jaty</td>
            <td>dddd</td>
            <td>test</td>
            <td>test</td>
            <td><input type="checkbox" class="checks" /></td>
        </tr>
    </table>

    <button id="buttonforsend" onclick="SendData()">Send greenmarked data!</button>

    <pre id="jsonString"></pre>

    <script>
        function AddRow() {

            var $check = document.createElement("INPUT");
            $check.setAttribute("type", "checkbox");
            $check.setAttribute("checked", "true");
            $check.setAttribute("class", "checks");
            $check.addEventListener("click", toggleClass);

            function toggleClass() {

                if (this.checked == true) {
                    this.parentNode.parentNode.className = "Green";

                } else {
                    this.parentNode.parentNode.className = "Red";
                }

            }

            var date = document.getElementById("Datum");
            var activity = document.getElementById("Activity");
            var time = document.getElementById("time");

            var table = document.getElementById("myTable");

            var rowCount = table.rows.length;
            var row = table.insertRow(rowCount);


            row.insertCell(0).innerHTML = date.value;
            row.insertCell(1).innerHTML = activity.value;
            row.insertCell(2).innerHTML = time.value;
            row.insertCell(3).appendChild($check).value;

        }

        function addTable() {

            var myTableDiv = document.getElementById("myDynamicTable");

            var table = document.createElement('TABLE');
            table.border = '1';

            var tableBody = document.createElement('TBODY');
            table.appendChild(tableBody);

            for (var i = 0; i < 3; i++) {
                var tr = document.createElement('TR');
                tableBody.appendChild(tr);

                for (var j = 0; j < 4; j++) {
                    var td = document.createElement('TD');
                    td.width = '75';
                    td.appendChild(document.createTextNode("Cell " + i + "," + j));
                    tr.appendChild(td);
                }
            }
            myTableDiv.appendChild(table);

        }

        function CheckData() {



            var table = document.getElementById("myTable");
            var max = 0;
            for (var i = 0; i < table.rows.length; i++) {
                if (max < table.rows[i].cells.length)
                    max = table.rows[i].cells.length;
            }



            var $arr = [];
            var arr1 = {};
            var tb = document.getElementById("myTable");

            var checks = tb.querySelectorAll(".checks"),
                chk, tr;
            for (var i = 0; i < checks.length; i++) {
                chk = checks[i];
                if (chk.checked) {
                    tr = chk.closest ? chk.closest('tr') : chk.parentNode.parentNode;

                    for (var j = 0; j < max; j++) {
                        //arr1.push('date :'+tr.cells[i].innerText);
                        arr1[j] = tr.cells[j].innerText;
                    }
                    $arr.push(arr1);
                    <!-- $arr.push({
                    // date: tr.cells[0].innerText,
                    //activity: tr.cells[1].innerText
                    // }); -->
                }
            }
            return $arr;
        }


        function SendData() {

            var obj = {
                test: CheckData()
            };
            var jsonString = "jsonString=" + (JSON.stringify(obj));


            document.getElementById('jsonString').innerHTML = jsonString;
            return; // for testing


            var xmlhttp = new XMLHttpRequest();

            xmlhttp.open("POST", "JSON_H.php", true);
            xmlhttp.setRequestHeader("Content-type", "application/x-www-form-  urlencoded");
            xmlhttp.setRequestHeader("Content-Length", jsonString.length);

            xmlhttp.onreadystatechange = function() {
                if (xmlhttp.readyState === 4 && (xmlhttp.status === 200)) {
                    alert(xmlhttp.responseText);
                }
            };
            xmlhttp.send(jsonString);
        }
    </script>
</body>
</html>

Set active class menu of navigation dynamically in PHP

Set active class menu of navigation dynamically in PHP
<ul class="nav">
    <?php $page_name=b asename($_SERVER[ 'PHP_SELF']); ?>
    <!-- Main menu -->
    <li class="submenu <?php echo ($page_name=='welcome_note.php' || $page_name=='profile.php' || $page_name=='introduction.php' || $page_name=='location.php')?'current open':'';?>">
        <a href="#">
            <i class="glyphicon glyphicon-list"></i> Masters
            <span class="caret pull-right"></span>
        </a>
        <!-- Sub menu -->
        <ul>
            <li class="<?php echo ($page_name=='welcome_note.php')?'current':'';?>"><a href="welcome_note.php">Welcome Note</a>
            </li>
            <li class="<?php echo ($page_name=='profile.php')?'current':'';?>"><a href="profile.php">Corporate Profile</a>
            </li>
            <li class="<?php echo ($page_name=='introduction.php')?'current':'';?>"><a href="introduction.php">The Township</a>
            </li>
            <li class="<?php echo ($page_name=='location.php')?'current':'';?>"><a href="location.php">Location Map</a>
            </li>

        </ul>
    </li>
</ul>

Application Cover Latter

Cover-Latter

Simple Cover Latter Demo

 

Subject :  Application for the position of PHP developer and Angularjs 

Respected Sir,
                             i am a student of MCA at Atmiya Institute of Technology & Science,Rajkot and i am  Developing my IT skills with joining this program (3 year / 6 semesters).

           I've acquire variety of skills along with core competencies in Problem Solving, Database Management capabilities and Developing C/S Application during my institution stay from semester 1 to 6.

            I believe that I can be a great asset to your company and I would be most grateful for the opportunity of an interview, where we can discuss your company goals, the job requirements and also my ability to meet them.
           
Please find the attached resume for PHP Developer.

I  have 1 year experience with strong focus on core php angular js and Webservices.Waiting for your favourable reply.

1.       Total Experience: 1 year
2.       Current CTC: Rs 10,000/-
3.       Expected CTC: As per company standard
4.       Notice Period: 1 month

With this mail I've attached My Curriculum Profile document.

Hope for a positive response from your side.
Thanking you.

From:
Sojitra Rinkal M.
MCA
Atmiya Institute of Technology & Science,
Rajkot (Gujarat).
C. No: 9898229898

Kategori

Kategori