Розробка проекту мобільного робочого місця "Нарядчик поїзних бригад"

Програмні засоби автоматизації планування та обліку робіт поїзних бригад нарядчиком пасажирської вагонної дільниці. Загальна характеристика мобільного робочого місця. Програмна реалізація структурних елементів. Система управління реляційними базами даних.

Рубрика Программирование, компьютеры и кибернетика
Вид дипломная работа
Язык украинский
Дата добавления 15.10.2013
Размер файла 1,5 M

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

$page = $_GET['page'];

$limit = $_GET['rows'];

$sidx = $_GET['sidx'];

$sord = $_GET['sord'];

$id = $_GET['id'];

if(!$sidx) $sidx =1;

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name="chleny_brigady";

switch ($q)

{

case 1:

$result = mysql_query("SELECT COUNT(*) AS count FROM $tb_name WHERE id_chlena=".$id);

$row = mysql_fetch_array($result);

$count = $row['count'];

if( $count >0 )

{

$total_pages = ceil($count/$limit);

}

else

{

$total_pages = 0;

}

if

($page > $total_pages)

$page=$total_pages;

$start = $limit*$page - $limit;

if ($start<0)

$start = 0;

$SQL = "SELECT * FROM $tb_name WHERE id_chlena=".$id." ORDER BY $sidx $sord LIMIT $start , $limit";

$result = mysql_query( $SQL ) or die("Couldn?t execute query.".mysql_error());

$responce->page = $page;

$responce->total = $total_pages;

$responce->records = $count;

$i=0;

while($row = mysql_fetch_array($result))

{

$responce->rows[$i]['id']=$row[id_brigady];

$responce->rows[$i]['cell']=array($row[tab_nomer],$row[PIB_chlena_brig]);

$i++;

}

echo json_encode($responce);

break;

}

?>

Лістинг «bd_config.php»

<?php

$db=mysql_connect('mysql.hostinger.com.ua','u757735049_admin','4052552')or die("Помилка!Не можливо з'єднатися з сервером mysql!" . mysql_error());

mysql_select_db("u757735049_naryad") or die("Error conecting to db.");

?>

Лістинг «bd_ind_list.php»

<?php

$page = $_GET['page'];

$limit = $_GET['rows'];

$sidx = $_GET['sidx'];

$sord = $_GET['sord'];

$fio=$_GET['fio'];

if(!$sidx) $sidx =1;

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name="Individ_marsh_listy";

if(isset($fio))

$query = "SELECT COUNT(*) AS count FROM $tb_name WHERE FIO='".$fio."'";

else

$query = "SELECT COUNT(*) AS count FROM $tb_name";

$result=mysql_query($query) or die(mysql_error());

$row=mysql_fetch_array($result);

$count = $row['count'];

if( $count >0 ) {

$total_pages = ceil($count/$limit);

} else {

$total_pages = 0;

}

if ($page > $total_pages) $page=$total_pages;

$start = $limit*$page - $limit;

if (isset($_GET['_search']) && $_GET['_search'] == 'true')

{

if(isset($_GET['searchOper']))

{

switch ($_GET['searchOper'])

{

case 'eq':

$qWhere = $_GET['searchField']."='".$_GET['searchString']."'";

break;

case 'ne':

$qWhere = $_GET['searchField']."<>'".$_GET['searchString']."'";

break;

case 'bw':

$qWhere = $_GET['searchField']." LIKE '".$_GET['searchString']."%'";

break;

case 'cn':

$qWhere = $_GET['searchField']." LIKE '%".$_GET['searchString']."%'";

break;

default: throw new Exception('Условие не существует!');

}

$qWhere=$qWhere." AND";

}

}

if(isset($fio))

$SQL = "SELECT * FROM $tb_name WHERE $qWhere FIO='".$fio."' ORDER BY $sidx $sord LIMIT $start , $limit";

else

$SQL = "SELECT * FROM $tb_name $qWhere ORDER BY $sidx $sord LIMIT $start , $limit";

$result = mysql_query( $SQL ) or die("Couldn t execute query.".mysql_error());

$responce->page = $page;

$responce->total = $total_pages;

$responce->records = $count;

$i=0;

while($row = mysql_fetch_array($result)) {

$responce->rows[$i]['id']=$row[id_Individ_marsh_listy];

if(isset($fio))

$responce->rows[$i]['cell']=array(substr($row[yavka],0,16),$row[Potyag],$row[Napryamok],substr($row[Uhod],0,16),$row[nomer_vagona],$row[Norma],$row[Hvostovyi]);

else

$responce->rows[$i]['cell']=array($row[FIO],substr($row[yavka],0,16),$row[Potyag],$row[Napryamok],substr($row[Uhod],0,16),$row[nomer_vagona],$row[Norma],$row[Hvostovyi]);

$i++;

}

echo json_encode($responce);

?>

Лістинг «bd_kalendar_list.php»

<?php

$page = $_GET['page']; $

limit = $_GET['rows'];

$sidx = $_GET['sidx'];

$sord = $_GET['sord'];

if(!$sidx) $sidx =1;

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name="Kalendar";

$query = "SELECT COUNT(*) AS count FROM $tb_name";

$result=mysql_query($query) or die(mysql_error());

$row=mysql_fetch_array($result);

$count = $row['count'];

if( $count >0 ) {

$total_pages = ceil($count/$limit);

} else {

$total_pages = 0;

}

if ($page > $total_pages) $page=$total_pages;

$start = $limit*$page - $limit;

if (isset($_GET['_search']) && $_GET['_search'] == 'true')

{

if(isset($_GET['searchOper']))

{

switch ($_GET['searchOper'])

{

case 'eq':

$qWhere = "WHERE ".$_GET['searchField']."='".$_GET['searchString']."'";

break;

case 'ne':

$qWhere = "WHERE ".$_GET['searchField']."<>'".$_GET['searchString']."'";

break;

case 'bw':

$qWhere = "WHERE ".$_GET['searchField']." LIKE '".$_GET['searchString']."%'";

break;

case 'cn':

$qWhere = "WHERE ".$_GET['searchField']." LIKE '%".$_GET['searchString']."%'";

break;

default: throw new Exception('Условие не существует!');

}

}

}

$SQL = "SELECT * FROM $tb_name $qWhere ORDER BY $sidx $sord LIMIT $start , $limit";

$result = mysql_query( $SQL ) or die("Couldn t execute query.".mysql_error());

$responce->page = $page;

$responce->total = $total_pages;

$responce->records = $count;

$i=0;

while($row = mysql_fetch_array($result)) {

$responce->rows[$i]['id']=$row[id_kalendar];

$responce->rows[$i]['cell']=array($row[FIO],$row[nomer_potyaga],$row[Napryamok],substr($row[Start_poezdka],0,16),substr($row[Yavka],0,16),substr($row[Uhod],0,16),$row[Norma],$row[p_doba],$row[v_doba],$row[t_doba],$row[ch_doba],$row[pya_doba],$row[sh_doba],$row[s_doba],$row[Vsogo]);

$i++;

}

echo json_encode($responce);

?>

Лістинг «bd_napryamok.php»

<?php

$page = $_GET['page'];

$limit = $_GET['rows'];

$sidx = $_GET['sidx'];

$sord = $_GET['sord'];

if(!$sidx) $sidx =1;

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name="Napryamok";

$query = "SELECT COUNT(*) AS count FROM $tb_name";

$result=mysql_query($query) or die(mysql_error());

$row=mysql_fetch_array($result);

$count = $row['count'];

if( $count >0 ) {

$total_pages = ceil($count/$limit);

} else {

$total_pages = 0;

}

if ($page > $total_pages) $page=$total_pages;

$start = $limit*$page - $limit;

if (isset($_GET['_search']) && $_GET['_search'] == 'true')

{

if(isset($_GET['searchOper']))

{

switch ($_GET['searchOper'])

{

case 'eq':

$qWhere = "WHERE ".$_GET['searchField']."='".$_GET['searchString']."'";

break;

case 'ne':

$qWhere = "WHERE ".$_GET['searchField']."<>'".$_GET['searchString']."'";

break;

case 'bw':

$qWhere = "WHERE ".$_GET['searchField']." LIKE '".$_GET['searchString']."%'";

break;

case 'cn':

$qWhere = "WHERE ".$_GET['searchField']." LIKE '%".$_GET['searchString']."%'";

break;

default: throw new Exception('Условие не существует!');

}

}

}

