예제 #1
2
 public function echoMenu($items)
 {
     foreach ($items as $key => $item) {
         if (!array_key_exists($item->id, $this->echoed)) {
             $this->countLevel($item);
             $this->echoed[$item->id] = $this->level;
             echo '<tr><td>';
             for ($i = 0; $i < $this->echoed[$item->id]; $i++) {
                 echo "--";
             }
             echo " " . $item->id . '</td>
                 <td>' . __(dots($item->title, 90)) . '</td>
                 <td><a class="btn btn-primary" href="' . _l(URL::action('MenuController@getItemEdit') . '/' . $item->id) . '">' . __(Lang::get('admin.edit')) . '</a></td>
                 <td><a href="#" data-toggle="modal" data-target="#confirm-delete" class="btn btn-danger" data-href="' . URL::action('MenuController@getItemDestroy') . '/' . $item->id . '">' . __(Lang::get('admin.delete')) . '</a></td>
             </tr>';
         }
         if ($item->children()->count() > 0) {
             $this->echoMenu($item->children);
         }
     }
 }
예제 #2
0
 function DrawRow($r, $numrow)
 {
     global $img_url, $site_url, $r, $gd, $db, $number, $HTTP_POST_VARS, $auth, $dbname, $img_url;
     if ($this->default) {
         $this->val = $this->default;
     }
     if ($r[$this->name]) {
         $this->val = $r[$this->name];
     } elseif ($HTTP_POST_VARS[$this->name]) {
         $this->val = $HTTP_POST_VARS[$this->name];
     } elseif ($this->text) {
         $this->val = set_params($this->text);
     }
     $name = $this->name;
     if (strlen($r[$name])) {
         $this->val = $r[$name];
     }
     $this->format = set_params($this->format);
     if ($this->type != "hidden") {
         print "<td " . set_params($this->tdstyle) . ">\n";
         if ($this->align == "center") {
             print "<center>";
         } elseif ($this->align) {
             print "<div align=\"{$this->align}\">";
         }
         switch ($this->type) {
             case "flag":
                 if (strlen($r[$name]) > 0 && !strstr($name, "ID")) {
                     print "<img src=\"{$site_url}" . "cls/images/flag.php?id={$r['0']}&dbname={$db->dbname}\" title=\"{$r['Country']}\" border=0>";
                 } elseif (strlen($name) > 0) {
                     print "<img src=\"{$site_url}" . "cls/images/flag.php?id={$r[$name]}\" border=0 title=\"{$r['Country']}\">";
                 }
                 break;
             case "kit":
                 if (strlen($r[$name]) > 0) {
                     print "<img src=\"{$img_url}?id={$r['0']}&table=ut_kits\" border=0>";
                 }
                 break;
             case "showimage":
                 $table = $this->table;
                 if ($r[$name]) {
                     print "<img src=\"/engine/cls/images/image.php?id={$r['0']}&table=" . $table->table . "\" title=\"{$r['Name']}\" alt=\"{$r['Name']}\" border=0>";
                 }
                 break;
             case "team":
                 $name2 = $name . "ID";
                 if (!$r[TeamID]) {
                     $r[$name2];
                 }
                 if ($r[Flag] && $r[CountryID]) {
                     print "<img src=\"/engine/cls/images/flag.php?id={$r['CountryID']}\" border=0 title=\"{$r['Country']}\" width=21px height=13px> ";
                 }
                 print "<a href=\"/roster.php?id={$r['TeamID']}\">";
                 if ($r[TeamID] == $auth->id) {
                     print "<b>";
                 }
                 print $r[$name];
                 print "</a>";
                 break;
             case "mail":
                 if ($r[Status] == 0) {
                     print "<img src=\"/engine/img/mail/new.gif\" width=14px height=11px>";
                 } else {
                     print "<img src=\"/engine/img/mail/read.gif\">";
                 }
                 print " <a href=\"{$PHP_SELF}?id={$r['MessageID']}\">";
                 if ($r[Status] == 0) {
                     print "<b>" . $this->val . "</b>";
                 } else {
                     print $this->val;
                 }
                 print "</a>";
                 break;
             case "icon":
                 print "<center><a href=\"" . set_params($this->text) . "\"><img src=\"{$this->format}\" {$this->style} border=0></a>";
                 break;
             case "icq":
                 $this->val = str_replace(" ", "", $this->val);
                 $icq = str_replace("-", "", $this->val);
                 if ($this->val) {
                     print "<img src=\"http://status.icq.com/online.gif?icq={$icq}&img=5\"  height=18px width=18px> ";
                 }
                 if ($this->val) {
                     print "<a href=\"http://wwp.icq.com/scripts/contact.dll?msgto={$icq}\">{$this->val}</a>";
                 }
                 break;
             case "date":
                 if (is_numeric($r[$name]) && $r[$name] > 0) {
                     print "<nobr>" . date($this->format, $this->val) . "</nobr>";
                 } elseif ($r[$name] > 0) {
                     print $r[$name];
                 }
                 break;
             case "number":
                 $number++;
                 $this->val = $number;
                 print "<div align=right>" . $this->val . ".</div>";
                 break;
             case "string":
                 print "<input name=\"" . $this->name . "[" . ($numrow - 1) . "]\" onfocus='FocusIN(this);' onblur='FocusOUT(this);' type=\"text\" maxlength=\"" . $this->maxlength . "\" value=\"" . $this->val . "\" size=" . $this->size . " {$this->format}>";
                 break;
             case "numeric":
                 if (!$this->size) {
                     $this->size = 2;
                 }
                 print "<input name=\"" . $this->name . "[" . ($numrow - 1) . "]\" onfocus='FocusIN(this);' onblur='FocusOUT(this);'  type=\"text\" maxlength=\"" . $this->maxlength . "\" value=\"" . $this->val . "\" size=" . $this->size . " {$this->format}>";
                 break;
             case "image":
                 print "<input type=\"file\" name=\"" . $this->name . "[]\" style='width:170px'>";
                 break;
             case "preview":
                 if (strlen($r[$name]) > 0) {
                     print "<img src=\"{$img_url}" . "?id={$r['0']}&table=" . $this->table->table . "&dbname=" . $dbname . "\" border=0><br>";
                 }
                 break;
             case "dots":
                 print "<nobr>";
                 if ($this->val) {
                     print dots($this->val) . $this->format;
                 } else {
                     print "0" . $this->format;
                 }
                 break;
             case "money":
                 print "<nobr>";
                 if ($this->val) {
                     print $this->format . dots($this->val);
                 } else {
                     print $this->format . "0";
                 }
                 break;
             case "golden":
                 print "<nobr>";
                 print dots($this->val) . $this->format . $gd;
                 break;
             case "edit":
                 print "<a href=\"{$PHP_SELF}?act=update&id={$r['0']}&type=" . $this->table->type . "\"><img src=\"{$site_url}" . "images/icons/edit.png\" width=16px height=16px border=0 alt=\"" . sysmessage(2) . "\" title=\"" . sysmessage(2) . "\"></a>";
                 break;
             case "delete":
                 print "<a href=\"{$PHP_SELF}?act=delete&id={$r['0']}&step=1&type=" . $this->table->type . "\" onclick=\"return confirm('¬ы уверены? «апись будет удалена')\"><img src=\"{$site_url}" . "images/icons/drop.png\" width=16px height=16px border=0 alt=\"" . sysmessage(1) . "\" title=\"" . sysmessage(1) . "\"></a>";
                 break;
             case "checkbox":
                 print "<input type=\"checkbox\" name=\"" . $this->name . "[" . ($numrow - 1) . "]\"";
                 if ($r[$this->name] == 1) {
                     print " checked";
                 }
                 print ">";
                 break;
             case "radio":
                 print "<input type=\"radio\" name=\"" . $this->name . "[" . ($numrow - 1) . "]\"";
                 print " value='{$this->val}'";
                 if ($this->val == set_params($this->text)) {
                     print " checked=1";
                 }
                 print ">";
                 break;
             case "list":
                 print "<select onfocus='FocusIN(this);' onblur='FocusOUT(this);' name=\"" . $this->name . "[]\">";
                 if (!strlen($this->text)) {
                     print "<option value=\"{$this->default}\">-";
                     print "</option>";
                 }
                 $ar = explode(";", $this->vars);
                 $n = 0;
                 foreach ($ar as $v) {
                     print "<option value=\"{$n}\"";
                     if ($r[$this->name] == $n || $this->text == $v && !$r[$this->name]) {
                         print " selected";
                     }
                     print ">{$v}</option>\n";
                     $n++;
                 }
                 print "</select>\n";
                 break;
             case "sqlist":
                 $res = runsql($this->sql);
                 if (mysql_num_rows($res)) {
                     print "<select onfocus='FocusIN(this);' onblur='FocusOUT(this);' name=\"" . $this->name . "[]\">\n";
                     if (!strlen($this->text)) {
                         print "<option value=\"{$this->default}\">-";
                         print "</option>";
                     }
                     $n = 0;
                     while ($r1 = mysql_fetch_array($res)) {
                         print "<option value=\"{$r1['0']}\"";
                         if ($r1[2]) {
                             print " style='background-color:{$r1['2']}' ";
                         }
                         if ($this->val == $r1[0] && $this->val || $r[$this->name] == $r1[0] || ($this->text == $r1[1] || $this->text == "{$n}") && !$r[$this->name]) {
                             print " selected";
                         }
                         print ">";
                         print "{$r1['1']}</option>\n";
                         $n++;
                     }
                     print "</select>\n";
                 } else {
                     print "<input type=\"hidden\" name=\"{$this->name}[" . ($numrow - 1) . "]\">";
                 }
                 break;
             default:
                 print $this->format . stripslashes($r[$name]);
                 break;
         }
         if ($this->form && (!$this->type || $this->type == "number")) {
             print "<input type=\"hidden\" name=\"{$this->name}[]\" value=\"{$this->val}\">";
         }
         print "</td>\n";
     } else {
         print "<input type=\"hidden\" name=\"{$this->name}[" . ($numrow - 1) . "]\" value=\"{$this->val}\">";
     }
 }
