function export_to_zarafa($uid)
{
    $f[] = "First Name,Middle Name,Last Name,Title,Suffix,Initials,Web Page,Gender,Birthday,Anniversary,Location,Language,Internet Free Busy,Notes,E-mail Address,E-mail 2 Address,E-mail 3 Address,Primary Phone,Home Phone,Home Phone 2,Mobile Phone,Pager,Home Fax,Home Address,Home Street,Home Street 2,Home Street 3,Home Address PO Box,Home City,Home State,Home Postal Code,Home Country,Spouse,Children,Manager's Name,Assistant's Name,Referred By,Company Main Phone,Business Phone,Business Phone 2,Business Fax,Assistant's Phone,Company,Job Title,Department,Office Location,Organizational ID Number,Profession,Account,Business Address,Business Street,Business Street 2,Business Street 3,Business Address PO Box,Business City,Business State,Business Postal Code,Business Country,Other Phone,Other Fax,Other Address,Other Street,Other Street 2,Other Street 3,Other Address PO Box,Other City,Other State,Other Postal Code,Other Country,Callback,Car Phone,ISDN,Radio Phone,TTY/TDD Phone,Telex,User 1,User 2,User 3,User 4,Keywords,Mileage,Hobby,Billing Information,Directory Server,Sensitivity,Priority,Private,Categories";
    $ldap = new clladp();
    $ct = new user($uid);
    $dn = "ou={$uid},ou=People,dc={$ct->ou},dc=NAB,{$ldap->suffix}";
    $filter = "(objectClass=inetOrgPerson)";
    $attrs = array();
    $hash = $ldap->Ldap_search($dn, $filter, array("employeeNumber"));
    if ($GLOBALS["VERBOSE"]) {
        echo "[{$uid}]: Exporting {$hash["count"]} user(s)\n";
    }
    for ($i = 0; $i < $hash["count"]; $i++) {
        $emp = new contacts(null, $hash[$i]["employeenumber"][0]);
        $f[] = @implode(",", $emp->ContactTocsvArray());
    }
    $tmpfile = "/tmp/{$uid}." . time() . ".csv";
    @file_put_contents("{$tmpfile}", @implode("\n", $f));
    $unix = new unix();
    $php = $unix->LOCATE_PHP5_BIN();
    $basename = basename($tmpfile);
    $cmd = $php . " " . dirname(__FILE__) . "/exec.zarafa.csv2contacts.php {$uid} \"{$ct->password}\" {$basename} 2>&1";
    if ($GLOBALS["VERBOSE"]) {
        echo "[{$uid}]: {$cmd}\n";
    }
    exec($cmd, $results);
    if ($GLOBALS["VERBOSE"]) {
        while (list($num, $line) = each($results)) {
            echo "[{$uid}]: {$line}\n";
        }
    }
}
示例#2
0
function PhotoUploaded()
{
    $tmp_file = $_FILES['photo']['tmp_name'];
    $content_dir = dirname(__FILE__) . "/ressources/conf/upload";
    if (!is_dir($content_dir)) {
        @mkdir($content_dir);
    }
    if (!@is_uploaded_file($tmp_file)) {
        $_GET["Photo_error"] = '{error_unable_to_upload_file} ' . $tmp_file;
        exit;
    }
    $name_file = $_FILES['photo']['name'];
    if (file_exists($content_dir . "/" . $name_file)) {
        @unlink($content_dir . "/" . $name_file);
    }
    if (!move_uploaded_file($tmp_file, $content_dir . "/" . $name_file)) {
        $_GET["Photo_error"] = "{error_unable_to_move_file} : " . $content_dir . "/" . $name_file;
        exit;
    }
    $file = $content_dir . "/" . $name_file;
    if (isset($_POST["uid"])) {
        $_GET["uid"] = $_POST["uid"];
        $user = new user($_POST["uid"]);
        $user->jpegPhoto_datas = file_get_contents($file);
        $user->add_user();
        if (is_file($user->thumbnail_path)) {
            unlink($user->thumbnail_path);
        }
        return null;
    }
    if (isset($_POST["employeeNumber"])) {
        $_GET["employeeNumber"] = $_POST["employeeNumber"];
        $user = new contacts($_SESSION["uid"], $_POST["employeeNumber"]);
        $user->jpegPhoto_datas = file_get_contents($file);
        if ($_SESSION["uid"] != -100) {
            $ldap = new clladp();
            $user2 = new user($_SESSION["uid"]);
            $dn = "cn={$user->sn} {$user->givenName},ou={$user2->uid},ou=People,dc={$user2->ou},dc=NAB,{$ldap->suffix}";
            if ($dn == $user->dn) {
                $user->Save();
            } else {
                $tpl = new templates();
                echo $tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
            }
        }
        if (is_file($user->thumbnail_path)) {
            unlink($user->thumbnail_path);
        }
        return null;
    }
}
示例#3
0
 function delete($id)
 {
     if ($this->id == '') {
         $this->id = $id;
     }
     return parent::do_delete();
 }
