function handleFormData($edit_submit = false)
 {
     global $template, $WebBaseDir, $i18n, $ActiveOption, $StateOption, $AddIP, $userid, $group_ids;
     $apf_opportunity = DB_DataObject::factory('ApfOpportunity');
     if ($edit_submit) {
         $apf_opportunity->get($apf_opportunity->escape($_POST['ID']));
         $do_action = "updatesubmit";
     } else {
         $do_action = "addsubmit";
     }
     $apf_opportunity->setTitle(stripslashes(trim($_POST['title'])));
     $apf_opportunity->setAddrees(stripslashes(trim($_POST['addrees'])));
     $apf_opportunity->setPhone(stripslashes(trim($_POST['phone'])));
     $apf_opportunity->setFax(stripslashes(trim($_POST['fax'])));
     $apf_opportunity->setEmail(stripslashes(trim($_POST['email'])));
     $apf_opportunity->setHomepage(stripslashes(trim($_POST['homepage'])));
     $apf_opportunity->setLinkMan(stripslashes(trim($_POST['link_man'])));
     $apf_opportunity->setMemo(stripslashes(trim($_POST['memo'])));
     $apf_opportunity->setState(stripslashes(trim($_POST['state'])));
     $apf_opportunity->setActive(stripslashes(trim($_POST['active'])));
     $apf_opportunity->setAddIp($AddIP);
     $apf_opportunity->setGroupid($group_ids);
     $apf_opportunity->setUserid($userid);
     $val = $apf_opportunity->validate();
     if ($val === TRUE) {
         if ($edit_submit) {
             $apf_opportunity->setUpdateAt(DB_DataObject_Cast::dateTime());
             $apf_opportunity->update();
             $log_string = $i18n->_("Update") . $i18n->_("Opportunity") . "\t{$_POST['title']}=>{$_POST['ID']}";
             logFileString($log_string);
             $this->forward("opportunity/apf_opportunity/update/" . $_POST['ID'] . "/ok");
         } else {
             $apf_opportunity->setCreatedAt(DB_DataObject_Cast::dateTime());
             $apf_opportunity->insert();
             $log_string = $i18n->_("Create") . $i18n->_("Opportunity") . "\t{$_POST['title']}";
             logFileString($log_string);
             $this->forward("opportunity/apf_opportunity/");
         }
     } else {
         $template->setFile(array("MAIN" => "apf_opportunity_edit.html"));
         $template->setBlock("MAIN", "edit_block");
         array_shift($ActiveOption);
         $template->setVar(array("WEBDIR" => $WebBaseDir, "ACTIVEOPTION" => radioTag("active", $ActiveOption, $_POST['active']), "STATE_OPTION" => radioTag("state", $StateOption, $_POST['state']), "MEMO_TEXT" => textareaTag("memo", $_POST['memo'], false, "ROWS=\"15\" COLS=\"60\" "), "DOACTION" => $do_action));
         foreach ($val as $k => $v) {
             if ($v == false) {
                 $template->setVar(array(strtoupper($k) . "_ERROR_MSG" => " ↓ " . $i18n->_("Please check here") . " ↓ "));
             }
         }
         $template->setVar(array("ID" => $_POST['id'], "TITLE" => $_POST['title'], "ADDREES" => $_POST['addrees'], "PHONE" => $_POST['phone'], "FAX" => $_POST['fax'], "EMAIL" => $_POST['email'], "HOMEPAGE" => $_POST['homepage'], "LINK_MAN" => $_POST['link_man'], "MEMO" => $_POST['memo'], "STATE" => $_POST['state'], "ACTIVE" => $_POST['active'], "ADD_IP" => $_POST['add_ip'], "CREATED_AT" => $_POST['created_at'], "UPDATE_AT" => $_POST['update_at']));
     }
 }
 function executeUpdate()
 {
     global $template, $WebBaseDir, $AccessOption, $controller, $i18n;
     $template->setFile(array("MAIN" => "apf_folders_edit.html"));
     $template->setBlock("MAIN", "edit_block");
     $apf_folders = DB_DataObject::factory('ApfFolders');
     $apf_folders->get($apf_folders->escape($controller->getID()));
     if ($controller->getURLParam(1) == "ok") {
         $template->setVar(array("SUCCESS_CLASS" => "save-ok", "SUCCESS_MSG" => "<h2>" . $i18n->_("Your modifications have been saved") . "</h2>"));
     }
     $template->setVar(array("ID" => $apf_folders->getId(), "NAME" => $apf_folders->getName(), "PARENT" => $apf_folders->getParent(), "DIRPATH" => $apf_folders->getDirpath(), "DESCRIPTION" => $apf_folders->getDescription(), "PASSWORD" => $apf_folders->getPassword(), "GROUPID" => $apf_folders->getGroupid(), "USERID" => $apf_folders->getUserid(), "ACTIVE" => $apf_folders->getActive(), "ADD_IP" => $apf_folders->getAddIp(), "CREATED_AT" => $apf_folders->getCreatedAt(), "UPDATE_AT" => $apf_folders->getUpdateAt()));
     array_shift($AccessOption);
     $template->setVar(array("WEBDIR" => $WebBaseDir, "ACCESSOPTION" => radioTag("access", $AccessOption, $apf_folders->getAccess()), "DOACTION" => "updatesubmit"));
 }