$SQL = "SELECT * FROM $tb_name $qWhere ORDER BY $sidx $sord LIMIT $start , $limit";

$result = mysql_query( $SQL ) or die("Couldn t execute query.".mysql_error());

$responce->page = $page;

$responce->total = $total_pages;

$responce->records = $count;

$i=0;

while($row = mysql_fetch_array($result))

{

$responce->rows[$i]['id']=$row[id_napryamok];

$responce->rows[$i]['cell']=array($row[napryamok]);

$i++;

}

echo json_encode($responce);

?>

Лістинг «bd_norma.php»

<?php

$page = $_GET['page'];

$limit = $_GET['rows'];

$sidx = $_GET['sidx'];

$sord = $_GET['sord'];

if(!$sidx) $sidx =1;

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name="Norma";

$query = "SELECT COUNT(*) AS count FROM $tb_name";

$result=mysql_query($query) or die(mysql_error());

$row=mysql_fetch_array($result);

$count = $row['count'];

if( $count >0 ) {

$total_pages = ceil($count/$limit);

} else {

$total_pages = 0;

}

if ($page > $total_pages) $page=$total_pages;

$start = $limit*$page - $limit;

if (isset($_GET['_search']) && $_GET['_search'] == 'true')

{

if(isset($_GET['searchOper']))

{

switch ($_GET['searchOper'])

{

case 'eq':

$qWhere = "WHERE ".$_GET['searchField']."='".$_GET['searchString']."'";

break;

case 'ne':

$qWhere = "WHERE ".$_GET['searchField']."<>'".$_GET['searchString']."'";

break;

case 'bw':

$qWhere = "WHERE ".$_GET['searchField']." LIKE '".$_GET['searchString']."%'";

break;

$qWhere = "WHERE ".$_GET['searchField']." LIKE '%".$_GET['searchString']."%'";

break;

default: throw new Exception('Условие не существует!');

}

}

}

$SQL = "SELECT * FROM $tb_name $qWhere ORDER BY $sidx $sord LIMIT $start , $limit";

$result = mysql_query( $SQL ) or die("Couldn t execute query.".mysql_error());

$responce->page = $page;

$responce->total = $total_pages;

$responce->records = $count;

$i=0;

while($row = mysql_fetch_array($result)) {

$responce->rows[$i]['id']=$row[id_norma];

$responce->rows[$i]['cell']=array($row[norma]);

$i++;

}

echo json_encode($responce);

?>

Лістинг «bd_polzovateli.php»

<?php

$page = $_GET['page'];

$limit = $_GET['rows'];

$sidx = $_GET['sidx'];

$sord = $_GET['sord'];

if(!$sidx) $sidx =1;

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name="polzovateli";

$query = "SELECT COUNT(*) AS count FROM $tb_name";

$result=mysql_query($query) or die(mysql_error());

$row=mysql_fetch_array($result);

$count = $row['count'];

if( $count >0 ) {

$total_pages = ceil($count/$limit);

} else {

$total_pages = 0;

}

if ($page > $total_pages) $page=$total_pages;

$start = $limit*$page - $limit;

if (isset($_GET['_search']) && $_GET['_search'] == 'true')

{

if(isset($_GET['searchOper']))

{

switch ($_GET['searchOper'])

{

case 'eq':

$qWhere = "WHERE ".$_GET['searchField']."='".$_GET['searchString']."'";

break;

case 'ne':

$qWhere = "WHERE ".$_GET['searchField']."<>'".$_GET['searchString']."'";

break;

case 'bw':

$qWhere = "WHERE ".$_GET['searchField']." LIKE '".$_GET['searchString']."%'";

break;

case 'cn':

$qWhere = "WHERE ".$_GET['searchField']." LIKE '%".$_GET['searchString']."%'";

break;

default: throw new Exception('Условие не существует!');

}

}

}

$SQL = "SELECT * FROM $tb_name $qWhere ORDER BY $sidx $sord LIMIT $start , $limit";

$result = mysql_query( $SQL ) or die("Couldn t execute query.".mysql_error());

$responce->page = $page;

$responce->total = $total_pages;

$responce->records = $count;

$i=0;

while($row = mysql_fetch_array($result)) {

$responce->rows[$i]['id']=$row[id];

$responce->rows[$i]['cell']=array($row[tabnomer],$row[FIO],$row[doljnost],$row[login]);

$i++;

}

echo json_encode($responce);

?>

Лістинг «bd_rabota.php»

<?php

$page = $_GET['page'];

$limit = $_GET['rows'];

$sidx = $_GET['sidx'];

$sord = $_GET['sord'];

if(!$sidx) $sidx =1;

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name="Rabota";

$query = "SELECT COUNT(*) AS count FROM $tb_name";

$result=mysql_query($query) or die(mysql_error());

$row=mysql_fetch_array($result);

$count = $row['count'];

if( $count >0 ) {

$total_pages = ceil($count/$limit);

} else {

$total_pages = 0;

}

if ($page > $total_pages) $page=$total_pages;

$start = $limit*$page - $limit;

if (isset($_GET['_search']) && $_GET['_search'] == 'true')

{

if(isset($_GET['searchOper']))

{

switch ($_GET['searchOper'])

{

case 'eq':

$qWhere = "WHERE ".$_GET['searchField']."='".$_GET['searchString']."'";

break;

case 'ne':

$qWhere = "WHERE ".$_GET['searchField']."<>'".$_GET['searchString']."'";

break;

case 'bw':

$qWhere = "WHERE ".$_GET['searchField']." LIKE '".$_GET['searchString']."%'";

case 'cn':

$qWhere = "WHERE ".$_GET['searchField']." LIKE '%".$_GET['searchString']."%'";

break;

default: throw new Exception('Условие не существует!');

}

}

}

$SQL = "SELECT * FROM $tb_name $qWhere ORDER BY $sidx $sord LIMIT $start , $limit";

$result = mysql_query( $SQL ) or die("Couldn t execute query.".mysql_error());

$responce->page = $page;

$responce->total = $total_pages;

$responce->records = $count;

$i=0;

while($row = mysql_fetch_array($result))

{

$responce->rows[$i]['id']=$row[id__rabota];

$responce->rows[$i]['cell']=array($row[Nazvanie]);

$i++;

}

echo json_encode($responce);

?>

Лістинг «bd_tab_list_provodnik.php»

<?php

$page = $_GET['page'];

$limit = $_GET['rows'];

$sidx = $_GET['sidx'];

$sord = $_GET['sord'];

$fio=$_GET['fio'];

if(!$sidx) $sidx =1;

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name="tabel";

if(isset($fio))

$query = "SELECT COUNT(*) AS count FROM $tb_name WHERE PIB='".$fio."'";

else

$query = "SELECT COUNT(*) AS count FROM $tb_name";

$result=mysql_query($query) or die(mysql_error());

$row=mysql_fetch_array($result);

$count = $row['count'];

if( $count >0 ) {

$total_pages = ceil($count/$limit);

} else {

$total_pages = 0;

}

if ($page > $total_pages) $page=$total_pages;

$start = $limit*$page - $limit;

if (isset($_GET['_search']) && $_GET['_search'] == 'true')

{

if(isset($_GET['searchOper']))

{

switch ($_GET['searchOper'])

{

case 'eq':

$qWhere = $_GET['searchField']."='".$_GET['searchString']."'";

break;

case 'ne':

$qWhere = $_GET['searchField']."<>'".$_GET['searchString']."'";

break;

case 'bw':

$qWhere = $_GET['searchField']." LIKE '".$_GET['searchString']."%'";

break;

case 'cn':

$qWhere = $_GET['searchField']." LIKE '%".$_GET['searchString']."%'";

break;

default: throw new Exception('Условие не существует!');

}

$qWhere=$qWhere." AND";

}

}

if(isset($fio))

$SQL = "SELECT * FROM $tb_name WHERE $qWhere PIB='".$fio."' ORDER BY $sidx $sord LIMIT $start , $limit";

else

$SQL = "SELECT * FROM $tb_name $qWhere ORDER BY $sidx $sord LIMIT $start , $limit";