示例#4
0
 public function __construct()
 {
     $this->page_title_new = sprintf(BOX_TEXT_NEW_TITLE, TEXT_PROJECT);
     $this->tab_list[] = array('file' => 'template_notes', 'tag' => 'notes', 'order' => 40, 'text' => TEXT_NOTES);
     $this->tab_list[] = array('file' => 'template_j_general', 'tag' => 'general', 'order' => 1, 'text' => TEXT_GENERAL);
     parent::__construct();
 }
示例#5
0
 function delete($id)
 {
     global $db;
     if ($this->id == '') {
         $this->id = $id;
     }
     // error check
     return parent::do_delete();
 }
示例#6
0
 public function __construct()
 {
     $this->page_title_new = sprintf(BOX_TEXT_NEW_TITLE, TEXT_VENDOR);
     $this->tab_list[] = array('file' => 'template_addbook', 'tag' => 'addbook', 'order' => 20, 'text' => TEXT_ADDRESS_BOOK);
     $this->tab_list[] = array('file' => 'template_contacts', 'tag' => 'contacts', 'order' => 5, 'text' => TEXT_CONTACTS);
     $this->tab_list[] = array('file' => 'template_history', 'tag' => 'history', 'order' => 10, 'text' => TEXT_HISTORY);
     $this->tab_list[] = array('file' => 'template_notes', 'tag' => 'notes', 'order' => 40, 'text' => TEXT_NOTES);
     $this->tab_list[] = array('file' => 'template_general', 'tag' => 'general', 'order' => 1, 'text' => TEXT_GENERAL);
     parent::__construct();
 }
示例#7
0
文件: DB1.php 项目: polycste/Database
<?php

include "DBClass.php";
$cdb = new contacts();
// echo $cdb->insertInto('webcoached','UK','webcoachedbd.com','+34256788');
$cdb->selectFrom();
示例#8
0
     $result = $db->Execute("select id, short_name, contact_first, contact_middle, contact_last, account_number, gov_id_number \n\t\t\tfrom " . TABLE_CONTACTS . " where id = " . $result->fields['ref_id'] . " limit 1");
     $xml .= xmlEntry('contact_id', $result->fields['id']);
     $xml .= xmlEntry('short_name', $result->fields['short_name']);
     $xml .= xmlEntry('contact_middle', $result->fields['contact_middle']);
     $xml .= xmlEntry('contact_first', $result->fields['contact_first']);
     $xml .= xmlEntry('contact_last', $result->fields['contact_last']);
     $xml .= xmlEntry('account_number', $result->fields['account_number']);
     $xml .= xmlEntry('gov_id_number', $result->fields['gov_id_number']);
     break;
 case 'rm_address':
     $id = $_GET['aID'];
     $result = $db->Execute("select ref_id, type from " . TABLE_ADDRESS_BOOK . " where address_id = {$id}");
     if ($result->fields['type'] == 'im') {
         // it's a contact record, also delete record
         $short_name = gen_get_contact_name($id);
         $contact = new contacts();
         if ($contact->delete($result->fields['ref_id'])) {
             gen_add_audit_log(TEXT_CONTACTS . '-' . TEXT_DELETE . '-' . constant('ACT_' . strtoupper($type) . '_TYPE_NAME'), $short_name);
             $message[] = 'The record was successfully deleted!';
         } else {
             $message[] = ACT_ERROR_CANNOT_DELETE;
         }
     } else {
         // just delete the address
         $db->Execute('delete from ' . TABLE_ADDRESS_BOOK . " where address_id = {$id}");
     }
     $message[] = 'The record was successfully deleted!';
     $xml .= xmlEntry('address_id', $id);
     break;
 case 'get_payment':
     $id = $_GET['pID'];
