Posts

Create Div and drag through jquery.

Image
<html> <head>       <meta charset="utf-8">       <style>         body {             margin: 0;             padding: 0;             overflow: hidden;             background-color: #F0F0F0;         } body { font-family: Arial, Helvetica, sans-serif; } table { font-size: 1em; } .ui-draggable, .ui-droppable { background-position: top; }     </style> <link rel="stylesheet" type="text/css" href="../css/normalize.css" /> <link rel="stylesheet" type="text/css" href="../fonts/font-awesome-4.3.0/css/font-awesome.min.css" /> <link rel="stylesheet" type="text/css" href="../css/demo.css" /> <link rel="stylesheet" type="text/css" href="../css/style.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <style&

Navigation Drawer and Custom listview

Image
Userpanel.java package com.alexatechno.; import android.app.ProgressDialog; import android.content.Intent; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.AsyncTask; import android.os.Bundle; import android.support.v7.app.ActionBarDrawerToggle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.NavigationView; import android.support.design.widget.Snackbar; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.HttpClient; import org.apache

Insert Data in Database through pdo in php..

try {  $db = new PDO('mysql:host=localhost;dbname=idegraphics', 'root', '');  $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);  $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); }catch(PDOException $e) { echo 'ERROR: ' . $e->getMessage(); } $radio=$_POST["radio1"]; $descr=$_POST["descr"]; $yrreg=$_POST["select"]; $carmodel=$_POST["mot"]; $fuel=$_POST["fuel"]; $variant=$_POST["variant"]; try {     $stmt = $db->prepare("insert into motorscustomer(cardetails,registartiondetails,yearofregistation,cardetailsname,fueltype,variantype) values(?,?,?,?,?,?)");     $stmt->execute(array($radio,$descr,$yrreg,$carmodel,$fuel,$variant)); $last_id = $db->lastInsertId();   //  echo "New record created successfully. Last inserted ID is: " . $last_id; }catch(PDOException $e) {     echo 'ERROR: ' . $e->getMessage(); }

Rating Bar in Android.

Image
 rates = (EditText) findViewById(R.id.rates);                         rates.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { if(rates.getText().length()>0) { ratingBar.setRating(Float.parseFloat(rates.getText().toString())); rating_val.setText(String.valueOf(rates.getText().toString())); } } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void afterTextChanged(Editable s) { } });

Import csv file data in database through PHPExcel.

<?php error_reporting(E_ALL); set_time_limit(0); date_default_timezone_set('Europe/London'); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>PHPExcel Reader Example #01</title> </head> <body> <h1>PHPExcel Reader Example #01</h1> <h2>Simple File Reader using PHPExcel_IOFactory::load()</h2> <?php $connection=mysql_connect("127.0.0.1","root",""); mysql_select_db("idegraphics",$connection); /** Include path **/ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/'); /** PHPExcel_IOFactory */ include 'PHPExcel/IOFactory.php'; $inputFileName = './sampleData/vmpc.csv'; echo 'Loading file ',pathinfo($inputFileName,PATHINFO_BASENAME),' using IOFactory to identify the format<br />'; $objPHPExcel = PHPExcel_IOFactory::load($inputFileName); $sh

Call Curl in php.

$ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "www.abc.com"); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // grab URL and pass it to the browser curl_exec($ch); // close cURL resource, and free up system resources curl_close($ch);

Google Chart with Database.

Image
<?php include("db.php"); $query = "select * from warehouse"; if ($result = mysql_query($query)) {     {     $rows = array();     $table = array();     $table['cols'] = array(             array('label' => 'Warehouse', 'type' => 'string'),             array('label' => 'Percentage', 'type' => 'number')     );     while ($row =mysql_fetch_array($result)) { $begani=mysql_fetch_array(mysql_query("select sum(stcokprice) from beganinventory where warehouse='$row[2]'")); $a="warehouse"; $b=200;             $temp = array();             $temp[] = array('v' => (string) $row[2]);             $temp[] = array('v' => (int) $begani[0]);             $rows[] = array('c' => $temp);             }    }  } $table['rows'] = $rows; $jsonTable = json_encode($table); ?> <link href="myadminstyle.css" rel="styleshe

