-

. , . .

,
19.01.2017
3,1 M

. ,

, , , , .

Web- Microsoft Windows 2003 Server . , Microsoft . , Web- CGI (Web- Apache, ) .

.

3.4

, , Apache+MySQL+PHP Windows. .

Microsoft Windows 2003 Server

MW 2003 Server - ( Windows). TCP/IP , Ethernet, SLIP (SerialLineInternetProtocol, TCP/IP ), PLIP (ParallelLineInternetProtocol), PPP (Point-to-PointProtocol), NFS (NetworkFileSystem). TCP/IP, FTP, telnet, NNTP SMTP.

Apache 3.0.1

:

1. , ( GET, POST);

2. , ;

3. Expires: proxy ;

4. Vary: ETag, ( proxy-cache /1.1);

5. URL ;

:

Accept-Charset: / Accept: text/x-cyrillic ... charset, , , nativecharset;

;

URI ;

" - ";

, ( , );

/ - . .. , "";

, , .

:

1. - . ,

2. ,

3. . (User-agent: ) charset-;

4. , MIME, ;

5. charset URL User-agent;

6. charset (.. charset-);

MySQL 5.5

MySQL - . , SQL. Mysql - , .. . , , , , , .

Mysql , . (, PHP) . PhpMyAdmin. Mysql.

PhpMyAdmin , , . SQL PhpMyAdmin , Internet. , , .

MySQL:

, ;

;

;

ODBC ;

;

16 . 15 ;

CREATE;

1 4 (ints, float, double, fixed), ;

perl;

, ;

(Jsarnchk);

IS08859_1;

;

, ;

. INSERT ;

, .

-

- . - - . " " : InternetExplorer( Microsoft Windows), Mozilla Firefox (, , Linux, Ubuntu), Safari( MacOSX Microsoft Windows), Opera

( 8.50), Google Chrome (), Avant (). . , . Tom'shardwareguide. :

1. ;

2. ;

3. javascript;

4. HTML 5 CSS.

Google Chrome. . , . , , .

, :

1. ;

2. ;

3. ;

4. ;

5. ;

6. , ;

7. ;

8. .

4.

4.1

, , " " " ".

11 -

4.2

5 :

1. ;

2. ;

3. ;

4. ;

5. ;

12 -

10

.

. :

1. ;

2. , 2 20;

3. 3 100 ;

4. , , "".

""(2).

, . , , , ""(1).

13 -

4.3 " "

" ". :

1. ;

2. , ;

3. .

""(1). , (2). (3). (4) " ".

14 - " "

4.4 " "

. " "(1) " " " "(2) (7) " " " ". " "(3) " ". "". .

15 - " "

" "(4) .

16 - " ",

" "(5) , . , (9) (10) . , (11).

17 - " ",

:

18 -

" "(6) , .

19 -

4.5 " "

(1), (2), , (3). " " .

20 - " "

4.6 " "

" " " ", , (1).

21 - " "

. " "(1), (2) ""(3). - , .

22 -

4.7 " "

:

1. :

23 - " ".

(1), "", . , - . , , , , .

2. :

3.

24 -

, , (1) . (2) " ", " " .

25 - " ".

4.8 ", "

:

1. ;

2. .

26 - ", "

" "(1), , . "" ""(2), . , . .

:

27 - ", ".

, (, )(1). ""(3) , " "(2) " ".

:

28 - ", ".

, , . , (4). , (2), - (1). (5) (6). (3), . , , - .

:

1. '' '' `' '`, : `''`;

2. '' 66. '';

:

1. '' '' , - `' '`;

2. '' '' `' '`, '';

3. '' '' `' '`, ;

4. '' '' `' '`, .

, , , " ".

, , , 50%.

, , .

, , , .

4.9 ""

"" , global.inc.php , , . , (1).

:

1. (2) - . ;

2. - .

29 - "". " "

, , . "". , :

1. " ";

2. ", ".

" " .

, , .

, , , .

, "".

" " :

30 - "". " "

, , . "..", . " " , .

, .

, "".

, , , .

" " :

31 - "". " "

. , , . - .

"" "" :

