Дипломная работа: Автоматизация процесса управления взаимоотношениями с клиентами в компании "Фаворит"

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
Приложение 6
Обработка входящего звонка от существующего клиента
103
Приложение 7
Текст программы
В приложении содержатся исходные тексты на языке PHP нескольких
модулей системы.
В разделе «Модуль контрагентов» представлен текст программы для двух
форм системы: «Список контрагентов» и «Форма редактирования контрагента
«Информация»».
Раздел «Модуль рассылки писем» содержит в себе исходный код двух форм
из этого модуля: «Форма редактирования рассылки» и «Форма выбора адресатов»
1. Модуль контрагентов
1.1 Форма списка контрагентов
<?php
/*************************************************************
***************
Description: форма списка контрагентов
Author: Potapenko Vladimir
Version: 1.0.0
Changes info:
+ 22.03.2013(Potapenko Vladimir):создан
*************************************************************
************** */
class OFormDLV_clients extends OFormGRepeaterListView implements
IActionListener
{
protected $SearchSelectQueryAlias;
protected $ParamSearchSelectQueryAlias;
protected $ParamSelectQueryAlias;
protected $SelectedParamId;
public function __construct($Name, $Parent)
{
parent::__construct($Name, $Parent/*, ProjectPath().
"forms/clients/DataList_clients.htm"*/);
$this-
>CreateFromXML(ProjectPath().'forms/clients/LayoutOFormDLV_clients.xml');
$this->Title="Контрагенты";
$this->DataAlias="table_clients";
$this->SelectQueryAlias="Select_All_table_clients";
$this->SearchSelectQueryAlias="SearchSelect_All_table_clients";
$this-
>ParamSearchSelectQueryAlias="ParamSearchSelect_All_table_clients";
$this->ParamSelectQueryAlias="ParamSelect_All_table_clients";
$this->DeleteQueryAlias="Delete_table_clients";
104
$this->SelectedParamId=-1;
$this->EditSearch->javascript_OnKeyPress="if(event.keyCode==13) ".
$this->ButtonSearch->FullName().".onclick();";
$this->FillTreeAttributes();
$this->ViewFormAlias="FormView_clients";
}
protected function FillTreeAttributes()
{
$this->TreeAttributes->Clear();
$parent_node=new ONode("Все", $this->TreeAttributes, -1,
"/images/icons/receipts.png");
$this->TreeAttributes->AddNode($parent_node, "");
$this->TreeAttributes->Value=0;
$query="SELECT * FROM table_client_params ORDER BY NAME";
$ds=new ODBDataSet("", $this, GetConnection("MainDBConnection"));
$ds->Open($query);
for($i=0; $i<$ds->RowCount; $i++)
{
$ds->SetRow($i);
$node=new ONode($ds->GetFieldValue("NAME"), $this->TreeAttributes,
$ds->GetFieldValue("ID"), "/images/icons/receipt.png");
$this->TreeAttributes->AddNode($node, $parent_node);
}
AddToChangedComponents($this->TreeAttributes);
}
protected function GetDataListQuery($_search_text="")
{
$result="";
if($_search_text=="")
{
$result=WorkSpaceQueryCollection($this->SelectedParamId==-1?$this-
>SelectQueryAlias:
$this->ParamSelectQueryAlias, array("ID_PARAM"=>$this-
>SelectedParamId));
}
else
{
$result=WorkSpaceQueryCollection($this->SelectedParamId==-1?
$this->SearchSelectQueryAlias:$this->ParamSearchSelectQueryAlias,
array("SEARCH_TEXT"=>$_search_text, "ID_PARAM"=>$this-
>SelectedParamId));
}
return $result;
}
protected function ButtonSearch_OnClick($_sender, $_event,
$_event_args=null)
{
$this->FillDataList($this->EditSearch->Value);
105
}
protected function TreeAttributes_OnNodeClick($_sender, $_event,
$_event_args=null)
{
$node=$this->TreeAttributes->AllNodes[$this->TreeAttributes->Value];
if(!is_null($node))
{
$this->EditSearch->Value="";
$this->SelectedParamId=$node->Object;
$this->FillDataList();
}
}
protected function CustomEvent($_event_name)
{
$result=parent::CustomEvent($_event_name);
switch($_event_name)
{
case "on_new_task_click":
$result="Event_on_new_task_click";
break;
case "on_to_history_click":
$result="Event_on_to_history_click";
break;
}
return $result;
}
protected function Event_on_to_history_click($_sender, $_event,
$_event_args=null)
{
$ItemID=$this->GetSelectedItemID($_event_args);
if($ItemID!=-1)
{
$f=new OFormView_client_history("FormView_client_history",
$_SESSION["WorkSpace"]->MainForm, $ItemID);
$f->SetCenterPosition();
$f->Work();
}
}
protected function Event_on_new_task_click($_sender, $_event,
$_event_args=null)
{
$ItemID=$this->GetSelectedItemID($_event_args);
if($ItemID!=-1)
{
$this->SendGlobalEvent("CreateNewPlan", $ItemID);
}
}
public function ActionPerform($_event_name, $_event_argument)
106
{
if($_event_name==="database_data_changed"&&$_event_argument===$th
is->DataAlias)
{
$this->FillDataList($this->EditSearch->Value);
}
if($_event_name==="NewAttributeAdded")
{
$current_selected=-1;
$node=$this->TreeAttributes->AllNodes[$this->TreeAttributes->Value];
if(!is_null($node))
{
$current_selected=$node->Object;
}
$this->FillTreeAttributes();
for($i=0; $i<count($this->TreeAttributes->AllNodes); $i++)
{
$node=$this->TreeAttributes->AllNodes[$i];
if($node->Object==$current_selected)
{
$this->TreeAttributes->Value=$i;
break;
}
}
}
}
}
?>
1.2 Форма редактирования контрагентов – «Информация»
<?php
/*************************************************************
***************
Description: форма редактирования контрагентов «Информация»
Author: Potapenko Vladimir
Version: 1.0.0
Changes info:
+ 23.03.2013(Potapenko Vladimir):создан
*************************************************************
***************/
class OFormView_clients extends OFormViewRecord implements
IActionListener
{
protected $SubTablesKeyId;
protected $Attributes;
public function __construct($Name, $Parent)
{
parent::__construct($Name, $Parent);
$this-
Источник: https://baza.diplomsite.ru/previewfile/2143