示例#9
0
function mozillaSecondEmailDelete()
{
    if (!isset($_GET["uidUser"])) {
        $ct = new contacts($_SESSION["uid"], $_GET["employeeNumber"]);
    } else {
        $ct = new contacts($_SESSION["uid"], null, $_GET["uidUser"]);
    }
    $tpl = new templates();
    if (!$ct->mozillaSecondEmailDel($_GET["mozillaSecondEmailDelete"])) {
        echo $tpl->_ENGINE_parse_body("{$_GET["mozillaSecondEmail"]} {failed}\n");
    } else {
        echo $tpl->_ENGINE_parse_body("{$_GET["mozillaSecondEmail"]} {success}\n");
    }
}
示例#10
0
 /**
  * Отправляет email контакам из /siteadmin/contacts/. Вызвается из hourly.php.
  *
  * @return string возможная ошибка
  */
 public function SendMailToContacts()
 {
     require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/contacts.php';
     require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/users.php';
     $mails = contacts::GetMails();
     if ($mails) {
         $fromSave = $this->from;
         foreach ($mails as $mail) {
             $user = new users();
             $user->GetUser($user->GetField($mail['user_id'], $ee, 'login'));
             $this->subject = $mail['subject'];
             $attaches = array();
             if ($mail['attaches']) {
                 $files = preg_split('/,/', $mail['attaches']);
                 foreach ($files as $a) {
                     $attaches[] = new CFile('users/' . substr($user->login, 0, 2) . '/' . $user->login . '/upload/' . $a);
                 }
                 $attaches = $this->CreateAttach($attaches);
             }
             $contact_ids = preg_split('/,/', $mail['contact_ids']);
             foreach ($contact_ids as $contact_id) {
                 $contact = contacts::getContactInfo($contact_id);
                 if ($contact['emails']) {
                     $msg_text = $mail['message'];
                     $msg_text = preg_replace('/%CONTACT_NAME%/', $contact['name'], $msg_text);
                     $msg_text = preg_replace('/%CONTACT_SURNAME%/', $contact['surname'], $msg_text);
                     $msg_text = preg_replace('/%CONTACT_COMPANY%/', $contact['company'], $msg_text);
                     foreach ($contact['emails'] as $email) {
                         $this->from = '*****@*****.**';
                         $this->recipient = $contact['name'] . ' <' . $email . '>';
                         $this->message = $msg_text;
                         $this->SmtpMail('text/html', $attaches);
                     }
                 }
             }
             contacts::DeleteMail($mail['id']);
         }
         $this->from = $fromSave;
     }
     return '';
 }