Exemplo n.º 3
0
 function handleFormData($edit_submit = false)
 {
     global $template, $WebBaseDir, $i18n, $AddIP, $userid, $group_ids, $AccessOption, $ReviewwayOption;
     $apf_review = DB_DataObject::factory('ApfReview');
     if ($edit_submit) {
         $apf_review->get($apf_review->escape($_POST['ID']));
         $do_action = "updatesubmit";
     } else {
         $do_action = "addsubmit";
     }
     $apf_review->setCompany(stripslashes(trim($_POST['company'])));
     $apf_review->setLinkman(stripslashes(trim($_POST['linkman'])));
     $apf_review->setReviewdate(stripslashes(trim($_POST['reviewdate'])));
     $apf_review->setCategory(stripslashes(trim($_POST['category'])));
     $apf_review->setContent(stripslashes(trim($_POST['content'])));
     $apf_review->setAccess(stripslashes(trim($_POST['access'])));
     $apf_review->setActive(stripslashes(trim($_POST['active'])));
     $apf_review->setAddIp($AddIP);
     $apf_review->setGroupid($group_ids);
     $apf_review->setUserid($userid);
     $val = $apf_review->validate();
     if ($val === TRUE) {
         if ($edit_submit) {
             $apf_review->setUpdateAt(DB_DataObject_Cast::dateTime());
             $apf_review->update();
             $log_string = $i18n->_("Update") . $i18n->_("ModuleName") . "\t{$_POST['name']}=>{$_POST['ID']}";
             logFileString($log_string);
             $this->forward("review/apf_review/update/" . $_POST['ID'] . "/ok");
         } else {
             $apf_review->setCreatedAt(DB_DataObject_Cast::dateTime());
             $apf_review->insert();
             $log_string = $i18n->_("Create") . $i18n->_("ModuleName") . "\t{$_POST['name']}=>{$_POST['create_date']}";
             logFileString($log_string);
             $this->forward("review/apf_review/");
         }
     } else {
         $template->setFile(array("MAIN" => "apf_review_edit.html"));
         $template->setBlock("MAIN", "edit_block");
         array_shift($AccessOption);
         array_shift($ReviewwayOption);
         $template->setVar(array("WEBDIR" => $WebBaseDir, "REVIEW_DATE" => inputDateTag("reviewdate", $_POST['reviewdate']), "ACCESSOPTION" => radioTag("access", $AccessOption, $_POST['access']), "CATEGORY_OPTION" => radioTag("category", $ReviewwayOption, $_POST['category']), "CONTENT_TEXT" => textareaTag('content', $_POST['content'], false, "ROWS=\"8\" COLS=\"40\""), "DOACTION" => $do_action));
         foreach ($val as $k => $v) {
             if ($v == false) {
                 $template->setVar(array(strtoupper($k) . "_ERROR_MSG" => " &darr; " . $i18n->_("Please check here") . " &darr; "));
             }
         }
         $template->setVar(array("ID" => $_POST['id'], "COMPANY" => $_POST['company'], "LINKMAN" => $_POST['linkman'], "REVIEWDATE" => $_POST['reviewdate'], "CATEGORY" => $_POST['category'], "CONTENT" => $_POST['content'], "GROUPID" => $_POST['groupid'], "USERID" => $_POST['userid'], "ACCESS" => $_POST['access'], "ACTIVE" => $_POST['active'], "ADD_IP" => $_POST['add_ip'], "CREATED_AT" => $_POST['created_at'], "UPDATE_AT" => $_POST['update_at']));
     }
 }
Exemplo n.º 4
0
 function executeUpdate()
 {
     global $template, $WebBaseDir, $controller, $GenderOption, $ActiveOption;
     $template->setFile(array("MAIN" => "apf_users_edit.html"));
     $template->setBlock("MAIN", "edit_block");
     $apf_users = DB_DataObject::factory('ApfUsers');
     $apf_users->get($apf_users->escape($controller->getID()));
     if ($controller->getURLParam(1) == "ok") {
         $template->setVar(array("SUCCESS_CLASS" => "save-ok", "SUCCESS_MSG" => "<h2>Your modifications have been saved</h2>"));
     }
     array_shift($GenderOption);
     array_shift($ActiveOption);
     $template->setVar(array("ID" => $apf_users->getId(), "USER_NAME" => $apf_users->getUserName(), "OLD_PASSWORD" => $apf_users->getUserPwd(), "GENDER" => $apf_users->getGender(), "ADDREES" => $apf_users->getAddrees(), "PHONE" => $apf_users->getPhone(), "EMAIL" => $apf_users->getEmail(), "PHOTO" => $apf_users->getPhoto(), "ROLE_ID" => $apf_users->getRoleId(), "ACTIVE" => $apf_users->getActive(), "ADD_IP" => $apf_users->getAddIp(), "CREATED_AT" => $apf_users->getCreatedAt(), "UPDATE_AT" => $apf_users->getUpdateAt()));
     $template->setVar(array("GENDEROPTION" => radioTag("gender", $GenderOption, $apf_users->getGender()), "ACTIVEOPTION" => radioTag("active", $ActiveOption, $apf_users->getActive()), "FILEPHOTO" => fileTag("photo", $apf_users->getPhoto()), "WEBDIR" => $WebBaseDir, "DOACTION" => "updatesubmit"));
 }
 function executeUpdate()
 {
     global $template, $WebBaseDir, $controller, $i18n, $ActiveOption;
     $template->setFile(array("MAIN" => "apf_product_category_edit.html"));
     $template->setBlock("MAIN", "edit_block");
     $template->setVar(array("WEBDIR" => $WebBaseDir, "DOACTION" => "updatesubmit"));
     $apf_product_category = DB_DataObject::factory('ApfProductCategory');
     $apf_product_category->get($apf_product_category->escape($controller->getID()));
     if ($controller->getURLParam(1) == "ok") {
         $template->setVar(array("SUCCESS_CLASS" => "save-ok", "SUCCESS_MSG" => "<h2>" . $i18n->_("Your modifications have been saved") . "</h2>"));
     }
     $template->setVar(array("ID" => $apf_product_category->getId(), "CATEGORY_NAME" => $apf_product_category->getCategoryName(), "ACTIVE" => $apf_product_category->getActive(), "ADD_IP" => $apf_product_category->getAddIp(), "CREATED_AT" => $apf_product_category->getCreatedAt(), "UPDATE_AT" => $apf_product_category->getUpdateAt()));
     array_shift($ActiveOption);
     $template->setVar(array("ACTIVEOPTION" => radioTag("active", $ActiveOption, $apf_product_category->getActive())));
 }
