public function pjActionConfig() { $this->checkLogin(); if ($this->isAdmin()) { $pjLogConfigModel = pjLogConfigModel::factory(); if (isset($_POST['update_config'])) { $pjLogConfigModel->eraseAll(); if (isset($_POST['filename']) && count($_POST['filename']) > 0) { $pjLogConfigModel->begin(); foreach ($_POST['filename'] as $filename) { $pjLogConfigModel->reset()->set('filename', $filename)->insert(); } $pjLogConfigModel->commit(); } pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjLog&action=pjActionConfig&err=PLG01"); } $data = array(); pjUtil::readDir($data, 'app/controllers/'); pjUtil::readDir($data, 'app/plugins/'); $this->set('data', $data); $this->set('config_arr', $pjLogConfigModel->findAll()->getDataPair('id', 'filename')); } else { $this->set('status', 2); } }
public function pjActionCreate() { $this->setLayout('pjAdminSignUpLayout'); if (isset($_POST['user_singup'])) { $data = array(); $data['is_active'] = 'T'; $data['ip'] = $_SERVER['REMOTE_ADDR']; $id = pjUserModel::factory(array_merge($_POST, $data))->insert()->getInsertId(); if ($id !== false && (int) $id > 0) { $err = 'AU03'; } else { $err = 'AU04'; } //Let's check when or not coming from clover. if (empty($_SESSION['cloverData'])) { pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdmin&action=pjActionLogin"); } else { $_SESSION['user_id'] = $id; pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdminSignUp&action=pjActionMain&case=signup"); } } else { $this->set('role_arr', pjRoleModel::factory()->orderBy('t1.id ASC')->findAll()->getData()); $this->appendJs('jquery.validate.min.js', PJ_THIRD_PARTY_PATH . 'validate/'); $this->appendJs('pjAdminUsers.js'); } }
public function pjActionUpdate() { $this->checkLogin(); if ($this->isAdmin()) { if (isset($_POST['options_update'])) { $OptionModel = new pjOptionModel(); foreach ($_POST as $key => $value) { if (preg_match('/value-(string|text|int|float|enum|bool|color)-(.*)/', $key) === 1) { list(, $type, $k) = explode("-", $key); if (!empty($k)) { $OptionModel->reset()->where('foreign_id', $this->getForeignId())->where('`key`', $k)->limit(1)->modifyAll(array('value' => $value)); } } } if (isset($_POST['i18n'])) { pjMultiLangModel::factory()->updateMultiLang($_POST['i18n'], 1, 'pjOption', 'data'); } if (isset($_POST['next_action'])) { switch ($_POST['next_action']) { case 'pjActionIndex': $err = 'AO01'; break; case 'pjActionOrders': $err = 'AO02'; break; case 'pjActionClientDetails': if ($_POST['tab_id'] == 'tabs-1') { $err = 'AO03&tab_id=' . $_POST['tab_id']; } else { $err = 'AO06&tab_id=' . $_POST['tab_id']; } break; case 'pjActionNotification': if ($_POST['tab_id'] == 'tabs-3') { $err = 'AO07&tab_id=' . $_POST['tab_id']; } else { $err = 'AO04&tab_id=' . $_POST['tab_id']; } break; case 'pjActionTerm': $err = 'AO05'; break; } } pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdminOptions&action=" . @$_POST['next_action'] . "&err={$err}"); } } else { $this->set('status', 2); } }
public function pjActionGetWTime() { $this->setAjax(true); if ($this->isXHR()) { if (isset($_POST['date']) && !empty($_POST['date'])) { $date = pjUtil::formatDate($_POST['date'], $this->option_arr['o_date_format']); $wt_arr = pjAppController::getWorkingTime($date, $_POST['location_id'], $_POST['type']); } else { $date = '1981-02-01'; $wt_arr = array('start_hour' => 0, 'end_hour' => 23); $this->_set('p_hour', 0); $this->_set('p_minute', 0); $this->_set('d_hour', 0); $this->_set('d_minute', 0); } $this->tpl['date'] = $date; $this->tpl['wt_arr'] = $wt_arr; } }
public function pjActionIndex() { $this->checkLogin(); if ($this->isAdmin()) { if (isset($_POST['sms_post'])) { $pjOptionModel = pjOptionModel::factory(); if (0 != $pjOptionModel->where('foreign_id', $this->getForeignId())->where('`key`', 'plugin_sms_api_key')->findCount()->getData()) { $pjOptionModel->limit(1)->modifyAll(array('value' => $_POST['plugin_sms_api_key'])); } else { $pjOptionModel->setAttributes(array('foreign_id' => $this->getForeignId(), 'key' => 'plugin_sms_api_key', 'tab_id' => '99', 'value' => $_POST['plugin_sms_api_key'], 'type' => 'string', 'is_visible' => 0))->insert(); } pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjSms&action=pjActionIndex&err=PSS02"); } $this->appendJs('jquery.datagrid.js', PJ_FRAMEWORK_LIBS_PATH . 'pj/js/'); $this->appendJs('pjSms.js', $this->getConst('PLUGIN_JS_PATH')); } else { $this->set('status', 2); } }
<?php $response1 = $_SESSION["response1"]; $responseAddress = $_SESSION["responseAddress"]; //echo "Merchant Address".$responseAddress; //echo "merchant id here".$_SESSION["merchantId"]; $result = json_decode($response1); $resultAddress = json_decode($responseAddress); $name = $result->name; $address = $resultAddress->address1; //echo "session".$name; if (isset($tpl['status'])) { $status = __('status', true); switch ($tpl['status']) { case 2: pjUtil::printNotice(NULL, $status[2]); break; } } else { ?> <div class="ui-tabs ui-widget ui-widget-content ui-corner-all b10"> <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"> <li class="ui-state-default ui-corner-top"><a href="<?php echo $_SERVER['PHP_SELF']; ?> ?controller=pjAdminMerchant&action=pjActionIndex">Merchant</a></li> <li class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a href="<?php echo $_SERVER['PHP_SELF']; ?> ?controller=pjAdminMerchant&action=pjActionCreate">Add Merchant</a></li> </ul>
<?php if (isset($tpl['status'])) { $status = __('status', true); switch ($tpl['status']) { case 2: pjUtil::printNotice(NULL, $status[2]); break; } } else { include PJ_VIEWS_PATH . 'pjLayouts/elements/optmenu.php'; $titles = __('error_titles', true); $bodies = __('error_bodies', true); pjUtil::printNotice(@$titles['PBU01'], @$bodies['PBU01']); if (isset($_GET['err'])) { pjUtil::printNotice(@$titles[$_GET['err']], @$bodies[$_GET['err']]); } ?> <form action="<?php echo PJ_INSTALL_URL; ?> index.php?controller=pjBackup&action=pjActionIndex" method="post" class="pj-form form"> <input type="hidden" name="backup" value="1" /> <fieldset class="fieldset white overflow"> <legend><?php __('plugin_backup_menu_backup'); ?> </legend> <div class="float_left w200"> <p> <label class="title"><?php
public function pjActionPrice() { $this->checkLogin(); if ($this->isAdmin() || $this->isEditor()) { if (isset($_POST['price_update'])) { $pjPriceModel = pjPriceModel::factory(); $pjPriceModel->where('location_id', $_POST['location_id'])->eraseAll(); if (isset($_POST['price']) && count($_POST['price']) > 0) { foreach ($_POST['price'] as $k => $price) { if ((double) $_POST['total_from'][$k] >= 0 && (double) $_POST['total_to'][$k] > 0 && (double) $_POST['total_from'][$k] <= (double) $_POST['total_to'][$k]) { $pjPriceModel->reset()->setAttributes(array('location_id' => $_POST['location_id'], 'total_from' => $_POST['total_from'][$k], 'total_to' => $_POST['total_to'][$k], 'price' => $_POST['price'][$k]))->insert(); } } } pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjAdminLocations&action=pjActionPrice&id=" . $_POST['location_id'] . "&err=AL09"); } else { $this->set('arr', pjPriceModel::factory()->where('location_id', $_GET['id'])->orderBy("t1.total_from ASC, t1.total_to ASC")->findAll()->getData()); $this->appendJs('jquery.validate.min.js', PJ_THIRD_PARTY_PATH . 'validate/'); $this->appendJs('pjAdminLocations.js'); } } else { $this->set('status', 2); } }
?controller=pjAdminCategories&action=pjActionIndex"><?php __('menuCategories'); ?> </a></li> <li class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a href="<?php echo $_SERVER['PHP_SELF']; ?> ?controller=pjAdminCategories&action=pjActionCreate"><?php __('lblAddCategory'); ?> </a></li> </ul> </div> <?php pjUtil::printNotice(__('infoAddCategoryTitle', true, false), __('infoAddCategoryDesc', true, false)); ?> <?php if ((int) $tpl['option_arr']['o_multi_lang'] === 1) { ?> <div class="multilang"></div> <?php } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?> ?controller=pjAdminCategories&action=pjActionCreate" method="post" id="frmCreateCategory" class="form pj-form" autocomplete="off"> <input type="hidden" name="category_create" value="1" />
__('lblValidateVoucherDateTime', false, true); ?> </label></em> </p> </div> <div id="valid_recurring" class="valid-box" style="display:none;"> <p> <label class="title"><?php __('lblEvery'); ?> </label> <span class="inline_block"> <select name="r_every" id="r_every" class="pj-form-field w150"> <?php $days = __('voucher_days', true, false); foreach (pjUtil::getWeekdays() as $v) { ?> <option value="<?php echo $v; ?> "><?php echo $days[$v]; ?> </option><?php } ?> </select> </span> </p> <p> <label class="title"><?php
public function pjActionReminderEmail() { $this->setAjax(true); if ($this->isXHR() && $this->isLoged()) { if (isset($_POST['send_email']) && isset($_POST['to']) && !empty($_POST['to']) && !empty($_POST['from']) && !empty($_POST['subject']) && !empty($_POST['message']) && !empty($_POST['id'])) { $Email = new pjEmail(); $Email->setContentType('text/html'); if ($this->option_arr['o_send_email'] == 'smtp') { $Email->setTransport('smtp')->setSmtpHost($this->option_arr['o_smtp_host'])->setSmtpPort($this->option_arr['o_smtp_port'])->setSmtpUser($this->option_arr['o_smtp_user'])->setSmtpPass($this->option_arr['o_smtp_pass']); } $r = $Email->setTo($_POST['to'])->setFrom($_POST['from'])->setSubject($_POST['subject'])->send(pjUtil::textToHtml($_POST['message'])); if (isset($r) && $r) { pjAppController::jsonResponse(array('status' => 'OK', 'code' => 200, 'text' => __('lblEmailSent', true, false))); } pjAppController::jsonResponse(array('status' => 'ERR', 'code' => 100, 'text' => __('lblFailedToSend', true, false))); } if (isset($_GET['id']) && (int) $_GET['id'] > 0) { $pjOrderModel = pjOrderModel::factory(); $arr = $pjOrderModel->join('pjClient', "t2.id=t1.client_id", 'left outer')->select('t1.*, t2.c_title, t2.c_email, t2.c_name, t2.c_phone, t2.c_company, t2.c_address_1, t2.c_address_2, t2.c_country, t2.c_state, t2.c_city, t2.c_zip, t2.c_notes')->find($_GET['id'])->getData(); if (!empty($arr)) { pjAppController::addOrderDetails($arr, $this->getLocaleId()); $tokens = pjAppController::getTokens($this->option_arr, $arr, PJ_SALT, $this->getLocaleId()); $pjMultiLangModel = pjMultiLangModel::factory(); $lang_message = $pjMultiLangModel->reset()->select('t1.*')->where('t1.model', 'pjOption')->where('t1.locale', $this->getLocaleId())->where('t1.field', 'o_email_confirmation_message')->limit(0, 1)->findAll()->getData(); $lang_subject = $pjMultiLangModel->reset()->select('t1.*')->where('t1.model', 'pjOption')->where('t1.locale', $this->getLocaleId())->where('t1.field', 'o_email_confirmation_subject')->limit(0, 1)->findAll()->getData(); if (count($lang_message) === 1 && count($lang_subject) === 1) { if ($arr['type'] == 'delivery') { $message = str_replace(array('[Delivery]', '[/Delivery]'), array('', ''), $lang_message[0]['content']); } else { $message = preg_replace('/\\[Delivery\\].*\\[\\/Delivery\\]/s', '', $lang_message[0]['content']); } $subject_client = str_replace($tokens['search'], $tokens['replace'], $lang_subject[0]['content']); $message_client = str_replace($tokens['search'], $tokens['replace'], $message); $from = !empty($this->option_arr['o_sender_email']) ? $this->option_arr['o_sender_email'] : $this->getAdminEmail(); $this->set('arr', array('id' => $_GET['id'], 'client_email' => $arr['c_email'], 'from' => $from, 'message' => $message_client, 'subject' => $subject_client)); } } else { exit; } } else { exit; } } }
public function pjActionUpdate() { $this->checkLogin(); if ($this->isAdmin() || $this->isEditor()) { $post_max_size = pjUtil::getPostMaxSize(); if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_SERVER['CONTENT_LENGTH']) && (int) $_SERVER['CONTENT_LENGTH'] > $post_max_size) { pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjAdminProducts&action=pjActionIndex&err=AP06"); } if (isset($_POST['product_update'])) { $pjProductModel = pjProductModel::factory(); $err = 'AP01'; $arr = $pjProductModel->find($_POST['id'])->getData(); if (empty($arr)) { pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjAdminProducts&action=pjActionIndex&err=AP08"); } $data = array(); if (isset($_FILES['image'])) { if ($_FILES['image']['error'] == 0) { if (getimagesize($_FILES['image']["tmp_name"]) != false) { if (!empty($arr['image'])) { @unlink(PJ_INSTALL_PATH . $arr['image']); } $Image = new pjImage(); if ($Image->getErrorCode() !== 200) { $Image->setAllowedTypes(array('image/png', 'image/gif', 'image/jpg', 'image/jpeg', 'image/pjpeg')); if ($Image->load($_FILES['image'])) { $resp = $Image->isConvertPossible(); if ($resp['status'] === true) { $hash = md5(uniqid(rand(), true)); $image_path = PJ_UPLOAD_PATH . 'products/' . $_POST['id'] . '_' . $hash . '.' . $Image->getExtension(); $Image->loadImage($_FILES['image']["tmp_name"]); $Image->setFillColor($this->imageFillColor)->resize(116, 87); $Image->saveImage($image_path); $data['image'] = $image_path; } } } } else { $err = 'AP10'; } } else { if ($_FILES['image']['error'] != 4) { $err = 'AP10'; } } } if (isset($_POST['is_featured'])) { $data['is_featured'] = 1; unset($_POST['is_featured']); } else { $data['is_featured'] = 0; } $pjProductModel->reset()->where('id', $_POST['id'])->limit(1)->modifyAll(array_merge($_POST, $data)); if (isset($_POST['i18n'])) { pjMultiLangModel::factory()->updateMultiLang($_POST['i18n'], $_POST['id'], 'pjProduct', 'data'); $pjMultiLangModel = pjMultiLangModel::factory(); $pjProductPriceModel = pjProductPriceModel::factory(); if ($_POST['set_different_sizes'] == 'T') { if (isset($_POST['index_arr']) && $_POST['index_arr'] != '') { $index_arr = explode("|", $_POST['index_arr']); foreach ($index_arr as $k => $v) { if (strpos($v, 'fd') !== false) { $p_data = array(); $p_data['product_id'] = $_POST['id']; $p_data['price'] = $_POST['product_price'][$v]; $price_id = $pjProductPriceModel->reset()->setAttributes($p_data)->insert()->getInsertId(); if ($price_id !== false && (int) $price_id > 0) { foreach ($_POST['i18n'] as $locale => $locale_arr) { foreach ($locale_arr as $field => $content) { if (is_array($content)) { $insert_id = $pjMultiLangModel->reset()->setAttributes(array('foreign_id' => $price_id, 'model' => 'pjProductPrice', 'locale' => $locale, 'field' => $field, 'content' => $content[$v], 'source' => 'data'))->insert()->getInsertId(); } } } } } else { $p_data = array(); $p_data['price'] = $_POST['product_price'][$v]; $pjProductPriceModel->reset()->where('id', $v)->limit(1)->modifyAll($p_data); foreach ($_POST['i18n'] as $locale => $locale_arr) { foreach ($locale_arr as $field => $content) { if (is_array($content)) { $sql = sprintf("INSERT INTO `%1\$s` (`id`, `foreign_id`, `model`, `locale`, `field`, `content`, `source`)\n\t\t\t\t\t\t\t\t\t\t\t\t\tVALUES (NULL, :foreign_id, :model, :locale, :field, :update_content, :source)\n\t\t\t\t\t\t\t\t\t\t\t\t\tON DUPLICATE KEY UPDATE `content` = :update_content, `source` = :source;", $pjMultiLangModel->getTable()); $foreign_id = $v; $model = 'pjProductPrice'; $source = 'data'; $update_content = $content[$v]; $modelObj = $pjMultiLangModel->reset()->prepare($sql)->exec(compact('foreign_id', 'model', 'locale', 'field', 'update_content', 'source')); if ($modelObj->getAffectedRows() > 0 || $modelObj->getInsertId() > 0) { } } } } } } } if (isset($_POST['remove_arr']) && $_POST['remove_arr'] != '') { $remove_arr = explode("|", $_POST['remove_arr']); $pjMultiLangModel->reset()->where('model', 'pjProductPrice')->whereIn('foreign_id', $remove_arr)->eraseAll(); $pjProductPriceModel->reset()->whereIn('id', $remove_arr)->eraseAll(); } $pjProductModel->reset()->where('id', $_POST['id'])->limit(1)->modifyAll(array('price' => ':NULL')); } else { $id_arr = $pjProductPriceModel->where('product_id', $_POST['id'])->findAll()->getDataPair("id", "id"); $pjMultiLangModel->reset()->where('model', 'pjProductPrice')->whereIn('foreign_id', $id_arr); $pjProductPriceModel->reset()->where('product_id', $_POST['id'])->eraseAll(); } } $pjProductCategoryModel = pjProductCategoryModel::factory(); $pjProductCategoryModel->where('product_id', $_POST['id'])->eraseAll(); if (isset($_POST['category_id']) && is_array($_POST['category_id']) && count($_POST['category_id']) > 0) { $pjProductCategoryModel->reset()->begin(); foreach ($_POST['category_id'] as $category_id) { $pjProductCategoryModel->reset()->set('product_id', $_POST['id'])->set('category_id', $category_id)->insert(); } $pjProductCategoryModel->commit(); } $pjProductExtraModel = pjProductExtraModel::factory(); $pjProductExtraModel->where('product_id', $_POST['id'])->eraseAll(); if (isset($_POST['extra_id']) && is_array($_POST['extra_id']) && count($_POST['extra_id']) > 0) { $pjProductExtraModel->reset()->begin(); foreach ($_POST['extra_id'] as $extra_id) { $pjProductExtraModel->reset()->set('product_id', $_POST['id'])->set('extra_id', $extra_id)->insert(); } $pjProductExtraModel->commit(); } if ($err == 'AP01') { pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjAdminProducts&action=pjActionIndex&err=AP01"); } else { pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjAdminProducts&action=pjActionUpdate&id=" . $_POST['id'] . "&err=AP10"); } } else { $pjMultiLangModel = pjMultiLangModel::factory(); $arr = pjProductModel::factory()->find($_GET['id'])->getData(); if (count($arr) === 0) { pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjAdminProducts&action=pjActionIndex&err=AP08"); } $arr['i18n'] = $pjMultiLangModel->getMultiLang($arr['id'], 'pjProduct'); $this->set('arr', $arr); $locale_arr = pjLocaleModel::factory()->select('t1.*, t2.file')->join('pjLocaleLanguage', 't2.iso=t1.language_iso', 'left')->where('t2.file IS NOT NULL')->orderBy('t1.sort ASC')->findAll()->getData(); $lp_arr = array(); foreach ($locale_arr as $item) { $lp_arr[$item['id'] . "_"] = $item['file']; } $this->set('lp_arr', $locale_arr); $this->set('locale_str', pjAppController::jsonEncode($lp_arr)); $this->set('category_arr', pjCategoryModel::factory()->select('t1.*, t2.content AS name')->join('pjMultiLang', "t2.model='pjCategory' AND t2.foreign_id=t1.id AND t2.field='name' AND t2.locale='" . $this->getLocaleId() . "'", 'left outer')->where('t1.status', 'T')->orderBy('`order` ASC')->findAll()->getData()); $this->set('extra_arr', pjExtraModel::factory()->select('t1.*, t2.content AS name')->join('pjMultiLang', "t2.model='pjExtra' AND t2.foreign_id=t1.id AND t2.field='name' AND t2.locale='" . $this->getLocaleId() . "'", 'left outer')->orderBy('name ASC')->findAll()->getData()); $this->set('category_id_arr', pjProductCategoryModel::factory()->where("product_id", $_GET['id'])->findAll()->getDataPair("category_id", "category_id")); $this->set('extra_id_arr', pjProductExtraModel::factory()->where("product_id", $_GET['id'])->findAll()->getDataPair("extra_id", "extra_id")); if ($arr['set_different_sizes'] == 'T') { $size_arr = pjProductPriceModel::factory()->where('product_id', $_GET['id'])->findAll()->getData(); foreach ($size_arr as $k => $v) { $size_arr[$k]['i18n'] = pjMultiLangModel::factory()->getMultiLang($v['id'], 'pjProductPrice'); } $this->set('size_arr', $size_arr); } $this->appendJs('jquery.validate.min.js', PJ_THIRD_PARTY_PATH . 'validate/'); $this->appendJs('jquery.multilang.js', PJ_FRAMEWORK_LIBS_PATH . 'pj/js/'); $this->appendJs('jquery.tipsy.js', PJ_THIRD_PARTY_PATH . 'tipsy/'); $this->appendCss('jquery.tipsy.css', PJ_THIRD_PARTY_PATH . 'tipsy/'); $this->appendJs('jquery.multiselect.min.js', PJ_THIRD_PARTY_PATH . 'multiselect/'); $this->appendCss('jquery.multiselect.css', PJ_THIRD_PARTY_PATH . 'multiselect/'); $this->appendJs('pjAdminProducts.js'); } } else { $this->set('status', 2); } }
?> </a></li> <li class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a href="<?php echo $_SERVER['PHP_SELF']; ?> ?controller=pjAdminClients&action=pjActionUpdate&id=<?php echo $tpl['arr']['id']; ?> "><?php __('lblUpdateClient'); ?> </a></li> </ul> </div> <?php pjUtil::printNotice(__('infoUpdateClientTitle', true, false), __('infoUpdateClientDesc', true, false)); ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?> ?controller=pjAdminClients&action=pjActionUpdate" method="post" id="frmUpdateClient" class="form pj-form"> <input type="hidden" name="client_update" value="1" /> <input type="hidden" name="id" value="<?php echo (int) $tpl['arr']['id']; ?> " /> <p> <label class="title"><?php __('lblTitle'); ?> </label>
public function pjActionUpdate() { $this->checkLogin(); if ($this->isAdmin()) { if (isset($_POST['voucher_update'])) { $data = array(); $data['code'] = $_POST['code']; $data['discount'] = $_POST['discount']; $data['type'] = $_POST['type']; $data['valid'] = $_POST['valid']; switch ($_POST['valid']) { case 'fixed': $data['date_from'] = pjUtil::formatDate($_POST['f_date'], $this->option_arr['o_date_format']); $data['date_to'] = $data['date_from']; $data['time_from'] = $_POST['f_hour_from'] . ":" . $_POST['f_minute_from'] . ":00"; $data['time_to'] = $_POST['f_hour_to'] . ":" . $_POST['f_minute_to'] . ":00"; $data['every'] = array('NULL'); break; case 'period': $data['date_from'] = pjUtil::formatDate($_POST['p_date_from'], $this->option_arr['o_date_format']); $data['date_to'] = pjUtil::formatDate($_POST['p_date_to'], $this->option_arr['o_date_format']); $data['time_from'] = $_POST['p_hour_from'] . ":" . $_POST['p_minute_from'] . ":00"; $data['time_to'] = $_POST['p_hour_to'] . ":" . $_POST['p_minute_to'] . ":00"; $data['every'] = array('NULL'); break; case 'recurring': $data['date_from'] = array('NULL'); $data['date_to'] = array('NULL'); $data['every'] = $_POST['r_every']; $data['time_from'] = $_POST['r_hour_from'] . ":" . $_POST['r_minute_from'] . ":00"; $data['time_to'] = $_POST['r_hour_to'] . ":" . $_POST['r_minute_to'] . ":00"; break; } pjVoucherModel::factory()->where('id', $_POST['id'])->limit(1)->modifyAll($data); pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjAdminVouchers&action=pjActionIndex&err=AV01"); } else { $arr = pjVoucherModel::factory()->find($_GET['id'])->getData(); if (count($arr) === 0) { pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjAdminVouchers&action=pjActionIndex&err=AV08"); } $this->set('arr', $arr); $this->appendJs('jquery.validate.min.js', PJ_THIRD_PARTY_PATH . 'validate/'); $this->appendJs('additional-methods.js', PJ_THIRD_PARTY_PATH . 'validate/'); $this->appendJs('pjAdminVouchers.js'); } } else { $this->set('status', 2); } }
echo $filter['active']; ?> </a> <a href="#" class="pj-button btn-filter btn-status" data-column="status" data-value="F"><?php echo $filter['inactive']; ?> </a> </div> <br class="clear_both" /> </div> <div id="grid"></div> <script type="text/javascript"> var pjGrid = pjGrid || {}; pjGrid.jsDateFormat = "<?php echo pjUtil::jsDateFormat($tpl['option_arr']['o_date_format']); ?> "; pjGrid.currentUserId = <?php echo (int) $_SESSION[$controller->defaultUser]['id']; ?> ; var myLabel = myLabel || {}; myLabel.merchant_name = "<?php __('lblName', false, true); ?> "; myLabel.merchant_address = "Address"; myLabel.active = "<?php echo $u_statarr['T']; ?>
public function pjActionUpdate() { $this->checkLogin(); if ($this->isAdmin()) { $arr = pjDateModel::factory()->find($_GET['id'])->getData(); if (count($arr) === 0) { pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjAdminTime&action=pjActionIndex&err=AT09&tab_id=tabs-2"); } $this->set('arr', $arr); $this->appendJs('jquery.validate.min.js', PJ_THIRD_PARTY_PATH . 'validate/'); $this->appendJs('pjAdminTime.js'); } else { $this->set('status', 2); } }
?> ?controller=pjAdminVouchers&action=pjActionIndex"><?php __('menuVouchers'); ?> </a></li> <li class="ui-state-default ui-corner-top"><a href="<?php echo $_SERVER['PHP_SELF']; ?> ?controller=pjAdminVouchers&action=pjActionCreate"><?php __('lblAddVoucher'); ?> </a></li> </ul> </div> <?php pjUtil::printNotice(__('infoVoucherListTitle', true, false), __('infoVoucherListDesc', true, false)); ?> <div class="b10"> <form action="" method="get" class="float_left pj-form frm-filter"> <input type="text" name="q" class="pj-form-field pj-form-field-search w150" placeholder="<?php __('btnSearch', false, true); ?> " /> </form> <br class="clear_both" /> </div> <div id="grid"></div> <script type="text/javascript"> var myLabel = myLabel || {}; myLabel.code = "<?php
public function pjActionUpdate() { $this->checkLogin(); if ($this->isCountryReady()) { if (isset($_POST['country_update'])) { pjCountryModel::factory()->where('id', $_POST['id'])->limit(1)->modifyAll($_POST); if (isset($_POST['i18n'])) { pjMultiLangModel::factory()->updateMultiLang($_POST['i18n'], $_POST['id'], 'pjCountry'); } pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjCountry&action=pjActionIndex&err=PCY01"); } else { $arr = pjCountryModel::factory()->find($_GET['id'])->getData(); if (count($arr) === 0) { pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjCountry&action=pjActionIndex&err=PCY08"); } $arr['i18n'] = pjMultiLangModel::factory()->getMultiLang($arr['id'], 'pjCountry'); $this->set('arr', $arr); $locale_arr = pjLocaleModel::factory()->select('t1.*, t2.file')->join('pjLocaleLanguage', 't2.iso=t1.language_iso', 'left')->where('t2.file IS NOT NULL')->orderBy('t1.sort ASC')->findAll()->getData(); $lp_arr = array(); foreach ($locale_arr as $item) { $lp_arr[$item['id'] . "_"] = $item['file']; //Hack for jquery $.extend, to prevent (re)order of numeric keys in object } $this->set('lp_arr', $locale_arr); $this->set('locale_str', pjAppController::jsonEncode($lp_arr)); $this->appendJs('jquery.validate.min.js', PJ_THIRD_PARTY_PATH . 'validate/'); $this->appendJs('jquery.multilang.js', PJ_FRAMEWORK_LIBS_PATH . 'pj/js/'); $this->appendJs('jquery.tipsy.js', PJ_THIRD_PARTY_PATH . 'tipsy/'); $this->appendCss('jquery.tipsy.css', PJ_THIRD_PARTY_PATH . 'tipsy/'); $this->appendJs('pjCountry.js', $this->getConst('PLUGIN_JS_PATH')); $this->appendJs('index.php?controller=pjAdmin&action=pjActionMessages', PJ_INSTALL_URL, true); } } else { $this->set('status', 2); } }
?controller=pjAdminLocations&action=pjActionIndex"><?php __('menuLocations'); ?> </a></li> <li class="ui-state-default ui-corner-top ui-tabs-active ui-state-active"><a href="<?php echo $_SERVER['PHP_SELF']; ?> ?controller=pjAdminLocations&action=pjActionCreate"><?php __('lblAddLocation'); ?> </a></li> </ul> </div> <?php pjUtil::printNotice(__('infoAddLocationTitle', true, false), __('infoAddLocationDesc', true, false)); ?> <?php if ((int) $tpl['option_arr']['o_multi_lang'] === 1) { ?> <div class="multilang"></div> <?php } ?> <div class="pj-loader-outer"> <div class="pj-loader-1"></div> <form action="" method="post" id="frmGetDetails" class="form pj-form frmLocation" autocomplete="off"> <p> <label class="title">Merchant Id</label> <span class="inline_block">
public function pjActionCancel() { $this->setLayout('pjActionCancel'); $pjOrderModel = pjOrderModel::factory(); if (isset($_POST['order_cancel'])) { $order_arr = $pjOrderModel->reset()->join('pjClient', "t2.id=t1.client_id", 'left outer')->select('t1.*, t2.c_title, t2.c_email, t2.c_name, t2.c_phone, t2.c_company, t2.c_address_1, t2.c_address_2, t2.c_country, t2.c_state, t2.c_city, t2.c_zip, t2.c_notes')->find($_POST['id'])->getData(); if (count($order_arr) > 0) { $sql = "UPDATE `" . $pjOrderModel->getTable() . "` SET status = 'cancelled' WHERE SHA1(CONCAT(`id`, `created`, '" . PJ_SALT . "')) = '" . $_POST['hash'] . "'"; $pjOrderModel->reset()->execute($sql); pjAppController::addOrderDetails($order_arr, $this->getLocaleId()); pjFront::pjActionConfirmSend($this->option_arr, $order_arr, PJ_SALT, 'cancel'); pjUtil::redirect($_SERVER['PHP_SELF'] . '?controller=pjFront&action=pjActionCancel&err=200'); } } else { if (isset($_GET['hash']) && isset($_GET['id'])) { $arr = $pjOrderModel->reset()->join('pjClient', "t2.id=t1.client_id", 'left outer')->join('pjMultiLang', "t3.model='pjCountry' AND t3.foreign_id=t1.d_country_id AND t3.field='name' AND t3.locale='" . $this->getLocaleId() . "'", 'left outer')->join('pjMultiLang', "t4.model='pjCountry' AND t4.foreign_id=t1.location_id AND t4.field='name' AND t4.locale='" . $this->getLocaleId() . "'", 'left outer')->join('pjClient', "t2.id=t1.client_id", 'left outer')->select('t1.*, t3.content as d_country, t4.content as location, t2.c_title, t2.c_email, t2.c_name, t2.c_phone, t2.c_company, t2.c_address_1, t2.c_address_2, t2.c_country, t2.c_state, t2.c_city, t2.c_zip, t2.c_notes')->find($_GET['id'])->getData(); if (count($arr) == 0) { $this->set('status', 2); } else { if ($arr['status'] == 'cancelled') { $this->set('status', 4); } else { $hash = sha1($arr['id'] . $arr['created'] . PJ_SALT); if ($_GET['hash'] != $hash) { $this->set('status', 3); } else { pjAppController::addOrderDetails($arr, $this->getLocaleId()); $this->set('arr', $arr); } } } } elseif (!isset($_GET['err'])) { $this->set('status', 1); } } }
public function pjActionClean() { $this->checkLogin(); if (!$this->isAdmin()) { $this->set('status', 2); return; } if (isset($_POST['clean_step'])) { if ($_POST['clean_step'] == 1) { $pjMultiLangModel = pjMultiLangModel::factory(); $arr = pjMultiLangModel::factory()->select('t1.id')->join('pjField', 't2.id=t1.foreign_id', 'left')->where('t1.model', 'pjField')->where('t2.id IS NULL')->findAll()->getDataPair(null, 'id'); if (!empty($arr)) { $pjMultiLangModel->reset()->whereIn('id', $arr)->eraseAll(); $this->pjActionUpdateFieldsIndex(); } } if ($_POST['clean_step'] == 2) { if (isset($_POST['field_id']) && !empty($_POST['field_id'])) { pjFieldModel::factory()->whereIn('id', $_POST['field_id'])->eraseAll(); pjMultiLangModel::factory()->where('model', 'pjField')->whereIn('foreign_id', $_POST['field_id'])->eraseAll(); $this->pjActionUpdateFieldsIndex(); } } pjUtil::redirect($_SERVER['PHP_SELF'] . "?controller=pjLocale&action=pjActionClean"); } # Step 1 $step1_arr = pjMultiLangModel::factory()->select('t1.id')->join('pjField', 't2.id=t1.foreign_id', 'left')->where('t1.model', 'pjField')->where('t2.id IS NULL')->findAll()->getDataPair(null, 'id'); $this->set('step1_arr', $step1_arr); # Step 2 $keys = $start = $data = array(); pjToolkit::readDir($data, PJ_APP_PATH); foreach ($data as $file) { $ext = pjToolkit::getFileExtension($file); if ($ext !== 'php') { continue; } $string = file_get_contents($file); if ($string !== FALSE) { preg_match_all('/__\\(\\s*\'(\\w+)\'\\s*(?:,\\s*(true|false))?\\)/i', $string, $matches); if (!empty($matches[1])) { foreach ($matches[1] as $k => $m) { if (!empty($matches[2][$k]) && strtolower($matches[2][$k]) == 'true') { $start[] = $m; } else { $keys[] = $m; } } } } } $keys = array_unique($keys); $keys = array_values($keys); $start = array_unique($start); $start = array_values($start); if (!empty($keys) || !empty($start)) { $field_arr = pjFieldModel::factory()->whereNotIn('t1.key', $keys)->whereNotIn("SUBSTRING_INDEX(t1.key, '_ARRAY_', 1)", $start)->orderBy("FIELD(t1.type, 'backend', 'frontend', 'arrays'), t1.key ASC", false)->findAll()->getData(); $this->set('field_arr', $field_arr); } $this->appendJs('pjLocale.js', $this->getConst('PLUGIN_JS_PATH')); }
public function pjActionUpdate() { $this->checkLogin(); if ($this->isAdmin() || $this->isEditor()) { if (isset($_POST['extra_update'])) { pjExtraModel::factory()->where('id', $_POST['id'])->limit(1)->modifyAll($_POST); if (isset($_POST['i18n'])) { pjMultiLangModel::factory()->updateMultiLang($_POST['i18n'], $_POST['id'], 'pjExtra', 'data'); } pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjAdminExtras&action=pjActionIndex&err=AE01"); } else { $arr = pjExtraModel::factory()->find($_GET['id'])->getData(); if (count($arr) === 0) { pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjAdminExtras&action=pjActionIndex&err=AE08"); } $arr['i18n'] = pjMultiLangModel::factory()->getMultiLang($arr['id'], 'pjExtra'); $this->set('arr', $arr); $locale_arr = pjLocaleModel::factory()->select('t1.*, t2.file')->join('pjLocaleLanguage', 't2.iso=t1.language_iso', 'left')->where('t2.file IS NOT NULL')->orderBy('t1.sort ASC')->findAll()->getData(); $lp_arr = array(); foreach ($locale_arr as $item) { $lp_arr[$item['id'] . "_"] = $item['file']; } $this->set('lp_arr', $locale_arr); $this->set('locale_str', pjAppController::jsonEncode($lp_arr)); $this->appendJs('jquery.validate.min.js', PJ_THIRD_PARTY_PATH . 'validate/'); $this->appendJs('jquery.multilang.js', PJ_FRAMEWORK_LIBS_PATH . 'pj/js/'); $this->appendJs('jquery.tipsy.js', PJ_THIRD_PARTY_PATH . 'tipsy/'); $this->appendCss('jquery.tipsy.css', PJ_THIRD_PARTY_PATH . 'tipsy/'); $this->appendJs('pjAdminExtras.js'); } } else { $this->set('status', 2); } }
public function pjActionUpdate() { $this->checkLogin(); if ($this->isAdmin()) { if (isset($_POST['merchant_update'])) { pjMerchantModel::factory()->where('merchant_id', $_POST['id'])->limit(1)->modifyAll($_POST); pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjAdminMerchant&action=pjActionIndex&err=AU01"); } else { $arr = pjMerchantModel::factory()->find($_GET['id'])->getData(); if (count($arr) === 0) { pjUtil::redirect(PJ_INSTALL_URL . "index.php?controller=pjAdminMerchant&action=pjActionIndex&err=AU08"); } $this->set('arr', $arr); $this->set('role_arr', pjRoleModel::factory()->orderBy('t1.id ASC')->findAll()->getData()); $this->appendJs('jquery.validate.min.js', PJ_THIRD_PARTY_PATH . 'validate/'); $this->appendJs('pjAdminMerchant.js'); } } else { $this->set('status', 2); } }
if ($tpl['option_arr']['o_bf_include_title'] == 3) { ?> <span class="fdRed">*</span><?php } ?> :</label> <select name="c_title" class="fdSelect fdPersonalField fdW50p<?php echo $tpl['option_arr']['o_bf_include_title'] == 3 ? ' required' : NULL; ?> " data-err="<?php __('front_title_required'); ?> "> <option value="">----</option> <?php $title_arr = pjUtil::getTitles(); $name_titles = __('personal_titles', true, false); foreach ($title_arr as $v) { ?> <option value="<?php echo $v; ?> "<?php echo isset($FORM['c_title']) ? @$FORM['c_title'] == $v ? ' selected="selected"' : NULL : (@$CLIENT['c_title'] == $v ? ' selected="selected"' : NULL); ?> ><?php echo $name_titles[$v]; ?> </option><?php } ?>
</tr> <?php } } ?> </tbody> </table> </fieldset> <p><input type="submit" value="<?php __('btnSave'); ?> " class="pj-button" /></p> </div><!-- tabs-2 --> <div id="tabs-3"> <?php pjUtil::printNotice(__('infoPrintTemplateTitle', true), __('infoPrintTemplateDesc', true)); ?> <div class="multilang"></div> <br/><br/> <table class="pj-table" cellpadding="0" cellspacing="0" style="width: 100%"> <thead> <tr> <th><?php __('lblOption'); ?> </th> <th><?php __('lblValue'); ?> </th>
$titles = __('error_titles', true); $bodies = __('error_bodies', true); if (isset($_GET['err'])) { pjUtil::printNotice(@$titles[$_GET['err']], @$bodies[$_GET['err']]); } ?> <div id="tabs"> <ul> <li><a href="#tabs-1"><?php __('menuInstall'); ?> </a></li> </ul> <div id="tabs-1"> <?php pjUtil::printNotice(__('lblInstallJs1_title', true), __('lblInstallJs1_body', true), false, false); ?> <form action="" method="get" class="pj-form form"> <fieldset class="fieldset white"> <legend><?php __('lblInstallConfig'); ?> </legend> <p> <label class="title"><?php __('lblInstallConfigLocale'); ?> </label> <select class="pj-form-field w200 pj-install-config" id="install_locale" name="install_locale"> <option value="">-- <?php
<?php $i++; } } } } $controller->_set('price', $price); ?> <tr class="fdProductRow"> <td><span class="fdCartSubtotal"><?php __('front_price'); ?> :</span></td> <td> </td> <td class="fdPriceCol"><span class="fdCartSubtotal"><?php echo pjUtil::formatCurrencySign(number_format($price, 2), $tpl['option_arr']['o_currency']); ?> </span></td> <td> </td> </tr> </tbody> </table> <div class="fdCartButton"> <a href="#" class="fdButton fdOrangeButton fdButtonCheckout" data-logged="<?php echo $controller->isFrontLogged() ? 'yes' : 'no'; ?> "><?php __('front_button_checkout'); ?> </a> </div>
?controller=pjAdminExtras&action=pjActionIndex"><?php __('menuExtras'); ?> </a></li> <li class="ui-state-default ui-corner-top"><a href="<?php echo $_SERVER['PHP_SELF']; ?> ?controller=pjAdminExtras&action=pjActionCreate"><?php __('lblAddExtra'); ?> </a></li> </ul> </div> <?php pjUtil::printNotice(__('infoExtrasTitle', true, false), __('infoExtrasDesc', true, false)); ?> <div class="b10"> <form action="" method="get" class="float_left pj-form frm-filter"> <input type="text" name="q" class="pj-form-field pj-form-field-search w150" placeholder="<?php __('btnSearch'); ?> " /> </form> <br class="clear_both" /> </div> <div id="grid"></div> <script type="text/javascript"> var myLabel = myLabel || {};
<?php include_once PJ_VIEWS_PATH . 'pjLayouts/elements/optmenu.php'; include dirname(__FILE__) . '/elements/menu.php'; if (isset($_GET['err'])) { $titles = __('error_titles', true); $bodies = __('error_bodies', true); pjUtil::printNotice(@$titles[$_GET['err']], @$bodies[$_GET['err']]); } pjUtil::printNotice(__('plugin_locale_titles_title', true), __('plugin_locale_titles_body', true)); ?> <form action="<?php echo PJ_INSTALL_URL; ?> index.php" method="get" class="float_left pj-form frm-filter b5"> <input type="hidden" name="controller" value="pjLocale" /> <input type="hidden" name="action" value="pjActionIndex" /> <input type="hidden" name="tab" value="1" /> <input type="text" name="q" class="pj-form-field pj-form-field-search w150" placeholder="<?php __('btnSearch'); ?> " value="<?php echo isset($_GET['q']) && !empty($_GET['q']) ? htmlspecialchars($_GET['q']) : NULL; ?> " /> </form> <div class="multilang b10"></div> <form action="<?php echo PJ_INSTALL_URL; ?>
" />--> <input type="text" name="p_date" id="fd_p_date_<?php echo $index; ?> " class="fdText fdPointer fdW70 fdDatepick fdFloatLeft fdMr5 fdPickupDate" readonly="readonly" value="<?php echo htmlspecialchars(stripslashes(@$STORAGE['p_date'])); ?> " /> <span class="fdInlineBlock fdPickupTime"> <?php $p_hour = isset($STORAGE['p_hour']) ? $STORAGE['p_hour'] : NULL; $p_minute = isset($STORAGE['p_minute']) ? $STORAGE['p_minute'] : NULL; $opts = array('start' => 0, 'end' => 23, 'skip' => array()); $options = array('start' => 0, 'end' => 59, 'skip' => array()); if (isset($tpl['wt_arr'])) { $date = pjUtil::formatDate(@$STORAGE['p_date'], $tpl['option_arr']['o_date_format']); $opts['start'] = (int) $tpl['wt_arr']['start_hour']; $opts['end'] = (int) $tpl['wt_arr']['end_hour']; $opts['skip'] = array(); if ((int) $tpl['wt_arr']['end_hour'] == (int) $p_hour) { $options['end'] = $tpl['wt_arr']['end_minutes']; } elseif ((int) $tpl['wt_arr']['start_hour'] == (int) $p_hour) { $options['start'] = $tpl['wt_arr']['start_minutes']; } $options['skip'] = array(); if (strtotime($date) == strtotime(date("Y-m-d"))) { list($hour, $minute) = explode("-", date("G-i")); foreach (range(0, 23) as $i) { if ($i < $hour) { $opts['skip'][] = $i; }