示例#11
0
        			list($un,$qid)=split("_",$s_key);
        			$sval = $status_arr[$s_key];
        			*/
        $mysql = "update {$contacts_table} set status='No'";
        $db_object->insert($mysql);
        for ($i = 0; $i < count($status_arr); $i++) {
            $qid = $status_arr[$i];
            $mysql = "update {$contacts_table} set status='Yes' where contact_id='{$qid}'";
            $db_object->insert($mysql);
        }
        $message = $error_msg["cContactupdated"];
        echo $message;
        $this->show_contacts($db_object, $common, $form_array, $error_msg, $default);
    }
}
$obj = new contacts();
while (list($kk, $vv) = @each($_POST)) {
    ${$kk} = $vv;
    $form_array["{$kk}"] = $vv;
}
while (list($kk, $vv) = @each($_GET)) {
    ${$kk} = $vv;
    $form_array["{$kk}"] = $vv;
}
//	print_r($form_array);
if ($fContact_submit) {
    $obj->update_contacts($db_object, $common, $form_array, $error_msg, $default);
} else {
    $obj->show_contacts($db_object, $common, $form_array, $error_msg, $default);
}
include_once "footer.php";
示例#12
0
/**
* Изменение группы.
*
* @param    integer $id     идентификатор группы
* @param    string  $title  название группы
*/
function UpdateGroup($id, $title)
{
    session_start();
    $objResponse = new xajaxResponse();
    if (hasPermissions('ourcontacts')) {
        $title = trim(strip_tags(stripslashes($title)));
        if ($title == '' || strlen($title) > 50) {
            $objResponse->script("alert('Название группы не может быть пустым и должно быть менее 50 символов');");
        } else {
            contacts::updateGroup($id, $title);
            $objResponse->script('xajax_GetGroups();');
            $objResponse->script("alert('Группа успешно сохранена');");
        }
    }
    return $objResponse;
}
示例#13
0
    header("Location: page_read.php");
}
// use contact id in session variable in the delete contact method
if (isset($_POST['delete_contact'])) {
    $transfer = $_SESSION['transfer'];
    $new = new contacts('', '', '', '', '', '', '');
    //$new = new contacts($_POST['fname'],$_POST['lname'],$_POST['email'],$_POST['mobile'],$_POST['home'],$_POST['street'],$_POST['city']);
    $new->delete_contact();
    header("Location: page_read.php");
}
//acquire contact id from the get method and insert into a session variable  to be used for the auto fill method
if (isset($_GET['transfer'])) {
    $_SESSION['transfer'] = $_GET['transfer'];
    $transfer = $_SESSION['transfer'];
    echo $_SESSION['transfer'];
    $new = new contacts('', '', '', '', '', '', '');
    $new->auto_fill();
    list($fname, $lname, $email, $mobile, $home, $street, $city) = $new->auto_fill();
    if ($mobile == 0) {
        $mobile = "";
    }
    if ($home == 0) {
        $home = "";
    }
    if ($home == 0 && $street == 0 && $city == 0) {
        $home = "";
        $street = "";
        $city = "";
    }
    $_SESSION['fname'] = $fname;
    $_SESSION['lname'] = $lname;
示例#14
0
    case "delete":
        $id = $_GET["id"];
        delete_contact($id);
        header("Location: /contacts.php?action=list");
        break;
    case "edit":
        $id = $_GET["id"];
        if ($method === "GET") {
            contacts::displayEditContactForm($id);
        } elseif ($method === "POST") {
            contacts::handleEditContact($id);
        }
        break;
    case "view":
        $id = $_GET["id"];
        contacts::viewContact($id);
        break;
}
class contacts
{
    /*
    	lists contacts of current user with action buttons
    */
    public static function listContacts()
    {
        global $smarty, $user;
        $contacts = get_contact_list($user["id"]);
        $smarty->assign("contacts", $contacts);
        $smarty->display("contacts.list.tpl.html");
    }
    public static function displayAddContactForm($vars = array())
示例#15
0
文件: list.php 项目: yunsite/demila
<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['contacts']);
$cms = new contacts();
$data = $cms->getAll(START, LIMIT);
abr('data', $data);
$p = paging("?m=" . $_GET['m'] . "&c=list&p=", "", PAGE, LIMIT, $cms->foundRows);
abr('paging', $p);
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
示例#16
0
#LOAD WITHDRAW
require_once ROOT_PATH . '/apps/users/models/deposit.class.php';
$depositClass = new deposit();
$withdraw['no'] = $depositClass->getWithdrawCount(" `paid` = 'false' AND `datetime` > '" . date('Y-m') . "-01 00:00:00' ");
$withdraw['paid'] = $depositClass->getWithdrawCount(" `paid` = 'true' AND `paid_datetime` > '" . date('Y-m') . "-01 00:00:00' ");
abr('withdraw', $withdraw);
#LOAD THEMES
require_once ROOT_PATH . '/apps/items/models/items.class.php';
$itemsClass = new items();
$items = $itemsClass->getAll(0, 10, " `status` = 'queue' ");
abr('items', $items);
$updated_items = $itemsClass->getAllForUpdate(0, 10);
abr('updated_items', $updated_items);
#LOAD LAST REQUEST
require_once ROOT_PATH . '/apps/contacts/models/contacts.class.php';
$contactsClass = new contacts();
$lastContact = $contactsClass->getAll(0, 10, " `answer` = '' ");
abr('lastContact', $lastContact);
#CHECK FOR ATTRIBUTES
require_once ROOT_PATH . '/apps/attributes/models/categories.class.php';
$categoriesClass = new categories();
$attributes = $categoriesClass->getAll();
if (!is_array($attributes)) {
    abr('notHaveAttributes', 'true');
}
require_once ROOT_PATH . '/apps/reports/models/javascript.class.php';
$referal_sum = $ordersClass->getSalesStatusByDay(" AND `datetime` > '" . date('Y-m') . "-01 00:00:00' ", 'referal');
$sales_sum = $ordersClass->getSalesStatusByDay(" AND `datetime` > '" . date('Y-m') . "-01 00:00:00' ");
$referal_money = array();
$sales_money = array();
$user_money = array();
示例#17
0
<?php