예제 #3
0
 function DrawRow($r, $numrow)
 {
     global $debug, $img_url, $site_url, $r, $gd, $db, $number, $_POST, $auth, $dbname, $img_url;
     if ($this->default) {
         $this->val = $this->default;
     }
     if ($r[$this->name]) {
         $this->val = $r[$this->name];
     } elseif ($_POST[$this->name]) {
         $this->val = $_POST[$this->name];
     } elseif ($this->text) {
         $this->val = $this->text;
     }
     if (is_Array($this->val)) {
         $this->val = $this->val[$numrow];
     }
     //if(strstr($this->val,"\$")) $this->val=set_params($this->val);
     //if(strstr($this->text,"\$")) $this->text=set_params($this->text);
     $name = $this->name;
     if (strlen($r[$name])) {
         $this->val = $r[$name];
     }
     if (strstr($this->format, "&lt") || strstr($this->format, "&gt")) {
         $this->format = settags($this->format);
     }
     if (strstr($this->format, "\$")) {
         $format = set_params($this->format);
     } else {
         $format = $this->format;
     }
     if ($this->type != "hidden") {
         if ($this->tdstyle && strstr($this->tdstyle, "\$")) {
             print "<td " . set_params($this->tdstyle) . ">\n";
         } else {
             print "<td>";
         }
         if ($this->align == "center") {
             print "<center>";
         } elseif ($this->align) {
             print "<div align=\"{$this->align}\">";
         }
         switch ($this->type) {
             case "flag":
                 /*
                 			if(strlen($r[$name])>0&&!strstr($name,"ID")) print "<img src=\"$site_url"."cls/images/flag.php?id=$r[0]&dbname=$db->dbname\" title=\"$r[Country]\" border=0 width=21px height=13px/>";
                 			elseif(strlen($r[$name])>0) print "<img src=\"$site_url"."cls/images/flag.php?id=$r[$name]\" width=21px height=13px border=0 title=\"$r[Country]\"/>";
                 */
                 print "<img src=\"{$site_url}" . "images/flag/{$r[$name]}.gif\" width=21px height=13px border=0 title=\"{$r['Country']}\"/>";
                 break;
             case "kit":
                 if (strlen($r[$name]) > 0) {
                     print "<img src=\"/images/ut_kits/kit/{$r['0']}.jpg\" border=0>";
                 }
                 break;
             case "showimage":
                 $table = $this->table;
                 if ($r[$name]) {
                     print "<img src=\"{$img_url}?id={$r['0']}&table=" . $table->table . "\" title=\"{$r['Name']}\" alt=\"{$r['Name']}\" border=0>";
                 }
                 break;
             case "team":
                 $name2 = $name . "ID";
                 if (!$r[TeamID]) {
                     $r[$name2];
                 }
                 if ($r[Flag] && $r[CountryID]) {
                     print "<img src=\"/cls/images/flag.php?id={$r['CountryID']}\" border=0 title=\"{$r['Country']}\" width=21px height=13px/> ";
                 }
                 print "<a href=\"/xml/players/roster.php?id={$r['TeamID']}\">";
                 if ($r[TeamID] == $auth->id) {
                     print "<b>";
                 }
                 print $r[$name];
                 print "</a>";
                 break;
             case "mail":
                 if ($r[Status] == 0) {
                     print "<img src=\"/images/engine/mail.gif\" width=14px height=11px/>";
                 } else {
                     print "<img src=\"/images/engine/read.gif\">";
                 }
                 print " <a href=\"{$PHP_SELF}?id={$r['MessageID']}\">";
                 if ($r[Status] == 0) {
                     print "<b>" . $this->val . "</b>";
                 } else {
                     print $this->val;
                 }
                 print "</a>";
                 break;
             case "icon":
                 print "<center><a href=" . set_params($this->text) . "><img src=\"{$format}\" {$this->style} border=0></a>";
                 break;
             case "icq":
                 $this->val = str_replace(" ", "", $this->val);
                 $icq = str_replace("-", "", $this->val);
                 if ($this->val) {
                     print "<img src=\"http://status.icq.com/online.gif?icq={$icq}&img=5\"  height=18px width=18px/> ";
                 }
                 if ($this->val) {
                     print "<a href=\"http://wwp.icq.com/scripts/contact.dll?msgto={$icq}\">{$this->val}</a>";
                 }
                 break;
             case "date":
                 if (is_numeric($r[$name]) && $r[$name] > 0) {
                     print "<nobr>" . date($format, $this->val) . "</nobr>";
                 } elseif ($r[$name] > 0) {
                     print $r[$name];
                 }
                 break;
             case "number":
                 $number++;
                 print "<div align=right>" . $number . ".";
                 break;
             case "numeric":
                 if ($this->size == 20) {
                     $this->size = 3;
                 }
                 print "<input name=\"" . $this->name . "[" . ($numrow - 1) . "]\" onkeypress=\"javascript: return checknumeric(event)\" onblur='FocusOUT(this);' onfocus='FocusIN(this);' type=\"text\" maxlength=\"" . $this->maxlength . "\" value=\"" . $this->val . "\" size=" . $this->size . " {$format}/>";
                 break;
             case "string":
                 print "<input name=\"" . $this->name . "[" . ($numrow - 1) . "]\" onfocus='FocusIN(this);' onblur='FocusOUT(this);' type=\"text\" maxlength=\"" . $this->maxlength . "\" value=\"" . $this->val . "\" size=" . $this->size . " {$format}/>";
                 break;
             case "image":
                 print "<input type=\"file\" name=\"" . $this->name . "[]\" style='width:170px'/>";
                 break;
             case "text":
                 print "<textarea {$this->format} name=\"" . $this->name . "[" . ($numrow - 1) . "]\" cols=20 rows=2 maxlength=\"" . $this->maxlength . "\">" . str_replace("<br />", "\r\n", $this->val) . "</textarea>";
                 break;
             case "file":
                 print "<input type=\"file\" name=\"" . $this->name . "[]\" style='width:170px'/>";
                 break;
             case "preview":
                 if (strlen($r[$name]) > 0) {
                     print "<img src=\"{$img_url}" . "?id={$r['0']}&table=" . $this->table->table . "&dbname=" . $dbname . "\" border=0><br>";
                 }
                 break;
             case "dots":
                 print "<nobr>";
                 if ($this->val) {
                     print dots($this->val) . $format;
                 } else {
                     print "0" . $format;
                 }
                 break;
             case "money":
                 print "<nobr>";
                 if ($this->val) {
                     print $format . dots($this->val);
                 } elseif (strlen($this->val)) {
                     print $format . "0";
                 }
                 break;
             case "report":
                 print "<a href=\"{$site_url}" . "admin/adm_games.php?id=" . $r[0] . "\"><img src=\"{$site_url}" . "images/icons/report.gif\" width=17px height=16px border=0 alt=\"" . sysmessage(2) . "\" title=\"" . sysmessage(2) . "\"/></a>";
                 break;
             case "golden":
                 print "<nobr>";
                 print dots($this->val) . $format . $gd;
                 break;
             case "edit":
                 print "<a href=\"{$PHP_SELF}?act=update&id={$r['0']}&type=" . $this->table->type . "\"><img src=\"{$site_url}" . "images/engine/edit.png\" width=16px height=16px border=0 alt=\"" . sysmessage(2) . "\" title=\"" . sysmessage(2) . "\"/></a>";
                 break;
             case "delete":
                 print "<a href=\"{$PHP_SELF}?act=delete&id={$r['0']}&step=1&type=" . $this->table->type . "\" onclick=\"return confirm('" . sysmessage(17) . "')\"><img src=\"{$site_url}" . "images/engine/drop.png\" width=16px height=16px border=0 alt=\"" . sysmessage(1) . "\" title=\"" . sysmessage(1) . "\"/></a>";
                 break;
             case "up":
                 print "<a href=\"{$PHP_SELF}?act=up&id={$r['0']}&step=1&type=" . $this->table->type . "\"><img src=\"{$site_url}" . "images/engine/up1.gif\" width=12px height=12px border=0  /></a>";
                 break;
             case "down":
                 print "<a href=\"{$PHP_SELF}?act=down&id={$r['0']}&step=1&type=" . $this->table->type . "\"><img src=\"{$site_url}" . "images/engine/down1.gif\" width=12px height=12px border=0 /></a>";
                 break;
             case "remove":
                 print "<a href=\"{$PHP_SELF}?act=remove&id={$r['0']}&step=1&type=" . $this->table->type . "\" onclick=\"return confirm('" . sysmessage(17) . "')\"><img src=\"{$site_url}" . "images/engine/drop.png\" width=16px height=16px border=0 alt=\"" . sysmessage(1) . "\" title=\"" . sysmessage(1) . "\"/></a>";
                 break;
             case "checkbox":
                 print "<input class=\"checkbox\" type=\"checkbox\" name=\"" . $this->name . "[" . ($numrow - 1) . "]\"";
                 if ($r[$this->name] == 1) {
                     print " checked";
                 }
                 print "/>";
                 break;
             case "radio":
                 print "<input  class=\"radio\" type=\"radio\" name=\"" . $this->name . "\"";
                 print " value='{$this->val}'";
                 if ($this->val == $this->text) {
                     print " checked=1";
                 }
                 print "/>";
                 break;
             case "list":
                 print "<select onfocus='FocusIN(this);' onblur='FocusOUT(this);' name=\"" . $this->name . "[]\">";
                 if (!strlen($this->text)) {
                     print "<option value=\"{$this->default}\">-";
                     print "</option>";
                 }
                 $ar = explode(";", $this->vars);
                 $n = 0;
                 foreach ($ar as $v) {
                     print "<option value=\"{$n}\"";
                     if ($r[$this->name] == $n || $this->text == $v && !$r[$this->name]) {
                         print " selected";
                     }
                     print ">{$v}</option>\n";
                     $n++;
                 }
                 print "</select>\n";
                 break;
             case "2dreport":
                 if ($r[Finished]) {
                     print "<a href=\"{$site_url}" . "xml/tour/getmatch.php?id=" . set_params("\$MatchID;") . "\" target=_blank><img src=\"{$site_url}" . "images/engine/goal.gif\" width=15px height=15px border=0/></a>";
                 }
                 break;
             case "sqlist":
                 $res = runsql($this->sql);
                 if (mysql_num_rows($res)) {
                     print "<select onfocus='FocusIN(this);' onblur='FocusOUT(this);' name=\"" . $this->name . "[]\">\n";
                     if (!strlen($this->text)) {
                         print "<option value=\"{$this->default}\">-";
                         print "</option>";
                     }
                     $n = 0;
                     while ($r1 = mysql_fetch_array($res)) {
                         print "<option value=\"{$r1['0']}\"";
                         if ($r1[2]) {
                             print " style='background-color:{$r1['2']}' ";
                         }
                         if ($this->val == $r1[0] && $this->val || $r[$this->name] == $r1[0] || ($this->text == $r1[1] || $this->text == "{$n}") && !$r[$this->name]) {
                             print " selected";
                         }
                         print ">";
                         print "{$r1['1']}</option>\n";
                         $n++;
                     }
                     print "</select>\n";
                 } else {
                     print "<input type=\"hidden\" name=\"{$this->name}[" . ($numrow - 1) . "]\"/>";
                 }
                 break;
             default:
                 print $format . stripslashes($r[$name]);
                 break;
         }
         print "</td>\n";
     } else {
         print "<input type=\"hidden\" name=\"{$this->name}[" . ($numrow - 1) . "]\" value=\"{$this->val}\"/>";
     }
 }