Exemplo n.º 6
0
 function handleFormData($edit_submit = false)
 {
     global $template, $WebBaseDir, $i18n, $ActiveOption, $AddIP, $userid, $group_ids;
     $apf_news = DB_DataObject::factory('ApfNews');
     if ($edit_submit) {
         $apf_news->get($apf_news->escape($_POST['ID']));
         $do_action = "updatesubmit";
     } else {
         $do_action = "addsubmit";
     }
     $apf_news->setCategoryId(stripslashes(trim($_POST['category_id'])));
     $apf_news->setTitle(stripslashes(trim($_POST['title'])));
     $apf_news->setContent(stripslashes(trim($_POST['content'])));
     $apf_news->setActive(stripslashes(trim($_POST['active'])));
     $apf_finance->setAddIp($AddIP);
     $apf_finance->setGroupid($group_ids);
     $apf_finance->setUserid($userid);
     $val = $apf_news->validate();
     if ($val === TRUE) {
         if ($edit_submit) {
             $apf_news->setUpdateAt(DB_DataObject_Cast::dateTime());
             $apf_news->update();
             $log_string = $i18n->_("Update") . $i18n->_("News") . "\t{$_POST['title']}=>{$_POST['ID']}";
             logFileString($log_string);
             $this->forward("news/apf_news/update/" . $_POST['ID'] . "/ok");
         } else {
             $apf_news->setCreatedAt(DB_DataObject_Cast::dateTime());
             $apf_news->insert();
             $log_string = $i18n->_("Create") . $i18n->_("News") . "\t{$_POST['title']}";
             logFileString($log_string);
             $this->forward("news/apf_news/");
         }
     } else {
         $template->setFile(array("MAIN" => "apf_news_edit.html"));
         $template->setBlock("MAIN", "edit_block");
         $template->setVar(array("WEBDIR" => $WebBaseDir, "DOACTION" => $do_action));
         $category_arr = $this->getCategory();
         array_shift($ActiveOption);
         $template->setVar(array("ACTIVEOPTION" => radioTag("active", $ActiveOption, $_POST['active']), "CATEGORYOPTION" => selectTag("category_id", $category_arr, $_POST['category_id'])));
         foreach ($val as $k => $v) {
             if ($v == false) {
                 $template->setVar(array(strtoupper($k) . "_ERROR_MSG" => " &darr; " . $i18n->_("Please check here") . " &darr; "));
             }
         }
         $template->setVar(array("ID" => $_POST['id'], "CATEGORY_ID" => $_POST['category_id'], "TITLE" => $_POST['title'], "CONTENT" => $_POST['content'], "ACTIVE" => $_POST['active'], "ADD_IP" => $_POST['add_ip'], "CREATED_AT" => $_POST['created_at'], "UPDATE_AT" => $_POST['update_at']));
     }
 }
 function handleFormData($edit_submit = false)
 {
     global $template, $WebBaseDir, $i18n, $ActiveOption;
     $apf_news_category = DB_DataObject::factory('ApfNewsCategory');
     if ($edit_submit) {
         $apf_news_category->get($apf_news_category->escape($_POST['ID']));
         $do_action = "updatesubmit";
     } else {
         $do_action = "addsubmit";
     }
     $apf_news_category->setCategoryName(stripslashes(trim($_POST['category_name'])));
     $apf_news_category->setOrderid(stripslashes(trim($_POST['orderid'])));
     $apf_news_category->setActive(stripslashes(trim($_POST['active'])));
     $apf_news_category->setAddIp(stripslashes(trim($_POST['add_ip'])));
     $apf_news_category->setCreatedAt(stripslashes(trim($_POST['created_at'])));
     $apf_news_category->setUpdateAt(stripslashes(trim($_POST['update_at'])));
     $val = $apf_news_category->validate();
     if ($val === TRUE) {
         if ($edit_submit) {
             $apf_news_category->setUpdateAt(DB_DataObject_Cast::dateTime());
             $apf_news_category->update();
             $log_string = $i18n->_("Update") . $i18n->_("NewsCategory") . "\t{$_POST['category_name']}=>{$_POST['ID']}";
             logFileString($log_string);
             $this->forward("news/apf_news_category/update/" . $_POST['ID'] . "/ok");
         } else {
             $apf_news_category->setCreatedAt(DB_DataObject_Cast::dateTime());
             $insert_id = $apf_news_category->insert();
             $log_string = $i18n->_("Create") . $i18n->_("NewsCategory") . "\t{$_POST['category_name']}";
             logFileString($log_string);
             $apf_news_category->get($insert_id);
             $apf_news_category->setOrderid($insert_id);
             $apf_news_category->update();
             $this->forward("news/apf_news_category/");
         }
     } else {
         $template->setFile(array("MAIN" => "apf_news_category_edit.html"));
         $template->setBlock("MAIN", "edit_block");
         array_shift($ActiveOption);
         $template->setVar(array("WEBDIR" => $WebBaseDir, "ACTIVEOPTION" => radioTag("active", $ActiveOption, $_POST['active']), "DOACTION" => $do_action));
         foreach ($val as $k => $v) {
             if ($v == false) {
                 $template->setVar(array(strtoupper($k) . "_ERROR_MSG" => " &darr; " . $i18n->_("Please check here") . " &darr; "));
             }
         }
         $template->setVar(array("ID" => $_POST['ID'], "CATEGORY_NAME" => $_POST['category_name'], "ORDERID" => $_POST['orderid'], "ACTIVE" => $_POST['active'], "ADD_IP" => $_POST['add_ip'], "CREATED_AT" => $_POST['created_at'], "UPDATE_AT" => $_POST['update_at']));
     }
 }
