Ejemplo n.º 1
0
function catv_UserProfileShow($userid)
{
    $userdata = catv_UserGetData($userid);
    $catv_conf = catv_LoadConfig();
    $currency = $catv_conf['CURRENCY'];
    $alltariffnames = catv_TariffGetAllNames();
    $alladdress = catv_UsersGetFullAddressList();
    $tariffname = $alltariffnames[$userdata['tariff']];
    $tariffprice = catv_TariffGetData($userdata['tariff']);
    $tariffprice = $tariffprice['price'];
    if (!empty($userdata['inetlink'])) {
        $inetlink = '<a href="?module=userprofile&username='******'inetlink'] . '"> ' . web_profile_icon() . ' ' . $userdata['inetlink'] . '</a>';
    } else {
        $inetlink = __('No');
    }
    $activity = catv_ActivityGetLastByUser($userid);
    $activity_time = catv_ActivityGetTimeLastByUser($userid);
    $result = '
      <table width="100%" border="0">
        <tr class="row3">
          <td class="row2" width="30%">ID</td>
          <td>' . $userdata['id'] . '</td>
        </tr>
        <tr class="row3">
          <td class="row2">' . __('Contract') . '</td>
           <td>' . $userdata['contract'] . '</td>
        </tr>
        <tr class="row3">
           <td class="row2">' . __('Real name') . '</td>
         <td>' . $userdata['realname'] . '</td>
        </tr>
        <tr class="row3">
         <td class="row2">' . __('Full address') . '</td>
          <td>' . @$alladdress[$userdata['id']] . '</td>
        </tr>
        <tr class="row3">
            <td class="row2">' . __('Phone') . '</td>
          <td>' . $userdata['phone'] . '</td>
        </tr>
        <tr class="row3">
           <td class="row2">' . __('Balance') . '</td>
            <td>' . $userdata['cash'] . ' ' . $currency . '</td>
        </tr>
        <tr class="row3">
         <td class="row2">' . __('Tariff') . '</td>
          <td>' . $tariffname . '</td>
        </tr>
        <tr class="row3">
         <td class="row2">' . __('Planned tariff change') . '</td>
         <td>' . @$alltariffnames[$userdata['tariff_nm']] . '</td>
        </tr>
        <tr class="row3">
         <td class="row2">' . __('Fee') . '</td>
         <td>' . $tariffprice . ' ' . $currency . '</td>
        </tr>
        <tr class="row3">
         <td class="row2">' . __('Discount') . '</td>
         <td>' . $userdata['discount'] . ' ' . $currency . '</td>
        </tr>
       
        <tr class="row3">
         <td class="row2">' . __('Connected') . '</td>
         <td>' . web_bool_led($activity) . '</td>
        </tr>
        <tr class="row3">
         <td class="row2">' . __('Connection date') . '</td>
         <td>' . $activity_time . '</td>
        </tr>
        <tr class="row3">
         <td class="row2">' . __('Decoder') . '</td>
         <td>' . $userdata['decoder'] . '</td>
        </tr>
        <tr class="row3">
         <td class="row2">' . __('Internet account') . '</td>
         <td>' . $inetlink . '</td>
        </tr>
        <tr class="row3">
         <td class="row2">' . __('Notes') . '</td>
         <td>' . $userdata['notes'] . '</td>
        </tr>
      </table>
          ';
    $result .= catv_ProfileControls($userid);
    show_window(__('CaTV user profile'), $result);
}
Ejemplo n.º 2
0
<?php

if (cfr('CATVACT')) {
    catv_GlobalControlsShow();
    if (wf_CheckGet(array('userid'))) {
        $userid = vf($_GET['userid']);
        //collect all data
        $alluseractivity = catv_ActivityGetAllByUser($userid);
        $lasuseractivity = catv_ActivityGetLastByUser($userid);
        $lasuseractivitytime = catv_ActivityGetTimeLastByUser($userid);
        $userdata = catv_UserGetData($userid);
        $curyear = curyear();
        $curmonth = date("m");
        $curday = date("d");
        $curtime = curtime();
        $address = $userdata['street'] . ' ' . $userdata['build'] . '/' . $userdata['apt'];
        //if creating new activity
        if (wf_CheckPost(array('newacttime', 'newactday'))) {
            $customdate = $_POST['newactyear'] . '-' . $_POST['newactmonth'] . '-' . $_POST['newactday'] . ' ' . $_POST['newacttime'];
            deb($customdate);
            catv_ActivityCreateCustomDate($userid, $_POST['newactivity'], $customdate);
            rcms_redirect('?module=catv_useractivity&userid=' . $userid);
        }
        //edit form construct
        $actinputs = '';
        $actinputs .= wf_Trigger('newactivity', 'Connected', $lasuseractivity, true) . '<hr>';
        $actinputs .= wf_TextInput('newactday', 'Day', $curday, false, '2');
        $actinputs .= wf_MonthSelector('newactmonth', 'Month', $curmonth, false);
        $actinputs .= wf_YearSelector('newactyear', 'Year', true) . '<br>';
        $actinputs .= wf_HiddenInput('newacttime', $curtime);
        $actinputs .= wf_Submit('Change');