How to implement the Delete functionality by using AJAX in following case? - javascript

I'm using PHP, Smarty, MySql, jQuery, etc. for my website. I'm fetching large amount of data from the database and displaying this data on a webpage. This data is nothing but matching question ids. It takes long time to fetch and display the matching question ids of a selected subject's selected topic onto a webpage.
Now what I want to achieve is to delete the question by clicking on a Delete icon. But this should be done by using AJAX such that the selected question_id should get deleted and the other matching question ids should get displayed. While doing this the page should not get refresh. So I have to do this by using AJAX only. Can anyone help me in this regard please? For your better understanding I'm putting below the code snippet from PHP file as well as Smarty template. I've also attached thescreenshot of the UI which displays matching question_ids. Currently I've implemented the normal delete functionality by means of jQUery Colorbox pop-up.
Code from PHP file is as follows:
match_question.php
<?php
$objQuestionMatch = new QuestionMatch();
switch($op) {
case "delete":
if($request['question_id']!="")
$question_id = $request['question_id'];
if(!empty($question_id)) {
/*Fetch the subject_id and topic_id of the question to assign into a query string*/
$question_data = $objQuestionMatch->GetSubjectIdAndTopicId($question_id);
$subject_id = $question_data['question_subject_id'];
$topic_id = $question_data['question_topic_id'];
$ret = $objQuestions->DeleteQuestion($question_id);
// if question is not deleted come back on the same page of match question ids
if(!$ret)
$return_url = "match_question.php?subject_id=".$subject_id."&topic_id=".$topic_id;
else
$return_url = "match_question.php?subject_id=".$subject_id."&topic_id=".$topic_id."&del_questions_suc=1";
header("Location:".$return_url);
}
die();
break;
}
?>
The Smarty template file is as follows:
match-question.tpl
<div class="breadcrumb-wrap">
{include file='resources-sub-menu.tpl'}
<ul class="page-flow">
<li>Home<span>></span></li>
<li>Questions</li>
</ul>
</div>
<h1 class="c-heading"> Match Questions </h1>
<div class="c-grad-box fnShowData">
<div class="form-wrapper">
<form id="view-questions-form" name="questions_filter" action="{$control_url}modules/questions/match_question.php" method="post">
<input type="hidden" name="page" id="page" value="1" >
<div class="w50">
<ul>
<li>
<label>Subjects</label>
<div class="form-element">
<select name="subject_id" id="subject_id" onchange="get_topics_by_subject(this.value, 'get_topics_by_subject_for_filter', '#topic_id'); return false;">
<option value="">All</option>
{foreach from=$all_subjects item=subjects key=key}
<option value="{$subjects.subject_id}" {if $subject_id == $subjects.subject_id} selected="selected"{/if}>{$subjects.subject_name}</option>
{/foreach}
</select>
</div>
</li>
</ul>
</div>
<div class="w50">
<ul>
<li>
<label>Topics</label>
<div class="form-element">
<select name="topic_id" id="topic_id">
<option value="">All</option>
{foreach from=$all_topics item=topics key=key}
<option value="{$topics.topic_id}" {if $topic_id==$topics.topic_id} selected="selected"{/if}>{$topics.topic_name}</option>
{/foreach}
</select>
</div>
</li>
<li>
<div class="find-que-ans">
<p class="custom-form"><label></label></p>
<input type="submit" class="c-btn submit_form" name="btn_submit" id="btn_submit" value="Match Questions" />
</div>
</li>
</ul>
</div>
</form>
</div>
</div>
{if "" != $info_msg} <div class="c-msg-seccess"> {$info_msg} <a class="c-close fnClose" href="#"></a> </div>{/if}
<br/><br/>
<form id="delete-questions-form" name="delete-questions-form" action="{$control_url}modules/questions/match_question.php" method="post">
<table width="100%" class="base-table tbl-practice" cellspacing="0" cellpadding="0" border="0">
<tr class="evenRow">
<th width="33%" style="text-align:center;" class="question-id">Que ID</th>
<th width="33%" style="text-align:center;" class="question-id">Matching Que IDs</th>
<th width="33%" style="text-align:center;" class="question-id">Percentage(%)</th>
</tr>
{if $all_match_questions}
{foreach from=$all_match_questions item=qstn key=key}
{if $qstn.similar_questions_ids_and_percentage}
<tr class="oddRow">
<td class="question-id" align="center" valign="top">
QUE{$qstn.question_id}{if $qstn.question_appeared_count gt 0}-Appeared({$qstn.question_appeared_count}){/if}
</td>
<td class="question" align="center" valign="top">
{foreach from=$qstn.similar_questions_ids_and_percentage item=question key=q_no}
{if $question.question_id!=''}
QUE{$question.question_id}{if $question.question_appeared_count gt 0}-Appeared({$question.question_appeared_count}){/if}
{if $question.question_appeared_count eq 0}
Delete
{/if}
{/if}<br />
{/foreach}
</td>
<td class="question" align="center" valign="top">
{foreach from=$qstn.similar_questions_ids_and_percentage item=question key=q_no}
{if $question.percentage!=''}{$question.percentage}{/if}<br />
{/foreach}
</td>
</tr>
{/if}
{/foreach}
{else}
<tr>
<td colspan="2" align="center"><b>No Questions Available</b></td>
</tr>
{/if}
</table>
</form>
<div class="hidden">
<div id="deletePopContent" class="c-popup">
<h2 class="c-popup-header">Delete Question</h2>
<div class="c-content">
<h3>Are you sure to delete this question?</h3>
<p class="alert"><strong>You are about to perform an action which can't be undone</strong></p>
NoDelete
</div>
</div>
</div>
{literal}
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$(".inline_view_question_detail").colorbox({href:$(this).attr('href'),width:'auto', height:'auto'});
$(".delete_question").click(function(e) {
var delete_url = $(this).attr('delhref');
$('#delete_url').attr('href', delete_url);
$(".delete_question").colorbox({inline:true, width:666});
$(".c-btn").bind('click', function(){
$.colorbox.close();
});
});
});
</script>
{/literal}

