public function getCalendarResources($connection, $group) { $personnel = new Personnel(); $clients = new Clients(); $personnel_list = $personnel->find(null, $connection); $client_list = $clients->find(null, $connection); $resources = []; switch ($group) { case 'Client': foreach ($client_list as $clientRecord) { foreach ($personnel_list as $personnelRecord) { $r = []; $r["id"] = $personnelRecord["id"]; $r["clientName"] = $clientRecord["name"]; $r["title"] = $personnelRecord["name"]; $resources[] = $r; } } break; default: foreach ($personnel_list as $personnelRecord) { foreach ($client_list as $clientRecord) { $r = []; $r["id"] = $clientRecord["id"]; $r["personnelName"] = $personnelRecord["name"]; $r["title"] = $clientRecord["name"]; $resources[] = $r; } } break; } $resources = json_encode($resources); return $resources; }
function update(Clients $obj) { $dir = realpath(root . DIRECTORY_SEPARATOR . "assets" . DIRECTORY_SEPARATOR . "images" . DIRECTORY_SEPARATOR . "clients"); $file = new File($dir); $columns = array('name', 'about'); $data = array($_REQUEST['name'], $_REQUEST['about']); if (isset($_FILES['logo']['name']) && !empty($_FILES['logo']['name'])) { $unique_name = uniqid() . "." . pathinfo(basename($_FILES['logo']['name']), PATHINFO_EXTENSION); $images = $unique_name; $file->uploadFile($unique_name, $_FILES['logo']['tmp_name']); $columns[] = 'logo'; $data[] = $unique_name; } return $obj->updateClient($_REQUEST['id'], $columns, $data); }
public function getClient($id) { if (empty($id)) { return NULL; } $dept_id = Clients::model()->getScaler('client_name', '`id`=:t1', array(':t1' => $id)); return !empty($dept_id) ? $dept_id : NULL; }
public static function getClientsState($state) { if (!isset(self::$_client_states_arr)) { self::$_client_states_arr = self::getClientsStatesArray(); } if (array_key_exists($state, self::$_client_states_arr)) { return self::$_client_states_arr[$state]; } return null; }
/** * Check Auth_Code rule */ public function check_auth() { $client = Clients::model()->findByPk($this->Client_ID); if($client) { $company = Companies::model()->findByPk($client->Company_ID); if ($company->Auth_Code != $this->Auth_Code) { $this->addError('Auth_Code','Invalid Authorization Code'); } } else { $this->addError('Auth_Code',"Company with this Authorization Code doesn't exists"); } }
public function actionActivateClientState() { $field = isset($_GET['field']) ? $_GET['field'] : 'state'; $this->scenario = 'update_client_state'; $action = Yii::app()->request->getParam('value', null); $id = Yii::app()->request->getParam('id', null); $availableStates = Clients::getClientsStatesArray(); if (!array_key_exists($action, $availableStates)) { $action = 0; } if (!(!$id && $action === null)) { $model = $this->loadModel($id); if ($this->scenario) { $model->scenario = $this->scenario; } if ($model) { $model->{$field} = $action; $model->save(false); } } echo CHtml::link($availableStates[$action]); }
function Header() { $client = Clients::model()->with('company')->findByPk(Yii::app()->user->clientID); $project = Projects::model()->findByPk(Yii::app()->user->projectID); $projectId = Yii::app()->user->projectID; //Logo //$this->Image('logo_pb.png',10,8,33); //Arial bold 15 $this->SetFont('Arial','',12); $this->SetXY(5,5); //$this->Cell(20,10,$client->company->Company_Name.' - '.$project->Project_Name ,0,0,'L'); $this->SetXY(5,5); $this->SetFont('Arial','B',12); $this->Cell(0,0, Helper::shortenString($client->company->Company_Name,30).' - '.Helper::shortenString($project->Project_Name,20),0,1,'L'); $this->SetFont('Arial','',12); $this->SetXY(5,10); $this->Cell(0,0,"Export Summary:",0,1,'L'); // $this->Text(0,10,"AP Batch Summary Report: "); $this->SetFont('Arial','B',12); $this->SetXY(140,5); if($this->doc_type == 'AP') { $this->Cell(0,0,"AP Batch Summary Report:",0,1,'R'); } else { $this->Cell(0,0,"PO Batch Summary Report:",0,1,'R'); } $this->SetFont('Arial','',12); $this->SetXY(140,10); $this->Cell(0,0,"Batch ".$this->batch_id,0,1,'R'); //$this->SetXY(120,5); //$this->Cell(0,0,"AP Batch Summary Report: ",0,0,'R'); $this->Line(5,14,205,14); $this->Ln(5); }
public function appendCompany($client_id){ $client = Clients::model()->with('company.adreses')->findByPk($client_id); $company = $client->company; $xml_company = $this->xml->createElement("company"); $xml_row = $this->xml->createElement("row"); foreach ($company->attributes as $key => $value) { $xml_field = $this->xml->createElement("field",htmlentities($value,ENT_QUOTES | 'ENT_XML1')); $xml_field->setAttribute('name', $key); $xml_row->appendChild($xml_field); } $xml_company->appendChild($xml_row); $xml_adreses = $this->xml->createElement("addresses"); foreach ($company->adreses as $address) { $xml_address = $this->xml->createElement("address"); $xml_row = $this->xml->createElement("row"); foreach ($address->attributes as $key=>$value) { $xml_field = $this->xml->createElement("field",htmlentities($value,ENT_QUOTES | 'ENT_XML1')); $xml_field->setAttribute('name', $key); $xml_row->appendChild($xml_field); } $xml_address->appendChild($xml_row); } $xml_adreses->appendChild($xml_address); $xml_company->appendChild($xml_adreses); $this->wrapper->appendChild($xml_company); }
<div class="row"> <?php echo $form->labelEx($model, 'name'); ?> <?php echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 255)); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'client_id'); ?> <?php echo $form->dropDownList($model, 'client_id', CHtml::listData(Clients::model()->findAll(), 'id', 'name')); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'status'); ?> <?php echo $form->dropDownList($model, 'status', Orders::model()->itemAlias('status')); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'date');
function getClientname($vid) { return Clients::model()->findByPk($vid)->FirstName; }
/** * Find ARs to entry data */ public static function findARsToEntry() { $queryString = $_SESSION['last_ar_to_entry_search']['query']; $options = $_SESSION['last_ar_to_entry_search']['options']; $condition = new CDbCriteria(); $condition->join = "LEFT JOIN documents ON documents.Document_ID=t.Document_ID"; $condition->condition = "t.Invoice_Number = '0'"; $countCond = 0; if (count($options) > 0 && trim($queryString) != '') { $search_condition = new CDbCriteria(); if ($options['search_option_com_name']) { $search_condition->compare('t.Company_Name', $queryString, true, 'OR'); $countCond++; } if ($options['search_option_inv_num']) { $search_condition->compare('t.Invoice_Number', $queryString, true, 'OR'); $countCond++; } if ($options['search_option_inv_date']) { $search_condition->compare('t.Invoice_Date', $queryString, true, 'OR'); $countCond++; } if ($options['search_option_inv_amount']) { $search_condition->compare('t.Invoice_Amount', $queryString, true, 'OR'); $countCond++; } if ($options['search_option_descr']) { $search_condition->compare('t.Description', $queryString, true, 'OR'); $countCond++; } if ($options['search_option_terms']) { $search_condition->compare('t.Terms', $queryString, true, 'OR'); $countCond++; } } if (Yii::app()->user->userType == UsersClientList::PROCESSOR || Yii::app()->user->userType == UsersClientList::APPROVER || Yii::app()->user->userType == UsersClientList::CLIENT_ADMIN) { $condition->addCondition("documents.Client_ID='" . Yii::app()->user->clientID . "'"); } if (Yii::app()->user->userType == UsersClientList::PROCESSOR || ((Yii::app()->user->userType == UsersClientList::APPROVER || Yii::app()->user->userType == UsersClientList::CLIENT_ADMIN) && is_numeric(Yii::app()->user->projectID))) { $condition->addCondition("documents.Project_ID='" . Yii::app()->user->projectID . "'"); } if (Yii::app()->user->userType == UsersClientList::USER && is_numeric(Yii::app()->user->projectID)) { $condition->addCondition("documents.Project_ID='" . Yii::app()->user->projectID . "'"); $condition->addCondition("documents.User_ID='" . Yii::app()->user->userID . "'"); } if (Yii::app()->user->userType == Users::DATA_ENTRY_CLERK) { //adding condition to allow DEC see only documents of clients that he has access $cli_array = Clients::getClientsIDList(Yii::app()->user->userID); $condition->addInCondition('documents.Client_ID', $cli_array); } $condition->order = "documents.Created ASC"; if( $countCond > 0 ) $condition->mergeWith($search_condition); $ars = Ars::model()->findAll($condition); return $ars; }
<?php require_once '../common/config/config.inc.php'; require_once '../classes/class.client.php'; require_once '../classes/class.clients_login.php'; require_once '../classes/class.extra.php'; $objClientsLogin = new ClientsLogin(); $objClientsLogin->isValidClients(); $objClients = new Clients(); $objExtra = new Extra(); $arrClmn = array('ClientExtra1', 'ClientExtra2'); $extra = $objExtra->getExtraListing(TABLE_EXTRA_SETTINGS, $arrClmn, ''); $clientID = $_SESSION['sessClientID']; $varWhr = "AND pkClientID = '" . $_SESSION['sessClientID'] . "'"; $arrResult = $objClientsLogin->getClientsEmail($varWhr); $varExtraWhr = "1 AND pkClientID =" . $_SESSION['sessClientID']; $arrClmn = array('ClientExtra1', 'ClientExtra2'); $arrExtraRecord = $objClients->getUsersListing(TABLE_CLIENTS, $arrClmn, '', $varExtraWhr); if ($_SESSION["arrPost"] != '') { @extract($_SESSION["arrPost"]); $varAdminEmail = $frmAdminEmail; $varAdminSupportEmail = $frmSupportEmail; } if ($arrResult) { $varClientEmailAddress = $arrResult[0]['ClientEmailAddress']; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
border-bottom: 1px solid #d9d9d9; padding: 8px 11px; text-align:left; font-size: 11px; color: #222; line-height: 12px;'), 'value' => function ($data) { return '<span class="circle ' . $data->color . '">circle</span>' . $data->name; }), array('name' => 'id', 'header' => 'Количество клиентов', 'headerHtmlOptions' => array('style' => ' height: 12px; border-right: 1px solid #d9d9d9; border-bottom: 1px solid #d9d9d9; padding: 8px 11px; text-align:left; font-size: 11px; color: #222; line-height: 12px;'), 'type' => 'raw', 'value' => function ($data) { return count(Clients::model()->findAll('priority_id=' . $data->id . ' and company_id=' . Users::model()->findByPk(Yii::app()->user->id)->company_id)); })))); ?> <div class="settings-footer"> <div class="help-dropdown open"> <dl> <dt class="dt simple"><i class="icon-help">help</i>Справка</dt> <dd class="dd"> <ul> <li> <strong>Приоритет клиента</strong> определяет важность клиента для компании.<br> Изменять или удалять приоритеты на данный момент невозможно. Сейчас доступно три приоритета: важный, средний и низки. Важный приоритет - это наиболее платежеспособные клиенты, на которых необходимо обратить внимание в первую очередь. Средний приоритет - это перспективные клиенты, с которыми нужно развивать взаимоотношения. Низкий приоритет - это клиенты, у которых нет или мало интереса к товарам или услугам компании. </li> </ul>
/** * получить данные о договоре для редактора */ public function actionChangeBody() { if (Yii::app()->request->isAjaxRequest) { //printvar($_POST); $return_msg = ''; $order_id = intval($_POST['order_id']); if (!is_array($order_pos = Works::model()->worksByOrder($order_id))) { $return_msg .= 'Невозможно получить список работ'; } $data['works'] = "<ul>\n"; foreach ($order_pos as $o_p) { $data['works'] .= '<li>' . $o_p->name . ', ' . $o_p->quantity . $o_p->unit . "</li>\n"; } $data['works'] .= "</ul>\n"; // echo ($data['works']);die; $data['contract']['date'] = $_POST['date']; $data['contract']['duedate'] = $_POST['duedate']; $data['contract']['name'] = $_POST['name']; $data['contract']['num'] = $_POST['num']; $data['contract']['sum'] = $_POST['sum']; // echo json_encode(CVarDumper::dump($data));die;//Yii::app()->end; if (!is_array($data['client'] = Clients::model()->clientByOrder($order_id))) { $return_msg .= 'Невозможно получить данные клиента'; } // echo CVarDumper::dump($data['client']);die; if (!is_array($data['settings'] = Config::model()->get_settings())) { $return_msg .= 'Невозможно получить основные параметры'; } // echo CVarDumper::dump($data['settings']['org.fullname']['value'],10,true);die; $body = $this->_tmpl_body($data, Contracts::model()->get_contract_tmpl($_POST['template_id'])); // echo $body;die; if ($body == '') { $return_msg .= 'Невозможно сформировать шаблон'; } if ($return_msg == '') { echo $body; } else { echo $return_msg; } } else { echo 'Некорректный формат запроса'; } }
function viewTable($data, $count) { $clients = new Clients(); $paginations = new Paginations(); $paginations->setLimit(10); $paginations->setPage($_REQUEST['page']); $paginations->setJSCallback("viewClients"); $paginations->setTotalPages($count); $paginations->makePagination(); ?> <div class="mws-panel-header"> <span class="mws-i-24 i-table-1">View Client</span> </div> <div class="mws-panel-body"> <table cellpadding="0" cellspacing="0" border="0" class="mws-datatable-fn mws-table"> <thead> <tr> <th>Client Name</th> <th>Client Address</th> <th>Client Email</th> </tr> </thead> <tbody> <?php if (count($data) > 0) { ?> <?php for ($i = 0; $i < count($data); $i++) { $clients->extractor($data, $i); ?> <tr id="row_<?php echo $clients->clientId(); ?> "> <td><?php echo $clients->clientFirstName() . ' ' . $clients->clientLastName(); ?> </td> <td><?php echo $clients->clientAddress(); ?> </td> <td><?php echo $clients->clientEmail(); ?> </td> </tr> <?php } ?> <?php } ?> </tbody> </table> <?php $paginations->drawPagination(); }
<?php require_once '../../resources/core/init.php'; if (LoginCheck::isLoggedInAsAdmin()) { $clients = new Clients(); if (isset($_POST['delete_client']) && isset($_POST['client_username'])) { $clients->deleteClientFromPOST(); } else { $allClients = $clients->getClients(); } require_once RESOURCE_DIR . '/views/current_clients.php'; } else { header('location: /admin.php'); }
<?php require_once '../common/config/config.inc.php'; require_once SOURCE_ROOT . 'classes/class.client.php'; require_once '../classes/class.adminlogin.php'; require_once SOURCE_ROOT . 'classes/class.extra.php'; $objAdminLogin = new AdminLogin(); $objAdminLogin->isValidAdmin(); $objExtra = new Extra(); $arrClmn = array('ClientExtra1', 'ClientExtra2'); $extra = $objExtra->getExtraListing(TABLE_EXTRA_SETTINGS, $arrClmn, ''); if ($_GET['n_id'] == '') { header($_SESSION['sessRedirectURL']); die; } $objClients = new Clients(); $arrUsersFlds = array(); $varWhere = ' pkClientID = \'' . $_GET['n_id'] . '\''; $arrUsersRecord = $objClients->getUsersListing(TABLE_CLIENTS, $arrUsersFlds, '', $varWhere); if ($_SESSION['sessNewsDetail'] != '') { @extract($_SESSION['sessUsersDetail']); } //var_dump($arrUsersRecord);die; $varUsersID = $_GET['n_id']; @extract($arrUsersRecord[0]); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Client Details</title>
<?php $this->breadcrumbs = array(tt('Manage clients', 'clients') => array('admin'), tt('View client', 'clients')); $this->menu = array(array('label' => tt('Manage clients', 'clients'), 'url' => array('admin')), array('label' => tt('Add client', 'clients'), 'url' => array('create')), array('label' => tt('Delete client', 'clients'), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => tc('Are you sure you want to delete this item?')))); $this->adminTitle = tt('View client', 'clients'); ?> <?php $this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'attributes' => array('id', array('label' => CHtml::encode($model->getAttributeLabel('state')), 'value' => Clients::getClientsState($model->state), 'template' => "<tr class=\"{class}\"><th>{label}</th><td>{value}</td></tr>\n"), 'contract_number', 'first_name', 'second_name', 'middle_name', 'birthdate', 'phone', 'additional_phone', 'acts', 'additional_info', 'date_created')));
padding: 8px 11px; text-align:left; font-size: 11px; color: #222; line-height: 12px;'), 'value' => function ($data) { return '<span class="square ' . $data->dealPriority->color . '">square</span>' . CHtml::submitButton($data->text, array("class" => "button_to_link", 'onClick' => 'ActionEdit(' . $data->id . ',"deal", "dealings_page")')); }), array('name' => 'client_id', 'header' => 'Клиент', 'headerHtmlOptions' => array('class' => 'w56_5', 'style' => ' height: 12px; border-right: 1px solid #d9d9d9; border-bottom: 1px solid #d9d9d9; padding: 8px 11px; text-align:left; font-size: 11px; color: #222; line-height: 12px;'), 'type' => 'raw', 'value' => function ($data) { $role = UsersRoles::model()->find('user_id=' . Yii::app()->user->id)->itemname; $client_info = Clients::model()->findByPk($data->client_id); $responsible = Users::model()->findByPk($client_info->responsable_id); if ($client_info->responsable_id == Yii::app()->user->id || $responsible->parent_id == Yii::app()->user->id || $role == 'admin') { return CHtml::link($data->client->name, Yii::app()->createUrl("page/client_profile", array("id" => $data->client->id))); } else { return $data->client->name; } }), array('name' => 'paid', 'header' => 'Уплачено / Остаток', 'headerHtmlOptions' => array('class' => 'w57_5', 'style' => ' height: 12px; border-right: 1px solid #d9d9d9; border-bottom: 1px solid #d9d9d9; padding: 8px 11px; text-align:left; font-size: 11px; color: #222; line-height: 12px;'), 'type' => 'raw', 'value' => function ($data) { return round($data->paid) . ' / ' . round($data->balance);
/** * Returns clients. * * @return Response */ public function load_clients() { $data['Clients'] = Clients::get(); // loads all clients from clients database return $data['Clients']; }
<?php require_once 'common/config/config.inc.php'; require_once SOURCE_ROOT . 'classes/class.niches.php'; require_once SOURCE_ROOT . 'classes/class.client.php'; $objNiches = new Niches(); $objClients = new Clients(); $arrClientFlds = array(); if (isset($_POST)) { $arrNichesRecord = $objNiches->getNiches($_POST); } if ($arrNichesRecord == NULL) { $_SESSION['window2'] = "{$objCore->setErrorMsg}('<b>This niche is not found in the registry.</b>')"; $objCore->setErrorMsg('<b>This niche is not found in the registry.</b>'); $objCore->standardRedirect('index.php'); } $fkClientID = $arrNichesRecord[0]['fkClientID']; $varClientWhere = ' pkClientID = ' . $fkClientID; $arrClientRecord = $objClients->getUsersListing(TABLE_CLIENTS, $arrClientFlds, '', $varClientWhere); @extract($arrNichesRecord[0]); @extract($arrClientRecord[0]); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php $this->breadcrumbs = array('Invoices Fkts' => array('index'), 'Manage'); $this->menu = array(array('label' => 'Создать', 'url' => array('create')), array('label' => 'Шаблоны', 'url' => array('invoicesFktTmpl/admin'))); Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('invoices-fkt-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n"); ?> <h1>Управление счетами-фактурами</h1> <?php $this->widget('application.extensions.yii-flash.Flash', array('keys' => array('success', 'error', 'notice'), 'htmlOptions' => array('class' => 'flash'))); ?> <!-- flashes --> <p> Можно использовать (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b> или <b>=</b>). </p> <?php echo CHtml::link('Продвинутый поиск', '#', array('class' => 'search-button')); ?> <div class="search-form" style="display:none"> <?php $this->renderPartial('_search', array('model' => $model)); ?> </div><!-- search-form --> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'invoices-fkt-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', 'num', array('name' => 'order_id', 'value' => '$data->order->name', 'filter' => Orders::model()->listData()), array('name' => 'client_id', 'value' => '$data->client->name', 'filter' => CHtml::listData(Clients::model()->findAll(), 'id', 'name')), 'date', 'sum', array('name' => 'is_sign', 'value' => 'InvoicesFkt::model()->itemAlias("is_sign",$data->is_sign)'), array('class' => 'MyButtonColumn'))));
/** * Get vendors to approve to session * @return array */ public static function getVendorsToApproveToSession() { $vendorsList = array(); $client = Clients::model()->with('vendors_list')->findByPk(Yii::app()->user->clientID); if (isset($client->vendors_list)) { $vendors = $client->vendors_list; } else { $vendors = array(); } $i = 1; foreach($vendors as $vendor) { $vendorsList[$i] = $vendor->Vendor_ID; $i++; } return $vendorsList; }
<?php $config = new Config(); $ne = new NewsAndEvent(); $news = $ne->getNEList('news'); $events = $ne->getNEList('event'); $client = new Clients(); $clients = $client->getClinets(); $sponcer = new Sponcer(); $sponcers = $sponcer->getSponcer('sponcer-girl'); $pm = new PageManager(); ?> <!-- Start main-content --> <div class="main-content"> <!-- Section: home --> <section> <div class="container pb-0"> <div class="section-title text-center mb-0"> <div class="row"> <div class="col-md-12"> <h3 class="text-uppercase mt-0">WomenLine</h3> <div class="title-icon"> <i class="flaticon-hand221"></i> </div> <div class="col-lg-10 col-md-9 col-sm-6 text-left"> <p><?php echo substr(strip_tags($pm->setPage('introduction')->getPageInfo('page-content')), 0, 250); ?> ...</p> </div> <div class="col-lg-2 col-md-3 col-sm-6">
public function loadModel($id) { $model = Clients::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
/** * Return a value indicating whether the user is or not client * By default user_id as unique param * @return boolean value indicating wheter is or not client */ public function getisClient() { $Users = Clients::model()->with("Users")->count(array('select' => 't.user_id', 'condition' => 'Users.user_id = :user_id', 'params' => array(':user_id' => Yii::app()->user->id))); return (bool) $Users; }
public static function notifyNextUsers($nextUsers,$userToClient){ if ($nextUsers) { $project = Projects::model()->findByPk(Yii::app()->user->projectID); foreach ($nextUsers as $nextUser) { $nextUserId = $nextUser->User_ID; $nextUserApprovalValue = $nextUser->User_Approval_Value; $user = Users::model()->with('settings','person')->findByPk($nextUserId); // send notification // get aps to approve to next users $condition = new CDbCriteria(); $condition->join = "LEFT JOIN documents ON documents.Document_ID=t.Document_ID"; $condition->condition = "documents.Client_ID='" . Yii::app()->user->clientID . "'"; $condition->addCondition("documents.Project_ID = '" . Yii::app()->user->projectID . "'"); $condition->addCondition("t.AP_Approval_Value < '" . $nextUserApprovalValue . "'"); $condition->addCondition("t.AP_Approval_Value >= '" . $userToClient->User_Approval_Value . "'"); $condition->addCondition("t.AP_Approval_Value != '0'"); $aps = Aps::model()->find($condition); if ($aps) { $client = Clients::model()->findByPk(Yii::app()->user->clientID); $clientsToApprove = array($client->company->Company_Name.' - '.$project->Project_Name); Mail::sendPendingApprovalDocumentsNotification(!$user->settings->Notification,$user, $clientsToApprove, Documents::AP,$client,$project); } } } }
$client; $merchantReferenceNo = $_REQUEST['resid']; //$session->getMerchantReferenceNo(); $reservations->setReservationId($merchantReferenceNo); $pay_data = $reservations->getReservationsFromId(); $reservations->extractor($pay_data); $reservation_link_id = $reservations->reservationFromBookingLink(); $reservations_status = $reservations->reservationPaymentStatus(); if ($reservations->reservationFromBookingLink()) { $client = new BookingClient(); $client->setId($reservations->reservationClientId()); $client->extractor($client->getClientsFromId()); $client_name = $client->name(); $client_email = $client->email(); } else { $client = new Clients(); $client->setClientId($reservations->reservationClientId()); $client->extractor($client->getClientFromId()); $client_name = $client->clientFirstName() . " " . $client->clientLastName(); $client_email = $client->clientEmail(); } $hotels->setHotelId($reservations->reservationHotelId()); $hotels->extractor($hotels->getHotelFromId()); $date = date("Y-m-d"); // current date $new_date = strtotime(date("Y-m-d", strtotime($date)) . " +3 month"); $expire_date = date("Y-m-d", $new_date); $rooms->setRoomTypeId($reservations->reservationHotelRoomTypeId()); $rooms->extractor($rooms->getHotelRoomTypeFromId()); $hotel_name = $hotels->hotelName(); $room_type = $rooms->roomTypeName();
<?php require_once '../common/config/config.inc.php'; require_once SOURCE_ROOT . 'classes/class.client.php'; require_once SOURCE_ROOT . 'classes/class.paging.php'; require_once SOURCE_ROOT . 'classes/class.sort.php'; require_once SOURCE_ROOT . '/classes/class.adminlogin.php'; require_once SOURCE_ROOT . '/classes/excelwriter.php'; $objAdminLogin = new AdminLogin(); $objAdminLogin->isValidAdmin(); $objSessionRedirectUrl = new SessionRedirectUrl(); $objClients = new Clients(); $objPaging = new Paging(); //$varPageStart = $objPaging->getPageStartLimit($_GET['page'], $_SESSION['sessAdminPagingLimit']); //$varLimit = $varPageStart.','.$_SESSION['sessAdminPagingLimit']; $arrUsersFlds = array('pkClientID', 'ClientLoginID', 'ClientFirstName', 'ClientLastName', 'ClientPassword', 'ClientOrganizationName', 'ClientStreetAddress', 'ClientCity', 'ClientState', 'ClientZipCode', 'ClientPhoneNumber', 'ClientOrganizationType', 'ClientAddedDate', 'ClientModifiedDate', 'ClientApprovalStatus'); //$varPageStart = $objPaging->getPageStartLimit($_GET['page'], $_SESSION['sessAdminPagingLimit']); //$varLimit = $varPageStart.','.$_SESSION['sessAdminPagingLimit']; //$arrUsersRecord = $objGeneral->getRecord(TABLE_CLIENTS, $arrUsersFlds, ''); //$NumberofRows = count($arrUsersRecord); //$varNumberPages = $objPaging->calculateNumberofPages($NumberofRows, $_SESSION['sessAdminPagingLimit']); $arrUsersList = $objClients->getUsersList(TABLE_CLIENTS, $arrUsersFlds, $varLimit, ''); //print_r($arrproperty_surveyList);die; $excel = new ExcelWriter("client_list.xls"); if ($excel == false) { echo $excel->error; } $main_array = array("<b>Client ID</b>", "<b>E-mail ID</b>", "<b>First Name</b>", "<b>Last Name</b>", "<b>Password</b>", "<b>Organization Name</b>", "<b>Street Address</b>", "<b>City</b>", "<b>State</b>", "<b>Zip</b>", "<b>Phone</b>", "<b>Organization Type</b>", "<b>Date Added</b>", "<b>Date Modified</b>", "<b>Status</b>"); $columnTitles = array_values($main_array); $numColumns = count($columnTitles); // $row += 2;
border-right: 1px solid #d9d9d9; padding: 8px 11px; text-align:left; font-size: 11px; color: #222; line-height: 12px;'), 'value' => function ($data) { return $data->status == 'active' ? 'Активен' : 'Не активен'; }), array('name' => 'clients_count', 'header' => 'Клиенты', 'headerHtmlOptions' => array('class' => 'w8', 'style' => ' height: 12px; border-bottom: 1px solid #d9d9d9; border-right: 1px solid #d9d9d9; padding: 8px 11px; text-align:left; font-size: 11px; color: #222; line-height: 12px;'), 'value' => function ($data) { return count(Clients::model()->findAll('responsable_id=' . $data->id)); }), array('name' => 'reg_date', 'header' => 'Дата создания', 'headerHtmlOptions' => array('class' => 'w8', 'style' => ' height: 12px; border-bottom: 1px solid #d9d9d9; padding: 8px 11px; text-align:left; font-size: 11px; color: #222; line-height: 12px;'), 'value' => function ($data) { return date('d.m.y', strtotime($data->reg_date)) . ' в ' . date('H:i', strtotime($data->reg_date)); })))); ?> </div> </div> </main><!--.content--> </div><!--.container--> <aside class="left-sidebar">