/**
  * Extracts attribute contents FROM a parent tree object
  *
  * @param array  $tree an array containing an array FROM which the
  *                     object data should be extracted
  * @param string $ver  represents the version of the GEDCOM standard
  *                     data is being extracted from
  *
  * @return void
  *
  * @access public
  * @since Method available since Release 0.0.1
  */
 protected function parse_tree_detail($tree, $ver)
 {
     if (($i1 = parent::find_tag($tree, Rp_Tags::TYPE)) !== false) {
         $this->type = parent::parse_text($tree[$i1], Rp_Tags::TYPE);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::DATE)) !== false) {
         $this->date = parent::parse_text($tree[$i1], Rp_Tags::DATE);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::ADDRESS)) !== false) {
         $this->address->parse_tree(array($tree[$i1]), $ver);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::PLACE)) !== false) {
         $this->place->parse_tree(array($tree[$i1]), $ver);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::RELIGION)) !== false) {
         $this->religious_affiliation = parent::parse_text($tree[$i1], Rp_Tags::RELIGION);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::AGENCY)) !== false) {
         $this->resp_agency = parent::parse_text($tree[$i1], Rp_Tags::AGENCY);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::AGE)) !== false) {
         $this->age = parent::parse_text($tree[$i1], Rp_Tags::AGE);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::RESTRICTION)) !== false) {
         $this->restriction = parent::parse_text($tree[$i1], Rp_Tags::RESTRICTION);
     }
     if (($i1 = parent::find_tag($tree, Rp_Tags::CAUSE)) !== false) {
         $this->cause = parent::parse_text($tree[$i1], Rp_Tags::CAUSE);
     }
     if (isset($this->place)) {
         $this->place->parse_tree($tree, $ver);
     }
     if (isset($this->address)) {
         $this->address->parse_tree($tree, $ver);
     }
     $off = 0;
     while (($i1 = parent::find_tag($tree, Rp_Tags::CITE, $off)) !== false) {
         $tmp = new RP_Citation();
         $tmp->parse_tree(array($tree[$i1]), $ver);
         $this->citations[] = $tmp;
         $off = $i1 + 1;
     }
     $off = 0;
     while (($i1 = parent::find_tag($tree, Rp_Tags::MEDIA, $off)) !== false) {
         $tmp = new RP_Media_Link();
         $tmp->parse_tree(array($tree[$i1]), $ver);
         $this->media_links[] = $tmp;
         $off = $i1 + 1;
     }
     $off = 0;
     while (($i1 = parent::find_tag($tree, Rp_Tags::NOTE, $off)) !== false) {
         $tmp = new RP_Note();
         $tmp->parse_tree(array($tree[$i1]), $ver);
         $this->notes[] = $tmp;
         $off = $i1 + 1;
     }
 }
 /**
  * Create the XAV request
  *
  * @return string
  */
 private function createRequest()
 {
     $xml = new DOMDocument();
     $xml->formatOutput = true;
     $avRequest = $xml->appendChild($xml->createElement("AddressValidationRequest"));
     $avRequest->setAttribute('xml:lang', 'en-US');
     $request = $avRequest->appendChild($xml->createElement("Request"));
     $node = $xml->importNode($this->createTransactionNode(), true);
     $request->appendChild($node);
     $request->appendChild($xml->createElement("RequestAction", "XAV"));
     if (null !== $this->requestOption) {
         $request->appendChild($xml->createElement("RequestOption", $this->requestOption));
     }
     if (null !== $this->maxSuggestion) {
         $avRequest->appendChild($xml->createElement("MaximumListSize", $this->maxSuggestion));
     }
     if (null !== $this->address) {
         $addressNode = $avRequest->appendChild($xml->createElement("AddressKeyFormat"));
         if ($this->address->getAttentionName()) {
             $addressNode->appendChild($xml->createElement("ConsigneeName", $this->address->getAttentionName()));
         }
         if ($this->address->getBuildingName()) {
             $addressNode->appendChild($xml->createElement("BuildingName", $this->address->getBuildingName()));
         }
         if ($this->address->getAddressLine1()) {
             $addressNode->appendChild($xml->createElement("AddressLine", $this->address->getAddressLine1()));
         }
         if ($this->address->getAddressLine2()) {
             $addressNode->appendChild($xml->createElement("AddressLine", $this->address->getAddressLine2()));
         }
         if ($this->address->getAddressLine3()) {
             $addressNode->appendChild($xml->createElement("AddressLine", $this->address->getAddressLine3()));
         }
         if ($this->address->getStateProvinceCode()) {
             $addressNode->appendChild($xml->createElement("PoliticalDivision2", $this->address->getStateProvinceCode()));
         }
         if ($this->address->getCity()) {
             $addressNode->appendChild($xml->createElement("PoliticalDivision1", $this->address->getCity()));
         }
         if ($this->address->getCountryCode()) {
             $addressNode->appendChild($xml->createElement("CountryCode", $this->address->getCountryCode()));
         }
         if ($this->address->getPostalCode()) {
             $addressNode->appendChild($xml->createElement("PostcodePrimaryLow", $this->address->getPostalCode()));
         }
     }
     return $xml->saveXML();
 }
 /**
  * Extracts attribute contents FROM a parent tree object
  *
  * @param array  $tree an array containing an array FROM which the
  *                     object data should be extracted
  * @param string $ver  represents the version of the GEDCOM standard
  *                     data is being extracted from
  *
  * @return void
  *
  * @access public
  * @since Method available since Release 0.0.1
  */
 public function parse_tree($tree, $ver)
 {
     $this->id = parent::parse_ref_id($tree[0], Rp_Tags::REPOSITORY);
     if (isset($tree[0][1])) {
         $sub2 = $tree[0][1];
         if (($i1 = parent::find_tag($sub2, Rp_Tags::NAME)) !== false) {
             $this->name = parent::parse_text($sub2[$i1], Rp_Tags::NAME);
         }
         $this->address->parse_tree($sub2, $ver);
         $this->user_file_parse_tree($sub2, $ver);
         $this->auto_rec_parse_tree($sub2, $ver);
         $this->change_date_parse_tree($sub2, $ver);
         $off = 0;
         while (($i1 = parent::find_tag($sub2, Rp_Tags::NOTE, $off)) !== false) {
             $tmp = new RP_Note();
             $tmp->parse_tree(array($sub2[$i1]), $ver);
             $this->notes[] = $tmp;
             $off = $i1 + 1;
         }
     }
 }
 /**
  * Extracts attribute contents FROM a parent tree object
  *
  * @param array  $tree an array containing an array FROM which the
  *                     object data should be extracted
  * @param string $ver  represents the version of the GEDCOM standard
  *                     data is being extracted from
  *
  * @return void
  *
  * @access public
  * @since Method available since Release 0.0.1
  */
 public function parse_tree($tree, $ver)
 {
     $this->id = parent::parse_ref_id($tree[0], Rp_Tags::SUBMITTER);
     if (isset($tree[0][1])) {
         $sub2 = $tree[0][1];
         if (($i1 = parent::find_tag($sub2, Rp_Tags::NAME)) !== false) {
             $this->name = parent::parse_text($sub2[$i1], Rp_Tags::NAME);
         }
         $this->address->parse_tree($sub2, $ver);
         $off = 0;
         while (($i1 = parent::find_tag($sub2, Rp_Tags::MEDIA, $off)) !== false) {
             $tmp = new RP_Media_Link();
             $tmp->parse_tree(array($sub2[$i1]), $ver);
             $this->media_links[] = $tmp;
             $off = $i1 + 1;
         }
         if (($i1 = parent::find_tag($sub2, Rp_Tags::LANGUAGE)) !== false) {
             $this->language = parent::parse_text($sub2[$i1], Rp_Tags::LANGUAGE);
         }
         if (($i1 = parent::find_tag($sub2, Rp_Tags::RFN)) !== false) {
             $this->submitter_ref_nbr = parent::parse_text($sub2[$i1], Rp_Tags::RFN);
         }
         if (($i1 = parent::find_tag($sub2, Rp_Tags::AUTORECID)) !== false) {
             $this->auto_rec_id = parent::parse_text($sub2[$i1], Rp_Tags::AUTORECID);
         }
         if (($i1 = parent::find_tag($sub2, Rp_Tags::CHANGEDATE)) !== false) {
             $this->change_date->parse_tree(array($sub2[$i1]), $ver);
         }
         $off = 0;
         while (($i1 = parent::find_tag($sub2, Rp_Tags::NOTE, $off)) !== false) {
             $tmp = new RP_Note();
             $tmp->parse_tree(array($sub2[$i1]), $ver);
             $this->notes[] = $tmp;
             $off = $i1 + 1;
         }
     }
 }
 function createaddress()
 {
     global $db, $user;
     if ($user->isLoggedIn()) {
         // save the address, make it default if it is the users first one
         $address = new address();
         $count = $address->find('count', 'user_id=' . $user->id);
         if ($count == 0) {
             $this->params['is_default'] = 1;
         }
         $this->params['user_id'] = $user->id;
         $address->update($this->params);
         // set the billing/shipping method
         if (isset($this->params['addresstype'])) {
             if ($this->params['addresstype'] == 'shipping') {
                 $shipping = new shipping();
                 $shipping->shippingmethod->setAddress($address);
             } elseif ($this->params['addresstype'] == 'billing') {
                 $billing = new billing();
                 $billing->billingmethod->setAddress($address);
             }
         }
     }
     redirect_to(array('controller' => 'cart', 'action' => 'checkout'));
 }
Exemple #6
0
 /**
  * Sett adresse
  * 
  * @param string path to file $path
  */
 private function set_path($path)
 {
     if (($pos = mb_strpos($path, "?")) !== false) {
         $path = mb_substr($path, 0, $pos);
     }
     self::$path = $path;
 }
Exemple #7
0
<?php