My method deleted the item and then directly reloads the page. If you don't want to reload, use hide()
function handleDelete()
{
var tbody = $('tbody tr');
$('td div.delete.order').click(function() {
var status = window.confirm('Do you really want to delete your article?');
if (status)
{
if(! $('td div.delete.order').hasClass('confirm'))
{
id = $(this).attr('id');
var data = {
id_delete: id,
};
$.ajax({
url: 'your PHP script url',
dataType: 'json',
type: 'post',
data: data,
success: function(data) {
//Item removed, now reload
$(this).parent().remove();
window.location.reload(true);
}
});
}
});
}

Related

Javascript read 3 data ->print realtime db firebase

Can anyone tell me how to make the print button I click match the data in the table?, for the data in the table using a realtime database. Of the three buttons it always reads the first data. Please help, thank you.
this is a table image.
This is the data that always comes out even though I click print in the second or third data.
realtimedb.
this is my html
<table class="table" >
<thead id="root">
<th>No</th>
<th>nama</th>
<th>tempatlahir</th>
<th>tanggallahir</th>
<th>alamat</th>
<th>action</th>
<iframe src="suratsktm.html" name="frame" style="display: none;"></iframe>
</thead>
<tbody>
</tbody>
</table>
db and read data for table javascript
var firebaseConfig = {
};
firebase.initializeApp(firebaseConfig);
var firebaseRef = firebase.database().ref("FormSktm");
firebaseRef.once("value", function(snapshot){
var stdNo = 0;
snapshot.forEach(function(element){
document.getElementById('root').innerHTML +=`
<div>
<td> ${innerHTML = ++stdNo}</td>
<td>${element.val().nama}</td>
<td>${element.val().tempatlahir}</td>
<td>${element.val().tanggallahir}</td>
<td>${element.val().alamat}</td>
<td><input type="button" onclick="frames['frame'].print()" value="print"></td>
</div>`
});
})
and this is the page to print
<ul >
<div id="logo_surat">logo </div>
<div id="nomer_surat">
<div class="nama_surat">Surat Keterangan Tidak Mampu</div>
<div>Nomor : </div>
</div>
<div id="surat_pembuka">
Yang bertanda tangan dibawah ini ,
Kepala Desa ,
Kecamatan, Kabupaten menerangkan dengan
sebenarnya bahwa orang tersebut dibawah ini :
</div>
<div class="content_surat">
<div>
<label>Nama
</label>
<label id="namaSktm" class="isian_surat"></label></div>
<div>
<label>Tempat lahir
</label>
<span id="ttlSktm" class="isian_surat"></span></div>
<div>
<label>Tanggal lahir
</label>
<label id="tglSktm" class="isian_surat"></label></div>
<div>
<label>Alamat
</label>
<label id="alamatSktm" class="isian_surat"></label></div>
</div>
<div id="surat_penutup"> Demikian Surat Keterangan ini diberikan, untuk
dapat digunakan sebagaimana mestinya.</div>
<div id="tanda_tangannya">ttd disini</div>
</ul>

piwik capture value behind dynamically generated download button from asp

A web site is developped in asp.net and let people choose pictures to download.
The website groups them togheter and people can then push a download button per picture.
As we never know how many pictures that eventually will be downloaded the button are dynamically generated.
I'm not permitted to alter the asp.net code on the server only in the piwik part...
The problem is that also the id's are dynamically generated..
I have tried with this:
$("h2").on("click", "a.button button-dl", function(){
alert($(this).text());
});
But got no result, In this case I would like to retrieve "276173" in a variable.
I hope that somebody can help me, thanks for reading
Guy
<table class="checkout-basket" cellspacing="0" rules="all" border="1" id="ctl00_ctl00_cphContent_cphContent_gvBasketitem" style="border-collapse:collapse;">
<tr>
<th scope="col"> </th><th scope="col"> </th><th scope="col">Asset</th><th scope="col"> </th>
</tr><tr>
<td style="width:30px;">
<input id="ctl00_ctl00_cphContent_cphContent_gvBasketitem_ctl02_CbFlag" type="checkbox" name="ctl00$ctl00$cphContent$cphContent$gvBasketitem$ctl02$CbFlag" />
</td><td style="width:80px;">
<a onclick="return confirm('Bent u zeker dat u deze asset wil verwijderen?');" id="ctl00_ctl00_cphContent_cphContent_gvBasketitem_ctl02_lbDelete" class="button" href="javascript:__doPostBack('ctl00$ctl00$cphContent$cphContent$gvBasketitem$ctl02$lbDelete','')">verwijder</a>
</td><td style="width:100px;">
<img id="ctl00_ctl00_cphContent_cphContent_gvBasketitem_ctl02_Image1" src="../../cache/images/thumb/3AF267A169AAED70770F0EEE7E74FBB61A526EBB_156.jpg" style="width:80px;border-width:0px;" />
</td>
<td>
<h2>
<a href='/nl-BE/asset/276173/'>
276173
</a>
</h2>
<h2>
<a href='/nl-BE/asset/276173/'>
20151109_113939_0040
</a>
</h2>
<a class="button button-dl" href="javascript:__doPostBack('ctl00$ctl00$cphContent$cphContent$gvBasketitem$ctl02$ctl00','')" style="margin-top: 4px;"><img style="position: relative; top: 4px; right: 5px" src="/images/picto/download.png" />Download</a>
</td><td>
<div id="ctl00_ctl00_cphContent_cphContent_gvBasketitem_ctl02_pnl">
<input type="hidden" name="ctl00$ctl00$cphContent$cphContent$gvBasketitem$ctl02$hfAsset" id="ctl00_ctl00_cphContent_cphContent_gvBasketitem_ctl02_hfAsset" value="276173" />
<span id="ctl00_ctl00_cphContent_cphContent_gvBasketitem_ctl02_rblPrint" class="rbl"><input id="ctl00_ctl00_cphContent_cphContent_gvBasketitem_ctl02_rblPrint_0" type="radio" name="ctl00$ctl00$cphContent$cphContent$gvBasketitem$ctl02$rblPrint" value="False" checked="checked" /><label for="ctl00_ctl00_cphContent_cphContent_gvBasketitem_ctl02_rblPrint_0">Download</label><br /><input id="ctl00_ctl00_cphContent_cphContent_gvBasketitem_ctl02_rblPrint_1" type="radio" name="ctl00$ctl00$cphContent$cphContent$gvBasketitem$ctl02$rblPrint" value="True" /><label for="ctl00_ctl00_cphContent_cphContent_gvBasketitem_ctl02_rblPrint_1">Print</label></span>
<div class="printFormat" style="display: none; padding: 3px 0 3px 20px;">
<select name="ctl00$ctl00$cphContent$cphContent$gvBasketitem$ctl02$ddlPrint" id="ctl00_ctl00_cphContent_cphContent_gvBasketitem_ctl02_ddlPrint">
<option selected="selected" value="">--</option>
<option value="9cmx13cm">9cmx13cm</option>
<option value="10cmx15cm">10cmx15cm</option>
</select>
</div>
</div>
</td>
</tr><tr>
I eventually found a solution thanks to the answer below..
This is what I used
var newstr = "1";
var addressValue = "1";
$(".button.button-dl").click(function () {
var addressValue = $(this).attr('href');
console.log("tweede ",addressValue );
var re = /'(.*?)'/;
var re2 = /\$/gi;
var m = addressValue.match(re);
if (m != null)
idVal = (m[0].replace(re, '$1'));
console.log("idVal ",idVal);
var newstr = idVal.replace(/\$/gi, "_").slice(0,-6)+"_hfAsset";
console.log("newstr ",newstr);
console.log(document.getElementById(newstr).value);
});
You have a hierarchy problem:
First, a CSS problem: "a.button button-dl" should be "a.button.button-dl" (both classes are on the anchor tag).
Second, that anchor tag is not contained within an h2, so your event is never triggering. At best, you can use the td tag.
So your JS might look like:
$("td").on("click", "a.button.button-dl", function () {
alert($(this).text());
});

Tried Every Thing But Still Getting OBJECT NOT FOUND error in Xamp when i hit submit button?

I was following some tutorials about ecommerce site in PHP and MySQL.
But when i hit submit button I get OBJECT NOT FOUND ERROR.
Below is the code,please guide me. Directories etc. are fine. I've also tried enclosing the button in seprate form tag but nothing worked.
<?php
include("includes/db.php");
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Add Products</title>
</head>
<body bgcolor="#3B6AD8">
<form method="post" action="insert_product" enctype="multipart/form-data">
<table width="700" height="650" align="center" border="2" bgcolor="#F3F3F3">
<tr>
<td colspan="2">
<h2 align="center">Insert Product Here</h2>
</td>
</tr>
<tr>
<td><b>Product Title</b></td>
<td><input type="text" name="product_title" /></td>
</tr>
<tr>
<td><b>Product Category</b></td>
<td>
<select name="product_cat">
<option>Select a Category</option>
<?php
$get_categories = "SELECT * FROM categories";
$run_categories = mysqli_query($con,$get_categories);
while($row_categories =mysqli_fetch_array($run_categories) ) {
$cat_id = $row_categories['cat_ID'];
$cat_title = $row_categories ['cat_title'];
echo "<option value='$cat_id'>$cat_title</option>";
}
?>
</td>
</select>
<tr>
<td><b>Product Brand</b></td>
<td><select name="product_brand">
<option>Select a Category</option>
<?php
$get_brands = "SELECT * FROM brands";
$run_brands = mysqli_query($con,$get_brands);
while($row_brands =mysqli_fetch_array($run_brands) ) {
$brand_id = $row_brands['brand_ID'];
$brand_title = $row_brands['brand_title'];
echo "<option value='$brand_id'>$brand_title</option>";
}
?>
</td>
</select>
</td>
</tr>
<tr>
<td><b>Product Image 1</b></td>
<td>
<input type="file" name="product_img1" />
</td>
</tr>
<tr>
<td><b>Product Image 2</b></td>
<td>
<input type="file" name="product_img2" />
</td>
</tr>
<tr>
<td><b>Product Image 3</b></td>
<td>
<input type="file" name="product_img3" />
</td>
</tr>
<tr>
<td><b>Product Price</b></td>
<td>
<input type="text" name="product_price" />
</td>
</tr>
<tr>
<td><b>Product Description</b></td>
<td>
<textarea name="product_desc" cols="30" rows="5"></textarea>
</td>
</tr>
<tr>
<td>Product Keywords</td>
<td>
<input type="text" name="product_keywords" />
</td>
</tr>
<tr align="center">
<td colspan="2">
<form method="post">
<input type="submit" name="add_product" value="Add Product"/>
</form>
</td>
</tr>
</table>
</form>
</body>
</html>
<?php
if(isset($_POST['add_product'])){
//text data variables
$product_title = $_POST['product_title'];
$product_cat = $_POST['product_cat'];
$product_brand = $_POST['product_brand'];
$product_price = $_POST['product_price'];
$product_desc = $_POST['product_desc'];
$product_keywords = $_POST['product_keywords'];
$product_status = 'on';
//Produt Images
$product_img1 = $_FILES['product_img1']['name'];
$product_img2 = $_FILES['product_img2']['name'];
$product_img3 = $_FILES['product_img3']['name'];
//Image Temp Names
$temp_name1 = $_FILES['product_img1']['tmp_name'];
$temp_name2 = $_FILES['product_img2']['tmp_name'];
$temp_name3 = $_FILES['product_img3']['tmp_name'];
if($product_title=="" OR $product_cat=="" OR $product_brand=="" OR $product_price=="" OR $product_desc=="" OR $product_keywords=="" OR $product_img1==""){
echo "<script>alert('Please Fill All The Fields')</script>";
exit();
}
else {
move_uploaded_file($temp_name1,"product_images/product_img1");
move_uploaded_file($temp_name2,"product_images/product_img2");
move_uploaded_file($temp_name3,"product_images/product_img3");
$insert_product_query = "INSERT INTO products(category_ID,brand_ID,date,product_title,product_img1,
product_img2,product_img3,product_price,product_desc,product_status)
values ('$product_cat','$brand_id',
NOW,'$product_title','$product_img1','$product_img2','$product_img3','$product_price','$product_desc',
'$product_status')";
$run_products = mysqli_query($con,$insert_product_query);
if ($run_products){
/*echo "<script>alert('Product inserted successfully')</script>";*/
}
}
}
?>
try to put an extension to your form action="insert_product" ... like .php or .asp .. Also, reform your title to something more like "Object not found on form submit."
Try this:
<form method="post" enctype="multipart/form-data">
Ther are two problems:-
The problem is you write form contains only submit button.Try to remove <form method="post">before button
You write all your code in same page but in form your action is insert_product which have no extension like .php.It's totally wrong
so try to do any one of these two.
a) either define it action= insert_product.php and make a file with that name and put your last form processing code in that file.
b) Or remove form action attribute and write like <form method="post" enctype="multipart/form-data">.
Try 1 point and 2 nd b) point at-once. And check once.

