本文整理汇总了PHP中Customers类的典型用法代码示例。如果您正苦于以下问题:PHP Customers类的具体用法?PHP Customers怎么用?PHP Customers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Customers类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: deleteAction
/**
* Delete a customer record
*/
public function deleteAction()
{
$customersTable = new Customers();
$customer = $customersTable->find($this->_getParam('id'))->current();
!is_null($customer) && $customer->delete();
$this->_redirect('/customers');
}
开发者ID:carriercomm,项目名称:billing-6,代码行数:10,代码来源:CustomersController.php
示例2: contacts_holidays_list_BeforeShow
function contacts_holidays_list_BeforeShow(&$sender)
{
$contacts_holidays_list_BeforeShow = true;
$Component =& $sender;
$Container =& CCGetParentContainer($sender);
global $contacts_holidays_list;
//Compatibility
//End contacts_holidays_list_BeforeShow
//Custom Code @22-2A29BDB7
// -------------------------
// Write your own code here.
$del_guid = CCGetFromGet("del_guid", "");
$o = CCGetFromGet("o", "");
if ($o == "delrecord" && strlen($del_guid) > 0) {
global $FileName;
$params["guid"] = $del_guid;
$customers = new Customers();
$customers->deleteHolidaysByGuid($params);
$querystring = CCGetQueryString("QueryString", array("o", "del_guid"));
//Forcing redirect
header("Location: {$FileName}?{$querystring}");
}
// -------------------------
//End Custom Code
//Close contacts_holidays_list_BeforeShow @1-2AE37F02
return $contacts_holidays_list_BeforeShow;
}
开发者ID:wangshipeng,项目名称:license_manager,代码行数:27,代码来源:contacts_holidays_list_events.php
示例3: getCompanyName
function getCompanyName($id)
{
$localvars = localvars::getInstance();
$validate = new validate();
$customers = new Customers();
$returnValue = "";
if (isnull($id) && !$validate->integer($id)) {
throw new Exception('not valid integer');
return false;
} else {
$data = $customers->getRecords($id);
$returnValue = $data[0]['companyName'];
return $returnValue;
}
}
开发者ID:ddavisgraphics,项目名称:TimeTrackerDemoApp_EngineAPI,代码行数:15,代码来源:index.php
示例4: fromArray
public static function fromArray($data)
{
$settings = new RoleSettings();
foreach ($data as $key => $value) {
if (property_exists(get_class($settings), $key)) {
if (is_array($value)) {
if ($key == "transactions") {
$settings->{$key} = Transactions::fromArray($value);
}
if ($key == "reports") {
$settings->{$key} = Reports::fromArray($value);
}
if ($key == "help") {
$settings->{$key} = Help::fromArray($value);
}
if ($key == "mobileVTAccess") {
$settings->{$key} = MobileVTAcces::fromArray($value);
}
if ($key == "admin") {
$settings->{$key} = Admin::fromArray($value);
}
if ($key == "customer") {
$settings->{$key} = Customers::fromArray($value);
}
if ($key == "webPosAccess") {
$settings->{$key} = WebPosAccess::fromArray($value);
}
} else {
$settings->{$key} = $value;
}
}
}
return $settings;
}
开发者ID:payhub,项目名称:payhubws-public-sdk,代码行数:34,代码来源:RoleSettings.php
示例5: customers
public function customers()
{
$registry = Shineisp_Registry::getInstance();
$translator = $registry->Zend_Translate;
$this->view->customers = Customers::getList($translator->translate('Select the customer ...'), array(array('where' => 'u.status_id = ?', 'params' => Statuses::id('active', 'customers'))));
return $this->view->render('partials/customers.phtml');
}
开发者ID:kokkez,项目名称:shineisp,代码行数:7,代码来源:Customers.php
示例6: isValid
public function isValid($value)
{
$customer = Customers::getCustomerbyEmail($value);
if (isset($customer[0])) {
$this->_error(self::ALREADYUSED);
return false;
} else {
return true;
}
}
开发者ID:kokkez,项目名称:shineisp,代码行数:10,代码来源:Email.php
示例7: customerloginAction
public function customerloginAction()
{
$response['code'] = 'Invalid ID or password.';
$email = $this->getRequest()->getParam('email');
$password = $this->getRequest()->getParam('password');
$Customer = Customers::setCustomerLogin($email, $password);
if ($Customer) {
$Customer->setLastLogin();
$_SESSION['Customer'] = $Customer;
$response['code'] = 'SUCCESS';
}
echo json_encode($response);
}
开发者ID:hoaitn,项目名称:base-zend,代码行数:13,代码来源:AjaxController.php
示例8: getAll
public function getAll($uuid)
{
$customers = Customers::findWithUuid($uuid);
if (empty($customers)) {
throw new Shineisp_Api_Exceptions(400006, ":: 'uuid' not valid");
exit;
}
$id = $customers['customer_id'];
$services = Products::getAllServicesByCustomerID($id, 'o.order_id, oi.detail_id as detail_id, pd.name as productname,
DATE_FORMAT(oi.date_start, "%d/%m/%Y") AS date_start, DATE_FORMAT(oi.date_end, "%d/%m/%Y") AS date_end,
DATEDIFF(oi.date_end, CURRENT_DATE) AS daysleft, oi.price as price, oi.autorenew as autorenew, oi.uuid as uuid, s.status as status');
return $services;
}
开发者ID:kokkez,项目名称:shineisp,代码行数:13,代码来源:Ordersitems.php
示例9: actionIndex
public function actionIndex()
{
if (Helper::checkRoute('index')) {
$searchModel = new ProvinceSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
if (Yii::$app->request->post('hasEditable')) {
$ID = \Yii::$app->request->post('editableKey');
$model = Customers::findOne($ID);
$out = Json::encode(['output' => '', 'message' => '']);
// fetch the first entry in posted data (there should
// only be one entry anyway in this array for an
// editable submission)
// - $posted is the posted data for Book without any indexes
// - $post is the converted array for single model validation
$post = [];
$posted = current($_POST['Customers']);
$post['Customers'] = $posted;
// load model like any single model validation
if ($model->load($post)) {
// can save model or do something before saving model
$model->save();
// custom output to return to be displayed as the editable grid cell
// data. Normally this is empty - whereby whatever value is edited by
// in the input by user is updated automatically.
$output = '';
// specific use case where you need to validate a specific
// editable column posted when you have more than one
// EditableColumn in the grid view. We evaluate here a
// check to see if buy_amount was posted for the Book model
if (isset($posted['CUST_KD_ALIAS'])) {
// $output = Yii::$app->formatter->asDecimal($model->EMP_NM, 2);
$output = $model->CUST_KD_ALIAS;
}
// similarly you can check if the name attribute was posted as well
// if (isset($posted['name'])) {
// $output = ''; // process as you need
// }
$out = Json::encode(['output' => $output, 'message' => '']);
// return ajax json encoded response and exit
echo $out;
return;
}
}
return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
} else {
Yii::$app->user->logout();
$this->redirect(array('/site/login'));
//
}
}
开发者ID:adem-team,项目名称:advanced,代码行数:50,代码来源:ProvinsiCustomersCrmController.php
示例10: getEntity
/**
* Get an order, first checking if the current user can view it.
*/
protected function getEntity($id)
{
// Fetch the order from the ID.
$order = Orders::getInstance()->findEntity($id);
// Find the customer whom the order belongs to.
$orderCustomerId = $order->getCustomer()->getId();
if ($orderCustomerId != Customers::getCurrent()->getId()) {
// A 'not found' exception is thrown instead of the expected 'not
// authorised' to prevent order enumeration from malicious users.
throw new NotFoundException('The current customer cannot use this order.');
}
// Everything looks fine, return the order.
return $order;
}
开发者ID:eix,项目名称:catalog,代码行数:17,代码来源:Orders.php
示例11: filter
public static function filter($input, $limit = 24)
{
return Customers::where(function ($query) use($input) {
if (array_key_exists('name', $input) && strlen($input['name'])) {
$query->where('name', 'LIKE', "%" . $input['name'] . "%");
}
if (array_key_exists('address', $input) && strlen($input['address'])) {
$query->where('address', 'LIKE', "%" . $input['address'] . "%");
}
if (array_key_exists('contact', $input) && strlen($input['contact'])) {
$query->where('contact', 'LIKE', "%" . $input['contact'] . "%");
}
})->orderBy('name', 'asc')->paginate($limit);
}
开发者ID:nurulimamnotes,项目名称:point-of-sale,代码行数:14,代码来源:Customers.php
示例12: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('text', 'invoice_date', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
$this->addElement('select', 'order_id', array('label' => $translate->_('Order No.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('order_id')->setAllowEmpty(false)->setMultiOptions(Orders::getList(true));
$this->addElement('select', 'customer_parent_id', array('label' => $translate->_('Invoice destination'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'disable' => 'true'));
$this->getElement('customer_parent_id')->setAllowEmpty(true)->setMultiOptions(Customers::getList(true));
$this->addElement('text', 'number', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Sequential number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'formatted_number', array('filters' => array('StringTrim'), 'required' => false, 'label' => $translate->_('Invoice number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'label' => $translate->_('Private Notes'), 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control wysiwyg'));
$this->addElement('hidden', 'invoice_id');
}
开发者ID:kokkez,项目名称:shineisp,代码行数:15,代码来源:InvoicesForm.php
示例13: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('text', 'subject', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Subject'), 'class' => 'form-control'));
$this->addElement('text', 'datetime', array('filters' => array('StringTrim'), 'label' => $translate->_('Date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'class' => 'col-lg-12 form-control wysiwyg'));
$this->addElement('select', 'sendemail', array('label' => $translate->_('Send Email'), 'description' => $translate->_('Send an email to the customer.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'multioptions' => array('1' => $translate->_('Yes'), '0' => $translate->_('No'))));
$this->addElement('select', 'category_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Category'), 'class' => 'form-control'));
$this->getElement('category_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(TicketsCategories::getList());
$this->addElement('select', 'customer_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Customer'), 'class' => 'form-control'));
$this->getElement('customer_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Customers::getList());
$this->addElement('select', 'category', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Category'), 'class' => 'form-control'));
$this->getElement('category')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(TicketsCategories::getList());
$this->addElement('select', 'order_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Order reference'), 'class' => 'form-control'));
$this->getElement('order_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Orders::getList(true));
$this->addElement('select', 'sibling_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Relationships'), 'class' => 'form-control'));
$this->getElement('sibling_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false);
$this->addElement('select', 'user_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Operator'), 'class' => 'form-control'));
$this->getElement('user_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(AdminUser::getList());
#->setMultiOptions(AdminUser::getUserbyRoleID(AdminRoles::getIdRoleByName('operator')));
$this->addElement('select', 'status_id', array('decorators' => array('Bootstrap'), 'label' => $translate->_('Status'), 'class' => 'form-control'));
$this->getElement('status_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Statuses::getList('tickets'));
// If the browser client is an Apple client hide the file upload html object
if (false == Shineisp_Commons_Utilities::isAppleClient()) {
$MBlimit = Settings::findbyParam('adminuploadlimit');
$Types = Settings::findbyParam('adminuploadfiletypes', 'Admin');
if (empty($MBlimit)) {
$MBlimit = 1;
}
if (empty($Types)) {
$Types = "zip,jpg";
}
$Byteslimit = Shineisp_Commons_Utilities::MB2Bytes($MBlimit);
$file = $this->createElement('file', 'attachments', array('label' => $translate->_('Attachment'), 'decorators' => array('File', array('ViewScript', array('viewScript' => 'partials/file.phtml', 'placement' => false))), 'description' => $translate->_('Select the document to upload. Files allowed are (%s) - Max %s', $Types, Shineisp_Commons_Utilities::formatSizeUnits($Byteslimit)), 'data-classButton' => 'btn btn-primary', 'data-input' => 'false', 'class' => 'filestyle'));
$file->addValidator('Extension', false, $Types)->addValidator('Size', false, $Byteslimit)->addValidator('Count', false, 1);
$this->addElement($file);
} else {
$this->addElement('hidden', 'attachments');
}
$this->addElement('hidden', 'ticket_id');
}
开发者ID:kokkez,项目名称:shineisp,代码行数:43,代码来源:TicketsForm.php
示例14: addSchedule
static function addSchedule($inputs)
{
$introVisit = new IntroVisit();
$introVisit['customer_id'] = $inputs['customerId'];
$introVisit->student_id = $inputs['studentIdIntroVisit'];
$introVisit->class_id = $inputs['eligibleClassesCbx'];
$introVisit->batch_id = $inputs['introbatchCbx'];
//$introVisit->status = 'ACTIVE/SCHEDULED';
$introVisit->franchisee_id = Session::get('franchiseId');
$introVisit->iv_date = date('Y-m-d', strtotime($inputs['introVisitTxtBox']));
$introVisit->created_by = Session::get('userId');
$introVisit->created_at = date("Y-m-d H:i:s");
$introVisit->save();
$customerObj = Customers::find($inputs['customerId']);
if ($customerObj) {
$customerObj->stage = "IV SCHEDULED";
$customerObj->save();
}
return $introVisit;
}
开发者ID:Headrun-php,项目名称:TLG,代码行数:20,代码来源:IntroVisit.php
示例15: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('text', 'paymentdate', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Payment date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
$this->addElement('text', 'reference', array('filters' => array('StringTrim'), 'label' => $translate->_('Transaction Reference'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'income', array('filters' => array('StringTrim'), 'label' => $translate->_('Income'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'outcome', array('filters' => array('StringTrim'), 'label' => $translate->_('Expense'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('select', 'confirmed', array('filters' => array('StringTrim'), 'label' => $translate->_('Does the Transaction has been confirmed?'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('confirmed')->setAllowEmpty(false)->setMultiOptions(array('0' => "No, it has been not", '1' => "Yes, it has been"));
$this->addElement('select', 'bank_id', array('decorators' => array('Bootstrap'), 'label' => 'Method of Payments', 'class' => 'form-control'));
$this->getElement('bank_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Banks::getList());
$this->addElement('select', 'order_id', array('decorators' => array('Bootstrap'), 'label' => 'Order', 'class' => 'form-control'));
$this->getElement('order_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Orders::getList());
$this->addElement('select', 'customer_id', array('decorators' => array('Bootstrap'), 'label' => 'Customer', 'class' => 'form-control'));
$this->getElement('customer_id')->setAllowEmpty(false)->setRegisterInArrayValidator(false)->setMultiOptions(Customers::getList());
$this->addElement('textarea', 'description', array('filters' => array('StringTrim'), 'label' => $translate->_('Description'), 'id' => 'description', 'rows' => '3', 'decorators' => array('Bootstrap'), 'class' => 'col-lg-12 form-control'));
$this->addElement('hidden', 'payment_id');
}
开发者ID:kokkez,项目名称:shineisp,代码行数:20,代码来源:PaymentsForm.php
示例16: clearAllReferences
/**
* Resets all references to other model objects or collections of model objects.
*
* This method is a user-space workaround for PHP's inability to garbage collect
* objects with circular references (even in PHP 5.3). This is currently necessary
* when using Propel in certain daemon or large-volume/high-memory operations.
*
* @param boolean $deep Whether to also clear the references on all referrer objects.
*/
public function clearAllReferences($deep = false)
{
if ($deep && !$this->alreadyInClearAllReferencesDeep) {
$this->alreadyInClearAllReferencesDeep = true;
if ($this->collDetailTransaksis) {
foreach ($this->collDetailTransaksis as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->aCustomers instanceof Persistent) {
$this->aCustomers->clearAllReferences($deep);
}
$this->alreadyInClearAllReferencesDeep = false;
}
// if ($deep)
if ($this->collDetailTransaksis instanceof PropelCollection) {
$this->collDetailTransaksis->clearIterator();
}
$this->collDetailTransaksis = null;
$this->aCustomers = null;
}
开发者ID:nurhidayatullah,项目名称:inventory,代码行数:30,代码来源:BaseTransaksi.php
示例17: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('text', 'domain', array('filters' => array('StringTrim'), 'required' => true, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Domain'), 'description' => $translate->_('Write down the name of the domain without any extension, white spaces, or symbols.'), 'class' => 'form-control updatechkdomain'));
$this->addElement('select', 'tld_id', array('label' => $translate->_('TLD'), 'description' => $translate->_('Select the TLD from the list'), 'decorators' => array('Bootstrap'), 'class' => 'form-control updatechkdomain'));
$this->getElement('tld_id')->setAllowEmpty(false)->setMultiOptions(DomainsTlds::getList())->setRequired(true);
$this->addElement('select', 'registrars_id', array('label' => $translate->_('Registrar'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('registrars_id')->setAllowEmpty(true)->setMultiOptions(Registrars::getList());
// Domain Ownership
$this->addElement('select', 'owner', array('label' => $translate->_('Owner'), 'description' => $translate->_("If the domain owner's profile is not set, the domain customer information will be used."), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('owner')->setAllowEmpty(true)->setMultiOptions(DomainsProfiles::getList(true));
$this->addElement('select', 'admin', array('label' => $translate->_('Admin-C'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('admin')->setAllowEmpty(true)->setMultiOptions(DomainsProfiles::getList(true));
$this->addElement('select', 'tech', array('label' => $translate->_('Tech'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('tech')->setAllowEmpty(true)->setMultiOptions(DomainsProfiles::getList(true));
$this->addElement('select', 'billing', array('label' => $translate->_('Billing'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('billing')->setAllowEmpty(true)->setMultiOptions(DomainsProfiles::getList(true));
$this->addElement('text', 'creation_date', array('filters' => array('StringTrim'), 'label' => $translate->_('Creation date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
$this->addElement('text', 'expiring_date', array('filters' => array('StringTrim'), 'label' => $translate->_('Expiry Date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date', 'dateformat' => Settings::getJsDateFormat()));
$this->addElement('text', 'authinfocode', array('filters' => array('StringTrim'), 'label' => $translate->_('AUTHINFO CODE'), 'description' => $translate->_('Write down the Authinfo code in order to transfer the domain to this ISP'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('checkbox', 'autorenew', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Auto renewal'), 'class' => 'form-control'));
$this->addElement('select', 'customer_id', array('label' => $translate->_('Customer'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('customer_id')->setAllowEmpty(false)->setMultiOptions(Customers::getList())->setRequired(true);
//
$note = $this->addElement('textarea', 'note', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Private Notes'), 'class' => 'col-lg-12 form-control'));
$note = $this->addElement('textarea', 'message', array('filters' => array('StringTrim'), 'required' => false, 'decorators' => array('Bootstrap'), 'label' => $translate->_('Message'), 'class' => 'col-lg-12 form-control wysiwyg'));
$status = $this->addElement('select', 'status_id', array('label' => 'Status', 'required' => true, 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
// DNS SECTION
// ==============
$this->addElement('text', 'subdomain', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Subdomain'), 'class' => 'form-control'));
$this->addElement('text', 'target', array('filters' => array('StringTrim'), 'decorators' => array('Bootstrap'), 'label' => $translate->_('Target'), 'class' => 'form-control'));
$this->addElement('select', 'zone', array('label' => $translate->_('Zone'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('zone')->setAllowEmpty(false)->setMultiOptions(Dns_Zones_Types::getZones());
$status = $this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('domains'));
$save = $this->addElement('submit', 'save', array('required' => false, 'label' => $translate->_('Save'), 'decorators' => array('Bootstrap'), 'class' => 'btn'));
$id = $this->addElement('hidden', 'domain_id');
}
开发者ID:kokkez,项目名称:shineisp,代码行数:39,代码来源:DomainsForm.php
示例18: indexAction
public function indexAction()
{
$auth = Zend_Auth::getInstance();
$registry = Shineisp_Registry::getInstance();
$translation = Shineisp_Registry::get('Zend_Translate');
$retval = array();
if ($auth->hasIdentity()) {
$request = Zend_Controller_Front::getInstance()->getRequest();
try {
$form = new Admin_Form_BulkmailForm(array('action' => '/admin/bulkmail/#bulkmail', 'method' => 'post'));
if ($request->isPost()) {
$isp = Isp::getActiveISP();
if ($form->isValid($request->getPost())) {
$data = $request->getPost();
$mail = new Bulkmails();
$mail->subject = $data['subject'];
$mail->body = $data['body'];
$mail->senddate = date('Y-m-d H:i:s');
$mail->save();
$customers = Customers::getEmails();
foreach ($customers as $customer) {
$body = str_replace('{fullname}', $customer['fullname'], $data['body']);
$result = Shineisp_Commons_Utilities::SendEmail($isp['email'], $customer['email'], null, $data['subject'], $body, true);
if ($result !== true) {
$retval[] = $result;
}
}
}
}
$retval = count($retval) > 0 ? $retval : null;
$this->view->form = $form;
$this->view->title = $translation->translate("Mass eMail");
$this->view->description = $translation->translate("Write here a message to send to all your own customers.");
$this->view->errors = $retval;
} catch (Exception $e) {
die($e->getMessage());
}
}
}
开发者ID:kokkez,项目名称:shineisp,代码行数:39,代码来源:BulkmailController.php
示例19: insert
public function insert($params)
{
$this->authenticate();
$form = new Api_Form_CustomerForm(array('action' => '#', 'method' => 'post'));
if (array_key_exists('countrycode', $params)) {
$country_id = Countries::getIDbyCode($params['countrycode']);
if ($country_id == null) {
throw new Shineisp_Api_Exceptions(400005, ":: 'countrycode' not valid");
exit;
}
unset($params['coutrycode']);
$params['country_id'] = $country_id;
}
if (array_key_exists('provincecode', $params) && $params['provincecode'] != "") {
$params['area'] = $params['provincecode'];
unset($params['provincecode']);
}
if ($form->isValid($params)) {
if ($params['status'] == false) {
$params['status'] = 'disabled';
}
$idcustomers = Customers::Create($params);
$customer = Customers::find($idcustomers);
return $customer['uuid'];
} else {
$errors = $form->getMessages();
$message = "";
foreach ($errors as $field => $errorsField) {
$message .= "Field '{$field}'<br/>";
foreach ($errorsField as $error => $describe) {
$message .= " => {$error} ({$describe})";
}
}
throw new Shineisp_Api_Exceptions(400004, ":\n{$message}");
exit;
}
}
开发者ID:kokkez,项目名称:shineisp,代码行数:37,代码来源:Customers.php
示例20: init
public function init()
{
// Set the custom decorator
$this->addElementPrefixPath('Shineisp_Decorator', 'Shineisp/Decorator/', 'decorator');
$translate = Shineisp_Registry::get('Zend_Translate');
$this->addElement('select', 'customer_id', array('label' => $translate->_('Owner of the domain profile'), 'description' => $translate->_('This is the customer who has created the domain profiles.'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('customer_id')->setAllowEmpty(false)->setMultiOptions(Customers::getList())->setRequired(true);
$this->addElement('text', 'firstname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Firstname'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'lastname', array('filters' => array('StringTrim'), 'required' => true, 'label' => $translate->_('Lastname'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('select', 'gender', array('label' => $translate->_('Gender'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('gender')->setAllowEmpty(true)->setMultiOptions(array('M' => $translate->translate('Man'), 'F' => $translate->translate('Female')));
$this->addElement('text', 'birthdate', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth date'), 'decorators' => array('Bootstrap'), 'class' => 'form-control date'));
$this->addElement('text', 'birthplace', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth place'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'birthdistrict', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth district'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'birthcountry', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth country'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'birthnationality', array('filters' => array('StringTrim'), 'label' => $translate->_('Birth nationality'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('select', 'type_id', array('label' => $translate->_('Company Type'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('type_id')->setAllowEmpty(true)->setMultiOptions(CompanyTypes::getList(true));
$this->addElement('select', 'legalform_id', array('label' => 'Legal form', 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('legalform_id')->setAllowEmpty(true)->setMultiOptions(Legalforms::getList());
$this->addElement('text', 'company', array('filters' => array('StringTrim'), 'label' => $translate->_('Company Name'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'vat', array('filters' => array('StringTrim'), 'label' => $translate->_('VAT Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'taxpayernumber', array('filters' => array('StringTrim'), 'label' => $translate->_('Taxpayer Number'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'address', array('filters' => array('StringTrim'), 'label' => $translate->_('Address'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'zip', array('filters' => array('StringTrim'), 'label' => $translate->_('Zip code'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'area', array('filters' => array('StringTrim'), 'label' => $translate->_('Area'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'city', array('filters' => array('StringTrim'), 'label' => $translate->_('City'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('select', 'country_id', array('label' => $translate->_('Country'), 'decorators' => array('Bootstrap'), 'class' => 'form-control', 'onchange' => 'onChangeCountry( this );'));
$this->getElement('country_id')->setAllowEmpty(false)->setMultiOptions(Countries::getList(true))->setRequired(true);
$this->addElement('text', 'phone', array('filters' => array('StringTrim'), 'label' => $translate->_('Phone'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'fax', array('filters' => array('StringTrim'), 'label' => $translate->_('Fax'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->addElement('text', 'email', array('filters' => array('StringTrim', 'StringToLower'), 'decorators' => array('Bootstrap'), 'validators' => array('EmailAddress'), 'required' => true, 'label' => $translate->_('Email'), 'class' => 'form-control'));
$this->addElement('select', 'status_id', array('label' => $translate->_('Status'), 'decorators' => array('Bootstrap'), 'class' => 'form-control'));
$this->getElement('status_id')->setAllowEmpty(false)->setMultiOptions(Statuses::getList('customers'));
$this->addElement('hidden', 'profile_id');
}
开发者ID:kokkez,项目名称:shineisp,代码行数:36,代码来源:DomainsProfilesForm.php
注:本文中的Customers类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论