32 - "". "" ""

, . , "". .

, .

, "".

, , , .

"" :

33 - "". ""

, , .

.

.

, , , .

. , . , . , , . .

1. .., .. .

2. .., .. .

3. . PHP.

4. , . YSQL.

5. 19.105-78.

6. 19.201-78. .

7. 19.505-79. . .

1. Apache+PHP+MySQL

. , "" - " ", 5.5 MB. .

:

1. ( flash-).

2. Apache, SSL, SSI, mod_rewrite, mod_php.

3. PHP5 GD, MySQL, sqLite.

4. MySQL5 .

5. , . , /home, . ; .

6. .

7. phpMyAdmin - MySQL Web-.

8. sendmail SMTP- ( "" localhost:25, /tmp .eml); PHP, Perl, Parser ..

. :

1. ""

, ( C:\WebServers, Enter, ). , ( ).

- , C:\WebServers, , , C:\My\WebServers. , . , , . , ?..

, . (Z:). , - Z:.

, , . :

1. (, , ), () . , , .

2. ( ). , , - .

2.

<?php

//logout.php

if (abs(intval($_GET['act']))==1){

session_start();

include (dirname(__FILE__).'/engine/classes/UserTools.class.php');

$userTools = new UserTools();

$userTools->logout();

header("Location:/index.php");

}

else{

header("Location:/index.php");

//include_once ("index.php");

}

?>

<?php

/*

SELECT kaf_users.id,fromId,toId,login FROM kaf_mail left outer join kaf_users on kaf_mail.fromId=kaf_users.id or kaf_mail.toId=kaf_users.id WHERE fromId = 10 OR toId=10 Group By login

SELECT id,login FROM kaf_mail left outer join kaf_users on kaf_mail.fromId=kaf_users.id or kaf_mail.toId=kaf_users.id WHERE fromId = 10 OR toId=10 Group By login

*/

class DB {

/* protected $db_name = 'articls';

protected $db_user = 'articls';

protected $db_pass = 'wt7jxRd5';

protected $db_host = 'localhost';*/

protected $db_name = 'kafedra';

protected $db_user = 'root';

protected $db_pass = '';

protected $db_host = 'localhost';

static $sqlCount;

public $prefix = 'kaf_';

public $say;

function __construct() {

$this->say = $this->prefix.'say';

$this->stena = $this->prefix.'stena';

$this->fotoComments = $this->prefix.'fotoComments';

$this->blogPostComments = $this->prefix.'blog_posts_comments';

}

public function whatTable ($data){

switch ($data) {

case 'say' : {$data = $this->say;break;}

case 'stena' : {$data = $this->stena;break;}

case 'foto' : {$data = $this->fotoComments;break;}

case 'blog' : {$data = $this->blogPostComments;break;}

}

return $data;

}

public function connect() {

$connection = mysql_connect($this->db_host, $this->db_user, $this->db_pass);

mysql_query('SET NAMES utf8') or header('Location: Error');

mysql_select_db($this->db_name);

return true;

}

// mysql ,

// . singleRow - true,

//

public function processRowSet($rowSet, $singleRow=false){

$resultArray = array();

while($row = mysql_fetch_assoc($rowSet)){

array_push($resultArray, $row); //

}

if($singleRow === true)

return $resultArray[0];

return $resultArray;

}

//

// $table $where

public function select($table, $where, $fields="*") {

$sql = "SELECT $fields FROM $table WHERE $where";

$this->requestsCount++;

$result = mysql_query($sql);

if(mysql_num_rows($result) == 1) {

return $this->processRowSet($result, true);}

return $this->processRowSet($result);

}

//

public function update($data, $table, $where) {

$this->requestsCount++;

$fields = $field_data = array();

$sql="UPDATE $table SET ";

foreach ($data as $key => $value){

$fields[] = $key;

if (is_numeric($value)){

$field_data[] = (int)$value;

}else{

$field_data[] = '"'.mysql_escape_string(trim($value)).'"';

}

}//echo $sql;

for ($i=0;$i<count($data);$i++){

$sql.=$fields[$i].'='.$field_data[$i].',';

}

$sql=substr($sql, 0, strlen($sql)-1);

$sql.= " WHERE $where";

return $this->query($sql);

}

public function query($sql){

$this->requestsCount++;

if (mysql_query($sql))return 1;

else return mysql_error();

}

public function getQuery($sql){

$this->requestsCount++;

if ($res=mysql_query($sql))return $res;

else return mysql_error();

}

public function delete($table,$where){

$this->requestsCount++;

$sql = "DELETE FROM `$table` WHERE $where";

return $this->query($sql);

}

public function count($table,$where){

$this->requestsCount++;

$sql = mysql_query("SELECT * FROM `$table` WHERE $where");

if(!$sql)return 0;

else return mysql_num_rows($sql);

}

final public function insert($table, array $data){

$this->requestsCount++;

$fields = $field_data = array();

foreach ($data as $key => $value){

$fields[] = '`'.$key.'`';

if (is_numeric($value)){

$field_data[] = (int)$value;

}else{

$field_data[] = '"'.mysql_escape_string(trim($value)).'"';

}

}

return $this->query('INSERT INTO `'.$table.'` ('.implode(',', $fields).') VALUES('.implode(',', $field_data).')');

}

}

