Диплом: Автоматизация сервисного обслуживания клиентов Rollbery

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
<input type="submit" id="entt" class="btn btn-
primary" style="border:none;" value="Отчет" style="cursor:pointer;">
</div>
</form>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-1">
</div>
<div id="main" class="col-md-10">
<?if (isset($text)):?>
<?php
$n=1;
//echo '<div id="prod">';?>
<h5>
Мои заказы
</h5>
<div class="container-fluid">
<div class="row">
<div class="col-md-1" style="text-
align:center;">
<div class="form-control text5"
style="border:none;color:black;">
</div>
</div>
<div class="col-md-3" style="text-
align:center;">
<div class="form-control text5"
style="border:none;color:black;">
<? if
((int)$_GET['id_kl']==0) echo 'ФИО КЛИЕНТА';
else if
((int)$_GET['id_kl']!=0) echo 'МЕНЕДЖЕР';
?>
</div>
</div>
<div class="col-md-2" style="text-
align:center;">
<div class="form-control text5"
style="border:none;color:black;">
СТАТУС
</div>
</div>
<div class="col-md-2" style="text-
align:center;">
<div class="form-control text5"
style="border:none;color:black;">
ДАТА
</div>
</div>
<div class="col-md-2" style="text-
align:center;">
<div class="form-control text5"
style="border:none;color:black;">
СУММА
</div>
</div>
</div>
</div>
<? $i=1; foreach($text as $item):?>
<form action="index.php" method="get">
<div class="container-fluid">
<div class="row">
<div class="col-md-1" style="text-
align:center;">
<div class="form-control
text5">
<?=$item["nom"];?>
</div>
</div>
<div class="col-md-3" style="text-
align:left;">
<div class="form-control
text5">
<?=$item["name"];?>
</div>
</div>
<div class="col-md-2" style="text-
align:left;">
<? if
((int)$_GET['id_kl']!=0):?>
<div class="form-control
text5">
<?=$item["status"];?>
</div>
<?elseif
((int)$_GET['id_kl']==0):?>
<select class="form-control
text5" name="status">
<option
selected><?=$item["status"];?></option>
<option
value="отгружен">отгружен</option>
<option
value="завершен">завершен</option>
<option
value="принят">принят</option>
</select>
<?endif;?>
</div>
md-2" style="text-
align:center;">
<div class="form-control
text5">
<?=$item["data"];?>
</div>
</div>
<div class="col-md-2" style="text-
align:center;">
<div class="form-control
text5">
</div>
</div>
<?if ((int)$_GET['id_kl']==0):?>
<div class="col-md-1" style="text-
align:center;">
<input type="hidden" name="option"
value="Order">
<input type="hidden"
name="id_them" value="<?=$_GET['id_them'];?>">
<input type="hidden" name="id_kl"
value="<?=$_GET['id_kl'];?>">
<input type="hidden" name="id_man"
value="<?=$_GET['id_man'];?>">
<input type="hidden" name="us"
value="<?=$_GET['us'];?>">
value="1">
<input type="hidden" name="id_ord"
value="<?=$item['id_ord'];?>">
<input type="submit"
style="border:none;background-color:white;cursor:pointer;"
value="Ok" onclick="">
</div>
<?endif;?>
</form>
<div class="col-md-1" style="text-
align:center;">
<form action="index.php" method="get"
id="ff11<?=$i;?>">
<input type="hidden" name="option"
value="Order1">
<input type="hidden"
name="id_them" value="<?=$_GET['id_them'];?>">
<input type="hidden" name="id_kl"
value="<?=$_GET['id_kl'];?>">
<input type="hidden" name="id_man"
value="<?=$_GET['id_man'];?>">
<input type="hidden" name="us"
value="<?=$_GET['us'];?>">
<input type="hidden" name="id_kind"
value="<?=$item['id_kind'];?>">
<input type="hidden" name="id_typ"
value="<?=$_GET['id_typ'];?>">
<input type="hidden" name="nom"
value="<?=$item['nom'];?>">
<input type="submit"
style="border:none;background-color:white;cursor:pointer;"
value="Открыть" onclick="">
</form>
</div>
</div>
</div>
<? $i++; endforeach;?>
<br>
<?endif;?>
</div>
<div class="col-md-1">
</div>
</div>
</div>
<?include 'footer.php';?>
</body>
</html>
Индексный файл
<?php
include 'config.php';
//include 'create_db.php';
function __autoload($file)
{
if (file_exists('controllers/'.$file.'.php'))
{
require_once 'controllers/'.$file.'.php';
}
else
{
require_once 'models/'.$file.'.php';
}
}
if (isset($_GET['option']))
{
$class=strip_tags($_GET['option']);
switch($class)
{
case 'Main':
$init=new Main();
break;
case 'Article':
$init=new Article();
break;
case 'Backet':
$init=new Backet();
break;
case 'Type':
$init=new Type();
break;
case 'Kind':
$init=new Kind();
break;
case 'Equip':
$init=new Equip();
break;
case 'Update':
$init=new Update();
break;
case 'Order':
$init=new Order();
break;
case 'Order1':
$init=new Order1();
break;
case 'User':
$init=new User();
break;
default:
$init=new User();
}
}
else
{
$init=new User();
}
echo $init->get_body();
?>
Файл созжания отчета в формате pdf
<?php
include 'config.php';
$link = mysql_connect(HOST, USER, PASS,CODE);
if (! $link)
{
echo "Heльзя соединиться с сервером базы данных...";
exit();
}
mysql_select_db(DB, $link);
mysql_query("SET NAMES ".CODE);
$q3="SELECT id_ord, klients.id_kl as id_kl, name_kl as name_kl,nom,
name_man,products.id_eq as id_eq,name_eq,description,price,status, data,
orders.count,address,klients.phone_kl as phone,types.id_typ FROM
orders,klients,products,managers,types WHERE klients.id_kl=orders.id_kl and
products.id_eq=orders.id_eq and managers.id_man=orders.id_man and
types.id_typ=products.id_typ and nom=".$_GET['nom'].";";
$result = mysql_query($q3, $link);
$i=1;
while($rows = mysql_fetch_array($result))
{
$a[$i]['id_ord']=$rows['id_ord'];
$a[$i]['id_kl']=$rows['id_kl'];
$a[$i]['name_kl']=$rows['name_kl'];
$a[$i]['nom']=$rows['nom'];
$a[$i]['name_man']=$rows['name_man'];
$a[$i]['name_eq']=$rows['name_eq'];
$a[$i]['description']=$rows['description'];
$a[$i]['price']=$rows['price'];
$a[$i]['status']=$rows['status'];
$a[$i]['data']=$rows['data'];
$a[$i]['count']=$rows['count'];
$a[$i]['address']=$rows['address'];
$a[$i]['phone']=$rows['phone'];
$a[$i]['id_typ']=$rows['id_typ'];
$a[$i]['id_eq']=$rows['id_eq'];
$i=$i+1;
}$n=$i-1;
require('tfpdf.php');
//MultiCell(float w, float h, string txt [, mixed border [, string align [, int fill]]])
$pdf = new tFPDF('L', 'mm', 'A4');
$pdf->AddPage();
$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
$pdf->SetFont('DejaVu','',14);
$pdf->Image( 'LoGo.jpg', 16, 15, 40 );
$pdf->SetTextColor( 128, 000, 000);
$pdf->Ln(6);
$pdf->Cell(0, 16, 'ООО "TWO STICKS"', 0, 0, 'C' );
$pdf->Ln(22);
//$pdf->SetTextColor( 025, 025, 112);
$pdf->Cell(0, 16, "ДОГОВОР ПО ЗАКАЗУ №", 0, 0, 'C' );
$pdf->Ln(0);
$pdf->Cell(345, 16, $a[1]['nom'], 0, 0, 'C' );
$pdf->Ln(8);
$pdf->Cell(0, 16, "СЛУЖБА ДОСТАВКИ СУШИ", 0, 0, 'C' );
$pdf->Ln(18);
$pdf->SetTextColor( 025, 025, 112);
$pdf->Cell(0, 16, "ДАТА: ", 0, 0, 'L' );
$pdf->Ln(0);
$pdf->SetTextColor( 0, 0, 0);
$pdf->Cell(70, 16, $a[1]['data'], 0, 0, 'C' );
$pdf->Ln(6);
$pdf->SetTextColor( 025, 025, 112);
$pdf->Cell(0, 16, "СТАТУС: ", 0, 0, 'L' );
$pdf->Ln(0);
$pdf->SetTextColor( 0, 0, 0);
$pdf->Cell(80, 16, $a[1]['status'], 0, 0, 'C' );
$pdf->Ln(6);
$pdf->SetTextColor( 025, 025, 112);
$pdf->Cell(0, 16, "ФИО КЛИЕНТА: ", 0, 0, 'L' );
$pdf->Ln(0);
$pdf->SetTextColor( 0, 0, 0);
$pdf->Cell(180, 16, $a[1]['name_kl'], 0, 0, 'C' );
$pdf->Ln(6);
$pdf->SetTextColor( 025, 025, 112);
$pdf->Cell(0, 16, "АДРЕС КЛИЕНТА: ", 0, 0, 'L' );
$pdf->Ln(0);
$pdf->SetTextColor( 0, 0, 0);
$pdf->Cell(130, 16, $a[1]['address'], 0, 0, 'C' );
$pdf->Ln(6);
$pdf->SetTextColor( 025, 025, 112);
$pdf->Cell(0, 16, "ФИО МЕНЕДЖЕРА: ", 0, 0, 'L' );
$pdf->Ln(0);
$pdf->SetTextColor( 0, 0, 0);
$pdf->Cell(180, 16, $a[1]['name_man'], 0, 0, 'C' );
$pdf->Ln(6);
$pdf->SetTextColor( 025, 025, 112);
$pdf->Cell(0, 16, "ТЕЛЕФОН КЛИЕНТА: ", 0, 0, 'L' );
$pdf->Ln(0);
$pdf->SetTextColor( 0, 0, 0);
$pdf->Cell(160, 16, $a[1]['phone'], 0, 0, 'C' );
$pdf->Ln(5);
//$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
//$pdf->SetFont('DejaVu','',16);
//$pdf->SetTextColor( 128, 000, 000);
$pdf->SetFont('DejaVu','',13);
$pdf->SetTextColor( 124, 123, 003 );
$pdf->Ln(6);
$pdf->Cell( 0, 8, "ПЕРЕЧЕНЬ ТОВАРОВ", 0, 0, 'C' );
$pdf->Ln( 12 );
$pdf->SetTextColor( 025, 025, 112);
$pdf->SetFont('DejaVu','',11);
$pdf->SetFillColor(135,206,250);
$pdf->Cell( 7, 8, "№", 1, 0, 'C','true' );
$pdf->Cell( 85, 8, "ТОВАР", 1, 0, 'C','true' );
$pdf->Cell( 150, 8, "Ингредиенты", 1, 0, 'C','true' );
$pdf->Cell( 10, 8, "К-О", 1, 0, 'C','true' );
$pdf->Cell( 15, 8, "ЦЕНА", 1, 2, 'C','true' );
$pdf->Ln( 2 );
$i=1;$sa=0;$o=0;
while($i<=$n)
{
$pdf->Cell( 7, 6, $i, 1, 0, 'C' );
$pdf->Cell( 85, 6, substr($a[$i]['name_eq'], 0, 70), 1, 0, 'L' );
$pdf->Cell( 150, 6, substr($a[$i]['description'], 0, 130), 1, 0, 'L' );
$pdf->Cell( 10, 6, $a[$i]['count'], 1, 0, 'C' );
$pdf->Cell( 15, 6, $a[$i]['price'], 1, 2, 'C' );
$pdf->Ln( 2 );
$sa=$sa+$a[$i]['count']*$a[$i]['price'];
$i=$i+1;
};
$pdf->SetFont('DejaVu','',16);
$pdf->Ln( 6 );
$pdf->SetTextColor( 128, 000, 000);
$pdf->Write( 6, "ИТОГО: ");
$pdf->SetTextColor( 025, 025, 112);
$pdf->Write( 6, number_format($sa,2));
$pdf->Output( "report1.pdf", "I" );
mysql_close($link);
?>

Смотрите также:

"Автоматизация обработки заявок ООО "Проектно-Строительная Компания"
"Автоматизация процесса аттестации персонала для ООО "Нэт Бай Нэт Холдинг"
"Анализ интернет-активности конкурентов ( на примере конкурентов "Газпром нефть")
"Бухгалтерский учёт и аудит расчётов с подотчётними лицами в организации на примере ООО "ЛОЦ 10""
«Психологическое сопровождение персонала в организации на примере ООО «Крокус»
Cовершенствование деловой оценки персонала в организации (на примере ООО "Даймонд кейтеринг развитие")
IPO - инструмент финансирования деятельности организации. На примере ПАО «Нефтяная компания «Лукойл»
PR как средство продвижения организации (на примере ПАО "Тамбовский завод "Комсомолец им. Н.С. Артемова")
PR-коммуникации в сфере общественного питания (на примере кафе-кондитерской «Cream Cheese»)
SMM как средство повышения эффективности работы учреждений социокультурной сферы (на примере Малого театра)