示例#1
0
<?php

require_once "../lib/model/Contacts.php";
require_once "../lib/model/Locations.php";
require_once "../lib/model/Venues.php";
require_once "../lib/model/Users.php";
require_once "../lib/model/Suggestions.php";
$app->get('/api/contacts/', function () {
    $cn = new Contacts();
    $cn->getContacts();
});
$app->post('/api/contacts/', function () use($app) {
    $req = $app->request();
    $bdy = $req->getBody();
    $contact = json_decode($bdy);
    $cn = new Contacts();
    $cn->insertContact($contact[0]);
});
$app->get('/api/contacts/:id', function ($id) {
    $cn = new Contacts();
    $cn->getContactsById($id);
});
$app->put('/api/contacts/:id', function ($id) use($app) {
    $req = $app->request();
    $bdy = $req->getBody();
    $contact = json_decode($bdy);
    $cn = new Contacts();
    $cn->updateContact($id, $contact[0]);
});
$app->delete('/api/contacts/:id', function ($id) {
    $cn = new Contacts();
示例#2
0
 /**
  * contactsGrid
  * Get all the contacts of the customer
  * @return unknown_type
  */
 private function contactsGrid($customer_id)
 {
     if (is_numeric($customer_id)) {
         $rs = Contacts::getContacts($customer_id);
         if (isset($rs)) {
             return array('records' => $rs, 'delete' => array('controller' => 'profile', 'action' => 'deletecontact'));
         }
     }
 }
 /** Display the index page
  */
 public function indexAction()
 {
     $contacts = new Contacts();
     $this->view->contacts = $contacts->getContacts($this->_getParam('page'));
 }
示例#4
0
 private function contactsGrid()
 {
     $request = Zend_Controller_Front::getInstance()->getRequest();
     if (isset($request->id) && is_numeric($request->id)) {
         $rs = Contacts::getContacts($request->id);
         if (isset($rs)) {
             $columns[] = $this->translator->translate('Contacts');
             $columns[] = $this->translator->translate('Type');
             return array('name' => 'contacts', 'columns' => $columns, 'records' => $rs, 'delete' => array('controller' => 'customers', 'action' => 'deletecontact'));
         }
     }
 }