defined('DT_ADMIN') or exit('Access Denied');
require MD_ROOT . '/address.class.php';
$do = new address();
$menus = array(array('地址列表', '?moduleid=' . $moduleid . '&file=' . $file));
switch ($action) {
    case 'edit':
        $itemid or msg();
        $do->itemid = $itemid;
        if ($submit) {
            if ($do->pass($post)) {
                $do->edit($post);
                dmsg('修改成功', $forward);
            } else {
                msg($do->errmsg);
            }
        } else {
            extract($do->get_one());
            include tpl('address_edit', $module);
        }
        break;
    case 'delete':
        $itemid or msg('请选择地址');
        $do->delete($itemid);
        dmsg('删除成功', $forward);
        break;
    default:
        $sfields = array('按条件', '姓名', '地址', '邮编', '手机', '电话', '会员', '备注');
        $dfields = array('address', 'truename', 'address', 'postcode', 'mobile', 'telephone', 'username', 'note');
        isset($fields) && isset($dfields[$fields]) or $fields = 0;
?>
        <i class="fa fa-search tax_region_id select_popup clickable"></i></li>
        <li><?php 
$f->l_text_field_d('description');
?>
    </li>
        <li><?php 
$f->l_status_field_d('status');
?>
</li>
        <li><?php 
$f->l_checkBox_field_d('default_cb');
?>
</li>
        <li><?php 
$f->l_select_field_from_object('usage_type', address::address_usage_type(), 'option_line_code', 'option_line_value', $address->usage_type, 'usage_type', '', '', $readonly);
?>
    </li>
        <?php 
if (!empty($_GET) && isset($_GET['window_type']) && ($_GET['window_type'] = 'popup')) {
    echo $f->hidden_field_withId('window_type', 'popup');
    echo '<li><label></label><button  class="quick_select button btn btn-success">Select Address</button></li>';
}
?>
       </ul>
     </div>
     <div id="tabsHeader-2" class="tabContent">
      <div> <?php 
echo ino_attachement($file);
?>
 </div>
Exemple #9
0
<?php

include_once 'config.php';
include_once 'functions.php';
include_once 'inc/class-fccdb.php';
include_once 'inc/class-user.php';
$fccdb = new fccdb();
session_start();
if (!empty($_POST['mail']) && !empty($_POST['pw']) && ($u = user::login($_POST['mail'], $_POST['pw']))) {
    include_once 'inc/class-address.php';
    $_SESSION['user_id'] = $u->user_id;
    $_SESSION['user_email'] = $u->user_email;
    $_SESSION['user_name_first'] = $u->user_name_first;
    $_SESSION['user_name_last'] = $u->user_name_last;
    $_SESSION['user_address'] = address::get_instance($u->user_address);
    $_SESSION['user_company'] = $u->user_company;
    $_SESSION['user_level'] = $u->user_level;
    header('Location: ' . ($_REQUEST['goto'] ?: './user/' . $u->user_id));
} else {
    global $the_title;
    $the_title = 'Login';
    include_once 'header.php';
    ?>
<div class="content-area container" id="primary">
  <div class="row">
    <div class="site-content col-xs-12" id="content">
      <div class="row">
        <div class="col-xs-12 col-sm-12 hidden-md hidden-lg">
        </div>

Exemple #10
0
 public function __construct()
 {
     global $order, $user;
     if (empty($order->id)) {
         return false;
     }
     $existing_shippingmethods = $order->getShippingMethods();
     $this->available_calculators = $this->listAvailableCalculators();
     $this->selectable_calculators = $this->selectableCalculators();
     if (count($existing_shippingmethods) == 1) {
         if ($order->forcedShipping()) {
             $this->shippingmethod = $order->getForcedShippingMethod();
             $this->forced_shipping = true;
         } else {
             $this->shippingmethod = $order->getCurrentShippingMethod();
         }
         // if this shippingmethod doesn't have an address assigned to it, lets check and see if this
         // user has set one up yet and default to that if so
         //if (empty($this->shippingmethod->addresses_id) && $user->isLoggedIn()) {
         if ($user->id != 0) {
             $address = new address();
             $addy = $address->find('first', 'user_id=' . $user->id . '  AND is_shipping=1');
             if (empty($addy->id)) {
                 $addy = $address->find('first', 'user_id=' . $user->id);
             }
             if (!empty($addy->id)) {
                 $this->shippingmethod->setAddress($addy);
             }
         }
         $this->address = new address($this->shippingmethod->addresses_id);
         $number_of_calculators = count($this->available_calculators);
         if ($number_of_calculators == 1 || empty($this->shippingmethod->shippingcalculator_id)) {
             $calcid = key($this->available_calculators);
             if ($this->shippingmethod->shippingcalculator_id != $calcid) {
                 $this->shippingmethod->update(array('shippingcalculator_id' => $calcid));
             }
         }
         if (!empty($this->available_calculators) && !empty($this->shippingmethod->shippingcalculator_id)) {
             if (isset($this->available_calculators[$this->shippingmethod->shippingcalculator_id])) {
                 $calcname = $this->available_calculators[$this->shippingmethod->shippingcalculator_id];
             } else {
                 //recently reconfigured/disabled shipping calc that was already set in the object, so default to the first one available
                 $key = array_shift(array_keys($this->available_calculators));
                 $calcname = $this->available_calculators[$key];
                 $this->shippingmethod->shippingcalculator_id = $key;
             }
             $this->calculator = new $calcname($this->shippingmethod->shippingcalculator_id);
         } else {
             $this->calculator = null;
         }
         $this->getRates();
     } else {
         eDebug($this);
         eDebug($order);
         eDebug("Error in shipping constuctor.", true);
         //NO split shipping for now
         /*$this->splitshipping = true;
           $this->splitmethods = array();
           foreach ($existing_shippingmethods as $smid) {
               $method = new shippingmethod($smid);
               if ($method->requiresShipping()) {
                   $this->splitmethods[$method->id] = $method;
                   $this->splitmethods[$method->id]->orderitem = $order->getOrderitemsByShippingmethod($method->id);
               }
               
           } */
     }
 }
 public function viewuser()
 {
     $u = new user($this->params['id']);
     $address = new address();
     $billings = $address->find('all', 'user_id=' . $u->id . ' AND is_billing = 1');
     $shippings = $address->find('all', 'user_id=' . $u->id . ' AND is_shipping = 1');
     // build out a SQL query that gets all the data we need and is sortable.
     $sql = 'SELECT o.*, b.firstname as firstname, b.billing_cost as total, b.middlename as middlename, b.lastname as lastname, os.title as status, ot.title as order_type ';
     $sql .= 'FROM ' . DB_TABLE_PREFIX . '_orders o, ' . DB_TABLE_PREFIX . '_billingmethods b, ';
     $sql .= DB_TABLE_PREFIX . '_order_status os, ';
     $sql .= DB_TABLE_PREFIX . '_order_type ot ';
     $sql .= 'WHERE o.id = b.orders_id AND o.order_status_id = os.id AND o.order_type_id = ot.id AND o.purchased > 0 AND user_id =' . $u->id;
     $limit = empty($this->config['limit']) ? 50 : $this->config['limit'];
     //eDebug($sql, true);
     $orders = new expPaginator(array('controller' => $this->params['controller'], 'action' => $this->params['action'], 'sql' => $sql, 'order' => 'purchased', 'dir' => 'DESC', 'limit' => $limit, 'columns' => array('Order #' => 'invoice_id', 'Total' => 'total', 'Date Purchased' => 'purchased', 'Type' => 'order_type_id', 'Status' => 'order_status_id', 'Ref' => 'orig_referrer')));
     assign_to_template(array('u' => $u, 'billings' => $billings, 'shippings' => $shippings, 'orders' => $orders));
 }
         <a name="show" href="form.php?class_name=pos_terminal&<?php 
echo "mode={$mode}";
?>
" class="show document_id pos_terminal_id">
          <i class="fa fa-refresh"></i></a> 
        </li>
        <li><?php 
$f->l_select_field_from_object('sd_store_id', sd_store::find_all(), 'sd_store_id', 'store_name', ${$class}->sd_store_id, 'sd_store_id', '', 1, $readonly);
?>
    </li>
        <li><?php 
$f->l_text_field_dm('terminal_name');
?>
</li>
        <li><?php 
$f->l_select_field_from_object('location_id', address::find_all(), 'address_id', 'address_name', ${$class}->location_id, 'location_id');
?>
    </li>
        <li><?php 
$f->l_text_field_d('description');
?>
</li>
        <li><?php 
$f->l_status_field_d('status');
?>
    </li>
       </ul>
      </div>
     </div>
     <div id="tabsHeader-2" class="tabContent">
      <div> <?php 
Exemple #13
0
<?php

include 'class.add.php';
include 'class.database.php';
include 'class.addressresidence.php';
include 'class.addressBusiness.php';
include "class.addressPark.php";
echo '<h3>Instant AddressResidence</h3>';
$Address_residence = new addressResidence();
echo '<h3>Setting prperties</h3>';
$Address_residence->street_address_1 = "12,ward no 15 new abadi ";
$Address_residence->city_name = "Mandalgarh";
$Address_residence->subdivision_name = "Bhilwara";
$Address_residence->country = "INDIA";
$Address_residence->address_type_id = 1;
echo $Address_residence;
echo '<tt><pre>' . var_export($Address_residence, TRUE) . '</pre></tt>';
echo '<h3>Testing address __ construct with an array  </h3>';
$Address_business = new addressBusiness(array('street_address_1' => " 123,rana nagar , pata chock,", 'city_name' => "hiran mangri", 'subdivision_name' => 'udaipur', 'country' => 'INDIA'));
echo $Address_business;
echo '<tt><pre>' . var_export($Address_business, TRUE) . '</pre></tt>';
echo '<h3>Testing address __ construct with an array  </h3>';
$Address_park = new addressPark(array('street_address_1' => " 789,azad nagar , BhagatSingh chok,", 'city_name' => "hiran mangri", 'subdivision_name' => 'udaipur', 'country' => 'BHARAT'));
echo $Address_park;
echo '<tt><pre>' . var_export($Address_park, TRUE) . '</pre></tt>';
echo '<h3>Load from Database</h3>';
$address_db = address::shanu(1);
echo '<tt><pre>' . var_export($address_db, TRUE) . '</pre></tt>';
?>

Exemple #14
0
 /**
  * 添加关系
  */
 public static final function append()
 {
     $error = array();
     $online = front::online();
     $get = array('s_type' => isset($_GET['s_type']) ? $_GET['s_type'] : '', 't_type' => isset($_GET['t_type']) ? $_GET['t_type'] : '', 's_id' => isset($_GET['s_id']) ? (int) $_GET['s_id'] : '0', 't_id' => isset($_GET['t_id']) ? (int) $_GET['t_id'] : '0');
     $s_list = null;
     if ($get['s_type'] == 'channel') {
         $s_list = channel::get_channel_select(0, 0, $get['s_id'], null, null);
     } elseif ($get['s_type'] == 'address') {
         $s_lists = address::selects('address_id as id,name', null, array('user_id' => $online->user_id), array('ORDER BY address_id DESC'), array('id', 'column|table=address' => 'name'));
         if ($s_lists) {
             $s_list = make_option($s_lists, $get['s_id']);
         }
     } elseif ($get['s_type'] == 'book') {
         $s_lists = book::selects('book_id as id,concat_ws(\',\',create_date,item_txt,remark,ccy,amount,otype) as name', null, array('user_id' => $online->user_id), array('ORDER BY create_date DESC,book_id DESC'), array('id', 'column|table=book' => 'name'));
         if ($s_lists) {
             $s_list = make_option($s_lists, $get['s_id']);
         }
     } elseif ($get['s_type'] == 'diary') {
         $s_lists = diary::selects('diary_id as id,title as name', null, array('user_id' => $online->user_id), array('ORDER BY diary_id DESC'), array('id', 'column|table=diary' => 'name'));
         if ($s_lists) {
             $s_list = make_option($s_lists, $get['s_id']);
         }
     } elseif ($get['s_type'] == 'doc') {
         $s_lists = doc::selects('doc_id as id,title as name', null, array('user_id' => $online->user_id), array('ORDER BY doc_id DESC'), array('id', 'column|table=doc' => 'name'));
         if ($s_lists) {
             $s_list = make_option($s_lists, $get['s_id']);
         }
     } elseif ($get['s_type'] == 'site') {
         $s_lists = site::selects('site_id as id,title as name', null, array('user_id' => $online->user_id), array('ORDER BY site_id DESC'), array('id', 'column|table=site' => 'name'));
         if ($s_lists) {
             $s_list = make_option($s_lists, $get['s_id']);
         }
     } elseif ($get['s_type'] == 'user') {
         $s_lists = user::selects('user_id as id,username as name', null, array('user_id' => $online->user_id), array('ORDER BY user_id DESC'), array('id', 'column|table=user' => 'name'));
         if ($s_lists) {
             $s_list = make_option($s_lists, $get['s_id']);
         }
     } else {
     }
     $t_list = null;
     if ($get['t_type'] == 'channel') {
         $t_list = channel::get_channel_select(0, 0, $get['t_id'], null, null);
     } elseif ($get['t_type'] == 'address') {
         $t_lists = address::selects('address_id as id,name', null, array('user_id' => $online->user_id), array('ORDER BY address_id DESC'), array('id', 'column|table=address' => 'name'));
         if ($t_lists) {
             $t_list = make_option($t_lists, $get['t_id']);
         }
     } elseif ($get['t_type'] == 'book') {
         $t_lists = book::selects('book_id as id,concat_ws(\',\',create_date,item_txt,remark,ccy,amount,otype) as name', null, array('user_id' => $online->user_id), array('ORDER BY create_date DESC,book_id DESC'), array('id', 'column|table=book' => 'name'));
         if ($t_lists) {
             $t_list = make_option($t_lists, $get['t_id']);
         }
     } elseif ($get['t_type'] == 'diary') {
         $t_lists = diary::selects('diary_id as id,title as name', null, array('user_id' => $online->user_id), array('ORDER BY diary_id DESC'), array('id', 'column|table=diary' => 'name'));
         if ($t_lists) {
             $t_list = make_option($t_lists, $get['t_id']);
         }
     } elseif ($get['t_type'] == 'doc') {
         $t_lists = doc::selects('doc_id as id,title as name', null, array('user_id' => $online->user_id), array('ORDER BY doc_id DESC'), array('id', 'column|table=doc' => 'name'));
         if ($t_lists) {
             $t_list = make_option($t_lists, $get['t_id']);
         }
     } elseif ($get['t_type'] == 'site') {
         $t_lists = site::selects('site_id as id,title as name', null, array('user_id' => $online->user_id), array('ORDER BY site_id DESC'), array('id', 'column|table=site' => 'name'));
         if ($t_lists) {
             $t_list = make_option($t_lists, $get['t_id']);
         }
     } elseif ($get['t_type'] == 'user') {
         $t_lists = user::selects('user_id as id,username as name', null, array('user_id' => $online->user_id), array('ORDER BY user_id DESC'), array('id', 'column|table=user' => 'name'));
         if ($t_lists) {
             $t_list = make_option($t_lists, $get['t_id']);
         }
     } else {
     }
     // 表单处理
     while (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST') {
         // 数据消毒
         $post = array('s_type' => isset($_POST['s_type']) ? $_POST['s_type'] : '', 't_type' => isset($_POST['t_type']) ? $_POST['t_type'] : '', 's_id' => isset($_POST['s_id']) ? (int) $_POST['s_id'] : '0', 't_id' => isset($_POST['t_id']) ? (int) $_POST['t_id'] : '0', 'user_id' => $online->user_id);
         if (!$post['s_type']) {
             $error['s_type'] = '请选择源类型';
         }
         if (!$post['t_type']) {
             $error['t_type'] = '请选择目标类型';
         }
         if (!$post['s_id']) {
             $error['s_id'] = '请选择源内容';
         }
         if (!$post['t_id']) {
             $error['t_id'] = '请选目标内容';
         }
         if (!$error['t_id']) {
             if ($post['s_type'] == $post['t_type'] && $post['s_id'] == $post['t_id']) {
                 $error['t_id'] = '不能和自己关联';
             }
         }
         if (!$error['t_id']) {
             $related_id = self::selects('related_id', null, array('user_id' => $online->user_id, 's_id' => $post['s_id'], 's_type' => $post['s_type'], 't_id' => $post['t_id'], 't_type' => $post['t_type']), null, array('column' => 'related_id'));
             if (!$related_id) {
                 $related_id = self::selects('related_id', null, array('user_id' => $online->user_id, 's_id' => $post['t_id'], 's_type' => $post['t_type'], 't_id' => $post['s_id'], 't_type' => $post['s_type']), null, array('column' => 'related_id'));
             }
             if ($related_id) {
                 $error['t_id'] = '目标内容已经关联,请重新选择';
             }
         }
         if (!empty($error)) {
             break;
         }
         // 数据入库
         $related = new self();
         $related->related_id = null;
         $related->struct($post);
         $related->insert();
         $error = '添加成功';
         front::view2('error.tpl', compact('error'));
         return;
     }
     $types = array('address' => '地址', 'book' => '账本', 'channel' => '分类', 'diary' => '日志', 'doc' => '文章', 'site' => '网址', 'user' => '用户');
     front::view2(__CLASS__ . '.' . 'form.tpl', compact('post', 'get', 'error', 'types', 's_list', 't_list'));
 }
    /**
     * main routine to convert old school module data into new controller format
     * @global db the exponent database object
     * @param  $iloc
     * @param  $module
     * @param int $hc
     * @return
     */
    private function convert($iloc, $module, $hc = 0)
    {
        if (!array_key_exists($iloc->mod, $this->params['migrate'])) {
            return $module;
        }
        global $db;
        $old_db = $this->connect();
        $linked = false;
        $loc = null;
        switch ($iloc->mod) {
            case 'textmodule':
                @($module->view = 'showall');
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "text";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'textmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'textmodule';
                $textitems = $old_db->selectObjects('textitem', "location_data='" . serialize($iloc) . "'");
                if ($textitems) {
                    foreach ($textitems as $ti) {
                        $text = new text();
                        $loc = expUnserialize($ti->location_data);
                        $loc->mod = "text";
                        $text->location_data = serialize($loc);
                        $text->body = $ti->text;
                        $text->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'rotatormodule':
                $module->action = 'showRandom';
                $module->view = 'showRandom';
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "text";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'rotatormodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'rotatormodule';
                $textitems = $old_db->selectObjects('rotator_item', "location_data='" . serialize($iloc) . "'");
                if ($textitems) {
                    foreach ($textitems as $ti) {
                        $text = new text();
                        $loc = expUnserialize($ti->location_data);
                        $loc->mod = "text";
                        $text->location_data = serialize($loc);
                        $text->body = $ti->text;
                        $text->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'snippetmodule':
                $module->view = 'showall';
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "snippet";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'snippetmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'snippetmodule';
                $textitems = $old_db->selectObjects('textitem', "location_data='" . serialize($iloc) . "'");
                if ($textitems) {
                    foreach ($textitems as $ti) {
                        $text = new snippet();
                        $loc = expUnserialize($ti->location_data);
                        $loc->mod = "snippet";
                        $text->location_data = serialize($loc);
                        $text->body = $ti->text;
                        // if the item exists in the current db, we won't save it
                        $te = $text->find('first', "location_data='" . $text->location_data . "'");
                        if (empty($te)) {
                            $text->save();
                            @$this->msg['migrated'][$iloc->mod]['count']++;
                            @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                        }
                    }
                }
                break;
            case 'linklistmodule':
                switch ($module->view) {
                    case 'Quick Links':
                        @($module->view = "showall_quicklinks");
                        break;
                    default:
                        @($module->view = 'showall');
                        break;
                }
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "links";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'linklistmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'linklistmodule';
                $links = $old_db->selectArrays('linklist_link', "location_data='" . serialize($iloc) . "'");
                if ($links) {
                    foreach ($links as $link) {
                        $lnk = new links();
                        $loc = expUnserialize($link['location_data']);
                        $loc->mod = "links";
                        $lnk->title = !empty($link['name']) ? $link['name'] : 'Untitled';
                        $lnk->body = $link['description'];
                        $lnk->new_window = $link['opennew'];
                        $lnk->url = !empty($link['url']) ? $link['url'] : '#';
                        $lnk->rank = $link['rank'];
                        $lnk->poster = 1;
                        $lnk->editor = 1;
                        $lnk->location_data = serialize($loc);
                        $lnk->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'linkmodule':
                // user mod, not widely distributed
                switch ($module->view) {
                    case 'Summary':
                        @($module->view = "showall_quicklinks");
                        break;
                    default:
                        @($module->view = 'showall');
                        break;
                }
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "links";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'linkmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'linkmodule';
                $links = $old_db->selectArrays('link', "location_data='" . serialize($iloc) . "'");
                $oldconfig = $old_db->selectObject('linkmodule_config', "location_data='" . serialize($iloc) . "'");
                if ($links) {
                    foreach ($links as $link) {
                        $lnk = new links();
                        $loc = expUnserialize($link['location_data']);
                        $loc->mod = "links";
                        $lnk->title = !empty($link['name']) ? $link['name'] : 'Untitled';
                        $lnk->body = $link['description'];
                        $lnk->new_window = $link['opennew'];
                        $lnk->url = !empty($link['url']) ? $link['url'] : '#';
                        $lnk->rank = $link['rank'];
                        $lnk->poster = 1;
                        $lnk->editor = 1;
                        $lnk->location_data = serialize($loc);
                        $lnk->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                    if ($oldconfig->enable_rss == 1) {
                        $config['enable_rss'] = true;
                        $config['feed_title'] = $oldconfig->feed_title;
                        $config['feed_desc'] = $oldconfig->feed_desc;
                        $config['rss_limit'] = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $config['rss_cachetime'] = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newconfig = new expConfig();
                        $newconfig->config = $config;
                        $newconfig->location_data = $loc;
                        $newconfig->save();
                        $newrss = new expRss();
                        $newrss->module = $loc->mod;
                        $newrss->src = $loc->src;
                        $newrss->enable_rss = $oldconfig->enable_rss;
                        $newrss->feed_title = $oldconfig->feed_title;
                        $newrss->feed_desc = $oldconfig->feed_desc;
                        $newrss->rss_limit = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $newrss->rss_cachetime = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newrss->save();
                    }
                }
                break;
            case 'swfmodule':
                $module->view = 'showall';
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "text";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'swfmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'swfmodule';
                $swfitems = $old_db->selectObjects('swfitem', "location_data='" . serialize($iloc) . "'");
                if ($swfitems) {
                    foreach ($swfitems as $ti) {
                        $text = new text();
                        $file = new expFile($ti->swf_id);
                        $loc = expUnserialize($ti->location_data);
                        $loc->mod = "text";
                        $text->location_data = serialize($loc);
                        $text->title = $ti->name;
                        $swfcode = '
							<p>
							 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" height="' . $ti->height . '" width="' . $ti->width . '">
								 <param name="bgcolor" value="' . $ti->bgcolor . '" />
									' . ($ti->transparentbg ? "<param name=\"wmode\" value=\"transparent\" />" : "") . '
								 <param name="quality" value="high" />
								 <param name="movie" value="' . $file->path_relative . '" />
								 <embed bgcolor= "' . $ti->bgcolor . '" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="' . $file->path_relative . '" type="application/x-shockwave-flash" height="' . $ti->height . '" width="' . $ti->width . '"' . ($ti->transparentbg ? " wmode=\"transparent\"" : "") . '>
								 </embed>
							 </object>
							</p>
						';
                        $text->body = $swfcode;
                        $text->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'newsmodule':
                if ($module->view == 'Featured News') {
                    $only_featured = true;
                }
                switch ($module->view) {
                    case 'Headlines':
                        $module->view = 'showall_headlines';
                        break;
                    case 'Summary':
                        $module->view = 'showall_summary';
                        break;
                    default:
                        $module->view = 'showall';
                        break;
                }
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "news";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'newsmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'newsmodule';
                $newsitems = $old_db->selectArrays('newsitem', "location_data='" . serialize($iloc) . "'");
                $oldconfig = $old_db->selectObject('newsmodule_config', "location_data='" . serialize($iloc) . "'");
                if ($newsitems) {
                    $files_attached = false;
                    foreach ($newsitems as $ni) {
                        unset($ni['id']);
                        $news = new news($ni);
                        $loc = expUnserialize($ni['location_data']);
                        $loc->mod = "news";
                        $news->location_data = serialize($loc);
                        $news->title = !empty($ni['title']) ? $ni['title'] : gt('Untitled');
                        $news->body = !empty($ni['body']) ? $ni['body'] : gt('(empty)');
                        $news->save();
                        // default is to create with current time
                        $news->created_at = $ni['posted'];
                        $news->edited_at = $ni['edited'];
                        $news->update();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                        if (!empty($ni['file_id'])) {
                            $file = new expFile($ni['file_id']);
                            $news->attachitem($file, '');
                            $files_attached = true;
                        }
                    }
                    $newconfig = new expConfig();
                    if ($files_attached) {
                        // fudge a config to get attached files to appear
                        $newconfig->config = 'a:14:{s:9:"feedmaker";s:0:"";s:11:"filedisplay";s:7:"Gallery";s:6:"ffloat";s:4:"Left";s:6:"fwidth";s:3:"120";s:7:"fmargin";s:1:"5";s:7:"piwidth";s:3:"100";s:5:"thumb";s:3:"100";s:7:"spacing";s:2:"10";s:10:"floatthumb";s:8:"No Float";s:6:"tclass";s:0:"";s:5:"limit";s:0:"";s:9:"pagelinks";s:14:"Top and Bottom";s:10:"feed_title";s:0:"";s:9:"feed_desc";s:0:"";}';
                    }
                    if ($oldconfig->enable_rss == 1) {
                        if ($newconfig->config != null) {
                            $config = expUnserialize($newconfig->config);
                        }
                        $config['enable_rss'] = true;
                        $config['feed_title'] = $oldconfig->feed_title;
                        $config['feed_desc'] = $oldconfig->feed_desc;
                        $config['rss_limit'] = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $config['rss_cachetime'] = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newconfig->config = $config;
                        $newrss = new expRss();
                        $newrss->module = $loc->mod;
                        $newrss->src = $loc->src;
                        $newrss->enable_rss = $oldconfig->enable_rss;
                        $newrss->feed_title = $oldconfig->feed_title;
                        $newrss->feed_desc = $oldconfig->feed_desc;
                        $newrss->rss_limit = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $newrss->rss_cachetime = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newrss->save();
                    }
                    if ($only_featured) {
                        $newconfig->config['only_featured'] = true;
                    }
                    if ($newconfig != null) {
                        $newconfig->location_data = $loc;
                        $newconfig->save();
                    }
                }
                break;
            case 'resourcesmodule':
                switch ($module->view) {
                    case 'One Click Download - Descriptive':
                        $module->view = 'showall_quick_download_with_description';
                        break;
                    default:
                        $module->view = 'showall';
                        break;
                }
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "filedownload";
                if ($db->countObjects('filedownloads', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'resourcesmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'resourcesmodule';
                $resourceitems = $old_db->selectArrays('resourceitem', "location_data='" . serialize($iloc) . "'");
                $oldconfig = $old_db->selectObject('resourcesmodule_config', "location_data='" . serialize($iloc) . "'");
                if ($resourceitems) {
                    foreach ($resourceitems as $ri) {
                        unset($ri['id']);
                        $filedownload = new filedownload($ri);
                        $loc = expUnserialize($ri['location_data']);
                        $loc->mod = "filedownload";
                        $filedownload->title = !empty($ri['name']) ? $ri['name'] : 'Untitled';
                        $filedownload->body = $ri['description'];
                        $filedownload->downloads = $ri['num_downloads'];
                        $filedownload->location_data = serialize($loc);
                        if (!empty($ri['file_id'])) {
                            $filedownload->save();
                            @$this->msg['migrated'][$iloc->mod]['count']++;
                            @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                            $file = new expFile($ri['file_id']);
                            $filedownload->attachitem($file, 'downloadable');
                            // default is to create with current time
                            $filedownload->created_at = $ri['posted'];
                            $filedownload->edited_at = $ri['edited'];
                            $filedownload->update();
                        }
                    }
                    if (isset($oldconfig->enable_rss)) {
                        $dorss = $oldconfig->enable_rss;
                    } elseif (isset($oldconfig->enable_podcasting)) {
                        $dorss = $oldconfig->enable_podcasting;
                    } else {
                        $dorss = false;
                    }
                    if ($dorss) {
                        $config['enable_rss'] = true;
                        $config['feed_title'] = $oldconfig->feed_title;
                        $config['feed_desc'] = $oldconfig->feed_desc;
                        $config['rss_limit'] = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $config['rss_cachetime'] = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newconfig = new expConfig();
                        $newconfig->config = $config;
                        $newconfig->location_data = $loc;
                        $newconfig->save();
                        $newrss = new expRss();
                        $newrss->module = $loc->mod;
                        $newrss->src = $loc->src;
                        //						$newrss->enable_rss = $oldconfig->enable_rss;
                        $newrss->enable_rss = true;
                        $newrss->feed_title = $oldconfig->feed_title;
                        $newrss->feed_desc = $oldconfig->feed_desc;
                        $newrss->rss_limit = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $newrss->rss_cachetime = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newrss->save();
                    }
                }
                break;
            case 'imagegallerymodule':
                switch ($module->view) {
                    case 'Slideshow':
                        $module->action = 'slideshow';
                        $module->view = 'showall';
                        break;
                    default:
                        $module->view = 'showall';
                        break;
                }
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "photos";
                if ($db->countObjects('photo', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'imagegallerymodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'imagegallerymodule';
                $galleries = $old_db->selectArrays('imagegallery_gallery', "location_data='" . serialize($iloc) . "'");
                if ($galleries) {
                    foreach ($galleries as $gallery) {
                        $gis = $old_db->selectArrays('imagegallery_image', "gallery_id='" . $gallery['id'] . "'");
                        foreach ($gis as $gi) {
                            $photo = new photo();
                            $loc = expUnserialize($gallery['location_data']);
                            $loc->mod = "photos";
                            $photo->title = !empty($gi['name']) ? $gi['name'] : 'Untitled';
                            $photo->body = $gi['description'];
                            $photo->alt = $gi['alt'];
                            $photo->location_data = serialize($loc);
                            if (!empty($gi['file_id'])) {
                                $photo->save();
                                @$this->msg['migrated'][$iloc->mod]['count']++;
                                @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                                $file = new expFile($gi['file_id']);
                                $photo->attachitem($file, '');
                                $photo->created_at = $gi['posted'];
                                $photo->edited_at = $gi['posted'];
                                $photo->update(array("validate" => false));
                            }
                        }
                    }
                }
                break;
            case 'slideshowmodule':
                $module->action = 'slideshow';
                $module->view = 'showall';
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "photos";
                if ($db->countObjects('photo', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'slideshowmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'slideshowmodule';
                $galleries = $old_db->selectArrays('imagegallery_gallery', "location_data='" . serialize($iloc) . "'");
                if ($galleries) {
                    foreach ($galleries as $gallery) {
                        $gis = $old_db->selectArrays('imagegallery_image', "gallery_id='" . $gallery['id'] . "'");
                        foreach ($gis as $gi) {
                            $photo = new photo();
                            $loc = expUnserialize($gallery['location_data']);
                            $loc->mod = "photos";
                            $photo->title = !empty($gi['name']) ? $gi['name'] : 'Untitled';
                            $photo->body = $gi['description'];
                            $photo->alt = $gi['alt'];
                            $photo->location_data = serialize($loc);
                            $te = $photo->find('first', "location_data='" . $photo->location_data . "'");
                            if (empty($te)) {
                                if (!empty($gi['file_id'])) {
                                    $photo->save();
                                    @$this->msg['migrated'][$iloc->mod]['count']++;
                                    @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                                    $file = new expFile($gi['file_id']);
                                    $photo->attachitem($file, '');
                                    $photo->created_at = $gi['posted'];
                                    $photo->edited_at = $gi['posted'];
                                    $photo->update();
                                }
                            }
                        }
                    }
                }
                break;
            case 'headlinemodule':
                $module->view = 'showall';
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "text";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'headlinemodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'headlinemodule';
                $headlines = $old_db->selectObjects('headline', "location_data='" . serialize($iloc) . "'");
                if ($headlines) {
                    foreach ($headlines as $hl) {
                        $headline = new text();
                        $loc = expUnserialize($hl->location_data);
                        $loc->mod = "text";
                        $headline->location_data = serialize($loc);
                        $headline->title = $hl->headline;
                        $headline->poster = 1;
                        //                        $headline->created_at = time();
                        //                        $headline->edited_at = time();
                        $headline->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'weblogmodule':
                switch ($module->view) {
                    case 'By Author':
                        $module->action = 'authors';
                        $module->view = 'authors';
                        break;
                    case 'By Tag':
                        $module->action = 'tags';
                        $module->view = 'tags_list';
                        break;
                    case 'Monthly':
                        $module->action = 'dates';
                        $module->view = 'dates';
                        break;
                    default:
                        $module->view = 'showall';
                        break;
                }
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "blog";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'weblogmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'weblogmodule';
                $blogitems = $old_db->selectArrays('weblog_post', "location_data='" . serialize($iloc) . "'");
                $oldconfig = $old_db->selectObject('weblogmodule_config', "location_data='" . serialize($iloc) . "'");
                if ($blogitems) {
                    foreach ($blogitems as $bi) {
                        unset($bi['id']);
                        $post = new blog($bi);
                        $loc = expUnserialize($bi['location_data']);
                        $loc->mod = "blog";
                        $post->location_data = serialize($loc);
                        $post->title = !empty($bi['title']) ? $bi['title'] : gt('Untitled');
                        $post->body = !empty($bi['body']) ? $bi['body'] : gt('(empty)');
                        $post->save();
                        // default is to create with current time
                        $post->created_at = $bi['posted'];
                        $post->edited_at = $bi['edited'];
                        $post->update();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                        // this next section is moot since there are no attachments to blogs
                        // if (!empty($bi['file_id'])) {
                        // $file = new expFile($bi['file_id']);
                        // $post->attachitem($file,'downloadable');
                        // }
                        if (isset($oldconfig->enable_tags) && ($oldconfig->enable_tags = true)) {
                            $params = null;
                            $oldtags = expUnserialize($bi['tags']);
                            foreach ($oldtags as $oldtag) {
                                $tagtitle = strtolower(trim($old_db->selectValue('tags', 'name', 'id = ' . $oldtag)));
                                $tag = new expTag($tagtitle);
                                //								$tag->title = $old_db->selectValue('tags','name','id = '.$oldtag);
                                if (empty($tag->id)) {
                                    $tag->update(array('title' => $tagtitle));
                                }
                                $params['expTag'][] = $tag->id;
                            }
                            $post->update($params);
                        }
                        $comments = $old_db->selectArrays('weblog_comment', "parent_id='" . $post->id . "'");
                        foreach ($comments as $comment) {
                            unset($comment['id']);
                            $newcomment = new expComment($comment);
                            $newcomment->created_at = $comment['posted'];
                            $newcomment->edited_at = $comment['edited'];
                            $newcomment->update();
                            // attach the comment to the blog post it belongs to
                            $obj->content_type = 'blog';
                            $obj->content_id = $post->id;
                            $obj->expcomments_id = $newcomment->id;
                            if (isset($this->params['subtype'])) {
                                $obj->subtype = $this->params['subtype'];
                            }
                            $db->insertObject($obj, $newcomment->attachable_table);
                        }
                    }
                    $newconfig = new expConfig();
                    $config['add_source'] = '1';
                    if ($oldconfig->enable_rss == 1) {
                        $config['enable_rss'] = true;
                        $config['feed_title'] = $oldconfig->feed_title;
                        $config['feed_desc'] = $oldconfig->feed_desc;
                        $config['rss_limit'] = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $config['rss_cachetime'] = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newrss = new expRss();
                        $newrss->module = $loc->mod;
                        $newrss->src = $loc->src;
                        $newrss->enable_rss = $oldconfig->enable_rss;
                        $newrss->feed_title = $oldconfig->feed_title;
                        $newrss->feed_desc = $oldconfig->feed_desc;
                        $newrss->rss_limit = isset($oldconfig->rss_limit) ? $oldconfig->rss_limit : 24;
                        $newrss->rss_cachetime = isset($oldconfig->rss_cachetime) ? $oldconfig->rss_cachetime : 1440;
                        $newrss->save();
                    }
                    $newconfig->config = $config;
                    $newconfig->location_data = $loc;
                    $newconfig->save();
                }
                break;
            case 'faqmodule':
                $module->view = 'showall';
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "faq";
                if ($db->countObjects('faqs', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'faqmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'faqmodule';
                $faqs = $old_db->selectArrays('faq', "location_data='" . serialize($iloc) . "'");
                if ($faqs) {
                    foreach ($faqs as $fqi) {
                        unset($fqi['id']);
                        $faq = new faq($fqi);
                        $loc = expUnserialize($fqi['location_data']);
                        $loc->mod = "faq";
                        $faq->location_data = serialize($loc);
                        $faq->question = !empty($fqi['question']) ? $fqi['question'] : 'Untitled?';
                        $faq->answer = $fqi['answer'];
                        $faq->rank = $fqi['rank'];
                        $faq->include_in_faq = 1;
                        $faq->submitter_name = 'Unknown';
                        $faq->submitter_email = '*****@*****.**';
                        $faq->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'listingmodule':
                $module->view = 'showall';
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "portfolio";
                if ($db->countObjects($ploc->mod, "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'listingmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'listingmodule';
                $listingitems = $old_db->selectArrays('listing', "location_data='" . serialize($iloc) . "'");
                if ($listingitems) {
                    $files_attached = false;
                    foreach ($listingitems as $li) {
                        unset($li['id']);
                        $listing = new portfolio($li);
                        $listing->title = !empty($li['name']) ? $li['name'] : 'Untitled?';
                        $loc = expUnserialize($li['location_data']);
                        $loc->mod = "portfolio";
                        $listing->location_data = serialize($loc);
                        $listing->featured = true;
                        $listing->poster = 1;
                        $listing->body = "<p>" . $li['summary'] . "</p>" . $li['body'];
                        $listing->save();
                        // default is to create with current time
                        $listing->created_at = time();
                        $listing->edited_at = time();
                        $listing->update();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                        if (!empty($li['file_id'])) {
                            $file = new expFile($li['file_id']);
                            $listing->attachitem($file, '');
                            $files_attached = true;
                        }
                    }
                    if ($files_attached) {
                        // fudge a config to get attached files to appear
                        $config = new expConfig();
                        $config->location_data = $loc;
                        $config->config = 'a:11:{s:11:"filedisplay";s:7:"Gallery";s:6:"ffloat";s:4:"Left";s:6:"fwidth";s:3:"120";s:7:"fmargin";s:1:"5";s:7:"piwidth";s:3:"100";s:5:"thumb";s:3:"100";s:7:"spacing";s:2:"10";s:10:"floatthumb";s:8:"No Float";s:6:"tclass";s:0:"";s:5:"limit";s:0:"";s:9:"pagelinks";s:14:"Top and Bottom";}';
                        $config->save();
                    }
                }
                break;
            case 'contactmodule':
                // convert to an old school form
                $module->view == "Default";
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "formmodule";
                if ($db->countObjects('formbuilder_form', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'contactmodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'contactmodule';
                $contactform = $old_db->selectObject('contactmodule_config', "location_data='" . serialize($iloc) . "'");
                if ($contactform) {
                    $loc = expUnserialize($contactform->location_data);
                    $loc->mod = 'formmodule';
                    $contactform->location_data = serialize($loc);
                    //				$replyto_address = $contactform->replyto_address;
                    unset($contactform->replyto_address);
                    //				$from_address = $contactform->from_address;
                    unset($contactform->from_address);
                    //				$from_name = $contactform->from_name;
                    unset($contactform->from_name);
                    unset($contactform->use_captcha);
                    $contactform->name = 'Send us an e-mail';
                    $contactform->description = '';
                    $contactform->response = $contactform->final_message;
                    unset($contactform->final_message);
                    $contactform->table_name = '';
                    $contactform->is_email = true;
                    $contactform->is_saved = false;
                    $contactform->submitbtn = 'Send Message';
                    $contactform->resetbtn = 'Reset';
                    unset($contactform->id);
                    $contactform->id = $db->insertObject($contactform, 'formbuilder_form');
                    $addresses = $old_db->selectObjects('contact_contact', "location_data='" . serialize($iloc) . "'");
                    foreach ($addresses as $address) {
                        unset($address->addressbook_contact_id);
                        unset($address->contact_info);
                        unset($address->location_data);
                        $address->form_id = $contactform->id;
                        $db->insertObject($address, 'formbuilder_address');
                    }
                    $report = null;
                    $report->name = $contactform->subject;
                    $report->location_data = $contactform->location_data;
                    $report->form_id = $contactform->id;
                    $db->insertObject($report, 'formbuilder_report');
                    // now add the controls to the form
                    $control = null;
                    $control->name = 'name';
                    $control->caption = 'Your Name';
                    $control->form_id = $contactform->id;
                    $control->data = 'O:11:"textcontrol":12:{s:4:"size";i:0;s:9:"maxlength";i:0;s:7:"caption";s:9:"Your Name";s:9:"accesskey";s:0:"";s:7:"default";s:0:"";s:8:"disabled";b:0;s:8:"required";b:1;s:8:"tabindex";i:-1;s:7:"inError";i:0;s:4:"type";s:4:"text";s:6:"filter";s:0:"";s:10:"identifier";s:4:"name";}';
                    $control->rank = 0;
                    $control->is_readonly = 0;
                    $control->is_static = 0;
                    $db->insertObject($control, 'formbuilder_control');
                    $control->name = 'email';
                    $control->caption = 'Your Email';
                    $control->data = 'O:11:"textcontrol":12:{s:4:"size";i:0;s:9:"maxlength";i:0;s:7:"caption";s:18:"Your Email Address";s:9:"accesskey";s:0:"";s:7:"default";s:0:"";s:8:"disabled";b:0;s:8:"required";b:1;s:8:"tabindex";i:-1;s:7:"inError";i:0;s:4:"type";s:4:"text";s:6:"filter";s:0:"";s:10:"identifier";s:5:"email";}';
                    $control->rank = 1;
                    $db->insertObject($control, 'formbuilder_control');
                    $control->name = 'subject';
                    $control->caption = 'Subject';
                    $control->data = 'O:11:"textcontrol":12:{s:4:"size";i:0;s:9:"maxlength";i:0;s:7:"caption";s:7:"Subject";s:9:"accesskey";s:0:"";s:7:"default";s:0:"";s:8:"disabled";b:0;s:8:"required";b:1;s:8:"tabindex";i:-1;s:7:"inError";i:0;s:4:"type";s:4:"text";s:6:"filter";s:0:"";s:10:"identifier";s:7:"subject";}';
                    $control->rank = 2;
                    $db->insertObject($control, 'formbuilder_control');
                    $control->name = 'message';
                    $control->caption = 'Message';
                    $control->data = 'O:17:"texteditorcontrol":12:{s:4:"cols";i:60;s:4:"rows";i:8;s:9:"accesskey";s:0:"";s:7:"default";s:0:"";s:8:"disabled";b:0;s:8:"required";b:0;s:8:"tabindex";i:-1;s:7:"inError";i:0;s:4:"type";s:4:"text";s:8:"maxchars";i:0;s:10:"identifier";s:7:"message";s:7:"caption";s:7:"Message";}';
                    $control->rank = 3;
                    $db->insertObject($control, 'formbuilder_control');
                    @$this->msg['migrated'][$iloc->mod]['count']++;
                    @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                }
                break;
            case 'youtubemodule':
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "youtube";
                if ($db->countObjects('youtube', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'youtubemodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'youtubemodule';
                $videos = $old_db->selectArrays('youtube', "location_data='" . serialize($iloc) . "'");
                if ($videos) {
                    foreach ($videos as $vi) {
                        unset($vi['id']);
                        $video = new youtube($vi);
                        $loc = expUnserialize($vi['location_data']);
                        $loc->mod = "youtube";
                        $video->title = $vi['name'];
                        if (empty($video->title)) {
                            $video->title = 'Untitled';
                        }
                        $video->location_data = serialize($loc);
                        $yt = explode("watch?v=", $vi['url']);
                        if (empty($yt[1])) {
                            break;
                        } else {
                            $ytid = $yt[1];
                        }
                        unset($video->url);
                        $video->embed_code = '<iframe title="YouTube video player" width="' . $vi['width'] . '" height="' . $vi['height'] . '" src="http://www.youtube.com/embed/' . $ytid . '" frameborder="0" allowfullscreen></iframe>';
                        $video->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'mediaplayermodule':
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "flowplayer";
                if ($db->countObjects('flowplayer', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'mediaplayermodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'mediaplayermodule';
                $movies = $old_db->selectArrays('mediaitem', "location_data='" . serialize($iloc) . "'");
                if ($movies) {
                    foreach ($movies as $mi) {
                        unset($mi['id']);
                        $movie = new flowplayer($mi);
                        $loc = expUnserialize($mi['location_data']);
                        $loc->mod = "flowplayer";
                        $movie->title = $mi['name'];
                        if (empty($movie->title)) {
                            $movie->title = 'Untitled';
                        }
                        unset($mi['bgcolor']);
                        unset($mi['alignment']);
                        unset($mi['loop_media']);
                        unset($mi['auto_rewind']);
                        unset($mi['autoplay']);
                        unset($mi['hide_controls']);
                        $movie->location_data = serialize($loc);
                        $movie->poster = 1;
                        $movie->rank = 1;
                        if (!empty($mi['media_id'])) {
                            $movie->save();
                            @$this->msg['migrated'][$iloc->mod]['count']++;
                            @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                            $file = new expFile($mi['media_id']);
                            $movie->attachitem($file, 'video');
                            if (!empty($mi['alt_image_id'])) {
                                $file = new expFile($mi['alt_image_id']);
                                $movie->attachitem($file, 'splash');
                            }
                        }
                    }
                }
                break;
            case 'bannermodule':
                //check to see if it's already pulled in (circumvent !is_original)
                $ploc = $iloc;
                $ploc->mod = "banner";
                if ($db->countObjects('banner', "location_data='" . serialize($ploc) . "'")) {
                    $iloc->mod = 'bannermodule';
                    $linked = true;
                    break;
                }
                $iloc->mod = 'bannermodule';
                $banners = $old_db->selectArrays('banner_ad', "location_data='" . serialize($iloc) . "'");
                if ($banners) {
                    foreach ($banners as $bi) {
                        $oldclicks = $old_db->selectObjects('banner_click', "ad_id='" . $bi['id'] . "'");
                        $oldcompany = $old_db->selectObject('banner_affiliate', "id='" . $bi['affiliate_id'] . "'");
                        unset($bi['id']);
                        $banner = new banner($bi);
                        $loc = expUnserialize($bi['location_data']);
                        $loc->mod = "banner";
                        $banner->title = $bi['name'];
                        $banner->url = !empty($bi['url']) ? $bi['url'] : '#';
                        if (empty($banner->title)) {
                            $banner->title = 'Untitled';
                        }
                        $banner->location_data = serialize($loc);
                        $newcompany = $db->selectObject('companies', "title='" . $oldcompany->name . "'");
                        if ($newcompany == null) {
                            $newcompany = new company();
                            $newcompany->title = !empty($oldcompany->name) ? $oldcompany->name : 'Untitled';
                            $newcompany->body = $oldcompany->contact_info;
                            $newcompany->location_data = $banner->location_data;
                            $newcompany->save();
                        }
                        $banner->companies_id = $newcompany->id;
                        $banner->clicks = 0;
                        foreach ($oldclicks as $click) {
                            $banner->clicks += $click->clicks;
                        }
                        if (!empty($bi['file_id'])) {
                            $file = new expFile($bi['file_id']);
                            $banner->attachitem($file, '');
                        }
                        $banner->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'addressbookmodule':
                // user mod, not widely distributed
                @($module->view = 'myaddressbook');
                @($module->action = 'myaddressbook');
                //check to see if it's already pulled in (circumvent !is_original)
                // $ploc = $iloc;
                // $ploc->mod = "addresses";
                // if ($db->countObjects($ploc->mod, "location_data='".serialize($ploc)."'")) {
                // $iloc->mod = 'addressbookmodule';
                // $linked = true;
                // break;
                // }
                //                $iloc->mod = 'addressbookmodule';
                $addresses = $old_db->selectArrays('addressbook_contact', "location_data='" . serialize($iloc) . "'");
                if ($addresses) {
                    foreach ($addresses as $address) {
                        //						unset($address['id']);
                        $addr = new address();
                        $addr->user_id = 1;
                        $addr->is_default = 1;
                        $addr->is_billing = 1;
                        $addr->is_shipping = 1;
                        $addr->firstname = !empty($address['firstname']) ? $address['firstname'] : 'blank';
                        $addr->lastname = !empty($address['lastname']) ? $address['lastname'] : 'blank';
                        $addr->address1 = !empty($address['address1']) ? $address['address1'] : 'blank';
                        $addr->city = !empty($address['city']) ? $address['city'] : 'blank';
                        $address['state'] = !empty($address['state']) ? $address['state'] : 'CA';
                        $state = $db->selectObject('geo_region', 'code="' . strtoupper($address['state']) . '"');
                        $addr->state = $state->id;
                        $addr->zip = !empty($address['zip']) ? $address['zip'] : '99999';
                        $addr->phone = !empty($address['phone']) ? $address['phone'] : '800-555-1212';
                        $addr->email = !empty($address['email']) ? $address['email'] : '*****@*****.**';
                        $addr->organization = $address['business'];
                        $addr->phone2 = $address['cell'];
                        $addr->save();
                        @$this->msg['migrated'][$iloc->mod]['count']++;
                        @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                    }
                }
                break;
            case 'feedlistmodule':
                @($module->view = 'showall');
                $iloc->mod = 'feedlistmodule';
                $feedlist = $old_db->selectObject('feedlistmodule_config', "location_data='" . serialize($iloc) . "'");
                if ($feedlist->enable_rss == 1) {
                    $loc = expUnserialize($feedlist->location_data);
                    $loc->mod = "rssController";
                    $config['enable_rss'] = true;
                    $config['feed_title'] = $feedlist->feed_title;
                    $config['feed_desc'] = $feedlist->feed_desc;
                    $config['rss_limit'] = isset($feedlist->rss_limit) ? $feedlist->rss_limit : 24;
                    $config['rss_cachetime'] = isset($feedlist->rss_cachetime) ? $feedlist->rss_cachetime : 1440;
                    $newconfig = new expConfig();
                    $newconfig->config = $config;
                    $newconfig->location_data = $loc;
                    $newconfig->save();
                    $newrss = new expRss();
                    $newrss->module = $loc->mod;
                    $newrss->src = $loc->src;
                    $newrss->enable_rss = $feedlist->enable_rss;
                    $newrss->feed_title = $feedlist->feed_title;
                    $newrss->feed_desc = $feedlist->feed_desc;
                    $newrss->rss_limit = isset($feedlist->rss_limit) ? $feedlist->rss_limit : 24;
                    $newrss->rss_cachetime = isset($feedlist->rss_cachetime) ? $feedlist->rss_cachetime : 1440;
                    $newrss->save();
                    @$this->msg['migrated'][$iloc->mod]['count']++;
                    @($this->msg['migrated'][$iloc->mod]['name'] = $this->new_modules[$iloc->mod]);
                }
                break;
            default:
                @$this->msg['noconverter'][$iloc->mod]++;
                break;
        }
        // quick check for non hard coded modules
        // We add a container if they're not hard coded.
        !$hc ? $this->add_container($iloc, $module, $linked) : "";
        return $module;
    }
 function save_address()
 {
     global $db;
     $order = new order($this->params['orderid']);
     $billing = new billing($this->params['orderid']);
     $s = array_pop($order->shippingmethods);
     $shippingmethod = new shippingmethod($s->id);
     //eDebug($order);
     //eDebug($this->params,true);
     //eDebug($shippingmethod);
     $billingmethod = $billing->billingmethod;
     /*
            eDebug($order);
            eDebug($shippingmethod);
            eDebug($billingmethod);*/
     if ($this->params['save_option'] == 0) {
         //update existing
         //echo "Update";
         $addy = new address($this->params['addyid']);
     } else {
         if ($this->params['save_option'] == 1) {
             //create new
             //echo "New";
             $oldaddy = new address($this->params['addyid']);
             $addy = new address();
             $addy->user_id = $oldaddy->user_id;
         }
     }
     //eDebug($addy,true);
     foreach ($this->params['address'] as $key => $val) {
         $addy->{$key} = $val;
         if (isset($billingmethod->{$key})) {
             $billingmethod->{$key} = $val;
         }
         if (isset($shippingmethod->{$key})) {
             $shippingmethod->{$key} = $val;
         }
     }
     $addy->is_billing = 0;
     $addy->is_shipping = 0;
     $addy->save();
     $addy->refresh();
     if ($this->params['type'] == 'billing' || $this->params['same'] == true && $this->params['save_option'] == 0) {
         //echo "Billing";
         $billingmethod->addresses_id = $addy->id;
         $billingmethod->save();
         $addy->is_billing = 1;
     }
     if ($this->params['type'] == 'shipping' || $this->params['same'] == true && $this->params['save_option'] == 0) {
         //eDebug("Shipping",true);
         $shippingmethod->addresses_id = $addy->id;
         $shippingmethod->save();
         $addy->is_shipping = 1;
     }
     $addy->save();
     if ($addy->is_default) {
         $db->setUniqueFlag($addy, 'addresses', 'is_default', 'user_id=' . $addy->user_id);
     }
     //eDebug($shippingmethod,true);
     flashAndFlow('message', 'Address updated.');
     redirect_to(array('controller' => 'order', 'action' => 'show', 'id' => $this->params['id']));
 }
Exemple #17
0
    ?>
</p>

                <p><?php 
    echo $user->user_company ? "Works at: {$user->user_company}" : "{$user->user_name_first} {$user->user_name_last} hasn't entered his/her company yet";
    ?>
</p>
              </div>
            </div>

            <div class="shell col-lg-4 col-md-4 col-sm-6">
              <div class="card">
                <h2>Address</h2>

                <p><?php 
    echo $user->user_address ? address::get_instance_pretty($user->user_address) : "{$user->user_name_first} {$user->user_name_last} hasn't entered his/her address yet";
    ?>
</p>
              </div>
            </div>

            <div class="shell col-lg-4 col-md-4 col-sm-6">
              <div class="card">
                <h2>Subscriptions</h2>
                <a href="./<?php 
    echo $user_id;
    ?>
/subs" class="btn btn-default edit" aria-label="Left Align">View All</a>
                <?php 
    function date_sort($a, $b)
    {
Exemple #18
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
login();
require DT_ROOT . '/module/' . $module . '/common.inc.php';
$MG['address_limit'] > -1 or dalert(lang('message->without_permission_and_upgrade'), 'goback');
require DT_ROOT . '/include/post.func.php';
require MD_ROOT . '/address.class.php';
$do = new address();
include load('message.lang');
switch ($action) {
    case 'add':
        if ($MG['address_limit']) {
            $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}address WHERE username='******'");
            if ($r['num'] >= $MG['address_limit']) {
                dalert(lang($L['limit_add'], array($MG['address_limit'], $r['num'])), 'goback');
            }
        }
        if ($submit) {
            if ($do->pass($post)) {
                $post['username'] = $_username;
                $do->add($post);
                dmsg($L['op_add_success'], '?action=index');
            } else {
                message($do->errmsg);
            }
        } else {
            foreach ($do->fields as $v) {
                ${$v} = '';
            }
            $head_title = $L['address_title_add'];
Exemple #19
0
function update_address(&$info, &$address)
{
    $add = new address($info['database'], $address['id']);
    $add->name = $address['name'];
    $add->phone = $address['phone'];
    $add->email = $address['email'];
    $add->contact = $address['contact'];
    $add->ext = $address['ext'];
    $add->street1 = $address['street1'];
    $add->street2 = $address['street2'];
    $add->city = $address['city'];
    $add->province = $address['province'];
    $add->country = $address['country'];
    $add->postal = $address['postal'];
    $add->Update();
}
Exemple #20
0
    $header_info_statement .= "<li>{$document_type} : " . ${$class}->{$document_type_number} . "</li>";
    $header_info_statement .= "<li>Revision : " . ${$class}->{$document_revision_number} . "</li>";
    $header_info_statement .= "<li>Buyer : " . ${$class}->{$document_showVar1} . "</li>";
    $header_info_statement .= "<li>Currency : " . ${$class}->{$document_showVar2} . "</li>";
    $header_info_statement .= "<li>Payment Term : " . $payment_term->payment_term . "</li>";
    $header_info_statement .= "<li>Amount : " . ${$class}->{$document_showVar4} . "</li>";
    $header_info_statement .= "</ul>";
}
//row 1 - right side supplier/customer Info
$external_entiry_info = "";
if (!empty(${$class}->{$external_entity_lineId})) {
    $external_entity_headerDetails = $external_entity_headerClass::find_by_id(${$class}->{$external_entity_headerId});
    $external_entity_lineDetails = $external_entity_lineClass::find_by_id(${$class}->{$external_entity_lineId});
    if (!empty($external_entity_addressId)) {
        $address = address::find_by_id($external_entity_lineDetails->{$external_entity_addressId});
        $address_value = address::show_adrees_details_inLine($address);
    }
    $external_entiry_info .= "<ul>";
    $external_entiry_info .= "<li>{$external_entity_type} : " . $external_entity_headerDetails->{$external_entity_headerName} . " </li>";
    $external_entiry_info .= "<li>  Number  : " . $external_entity_headerDetails->{$external_entity_headerNumber} . " </li>";
    $external_entiry_info .= "<li>  Site Name  : " . $external_entity_lineDetails->{$external_entity_lineName} . "</li>";
    $external_entiry_info .= "<li>  Site Number  : " . $external_entity_lineDetails->{$external_entity_lineNumber} . "</li>";
    $external_entiry_info .= "<li> {$address_value} </li>";
    $external_entiry_info .= "</ul>";
}
?>
<div id="page_print">
 <div id="print_header">
	<div class="half_page left logo">Site Logo </div>
	<div class="half_page right bu_details"><?php 
echo !empty(${$class}->bu_org_id) ? org::print_orgDetails_inLine(${$class}->bu_org_id) : "";
Exemple #21
0
 public function getForcedShippingMethod()
 {
     global $db, $user;
     $forced_calc = '';
     $forced_method = '';
     foreach ($this->orderitem as $item) {
         if (!empty($item->product->required_shipping_method)) {
             $method = new shippingmethod($item->shippingmethods_id);
             $forced_calc = $item->product->required_shipping_calculator_id;
             $forced_method = $item->product->required_shipping_method;
             $this->forced_shipping = true;
             $this->product_forcing_shipping = $item->product;
             $this->forcing_shipping_reason = $item->product->title;
             break;
         }
     }
     #FJD - TODOD: this will require some more work; eg. combining a free shipping discount code with a
     #product in the cart that is also forcing shipping.  He coupon could require the lowest shipping
     #method, but the product could require overnight or a high-end shipping, so we need to account for this
     //check discounts requiring forced shipping
     if ($forced_calc == '') {
         $o = new order_discounts();
         $ods = $o->find('all', 'orders_id=' . $this->id);
         foreach ($ods as $od) {
             if ($od->requiresForcedShipping()) {
                 $method = new shippingmethod($this->orderitem[0]->shippingmethods_id);
                 $forced_calc = $od->getRequiredShippingCalculatorId();
                 $forced_method = $od->getRequiredShippingMethod();
                 $this->forced_shipping = true;
                 $this->forcing_shipping_reason = gt('The discount code you are using');
                 break;
             }
         }
     }
     ###################
     // if this shippingmethod doesn't have an address assigned to it, lets check and see if this
     // user has set one up yet and default to that if so
     if (empty($method->addresses_id) && $user->isLoggedIn()) {
         $address = new address();
         $addy = $address->find('first', 'user_id=' . $user->id . '  AND is_default=1');
         if (!empty($addy->id)) {
             $method->setAddress($addy);
         }
     }
     $calcname = $db->selectValue('shippingcalculator', 'calculator_name', 'id=' . $forced_calc);
     $calculator = new $calcname($forced_calc);
     $rates = $calculator->getRates($this);
     $rate = $rates[$forced_method];
     $method->update(array('option' => $forced_method, 'option_title' => $rate['title'], 'shipping_cost' => $rate['cost'], 'shippingcalculator_id' => $forced_calc));
     return $method;
 }
Exemple #22
0
    /**
     * Crewlogg
     */
    protected static function page_crewlog()
    {
        global $_game;
        ess::$b->page->add_title("Crewhendelser");
        ess::$b->page->add_css('
.gamelog { width: 80%; margin: 0 auto }
.gamelog .time { color: #888888; padding-right: 2px }
.log_section {
	background-color: #1C1C1C;
	padding: 15px 15px 5px;
	margin: 30px 0;
	border: 10px solid #111111;
}');
        echo '
	<div class="gamelog">';
        $gamelog = new gamelog();
        // liste over hva vi har av typer
        $types = array(gamelog::$items['crewforum_emne'], gamelog::$items['crewforum_svar'], gamelog::$items['crewforuma_emne'], gamelog::$items['crewforuma_svar'], gamelog::$items['crewforumi_emne'], gamelog::$items['crewforumi_svar']);
        // finn ut hva som er tilgjengelig
        $result = \Kofradia\DB::get()->query("SELECT type, COUNT(id) AS count FROM users_log WHERE ul_up_id = 0 AND type IN (" . implode(",", $types) . ") GROUP BY type");
        $in_use = array();
        $count = array();
        $total = 0;
        while ($row = $result->fetch()) {
            $in_use[] = $row['type'];
            $count[$row['type']] = $row['count'];
        }
        $tilgjengelig = array();
        foreach (gamelog::$items_id as $id => $name) {
            if (in_array($id, $in_use)) {
                $tilgjengelig[$id] = $id;
            }
        }
        $i_bruk = $tilgjengelig;
        $total = array_sum($count);
        // nye hendelser (viser også nye hendelser i firma/familie)?
        if (page_min_side::$active_user->data['u_log_crew_new'] > 0 && login::$user->id == page_min_side::$active_user->id && count($i_bruk) > 0) {
            echo '
		<h1 class="c">Nye crewhendelser</h1>';
            ess::$b->page->add_css('.ny { color: #FF0000 }');
            $where = ' AND type IN (' . implode(",", $i_bruk) . ')';
            $result = \Kofradia\DB::get()->query("SELECT time, type, note, num FROM users_log WHERE ul_up_id = 0{$where} ORDER BY time DESC, id DESC LIMIT " . page_min_side::$active_user->data['u_log_crew_new']);
            if ($result->rowCount() == 0) {
                echo '
		<p class="c">Ingen crewhendelser ble funnet.</p>';
            } else {
                // vis hendelsene
                $logs = array();
                while ($row = $result->fetch()) {
                    $day = ess::$b->date->get($row['time'])->format(date::FORMAT_NOTIME);
                    $data = $gamelog->format_log($row['type'], $row['note'], $row['num']);
                    $logs[$day][] = '
				<p><span class="time"><span class="ny">Ny!</span> - ' . ess::$b->date->get($row['time'])->format("H:i") . ':</span> ' . $data . '</p>';
                }
                foreach ($logs as $day => $items) {
                    echo '
		<div class="bg1_c">
			<h1 class="bg1">' . $day . '<span class="left2"></span><span class="right2"></span></h1>
			<div class="bg1">';
                    foreach ($items as $item) {
                        echo $item;
                    }
                    echo '
			</div>
		</div>';
                }
                echo '
				<p class="c">Viser ' . page_min_side::$active_user->data['u_log_crew_new'] . ' <b>ny' . (page_min_side::$active_user->data['u_log_crew_new'] == 1 ? '' : 'e') . '</b> crewhendelse' . (page_min_side::$active_user->data['u_log_crew_new'] == 1 ? '' : 'r') . '<br /><a href="' . htmlspecialchars(page_min_side::addr()) . '">Se full oversikt</a></p>';
                \Kofradia\DB::get()->exec("UPDATE users SET u_log_crew_new = 0 WHERE u_id = " . page_min_side::$active_user->id);
                page_min_side::$active_user->data['u_log_crew_new'] = 0;
            }
        } else {
            if (page_min_side::$active_user->data['u_log_crew_new'] > 0 && login::$user->id == page_min_side::$active_user->id) {
                \Kofradia\DB::get()->exec("UPDATE users SET u_log_crew_new = 0 WHERE u_id = " . page_min_side::$active_user->id);
                page_min_side::$active_user->data['u_log_crew_new'] = 0;
            }
            // filter
            $filter = array();
            foreach ($_GET as $name => $val) {
                $matches = NULL;
                if (preg_match("/^f([0-9]+)\$/Du", $name, $matches) && in_array($matches[1], $tilgjengelig)) {
                    $filter[] = $matches[1];
                }
            }
            if (count($filter) == 0) {
                $filter = false;
            } else {
                $i_bruk = $filter;
                $filter = true;
                ess::$b->page->add_message("Du har aktivert et filter og viser kun bestemte enheter.");
            }
            // hva skal vi vise?
            if (!$filter) {
                echo '
		<p class="c filterbox"><a href="#" onclick="toggle_display(\'.filterbox\', event)">Vis filteralternativer</a></p>';
            }
            echo '
		<div' . (!$filter ? ' style="display: none"' : '') . ' class="filterbox bg1_c">
			<h1 class="bg1">Filter<span class="left2"></span><span class="right2"></span></h1>
			<div class="bg1">
				<p class="c">Velg filter (<a href="#" class="box_handle_toggle" rel="f[]">Merk alle</a>)</p>
				<form action="" method="get">' . (!page_min_side::$active_own ? '
					<input type="hidden" name="u_id" value="' . page_min_side::$active_user->id . '" />' : '
					<input type="hidden" name="u" value="1" />') . '
					<input type="hidden" name="a" value="crewlog" />
					<table class="table center" width="100%">
						<tbody>';
            $tbody = new tbody(3);
            // 3 kolonner
            foreach ($tilgjengelig as $id) {
                $title = gamelog::$items_name[$id];
                $aktivt = in_array($id, $i_bruk) && $filter;
                $ant = $count[$id];
                $tbody->append('<input type="checkbox" name="f' . $id . '" rel="f[]" value=""' . ($aktivt ? ' checked="checked"' : '') . ' />' . htmlspecialchars($title) . ' <span class="dark">(' . $ant . ' stk)</span>', 'class="box_handle"');
            }
            $tbody->clean();
            echo '
						</tbody>
					</table>
					<p class="c">' . show_sbutton("Oppdater") . '</p>
				</form>
			</div>
		</div>';
            $i_bruk[] = "NULL";
            $where = ' AND type IN (' . implode(",", $i_bruk) . ')';
            // sideinformasjon - hent loggene på denne siden
            $pagei = new pagei(pagei::ACTIVE_GET, "side", pagei::PER_PAGE, max(50, page_min_side::$active_user->data['u_log_crew_new']));
            $result = $pagei->query("SELECT time, type, note, num FROM users_log WHERE ul_up_id IN (0, " . page_min_side::$active_player->id . "){$where} ORDER BY time DESC, id DESC");
            if ($result->rowCount() == 0) {
                echo '
		<p class="c">Ingen hendelser ble funnet.</p>';
            } else {
                echo '
		<p class="c">Totalt har du <b>' . game::format_number($total) . '</b> crewhendelse' . ($total == 1 ? '' : 'r') . '.</p>';
                if ($pagei->pages > 1) {
                    echo '
		<p class="c">' . address::make($_GET, "", $pagei) . '</p>';
                }
                // hendelsene
                $logs = array();
                $i = 0;
                $e = $pagei->start;
                while ($row = $result->fetch()) {
                    $day = ess::$b->date->get($row['time'])->format(date::FORMAT_NOTIME);
                    $data = $gamelog->format_log($row['type'], $row['note'], $row['num']);
                    $ny = $e < page_min_side::$active_user->data['u_log_crew_new'];
                    $logs[$day][] = '
				<p><span class="time">' . ($ny ? '<span class="ny">Ny!</span> - ' : '') . '' . ess::$b->date->get($row['time'])->format("H:i") . ':</span> ' . $data . '</p>';
                    $e++;
                }
                foreach ($logs as $day => $items) {
                    echo '
		<div class="bg1_c">
			<h1 class="bg1">' . $day . '<span class="left2"></span><span class="right2"></span></h1>
			<div class="bg1">';
                    foreach ($items as $item) {
                        echo $item;
                    }
                    echo '
			</div>
		</div>';
                }
                echo '
		<p class="c">Viser ' . $pagei->count_page . ' av ' . $pagei->total . ' crewhendelse' . ($pagei->total == 1 ? '' : 'r') . '</p>';
                if ($pagei->pages > 1) {
                    echo '
		<p class="c">' . address::make($_GET, "", $pagei) . '</p>';
                }
            }
        }
        echo '
	</div>';
    }
<?php

require_once '../model/address.php';
require_once '../model/link_company_delivery_address.php';
//Création et ajout de l'adresse dans la base de données
if ($_GET) {
    $naddress = new address();
    foreach ($_GET as $key => $value) {
        if ($key != "id_company") {
            $nattr = "set" . ucfirst($key);
            $naddress->{$nattr}($value);
        }
    }
    $naddress->addToDatabase();
    $id_address = $naddress->getId();
    $id_company = $_GET["id_company"];
    $nlcda = new link_company_delivery_address();
    $nlcda->setId_company($id_company);
    $nlcda->setId_address($id_address);
    $nlcda->addToDatabase();
}
Exemple #24
0
<?php

/*
	[Destoon B2B System] Copyright (c) 2008-2015 www.destoon.com
	This is NOT a freeware, use is subject to license.txt
*/
$moduleid = 2;
require 'common.inc.php';
require DT_ROOT . '/module/' . $module . '/common.inc.php';
$_userid or dheader('login.php?forward=' . urlencode('address.php?action=' . $action));
require DT_ROOT . '/include/post.func.php';
require MD_ROOT . '/address.class.php';
$do = new address();
$head_name = $L['address_title'];
$head_title = $head_name . $DT['seo_delimiter'] . $head_title;
switch ($action) {
    case 'add':
        if (isset($_POST['ok'])) {
            if ($MG['address_limit']) {
                $r = $db->get_one("SELECT COUNT(*) AS num FROM {$DT_PRE}address WHERE username='******'");
                if ($r['num'] >= $MG['address_limit']) {
                    exit('max');
                }
            }
            foreach ($post as $k => $v) {
                $post[$k] = convert(input_trim($v), 'UTF-8', DT_CHARSET);
            }
            if ($do->pass($post)) {
                $post['username'] = $_username;
                $do->add($post);
                exit('ok');
//////////////////////////////////////////////////////////////////////////
//Quatrième bloc : Texte d'intro
$pdf->SetFont('Arial', '', 8);
$pdf->setY($pdf->GetY() + 2);
$pdf->MultiCell($pdf->w - 25, 3, utf8_decode($text_intro));
//////////////////////////////////////////////////////////////////////////
//Cinquième bloc : Détails de la commande
$pdf->setY($pdf->GetY() + 2);
$pdf->SecondTable($order);
checkIfDropPage($pdf, $order, $table_first, 20);
//Bloc DO :
$pdf->setY($pdf->GetY() + 2);
$pdf->SetTextColor(0);
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(180, 6, utf8_decode('Delivery Address : '), 0, 1, 'L', false);
$pdf->SetFont('Arial', '', 8);
$delivery_address = new address($order->getId_delivery_address());
$pdf->Cell(0, 5, utf8_decode($delivery_address->getLine() . ' ' . $delivery_address->getComplement()), 0, 1, 'L', false);
$pdf->Cell(0, 5, utf8_decode($delivery_address->getZip() . ' ' . $delivery_address->getCity() . ' ' . $delivery_address->getCountry()), 0, 1, 'L', false);
checkIfDropPage($pdf, $order, $table_first, 20);
/////////////////////////////////////////////////////////////////////////
//Sixième bloc : Texte de fin
$pdf->setY($pdf->GetY() + 5);
$pdf->SetFont('Arial', '', 8);
$pdf->SetTextColor(0);
$pdf->MultiCell($pdf->w - 25, 3, utf8_decode($text_fin));
//Pas besoin de celui-ci
$pdf->MultiCell($pdf->w - 25, 3, utf8_decode($order->getLine_bellow()));
//////////////////////////////////////////////////////////////////////////
//On sort le PDF avec le nom qui va bien
$pdf->Output($id_document . '_' . str_replace(' ', '', $company->getName()) . '.pdf', 'I');
echo HOME_URL;
?>
themes/images/serach.png">
          Address Id</label><?php 
echo form::text_field('address_id', $address->address_id, '10', '', '', 'System number', 'address_id', $readonly);
?>
         <a name="show" href="form.php?class_name=address&<?php 
echo "mode={$mode}";
?>
" class="show document_id address_id"><img src="<?php 
echo HOME_URL;
?>
themes/images/refresh.png"/></a> 
        </li>
        <li><label>Type</label><?php 
echo form::select_field_from_object('type', address::address_types(), 'option_line_code', 'option_line_code', $address->type, 'type', $readonly);
?>
    </li>
        <li><label>Address Name</label><?php 
echo form::text_field('address_name', $address->address_name, '20', '', '', 'Enter a valid address name', 'address_name', $readonly);
?>
    </li>
        <li><label><img class="tax_region_id select_popup clickable" src="<?php 
echo HOME_URL;
?>
themes/images/serach.png">
          Tax Region</label><?php 
$f->text_field_d('tax_region_name');
?>
</li>
        <li><label>Description</label><?php 
Exemple #27
0
require_once '../model/link_company_delivery_address.php';
require_once '../model/address.php';
require_once '../model/database.php';
$id_DA = $_GET["idDA"];
$id_c = $_GET["idC"];
$pdo = database::getInstance();
$pdo = $pdo->PDOInstance;
$stmt = $pdo->prepare('SELECT id FROM link_company_delivery_address WHERE id_company = :idc and id_address = :ida');
$stmt->bindParam(':idc', $id_c);
$stmt->bindParam(':ida', $id_DA);
$stmt->execute();
$result = $stmt->fetch();
$idLDA = $result['id'];
$lda = new link_company_delivery_address($idLDA);
$address = new address($lda->getId_address());
?>

<h2>Set this Address to Database</h2>
<form method="get" action="../controller/setLinkDA.php">
	<input type="hidden" name="idA" value="<?php 
echo $address->getId();
?>
">
	<input type="hidden" name="idC" value="<?php 
echo $id_c;
?>
">
	<div class="form-group">
		<label for="line">Line</label>
		<input type="text" class="form-control" name="line" value="<?php 
Exemple #28
0
 public function __construct($id = null)
 {
     global $user;
     // if an ID is passed in we'll look up the cart from the database...it means this is
     // probably a completed order an admin is looking at it via the order admin interface.
     //if (empty($id)) {
     //    global $order;
     //} else {
     //$order = new order($id);
     //}
     /*
             // check for this users billing method object.  If it hasn't been created yet then lets do it now.
             if (empty($order->billingmethod)) {
                 $order->billingmethod[0] = new billingmethod();
                 $order->billingmethod[0]->update(array('orders_id'=>$order->id)); 
             } */
     //if (empty($order->billingmethod[0]->addresses_id) && $user->isLoggedIn()) {
     //if ($user->isLoggedIn()) {
     if ($id == null) {
         // since this is a new billingmethod object, lets initialize it with the users billing address.
         global $order;
         $address = new address();
         //FJD $defaultaddy = $address->find('first', 'user_id='.$user->id.' AND is_default=1');
         if (empty($order->billingmethod)) {
             $order->billingmethod[0] = new billingmethod();
             $order->billingmethod[0]->update(array('orders_id' => @$order->id));
             // @ added to ditch notice when ecom is off
         }
         $billingAddy = $address->find('first', 'user_id=' . $user->id . ' AND is_billing=1');
         $order->billingmethod[0]->setAddress($billingAddy);
     } else {
         $order = new order($id);
         if (empty($order->id)) {
             return false;
         }
     }
     //}
     $this->address = new address($order->billingmethod[0]->addresses_id);
     //$this->address = new address($order->billingmethod[0]->id);
     $this->available_calculators = billing::listAvailableCalculators();
     $this->selectable_calculators = $this->selectableCalculators();
     $this->calculator_views = $this->getCalcViews();
     // if there is only one available calculator we'll force it on the user
     // also if the user hasn't selected a calculator yet well set it to a default.
     $number_of_calculators = count($this->available_calculators);
     if ($number_of_calculators == 1 || empty($order->billingmethod[0]->billingcalculator_id)) {
         reset($this->available_calculators);
         $calcid = key($this->available_calculators);
         $order->billingmethod[0]->update(array('billingcalculator_id' => $calcid));
     }
     if ($number_of_calculators > 0) {
         $calcname = $this->available_calculators[$order->billingmethod[0]->billingcalculator_id];
         $this->calculator = new $calcname($order->billingmethod[0]->billingcalculator_id);
     } else {
         $this->calculator = null;
     }
     $this->billingmethod = $order->billingmethod[0];
     $options = unserialize($this->billingmethod->billing_options);
     $this->info = empty($this->calculator->id) ? '' : $this->calculator->userView($options);
     foreach ($this->available_calculators as $key => $item) {
         $calc = new $item($key);
         $this->form[$key] = $calc->userForm();
     }
     // eDebug($this->form, true);
 }
<?php

$data = $_GET["address"];
$data = str_replace('\\', '', $data);
$data = json_decode($data, true);
$idFor = $data['idFor'];
$class = $data['for'];
$step = $data['step'];
require_once '../model/address.php';
require_once '../model/' . $class . '.php';
$address = new address();
foreach ($_GET as $key => $value) {
    if ($key != "next" && $key != "address") {
        $nkey = "set" . ucfirst($key);
        $address->{$nkey}($value);
    }
}
$address->addToDatabase();
$item = new $class($idFor);
$method = "setId_" . $step;
$item->{$method}($address->getId());
$item->setToDatabase();
$result = array('idAddress' => $address->getId(), 'address' => $address->printAddress());
echo json_encode($result);
Exemple #30
0
       </thead>
       <tbody class="form_data_line_tbody fa_asset_assignment_values" >
        <?php 
$count = 0;
$fa_asset_assignment_object_ai = new ArrayIterator($fa_asset_assignment_object);
$fa_asset_assignment_object_ai->seek($position);
while ($fa_asset_assignment_object_ai->valid()) {
    $fa_asset_assignment = $fa_asset_assignment_object_ai->current();
    if (!empty($fa_asset_assignment->hr_employee_id)) {
        $emp_details_l = hr_employee::find_by_id($fa_asset_assignment->hr_employee_id);
        $fa_asset_assignment->employee_name = $emp_details_l->first_name . ' ' . $emp_details_l->last_name;
    } else {
        $fa_asset_assignment->employee_name = null;
    }
    if (!empty($fa_asset_assignment->address_id)) {
        $address_l = address::find_by_id($fa_asset_assignment->address_id);
        $fa_asset_assignment->address_name = $address_l->address_name;
    } else {
        $fa_asset_assignment->address_name = null;
    }
    ?>
         
         <tr class="fa_asset_assignment<?php 
    echo $count;
    ?>
">
          <td>
           <?php 
    echo ino_inline_action($fa_asset_assignment->fa_asset_assignment_id, array('fa_asset_id' => ${$class}->fa_asset_id));
    ?>
          </td>