//ini_set('display_errors',1);
$case = new cases();
$global_tasks = new GlobalTask();
$contacts = new contacts();
//$sql = $case->search_query( array('case_id' => $options['case_id'] ) );
$sql = "SELECT * FROM contacts WHERE contact_id = '" . $options['contact_id'] . "'";
$array = $this->db->fetch_assoc($this->db->query($sql));
$array['tasks'] = array();
$tasks = $global_tasks->search_flow_chart_tasks(array('module' => 'contacts', 'module_id' => $options['contact_id']));
foreach ($tasks as $n => $v) {
    //$v['name'] = $v['subject'];
    $v['task_type'] = 'global_task';
    $v['task_id'] = $v['chart_assign_id'];
    $v['access'] = $global_tasks->check_permitions($v);
    $v['options'] = $global_tasks->get_flowchart_options($v['flow_chart_id']);
    $array['tasks'][] = $v;
}
$array['activity'] = $this->get_activity_log_by_module('contacts', $options['contact_id']);
$array['followers'] = $this->follow->get_followers_by_module('contacts', $options['contact_id']);
$array['phone'] = $contacts->get_contact_phone($options['contact_id']);
$array['email'] = $contacts->get_contact_email($options['contact_id']);
$array['address'] = $contacts->get_contact_address($options['contact_id']);
$array['im'] = $contacts->get_contact_im($options['contact_id']);
if (array_key_exists($_SESSION['user_id'], $array['followers'])) {
    $array['following'] = true;
} else {
    $array['following'] = false;
}
$sql = $case->search_query(array('module_name' => 'contacts', 'module_id' => $options['contact_id']));
示例#18
0
文件: index.php 项目: yunsite/demila
#加载类别
$categoriesClass = new ccategories();
$categories = $categoriesClass->getAll(0, 0, " `visible` = 'true'");
abr('categories', $categories);
#发送联系支持请求
if (isset($_POST['action'])) {
    //验证码验证
    if (isset($_POST['verify'])) {
        if (empty($_POST['verify'])) {
            addErrorMessage($langArray['error_verify_invalid_empty'], '', 'error');
        }
        require_once ROOT_PATH . '/classes/Verify.class.php';
        $verify = new Verify();
        $yz_verify = $verify->check($_POST['verify'], 1);
        if (!$yz_verify) {
            addErrorMessage($langArray['error_invalid_verify'], '', 'error');
        } else {
            $contactsClass = new contacts();
            $s = $contactsClass->add();
            if ($s === true) {
                refresh('/' . $languageURL . 'support/', $langArray['complete_send_email'], 'complete');
            } else {
                addErrorMessage($langArray['error_all_fields_required'], '', 'error');
            }
        }
    } else {
        addErrorMessage($langArray['error_verify_invalid_empty'], '', 'error');
    }
}
#面包屑
abr('breadcrumb', '<a href="/' . $languageURL . '" title="">' . $langArray['home'] . '</a> \\ <a href="/' . $languageURL . 'contacts/" title="">' . $langArray['contacts'] . '</a>');
 function view($id, $tpl)
 {
     /*
     	Cosas que faltan por hacer:
     		De forma general, mirar los permisos del usuario que vaya a acceder aqui, para saber si tiene permisos de borrar editar ver etc...
     		Averiguar como pasar el numero de registros, si va a ser a grupos a grupos, si va a ser a modulos, a modulos
     		Order By (y mantener la b�squeda en el caso de que hubiera hecha una y averiguar la "pesta�a" a la que hace referencia)
     		Busquedas
     */
     $cadena = '';
     // Leemos la empresa y se lo pasamos a la plantilla
     $this->read($id);
     $tpl->assign('objeto', $this);
     $_SESSION['id_client'] = $this->id_client;
     //listado de contactos
     $tabla_contactos = new table(false);
     $contactos = new contacts();
     if ($contactos->get_list_contacts($_SESSION['id_client']) == 0) {
         $per = new permissions();
         $per->get_permissions_list('clients');
         $cadena = $cadena . $tabla_contactos->tabla_vacia('contacts', $per->add);
         $variables_empleados = $tabla_contactos->nombres_variables;
     } else {
         $per = new permissions();
         $per->get_permissions_list('clients');
         $cadena = $cadena . $tabla_contactos->make_tables('contacts', $contactos->contacts_list, array('Nombre', 20, 'Primer Apellido', 20, 'Segundo Apellido', 20), array('id_contact', 'name', 'last_name', 'last_name2'), $_SESSION['num_regs'], $per->permissions_module, $per->add);
         $variables_contactos = $tabla_contactos->nombres_variables;
     }
     $facturaspen = new table(false);
     $facturascob = new table(false);
     $albaranes = new table(false);
     $partes = new table(false);
     $cadena = $cadena . $facturaspen->dont_show('facturaspen');
     $cadena = $cadena . $facturascob->dont_show('facturascob');
     $cadena = $cadena . $albaranes->dont_show('albaranes');
     $cadena = $cadena . $partes->dont_show('partes');
     $variables_facturaspen = $facturaspen->nombres_variables;
     $variables_facturascob = $facturascobs->nombres_variables;
     $variables_albaranes = $albaranes->nombres_variables;
     $variables_partes = $partes->nombres_variables;
     $i = 0;
     while ($i < count($variables_contactos) + count($variables_facturaspen) + count($variables_facturascob) + count($variables_products) + count($variables_services) + count($variables_albaranes) + count($variables_partes)) {
         for ($j = 0; $j < count($variables_contactos); $j++) {
             $variables[$i] = $variables_contactos[$j];
             $i++;
         }
         for ($j = 0; $j < count($variables_facturaspen); $j++) {
             $variables[$i] = $variables_facturaspen[$j];
             $i++;
         }
         for ($j = 0; $j < count($variables_facturascob); $j++) {
             $variables[$i] = $variables_facturascob[$j];
             $i++;
         }
         for ($j = 0; $j < count($variables_albaranes); $j++) {
             $variables[$i] = $variables_albaranes[$j];
             $i++;
         }
         for ($j = 0; $j < count($variables_partes); $j++) {
             $variables[$i] = $variables_partes[$j];
             $i++;
         }
     }
     //Se comprueba si hay permiso para borrar o modificar
     $permisos_mod_del = new permissions();
     $permisos_mod_del->get_permissions_modify_delete('clients');
     $tpl->assign('acciones', $permisos_mod_del->per_mod_del);
     $tpl->assign('variables', $variables);
     $tpl->assign('cadena', $cadena);
     //
     return $tpl;
 }
