Esempio n. 1
0
     if (isset($data['auto_update']) and $data['auto_update'] == 1) {
         $cf->setAutoUpdate(TRUE);
     } else {
         $cf->setAutoUpdate(FALSE);
     }
     if (isset($data['is_base']) and $data['is_base'] == 1) {
         $cf->setBase(TRUE);
     } else {
         $cf->setBase(FALSE);
     }
     if (isset($data['is_default']) and $data['is_default'] == 1) {
         $cf->setDefault(TRUE);
     } else {
         $cf->setDefault(FALSE);
     }
     $cf->setRateModifyPercent($data['rate_modify_percent']);
     if ($cf->isValid()) {
         $cf->Save();
         //Redirect::Page( URLBuilder::getURL( array('id' => $data['id'], 'data_saved' => TRUE), 'EditCurrency.php') );
         Redirect::Page(URLBuilder::getURL(NULL, 'CurrencyList.php'));
         break;
     }
 default:
     if (isset($id)) {
         BreadCrumb::setCrumb($title);
         $clf = new CurrencyListFactory();
         $clf->getByIdAndCompanyId($id, $current_company->getId());
         foreach ($clf as $c_obj) {
             //Debug::Arr($branch,'branch', __FILE__, __LINE__, __METHOD__,10);
             $data = array('id' => $c_obj->getId(), 'status' => $c_obj->getStatus(), 'name' => $c_obj->getName(), 'iso_code' => $c_obj->getISOCode(), 'conversion_rate' => $c_obj->getConversionRate(), 'auto_update' => $c_obj->getAutoUpdate(), 'rate_modify_percent' => $c_obj->getRateModifyPercent(), 'actual_rate' => (double) $c_obj->getActualRate(), 'actual_rate_updated_date' => $c_obj->getActualRateUpdatedDate(), 'is_base' => $c_obj->getBase(), 'is_default' => $c_obj->getDefault(), 'created_date' => $c_obj->getCreatedDate(), 'created_by' => $c_obj->getCreatedBy(), 'updated_date' => $c_obj->getUpdatedDate(), 'updated_by' => $c_obj->getUpdatedBy(), 'deleted_date' => $c_obj->getDeletedDate(), 'deleted_by' => $c_obj->getDeletedBy());
         }