jQuery doesn't display specific hidden content when I use the .show() command

Below is my HTML and jQuery code. jQuery displays the hidden elements, except for the #image4 and #video4 elements, which stay hidden with if I select image or video. All the other elements get displayed correctly.
Any idea why those two won't show?
JS:
$(document).ready(function(){
var fields = jQuery('#image_type');
var select = this.value;
fields.change(function () {
if ($(this).val() == 'image') {
alert($(this).val());
$('#images_pop_up').show();
$('#video1').hide();
$('#video2').hide();
$('#video3').hide();
$('#video4').hide();
$('#image1').show();
$('#image2').show();
$('#image3').show();
$('#image4').show();
$(' #image5').show();
}
else {
$('#images_pop_up').show();
$('#image1').hide();
$('#image2').hide();
$('#image3').hide();
$('#image4').hide();
$('#image5').hide();
$('#video1').show();
$('#video2').show();
$('#video3').show();
$('#video4').show();
$('#image5').show();
}
});
});
HTML:
<div id ="images_pop_up" style="display:none;">
<span id="image1" style="display:none;" ><img src="/uploads/commerce/images/large/easton-163135-wheeled-bag.jpg" border="0" alt="easton-163135-wheeled-bag.jpg" title=" easton-163135-wheeled-bag.jpg " class="productimage"><input type="hidden" name="products_previous_image_lrg" value="easton-163135-wheeled-bag.jpg"><br>Nice bag</span>
<span id ="video1" style="display:none;"></span></td>
<td class="textSmall" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<span id="image3" style="display:none;"><input type="hidden" name="products_previous_image_lrg" value="easton-163135-wheeled-bag.jpg"><input type="hidden" name="products_previous_image_lrg_caption" value="Nice bag"></span>
<span id ="video3"><input type="hidden" name="products_previous_video_embed"><input type="hidden" name="products_previous_video_embed_caption"></span>
<td class="textSmall" valign="top"><span id="image4" style="display:none;">New Image File: <input type="text" name="products_image_lrg" value="easton-163135-wheeled-bag.jpg"><br>Image Caption: <input type="text" name="products_image_lrg_caption" value="Nice bag"></span>
<span id ="video4" style="display:none;">Video Embed field: <input type="text" name="products_video_embed"><br>Video Image Caption: <input type="text" name="products_video_embed_caption"></span>
</td>
<td><span id="image5" style="display:none;"> </span></td>
</tr>
<tr>
<td colspan="2">
<div id='div_img_lrg'></div>
</td>
</tr>
</table>
</td>
</div>
What sticks out most to me is that you're copy pasting when you could be putting CSS to work for you by giving them all the same class (or the appropriate groups of elements the same class at least) and then hiding and showing them based on that.
Your bug is probably caused by a slight typo somewhere in the selectors or the place where you're setting the ids in the markup.
try like this
$(document).ready(function () {
var fields = jQuery('#image_type');
var select = this.value;
$('#image_type').change(function () {
if ($(this).val() == 'image') {
alert($(this).val());
$("[id^=image]").show();
$("[id^=video]").hide();
} else {
$("[id^=video]").show();
$("[id^=image]").hide();
}
});
});