$result = mysql_query( $SQL ) or die("Couldn t execute query.".mysql_error());

$responce->page = $page;

$responce->total = $total_pages;

$responce->records = $count;

$i=0;

while($row = mysql_fetch_array($result)) {

$responce->rows[$i]['id']=$row[id_provodnika];

if(isset($fio))

$responce->rows[$i]['cell']=array(

$row[Napryam],$row[Norma],

$row[perv_p],$row[vtor_p],

$row[tret_p],$row[chet_p],

$row[pyat_p],$row[shest_p],

$row[sedm_p],$row[vosm_p],

$row[devyat_p],$row[desyat_p],

$row[odinadc_p],$row[dvenadc_p],

$row[trenadc_p],$row[chetyrn_p],

$row[pyatn_p],$row[shestn_p],

$row[semn_p],$row[vosemn_p],

$row[devyatn_p],$row[dvadc_p],

$row[dvadc_perv_p],$row[dvadc_vtor_p],

$row[dvadc_tret_p],$row[dvadc_chetv_p],

$row[dvadc_pyat_p],$row[dvadc_shest_p],

$row[dvadc_sedm_p],$row[dvadc_vosm_p],

$row[dvadc_devyat_p],$row[tredcatoe_p],

$row[tredcat_perv_p],$row[perv_v],

$row[vtor_v],$row[tret_v],

$row[chet_v],$row[pyat_v],

$row[shest_v],$row[sedm_v],

$row[vosm_v],$row[devyat_v],

$row[desyat_v],$row[odinadc_v],

$row[dvenadcat_v],$row[trenadcat_v],

$row[chetyrn_v],$row[pyatnadc_v],

$row[shestnadc_v],$row[semnadc_v],

$row[vosemnadc_v],$row[devyatnadc_v],

$row[dvadcat_v],$row[dvadcat_perv_v],

$row[dvadcat_vtor_v],$row[dvadcat_tret_v],

$row[dvadcat_chetv_v],$row[dvadcat_pyat_v],

$row[dvadcat_shest_v],$row[dvadcat_sedm_v],

$row[dvadcat_vosm_v],$row[dvadcat_devyat_v],

$row[tridcatoe_v],$row[per_t],

$row[vtor_t],$row[tret_t],

$row[chet_t],$row[pyat_t],

$row[shest_t],$row[sedm_t],

$row[sedm_t],$row[devyat_t],

$row[desyat_t],$row[odinadc_t],

$row[dvenadc_t],$row[trinadc_t],

$row[chetyrn_t],$row[pyatn_t],

$row[shestn_t],$row[semn_t],

$row[vosemn_t],$row[devyatn_t],

$row[dvadc_t],$row[dvadcat_perv_t],

$row[dvadcat_vtor_t],$row[dvadcat_tret_t],

$row[dvadcat_chetv_t],$row[dvadcat_pyat_t],

$row[dvadca_shest_t],$row[dvadcat_sedm_t],

$row[dvadcat_vosm_t],$row[dvadcat_devyat_t],

$row[tridcatoe_t],$row[tridc_per_t]

);

$i++;

}

echo json_encode($responce);

?>

Додаток Д

Програмна реалізація редагування таблиць

Лістинг «edit_brig_list.php»

<?php

$id = $_POST['id'];

$operaciya = $_POST['oper'];

$nomer_brigady = $_POST['nomer_brigady'];

$nachalnik_potyaga = $_POST['nachalnik_potyaga'];

$potyag = $_POST['potyag'];

$napryam = $_POST['napryam'];

$yavka = $_POST['yavka'];

$uhod = $_POST['uhod'];

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name='brigadnie_marsh_listy';

switch($operaciya)

