Skip to content

Commit

Permalink
version 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
opendatatable committed Jul 6, 2018
1 parent ef4dcb5 commit 35c4eda
Show file tree
Hide file tree
Showing 13 changed files with 1,334 additions and 14 deletions.
97 changes: 97 additions & 0 deletions bootstrap/index.html
@@ -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">
&lt;html>
&lt;head>
&lt;title>Open Data Table&lt;/title>
&lt;script src="https://code.jquery.com/jquery-2.2.4.js">&lt;/script>
&lt;link rel="stylesheet" type="text/css" href="style.css">
&lt;script src="OpenDataTable.js">&lt;/script>
&lt;link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet">
&lt;link href="../css/custom_style.css" rel="stylesheet">
&lt;script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js
"></script>
&lt;script type="text/javascript">
$(document).ready(function(){
$(".OpenDataTable").OpenDataTable({
url:"simple_php_datasource.php",
});
});
&lt;/script>
&lt;/head>
&lt;body>
&lt;table class="OpenDataTable table strip table-striped table-bordered">
&lt;thead>
&lt;tr>
&lt;th>Code&lt;/th>
&lt;th>Name&lt;/th>
&lt;th>Continent&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>&lt;/tbody>
&lt;/table>
&lt;/body>
&lt;/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>
46 changes: 46 additions & 0 deletions crud/action.php
@@ -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";
}

?>

0 comments on commit 35c4eda

Please sign in to comment.