how do I pass a variable from an input box on one page to another page, then submit it?

Here is some code written by a helpful member of this site (the first section) and I put on my site in search2.tpl (I use Smarty templates). The second code bit is the search form on page ONE of my test site, and the third code bit, the entire template from page TWO (incorporating the code from the first section).
What I want to do is "capture" the input from the form on page ONE (second code section), and then use this data to auto-submit to the form on page TWO (third code section). The code, as is, doesn't error out, and goes to the search page when I type in a search query and click submit, but it doesn't search for the entered text or do anything except maybe refresh itself.
Any ideas or help would be greatly appreciated!
<script type="text/javascript">
<!--
function checkForAutoSearch()
{
var searchString = <?php echo (!empty($_POST['new_search_text'])) ? $_POST['new_search_text'] : ''; ?>;
if (searchString)
{
// put searchString into the second search field
document.getElementById('search_text').value = searchString;
// up in your search form, assign the form tag an id first: id="search_form_new"
// then submit the form:
document.getElementById('search_form_new').submit();
}
}
// now fire this function whenever the page loads
window.onload = checkForAutoSearch;
//-->
</script>
-------------
<form id="searchForm_newsearch" action="./search2.php" method="post"><input type="text" name="new_search_text" value=""><input type="submit" value="Search"><input type="submit" value="Cancel" onclick="showSearchLink();return false;"></form><a id="searchLink" class="button_link_main" href="./search2.php" onclick="showSearchForm();return false;"><img src="/images/search.png" onmouseover="this.src='/images/searchsite_hover.png'" onmouseout="this.src='/images/search.png'" /></a>
--------------
{literal}
<script type="text/javascript">
<!--
function checkForAutoSearch()
{
var searchString = <?php echo (!empty($_POST['new_search_text'])) ? $_POST['new_search_text'] : ''; ?>;
if (searchString)
{
// put searchString into the second search field
document.getElementById('search_text').value = searchString;
// up in your search form, assign the form tag an id first: id="search_form_new"
// then submit the form:
document.getElementById('search_form_new').submit();
}
}
// now fire this function whenever the page loads
window.onload = checkForAutoSearch;
//-->
</script>
{/literal}
<img src='./images/icons/search48.gif' border='0' class='icon_big'>
<div>{lang_print id=924}</div>
<br />
<br />
<form id="search_form_new" action='search2.php' name='search_form' method='post'>
<table cellpadding='0' cellspacing='0' align='center'>
<tr>
<td class='search'>
<table cellpadding='0' cellspacing='0' align='center'>
<tr>
<td>{lang_print id=925}</td>
<td> <input style='background-color:#CCCCCC' type='text' size='30' class='text' name='search_text' id='search_text' value='{$search_text}' maxlength='100'></td>
<td>
<input type='submit' class='button' value='{lang_print id=646}'>
<input type='hidden' name='task' value='dosearch'>
<input type='hidden' name='t' value='0'>
</td>
</tr>
<tr>
<td> </td>
<td colspan='2'> <b>-=<a href='search_advanced.php'>Browse Members</a>=-</b></td>
</tr>
</table>
</div>
</form>
</td>
</tr>
</table>
<br>
{if $search_text != ""}
{if $is_results == 0}
<table cellpadding='0' cellspacing='0' align='center'>
<tr>
<td class='result'>
<img src='./images/icons/bulb16.gif' class='icon'>
{lang_sprintf id=927 1=$search_text}
</td>
</tr>
</table>
{else}
{* SHOW DIFFERENT RESULT TOTALS *}
<table class='tabs' cellpadding='0' cellspacing='0'>
<tr>
<td class='tab0'> </td>
{section name=search_loop loop=$search_objects}
<td class='tab{if $t == $search_objects[search_loop].search_type}1{else}2{/if}' NOWRAP>{if $search_objects[search_loop].search_total == 0}{lang_sprintf id=$search_objects[search_loop].search_lang 1=$search_objects[search_loop].search_total}{else}<a href='search2.php?task=dosearch&search_text={$url_search}&t={$search_objects[search_loop].search_type}'>{lang_sprintf id=$search_objects[search_loop].search_lang 1=$search_objects[search_loop].search_total}</a>{/if}</td>
<td class='tab'> </td>
{/section}
<td class='tab3'> </td>
</tr>
</table>
<div class='search_results'>
{* SHOW PAGES *}
{if $p != 1}<a href='search2.php?task=dosearch&search_text={$url_search}&t={$t}&p={math equation='p-1' p=$p}'>« {lang_print id=182}</a> | {/if}
{if $p_start == $p_end}
<b>{lang_sprintf id=184 1=$p_start 2=$total_results}</b> ({lang_sprintf id=928 1=$search_time})
{else}
<b>{lang_sprintf id=185 1=$p_start 2=$p_end 3=$total_results}</b> ({lang_sprintf id=928 1=$search_time})
{/if}
{if $p != $maxpage} | <a href='search2.php?task=dosearch&search_text={$url_search}&t={$t}&p={math equation='p+1' p=$p}'>{lang_print id=183} »</a>{/if}
<br><br>
{* SHOW RESULTS *}
{section name=result_loop loop=$results}
<div class='search_result{cycle name="class_name" values="1,2,2,1"}' style='width: 400px; float: left; border: 1px solid #CCCCCC; margin: 5px;'>
<table cellpadding='0' cellspacing='0'>
<tr>
<td valign='top' style='padding-right: 4px;'>
<img src='{$results[result_loop].result_icon}' class='photo' width='60' height='60' border='0'>
</td>
<td valign='top'>
<div class='search_result_text'>
{capture assign='result_title'}{lang_sprintf id=$results[result_loop].result_name 1=$results[result_loop].result_name_1}{/capture}
{$result_title|truncate:40:"...":true}
<div class='search_result_text2'>{lang_sprintf id=$results[result_loop].result_desc 1=$results[result_loop].result_desc_1 2=$results[result_loop].result_desc_2 3=$results[result_loop].result_desc_3}</div>
{if $results[result_loop].result_online == 1}<div style='margin-top: 5px;'><img src='./images/icons/online16.gif' border='0' class='icon'>{lang_print id=929}</div>{/if}
</div>
</td>
</tr>
</table>
</div>
{cycle name="clear_cycle" values=",<div style='clear: both; height: 0px;'></div>"}
{/section}
<div style='clear:both;'></div><br />
{* SHOW PAGES *}
{if $p != 1}<a href='search2.php?task=dosearch&search_text={$url_search}&t={$t}&p={math equation='p-1' p=$p}'>« {lang_print id=182}</a> | {/if}
{if $p_start == $p_end}
<b>{lang_sprintf id=184 1=$p_start 2=$total_results}</b> ({lang_sprintf id=928 1=$search_time})
{else}
<b>{lang_sprintf id=185 1=$p_start 2=$p_end 3=$total_results}</b> ({lang_sprintf id=928 1=$search_time})
{/if}
{if $p != $maxpage} | <a href='search2.php?task=dosearch&search_text={$url_search}&t={$t}&p={math equation='p+1' p=$p}'>{lang_print id=183} »</a>{/if}
</div>
{/if}
{/if}

Categories