예제 #4
0
파일: staff.php 프로젝트: dapfru/gladiators
    $act = "hire";
}
if ($act == "list") {
    $res = runsql("select i.StaffID,i.InfoID,i.Salary,t.Date,i.Price,concat_ws('-',i.Name_{$lang},t.Level) as Name, i.Comments_{$lang} as Comment from tm_staff t  join fn_staff_info i on i.StaffID=t.StaffID and t.Level=i.Level  and t.UserID='{$auth->user};'  order by t.Date");
    if (!mysql_num_rows($res)) {
        print icon('green', $form->empty);
    } else {
        print "<table border=0 bordercolor=\"#78746C\" width=100% bgcolor=\"#78746C\" cellpadding=4 cellspacing=1>";
        $money = 0;
        while ($r = mysql_fetch_array($res)) {
            print "<tr bgcolor=\"#515E64\"><td height=10px bgcolor=\"#3B484C\"><b><a href=\"{$PHP_SELF}?id={$r['StaffID']}\">{$r['Name']}</a></td>";
            if (file_exists($site_path . "images/fn_staff_info/small/{$r['InfoID']}.jpg")) {
                print "<td rowspan=2 valign=middle ><a href=\"staff.php?id={$r['StaffID']}\"><img src=\"/images/fn_staff_info/small/{$r['InfoID']}.jpg\" border=0 style=\"align-right:10px\"></a></td>";
            }
            print "<tr bgcolor=\"#515E64\"><td width=100% valign=middle height=90px>{$r['Comment']}<br>";
            print "<br>" . message(207) . ": " . date("d.m.Y", $r[Date]) . "</b>\n\t\t\t<br> " . message(208) . ": " . dots($r[Salary]);
            $money += $r[Salary];
            print "</td></tr>";
        }
        if ($money) {
            print "<tr><td colspan=2 align=center bgcolor=3B484C><b>Суммарная зарплата (в день): {$money}</td></tr>";
        }
        print "</table>";
    }
} elseif ($id) {
    if ($act == "hire") {
        $r = select("select *,Name_{$lang} as Name, Comments_{$lang} as Comments from fn_staff_info where StaffID='{$id}' and Level = COALESCE((select b.Level from tm_staff b LEFT OUTER JOIN fn_staff_info i on  i.StaffID=b.StaffID where UserID='{$auth->user}' and  b.StaffID='{$id}'  order by b.level desc limit 0,1),1)");
    }
    $q = select("select * from tm_staff where StaffID='{$id}' and UserID='{$auth->user};'");
    print "<table border=0 width=500px cellspacing=0 cellpadding=4>";
    if (!$q[Level] && $act == "hire" || $act != "hire") {
예제 #5
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function getEdit($id)
 {
     if (Session::get('user_level') < Config::get('cms.editComments')) {
         return Redirect::to(_l(URL::action('AdminHomeController@getIndex')))->with('message', Lang::get('admin.notPermitted'))->with('notif', 'warning');
     }
     try {
         $_SESSION['RF']['subfolder'] = 'images/';
         $comment = MemeComment::findOrFail($id);
         $this->setLayout();
         View::share('title', Lang::get('admin.editComment') . ": " . dots($comment->meme->first_line, 60));
         View::share('comment', $comment);
         $this->layout->content = View::make('backend.puskice.memeComments.editComment');
     } catch (Exception $e) {
         return Redirect::to(_l(URL::action('MemeCommentController@getIndex')))->with('message', Lang::get('admin.noSuchComment'))->with('notif', 'danger');
     }
 }
예제 #6
0
        print "<b>Outcome:</b> " . dots($q1[0]) . "<br>";
        print "<b>Income:</b> " . dots($q2[0]) . "<br>";
        print "<b>Balance:</b> " . dots($q3[0]) . "<br>";
        $q = select("select OperationID,SenderBalance from fn_operations where SenderID='{$team}' and OperationDate>unix_timestamp()-3*24*3600 order by OperationID asc limit 0,1");
        $q1 = select("select sum(Money) from fn_operations where SenderID='{$team}' and OperationID>'{$q['0']}'");
        $q2 = select("select sum(Money) from fn_operations where ReceiverID='{$team}' and OperationID>'{$q['0']}'");
        $q3 = select("select Money from fn_accounts where AccountID='{$team}'");
        $error = -$q[1] + $q1[0] + $q3[0] - $q2[0];
        if ($error) {
            print "<font color=red>";
        } else {
            print "<font color=green>";
        }
        print "<br>Three days error:  " . dots($error) . "<br>";
        print "</font>";
        print "<b>Start balance:</b> " . dots($q[1]) . "<br>";
        print "<b>Outcome:</b> " . dots($q1[0]) . "<br>";
        print "<b>Income:</b> " . dots($q2[0]) . "<br>";
        print "<b>Balance:</b> " . dots($q3[0]) . "<br>";
        print "<br>";
    }
}
require $engine_path . "cls/common/cls_catalog.php";
$catalog = new cls_catalog();
print "<table border=0 cellspacing=1 bgcolor=D3E1EC cellpadding=4><form action=\"{$PHP_SELF}\" method=\"post\"><tr><td><select name=\"id\" onchange=\"this.form.submit()\">";
print "<option value=''>" . message(54) . "</option>";
$catalog->Draw('fn_operation_types', 'TypeID', 'select', $id);
print "</select></td></form></table>";
print "<hr>";
$form->Draw();
require $site_path . "bottom.php";
예제 #7
0
        item($page_num, $i++);
    }
    if ($page_num > 5) {
        dots();
    }
    if ($page_num > 4 && $page_num < $num_pages - 1) {
        echo "<a class = \"item\"> " . ($page_num - 1) . " </a>";
    }
    if ($page_num > 3 && $page_num < $num_pages - 2) {
        echo "<a class = \"active item\"> " . $page_num . " </a>";
    }
    if ($page_num > 2 && $page_num < $num_pages - 3) {
        echo "<a class = \"item\"> " . ($page_num + 1) . " </a>";
    }
    if ($page_num < $num_pages - 4) {
        dots();
    }
    $i = $num_pages - 2;
    while ($i <= $num_pages) {
        item($page_num, $i++);
    }
} else {
    if ($page_num < 11) {
        $i = 1;
        while ($i <= $num_pages) {
            item($page_num, $i++);
        }
    }
}
echo "<a class= \"icon ";
if ($page_num == $num_pages) {
예제 #8
0
파일: left.php 프로젝트: dapfru/gladiators
 //---------- вывод базовой статистики пользователя-----------
 $r1 = select("select count(MessageID) from ut_messages where UserID2='{$auth->user}' and Status<2 and Support<>1");
 $mailnum = $r1[0];
 $r1 = select("select count(MessageID) from ut_messages where UserID2='{$auth->user}' and Status=0 and Support<>1");
 $unreadnum = $r1[0];
 $r1 = select("select HolidayID,Name_{$lang} Name from ut_holidays\n where (from_unixtime(unix_timestamp(),'%d')>=Day1 and from_unixtime(unix_timestamp(),'%m')=Month1)\n or (from_unixtime(unix_timestamp(),'%d')<=Day2 and from_unixtime(unix_timestamp(),'%m')=Month2)");
 if ($r1[HolidayID]) {
     $curholiday = $r1[Name];
 }
 print "<tr><td><table border=0 cellspacing=0 cellpadding=0 width=180px  class=menu>\n\n<tr><td><img src=\"/images/icons/profile.gif\"></td><td colspan=2>\n<table border=0 cellspacing=0 cellpadding=0 width=100%><td><a href=\"/xml/residence/info.php\"><b>Логин:</a></b></td><td align=right>";
 if ($auth->guild) {
     print guildlogo($auth->guild, 1) . " ";
 }
 print "<a href=/users/{$auth->user}>{$auth->nick}</a></b></table></td>\n<tr><td colspan=3><img src=\"/images/hr2.gif\" height=10px width=180px></td>";
 if (!$hide_finances) {
     print "<tr><td><img src=\"/images/icons/finance.gif\"></td><td><a href=\"/xml/residence/treasury.php\"><b>Финансы:</a></b></td><td align=right><a href=\"/xml/residence/treasury.php\">" . dots($auth->rst[Money]) . "</a></td>\n<tr><td colspan=3><img src=\"/images/hr2.gif\" height=10px width=180px></td>";
 }
 print "<tr><td><img src=\"/images/icons/sword.gif\"></td><td><b><a href=\"/xml/gladiators/\">Гладиаторы:</a></b></td><td align=right><a href=\"/xml/gladiators/\">" . count($auth->rst[Gladiators]) . "</a></td>\n<tr><td colspan=3><img src=\"/images/hr2.gif\" height=10px width=180px></td>\n<tr><td><img src=\"/images/icons/";
 if ($unreadnum > 0) {
     print "blink";
 }
 print "mail.gif\"></td><td><b><a href=/xml/residence/mail.php>Почта:</a></b></td><td align=right><a href=/xml/residence/mail.php>";
 if ($unreadnum > 0) {
     print "<b>";
 }
 print "{$unreadnum}</font></b>/{$mailnum}</td>";
 if ($curholiday) {
     print "<tr><td colspan=3><img src=\"/images/hr2.gif\" height=10px width=180px></td>\n<tr><td><img src=\"/images/icons/cup.gif\"></td><td colspan=2>\n<table border=0 cellspacing=0 cellpadding=0 width=100%><td><b><a href=\"/xml/misc/holidays.php\">Праздник:</a></b></td><td align=right><a href=\"/xml/misc/holidays.php#{$r1['HolidayID']}\">{$curholiday}</a></b></table></td>\n";
 }
 print "<tr><td colspan=3><img src=\"/images/hr2.gif\" height=10px width=180px></td>\n<tr><td><img src=\"/images/types/4.gif\"></td><td>";
 $q = select("select * from ft_agreements where (UserID1='{$auth->user}' or UserID2='{$auth->user}') \nand Approved=1");
예제 #9
0
 public function singleSubject($year, $department, $permalink)
 {
     try {
         $permalink = str_replace("_", "-", $permalink);
         if (Session::get('user_level') >= Config::get('cms.viewAdminNews')) {
             $page = News::where('post_type', '=', 3)->where('published', '>=', 1)->where('permalink', '=', $permalink)->firstOrFail();
         } else {
             $page = News::where('post_type', '=', 3)->where('published', '=', 2)->where('created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('permalink', '=', $permalink)->firstOrFail();
         }
         $subjects = Subject::where('news_id', '=', $page->id)->get();
         $sub = Subject::where('news_id', '=', $page->id)->first();
         $allow = false;
         foreach ($subjects as $key => $subject) {
             if ($year == Puskice::getYear($subject->semester) && Puskice::getDepartment($subject->department) == $department) {
                 $allow = true;
             }
         }
         if (!$allow) {
             App::abort(404);
         }
         $articles = News::inCategories(Config::get('settings.homepage'))->where('published', '=', 2)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(10)->get();
         $featured = News::where('published', '=', 2)->where('featured', '=', 1)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->orderBy('created_at', 'desc')->take(3)->get();
         $results = News::inCategories(Config::get('settings.results'))->where('published', '=', 2)->where('post_type', '=', 1)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get();
         $featuredImage = News::inCategories(array(25))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(3)->get();
         $didYouKnow = News::inCategories(array(30))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(3)->get();
         $magazine = News::inCategories(Config::get('settings.magazine'))->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('published', '=', 2)->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get();
         $ourComment = News::inCategories(array(17))->where('published', '=', 2)->where('news.created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->where('post_type', '=', 1)->distinct('permalink')->groupBy('news.id')->orderBy('news.created_at', 'desc')->take(4)->get();
         $feed = getFeed('http://bazaznanja.puskice.org/feed/qa.rss', 4);
         $poll = null;
         $poll = Poll::where('published', '=', '1')->where('end_date', '>', date("Y-m-d H:i:s", strtotime('now')))->where('created_at', '<', date("Y-m-d H:i:s", strtotime('now')))->first();
         if (isset($poll->id)) {
             $poll->pollOptions;
         }
         View::share('title', strip_tags($page->title) . " | Пушкице");
         $ogimage = firstImage($page);
         $meta = "\t<meta property='og:image' content='" . str_replace(" ", "%20", $ogimage) . "'/>\n\t\t\t\t\t\t<meta property='og:title' content='" . __($page->title . " | Пушкице") . "'/>\n\t\t\t\t\t\t<meta property='fb:app_id' content='355697367892039'/>\n\t\t\t\t\t\t<meta property='og:site_name' content='" . __("Пушкице - ФОН Андерграунд") . "'/>\n\t\t\t\t\t\t<meta property='og:type' content='article'/>\n\t\t\t\t\t\t<meta property='og:url' content='" . _l(Request::root() . "/" . Puskice::getYear($sub->semester) . "/" . Puskice::getDepartment($sub->department) . "/" . $page->permalink) . "'/>\n\t\t\t\t\t\t<meta property='og:description' content='" . __(dots(strip_tags($page->short_content), 500)) . "' />\n\t\t\t\t\t\t<meta name='twitter:card' content='summary_large_image'>\n\t\t\t\t\t\t<meta name='twitter:site' content='" . __("Пушкице - ФОН Андерграунд") . "'>\n\t\t\t\t\t\t<meta name='twitter:creator' content='@puskice'>\n\t\t\t\t\t\t<meta name='twitter:domain' content='puskice.org'>\n\t\t\t\t\t\t<meta name='twitter:app:name:iphone' content='" . __("Пушкице") . "'>\n\t\t\t\t\t\t<meta name='twitter:app:name:ipad' content='" . __("Пушкице") . "'>\n\t\t\t\t\t\t<meta name='twitter:title' content='" . __($page->title . " | Пушкице") . "'>\n\t\t\t\t\t\t<meta name='twitter:description' content='" . __(dots(strip_tags($page->short_content), 500)) . "'>\n\t\t\t\t\t\t<meta name='twitter:image' content='" . str_replace(" ", "%20", $ogimage) . "'>";
         $page->view_count++;
         $page->save();
         $data = array('articles' => $articles, 'featured' => $featured, 'results' => $results, 'ourComment' => $ourComment, 'magazine' => $magazine, 'featuredImage' => $featuredImage, 'didYouKnow' => $didYouKnow, 'feed' => $feed, 'poll' => $poll, 'meta' => $meta, 'sub' => $sub, 'page' => $page);
         $this->setLayout($data);
         $this->layout->center = View::make('frontend.content.subject', $data);
     } catch (Exception $e) {
         return App::abort(404);
     }
 }
예제 #10
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function getEdit($id)
 {
     if (Session::get('user_level') < Config::get('cms.editFile')) {
         return Redirect::to(_l(URL::action('AdminHomeController@getIndex')))->with('message', Lang::get('admin.notPermitted'))->with('notif', 'warning');
     }
     try {
         $_SESSION['RF']['upload_dir'] = '/download/';
         $file = Files::findOrFail($id);
         $this->setLayout();
         View::share('title', Lang::get('admin.editFile') . ": " . dots($file->title, 60));
         View::share('file', $file);
         $this->layout->content = View::make('backend.files.editFile');
     } catch (Exception $e) {
         return Redirect::to(_l(URL::action('FileController@getIndex')))->with('message', Lang::get('admin.noSuchFile'))->with('notif', 'danger');
     }
 }
예제 #11
0
require $engine_path . "cls/auth/session.php";
$type = "players/transfer";
if (!$act) {
    $act = "first";
}
$_POST['priv'] = checkpriv("players/transfer", "check");
require $site_path . "up.php";
require $site_path . "left.php";
if (0 == 1) {
    print icon('green', "Трансфер временно закрыт для проведения профилактических работ. (до 10.06.06)");
} else {
    print "<center><table border=0 cellspacing=1 bgcolor=B1B1B1 cellpadding=0><tr>";
    $num = $form->numrows;
    $bgcol = "F1F4F7";
    $q = select("select u.TrStatus as TrStatus, tr_fond({$auth->team}) as fond from ut_teams t left outer join ut_users u on u.UserID=t.UserID where t.TeamID='{$auth->team}'");
    print "<td><table border=0 cellspacing=0 cellpadding=2 bgcolor=B1B1B1 height=20px><tr bgcolor=\"{$bgcol}\"  height=20px><td><img src=\"/images/icons/golden.gif\" height=15px title=\"" . message(149) . "\" width=15px border=0> </td><td><b>" . message(141) . ":</b> " . dots($q[fond]) . $gd . "</td></table>";
    print "<td><table border=0 cellspacing=0 cellpadding=2 bgcolor=B1B1B1 height=20px><tr bgcolor=\"{$bgcol}\"  height=20px><td height=15px><img src=\"/images/icons/transfer.gif\" height=15px title=\"" . message(150) . "\" width=15px border=0> </td><td><b>" . message(142) . ":</b> " . $q[TrStatus] . "</td></table>";
    print "</td><td><table border=0 cellspacing=0 cellpadding=2 bgcolor=B1B1B1 height=20px><tr bgcolor=\"{$bgcol}\"  height=20px><td><img src=\"/images/icons/player.gif\" height=15px title=\"" . message(151) . "\" width=15px border=0> </td><td> <b>" . message(143) . ":</b> " . $num . "</td></table>";
    print "</td>";
    print "</table><br>";
    print "<table border=0 cellspacing=1 bgcolor=B1B1B1 cellpadding=4><tr bgcolor={$bgcol}>";
    $q = select("select Tr_SenderPerc+Tr_LeaguesPerc as Tr_SenderPerc,Tr_ReceiverPerc+Tr_LeaguesPerc as Tr_ReceiverPerc,Tr_LegionerPerc FROM ut_leagues u");
    print "<td><b>" . message(144) . ":</b> </td>";
    print "<td>" . message(145) . ": <b><font color=EC9E10>{$q['0']}%</b></font></td>";
    print "<td>" . message(146) . ": <b><font color=green>{$q['1']}%</b></font>,";
    print " " . message(147) . ": <b><font color=green>+{$q['2']}%</font></b></td>";
    print "</table></center><br>";
    if ($act == "my") {
        print "<center><b>" . message(155) . ":</b><br><br>";
        $form->Draw();
        print "<br><center><b>" . message(156) . ":</b><br><br>";