@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btnlvl:
AlertDialog.Builder builder = new AlertDialog.Builder(ActivityLvl.this);
builder.setTitle("Внимание!")
.setMessage("Вы действительно хотите перейти на другое активити?")
.setIcon(R.drawable.phiz)
.setCancelable(false)
.setPositiveButton("Перейти",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
Intent intent = new Intent(this, ActivityOne.class);
startActivity(intent);
}
});
AlertDialog alert = builder.create();
alert.show();
// TODO Call second activity
break;
default:
break;
}
}
function wherePriceBetween($from_price, $to_price){
$sql = "SELECT * from `table` where `price` BETWEEN {$from_price} AND {$to_price}";
//....
}
function search($price_on, $price_to){
$query = "SELECT * FROM `table` WHERE 1=1";
if($price_on) $query .= " AND `price-on` = {$price_on}";
if($price_to) $query .= " AND `price-to` = {$price_to}";
}
function search($price_on, $price_to){
$query = "SELECT * FROM `table` WHERE 1=1";
if($price_on) $query .= " AND `price-on` >= {$price_on}";
if($price_to) $query .= " AND `price-to` <= {$price_to}";
}
navbar-right
вам в помощь $arr = ['one', 'two', 'trip']; // php array
var arr = ['one', 'two', 'trip']; // js array
в js просто
{key: value, key2: value}
методы
$obj->getSomething()
в js
obj.getsomething()