Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef4dcb5
commit 35c4eda
Showing
13 changed files
with
1,334 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<html> | ||
<head> | ||
<title>Open DataTable Bootstrap Example</title> | ||
<meta name="description" content="Open DataTable is a JQuery plug-in. It is fast, very much realiable, easy to implement, highly flexible and comes with a very beautiful UI.It is currently avaiblable only with PHP MySQL data source and under development for supporting other data sources in near future"> | ||
<meta name="keyword" content="JQuery data table, Php data table, simple data table"> | ||
<meta http-equiv="content-type" content="text/html;charset=utf-8" /> | ||
<script src="https://code.jquery.com/jquery-2.2.4.js"></script> | ||
|
||
<script src="../js/OpenDataTable.js"></script> | ||
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet"> | ||
<script type="text/javascript" src="../js/prism.js"></script> | ||
<link href="../css/prism.css" rel="stylesheet"> | ||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet"> | ||
<link href="../css/custom_style.css" rel="stylesheet"> | ||
<script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js | ||
"></script> | ||
<script type="text/javascript"> | ||
$(document).ready(function(){ | ||
$(".OpenDataTable").OpenDataTable({ | ||
url:"../source/simple_php_datasource.php", | ||
}); | ||
}); | ||
</script> | ||
<script> | ||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | ||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | ||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | ||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); | ||
|
||
ga('create', 'UA-98093724-1', 'auto'); | ||
ga('send', 'pageview'); | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<h1 class="logo"> <a href="http://opendatatable.com/"> <span class="logo1">Open</span> DataTable</a></h1> | ||
<h2>Simple Example</h2> | ||
<p><b>Required files</b><br> | ||
<a href="https://code.jquery.com/jquery-2.2.4.js">jquery-2.2.4.js</a><br> | ||
<a href="https://github.com/opendatatable/OpenDataTable/blob/master/source/simple_php_datasource.php">simple_php_datasource.php</a><br> | ||
<a href="https://github.com/opendatatable/OpenDataTable/blob/master/css/custom_style.css">custom_style.css</a><br> | ||
<a href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">bootstrap.min.css</a><br> | ||
|
||
<a href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js">bootstrap.min.js</a><br> | ||
<a href="https://github.com/opendatatable/OpenDataTable/blob/master/js/OpenDataTable.js">OpenDataTable.js</a><br> | ||
<a href="https://github.com/opendatatable/OpenDataTable/blob/master/country_city.sql">country_city.sql</a><br> | ||
</p> | ||
<b>Code</b> | ||
<pre class="language-markup"> | ||
<code class="language-markup"> | ||
<html> | ||
<head> | ||
<title>Open Data Table</title> | ||
<script src="https://code.jquery.com/jquery-2.2.4.js"></script> | ||
<link rel="stylesheet" type="text/css" href="style.css"> | ||
<script src="OpenDataTable.js"></script> | ||
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet"> | ||
<link href="../css/custom_style.css" rel="stylesheet"> | ||
<script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js | ||
"></script> | ||
<script type="text/javascript"> | ||
$(document).ready(function(){ | ||
$(".OpenDataTable").OpenDataTable({ | ||
url:"simple_php_datasource.php", | ||
}); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<table class="OpenDataTable table strip table-striped table-bordered"> | ||
<thead> | ||
<tr> | ||
<th>Code</th> | ||
<th>Name</th> | ||
<th>Continent</th> | ||
</tr> | ||
</thead> | ||
<tbody></tbody> | ||
</table> | ||
</body> | ||
</html> | ||
|
||
|
||
</code></pre> | ||
<p><b>Output</b></p> | ||
<table class="OpenDataTable table strip table-striped table-bordered"> | ||
<thead> | ||
<tr> | ||
<th>Code</th> | ||
<th>Name</th> | ||
<th>Continent</th> | ||
</tr> | ||
</thead> | ||
<tbody></tbody> | ||
</table> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
$con=mysqli_connect("localhost","root","","country_city"); | ||
if(!$con){ | ||
die("Connection fail".mysqli_connect_error()); | ||
} | ||
|
||
|
||
$req_method=$_SERVER['REQUEST_METHOD']; | ||
|
||
$name=$_POST['name']; | ||
$city=$_POST['city']; | ||
$work_area=$_POST['work_area']; | ||
$country=$_POST['country']; | ||
$grade=$_POST['grade']; | ||
|
||
if($req_method=="POST") | ||
{ | ||
mysqli_query($con,"INSERT INTO customer_2(CUST_NAME,CUST_CITY,WORKING_AREA,CUST_COUNTRY,GRADE) | ||
VALUES('$name','$city','$work_area','$country','$grade')"); | ||
var_dump($_POST); | ||
echo "success"; | ||
} | ||
else if($req_method=="PUT") | ||
{ | ||
$id=$_POST['id']; | ||
mysqli_query($con,"UPDATE customer_2 set | ||
CUST_NAME='$name', | ||
CUST_CITY='$city', | ||
WORKING_AREA='$work_area', | ||
CUST_COUNTRY='$country', | ||
GRADE='$grade' | ||
WHERE id='$id'"); | ||
echo "success"; | ||
} | ||
else if($req_method=="DELETE") | ||
{ | ||
$id=$_GET['id']; | ||
mysqli_query($con,"DELETE from customer_2 where id='$id'"); | ||
echo "success"; | ||
} | ||
else | ||
{ | ||
echo "error"; | ||
} | ||
|
||
?> |
Oops, something went wrong.