示例#20
0
文件: index.php 项目: valkiki/karotte
<?php

require_once "controllers/controller.php";
require_once "models/model.php";
// Injection de dépendance, On envoi l'objet modèle au controller. Just for Fun.
$myModule = new contacts(new contactsModel());
$myModule->load($_REQUEST);
示例#21
0
    }
} else {
    hidden('customer_id');
}
if (!$selected_id) {
    unset($_POST['_tabs_sel']);
}
// force settings tab for new customer
tabbed_content_start('tabs', array('settings' => array(_('&General settings'), $selected_id), 'contacts' => array(_('&Contacts'), $selected_id), 'transactions' => array(_('&Transactions'), $selected_id), 'orders' => array(_('Sales &Orders'), $selected_id)));
switch (get_post('_tabs_sel')) {
    default:
    case 'settings':
        customer_settings($selected_id);
        break;
    case 'contacts':
        $contacts = new contacts('contacts', $selected_id, 'customer');
        $contacts->show();
        break;
    case 'transactions':
        $_GET['customer_id'] = $selected_id;
        $_GET['popup'] = 1;
        include_once $path_to_root . "/sales/inquiry/customer_inquiry.php";
        break;
    case 'orders':
        $_GET['customer_id'] = $selected_id;
        $_GET['popup'] = 1;
        include_once $path_to_root . "/sales/inquiry/sales_orders_view.php";
        break;
}
br();
tabbed_content_end();
示例#22
0
文件: view.php 项目: yunsite/demila
<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
_setView(__FILE__);
_setTitle($langArray['view']);
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
    refresh('?m=' . $_GET['m'] . '&c=list', 'INVALID ID', 'error');
}
if (!isset($_GET['p'])) {
    $_GET['p'] = '';
}
$cms = new contacts();
$data = $cms->get($_GET['id']);
if (isset($_POST['send'])) {
    $s = $cms->sendAnswer();
    if ($s === true) {
        refresh('?m=' . $_GET['m'] . '&c=list', $langArray['complete_answer_issue'], 'complete');
    } else {
        addErrorMessage($langArray['error_answer_issue'], '', 'error');
    }
}
$_POST = $data;
require_once ROOT_PATH . '/apps/lists/leftlist_admin.php';
示例#23
0
function ParseContacts($uid)
{
    if ($uid == "--all") {
        ParseAllcontacts();
        return;
    }
    $ct = new user($uid);
    $f = new zarafa_contacts();
    $f->connect(null, $ct->uid, $ct->password);
    $contacts = $f->ParseContacts();
    while (list($num, $contact) = each($contacts)) {
        if ($contact["email1"] == null) {
            continue;
        }
        $_contact = new contacts($ct->uid);
        $employeeNumber = $_contact->employeeNumberByEmail($contact["email1"]);
        if ($employeeNumber != null) {
            $_contact = new contacts($ct->uid, $employeeNumber);
            if ($_contact->modifyTimestamp == $contact["last_modification_time"]) {
                continue;
            }
        }
        $_contact->displayName = $contact["display_name"];
        $_contact->fileAs = $contact["fileas"];
        $_contact->givenName = $contact["given_name"];
        // First Name=$contact["gender"];
        $_contact->telephoneNumber = $contact["office_telephone_number"];
        $_contact->homePhone = $contact["home_telephone_number"];
        $_contact->homePostalAddress = $contact["home_address_street"] . ", {$contact["home_address_postal_code"]} {$contact["home_address_city"]} {$contact["home_address_state"]}  {$contact["home_address_country"]}";
        $_contact->street = $contact["business_street"];
        //$_contact->postOfficeBox=$contact["gender"];//Professional address
        $_contact->postalCode = $contact["business_postcode"];
        $_contact->postalAddress = $contact["business_street"];
        $_contact->l = $contact["business_city"];
        //	Business city
        $_contact->st = $contact["business_state"];
        //	Business state/province
        $_contact->c = $contact["business_country"];
        // 	Country
        $_contact->mail = $contact["email1"];
        $_contact->mobile = $contact["cellular_telephone_number"];
        $_contact->labeledURI = $contact["business_home_page"];
        // personal URL
        $_contact->modifyTimestamp = $contact["last_modification_time"];
        //when entry was modified
        $_contact->department = $contact["department_name"];
        $_contact->o = $contact["company_name"];
        $_contact->note = $contact["notes"];
        if (isset($contact["email2"])) {
            $_contact->mozillaSecondEmail[] = $contact["email2"];
        }
        if (isset($contact["email3"])) {
            $_contact->mozillaSecondEmail[] = $contact["email3"];
        }
        $_contact->mozillaNickname = $contact["nickname"];
        $_contact->facsimileTelephoneNumber = $contact["primary_fax_number"];
        $_contact->Fax = $contact["primary_fax_number"];
        $_contact->nsMSNid = $contact["IM1"];
        $_contact->businessRole = $contact["profession"];
        $_contact->managerName = $contact["manager_name"];
        $_contact->assistantName = $contact["assistant"];
        if (isset($contact["birthday"])) {
            $_contact->birthDate = date("Y-m-d", $contact["birthday"]);
        }
        $_contact->spouseName = $contact["spouse_name"];
        if (isset($contact["wedding_anniversary"])) {
            $_contact->anniversary = date("Y-m-d", $contact["wedding_anniversary"]);
        }
        $_contact->modifyTimestamp = $contact["last_modification_time"];
        $_contact->title = $contact["title"];
        //Working title, as opposed to personell title. e.g. "Project leader", etc.
        $_contact->sn = $contact["surname"];
        // Last Name=$contact["gender"];
        $_contact->NoExport = true;
        $_contact->Save();
        sleep(1);
    }
}
示例#24
0
文件: delete.php 项目: yunsite/demila
<?php

// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
define('USING_LANGUAGE', false);
require_once '../../../config.php';
require_once $config['root_path'] . '/core/functions.php';
include_once $config['system_core'] . "/initEngine.php";
admin_login();
if (isset($_POST['deleteMail']) && isset($_POST['id']) && isset($_SESSION['user']['access']['contacts'])) {
    require_once ROOT_PATH . "/apps/contacts/models/contacts.class.php";
    $cms = new contacts();
    $cms->delete(intval($_POST['id']));
    die(json_encode(array_merge($_POST, array('status' => 'true'))));
} elseif (isset($_POST['deleteCategory']) && isset($_POST['id']) && isset($_SESSION['user']['access']['contacts'])) {
    require_once ROOT_PATH . "/apps/contacts/models/ccategories.class.php";
    $cms = new ccategories();
    $cms->delete(intval($_POST['id']));
    die(json_encode(array_merge($_POST, array('status' => 'true'))));
}
echo json_encode(array_merge($_POST, array('status' => 'unknown error')));
die;