$(document).ready(function() {
var a = '1';
var b = '2';
getText(a);
function getText(text) {
$.ajax({
type: "POST",
data: {parametr: text},
url: "text.php",
success: function (text) {
$('#box').empty();
$('#box').append(text);
}
});
}
$(document).on(
'click',
'a',
function(){
getText(b);
}
);
});
if($_POST['parametr'] == '1'){
$block_1 = '<p>some text</p>';
echo $block_1;
} else if($_POST['parametr'] == '2'){
$block_2 = '<p>another some text</p>';
echo $block_2;
}
function getPrice() {
$.ajax({
type: "POST",
data: {operation: 'getprice'},
url: "index.php",
dataType: "json",
success: function (json) {
}
});
}
function getPrice() {
$.ajax({
type: "POST",
data: {operation: 'getprice'},
url: "index.php",
success: function (data) {
$('#price').empty();
$('#price').append(data);
}
});
}
if($_POST['dateStart'] != "" && $_POST['dateEnd'] != "") {
$dateStart = $_POST['dateStart'];
$dateEnd = $_POST['dateEnd'];
$query = "SELECT * FROM orders_1C WHERE date_order BETWEEN '" . $dateStart . "' AND '" . $dateEnd . "' AND code_client='000002805'";
} else {
$query = "SELECT * FROM orders_1C WHERE code_client='000002805'";
}
$result = db_connection($query);
$orders_1C = array();
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
array_push($orders_1C, array('id' => $row['id_order'], 'date' => $row['date_order'], 'product' => $row['product'], 'tirag' => $row['tirag'], 'price' => $row['price'], 'status' => $row['status']));
}
echo json_encode(array("orders1C" => $orders_1C));
exit;
$('#calculationTypeProduct').change(function(){
if($(this).val() == '1') {
$('#vizitka').css('display','block');
$('#fotoPrint').css('display','none');
$('#blank').css('display','none');
} else if($(this).val() == '2') {
$('#vizitka').css('display','none');
$('#fotoPrint').css('display','none');
$('#blank').css('display','block');
} else if($(this).val() == '3') {
$('#vizitka').css('display','none');
$('#fotoPrint').css('display','block');
$('#blank').css('display','none');
}
});