$sql = mysql_query("SELECT * FROM TotalTickets ORDER BY email ASC") or die(mysql_error());
$cust_email = false; $cust_txt = ""; $cust_sum = 0;
while($cust = mysql_fetch_array($sql, MYSQL_ASSOC))
{
if ($cust_email !== false AND $cust_email != $cust['email'])
{
echo '<tbody class="labels">
<tr>
<td colspan="5">
<label for="accounting">'.$cust_email.': '.round($cust_sum, 2).'</label>
<input type="checkbox" name="accounting" id="accounting" data-toggle="toggle">
</td>
</tr>
</tbody>
<tbody class="hide">
'.$cust_txt.'
</tbody> ';
$cust_email = $cust['email'];
$cust_txt = "";
$cust_sum = 0;
}
$cust_sum += $cust['price'];
$cust_txt .= ' <tr>
<td>'.$cust['filmName'].'</td>
<td>'.$cust['date'].'</td>
<td>'.$cust['timeBegin'].'</td>
<td>'.$cust['price'].'</td>
<td>0</td>
</tr>';
}
if (!empty($cust_txt))
{
echo '<tbody class="labels">
<tr>
<td colspan="5">
<label for="accounting">'.$cust_email.': '.round($cust_sum, 2).'</label>
<input type="checkbox" name="accounting" id="accounting" data-toggle="toggle">
</td>
</tr>
</tbody>
<tbody class="hide">
'.$cust_txt.'
</tbody> ';
}
echo(getcwd()."<br>\n");
echo(realpath("../folder/folder2/b.php")."<br>\n");
var_dump(file_exists("../folder/folder2/b.php"));
<a href='index.php?lang=EN'>EN</a> | <a href='index.php?lang=RU'>RU</a>
<?php
// index.php
$xmlURL = "http://domain.com/lang/en.xml";
if (!empty($_REQUEST['lang']) AND $_REQUEST['lang'] == "RU")
{
$xmlURL = "http://domain.com/lang/ru.xml";
}
?>
$cnt_element=1; //зададим нумерацию
$str1 = $str2 = "";
while($ob = $res->GetNextElement()){ //вытащим из массива элементы
$arFields = $ob->GetFields(); //поля элементов
$arProps = $ob->GetProperties(); // свойства элементов
//покажем элементы после первых трех из выборки. ПЕРВАЯ ГРУППА
// должно быть "Элемент4", "Элемент5", "Элемент6"....
if (empty($arFields[PROPERTY_PHOTOMODULECHECK_VALUE]))
{ $str1 .= "<div class='itemsnew-list-item-wrapper'>{$arFields['NAME']}</div>"; }
//покажем самые первые 3 элемента, но в конце списка. ВТОРАЯ ГРУППА
// должно быть "Элемент1", "Элемент2", "Элемент3"....
if (!empty($arFields[PROPERTY_PHOTOMODULECHECK_VALUE]))
{ $str2 .= "<div class='itemsnew-list-item-wrapper'>{$arFields['NAME']}</div>"; }
if ($cnt_element == 6)
{ echo($str1.$str2); $str1 = $str2 = ""; $cnt_element = 0; }
$cnt_element++;
}
<html>
<head>
<script src='https://code.jquery.com/jquery-3.4.1.js'></script>
</head>
<body>
<div class='tabs'>
<ul><li>Tab1</li><li>Tab2</li></ul>
<div><div style='display:none;'>1111</div><div style='display:none;'>2222</div></div>
</div>
<script type='text/javascript'><!--
(function($){
jQuery.fn.lightTabs = function(options){
var createTabs = function(){
tabs = this;
i = 0;
showPage = function(i){
$(tabs).children("div").children("div").hide();
$(tabs).children("div").children("div").eq(i).show();
$(tabs).children("ul").children("li").removeClass("active");
$(tabs).children("ul").children("li").eq(i).addClass("active");
}
showPage(0);
$(tabs).children("ul").children("li").each(function(index, element){
$(element).attr("data-page", i);
i++;
});
$(tabs).children("ul").children("li").click(function(){
showPage(parseInt($(this).attr("data-page")));
});
};
return this.each(createTabs);
};
})(jQuery);
$(document).ready(function(){
$(".tabs").lightTabs();
});
//--></script>
</body>
</html>
SELECT DATE_FORMAT(date,'%d.%m.%Y') as date1, `date`, `date` - INTERVAL 1 DAY AS `prevDate`, `price_product` FROM `prices` FORCE INDEX (`id_product`) WHERE `id_product` = 235408123 ORDER BY `date`
$DB = mysqli_connect("localhost", "_username_", "_password_", "_database_") or die(mysqli_error($DB));
function ping($IP)
{
global $DB;
if (!preg_match("/^(\d{1,3})(\.\d{1,3}){3}$/", $IP)) return false;
exec('ping -c 2 -i 0.2 ' .$IP,$ping);
$nachalo = substr($ping[1],0,4);
if ($nachalo !== "From")
{
mysqli_query($DB, "INSERT INTO _Primer_ (_row_) VALUES(1)") or die(mysqli_error($DB));
}
else
{
mysqli_query($DB, "INSERT INTO _Primer_ (_row_) VALUES(0)") or die(mysqli_error($DB));
}
}