Вход Регистрация
Файл: _rootadmin/_fullinfo.inc.php
Строк: 935
<?

    $u 
GetUserById($id);
    if (!
$u) { $u GetUserByLogin($id); }
    
    if (
$u) {
        print 
menu_admin_client($u->id);

        if (
$sub == "updateRemark") {
            @
mysql_query("UPDATE users SET remark = '$remark' WHERE id='$id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());

            
writeAdminLog("Изменены заметки для клиента ID # $u->id$u->login");

            print 
"Заметки успешно сохранены.<BR><BR>";
        }

        if (
$sub == "moveorders" and $userName) {
            
checkAdminAccess('clientMoveOrders',1);

            
$newUser GetUserByLogin($userName);
            if (
$newUser->id) {
                @
mysql_query("UPDATE bills SET uid='$newUser->id' WHERE uid='$u->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                @
mysql_query("UPDATE orders SET uid='$newUser->id' WHERE uid='$u->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                @
mysql_query("UPDATE orders_domains SET uid='$newUser->id' WHERE uid='$u->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                @
mysql_query("UPDATE orders_domainscert SET uid='$newUser->id' WHERE uid='$u->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                @
mysql_query("UPDATE orders_shop SET uid='$newUser->id' WHERE uid='$u->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                @
mysql_query("UPDATE users_profile SET uid='$newUser->id' WHERE uid='$u->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());

                
writeAdminLog("Перенесены все счета, заказы и профайлы с аккаунта $u->login в $newUser->login");

                print 
"Перенос успешно завершен.<BR><BR>";

            } else {
                print 
"Пользователь $userName не найден.<BR><BR>";
            }
        }
        
        if (
$sub == "savepassword") {
            
checkAdminAccess('clientPasswordEdit',1);

            if(
$newpassword) {
                @
mysql_query("UPDATE users SET password = '".crypt($newpassword)."' WHERE id='$id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());

                
writeAdminLog("Изменен пароль клиента ID # $u->id$u->login");

                print 
"Пароль успешно изменён.<BR><BR>";
            }
        }
        
        if (
$sub == "makebill") {
            
checkAdminAccess('newBillsAllow',1);

            
$money str_replace(",",".",$money);

            if (
$money 0) {
                @
mysql_query("insert into bills (uid,host_id,domain_id,host_srok,domain_srok,money_host,money_domain,money_addons,money,created,comment) values('".$id."','0','0','0','0','0','0','0','$money',NOW(),'$comment')") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                
$bill_id=mysql_insert_id();

                
writeAdminLog("Выставлен счет ID # $bill_id клиенту ID # $u->id$u->login");

                
$bill GetBillById($bill_id);
                
$curr LoadCurrencyToVariable($u->currency);

                
$company_name=GetSetting('company_name');
                
$company_url=GetSetting('company_url');
                
$manager_email=GetSetting("manager_email");
                
$billing_url=GetSetting('billing_url');
                
$support_url=GetSetting('support_url');

                
$tpl=GetTpl('new_bill',$u->lang);
                
$subject=$tpl[subject]; $template=$tpl[template];

                if (
$subject and $template) {
                    
$subject str_replace('{id}',sprintf("%04d"$bill->id),$subject);
                    
$subject str_replace('{date}',mydate($bill->created),$subject);

                    
$template str_replace('{company_name}',$company_name,$template);
                    
$template str_replace('{company_url}',$company_url,$template);
                    
$template str_replace('{billing_url}',$billing_url,$template);
                    
$template str_replace('{support_url}',$support_url,$template);
                    
$template str_replace('{bill_date}',mydate($bill->created),$template);
                    
$template str_replace('{login}',$u->login,$template);
                    
$template str_replace('{password}','******',$template);
                    
$template str_replace('{schet}',sprintf("%04d"$bill->id),$template);
                    
$template str_replace('{cost}',round($bill->money*$curr["CURK"],2)." ".$curr["CURS"],$template);
                    
$template str_replace('{comment}',$comment,$template);

                    
WriteMailLog($subject,$template,$u->id);
                    
sendmail($u->email,$company_name,$manager_email,$subject,$template,'','',$tpl[type]);
                    
sendmail($u->email2,$company_name,$manager_email,$subject,$template,'','',$tpl[type]);
                }

                
$tpl=GetTpl('new_bill_sms',$u->lang);
                
$template=$tpl[template];

                if (
$template and $u->mobile and $u->smsUserBillNew) {
                    
$template str_replace('{company_name}',$company_name,$template);
                    
$template str_replace('{company_url}',$company_url,$template);
                    
$template str_replace('{billing_url}',$billing_url,$template);
                    
$template str_replace('{support_url}',$support_url,$template);
                    
$template str_replace('{bill_date}',mydate($bill->created),$template);
                    
$template str_replace('{login}',$u->login,$template);
                    
$template str_replace('{password}','******',$template);
                    
$template str_replace('{schet}',sprintf("%04d"$bill->id),$template);
                    
$template str_replace('{cost}',round($bill->money*$curr["CURK"],2)." ".$curr["CURS"],$template);
                    
$template str_replace('{comment}',$comment,$template);

                    
sendSMS($u->id,'',$template);
                }

                print 
"Счет успешно выставлен.<BR><BR>";
            }
        }

        if (
$sub == "changemoney") {
            
checkAdminAccess('clientBalanceEdit',1);

            
$money str_replace(",",".",$money);

            @
mysql_query("update users set money=$money where id=$id") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());

            
writeAdminLog("Изменен внутренний баланс клиента ID # $u->id$u->login");

            print 
"Внутренний баланс клиента успешно изменен.<BR><BR>";
        }

        if (
$sub == "createticket") {
            
checkAdminAccess('ticketsCreate',1);

            if (!
$subject) { print "<font color=red>".$_lang[TicketsErrorSubject]."</font><br><br>"; }
            else if (
$priority == '') { print "<font color=red>".$_lang[TicketsErrorPriority]."</font><br><br>"; }
            else if (!
$message) { print "<font color=red>".$_lang[TicketsErrorMessage]."</font><br><br>"; }
            else {
                
$admUser GetAdminById($_SESSION["adminId"]);
                if (
$admUser->signature) {
                    
$message $message."rnrn".$admUser->signature;
                }

                
$z=@mysql_query("select * from tickets where parentid='0' and priority='$priority' and subject='$subject' and userid='$id' and message='".addslashes($message)."'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                if (
mysql_num_rows($z) == 0) {

                    @
mysql_query("insert into tickets (priority,dt,subject,userid,message,newforuser,newforadmin,adminname,adminId,department,sendadminsms) values('$priority',NOW(),'$subject','$id','".addslashes($message)."','1','0','".$_SESSION["adminName"]."','".$_SESSION["adminId"]."','$department','$sendadminsms')") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
                    
$ticketid=mysql_insert_id();

                    
$pwd generatePassword(25);
                    @
mysql_query("update users set tempPassword='".crypt($pwd)."' where id='$u->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());

                    
$tpl=GetTpl('email_touser_ticket_new',$u->lang);
                    
$subj=$tpl[subject]; $template=$tpl[template];

                    if (
$subj and $template) {
                        
$company_name=GetSetting('company_name');
                        
$company_url=GetSetting('company_url');
                        
$support_email=GetSetting("support_email");
                        
$support_url=GetSetting('support_url');

                             
$subj str_replace('{id}',$ticketid,$subj);
                             
$subj str_replace('{priority}',$_priority[$priority],$subj);
                     
                        
$template str_replace('{company_name}',$company_name,$template);
                             
$template str_replace('{company_url}',$company_url,$template);
                             
$template str_replace('{support_url}',$support_url,$template);

                             
$template str_replace('{subject}',$subject,$template);
                             
$template str_replace('{message}',$message,$template);
                             
$template str_replace('{id}',$ticketid,$template);
                             
$template str_replace('{link}',$full_www_path."billing.php?do=tickets&sub=view&id=$ticketid&login=$u->login&pass=$pwd",$template);

                        
WriteMailLog($subj,$template,$u->id);
                        
sendmail($u->email,$company_name,$support_email,$subj,$template,'','',$tpl[type]);
                        
sendmail($u->email2,$company_name,$support_email,$subj,$template,'','',$tpl[type]);

                    }

                    if (
GetSetting("smsGateway") and GetSetting("smsUserTicketNew")) {
                        
$tpl=GetTpl('email_touser_ticket_new_sms',$u->lang);
                        
$template=$tpl[template];

                        if (
$template and $u->mobile and $u->smsUserTicketNew) {
                            
$company_name=GetSetting('company_name');
                            
$company_url=GetSetting('company_url');
                            
$support_email=GetSetting("support_email");
                            
$support_url=GetSetting('support_url');

                            
$template str_replace('{company_name}',$company_name,$template);
                                 
$template str_replace('{company_url}',$company_url,$template);
                                 
$template str_replace('{support_url}',$support_url,$template);

                                 
$template str_replace('{subject}',$subject,$template);
                                 
$template str_replace('{message}',$message,$template);
                                 
$template str_replace('{id}',$ticketid,$template);
                                 
$template str_replace('{priority}',$_priority[$priority],$template);
                                 
$template str_replace('{link}',$full_www_path."billing.php?do=tickets&sub=view&id=$ticketid&login=$u->login&pass=$pwd",$template);

                            
sendSMS($u->id,'',$template);
                        }

                    }

                    
writeAdminLog("Создан новый тикет ID # $ticketid");

                    print 
"Тикет успешно создан.<BR><BR>";

                    
$subject=''$priority=''$message='';
                }
            }
        }

        
checkAdminAccess('clientsRead',1);
        
$admUser GetAdminById($_SESSION["adminId"]);

        
$disallowedMenus = @mb_split("::"$admUser->disallowedMenus);

        
$weSalesTypes GetSetting("weSalesTypes");
        
$weSalesTypes = @mb_split("::",$weSalesTypes);

        
getfont();
            
$o=@mysql_query("select *,TO_DAYS(todate)-TO_DAYS(NOW()) as leftdays from orders where uid='$u->id' and archived=0") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
            
$od=@mysql_query("select *,TO_DAYS(todate)-TO_DAYS(NOW()) as leftdays from orders_domains where uid='$u->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());

        if (
GetSetting("registerNeedMobile") == and GetSetting("registerNeedMobileVerification") and $u->mobile and $u->mobileVerification == 1) {
            
$mobileVerificationPass "[ <B>номер подтвержден</b> ]";
        }
        
        
?>
        <table width=80%>
        
        <tr onclick="myShow('s1');" onmouseover="this.bgColor='<? print $font_headm?>'; this.style.cursor='pointer'" onmouseout="this.bgColor='<? print $font_head?>'" bgcolor=<? print $font_head?>><td colspan=2 align=center><B>Информация по клиенту</B></td></tr>
        <td colspan=2>
            <div id="s1" style="display: block;">
            <table width="100%">
            <tr bgcolor=<? print $font_row?>><td align=right>Аккаунт заблокирован:&nbsp;</td><td><B><? print $_yes[$u->banned]?></B></td></tr>
            <tr width=50% bgcolor=<? print $font_row?>><td align=right>ID клиента:&nbsp;</td><td width=50%><? print $u->id?></td></tr>
            <tr bgcolor=<? print $font_row?>><td align=right>ФИО:&nbsp;</td><td><? print $u->surname." ".$u->name." ".$u->otchestvo?></td></tr>
            <tr bgcolor=<? print $font_row?>><td align=right>Логин:&nbsp;</td><td><? print $u->login?></td></tr>
            <tr bgcolor=<? print $font_row?>><td align=right>Пароль:&nbsp;</td><td><form method=post><input type=hidden name=id value=<? print $u->id?>><input type=hidden name=do value=fullinfo><input type=hidden name=sub value=savepassword><input type=password name=newpassword size=25>&nbsp;<input type=submit value="изменить"></form></td></tr>
            <? if ($u->codeWord) { ?><tr bgcolor=<? print $font_row?>><td align=right>Кодовое слово:&nbsp;</td><td><? print $u->codeWord?></td></tr><? ?>
            <tr bgcolor=<? print $font_row?>><td align=right>E-Mail:&nbsp;</td><td><A href="?do=mailsend&userid=<? print $u->id?>"><? print $u->email?></a></td></tr>
            <? if ($u->email2) { ?><tr bgcolor=<? print $font_row?>><td align=right>Альтернативный E-Mail:&nbsp;</td><td><A href="?do=mailsend&userid=<? print $u->id?>&alt=1"><? print $u->email2?></a></td></tr><? ?>
            <? if ($u->mobile) { ?><tr bgcolor=<? print $font_row?>><td align=right>Мобильный телефон:&nbsp;</td><td><? print $u->mobile?> <? print $mobileVerificationPass?></td></tr><? ?>
            <? if ($u->icq) { ?><tr bgcolor=<? print $font_row?>><td align=right>ICQ:&nbsp;</td><td><? if ($u->icq) { print "<img src=http://status.icq.com/online.gif?icq=$u->icq&img=5 border=0 width=18 height=18>"; } ?> <? print $u->icq?></td></tr><? ?>
            <? if ($u->skype) { ?><tr bgcolor=<? print $font_row?>><td align=right>Skype:&nbsp;</td><td><? print $u->skype?></td></tr><? ?>
            <? if (@in_array("domains",$weSalesTypes)) { ?><tr bgcolor=<? print $font_row?>><td align=right>Реселлер доменов:&nbsp;</td><td><? print $_yes[$u->domainreseller]?></td></tr><? ?>
            <tr bgcolor=<? print $font_row?>><td align=right>Подписка на новости:&nbsp;</td><td><? print $_yes[$u->news]?></td></tr>
            <tr bgcolor=<? print $font_row?>><td align=right>Запрет автоостановки аккаунтов:&nbsp;</td><td><? print $_yes[$u->noSuspend]?></td></tr>
            <tr bgcolor=<? print $font_row?>><td align=right>Автопродление заказов:&nbsp;</td><td><? if ($u->autoRenew == "0") { print "по умолчанию"; } else if ($u->autoRenew == "1") { print "включено"; } else if ($u->autoRenew == "2") { print "отключено"; }?></td></tr>
            <tr bgcolor=<? print $font_row?>><td align=right>Прикреплять PDF к счетам:&nbsp;</td><td><? if ($u->attachPDFtoBill == "0") { print "по умолчанию"; } else if ($u->attachPDFtoBill == "1") { print "включено"; } else if ($u->attachPDFtoBill == "2") { print "отключено"; }?></td></tr>
            <tr bgcolor=<? print $font_row?>><td align=right>Push (перенос) доменов:&nbsp;</td><td><? if ($u->allowDomainPush == "0") { print "по умолчанию"; } else if ($u->allowDomainPush == "1") { print "включено"; } else if ($u->allowDomainPush == "2") { print "отключено"; }?></td></tr>
            <? if ($u->specialPromoCode) { ?>
                <tr bgcolor=<? print $font_row?>><td align=right>Специальная скидка (промо-код):&nbsp;</td><td><B><? print $u->specialPromoCode?></b> (для клиента: <B><? print $_yes[$u->specialPromoCodeForUser]?></b>, для рефералов: <B><? print $_yes[$u->specialPromoCodeForReferals]?></b>)</td></tr>
            <? ?>
            <tr bgcolor=<? print $font_row?>><td colspan=2>&nbsp;</td></tr>
            <tr bgcolor=<? print $font_head?>><td align=right><A href=?do=gotobilling&id=<? print $u->id?> target=_blank><img src=./_rootimages/goto.gif border=0></a> Войти в биллинг клиента:&nbsp;</td><td><form method=post action=?do=gotobilling&id=<? print $u->id?> target=_blank><input type=submit value=войти></form></td></tr>
<!--            <tr bgcolor=<? print $font_head?>><td align=right><A href=?do=profile&id=<? print $u->id?> target=_blank><img src=./_rootimages/profile.gif border=0></a>Профайл клиента:&nbsp;</td><td><form method=post action=?do=profile&id=<? print $u->id?> target=_blank><input type=submit value=редактировать></form></td></tr>-->
<!--            <tr bgcolor=<? print $font_head?>><td align=right><A href=?do=history&uid=<? print $u->id?> target=_blank><img src=./_rootimages/history.gif border=0></a>&nbsp;История клиента:&nbsp;</td><td><form action="?do=history&uid=<? print $u->id?>" method=post target=_blank><input type=submit value=просмотреть></form></td></tr>-->
            <tr bgcolor=<? print $font_row?>><td colspan=2>&nbsp;</td></tr>
            </table>
            </div>
        </td></tr>


        <tr onclick="myShow('s2');" onmouseover="this.bgColor='<? print $font_headm?>'; this.style.cursor='pointer'" onmouseout="this.bgColor='<? print $font_head?>'" bgcolor=<? print $font_head?>><td colspan=2 align=center><B>Партнерская программа</B></td></tr>
        <td colspan=2>
            <div id="s2" style="display: block;">
            <table width="100%">
            <tr bgcolor=<? print $font_row?>><td colspan=2 align=center>Партнерский счет: <? print GetUserPartnerMoney($u->id)?> <? print CURAS?>
            <?

            $refs1array 
= array();
            
$refs2array = array();

            
$referals GetUserReferalsArray($u->id);
            while (list(
$r_id,$refArray) = @each($referals)) {      
                
$refs1array[$r_id] = "<a target=_blank href=?do=fullinfo&id=$r_id>".$refArray[login]."</a>";

                
$referals2 GetUserReferalsArray($r_id);
                while (list(
$r_id2,$refArray2) = @each($referals2)) {
                    
$refs2array[$r_id2] = "<a target=_blank href=?do=fullinfo&id=$r_id2>".$refArray2[login]."</a>";
                }
            }

            print 
"&nbsp;&nbsp;&nbsp;&nbsp;Рефералы 1-го уровня: ".count($refs1array);
            print 
"&nbsp;&nbsp;&nbsp;&nbsp;Рефералы 2-го уровня: ".count($refs2array);
            print 
"<BR>";

            if (
count($refs1array) > 0) {
                print 
"<BR>Рефералы 1-го уровня: ".@join(", ",$refs1array)."<BR>";
            }

            if (
count($refs2array) > 0) {
                print 
"<BR>Рефералы 2-го уровня: ".@join(", ",$refs2array)."<BR>";
            }

            if (
$u->referal) {
                
$partner GetUserById($u->referal);
                print 
"<BR>Партнер, который привел данного клиента: <a href=?do=fullinfo&id=$partner->id target=_blank>$partner->login</a><BR>";
            }

            
?>
            <br></td></tr>
            </table>
            </div>
        </td></tr>

        <?
        $r 
= @mysql_query("select SUM(money) as mother, SUM(money_host) as mhost, SUM(money_domain) as mdomain, SUM(money_addons) as maddons, SUM(money_shop) as mshop from bills where uid='$u->id' and NOT(payed='0000-00-00') and status='1' and NOT(addfunds='1')") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
        if (
mysql_num_rows($r) > 0) {
            
$r mysql_fetch_object($r);
            
$mhost round($r->mhost,2);
            
$mdomain round($r->mdomain,2);
            
$maddons round($r->maddons,2);
            
$mother round($r->mother,2);
            
$mshop round($r->mshop,2);
        }
        if (!
$mhost) { $mhost 0; }
        if (!
$mdomain) { $mdomain 0; }
        if (!
$maddons)    { $maddons 0; }
        if (!
$mother)    { $mother 0; }
        if (!
$mshop)    { $mshop 0; }
        
?>
        <tr onclick="myShow('s3');" onmouseover="this.bgColor='<? print $font_headm?>'; this.style.cursor='pointer'" onmouseout="this.bgColor='<? print $font_head?>'" bgcolor=<? print $font_head?>><td colspan=2 align=center><B>Финансы</B></td></tr>
        <tr><td colspan=2>
            <div id="s3" style="display: block;">
            <table width="100%">
            <tr>
            <td bgcolor=<? print $font_head?> align=center><B>Внутренний баланс</b></td>
            <td bgcolor=<? print $font_head?> align=center><B>Выставить счет</b></td>
            <td bgcolor=<? print $font_head?> align=center><B>Всего оплачено</b></td>
            </tr>
            <tr>
            <td bgcolor=<? print $font_row?> align=center valign=top>
                <form method=post>
                На счету: <input type=hidden name=do value=<? print $do?>><input type=hidden name=sub value=changemoney><input type=hidden name=id value=<? print $id?>><input type=text size=3 name=money value=<? print GetUserMoney($id)?><? print CURAS?><BR>
                <input type=submit value='Изменить'></form>
            </td>
            <td bgcolor=<? print $font_row?> align=center valign=top>
                <form method=post>
                Сумма: <input type=hidden name=do value=<? print $do?>><input type=hidden name=sub value=makebill><input type=hidden name=id value=<? print $id?>><input type=text size=3 name=money value=0.0> <? print CURAS?><BR>
                За что: <input type=text size=11 name=comment><BR>
                <input type=submit value='Выставить счет'></form>
            </td>
            <td bgcolor=<? print $font_row?> valign=top>
                За хостинг: <? print $mhost?> <? print CURAS?><BR>
                За домены: <? print $mdomain?> <? print CURAS?><BR>
                За доп. услуги: <? print $maddons?> <? print CURAS?><BR>
                За другое: <? print $mother?> <? print CURAS?><BR>
                За товары: <? print $mshop?> <? print CURAS?><BR>
                Оплачено всего: <B><? print ($mhost+$mdomain+$maddons+$mother+$mshop)?> <? print CURAS?></b>
            </td>
            <tr bgcolor=<? print $font_row?>><td colspan=3>&nbsp;</td></tr>
            </table>
            </div>
        </td></tr>

        <? if (!@in_array("orders",$disallowedMenus) and checkAdminAccess("ordersRead")) { ?>
        <tr onclick="myShow('s4');" onmouseover="this.bgColor='<? print $font_headm?>'; this.style.cursor='pointer'" onmouseout="this.bgColor='<? print $font_head?>'" bgcolor=<? print $font_head?>><td colspan=2 align=center><B>Заказы</B></td></tr>
        <tr><td colspan=2>
            <div id="s4" style="display: none;">
            <table width="100%">
            <?
            
if (mysql_num_rows($o) > 0) {
                
?>
                <tr bgcolor=<? print $font_row?>>
                <td align=center colspan=2>
                <table border=0 cellpadding=0 cellspacing=0 width=100%>
                <?
                
while ($oo mysql_fetch_object($o)) {
                    
$tarif GetTarifById($oo->tarif);
                    
?>
                    <tr>
                    <td><input type=text readonly size=20 value="<? print $oo->domain?>"></td>
                    <td align=center><select disabled><option><? print $tarif->name?></option></select></td>
                    <Td align=center>
                    <?
                    
if ($oo->leftdays) {
                        print 
"$oo->leftdays дн.";
                        if (
$oo->leftdays and ($tarif->vid == "hosting" or $tarif->vid == "reseller" or $tarif->vid == "vds")) {
                            print 
", ".GetMoneyBackByOrderId($oo->id)." ".CURAS;
                        }
                    
                    } else {
                        print 
"-";
                    }
                    
?>
                    </td><td align=right>
                    <form action=?do=editorder&host_id=<? print $oo->id?> method=post target=_blank><input type=submit value=подробнее></form>
                    </td></tr>
                    <?
                
}
                
?>
                </table>
                </td>
                </tr>
                <?
            
}
            
?>
            <tr bgcolor=<? print $font_row?>><td colspan=2>&nbsp;</td></tr>
            </table>
            </div>
        </td></tr>
        <? ?>

        <? if (!@in_array("domains",$disallowedMenus) and checkAdminAccess("domainsRead")) { ?>
        <tr onclick="myShow('s5');" onmouseover="this.bgColor='<? print $font_headm?>'; this.style.cursor='pointer'" onmouseout="this.bgColor='<? print $font_head?>'" bgcolor=<? print $font_head?>><td colspan=2 align=center><B>Домены</B></td></tr>
        <tr><td colspan=2>
            <div id="s5" style="display: none;">
            <table width="100%">
            <?
            
if (mysql_num_rows($od) > 0) {
                
?>
                <tr bgcolor=<? print $font_row?>>
                <td align=center colspan=2>
                <table cellpadding=0 cellspacing=0 width=100%>
                <?
                
while ($odd mysql_fetch_object($od)) {
                    
?>
                    <tr>
                    <Td><input type=text readonly size=20 value="<? print $odd->domain?>"></td>
                    <Td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;рег. до (<? print mydate($odd->todate)?>)</td>
                    <td align=center>
                
                    <?
                    
if ($odd->leftdays) {
                        print 
"(осталось $odd->leftdays дн.)";
                    } else {
                        print 
"-";
                    }
                    
?>
                    </td>
                
                    <td align=right>
                    <form action=?do=editorder&domain_id=<? print $odd->id?> method=post target=_blank><input type=submit value=подробнее></form>
                    </td></tr>
                    <?
                
}
                
?>
                </table>
                </td>
                </tr>
                <?
            
}
            
?>
            <tr bgcolor=<? print $font_row?>><td colspan=2>&nbsp;</td></tr>
            </table>
            </div>
        </td></tr>
        <? ?>

        <? if (checkAdminAccess("clientMoveOrders")) { ?>
        <tr onclick="myShow('s6');" onmouseover="this.bgColor='<? print $font_headm?>'; this.style.cursor='pointer'" onmouseout="this.bgColor='<? print $font_head?>'" bgcolor=<? print $font_head?>><td colspan=2 align=center><B>Объединение аккаунтов</B></td></tr>
        <tr><td colspan=2>
            <div id="s6" style="display: none;">
            <table width="100%">
            <tr><td colspan=2 align=center bgcolor=<? print $font_row?>>
                <form method=post>
                <input type=hidden name=do value=<? print $do?>>
                <input type=hidden name=sub value=moveorders>
                <input type=hidden name=id value=<? print $id?>>
                Перенести все счета, заказы и профайлы в аккаунт клиента 
                <?
                $usersLogins 
GetUsersLogins();
                if (
count($usersLogins) > 0) {
                      print 
"<select name=userName><option></option>";
                      while (list(
$key,$value) = each($usersLogins)) {
                          print 
"<option value=$value>$value</option>";
                      }
                    print 
"</select>";
                }
                
?>
                <input type=Submit value="Перенести">
                </form>
            </td></tr>
            <tr bgcolor=<? print $font_row?>><td colspan=2>&nbsp;</td></tr>
            </table>
            </div>
        </td></tr>
        <? ?>

        <? if (checkAdminAccess("ticketsCreate")) { ?>
        <tr onclick="myShow('s7');" onmouseover="this.bgColor='<? print $font_headm?>'; this.style.cursor='pointer'" onmouseout="this.bgColor='<? print $font_head?>'" bgcolor=<? print $font_head?>><td colspan=2 align=center><B>Создать тикет</B></td></tr>
        <tr><td colspan=2>
            <div id="s7" style="display: none;">
            <table width="100%">
            <tr><td colspan=2 align=center bgcolor=<? print $font_row?>>
                <form method=post>
                <input type=hidden name=do value=<? print $do?>>
                <input type=hidden name=sub value=createticket>
                <input type=hidden name=id value=<? print $id?>>
                    <table border=0>
                    <tr><td><? print $_lang[TicketsSubject]?>:</td><td><input type=text maxlength=50 name=subject value="<? print $subject?>" size=93></td></tr>
                <?
                $admGroups 
GetAdminGroups();
                if (@
mysql_num_rows($admGroups) > 0) {
                    print 
"<tr><td>".$_lang[TicketsDepartment].":</td><td><select class=input name=department>";
                    while (
$admGroup = @mysql_fetch_object($admGroups)) {
                        print 
"<option value=$admGroup->id$admGroup->name ";
                    }
                    print 
"</select></td></tr>";
                }
                
?>
                    <tr><td><? print $_lang[TicketsPriority]?>:</td><td><?GetPrioritySelect($priority)?></td></tr>
                    <tr><td valign=top><? print $_lang[TicketsTicketTypeMsg]?>:</td><td><textarea name=message cols=70 rows=10><? print $message?></textarea></td></tr>
                    <? if ($admUser->sms_sendticketreply) { ?><tr><td></td><td><input type=checkbox name=sendadminsms value="1"> уведомлять об ответах с помощью SMS</td></tr><? ?>
                    <tr><td colspan=2 align=center><input type=Submit value="<? print $_lang[TicketsAddTicket]?>"></td></tr>
                </table>
                </form>
            </td></tr>
            </table>
            </div>
        </td></tr>
        <? ?>

        <tr onclick="myShow('s8');" onmouseover="this.bgColor='<? print $font_headm?>'; this.style.cursor='pointer'" onmouseout="this.bgColor='<? print $font_head?>'" bgcolor=<? print $font_head?>><td colspan=2 align=center><B>Заметки (видны только администратору)</B></td></tr>
        <tr><td colspan=2>
            <div id="s8" style="display: <? if ($u->remark) {print "block";} else {print "none";} ?>;">
            <table width="100%">
            <tr><td colspan=2 align=center bgcolor=<? print $font_row?>>
                <form method=post>
                <input type=hidden name=do value=<? print $do?>>
                <input type=hidden name=sub value=updateRemark>
                <input type=hidden name=id value=<? print $id?>>
                    <table border=0>
                    <tr><td><textarea name=remark cols=70 rows=10><? print htmlDecode($u->remark)?></textarea></td></tr>
                    <tr><td align=center><input type=Submit value="Сохранить"></td></tr>
                </table>
                </form>
            </td></tr>
            </table>
            </div>
        </td></tr>

        <tr bgcolor=<? print $font_row?>><td colspan=2>&nbsp;</td></tr>        
        <tr bgcolor=<? print $font_head?>><td align=right>Удалить клиента:&nbsp;</td><td>&nbsp;<a href=?do=clients&sub=delete&uid=<? print $u->id?> onclick="javascript: return confirm('Будет удален клиент, а так же все заказы и счета, относящиесу к нему. Вы уверены, что хотите удалить клиента?');"><img src=./_rootimages/del.gif border=0 alt='Удалить клиента'>удалить</a></td></tr>
        <tr bgcolor=<? print $font_row?>><td colspan=2>&nbsp;</td></tr>
        
        </table>
        <?
    
} else {
        print 
"Клиент не найден.";
    }
?>
Онлайн: 1
Реклама