?>

<?php

//Func.class.php

class Func {

public function getDate($date,$type=""){

if($type=="d"){

return date("j",$date);

}

elseif($type=="m"){

return abs(date("m",$date));

}

elseif($type=="y"){

return date("Y",$date);

}

else{

return date("d.m.y",$date);

}

}

public function russianDate($date,$type='',$year=1,$month=1,$day=1,$time=1){

if($type == 'month'){

$date=explode(".", date("d.m.Y.G:i",$date));

switch ($date[1]){

case 1: $m='Январь'; break;

case 2: $m='Февраль'; break;

case 3: $m='Март'; break;

case 4: $m='Апрель'; break;

case 5: $m='Май'; break;

case 6: $m='Июнь'; break;

case 7: $m='Июль'; break;

case 8: $m='Август'; break;

case 9: $m='Сентябрь'; break;

case 10: $m='Октябрь'; break;

case 11: $m='Ноябрь'; break;

case 12: $m='Декабрь'; break;

}

return $m;

}

if($type=='fullAndWeek'){

$week=explode(".", date("w",$date));

switch ($week[0]){

case 1: $week='понедельник'; break;

case 2: $week='вторник'; break;

case 3: $week='среда'; break;

case 4: $week='четверг'; break;

case 5: $week='пятница'; break;

case 6: $week='суббота'; break;

case 0: $week='воскресенье'; break;

}

}

else{

$week='';

}

if($type=='week'){

$week=explode(".", date("w",$date));

switch ($week[0]){

case 1: $week='понедельник'; break;

case 2: $week='вторник'; break;

case 3: $week='среда'; break;

case 4: $week='четверг'; break;

case 5: $week='пятница'; break;

case 6: $week='суббота'; break;

case 0: $week='воскресенье'; break;

}

return $week;

}

$date=explode(".", date("d.m.Y.G:i",$date));

if($type=='short'){

switch ($date[1]){

case 1: $m='янв'; break;

case 2: $m='фев'; break;

case 3: $m='мар'; break;

case 4: $m='апр'; break;

case 5: $m='мая'; break;

case 6: $m='июн'; break;

case 7: $m='июл'; break;

case 8: $m='авг'; break;

case 9: $m='сен'; break;

case 10: $m='окт'; break;

case 11: $m='ноя'; break;

case 12: $m='дек'; break;

}

}

else {

switch ($date[1]){

case 1: $m='января'; break;

case 2: $m='февраля'; break;

case 3: $m='марта'; break;

case 4: $m='апреля'; break;

case 5: $m='мая'; break;

case 6: $m='июня'; break;

case 7: $m='июля'; break;

case 8: $m='августа'; break;

case 9: $m='сентября'; break;

case 10: $m='октября'; break;

case 11: $m='ноября'; break;

case 12: $m='декабря'; break;

}

}

return ($day==1?abs($date[0]):null).'&nbsp;'.($month==1?$m.'&nbsp;':null).($year==1?$date[2].'':null).(!empty($week)?',&nbsp'.$week.'&nbsp':null).($time==1?$date[3]:null);

}

public function rgbToHex($rgb){

$hex = '#';

$hex .= str_pad(dechex($rgb[0]), 2, "0", STR_PAD_LEFT);

$hex .= str_pad(dechex($rgb[1]), 2, "0", STR_PAD_LEFT);

$hex .= str_pad(dechex($rgb[2]), 2, "0", STR_PAD_LEFT);

return $hex;

}

public function countOfDays($time){

$n=date("j",$time);

$n=intval($n);

$n=$time-$n*86400+1;

$res['last']=date("t",$n);

$n=$time;

$res['now']=date("t",$n);

$n=date("j",$time);

$n=intval($n);

$count=date("t",$time)-$n+1;

$n=$time+$count*86400;

$res['next']=date("t",$n);

return $res;

}

public function toArray($array) {

if (is_array($array) && !isset($array[0]))

$array = array(0=>$array);

return $array;

}

public $agencys = array (

'01' => 'MO',

);

Function DateDiff($date1,$date2,$interval='d') {

// получает количество секунд между двумя датами

$timedifference = $date2 - $date1;

switch ($interval) {

case 'w':

$retval = bcdiv($timedifference,604800);

break;

case 'd':

$retval = bcdiv($timedifference,86400);

break;

case 'h':

$retval =bcdiv($timedifference,3600);

break;

case 'n':

$retval = bcdiv($timedifference,60);

break;

case 's':

$retval = $timedifference;

break;

}

return $retval;

}

Function isHoliday($date,$holidayList=null) {

global $db;

$date=strtotime(date('d.m.Y',$date));

$week=explode(".", date("w",$date));

$isHoliday = ($week[0]==6 || $week[0]==0)?true:false;

if(!$isHoliday) {

if($holidayList==null){

$req = $db->select($db->prefix.'holidays','unitId=0','date,everyYear');

$req = $this->toArray($req);

}

else {

$req = $holidayList;

}

foreach ($req AS $key => $hd){

if($hd['date']){

$hd['date']=strtotime(date('d.m.',$hd['date']).date('Y',time()));

}

$holidays[] = $hd['date'];

}

$isHoliday = (in_array($date,$holidays)) ? true : false ;

}

return $isHoliday;

}

function getHolidayList($dateFrom,$dateTo=0){

global $db;

$dateTo = ($dateTo==0) ? time() : $dateTo;

$dateFrom=strtotime(date('d.m.Y',$dateFrom));

$dateTo=strtotime(date('d.m.Y',$dateTo));

$differDate=$this->DateDiff($dateFrom,$dateTo)+1; // разница между 2 датами

$dateFrombuf=$dateFrom;

$holDB = $this->toArray($db->select($db->prefix.'holidays','unitId=0','date,everyYear'));

for($i=0;$i<$differDate;$i++){

$this->isHoliday($dateFrombuf,$holDB) ? $holidays[]=$dateFrombuf : null;

$dateFrombuf+=86400;

}

return $holidays;

}

function options($sqlTable,$col,$selectId,$downIndex=0,$upUndex=0,$sort=''){

global $db;

unset($array);

$array=array();

$sort=(!empty($sort) ? $sort : 'id');

$array=$db->select($db->prefix.$sqlTable,"id>0 ORDER BY $sort ASC");

$array = $this->toArray($array);

$i=$downIndex;

$j=($upUndex!=0)?$upUndex:count($array);

$return= " <option value='0'></option> ";

for($i;$i<$j;$i++){

$id=$array[$i]['id'];

$selected=($id==$selectId)?"selected='selected'":"";

$value=$array[$i][$col];

$value.=(($array[$i]['isFac'])?'ф':'');

$return.= " <option style='min-width' $selected value='$id'>$value</option> ";

}

return $return;

}

function strFirstUp($str){

return mb_convert_case(mb_strtolower($str),MB_CASE_TITLE,'UTF-8');

}

function getUnitsOptions($selectId=0,$type='unit',$field='',$unitId=null){

global $db,$user;

unset($array);

switch ($type) {

case 'unit' : {

$field=($field=='')?'number':$field;

$units=$db->select($db->prefix.'units AS U Left JOIN '.$db->prefix.'fucks AS F ON F.id=U.id Left JOIN '.$db->prefix.'kafs AS K ON K.id=U.id Left JOIN '.$db->prefix.'unitsType AS T ON T.id=U.typeId',

'U.id>0 ORDER BY U.typeId,F.number,K.number ASC','F.'.$field.' AS Fnum,U.id,K.'.$field.' AS Knum, T.id AS Tid, T.title AS title');

break;

}

case 'user' : {

$unitId=(!empty($unitId) ? 'and unitId='.$unitId : '');

$units=$db->select($db->prefix.'users' , 'id>0 AND activate=1 '.$unitId.' ORDER BY id ASC ', 'id, login AS title');

$Tid='user';

break;

}

}

$units = $this->toArray($units);

foreach ($units AS $k=>$unit) {

$id= $unit['id'];

$selected=($id==$selectId)?"selected='selected'":"";

if(isset($unit['Tid'])){

if($unit['Tid']==1) {

$value= ($field=='number') ? $unit['Fnum'].mb_substr($unit['title'],0,1) : $unit['Fnum'];

} else if($unit['Tid']==2) {

$value = ($field=='number') ? $unit['Knum'].mb_substr($unit['title'],0,1) : $unit['Fnum'];

}

} else if($Tid=='user') {

$value = $unit['title'];

$id= $unit['id'];

}

$return.= " <option $selected value='$id'>$value</option> ";

}

return $return;

}

function getUnit($id,$fields="*",$unitType='',$key='id'){

global $db;

if(!empty($id) ){

if(empty($unitType)){

$req=$db->select($db->prefix.'units AS U Left JOIN '.$db->prefix.'unitsType AS T ON T.id=U.typeId',

"U.id=$id",'U.id, T.*');

$unit=$db->select($db->prefix.'units AS U Left JOIN '.$db->prefix.$req['sqlTable'].' AS T ON T.id=U.id',

"U.id=$id",'T.'.$fields);

if(count($fields==1) && $fields!='*'){

$unit=$unit[$fields];

}

$unit['unitTitle']=$req['title'];

} else if(!empty($key)){

$req=$db->select($db->prefix.'unitsType',"title='$unitType'");

$unit=$db->select($db->prefix.$req['sqlTable'],"$key=$id",$fields);

if(count($fields==1) && $fields!='*'){

$unit=$unit[$fields];

}

} else {

return false;

}

}

return $unit;

}

function showUsers($where=null,$field='id',$id=0){

global $site,$page,$db,$userTools;

$where = (!$where) ? 'U.id>0' : 'U.'.$field.'='.$where;

$where.=' AND U.id<>'.$id;

$result = $db->select($db->prefix.'users as U LEFT JOIN '.$db->prefix.'ranks as R ON R.id=U.rankId

LEFT JOIN '.$db->prefix.'usersRoles as Rool ON Rool.id=U.roleId',

$where,

'U.*, R.title AS RankTitle, Rool.title AS RoolTitle');

$result['rank']['id']=$result['rankId'];

$result['role']['id']=$result['roleId'];

$result['rank']['title']=$result['RankTitle'];

$result['role']['title']=$result['RoolTitle'];

//$unit['type']['title'] = $result['role']['title'];

if(!empty($result['unitId'])){

$unit['typeId']=$db->select($db->prefix.'units','id='.$result['unitId'],'typeId'); // АЙДИ типа подразделения

$unit['typeTitle']=$db->select($db->prefix.'unitsType','id='.$unit['typeId']['typeId'],'title'); // тайтл (факультет/кафедра)

switch ($unit['typeId']['typeId']) {

case 1: {$table='fucks';$unitFields='number,title,abr';break;}

case 2: {$table='kafs';$unitFields='number,title,fuckId';break;}

}

$unit['fields']=$db->select($db->prefix.$table,'id='.$result['unitId'],$unitFields); // получаем поля подразделения

$result['unit']['id']=$result['unitId'];

$result['unit']['typeId']=$unit['typeId']['typeId'];

$result['unit']['typeTitle']=$unit['typeTitle']['title'];

$result['unit']['number']=$unit['fields']['number'];

$result['unit']['title']=$unit['fields']['title'];

$result['unit']['shotTitle']=$unit['fields']['number'].' '.mb_substr($unit['typeTitle']['title'],0,1);

$result['unit']['abr']=$unit['fields']['abr'];

$result['unit']['fuckId']=$unit['fields']['fuckId'];

}

$users = $result;

foreach ($users AS $i => $us){

if($us['id']){

$ava=$userTools->checkAvatar($us['avatar']);

$out .="

<a href='".$site->url.$page->dosie."?id=".$us['id']."'>

<div id='user".$us['id']."' style='float:left; min-height:70px; min-width:170px;padding-right:10px;'>

<div style='float:left; padding-right:5px;'><img src='".$site->url."/upload/miniava/".$ava."'></div>

<div style='float:left'>

".$us['login']."

</div>

".$us['unit']['shotTitle']."

</div>

</a>

";

}

}

return $out;

}

public function calendar($date=0,$act='view',$unitId=null,$userId=null) {

global $user,$db,$func,$userTools,$tpl,$site,$page;

$fill = array(date("Y-m-d"));

$month_names=array("Январь","Февраль","Март","Апрель","Май","Июнь",

"Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь");

if($date!=0){

$date = explode('.',date('d.m.Y',$date));

$m = $date[1];

$y = $date[2];

}

if (!isset($y) OR $y < 1970 OR $y > 2037) $y=date("Y");

if (!isset($m) OR $m < 1 OR $m > 12) $m=date("m");

$month_stamp=mktime(0,0,0,$m,1,$y);

$day_count=date("t",$month_stamp);

$weekday=date("w",$month_stamp);

if ($weekday==0) $weekday=7;

$start=-($weekday-2);

$last=($day_count+$weekday-1) % 7;

if ($last==0) $end=$day_count; else $end=$day_count+7-$last;

$today=strtotime('1.'.$m.'.'.$y);

$prev=strtotime(date('1.m.Y',mktime (0,0,0,$m-1,1,$y)));

$next=strtotime(date('1.m.Y',mktime (0,0,0,$m+1,1,$y)));

if(!empty($userId)){

$userId = abs(intval($userId));

}

if($unitId!=null){

$unitIdSQL = ' AND U.id='.abs(intval($unitId));

} else {

$unitIdSQL = '';

}

$i=0;

$arrayOfDutyTypes=$db->select($db->prefix.'dutyTypes',"id>0");

$dutyTypes = $func->toArray($arrayOfDutyTypes); // виды нарядов в филиале

$arrayOfUnits=$db->select($db->prefix.'units AS U Left JOIN '.$db->prefix.'fucks AS F ON F.id=U.id Left JOIN '.$db->prefix.'kafs AS K ON K.id=U.id Left JOIN '.$db->prefix.'unitsType AS T ON T.id=U.typeId',

'U.id>0 '.$unitIdSQL.' ORDER BY U.typeId,F.number,K.number ASC','F.number AS Fnum, U.id, K.number AS Knum, T.id AS Tid, T.title AS title');

$units = $func->toArray($arrayOfUnits); // список подразделений

$buf=array();

foreach ($units AS $k=>$unit){

$buf[$unit['id']]['id']=$unit['id'];

if($unit['Tid']==1){

$buf[$unit['id']]['number']=$unit['Fnum'];

} else{

$buf[$unit['id']]['number']=$unit['Knum'];

}

$buf[$unit['id']]['number']=$buf[$unit['id']]['number'].mb_substr($unit['title'],0,1);

$buf[$unit['id']]['title']=$unit['title'];

}

unset($units);

$units=$buf;

$i=0;

$showDuties = array(); // вывод нарядов на календарь

$unitIdSQL = (!empty($unitId)) ? ' AND unitId='.abs(intval($unitId)) : '';

$arrayOfAllUsers=$db->select($db->prefix.'users',"id>0 AND activate=1".$unitIdSQL);

$allusers = $func->toArray($arrayOfAllUsers); // пользователи ALL

$thisMonth['start'] = strtotime('1.'.$m.'.'.$y);

$thisMonth['end'] = strtotime($day_count.'.'.$m.'.'.$y);

$dutiesFromDb = $db->select($db->prefix.'duty',"date BETWEEN ".$thisMonth['start']." AND ".$thisMonth['end']." ORDER BY date ASC"); // наряды на месяц из базы

$dutiesFromDb = $func->toArray($dutiesFromDb);

//var_export($dutiesFromDb);

$l=0;

$userTools->getRools();

$events = array(); // массив из событий(селектов)

$days = array(); // массив дней в которых изменены наряды

//var_export($dutiesFromDb);

for($i=1;$i<=$day_count;$i++){

if(!empty($dutiesFromDb[($l)]['dutyTypeId'])){

if($this->getDate($dutiesFromDb[($l)]['date'],"d")==$i){

$days[]=$i;

$dateBuf = date('j',$dutiesFromDb[($l)]['date']);

while($i == $dateBuf){

//$func->getDate($dutiesFromDb[($l-1)]['date'],"d").'|';

$events[$i][]=$dutiesFromDb[$l];

$l++;

$dateBuf = date('j',$dutiesFromDb[($l)]['date']);

}

}

else{

$events[$i]=NULL;

}

}

else{

$events[$i]=NULL;

}

}

//var_export($events);

if (isset($_GET['act']) || isset($act)) {

$act=empty($act) ? $_GET['act'] : $act;

// - EDIT комендант

if($act=="edit"){

if($user->rools[0]){

for($day=1;$day<=$day_count;$day++){

$x=0;

while($dutyTypes[$x]['id']!=''){

$j=0;

$showDuties[$day].='

<div style=" clear:right">

<div style="float:left" title="'.$dutyTypes[$x]['fullTitle'].'">'.$dutyTypes[$x]['title'].'</div>

<div style="float:right;">

<select style="" name="select['.$day.'][]" id="select['.$day.'][]"><option value=""> </option>';

//while($units[$j]['id']!=''){

foreach($units AS $k=>$v){

if(in_array($day,$days)){

for($p=0;$p<count($events[$day]);$p++){

if($units[$k]['id']==$events[$day][$p]['unitId'] && $dutyTypes[$x]['id']==$events[$day][$p]['dutyTypeId']){

$selected = "selected='selected'";

break;

}

else{

$selected = "";

}

}

}

else{

$selected = "";

}

$showDuties[$day].='<option '.$selected.' value="'.$units[$k]['id'].'">'.$units[$k]['number'].'</option>';

$j++;

}

$showDuties[$day].='

</select>

<input type="hidden" name="dutyTypeId['.$day.'][]" id="dutyTypeId['.$day.'][]" value="'.$dutyTypes[$x]['id'].'">

</div>

</div>';

$x++;

}

}

//echo var_export($showDuties);

}

// - EDIT Начальники Кафедр и Факульетов

elseif($user->rools[1]){ // начКаф & начФак

$arr='';

if(!empty($user->unit['id'])){

$arrayOfUsers=$db->select($db->prefix.'users',"unitId=".$user->unit['id'].' AND activate=1');

$users = $func->toArray($arrayOfUsers); // пользователи для НачКафа


  • . . . . . .

    [882,3 K], 18.01.2014

  • "" 0. -. , .

    [8,2 M], 25.12.2011

  • . . , . , .

    [2,0 M], 07.03.2015

  • , , -. . .

    [1,9 M], 08.02.2015

  • . . - .

    [5,2 M], 26.05.2012

  • . front-end . . . SQL- Oracle.

    [1,0 M], 09.11.2016

  • "1: 8.0" -. . .

    [640,5 K], 14.02.2015

  • . . .

    [1,9 M], 09.02.2018

  • . , . . .

    [1,6 M], 04.12.2014

  • , "", .

    [5,3 M], 29.06.2012

, , ..
PPT, PPTX PDF- .
.