Some Genius help!!!!!! 1) Interface
2) click button ----> MySQL query will show in the box ----> click button "generate CSV" 3) Query "Get product base" always work, "Price base" work on IE several times, then stopped working.
<li>
<input type=button style="width:800px;height:30px;text-align:left;padding-left:20px;"
value="Price base"
sql="select p.model, pd.name, p.ws_price, p.rt_price, p.pc
from product p, product_description pd
where p.product_id = pd.product_id
order by substr(p.model,3,4)"
/>
</li>
<li>
<input type=button style="width:800px;height:30px;text-align:left;padding-left:20px;"
value="Get product base"
sql="select p.model, p.sku, pd.name_for_sales, p.quantity, p.ws_price, p.rt_price
from product p, product_description pd
where p.product_id = pd.product_id
"
/>
</li>
3)
<script type="text/javascript"><!--
$(document).ready(function(){
$('input').bind('click',function(e){
$tgt = $(e.target);
$sql = $tgt.attr('sql');
$('textarea')[0].value = $sql;
});
$('.excel').bind('click',function(e){
//$sql = $('textarea').html().trim();
var ta = $('textarea');
$sql = $('textarea')[0].value;
//alert($sql);
$url = '<?php echo $lnk_export; ?>' + '&sql=' + $sql;
//alert($url);
location.href = $url;
});
});
//-->
</script>