here it is my html part from where i m trying to enter details ..
<div ng-app="angularPHP">
<div ng-controller="mainpagecntl">
<div id="customer" class="cuscontainer" hidden="hidden">
<div>
<h3 class="modal-title" >Add customer</h3>
<i class="fa fa-times" id="clo" aria-hidden="true"></i>
</div>
<table>
<tr>
<div class="form-group" >
<td><label id="label" class="control-label">customer Name:</label>
<td><input type="text" class="form-control" ng-model="customer_name" />
</div>
</tr>
<tr>
<div class="form-group">
<td><label id="label" class="control-label">Address:</label></td>
<td><input type="text" class="form-control" ng-model="customer_add"/></td>
</div>
</tr>
</table>
<div class="madal-footer">
<button class="btn btn-primary" ng-click="custadd()">ADD</button><br />
</div>
</div>
</div>
</div>
here is my angular-js part..
var app = angular.module('angularPHP', []);
app.controller('mainpagecntl', function($http,$scope)
{
$scope.custadd= function()
{
data={
cname :$scope.customer_name,
cadd: $scope.customer_add,
}
$http.post("../pos_system/Widgets/addcust.php?add",data).success(function(data)
{
});
}
});
but when i click on button nothing happened my ng-click function is not firing.
try adding ng-controller="myCtrl"at the <div id="customer" class="cuscontainer" hidden="hidden"> like this
<div id="customer" class="cuscontainer" hidden="hidden" ng-controller="myCtrl">
Are you sure the function is not firing at all? It may be firing but just failing to post the data. console.log something straight away inside the function to check e.g.
var app = angular.module('angularPHP', []);
app.controller('mainpagecntl', function($http,$scope) {
var vm = this;
vm.custadd = function() {
console.log('test');
var data = { cname :$scope.customer_name, cadd: $scope.customer_add};
$http.post("../pos_system/Widgets/addcust.php?add",data)
.success(function(data) {
console.log(data);
});
}
}
Then your ng-click should look like this
ng-click='vm.custadd()'
See if that makes any difference.
Note: Your ng-controller should also look like
ng-controller="mainpagecntl as vm"
as noted in the comments below.
Here's the working demo https://plnkr.co/edit/k7yApAavre66KFAiVlOp?p=preview for your code and it worked perfectly when I clicked on Add button. Although I have removed some div tags from table as it's bad practice and Angular will not identify those tags when its directives are used on them.
var app = angular.module('angularPHP', []);
app.controller('mainpagecntl', function($http, $scope) {
$scope.custadd = function() {
$scope.data = {
cname: $scope.customer_name,
cadd: $scope.customer_add,
}
// $http.post("../pos_system/Widgets/addcust.php?add", data).success(function(data) {});
}
});
Related
I used this script (https://www.webslesson.info/2020/02/instant-search-with-pagination-in-php-mysql-jquery-and-ajax.html) and I would like to add a form to directly access a page number.
I tried this but it doesn't work !
<div class="goto-page">
<form action="" method="POST" onsubmit="return pageValidation()">
<input type="submit" class="goto-button" value="Go to page">
<input type="text"
class="enter-page-no" maxlength="4" size="3"
name="goto" min="1"
required >
</form>
</div>
PHP Code modified
if (isset($_POST['goto'])) {
$start = (($_POST['page'] - 1) * $limit);
$page = $_POST['goto'];
}
else
{
if($_POST['page'] > 1)
{
$start = (($_POST['page'] - 1) * $limit);
$page = $_POST['page'];
}
else
{
$start = 0;
}
}
Consider the following example. This expands on the jQuery already in use in the example you linked to.
$(function() {
function load_data(page, query = '') {
$.ajax({
url: "fetch.php",
method: "POST",
data: {
page: page,
query: query
},
success: function(data) {
$('#dynamic_content').html(data);
}
});
}
load_data(1);
$(document).on('click', '.page-link', function() {
var page = $(this).data('page_number');
var query = $('#search_box').val();
load_data(page, query);
});
$('#search_box').keyup(function() {
var query = $('#search_box').val();
load_data(1, query);
});
$(".goto-page form").submit(function(evt) {
evt.preventDefault();
load_data(parseInt($(".goto-page input[name='goto']").val()));
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<br />
<div class="container">
<h3 align="center">Live Data Search with Pagination in PHP Mysql using Ajax</h3>
<br />
<div class="card">
<div class="card-header">Dynamic Data</div>
<div class="card-body">
<div class="form-group">
<input type="text" name="search_box" id="search_box" class="form-control" placeholder="Type your search query here" />
</div>
<div class="table-responsive" id="dynamic_content">
</div>
<div class="goto-page">
<form>
<button type="submit">Go To Page</button>
<input type="text" class="enter-page-no" maxlength="4" size="3" name="goto" value="1" required>
</form>
</div>
</div>
</div>
</div>
When Enter is hit or the Button pressed, the form is submitted. The submit callback will gather the value and use load_data() to load that page.
My jQuery code is not sending a value from the textarea name="post_description"
<form id="post" method="post">
<div class="input-group">
<textarea name="post_description" class="form-control" placeholder="<?php echo $lang['description']; ?>" rows="4" ng-model="description"></textarea>
</div>
<div id="share_result"></div>
<a id="share" class="btn-custom">
<i class="fa fa-th-large"></i> <?php echo $lang['share']; ?>
</a>
</form>
$(document).ready(function() {
$("#share").click(function(e) {
e.preventDefault();
var postimg = $("#post").serialize();
$.post("posts/post_image.php", postimg).done(function(data) {
$("#share_result").html(data);
}).fail(function() {
//alert("Error submitting forms!");
})
})
})
On the backend:
$post_description = $_POST['post_description'];
It's returning as undefined index but the names do match
May be because you prevent event onclick you have to set event prevent on form submit like this :
<form id="post" method="post">
<div class="input-group">
<textarea name="post_description" class="form-control" placeholder="<?php echo $lang['description']; ?>" rows="4" ng-model="description"></textarea>
</div>
<div id="share_result"></div>
<a id="share" class="btn-custom">
<i class="fa fa-th-large"></i> <?php echo $lang['share']; ?>
</a>
<button type="submit" id="postform">Submit form</button>
</form>
When you click on submit button your form will submit and then
$("#post").submit(function (e) {
e.preventDefault();
// here is your code
});
Or if you don't want to add this button you have to change from
var postimg = $("#post").serialize();
to
var postimg = {post_description:$("textarea[name='post_description']").val()};
It was the Angular js conflict so I had to write my own jquery function to replace the angular and keep the same angular beraviour on the page, here is my jquery solution for angular replacement:
<script type="text/javascript">
$(document).ready(function(){
$("#post_description").keyup(function(){
// Getting the current value of textarea
var currentText = $(this).val();
// Setting the Div content
$("#text_output").text(currentText);
//$("#text_output").value(currentText);
$("#text_output").attr("value", currentText);
});
});
</script>
I have 3 query records in a database table of the same user. When I do query returns and shows the most recent query of the database table.
I want to return the 3 queries, always show the most recent query, but have a button that when clicked close the query that is showing and open the previous query and so on until no further queries.
In this way I always have access to the information registered in each consultation about the user.
At this point I return the query as follows:
<a name="view2" id="<?php echo $row["Id"]; ?>" data-toggle="modal" href="#dataModal1" class="btn btn-primary view_data2" />EGA</a>
<div id="dataModal1" class="modal fade" style="width:1000px;">
<div class="modal-dialog" style="width:1000px;">
<div class="modal-content" style="width:1000px;">
<div class="modal-header" style="width:1000px;">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"><strong>Estado Geral e Autonomia</strong></h4>
</div>
<div class="container"></div>
<div class="modal-body" id="employee_detail1">
</div>
<div class="modal-footer">
Sair
</div>
</div>
</div>
</div>
$(document).on('click', '.view_data2', function() {
var employee_id1 = $(this).attr("Id");
if (employee_id1 != '') {
$.ajax({
url: "./select2",
method: "POST",
data: {
employee_id1: employee_id1
},
success: function(data) {
console.log(data);
$('#employee_detail1').html(data);
$('#dataModal1').modal('show');
}
});
}
});
on the select2 page I have the following code:
if(isset($_POST["employee_id1"]))
{
$output = '';
$query = "SELECT * FROM centrodb.PsicUtentes WHERE centrodb.PsicUtentes.Id = '".$_POST["employee_id1"]."'";
$result = mysqli_query($conn, $query);
$output;
while($row = mysqli_fetch_array($result))
{
$output .= '
<h4 class="modal-title">Identificação do Utente</h4>
<form method="post" id="insert_form2">
<fieldset class="grupo">
<table class="campo" cellspacing="10">
<tr>
<td>
<label>Data</label>
<input type="text" id="Data1" name="Data" class="form-control" value="'.$row["Data"].'" style="width:150px;" />
</td>
<td>
<label>Código Utente</label>
<input type="number" id="CodigoUtente1" name="CodigoUtente" value="'.$row["CodigoUtente"].'" class="form-control" style="width:100px;"/>
</td>
<td>
<label>Nome Utente</label>
<input type="text" id="Nome1" name="Nome" value="'.$row["Nome"].'" class="form-control" class="form-control" style="width:400px;"/>
</td>
<td>
<label>Data Nascimento</label>
<input type="date" id="DataNasc1" name="DataNasc" value="'.$row["DataNasc"].'" class="form-control" style="width:150px;"/>
</td>
</tr>
</table>
</fieldset>
</form>
';
}
$output;
echo $output;
}
I will show the image with the page when I have three queries:
I intended to have a button like the one surrounded in red and whenever I clicked, I closed the information of the query that is showing and opened the previous query.
Solution I'm trying.
<script type="text/javascript">
$(document).ready(function(){
$('.conteudo').hide();
$('.exibir').each(function(i){
$(this).click(function(){
$('.conteudo').each(function(j){
if(i == j) $(this).show('slow');
});
});
});
$('.ocultar').each(function(i){
$(this).click(function(){
$('.conteudo').each(function(j){
if(i == j) $(this).hide('slow');
});
});
});
});
</script>
if(isset($_POST["employee_id1"]))
{
$output = '';
$query = "SELECT * FROM centrodb.PsicUtentes WHERE centrodb.PsicUtentes.Id = '".$_POST["employee_id1"]."'";
$result = mysqli_query($conn, $query);
$output;
while($row = mysqli_fetch_array($result))
{
$output .= '
<h4 class="modal-title">Identificação do Utente</h4>
<div>
<a class="exibir" href="#">Ver</a>--
Ocultar
</div>
<div class="conteudo">
<form method="post" id="insert_form2">
<fieldset class="grupo">
<table class="campo" cellspacing="10">
<tr>
<td>
<label>Data</label>
<input type="text" id="Data1" name="Data" class="form-control" value="'.$row["Data"].'" style="width:150px;" />
</td>
<td>
<label>Código Utente</label>
<input type="number" id="CodigoUtente1" name="CodigoUtente" value="'.$row["CodigoUtente"].'" class="form-control" style="width:100px;"/>
</td>
<td>
<label>Nome Utente</label>
<input type="text" id="Nome1" name="Nome" value="'.$row["Nome"].'" class="form-control" class="form-control" style="width:400px;"/>
</td>
<td>
<label>Data Nascimento</label>
<input type="date" id="DataNasc1" name="DataNasc" value="'.$row["DataNasc"].'" class="form-control" style="width:150px;"/>
</td>
</tr>
</table>
</fieldset>
</form>
<div>
';
}
$output;
echo $output;
}
That's how it works, but I still wanted to make one thing better. I see the first record, but when I see the second the first is always open and should hide when I open the second. The second record opens when I click on view and hides when I click hide.
Also I wanted the Edit and New button, always according to the div that I open and in my project if there are two registry open the two buttons at the beginning of the project and should open as I open the div, I show in the image:
When I open the first time the:
enter image description here
When I see the first record:
enter image description here
When I see the second record:
enter image description here
Hi what you can do is hide your modal in your html content, and fill it with your ajax then once you have the data you can display it ,you can do it this way:
your php script:
if (isset($_POST["action"])) {
$action = $_POST["action"];
switch ($action) {
case 'SLC':
if (isset($_POST["id"])) {
$id = $_POST["id"];
if (is_int($id)) {
$query = "select * from client where clientId = '$id' ";
$update = mysqli_query($mysqli, $query);
$response = array();
while($row = mysqli_fetch_array($update)){
.......
// you need to fill the response array here with the info you
//want to display and send it with json encode later
}
echo json_encode($response);
}
}
break;
}
}
Where action can be a command you want to do SLC, UPD, DEL etc and id is a parameter
then in your ajax:
function getInfo(id) {
return $.ajax({
type: "POST",
url: "getInfo.php",
data: { action: "SLC", id:id }
})
}
then call it like this:
getInfo(id).done(function(response){
var data=JSON.parse(response);
if (data != null) {
$('#form_id').trigger("reset");
//fill your modal form using your data and display the modal after reset the form
$("#modal").show();
}
})
Hope it helps
I have a module where a user can upload a profile picture. I want to do several things when a user uploads a picture to there profile, but I am trying to take it in steps, the first step being getting the picture saved and uploaded to the server. Right now, the user can select there picture just fine, after the user has chosen there picture, it gives a little notice that the picture is uploading. I don't know if something is supposed to show after uploading or if it is just supposed to go away (I joined a friend in getting this site done, the module was already here; I'm trying to get the functionality finished up and working).
This is what it looks like:
I have noticed though, that if you click save nothing seems to happen. Like the save button is not set up correctly or something.
I suspect that the the issue of the pictures not being uploaded is either because of the "Uploading..." text or the save button not working. I have tried to debug by echoing out if $_FILES is getting the picture that I am trying to upload, but the module does not reload to allow me to see if $_FILES is getting anything (it's not making it to the if loop of what happens after the save button has been clicked.
Here is the code for the module itself:
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
</div>
<div class="modal-body">
<center>
<h3>Edit Profile Picture</h3>
<img src="images/default.png" name="aboutme" width="140" height="140" border="0" class="img-circle"></a></br></br></br></br></br></br></br>
</center>
<div class="modal-body">
<form id="cropimage" method="post" enctype="multipart/form-data" action="upload_pic/change_pic.php">
<strong>Upload Image:</strong> <br><br>
<input type="file" name="profile-pic" id="profile-pic" />
<input type="hidden" name="hdn-profile-id" id="hdn-profile-id" value="1" />
<input type="hidden" name="hdn-x1-axis" id="hdn-x1-axis" value="" />
<input type="hidden" name="hdn-y1-axis" id="hdn-y1-axis" value="" />
<input type="hidden" name="hdn-x2-axis" value="" id="hdn-x2-axis" />
<input type="hidden" name="hdn-y2-axis" value="" id="hdn-y2-axis" />
<input type="hidden" name="hdn-thumb-width" id="hdn-thumb-width" value="" />
<input type="hidden" name="hdn-thumb-height" id="hdn-thumb-height" value="" />
<input type="hidden" name="action" value="" id="action" />
<input type="hidden" name="image_name" value="" id="image_name" />
<div id='preview-profile-pic'></div>
<div id="thumbs" style="padding:5px; width:600p"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" id="save_crop" class="btn btn-primary">Save</button>
</div>
</div></br>
<div class="container">
<div id="profile_pic_modal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Upload Profile Picture</h3>
</div>
<div class="modal-body">
<form id="cropimage" method="post" enctype="multipart/form-data" action="upload_and_change.php">
<strong>Upload Image:</strong> <br><br>
<input type="file" name="profile-pic" id="profile-pic" />
<input type="hidden" name="hdn-profile-id" id="hdn-profile-id" value="1" />
<input type="hidden" name="hdn-x1-axis" id="hdn-x1-axis" value="" />
<input type="hidden" name="hdn-y1-axis" id="hdn-y1-axis" value="" />
<input type="hidden" name="hdn-x2-axis" value="" id="hdn-y2-axis" />
<input type="hidden" name="hdn-thumb-width" id="hdn-thumb-width" value="" />
<input type="hidden" name="hdn-thumb-height" id="hdn-thumb-height" value="" />
<input type="hidden" name="action" value="" id="action" />
<input type="hidden" name="image_name" value="" id="image_name" />
<div id='preview-profile-pic'></div>
<div id="thumbs" style="padding:5px; width:600p"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" id="save_crop" class="btn btn-primary" name="save">Save</button>
</div>
</div>
</div>
</div>
</div>
</br></br></br></br></br>
</div>
</div>
</div>
This is the function.js where I think the "Uploading..." is coming from:
jQuery(document).ready(function(){
/* When click on change profile pic */
jQuery('#change-profile-pic').on('click', function(e){
jQuery('#profile_pic_modal').modal({show:true});
});
jQuery('#profile-pic').on('change', function() {
jQuery("#preview-profile-pic").html('');
jQuery("#preview-profile-pic").html('Uploading....');
jQuery("#cropimage").ajaxForm(
{
target: '#preview-profile-pic',
success: function() {
jQuery('img#photo').imgAreaSelect({
aspectRatio: '1:1',
onSelectEnd: getSizes,
});
jQuery('#image_name').val(jQuery('#photo').attr('file-name'));
}
}).submit();
});
/* handle functionality when click crop button */
jQuery('#save_crop').on('click', function(e){
e.preventDefault();
params = {
targetUrl: '/upload_pic/change_pic.php?action=save',
action: 'save',
x_axis: jQuery('#hdn-x1-axis').val(),
y_axis : jQuery('#hdn-y1-axis').val(),
x2_axis: jQuery('#hdn-x2-axis').val(),
y2_axis : jQuery('#hdn-y2-axis').val(),
thumb_width : jQuery('#hdn-thumb-width').val(),
thumb_height:jQuery('#hdn-thumb-height').val()
};
saveCropImage(params);
});
/* Function to get images size */
function getSizes(img, obj){
var x_axis = obj.x1;
var x2_axis = obj.x2;
var y_axis = obj.y1;
var y2_axis = obj.y2;
var thumb_width = obj.width;
var thumb_height = obj.height;
if(thumb_width > 0) {
jQuery('#hdn-x1-axis').val(x_axis);
jQuery('#hdn-y1-axis').val(y_axis);
jQuery('#hdn-x2-axis').val(x2_axis);
jQuery('#hdn-y2-axis').val(y2_axis);
jQuery('#hdn-thumb-width').val(thumb_width);
jQuery('#hdn-thumb-height').val(thumb_height);
} else {
alert("Please select portion..!");
}
}
/* Function to save crop images */
function saveCropImage(params) {
jQuery.ajax({
url: params['targetUrl'],
cache: false,
dataType: "html",
data: {
action: params['action'],
id: jQuery('#hdn-profile-id').val(),
t: 'ajax',
w1:params['thumb_width'],
x1:params['x_axis'],
h1:params['thumb_height'],
y1:params['y_axis'],
x2:params['x2_axis'],
y2:params['y2_axis'],
image_name :jQuery('#image_name').val()
},
type: 'Post',
success: function (response) {
jQuery('#profile_pic_modal').modal('hide');
jQuery(".imgareaselect-border1,.imgareaselect-border2,.imgareaselect-border3,.imgareaselect-border4,.imgareaselect-border2,.imgareaselect-outer").css('display', 'none');
jQuery("#profile_picture").attr('src', response);
jQuery("#preview-profile-pic").html('');
jQuery("#profile-pic").val();
},
error: function (xhr, ajaxOptions, thrownError) {
alert('status Code:' + xhr.status + 'Error Message :' + thrownError);
}
});
}
});
I have attempted to comment out the line jQuery("#preview-profile-pic").html('Uploading....'); but that does not seem to remove the "Uploading..." text and the picture still does not upload.
If someone could help me figure out why the module is not working correctly, I would greatly appreciate it. If there is an easier way to get the functionality I am looking for, please let me know.
From my analysis, I did ran the code and found lots of more errors but the following are the key issues to address first.
Your code uses an assigned header file, as seen here ,that carries all the snippets for CDN jquery files. if you would have opened your console while its 'Uploading...' you would have noticed an error like one in this pic
First impression is that no jQuery.form.js file was found which is responsible for this function. If you go further and confirm that it is correctly loaded, Use this function here to check its loading:
(function() {
var startingTime = new Date().getTime();
// Load the script
var script = document.createElement("SCRIPT");
script.src = 'dist_files/jquery.form.js';
script.type = 'text/javascript';
document.getElementsByTagName("head")[0].appendChild(script);
// Poll for jQuery to come into existance
var checkReady = function(callback) {
if (window.jQuery) {
callback(jQuery);
}
else {
window.setTimeout(function() { checkReady(callback); }, 20);
}
};
// Start polling...
checkReady(function($) {
$(function() {
var endingTime = new Date().getTime();
var tookTime = endingTime - startingTime;
window.alert("jQuery.form is loaded, after " + tookTime + " milliseconds!");
});
});
})();
if you would use this function to check if its correctly loaded, after then, if it loads, your next victim is your jQuery, this is because of compatibility issues, the jQuery.form.js version used requires a jQuery of 1.5.x or higher.
Secondly,you have to check that you don't have any conflict with your imports, if in your project you used a version like
Assuming you had used jQuery in your other functions before the profile thing came in, which in this case came with its imports.
<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
then definitely you'll not have jQuery functioning, meaning, jQuery will no work, and also, the same guy needs to call jQuery.form.js, now you see you'll come back to the same error. so harmonize your imports and delete any duplicates in .js imports and also .css files(although there is no css conflict currently but just for your info)
Once you clean the imports(I advise you use CDN if you are developing with good network connection) clear your browser caches and redo the upload with 'inspect element option in your browser' Do this:
Right click an empty space on browser
select 'inspect element'
switch in the inspector to 'Console' and you'll be able to see the errors if any.
your end result should work and get something of this sort:
I've installed the blueimp jQuery-file-upload
but I had a big problem to modify the view after you finish uploading, I want to do a show all by making the image raised in a specific div
I hope all edits must be in jquery.fileupload-uix.js ,
and in this code exactly :
this.getFileUrl = function (file, handler) {
return file.url;
};
this.getThumbnailUrl = function (file, handler) {
return file.thumbnail;
};
this.buildMultiDownloadRow = function (files, handler) {
var rows = $('<tbody style="display:none;"/>');
$.each(files, function (index, file) {
rows.append(handler.buildDownloadRow(file, handler).show());
});
return rows;
};
this.buildDownloadRow = function (file, handler) {
if ($.isArray(file)) {
return handler.buildMultiDownloadRow(file, handler);
}
var fileName = handler.formatFileName(file.name),
fileUrl = handler.getFileUrl(file, handler),
thumbnailUrl = handler.getThumbnailUrl(file, handler),
downloadRow = handler.downloadTemplate
.clone().removeAttr('id');
downloadRow.attr('data-id', file.id || file.name);
downloadRow.find('.file_name a')
.text(fileName);
downloadRow.find('.file_size')
.text(handler.formatFileSize(file.size));
if (thumbnailUrl) {
downloadRow.find('.file_download_preview').append(
$('<a/>').append($('<img/>').attr('src', thumbnailUrl || null))
);
downloadRow.find('a').attr('target', '_blank');
}
downloadRow.find('a')
.attr('href', fileUrl || null)
.each(handler.enableDragToDesktop);
downloadRow.find('.file_download_delete button')
.button({icons: {primary: 'ui-icon-trash'}, text: false});
return downloadRow;
};
and in HTML :
<div id="file_upload" class="panel">
<form action="upload.php" method="POST" enctype="multipart/form-data">
<div id="buttons">
<div id="file-wrapper" class="title" title="upload images from your computer">
<input type="file" name="file[]" multiple="" accept="image/jpeg,image/gif,image/png,image/bmp" />
</div>
<div class="center">
<input type="button" id="url" class="button-big title" title="upload images from the web" value="" />
</div>
</div>
</form>
<table class="files">
<tr class="file_upload_template" style="display:none;">
<td class="file_upload_preview"></td>
<td class="file_name"></td>
<td class="file_size"></td>
<td class="file_upload_progress"><div></div></td>
<td class="file_upload_start"><button>Start</button></td>
<td class="file_upload_cancel"><button>Cancel</button></td>
</tr>
<tr class="file_download_template" style="display:none;">
<td class="file_name"><a></a></td>
<td class="file_size"></td>
<td class="file_download_delete" colspan="3"><button>Delete</button></td>
</tr>
</table>
<div class="file_upload_overall_progress"><div style="display:none;"></div></div>
<div class="file_upload_buttons">
<button class="button-big file_upload_start">Start All</button>
<button class="file_upload_cancel">Cancel All</button>
</div>
</div>
<br />
<div class="panel">
<div id="shows">
<!-- HERE I Want to repeat the div like -->
<div class='preview'>
<h2>name</h2>
<img srch='img' />
</div>
</div>
</div>
I try and try but there are no code that I believe that it good to show.