Add Texfield in Html Table through Javascript.

<script type="text/javascript"> function addRow(tableID) {         var table = document.getElementById(tableID);         var rowCount = table.rows.length;         var row = table.insertRow(rowCount);         var cell1 = row.insertCell(0);          cell1.innerHTML = rowCount;         var cell2 = row.insertCell(1);         cell2.innerHTML = "<input type='text' name='key[]' style='width:140px;'>";         var cell3 = row.insertCell(2);         cell3.innerHTML = "<input type='text' name='descr[]' style='width:140px;'>";         var cell4 = row.insertCell(3);         cell4.innerHTML = "<input type='text' name='city[]' style='width:140px;'>";         var cell5 = row.insertCell(4);         cell5.innerHTML = "<input type='text' name='address[]' style='width:140px;'>";  var cell6 = row.insertCell(5);         cell6.inner

Edit Data in Database through html Table

 <table cellspacing="0" style="font-size:15px;" width="100%" align="center" id="sl">    <p class="a">Custom Subsidiary</p>  <INPUT type="button" value="Add" onclick="addRow('sl')" style="font-family: 'icomoon';     font-size: 12px;content: \e608;"/>   <tr style="" width="100%">   <th style="border-bottom: black 2px solid;"></th>     <th style="border-bottom: black 2px solid;text-align:left;" valign="left">Key</th>   <th style="border-bottom: black 2px solid;text-align:left;" align="left">Description</th>   <th style="border-bottom: black 2px solid;text-align:left;" align="left">City</th>   <th style="border-bottom: black 2px solid;text-align:left;" align="left">Address</th>

add background image on div.

<div  style="margin-left:0px;color:white;width:100%;background-image:url('images1/menu.jpg');"> Scan </div>

check connection available or not in android.

public static boolean isNetworkAvailable(Context cont) {    ConnectivityManager connectivityManager          = (ConnectivityManager)cont. getSystemService(Context.CONNECTIVITY_SERVICE);    NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();    return activeNetworkInfo != null && activeNetworkInfo.isConnected(); } and check this in- if(isNetworkAvailable(getApplicationContext())) { new Resiter().execute(); } else { Toast.makeText(getApplicationContext(), "Internet Unavailable...Please connect to Internet",3000).show(); }

Match word in String.

String string = "this is Naveen rajput"; String keyword = "Naveen"; Boolean found = Arrays.asList(string.split(" ")).contains(keyword); if(found){       System.out.println("Keyword matched");}

Connection pool in apache tomcat.

Context.xml <?xml version="1.0" encoding="UTF-8"?> <Context antiJARLocking="true" path="/apacheindia"> <Resource name="jdbc/testdb" auth="Container" maxActive="10000" maxIdle="5000" maxWait="60000" username="root" password="root" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3305/indiaswap?autoReconnect=true" logAbandoned="true" removeAbandoned="true" removeAbandonedTimeout="60" type="javax.sql.DataSource" /> </Context> database1.java package Db; import java.sql.DriverManager; import javax.naming.Context; import javax.naming.InitialContext; import javax.sql.DataSource; /**  *  * @author Naveen  */ public class database1 {     private DataSource dataSource;      public DataSource connectit()     {     java.sql.Connection con=null;         try         {              Co

Sending Mail Through Servlet

/*  * To change this license header, choose License Headers in Project Properties.  * To change this template file, choose Tools | Templates  * and open the template in the editor.  */ import Db.databse; import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sql.Date; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /**  *  * @author Naveen&Jyoti  */ @WebServlet(urlPatterns = {"/Register.action"}) public