Exemplo n.º 8
0
 function executeUpdate()
 {
     global $template, $userid, $luadmin, $LU, $i18n, $WebBaseDir, $ClassDir, $controller, $GenderOption, $ActiveOption, $WebTemplateDir;
     include_once $ClassDir . "URLHelper.class.php";
     $template->setFile(array("MAIN" => "apf_users_edit.html"));
     $template->setBlock("MAIN", "edit_block");
     $apf_users = DB_DataObject::factory('ApfUsers');
     $apf_users->get($apf_users->escape($controller->getID()));
     if ($controller->getURLParam(1) == "ok") {
         $template->setVar(array("SUCCESS_CLASS" => "save-ok", "SUCCESS_MSG" => "<h2>Your modifications have been saved</h2>"));
     }
     $groups = $luadmin->perm->getGroups();
     foreach ($groups as $data) {
         $category_arr[$data['group_id']] = $data['group_define_name'];
     }
     $user_group = $this->getGroupByUserid($controller->getID());
     $group_id = $user_group['group_id'];
     array_shift($GenderOption);
     array_shift($ActiveOption);
     $template->setVar(array("ID" => $apf_users->getId(), "USER_NAME" => $apf_users->getUserName(), "REALNAME" => $apf_users->getRealname(), "OLD_PASSWORD" => $apf_users->getUserPwd(), "GENDER" => $apf_users->getGender(), "ADDREES" => $apf_users->getAddrees(), "PHONE" => $apf_users->getPhone(), "EMAIL" => $apf_users->getEmail(), "PHOTO" => $apf_users->getPhoto(), "ROLE_ID" => $apf_users->getRoleId(), "ACTIVE" => $apf_users->getActive(), "ADD_IP" => $apf_users->getAddIp(), "CREATED_AT" => $apf_users->getCreatedAt(), "UPDATE_AT" => $apf_users->getUpdateAt()));
     $template->setVar(array("WEBDIR" => $WebBaseDir, "OLD_GROUP" => $group_id, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "GENDEROPTION" => radioTag("gender", $GenderOption, $apf_users->getGender()), "ACTIVEOPTION" => radioTag("active", $ActiveOption, $apf_users->getActive()), "FILEPHOTO" => fileTag("photo", $apf_users->getPhoto()), "MEMO_TEXT" => textareaTag('memo', $apf_users->getMemo(), false, "ROWS=\"8\" COLS=\"40\""), "GROUPOPTION" => selectTag("group", $category_arr, $group_id), "WEBDIR" => $WebBaseDir, "DOACTION" => "updatesubmit"));
 }
 function handleFormData($edit_submit = false)
 {
     global $template, $WebBaseDir, $i18n, $ActiveOption, $ClassDir, $UploadDir, $AllowUploadFilesType, $AddIP, $userid, $group_ids;
     $apf_product = DB_DataObject::factory('ApfProduct');
     if ($edit_submit) {
         $apf_product->get($apf_product->escape($_POST['ID']));
         $do_action = "updatesubmit";
     } else {
         $do_action = "addsubmit";
     }
     $apf_product->setCategory(stripslashes(trim($_POST['category'])));
     $apf_product->setCompanyId(stripslashes(trim($_POST['company_id'])));
     $apf_product->setName(stripslashes(trim($_POST['name'])));
     $apf_product->setPrice(stripslashes(trim($_POST['price'])));
     $apf_product->setMemo(stripslashes(trim($_POST['memo'])));
     $apf_product->setActive(stripslashes(trim($_POST['active'])));
     $apf_product->setAddIp($AddIP);
     $apf_product->setGroupid($group_ids);
     $apf_product->setUserid($userid);
     if ($_POST['photo_del'] == 'Y') {
         unlink($UploadDir . $_POST['photo_old']);
         $apf_product->setPhoto("");
         $_POST['photo_old'] = "";
     }
     if ($_POST['upload_temp']) {
         $apf_product->setPhoto($_POST['upload_temp']);
     }
     $allow_upload_file = TRUE;
     if ($_FILES['photo']['name']) {
         require_once $ClassDir . "FileHelper.class.php";
         $upload_data = FileHelper::uploadFile("product");
         $allow_upload_file = $upload_data["upload_state"];
         if ($allow_upload_file) {
             $photos_arr = $upload_data["upload_msg"];
             if ($photo_pic = $photos_arr['photo']) {
                 $apf_product->setPhoto($photo_pic);
                 $_POST['upload_temp'] = $photo_pic;
             }
         } else {
             $upload_error_msg = $upload_data["upload_msg"];
         }
     }
     $val = $apf_product->validate();
     if ($val === TRUE && $allow_upload_file === TRUE) {
         if ($edit_submit) {
             $apf_product->setUpdateAt(DB_DataObject_Cast::dateTime());
             $apf_product->update();
             $log_string = $i18n->_("Update") . $i18n->_("Product") . "\t{$_POST['name']}=>{$_POST['ID']}";
             logFileString($log_string);
             $this->forward("product/apf_product/update/" . $_POST['ID'] . "/ok");
         } else {
             $apf_product->setCreatedAt(DB_DataObject_Cast::dateTime());
             $apf_product->insert();
             $log_string = $i18n->_("Create") . $i18n->_("Product") . "\t{$_POST['name']}";
             logFileString($log_string);
             $this->forward("product/apf_product/");
         }
     } else {
         $template->setFile(array("MAIN" => "apf_product_edit.html"));
         $template->setBlock("MAIN", "edit_block");
         $template->setVar(array("WEBDIR" => $WebBaseDir, "DOACTION" => $do_action));
         $category_arr = $this->getCategory();
         array_shift($ActiveOption);
         $template->setVar(array("CATEGORYOPTION" => selectTag("category", $category_arr, $_POST['category']), "FILEPHOTO" => fileTag("photo", $_POST['photo_old']), "ACTIVEOPTION" => radioTag("active", $ActiveOption, $_POST['active'])));
         foreach ($val as $k => $v) {
             if ($v == false) {
                 $template->setVar(array(strtoupper($k) . "_ERROR_MSG" => " &darr; " . $i18n->_("Please check here") . " &darr; "));
             }
         }
         $template->setVar(array("ID" => $_POST['id'], "CATEGORY" => $_POST['category'], "COMPANY_ID" => $_POST['company_id'], "NAME" => $_POST['name'], "PRICE" => $_POST['price'], "PHOTO" => $_POST['photo'], "MEMO" => $_POST['memo'], "ACTIVE" => $_POST['active'], "ADD_IP" => $_POST['add_ip'], "CREATED_AT" => $_POST['created_at'], "UPDATE_AT" => $_POST['update_at']));
     }
 }
