Файл: RootPanel 1.7.0 FreeCode/RootPanel 1.7.0 FreeCode/_rootadmin/_domains.inc.php
Строк: 175
<?
if ($param == "uid" and $search) { print menu_admin_client($search); }
if ($param and $search) {$linkAddon = "param=$param&search=$search";}
if ($sub == 'delete' and $id) {
checkAdminAccess('domainsDelete',1);
$domain = GetDomainById($id);
@mysql_query("delete from orders_domains where id='$id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
@mysql_query("delete from bills where domain_id='$id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
writeAdminLog("Удален домен ID # $id, $domain->domain");
print "Домен и все счета, относящиеся к нему, успешно удалены.<BR><BR>";
}
checkAdminAccess('domainsRead',1);
$myShow = $_SESSION["domainShow"]; if (!$myShow) { $myShow="all"; }
if ($show and $show != $myShow) { $myShow = $show; $_SESSION["domainShow"] = $myShow; }
$mySort = $_SESSION["domainSort"];
if ($myShow == "all") {
$where = "";
} else if ($myShow == "obrab") {
$where = "where status=1";
} else if ($myShow == "noobrab") {
$where = "where status=0";
} else if ($myShow == "suspended") {
$where = "where status=2";
} else if ($myShow == "toexpire") {
$where = "where TO_DAYS(todate)-TO_DAYS(NOW())>=0 and TO_DAYS(todate)-TO_DAYS(NOW())<=30";
} else if ($myShow == "expired") {
$where = "where TO_DAYS(todate)-TO_DAYS(NOW())<0";
}
if ($param == 'uid') { $operat = "$param = '$search'"; } else { $operat = "$param LIKE '%$search%'"; }
if ($search) {
if ($where) { $where .= " and $operat"; }
else { $where = "where $operat"; }
}
if (!$mySort) { $mySort = "id"; } # установка поля для сортировки по умолчанию, если не указано
if ($sort and $sort != $mySort) { $mySort = $sort; } # установка нового типа сортировки, если клиент выбрал другой
$_SESSION["domainSort"] = $mySort;
if (!$_SESSION["domainDesc"]) { $_SESSION["domainDesc"] = "desc"; } # получение направления сортировки или установка по умолчанию
if ($desc and $desc != $_SESSION["domainDesc"]) { $_SESSION["domainDesc"] = $desc; } # установка нового направления сортировки, если клиент выбрал другое
if (!$desc and $_SESSION["domainDesc"]) { $desc = $_SESSION["domainDesc"]; }
if ($desc == "desc") { $desc = "asc"; } else { $desc = "desc"; }
$myDesc = $_SESSION["domainDesc"];
getfont();
?>
<table width=99%>
<tr>
<Td valign=top>
<table width=270>
<tr><td align=center bgcolor=<?=$font_head?>><B>Фильтр</b></td></tr>
<tr><td bgcolor=<?=$font_row?> align=center>
<form method=post>
<select name=show>
<option value=all <? if ($myShow == 'all') {print "selected";} ?>>Все домены</option>
<option value=obrab <? if ($myShow == 'obrab') {print "selected";} ?>>Обработанные</option>
<option value=noobrab <? if ($myShow == 'noobrab') {print "selected";} ?>>Не обработанные</option>
<option value=suspended <? if ($myShow == 'suspended') {print "selected";} ?>>Приостановленные</option>
<option value=toexpire <? if ($myShow == 'toexpire') {print "selected";} ?>>Заканчивающиеся</option>
<option value=expired <? if ($myShow == 'expired') {print "selected";} ?>>Закончившиеся</option>
</select>
<input type=submit value=Показать>
</form>
</td></tr>
</table>
</td>
<td width=50> </td>
<Td valign=top>
<table width=300>
<tr><td align=center bgcolor=<?=$font_head?>><B>Поиск</b></td></tr>
<tr><td bgcolor=<?=$font_row?>><form method=post><input type=hidden name=show value=all><select name=param><option value=domain selected>Домен:</option><option value=remark>Комментарий:</option></select> <input type=text name=search size=20> <input type=submit value=Найти></form></td></tr>
</table>
</td>
<td width=100%></td>
</tr>
</table><BR>
<?
$r=@mysql_query("select *,TO_DAYS(todate)-TO_DAYS(NOW()) as leftdays from orders_domains $where order by $mySort $myDesc") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
$rows = mysql_num_rows($r);
list($start, $perPage, $txt) = MakePages($page, $rows, $linkAddon);
?>
<table cellpadding=3 width=99%>
<tr><td colspan=8 align=right><?=$txt?></td></tr>
<tr><td colspan=8 align=center bgcolor=<?=$font_head?>><B>Домены</b></td></tr>
<tr bgcolor=<?=$font_head?> align=center>
<td></td>
<td><a href=?do=<?=$do?>&sort=orderdate&desc=<?=$desc?>>Дата <? if ($mySort == "orderdate") { print "<img src=./_rootimages/s_".$myDesc.".png border=0 width=11 height=9 alt='".$_sort[$myDesc]."' title='".$_sort[$myDesc]."'>"; } ?></a></td>
<td align=center>Логин</td>
<td><a href=?do=<?=$do?>&sort=domain&desc=<?=$desc?>>Домен <? if ($mySort == "domain") { print "<img src=./_rootimages/s_".$myDesc.".png border=0 width=11 height=9 alt='".$_sort[$myDesc]."' title='".$_sort[$myDesc]."'>"; } ?></a></td>
<td><a href=?do=<?=$do?>&sort=todate&desc=<?=$desc?>><img src=./_rootimages/domain.gif border=0 alt='Домен' title='Домен'> Конец <? if ($mySort == "todate") { print "<img src=./_rootimages/s_".$myDesc.".png border=0 width=11 height=9 alt='".$_sort[$myDesc]."' title='".$_sort[$myDesc]."'>"; } ?></a></td>
<td><a href=?do=<?=$do?>&sort=status&desc=<?=$desc?>><img src=./_rootimages/domain.gif border=0 alt='Домен' title='Домен'> Статус <? if ($mySort == "status") { print "<img src=./_rootimages/s_".$myDesc.".png border=0 width=11 height=9 alt='".$_sort[$myDesc]."' title='".$_sort[$myDesc]."'>"; } ?></a></td>
<td></td>
</tr>
<?
$r=@mysql_query("select *,TO_DAYS(todate)-TO_DAYS(NOW()) as leftdays from orders_domains $where order by $mySort $myDesc LIMIT $start,$perPage") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
$cnt=0;
getfont();
while ($rr = mysql_fetch_object($r)) {
getfont();
$u=mysql_query("select * from users where id = '$rr->uid'");
$u=mysql_fetch_object($u);
$b=mysql_query("select * from bills where domain_id = '$rr->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
$bills=mysql_num_rows($b);
$b=mysql_fetch_object($b);
if ($rr->leftdays == "") { $rr->leftdays = 0; }
if ($rr->leftdays <= 30 and $rr->startdate != "0000-00-00") { $rr->leftdays = "<font color=red>".$rr->leftdays."</font>"; }
$statusDomain = "<img src=./_rootimages/obrabotan_".$rr->status."_small.gif border=0 alt='".$_status[$rr->status]."' title='".$_status[$rr->status]."'>";
$toDateDomain = mydate($rr->todate);
$leftDaysDomain = "<label alt='осталось дней' title='осталось дней'>[$rr->leftdays]</label>";
if ($rr->startdate != "0000-00-00") { $toDateDomainTxt = "$toDateDomain $leftDaysDomain"; } else { $toDateDomainTxt = "-";}
if ($rr->host_id) { $edit_link = "host_id=$rr->host_id"; }
else { $edit_link = "domain_id=$rr->id"; }
print "
<tr bgcolor=$font_row height=30>
<td align=center>
<a href=?do=editorder&$edit_link><img src=./_rootimages/edit.gif border=0 alt='Редактировать заказ' title='Редактировать заказ'></a><a href=?do=$do&sub=delete&id=$rr->id onclick="javascript: return confirm('Будет удален домен, а так же все счета, относящиесу к нему. Вы уверены, что хотите удалить домен?');"><img src=./_rootimages/del.gif border=0 alt='Удалить заказ' title='Удалить заказ'></a>
</td>
<td align=center>".mydate($rr->orderdate)."</td>
<td align=center><a href=?do=fullinfo&id=$u->id>$u->login</a></td>
<td><B>$rr->domain</b></td>
<td align=center>$toDateDomainTxt</td>
<td align=center>$statusDomain</font></td>
<td align=center>
<A href=?do=bills¶m=domain_id&search=$rr->id><img src=./_rootimages/bills.gif border=0 alt='Счета: $bills' title='Счета по данному заказу: $bills'></a>
</td>
</tr>
";
$cnt++;
}
?>
<tr bgcolor=<?=$font_head?>><Td colspan=8>Всего доменов: <?=$rows?>, доменов на странице: <?=$cnt?></td></tr>
<tr><td colspan=8 align=right><?=$txt?></td></tr>
</table>
<?
?>