{

case 'add':

mysql_query("INSERT into $tb_name(nomer_brigady,nachalnik_potyaga,potyag,napryam,yavka,uhod)

values (

'".$nomer_brigady."',

'".$nachalnik_potyaga."',

'".$potyag."',

'".$napryam."',

'".$yavka."',

'".$uhod."'

);")

or die(mysql_error());

break;

case 'edit':

mysql_query("UPDATE $tb_name

SET

nomer_brigady='".$nomer_brigady."',

nachalnik_potyaga='".$nachalnik_potyaga."',

potyag='".$potyag."',

napryam='".$napryam."',

yavka='".$yavka."',

uhod='".$uhod."'

where

id_br_mr_list='".$id."'

;")

or die(mysql_error());

break;

case 'del':

mysql_query("DELETE from $tb_name where id_br_mr_list=".$id);

break;

}

?>

Лістинг «edit_brigada.php»

<?php

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name="brigady";

$id = $_POST['id'];

$operaciya = $_POST['oper'];

$Nomer_brigady = $_POST['Nomer_brigady'];

$nachalnik_poezda = $_POST['nachalnik_poezda'];

switch($operaciya)

{

case 'add':

mysql_query("INSERT into $tb_name(Nomer_brigady,nachalnik_poezda)

values (

'".$Nomer_brigady."',

'".$nachalnik_poezda."'

);")

or die(mysql_error());

break;

case 'edit':

mysql_query("UPDATE $tb_name

SET

Nomer_brigady='".$Nomer_brigady."',

nachalnik_poezda='".$nachalnik_poezda."',

where

id_brig='".$id."'

;")

or die(mysql_error());

break;

case 'del':

mysql_query("DELETE from $tb_name where id_brig=".$id)

or die(mysql_error());

mysql_query("DELETE from `chleny_brigady` where id_brigady=".$id)

or die(mysql_error());

break;

}

?>

Лістинг «edit_chleni_brigadi»

<?php

$tb_name="chleny_brigady";

$q = $_GET['q'];

$id = $_POST['id'];

$operaciya =$_POST['oper'];

$id_chlena = $_GET['id_chlena'];

$tab_nomer = $_POST['tab_nomer'];

$PIB_chlena_brig = $_POST['PIB_chlena_brig'];

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

if($q==1)

{

switch($operaciya)

{

case 'add':

mysql_query("INSERT into $tb_name(id_chlena,tab_nomer,PIB_chlena_brig)

values (

'".$id_chlena."',

'".$tab_nomer."',

'".$PIB_chlena_brig."'

);")

or die(mysql_error());

break;

case 'edit':

mysql_query("UPDATE $tb_name

SET

id_chlena='".$id_chlena."',

tab_nomer='".$tab_nomer."',

PIB_chlena_brig='".$PIB_chlena_brig."'

where

id_brigady='".$id."'

;")

or die(mysql_error());

break;

case 'del':

mysql_query("DELETE from $tb_name where id_brigady=".$id)

or die(mysql_error());

break;

}

}

?>

Лістинг «edit_ind_list.php»

<?php

$id = $_POST['id'];

$operaciya = $_POST['oper'];

$FIO = $_POST['FIO'];

$yavka = $_POST['yavka'];

$Potyag = $_POST['Potyag'];

$Napryamok = $_POST['Napryamok'];

$Uhod = $_POST['Uhod'];

$nomer_vagona = $_POST['nomer_vagona'];

$Norma = $_POST['Norma'];

$Hvostovyi = $_POST['Hvostovyi'];

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name='Individ_marsh_listy';

switch($operaciya)

{

case 'add':

mysql_query("INSERT into $tb_name(FIO,yavka,Potyag,Napryamok,Uhod,nomer_vagona,Norma,Hvostovyi)

values (

'".$FIO."',

'".$yavka."',

'".$Potyag."',

'".$Napryamok."',

'".$Uhod."',

'".$nomer_vagona."',

'".$Norma."',

'".$Hvostovyi."'

);")

or die(mysql_error());

break;

case 'edit':

mysql_query("UPDATE $tb_name

SET

FIO='".$FIO."',

yavka='".$yavka."',

Potyag='".$Potyag."',

Napryamok='".$Napryamok."',

Uhod='".$Uhod."',

nomer_vagona='".$nomer_vagona."',

Norma='".$Norma."',

Hvostovyi='".$Hvostovyi."'

where

id_Individ_marsh_listy='".$id."'

;")

or die(mysql_error());

break;

case 'del':

mysql_query("DELETE from $tb_name where id_Individ_marsh_listy=".$id);

break;

}

?>

Лістинг «edit_kalendar_list.php»

<?php

$id = $_POST['id'];

$operaciya = $_POST['oper'];

$FIO = $_POST['FIO'];

$nomer_potyaga = $_POST['nomer_potyaga'];

$Napryamok = $_POST['Napryamok'];

$start_poezdka = $_POST['Start_poezdka'];

$Yavka = $_POST['Yavka'];

$Uhod = $_POST['Uhod'];

$Norma = $_POST['Norma'];

$Vsogo = $_POST['Vsogo'];

$p_doba = $_POST['p_doba'];

$v_doba = $_POST['v_doba'];

$t_doba = $_POST['t_doba'];

$ch_doba = $_POST['ch_doba'];

$pya_doba = $_POST['pya_doba'];

$sh_doba = $_POST['sh_doba'];

$s_doba = $_POST['s_doba'];

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name='Kalendar';

switch($operaciya)

{

case 'add':

mysql_query("INSERT into $tb_name(FIO,nomer_potyaga,Napryamok,Start_poezdka,Yavka,Uhod,Vsogo,Norma,p_doba,v_doba,t_doba,ch_doba,pya_doba,sh_doba,s_doba)

values (

'".$FIO."',

'".$nomer_potyaga."',

'".$Napryamok."',

'".$start_poezdka."',

'".$Yavka."',

'".$Uhod."',

'".($p_doba+$v_doba+$t_doba+$ch_doba+$pya_doba+$sh_doba+$s_doba)."',

'".$Norma."',

'".$p_doba."',

'".$v_doba."',

'".$t_doba."',

'".$ch_doba."',

'".$pya_doba."',

'".$sh_doba."',

'".$s_doba."'

);")

or die(mysql_error());

$row=mysql_fetch_array(mysql_query("SELECT * FROM $tb_name WHERE FIO='".$FIO."'"));

$id_dob_roz=$row[id_kalendar];

$query_string_param="PIB,

Napryam,Norma,perv_p,vtor_p,tret_p,chet_p,

pyat_p,shest_p,sedm_p,vosm_p,devyat_p,

desyat_p,odinadc_p,dvenadc_p,trenadc_p,

chetyrn_p,pyatn_p,shestn_p,semn_p, vosemn_p,

devyatn_p,dvadc_p,dvadc_perv_p,dvadc_vtor_p,

dvadc_tret_p,dvadc_chetv_p,

dvadc_pyat_p, dvadc_shest_p,dvadc_sedm_p,

dvadc_vosm_p, dvadc_devyat_p,tredcatoe_p,

tredcat_perv_p, perv_v,vtor_v,tret_v,

chet_v,pyat_v,shest_v,sedm_v,vosm_v,

devyat_v,desyat_v,odinadc_v,dvenadcat_v,

trenadcat_v,chetyrn_v,pyatnadc_v,shestnadc_v,

semnadc_v,vosemnadc_v,devyatnadc_v,dvadcat_v,

dvadcat_perv_v,dvadcat_vtor_v,dvadcat_tret_v,

dvadcat_chetv_v,dvadcat_pyat_v,dvadcat_shest_v,

dvadcat_sedm_v,dvadcat_vosm_v,dvadcat_devyat_v,

tridcatoe_v,per_t,vtor_t,tret_t,chet_t,

pyat_t, shest_t,sedm_t,vosm_t,devyat_t,

desyat_t,odinadc_t,dvenadc_t,trinadc_t,

chetyrn_t,pyatn_t, shestn_t,semn_t,vosemn_t,

devyatn_t,dvadc_t,dvadcat_perv_t,

dvadcat_vtor_t,dvadcat_tret_t,dvadcat_chetv_t,

dvadcat_pyat_t,dvadca_shest_t, dvadcat_sedm_t,

dvadcat_vosm_t,dvadcat_devyat_t,tridcatoe_t,

tridc_per_t,start_poezdka,id_dob_roz";

$query_string_value='';

for($i=0;$i<92;$i++)

{

if($i>0)

$query_string_value=$query_string_value.',';

if($i<92)

$query_string_value=$query_string_value."'".$p_doba."',";

else

break;

if($i+1<92)

$query_string_value=$query_string_value."'".$v_doba."',";

else

break;

if($i+2<92)

$query_string_value=$query_string_value."'".$t_doba."',";

else

break;

if($i+3<92)

$query_string_value=$query_string_value."'".$ch_doba."',";

else

break;

if($i+4<92)

$query_string_value=$query_string_value."'".$pya_doba."',";

else

break;

if($i+5<92)

$query_string_value=$query_string_value."'".$sh_doba."',";

else

break;

if($i+6<92)

$query_string_value=$query_string_value."'".$s_doba."'";

else

break;

$i=$i+6;

}

if(substr($query_string_value,-1)==',')

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

$query="INSERT into tabel(".$query_string_param.")values('".$FIO."','".$Napryamok."','".$Norma."',".$query_string_value.",'".$start_poezdka."','".$id_dob_roz."');";

mysql_query($query) or die(mysql_error());

break;

case 'edit':

mysql_query("UPDATE $tb_name

SET

FIO='".$FIO."',

nomer_potyaga='".$nomer_potyaga."',

Napryamok='".$Napryamok."',

Start_poezdka='".$start_poezdka."',

Yavka='".$Yavka."',

Uhod='".$Uhod."',

Vsogo='".($p_doba+$v_doba+$t_doba+$ch_doba+$pya_doba+$sh_doba+$s_doba)."',

Norma='".$Norma."',p_doba='".$p_doba."',

v_doba='".$v_doba."',t_doba='".$t_doba."',

ch_doba='".$ch_doba."',

pya_doba='".$pya_doba."',

sh_doba='".$sh_doba."',s_doba='".$s_doba."'

where

id_kalendar='".$id."'

;")

or die(mysql_error());

$param_array=array(

"perv_p","vtor_p","tret_p","chet_p","pyat_p","shest_p",

"sedm_p","vosm_p","devyat_p","desyat_p","odinadc_p",

"dvenadc_p","trenadc_p","chetyrn_p","pyatn_p","shestn_p",

"semn_p","vosemn_p","devyatn_p","dvadc_p","dvadc_perv_p",

"dvadc_vtor_p","dvadc_tret_p","dvadc_chetv_p",

"dvadc_pyat_p","dvadc_shest_p","dvadc_sedm_p",

"dvadc_vosm_p","dvadc_devyat_p","tredcatoe_p",

"tredcat_perv_p","perv_v","vtor_v","tret_v","chet_v",

"pyat_v","shest_v","sedm_v","vosm_v","devyat_v","desyat_v",

"odinadc_v","dvenadcat_v","trenadcat_v","chetyrn_v",

"pyatnadc_v","shestnadc_v","semnadc_v","vosemnadc_v",

"devyatnadc_v","dvadcat_v","dvadcat_perv_v",

"dvadcat_vtor_v","dvadcat_tret_v","dvadcat_chetv_v",

"dvadcat_pyat_v","dvadcat_shest_v","dvadcat_sedm_v",

"dvadcat_vosm_v","dvadcat_devyat_v","tridcatoe_v","per_t","vtor_t", "tret_t","chet_t","pyat_t","shest_t",

"sedm_t","vosm_t","devyat_t","desyat_t","odinadc_t",

"dvenadc_t","trinadc_t","chetyrn_t","pyatn_t","shestn_t",

"semn_t","vosemn_t","devyatn_t","dvadc_t","dvadcat_perv_t",

"dvadcat_vtor_t","dvadcat_tret_t","dvadcat_chetv_t",

"dvadcat_pyat_t","dvadca_shest_t","dvadcat_sedm_t",

"dvadcat_vosm_t","dvadcat_devyat_t","tridcatoe_t",

"tridc_per_t");

$query="UPDATE tabel

SET

PIB='".$FIO."',

Napryam='".$Napryamok."',

Norma='".$Norma."',

start_poezdka='".$start_poezdka."',";

$query_string_value='';

for($i=0;$i<92;$i++)

if($i>0)

$query_string_value=$query_string_value.',';

if($i<92)

$query_string_value=$query_string_value.$param_array[$i]."="."'".$p_doba."',";

else

break;

if($i+1<92)

$query_string_value=$query_string_value.$param_array[$i+1]."="."'".$v_doba."',";

else

break;

if($i+2<92)

$query_string_value=$query_string_value.$param_array[$i+2]."="."'".$t_doba."',";

else

break;

if($i+3<92)

$query_string_value=$query_string_value.$param_array[$i+3]."="."'".$ch_doba."',";

else

break;

if($i+4<92)

$query_string_value=$query_string_value.$param_array[$i+4]."="."'".$pya_doba."',";

else

break;

if($i+5<92)

$query_string_value=$query_string_value.$param_array[$i+5]."="."'".$sh_doba."',";

else

break;

if($i+6<92)

$query_string_value=$query_string_value.$param_array[$i+6]."="."'".$s_doba."'";

else

break;

$i=$i+6;

}

if(substr($query_string_value,-1)==',')

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

$query=$query.$query_string_value." WHERE id_dob_roz=".$id;

mysql_query($query) or die(mysql_error());

break;

case 'del':

mysql_query("DELETE from $tb_name where id_kalendar=".$id);

mysql_query("DELETE from tabel where id_dob_roz=".$id);

break;

}

?>

Лістинг «edit_napryamok.php»

<?php

$id = $_POST['id'];

$oper = $_POST['oper'];

$napryamok = $_POST['napryamok'];

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name="Napryamok";

switch($oper)

{

case 'add':

mysql_query("INSERT into $tb_name(napryamok)

values (

'".$napryamok."'

);")

or die(mysql_error());

break;

case 'edit':

mysql_query("UPDATE $tb_name

SET

napryamok='".$napryamok."'

where

id_napryamok='".$id."'

;")

or die(mysql_error());

break;

case 'del':

mysql_query("DELETE from $tb_name where id_napryamok=".$id)

or die(mysql_error());

break;

}

?>

Лістинг «edit_norma.php»

<?php

$id = $_POST['id'];

$oper = $_POST['oper'];

$norma = $_POST['norma'];

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name="Norma";

switch($oper)

{

case 'add':

mysql_query("INSERT into $tb_name(norma)

values (

'".$norma."'

);")

or die(mysql_error());

break;

case 'edit':

mysql_query("UPDATE $tb_name

SET

norma='".$norma."'

where

id_norma='".$id."'

;")

or die(mysql_error());

break;

case 'del':

mysql_query("DELETE from $tb_name where id_norma=".$id)or die(mysql_error());

break;

}

?>

Лістинг «edit_polzovateli.php»

<?php

$id = $_POST['id'];

$operaciya = $_POST['oper'];

$login = $_POST['login'];

$FIO = $_POST['FIO'];

$tabnomer = $_POST['tabnomer'];

$doljnost = $_POST['doljnost'];

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name='polzovateli';

switch($operaciya)

{

case 'add':

mysql_query("INSERT into $tb_name(FIO,tabnomer,doljnost)

values (

'".$FIO."',

'".$tabnomer."',

'".$doljnost."'

);")

or die(mysql_error());

break;

case 'edit':

mysql_query("UPDATE $tb_name

SET

FIO='".$FIO."',

tabnomer='".$tabnomer."',

doljnost='".$doljnost."'

where

id='".$id."'

;")

or die(mysql_error());

break;

case 'del':

mysql_query("DELETE from $tb_name where id=".$id);

break;

}

?>

Лістинг «edit_rabota.php»

<?php

$id = $_POST['id'];

$oper = $_POST['oper'];

$Nazvanie = $_POST['Nazvanie'];

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name="Rabota";

switch($oper)

{

case 'add':

mysql_query("INSERT into $tb_name(Nazvanie)

values (

'".$Nazvanie."'

);")

or die(mysql_error());

break;

case 'edit':

mysql_query("UPDATE $tb_name

SET

Nazvanie='".$Nazvanie."'

where

id__rabota='".$id."'

;")

or die(mysql_error());

break;

case 'del':

mysql_query("DELETE from $tb_name where id__rabota=".$id)

or die(mysql_error());

break;

}

?>

Лістинг «edit_tabel_provodnika.php»

<?php

$id = $_POST['id'];

$operaciya = $_POST['oper'];

$chet_p = $_POST['chet_p'];

$chet_t = $_POST['chet_t'];

$chet_v = $_POST['chet_v'];

$chetyrn_p = $_POST['chetyrn_p'];

$chetyrn_t = $_POST['chetyrn_t'];

$chetyrn_v = $_POST['chetyrn_v'];

$desyat_p = $_POST['desyat_p'];

$desyat_t = $_POST['desyat_t'];

$desyat_v = $_POST['desyat_v'];

$devyat_p = $_POST['devyat_p'];

$devyat_t = $_POST['devyat_t'];

$devyat_v = $_POST['devyat_v'];

$devyatn_p = $_POST['devyatn_p'];

$devyatn_t = $_POST['devyatn_t'];

$devyatnadc_v = $_POST['devyatnadc_v'];

$dvadc_chetv_p = $_POST['dvadc_chetv_p'];

$dvadc_devyat_p = $_POST['dvadc_devyat_p'];

$dvadc_p = $_POST['dvadc_p'];

$dvadc_perv_p = $_POST['dvadc_perv_p'];

$dvadc_pyat_p = $_POST['dvadc_pyat_p'];

$dvadc_sedm_p = $_POST['dvadc_sedm_p'];

$dvadc_shest_p = $_POST['dvadc_shest_p'];

$dvadc_t = $_POST['dvadc_t'];

$dvadc_tret_p = $_POST['dvadc_tret_p'];

$dvadc_vosm_p = $_POST['dvadc_vosm_p'];

$dvadc_vtor_p = $_POST['dvadc_vtor_p'];

$dvadca_shest_t = $_POST['dvadca_shest_t'];

$dvadcat_chetv_t = $_POST['dvadcat_chetv_t'];

$dvadcat_chetv_v = $_POST['dvadcat_chetv_v'];

$dvadcat_devyat_t = $_POST['dvadcat_devyat_t'];

$dvadcat_devyat_v = $_POST['dvadcat_devyat_v'];

$dvadcat_perv_t = $_POST['dvadcat_perv_t'];

$dvadcat_perv_v = $_POST['dvadcat_perv_v'];

$dvadcat_pyat_t = $_POST['dvadcat_pyat_t'];

$dvadcat_pyat_v = $_POST['dvadcat_pyat_v'];

$dvadcat_sedm_t = $_POST['dvadcat_sedm_t'];

$dvadcat_sedm_v = $_POST['dvadcat_sedm_v'];

$dvadcat_shest_v = $_POST['dvadcat_shest_v'];

$dvadcat_tret_t = $_POST['dvadcat_tret_t'];

$dvadcat_tret_v = $_POST['dvadcat_tret_v'];

$dvadcat_v = $_POST['dvadcat_v'];

$dvadcat_vosm_t = $_POST['dvadcat_vosm_t'];

$dvadcat_vosm_v = $_POST['dvadcat_vosm_v'];

$dvadcat_vtor_t = $_POST['dvadcat_vtor_t'];

$dvadcat_vtor_v = $_POST['dvadcat_vtor_v'];

$dvenadc_p = $_POST['dvenadc_p'];

$dvenadc_t = $_POST['dvenadc_t'];

$dvenadcat_v = $_POST['dvenadcat_v'];

$odinadc_p = $_POST['odinadc_p'];

$odinadc_t = $_POST['odinadc_t'];

$odinadc_v = $_POST['odinadc_v'];

$per_t = $_POST['per_t'];

$perv_p = $_POST['perv_p'];

$perv_v = $_POST['perv_v'];

$pyat_p = $_POST['pyat_p'];

$pyat_t = $_POST['pyat_t'];

$pyat_v = $_POST['pyat_v'];

$pyatn_p = $_POST['pyatn_p'];

$pyatn_t = $_POST['pyatn_t'];

$pyatnadc_v = $_POST['pyatnadc_v'];

$sedm_p = $_POST['sedm_p'];

$sedm_t = $_POST['sedm_t'];

$sedm_v = $_POST['sedm_v'];

$semn_p = $_POST['semn_p'];

$semn_t = $_POST['semn_t'];

$semnadc_v = $_POST['semnadc_v'];

$shest_p = $_POST['shest_p'];

$shest_t = $_POST['shest_t'];

$shest_v = $_POST['shest_v'];

$shestn_p = $_POST['shestn_p'];

$shestn_t = $_POST['shestn_t'];

$shestnadc_v = $_POST['shestnadc_v'];

$tredcat_perv_p = $_POST['tredcat_perv_p'];

$tredcatoe_p = $_POST['tredcatoe_p'];

$trenadc_p = $_POST['trenadc_p'];

$trenadcat_v = $_POST['trenadcat_v'];

$tret_p = $_POST['tret_p'];

$tret_t= $_POST['tret_t'];

$tret_v = $_POST['tret_v'];

$tridc_per_t = $_POST['tridc_per_t'];

$tridcatoe_t = $_POST['tridcatoe_t'];

$tridcatoe_v = $_POST['tridcatoe_v'];

$trinadc_t = $_POST['trinadc_t'];

$vosemn_p = $_POST['vosemn_p'];

$vosemn_t = $_POST['vosemn_t'];

$vosemnadc_v = $_POST['vosemnadc_v'];

$vosm_p = $_POST['vosm_p'];

$vosm_t = $_POST['vosm_t'];

$vosm_v = $_POST['vosm_v'];

$vtor_p = $_POST['vtor_p'];

$vtor_t= $_POST['vtor_t'];

$vtor_v = $_POST['vtor_v'];

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

$tb_name='tabel';

switch($operaciya)

{

case 'edit':

mysql_query("UPDATE $tb_name

SET

chet_p = '".$chet_p."',

chet_t = '".$chet_t."',

chet_v = '".$chet_v."',

chetyrn_p = '".$chetyrn_p."',

chetyrn_t = '".$chetyrn_t."',

chetyrn_v = '".$chetyrn_v."',

desyat_p = '".$desyat_p."',

desyat_t = '".$desyat_t."',

desyat_v = '".$desyat_v."',

devyat_p = '".$devyat_p."',

devyat_t = '".$devyat_t."',

devyat_v = '".$devyat_v."',

devyatn_p = '".$devyatn_p."',

devyatn_t = '".$devyatn_t."',

devyatnadc_v = '".$devyatnadc_v."',

dvadc_chetv_p = '".$dvadc_chetv_p."',

dvadc_devyat_p = '".$dvadc_devyat_p."',

dvadc_p = '".$dvadc_p."',

dvadc_perv_p = '".$dvadc_perv_p."',

dvadc_pyat_p = '".$dvadc_pyat_p."',

dvadc_sedm_p = '".$dvadc_sedm_p."',

dvadc_shest_p = '".$dvadc_shest_p."',

dvadc_t = '".$dvadc_t."',

dvadc_tret_p = '".$dvadc_tret_p."',

dvadc_vosm_p = '".$dvadc_vosm_p."',

dvadc_vtor_p = '".$dvadc_vtor_p."',

dvadca_shest_t = '".$dvadca_shest_t."',

dvadcat_chetv_t = '".$dvadcat_chetv_t."',

dvadcat_chetv_v = '".$dvadcat_chetv_v."',

dvadcat_devyat_t = '".$dvadcat_devyat_t."',

dvadcat_devyat_v = '".$dvadcat_devyat_v."',

dvadcat_perv_t = '".$dvadcat_perv_t."',

dvadcat_perv_v = '".$dvadcat_perv_v."',

dvadcat_pyat_t = '".$dvadcat_pyat_t."',

dvadcat_pyat_v = '".$dvadcat_pyat_v."',

dvadcat_sedm_t = '".$dvadcat_sedm_t."',

dvadcat_sedm_v = '".$dvadcat_sedm_v."',

dvadcat_shest_v = '".$dvadcat_shest_v."',

dvadcat_tret_t = '".$dvadcat_tret_t."',

dvadcat_tret_v = '".$dvadcat_tret_v."',

dvadcat_v = '".$dvadcat_v."',

dvadcat_vosm_t = '".$dvadcat_vosm_t."',

dvadcat_vosm_v = '".$dvadcat_vosm_v."',

dvadcat_vtor_t = '".$dvadcat_vtor_t."',

dvadcat_vtor_v = '".$dvadcat_vtor_v."',

dvenadc_p = '".$dvenadc_p."',

dvenadc_t = '".$dvenadc_t."',

dvenadcat_v = '".$dvenadcat_v."',

odinadc_p = '".$odinadc_p."',

odinadc_t = '".$odinadc_t."',

odinadc_v = '".$odinadc_v."',

per_t = '".$per_t."',

perv_p = '".$perv_p."',

perv_v = '".$perv_v."',

pyat_p = '".$pyat_p."',

pyat_t = '".$pyat_t."',

pyat_v = '".$pyat_v."',

pyatn_p = '".$pyatn_p."',

pyatn_t = '".$pyatn_t."',

pyatnadc_v = '".$pyatnadc_v."',

sedm_p = '".$sedm_p."',

sedm_t = '".$sedm_t."',

sedm_v = '".$sedm_v."',

semn_p = '".$semn_p."',

semn_t = '".$semn_t."',

semnadc_v = '".$semnadc_v."',

shest_p = '".$shest_p."',

shest_t = '".$shest_t."',

shest_v = '".$shest_v."',

shestn_p = '".$shestn_p."',

shestn_t = '".$shestn_t."',

shestnadc_v = '".$shestnadc_v."',

tredcat_perv_p = '".$tredcat_perv_p."',

tredcatoe_p = '".$tredcatoe_p."',

trenadc_p = '".$trenadc_p."',

trenadcat_v = '".$trenadcat_v."',

tret_p = '".$tret_p."',

tret_t= '".$tret_t."',

tret_v = '".$tret_v."',

tridc_per_t = '".$tridc_per_t."',

tridcatoe_t = '".$tridcatoe_t."',

tridcatoe_v = '".$tridcatoe_v."',

trinadc_t = '".$trinadc_t."',

vosemn_p = '".$vosemn_p."',

vosemn_t = '".$vosemn_t."',

vosemnadc_v = '".$vosemnadc_v."',

vosm_p = '".$vosm_p."',

vosm_t = '".$vosm_t."',

vosm_v = '".$vosm_v."',

vtor_p = '".$vtor_p."',

vtor_t= '".$vtor_t."',

vtor_v = '".$vtor_v."'

where

id_provodnika='".$id."'

;")

or die(mysql_error());

break;

}

Додаток Е

Програмна реалізація зовнішньго вигляду таблиць

Лістинг «polzovateli.php»

<div id="polzovateli_table">

<table id="polzovateli_list"></table>

<div id="polzovateli_page"></div>

</div>

<script type="text/javascript">

$(document).ready(function(){

jQuery("#polzovateli_list").jqGrid({

url:'bd_polzovateli.php',

datatype: "json",

colNames:['Таб №', 'ФІО','Права','Логін'],

colModel:[

{name:'tabnomer',index:'tabnomer',align:"center", width:130,editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'FIO',index:'FIO', align:"center",width:180,editable:true,editoptions:{size:45},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'doljnost',index:'doljnost',align:"center", width:130,editable:true,edittype:"select",editoptions:{value:"Адмін:Адмін;Старший нарядчик:Старший нарядчик;Нарядчик зміни:Нарядчик зміни;Провідник:Провідник;Начальник поїзда:Начальник поїзда"},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'login',index:'login', align:"center",width:170,editable:false,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}},

rowNum:10,

rowList:[10,20,30],

pager: '#polzovateli_page',

viewrecords: true,

sortorder: "desc",

caption:"Користувачі",

rownumbers: true,

editurl:"edit_polzovateli.php",

height:460,

width:875

});

jQuery("#polzovateli_list").jqGrid('navGrid','#polzovateli_page',{},

{height:225,width:500,reloadAfterSubmit:false,closeAfterEdit:true},

{height:225,width:500,reloadAfterSubmit:false,closeAfterAdd:true},

{reloadAfterSubmit:false},

{closeAfterSearch:true}

);

});

</script>

Лістинг «brig_marsh_list.php»

<div id="brig_table">

<table id="brig_list"></table>

<div id="brig_page"></div>

</div>

<script type="text/javascript">

$(document).ready(function(){

var napryamok=$.ajax({

type:'POST',

async: false,

url:'vibor_s_bazi.php',

data:{baza:"Napryamok",fild:"napryamok"}

}).responseText;

jQuery("#brig_list").jqGrid({

url:'bd_brig_list.php',

datatype: "json",

colNames:['Номер бригади', 'Начальник потягу','Потяг','Напрям','Явка','Уход'],

colModel:[

{name:'nomer_brigady',index:'nomer_brigady',align:"center", width:130,editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'nachalnik_potyaga',index:'nachalnik_potyaga', align:"center",width:180,editable:true,editoptions:{size:45},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'potyag',index:'potyag',align:"center", width:55,editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'napryam',index:'napryam', align:"center",width:170,editable:true,edittype:"select",editoptions:{value:napryamok},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'yavka',index:'yavka', align:"center",width:170,editable:true,edittype:"text",editoptions:{dataInit:function(el){$(el).datetimepicker({dateFormat:'yy-mm-dd'});}},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'uhod',index:'uhod',align:"center",width:170,editable:true,edittype:"text",editoptions:{dataInit:function(el){$(el).datetimepicker({dateFormat:'yy-mm-dd'});}},searchoptions:{sopt:['eq','ne','bw','cn']}},

rowNum:10,

rowList:[10,20,30],

pager: '#brig_page',

viewrecords: true,

sortorder: "desc",

rownumbers: true,

editurl:"edit_brig_list.php",

height:460,

width:875

});

jQuery("#brig_list").jqGrid('navGrid','#brig_page',{},

{height:300,width:600,reloadAfterSubmit:false,closeAfterEdit:true},{height:300,width:600,reloadAfterSubmit:false,closeAfterAdd:true},{reloadAfterSubmit:false},

{closeAfterSearch:true}

);

});

</script>

Лістинг «brigadi.php»

<div id="tabs_brigada">

<ul>

<li><a href="#tabs_brigada-1">Бригади</a></li>

</ul>

<div id="tabs_brigada-1">

<?php

include $_SERVER['DOCUMENT_ROOT'].'/php/brig_list.php';

?>

</div>

</div>

<script type="text/javascript">

$(document).ready(function(){

$("#tabs_brigada").tabs();

});

</script>

Лістинг «grafiki.php»

<div id="tabs1">

<ul>

<li><a href="#tabs1-1">Стан робіт</a></li>

<li><a href="#tabs1-2">Добовий розрахунок робочого часу поїздним бригадам</a></li>

</ul>

<div id="tabs1-1">

<?php

include $_SERVER['DOCUMENT_ROOT'].'/php/stan_robit.php';

?>

</div>

<div id="tabs1-2">

<?php

include $_SERVER['DOCUMENT_ROOT'].'/php/kalendar.php';

?>

</div>

</div>

<script type="text/javascript">

$(document).ready(function(){

$("#tabs1").tabs();

});

</script>

Лістинг «ind_list.php»

<div id="ind_table">

<table id="ind_list"></table>

<div id="ind_page"></div>

</div>

<script type="text/javascript">

$(document).ready(function(){

var napryamok=$.ajax({

type:'POST',

async: false,

url:'vibor_s_bazi.php',

data:{baza:"Napryamok",fild:"napryamok"}

}).responseText;

var norma=$.ajax({

type:'POST',

async: false,

url:'vibor_s_bazi.php',

data:{baza:"Norma",fild:"norma"}

}).responseText;

jQuery("#ind_list").jqGrid({

<?php

if($doljnost==$providnik)

echo "url:'bd_ind_list.php?fio=".$FIO."'";

if($doljnost==$vse_prava)

echo "url:'bd_ind_list.php'";?>,

colNames:[<?php if($doljnost==$vse_prava)echo "'ПІБ',";?> 'Явка','Потяг','Напрям','Уход','№ вагона','Норма','Хвостовий'],

colModel:[

<?php if($doljnost==$vse_prava)echo "{name:'FIO',index:'FIO',align:'center',width:180,editable:true,editoptions:{size:40},searchoptions:{sopt:['eq','ne','bw','cn']}},";?>

{name:'yavka',index:'yavka', align:"center",width:180,editable:true,editoptions:{dataInit:function(el){$(el).datetimepicker({dateFormat:'yy-mm-dd'});}},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'Potyag',index:'Potyag', align:"center",width:170,editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'Napryamok',index:'Napryamok', align:"center",width:170,editable:true,edittype:"select",editoptions:{value:napryamok},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'Uhod',index:'Uhod',align:"center",width:170,editable:true,edittype:"text",editoptions:{dataInit:function(el){$(el).datetimepicker({dateFormat:'yy-mm-dd'});}},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'nomer_vagona',index:'nomer_vagona',align:"center",width:170,editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'Norma',index:'Norma',align:"center",width:120,editable:true,edittype:"select",editoptions:{value:norma},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'Hvostovyi',index:'Hvostovyi',align:"center",width:170,editable:true,edittype:"select",editoptions:{value:"Так:Так;Ні:Ні"},searchoptions:{sopt:['eq','ne','bw','cn']}},

rowNum:10,

rowList:[10,20,30],

pager: '#ind_page',

viewrecords: true,

sortorder: "desc",

rownumbers: true,

shrinkToFit:false,

editurl:"edit_ind_list.php",

height:460,

width:875

});

jQuery("#ind_list").jqGrid('navGrid','#ind_page',

<?php

if($doljnost==$providnik)

echo '{search:true,edit:false,add:false,del:false});';

if($doljnost==$vse_prava)

echo'{},

{height:400,width:500,reloadAfterSubmit:false,closeAfterEdit:true},

{height:400,width:500,reloadAfterSubmit:false,closeAfterAdd:true},

{reloadAfterSubmit:false},

{closeAfterSearch:true}

);';?>

});

</script>

Лістинг «kalendar.php»

<div id="kalendar_table">

<table id="kalendar_list"></table>

<div id="kalendar_page"></div>

</div>

<script type="text/javascript">

$(document).ready(function(){

var norma=$.ajax({

type:'POST',

async: false,

url:'vibor_s_bazi.php',

data:{baza:"Norma",fild:"norma"}

}).responseText;

var napryamok=$.ajax({

type:'POST',

async: false,

url:'vibor_s_bazi.php',

data:{baza:"Napryamok",fild:"napryamok"}

}).responseText;

jQuery("#kalendar_list").jqGrid({

url:'bd_kalendar_list.php',

datatype: "json",

colNames:['ПІБ', 'Номер потягу','Напрям','Стартова поїздка','Явка','Уход','Норма','1 доба','2 доба','3 доба','4 доба','5 доба','6 доба','7 доба','Всьго'],

{name:'FIO',index:'FIO',align:"center", width:180,editable:true,editoptions:{size:45},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'nomer_potyaga',index:'nomer_potyaga', align:"center",width:170,editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'Napryamok',index:'Napryamok',align:"center",width:170,editable:true,edittype:"select",editoptions:{value:napryamok},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'Start_poezdka',index:'Start_poezdka', align:"center",width:130,editable:true,edittype:"text",editoptions:{dataInit:function(el){$(el).datetimepicker({dateFormat:'yy-mm-dd'});}},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'Yavka',index:'Yavka', align:"center",width:130,editable:true,edittype:"text",editoptions:{dataInit:function(el){$(el).datetimepicker({dateFormat:'yy-mm-dd'});}},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'Uhod',index:'Uhod', align:"center",width:130,editable:true,edittype:"text",editoptions:{dataInit:function(el){$(el).datetimepicker({dateFormat:'yy-mm-dd'});}},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'Norma',index:'Norma', align:"center",width:120,editable:true,edittype:"select",editoptions:{value:norma},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'p_doba',index:'p_doba', align:"center",width:130,editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'v_doba',index:'v_doba', align:"center",width:130,editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'t_doba',index:'t_doba', align:"center",width:130,editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'ch_doba',index:'ch_doba', align:"center",width:130,editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'pya_doba',index:'pya_doba', align:"center",width:130,editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'sh_doba',index:'sh_doba', align:"center",width:130,editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'s_doba',index:'s_doba', align:"center",width:130,editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}},

{name:'Vsogo',index:'Vsogo', align:"center",width:130,editable:false,searchoptions:{sopt:['eq','ne','bw','cn']}}

rowNum:10,

rowList:[10,20,30],

pager: '#kalendar_page',

viewrecords: true,

rownumbers: true,

sortorder: "desc",

shrinkToFit:false,

editurl:"edit_kalendar_list.php",

height:460,

width:875

});

jQuery("#kalendar_list").jqGrid('navGrid','#kalendar_page',{},

{height:600,width:600,reloadAfterSubmit:false,closeAfterEdit:true},{height:600,width:600,reloadAfterSubmit:false,closeAfterAdd:true},

{reloadAfterSubmit:false},

{closeAfterSearch:true}

);

});

</script>

Лістинг «marshrut_list.php»

<div id="tabs">

<ul>

<?php if($doljnost==$vse_prava)

echo '<li><a href="#tabs-1">Бригадні маршрутні листи</a></li>';?>

<li><a href="#tabs-2">Індивідуальний маршрутний лист</a></li>

</ul>

<?php

if($doljnost==$vse_prava)

{

echo '<div id="tabs-1">';

include $_SERVER['DOCUMENT_ROOT'].'/php/brig_marsh_list.php';

echo '</div>';

}

?>

<div id="tabs-2">

<?php

include $_SERVER['DOCUMENT_ROOT'].'/php/ind_list.php';

?>

</div>

</div>

<script type="text/javascript">

$(document).ready(function(){

$("#tabs").tabs();

});

</script>

Лістинг «napryam.php»

<table id="napryam_list"></table>

<div id="napryam_pager"></div>

<script type="text/javascript">

$(document).ready(function(){

jQuery("#napryam_list").jqGrid({

url:'bd_napryamok.php',

datatype: "json",

colNames:['Напрям'],

colModel:[

{name:'napryamok',index:'napryamok', width:160,align:"center",editable:true,editoptions:{size:35},searchoptions:{sopt:['eq','ne','bw','cn']}},

rowNum:10,

rowList:[10,20,30],

pager:'#napryam_pager',

viewrecords: true,

caption:"Напрями",

editurl:"edit_napryamok.php",

height:200,

width:300

});

jQuery("#napryam_list").jqGrid('navGrid','#napryam_pager',{},

{height:120,width:400,reloadAfterSubmit:false,closeAfterEdit:true},{height:120,width:400,reloadAfterSubmit:false,closeAfterAdd:true}, // add options

{reloadAfterSubmit:false},

{closeAfterSearch:true}

);

});

</script>

Лістинг «norma.php»

<table id="norma_list"></table>

<div id="norma_pager"></div>

<script type="text/javascript">

$(document).ready(function(){

$("#norma_list").jqGrid({

url:'bd_norma.php',

datatype: "json",

colNames:['Норма'],

colModel:[

{name:'norma',index:'norma', width:160,align:"center",editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}}

rowNum:10,

rowList:[10,20,30],

pager:'#norma_pager',

viewrecords: true,

caption:"Норма",

editurl:"edit_norma.php",

height:200,

width:300

});

$("#norma_list").jqGrid('navGrid','#norma_pager',{},

{height:120,reloadAfterSubmit:false,closeAfterEdit:true},

{height:120,reloadAfterSubmit:false,closeAfterAdd:true},

{reloadAfterSubmit:false},

{closeAfterSearch:true}

);

});

</script>

Додаток Ж

Програмна реалізація прогнозування табеля

Лістинг «tab_list_provodnik.php»

<?php

$fio_provodnika=$FIO;

include $_SERVER['DOCUMENT_ROOT'].'/php/bd_config.php';

if($doljnost==$vse_prava)

{

$vibraniy_provodnik=$_POST['vibraniy_provodnik'];

$fio_provodnika=$vibraniy_provodnik;

}

$query = "SELECT start_poezdka,id_provodnika FROM `tabel` WHERE PIB='".$fio_provodnika."'";

$result=mysql_query($query) or die (mysql_error());

if (mysql_num_rows($result) == 1)

{

$row=mysql_fetch_array($result);

$id=$row[id_provodnika];

$start_poezdka = substr($row[start_poezdka],0,10);

$date=explode('-',($start_poezdka));

$k=$date[1]+3;

$end_date=date("Y-m-d", mktime(0, 0, 0, $k,$date[2],$date[0]));

$date_array = array();

$i=$date[2];

$j=0;

$next_date=$start_poezdka;

while($next_date!=$end_date)

{

$next_date = date("Y-m-d", mktime(0, 0, 0, $date[1],$i,$date[0]));

$date_array[$j]=$next_date;

$i++;

$j++;

}

$param_array=array(

"perv_p","vtor_p","tret_p","chet_p","pyat_p",

"shest_p","sedm_p", "vosm_p", "devyat_p",

"desyat_p","odinadc_p","dvenadc_p",

"trenadc_p","chetyrn_p","pyatn_p", "shestn_p",

"semn_p", "vosemn_p","devyatn_p","dvadc_p",

"dvadc_perv_p","dvadc_vtor_p","dvadc_tret_p",

"dvadc_chetv_p","dvadc_pyat_p", "dvadc_shest_p",

"dvadc_sedm_p", "dvadc_vosm_p", "dvadc_devyat_p",

"tredcatoe_p", "tredcat_perv_p", "perv_v",

"vtor_v","tret_v","chet_v","pyat_v","shest_v",

"sedm_v","vosm_v","devyat_v","desyat_v",

"odinadc_v",dvenadcat_v","trenadcat_v",

"chetyrn_v","pyatnadc_v","shestnadc_v",

"semnadc_v","vosemnadc_v","devyatnadc_v",

"dvadcat_v","dvadcat_perv_v","dvadcat_vtor_v",

"dvadcat_tret_v","dvadcat_chetv_v",

"dvadcat_pyat_v","dvadcat_shest_v",

"dvadcat_sedm_v","dvadcat_vosm_v",

"dvadcat_devyat_v","tridcatoe_v","per_t",

"vtor_t", "tret_t","chet_t","pyat_t","shest_t",

"sedm_t","vosm_t","devyat_t","desyat_t",

"odinadc_t","dvenadc_t","trinadc_t","chetyrn_t",

"pyatn_t", "shestn_t","semn_t",

"vosemn_t","devyatn_t","dvadc_t","dvadcat_perv_t",

"dvadcat_vtor_t","dvadcat_tret_t",

"dvadcat_chetv_t","dvadcat_pyat_t",

"dvadca_shest_t", "dvadcat_sedm_t",

"dvadcat_vosm_t","dvadcat_devyat_t",

"tridcatoe_t","tridc_per_t");

echo '<div id="tabel_table">

<table id="tabel_list"></table>

<div id="tabel_page"></div>

</div>';

echo '<script type="text/javascript">'.

"$(document).ready(function(){

$(".'"#tabel_list").jqGrid({'.

"url:'bd_tab_list_provodnik.php?fio=".$fio_provodnika."',

datatype: 'json',

colNames:['Напрям','Норма',";

for($i=0;$i<count($date_array)-1;$i++)

{

if($i>0)

echo ",";

echo "'".$date_array[$i]."'";

echo "],";

echo "colModel:[";

echo "{name:'Napryam',index:'Napryam', align:'center',width:170,searchoptions:{sopt:['eq','ne','bw','cn']}},{name:'Norma',index:'Norma',align:'center',width:170,searchoptions:{sopt:['eq','ne','bw','cn']}},\n";

for($i=0;$i<count($date_array)-1;$i++)

if($i>0)

echo ",\n";

echo "{name:'".$param_array[$i]."',index:'".$param_array[$i]."',align:'center',width:100,editable:true,editoptions:{size:10},searchoptions:{sopt:['eq','ne','bw','cn']}}";

}

echo "],\n";

echo "

rowNum:10,

rowList:[10,20,30],

pager: '#tabel_page',

viewrecords: true,

rownumbers: true,

sortorder: 'desc',

shrinkToFit:false,";

if($doljnost==$vse_prava)

{

echo "caption:'Табель провідника : ".$fio_provodnika."',";

echo "editurl:'edit_tabel_provodnika.php',";

}

echo "height:460,

width:875

});";

if($doljnost==$vse_prava)

echo "$(".'"#tabel_list").jqGrid'."('navGrid','#tabel_page',{search:false,add:false,del:false},

{height:300,dataheight:200,reloadAfterSubmit:false,closeAfterEdit:true},

{reloadAfterSubmit:false});";

else

echo "$(".'"#tabel_list").jqGrid'."('navGrid','#tabel_page',{search:false,edit:false,add:false,del:false});";


Подобные документы

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.