Exemplo n.º 10
0
 function handleFormData($edit_submit = false)
 {
     global $template, $WebBaseDir, $i18n, $ActiveOption, $UploadDir, $ClassDir, $AllowUploadFilesType, $AddIP, $userid, $group_ids;
     $apf_company = DB_DataObject::factory('ApfCompany');
     if ($edit_submit) {
         $apf_company->get($apf_company->escape($_POST['ID']));
         $do_action = "updatesubmit";
     } else {
         $do_action = "addsubmit";
     }
     $apf_company->setName(stripslashes(trim($_POST['name'])));
     $apf_company->setAddrees(stripslashes(trim($_POST['addrees'])));
     $apf_company->setPhone(stripslashes(trim($_POST['phone'])));
     $apf_company->setFax(stripslashes(trim($_POST['fax'])));
     $apf_company->setEmail(stripslashes(trim($_POST['email'])));
     $apf_company->setPhoto(stripslashes(trim($_POST['photo'])));
     $apf_company->setHomepage(stripslashes(trim($_POST['homepage'])));
     $apf_company->setEmployee(stripslashes(trim($_POST['employee'])));
     $apf_company->setBankroll(stripslashes(trim($_POST['bankroll'])));
     $apf_company->setLinkMan(stripslashes(trim($_POST['link_man'])));
     $apf_company->setIncorporator(stripslashes(trim($_POST['incorporator'])));
     $apf_company->setIndustry(stripslashes(trim($_POST['industry'])));
     $apf_company->setProducts(stripslashes(trim($_POST['products'])));
     $apf_company->setMemo(stripslashes(trim($_POST['memo'])));
     $apf_company->setActive(stripslashes(trim($_POST['active'])));
     $apf_company->setAddIp($AddIP);
     $apf_company->setGroupid($group_ids);
     $apf_company->setUserid($userid);
     if ($_POST['photo_del'] == 'Y') {
         unlink($UploadDir . $_POST['photo_old']);
         $apf_company->setPhoto("");
         $_POST['photo_old'] = "";
     }
     if ($_POST['upload_temp']) {
         $apf_company->setPhoto($_POST['upload_temp']);
     }
     $allow_upload_file = TRUE;
     if ($_FILES['photo']['name']) {
         require_once $ClassDir . "FileHelper.class.php";
         $upload_data = FileHelper::uploadFile("company");
         $allow_upload_file = $upload_data["upload_state"];
         if ($allow_upload_file) {
             $photos_arr = $upload_data["upload_msg"];
             if ($photo_pic = $photos_arr['photo']) {
                 $apf_company->setPhoto($photo_pic);
                 $_POST['upload_temp'] = $photo_pic;
             }
         } else {
             $upload_error_msg = $upload_data["upload_msg"];
         }
     }
     $val = $apf_company->validate();
     if ($val === TRUE) {
         if ($edit_submit) {
             $apf_company->setUpdateAt(DB_DataObject_Cast::dateTime());
             $apf_company->update();
             $log_string = $i18n->_("Update") . $i18n->_("Company") . "\t{$_POST['name']}=>{$_POST['ID']}";
             logFileString($log_string);
             $this->forward("company/apf_company/update/" . $_POST['ID'] . "/ok");
         } else {
             $apf_company->setCreatedAt(DB_DataObject_Cast::dateTime());
             $apf_company->insert();
             $log_string = $i18n->_("Create") . $i18n->_("Company") . "\t{$_POST['name']}";
             logFileString($log_string);
             $this->forward("company/apf_company/");
         }
     } else {
         $template->setFile(array("MAIN" => "apf_company_edit.html"));
         $template->setBlock("MAIN", "edit_block");
         foreach ($val as $k => $v) {
             if ($v == false) {
                 $template->setVar(array(strtoupper($k) . "_ERROR_MSG" => " &darr; " . $i18n->_("Please check here") . " &darr; "));
             }
         }
         $template->setVar(array("ID" => $_POST['id'], "NAME" => $_POST['name'], "ADDREES" => $_POST['addrees'], "PHONE" => $_POST['phone'], "FAX" => $_POST['fax'], "EMAIL" => $_POST['email'], "PHOTO" => $_POST['photo'], "HOMEPAGE" => $_POST['homepage'], "EMPLOYEE" => $_POST['employee'], "BANKROLL" => $_POST['bankroll'], "LINK_MAN" => $_POST['link_man'], "INCORPORATOR" => $_POST['incorporator'], "INDUSTRY" => $_POST['industry'], "PRODUCTS" => $_POST['products'], "MEMO" => $_POST['memo'], "ACTIVE" => $_POST['active'], "ADD_IP" => $_POST['add_ip'], "CREATED_AT" => $_POST['created_at'], "UPDATE_AT" => $_POST['update_at']));
         array_shift($ActiveOption);
         $template->setVar(array("FILEPHOTO" => fileTag("photo", $_POST['photo_old']), "WEBDIR" => $WebBaseDir, "ACTIVEOPTION" => radioTag("active", $ActiveOption, $_POST['active']), "DOACTION" => $do_action));
     }
 }
Exemplo n.º 11
0
 function handleFormData($edit_submit = false)
 {
     global $template, $WebBaseDir, $i18n, $ActiveOption, $DebitOption, $AddIP, $userid, $group_ids;
     $apf_finance = DB_DataObject::factory('ApfFinance');
     if ($edit_submit) {
         $apf_finance->get($apf_finance->escape($_POST['ID']));
         $do_action = "updatesubmit";
     } else {
         $do_action = "addsubmit";
     }
     $apf_finance->setCategory(stripslashes(trim($_POST['category'])));
     $apf_finance->setCreateDate(stripslashes(trim($_POST['create_date'])));
     $apf_finance->setAmount(stripslashes(trim($_POST['amount'])));
     $apf_finance->setDebit(stripslashes(trim($_POST['debit'])));
     $apf_finance->setMoney(stripslashes(trim($_POST['money'])));
     $apf_finance->setMemo(stripslashes(trim($_POST['memo'])));
     $apf_finance->setActive(stripslashes(trim($_POST['active'])));
     $apf_finance->setAddIp($AddIP);
     $apf_finance->setGroupid($group_ids);
     $apf_finance->setUserid($userid);
     $val = $apf_finance->validate();
     if ($val === TRUE) {
         if ($edit_submit) {
             $apf_finance->setUpdateAt(DB_DataObject_Cast::dateTime());
             $apf_finance->update();
             $log_string = $i18n->_("Update") . $i18n->_("Finance") . "\t{$_POST['money']}=>{$_POST['ID']}";
             logFileString($log_string);
             $this->forward("finance/apf_finance/update/" . $_POST['ID'] . "/ok");
         } else {
             $apf_finance->setCreatedAt(DB_DataObject_Cast::dateTime());
             $apf_finance->insert();
             $log_string = $i18n->_("Create") . $i18n->_("Finance") . "\t{$_POST['money']}=>{$_POST['create_date']}";
             logFileString($log_string);
             $this->forward("finance/apf_finance/");
         }
     } else {
         $template->setFile(array("MAIN" => "apf_finance_edit.html"));
         $template->setBlock("MAIN", "edit_block");
         $template->setVar(array("WEBDIR" => $WebBaseDir, "DOACTION" => $do_action));
         foreach ($val as $k => $v) {
             if ($v == false) {
                 $template->setVar(array(strtoupper($k) . "_ERROR_MSG" => " &darr; " . $i18n->_("Please check here") . " &darr; "));
             }
         }
         $template->setVar(array("ID" => $_POST['ID'], "CATEGORY" => $_POST['category'], "CREATE_DATE" => $_POST['create_date'], "AMOUNT" => $_POST['amount'], "DEBIT" => $_POST['debit'], "MONEY" => $_POST['money'], "MEMO" => $_POST['memo'], "ACTIVE" => $_POST['active'], "ADD_IP" => $_POST['add_ip'], "CREATED_AT" => $_POST['created_at'], "UPDATE_AT" => $_POST['update_at']));
         $category_arr = $this->getCategory();
         array_shift($ActiveOption);
         array_shift($DebitOption);
         $template->setVar(array("CATEGORYOPTION" => selectTag("category", $category_arr, $_POST['category']), "CREATEDATE" => inputDateTag("create_date", $_POST['create_date']), "AMOUNTTEXT" => textTag("amount", $_POST['amount']), "ACTIVEOPTION" => radioTag("active", $ActiveOption, $_POST['active']), "DEBITOPTION" => radioTag("debit", $DebitOption, $_POST['debit'])));
     }
 }
 function handleFormData($edit_submit = false)
 {
     global $template, $WebBaseDir, $i18n, $AddIP, $userid, $group_ids, $AccessOption;
     $apf_agreement = DB_DataObject::factory('ApfAgreement');
     if ($edit_submit) {
         $apf_agreement->get($apf_agreement->escape($_POST['ID']));
         $do_action = "updatesubmit";
     } else {
         $do_action = "addsubmit";
     }
     $apf_agreement->setNoid(stripslashes(trim($_POST['noid'])));
     $apf_agreement->setCategory(stripslashes(trim($_POST['category'])));
     $apf_agreement->setEffectdate(stripslashes(trim($_POST['effectdate'])));
     $apf_agreement->setExpireddate(stripslashes(trim($_POST['expireddate'])));
     $apf_agreement->setBuyer(stripslashes(trim($_POST['buyer'])));
     $apf_agreement->setVender(stripslashes(trim($_POST['vender'])));
     $apf_agreement->setBuyersignature(stripslashes(trim($_POST['buyersignature'])));
     $apf_agreement->setVendersignature(stripslashes(trim($_POST['vendersignature'])));
     $apf_agreement->setDescription(stripslashes(trim($_POST['description'])));
     $apf_agreement->setAccess(stripslashes(trim($_POST['access'])));
     $apf_agreement->setActive(stripslashes(trim($_POST['active'])));
     $apf_agreement->setAddIp($AddIP);
     $apf_agreement->setGroupid($group_ids);
     $apf_agreement->setUserid($userid);
     $val = $apf_agreement->validate();
     if ($val === TRUE) {
         if ($edit_submit) {
             $apf_agreement->setUpdateAt(DB_DataObject_Cast::dateTime());
             $apf_agreement->update();
             $log_string = $i18n->_("Update") . $i18n->_("ModuleName") . "\t{$_POST['name']}=>{$_POST['ID']}";
             logFileString($log_string);
             $this->forward("agreement/apf_agreement/update/" . $_POST['ID'] . "/ok");
         } else {
             $apf_agreement->setCreatedAt(DB_DataObject_Cast::dateTime());
             $apf_agreement->insert();
             $log_string = $i18n->_("Create") . $i18n->_("ModuleName") . "\t{$_POST['name']}=>{$_POST['create_date']}";
             logFileString($log_string);
             $this->forward("agreement/apf_agreement/");
         }
     } else {
         $template->setFile(array("MAIN" => "apf_agreement_edit.html"));
         $template->setBlock("MAIN", "edit_block");
         $category_arr = $this->getCategory();
         array_shift($AccessOption);
         $template->setVar(array("WEBDIR" => $WebBaseDir, "CATEGORYOPTION" => selectTag("category", $category_arr, $_POST['category']), "EFFECT_DATE" => inputDateTag("effectdate", $_POST['effectdate']), "EXPIRED_DATE" => inputDateTag("expireddate", $_POST['expireddate']), "ACCESSOPTION" => radioTag("access", $AccessOption, $_POST['access']), "DESCRIPTION_TEXT" => textareaTag('description', $_POST['description'], false, "ROWS=\"8\" COLS=\"40\""), "DOACTION" => $do_action));
         foreach ($val as $k => $v) {
             if ($v == false) {
                 $template->setVar(array(strtoupper($k) . "_ERROR_MSG" => " &darr; " . $i18n->_("Please check here") . " &darr; "));
             }
         }
         $template->setVar(array("ID" => $_POST['id'], "NOID" => $_POST['noid'], "CATEGORY" => $_POST['category'], "EFFECTDATE" => $_POST['effectdate'], "EXPIREDDATE" => $_POST['expireddate'], "BUYER" => $_POST['buyer'], "VENDER" => $_POST['vender'], "BUYERSIGNATURE" => $_POST['buyersignature'], "VENDERSIGNATURE" => $_POST['vendersignature'], "DESCRIPTION" => $_POST['description'], "GROUPID" => $_POST['groupid'], "USERID" => $_POST['userid'], "ACCESS" => $_POST['access'], "ACTIVE" => $_POST['active'], "ADD_IP" => $_POST['add_ip'], "CREATED_AT" => $_POST['created_at'], "UPDATE_AT" => $_POST['update_at']));
     }
 }
Exemplo n.º 13
0
 function handleFormData($edit_submit = false)
 {
     global $template, $WebBaseDir, $i18n, $AddIP, $userid, $group_ids, $OrderStateOption, $AccessOption, $PaywayOption, $DeliverywayOption;
     $apf_order = DB_DataObject::factory('ApfOrder');
     if ($edit_submit) {
         $apf_order->get($apf_order->escape($_POST['ID']));
         $do_action = "updatesubmit";
     } else {
         $do_action = "addsubmit";
     }
     $apf_order->setNoid(stripslashes(trim($_POST['noid'])));
     $apf_order->setCategory(stripslashes(trim($_POST['category'])));
     $apf_order->setContactid(stripslashes(trim($_POST['contactid'])));
     $apf_order->setProduct(stripslashes(trim($_POST['product'])));
     $apf_order->setAmount(stripslashes(trim($_POST['amount'])));
     $apf_order->setMoney(stripslashes(trim($_POST['money'])));
     $apf_order->setDiscount(stripslashes(trim($_POST['discount'])));
     $apf_order->setPayway(stripslashes(trim($_POST['payway'])));
     $apf_order->setDeliveryway(stripslashes(trim($_POST['deliveryway'])));
     $apf_order->setDeliverydatetime(stripslashes(trim($_POST['deliverydatetime'])));
     $apf_order->setState(stripslashes(trim($_POST['state'])));
     $apf_order->setMemo(stripslashes(trim($_POST['memo'])));
     $apf_order->setAccess(stripslashes(trim($_POST['access'])));
     $apf_order->setActive(stripslashes(trim($_POST['active'])));
     $apf_order->setAddIp($AddIP);
     $apf_order->setGroupid($group_ids);
     $apf_order->setUserid($userid);
     $val = $apf_order->validate();
     if ($val === TRUE) {
         if ($edit_submit) {
             $apf_order->setUpdateAt(DB_DataObject_Cast::dateTime());
             $apf_order->update();
             $log_string = $i18n->_("Update") . $i18n->_("ModuleName") . "\t{$_POST['name']}=>{$_POST['ID']}";
             logFileString($log_string);
             $this->forward("order/apf_order/update/" . $_POST['ID'] . "/ok");
         } else {
             $apf_order->setCreatedAt(DB_DataObject_Cast::dateTime());
             $apf_order->insert();
             $log_string = $i18n->_("Create") . $i18n->_("ModuleName") . "\t{$_POST['name']}=>{$_POST['create_date']}";
             logFileString($log_string);
             $this->forward("order/apf_order/");
         }
     } else {
         $template->setFile(array("MAIN" => "apf_order_edit.html"));
         $template->setBlock("MAIN", "edit_block");
         foreach ($val as $k => $v) {
             if ($v == false) {
                 $template->setVar(array(strtoupper($k) . "_ERROR_MSG" => " &darr; " . $i18n->_("Please check here") . " &darr; "));
             }
         }
         $template->setVar(array("ID" => $_POST['id'], "NOID" => $_POST['noid'], "CATEGORY" => $_POST['category'], "CONTACTID" => $_POST['contactid'], "PRODUCT" => $_POST['product'], "AMOUNT" => $_POST['amount'], "MONEY" => $_POST['money'], "DISCOUNT" => $_POST['discount'], "PAYWAY" => $_POST['payway'], "DELIVERYWAY" => $_POST['deliveryway'], "DELIVERYDATETIME" => $_POST['deliverydatetime'], "STATE" => $_POST['state'], "MEMO" => $_POST['memo'], "GROUPID" => $_POST['groupid'], "USERID" => $_POST['userid'], "ACCESS" => $_POST['access'], "ACTIVE" => $_POST['active'], "ADD_IP" => $_POST['add_ip'], "CREATED_AT" => $_POST['created_at'], "UPDATE_AT" => $_POST['update_at']));
         $category_arr = $this->getCategory();
         array_shift($AccessOption);
         array_shift($OrderStateOption);
         array_shift($PaywayOption);
         array_shift($DeliverywayOption);
         $template->setVar(array("WEBDIR" => $WebBaseDir, "CATEGORYOPTION" => selectTag("category", $category_arr, $_POST['category']), "ACCESSOPTION" => radioTag("access", $AccessOption, $_POST['access']), "DELIVERYDATE" => inputDateTag("deliverydatetime", $_POST['deliverydatetime']), "MEMOTEXT" => textareaTag('memo', $_POST['memo'], false, "ROWS=\"8\" COLS=\"40\""), "PAYWAY_OPTION" => radioTag("payway", $PaywayOption, $_POST['payway']), "DELIVERY_OPTION" => radioTag("deliveryway", $DeliverywayOption, $_POST['deliveryway']), "STATE_OPTION" => radioTag("state", $OrderStateOption, $_POST['state']), "DOACTION" => $do_action));
     }
 }