private function createBreadCrumbs() { if (!$this->link) { return; } $breadCrumbs = array(); foreach ($this->link as $key => $value) { $model = new BreadCrumbItem(); if (is_array($value)) { if (isset($value[1])) { $array = $value[0]; $params = $value[1]; } else { $array = $value; $params = array(); } $link = AF::link($array, $params); $model->label = $key; $model->link = $link ? $link : null; } else { $model->label = $value; $model->link = null; } $breadCrumbs[] = $model; unset($model); } $this->bca = $breadCrumbs; unset($breadCrumbs); }
function deleteAction() { $id = AF::get($_POST, 'id', 0); $modelsID = explode(',', $id); $errors = FALSE; foreach ($modelsID as $id) { $model = new CampaignShipping(); $model->model_uset_id = $this->user->user_id; if ($model->findByPk($id)) { $model->delete($id); } else { $errors = TRUE; } if ($model->getErrors()) { $errors = TRUE; } $campaign_id = $model->campaign_id; unset($model); } if (isset($_POST['ajax'])) { AF::setJsonHeaders('json'); if ($errors) { Message::echoJsonError(__('campship_not_deleted')); } else { $countE = AF::get($_POST, 'countE', 100000); if (count($modelsID) >= $countE) { $link = AF::link(array('campship' => 'view'), array('campaign_id' => $campaign_id)); Message::echoJsonRedirect($link); } else { Message::echoJsonSuccess(__('campship_deleted')); } } } $this->redirect(); }
private function apiSuccess($url) { // $url will be a message in CRM Order, a redirect url in all other cases // what return type? if ($this->wsType == 'x1') { Message::echoJsonRedirect(AF::link(array('orders' => 'update'), array('id' => $this->order->order_id))); } else { // is this a system generated url with no prefix or is this a fully formed GC url // do we need to append noclk ? $url = stripos($url, 'http') !== false ? $url : 'http://' . $url . ($this->noclk ? '&noclk' : ''); exit(json_encode(array('status' => 1, 'url' => $url))); } }
function __construct($params) { parent::__construct($params); $this->url = AF::link(array($this->controller => $this->action)); $params = $this->params; if (isset($params['page'])) { $this->page = $params['page'] < 1 ? 1 : (int) $params['page']; unset($params['page']); } $amp = $params ? '&' : ''; $this->url .= http_build_query($params) . $amp . 'page='; if (isset($_POST['pagination_count_in_page_value']) && in_array($_POST['pagination_count_in_page_value'], self::$itemInPage)) { setcookie('pagination_count_in_page_value', $_POST['pagination_count_in_page_value']); $this->countInPage = $_POST['pagination_count_in_page_value']; } elseif (isset($_COOKIE['pagination_count_in_page_value']) && in_array($_COOKIE['pagination_count_in_page_value'], self::$itemInPage)) { $this->countInPage = $_COOKIE['pagination_count_in_page_value']; } }
public function createAction() { $model = new Campaign(); if (isset($_POST['country_id'])) { $_POST['country_id'] = implode(',', $_POST['country_id']); } // check if this is an attachment campaign. if so, we don't want to validate the urls or fulfillment_id if it isnot presesnt $attach = false; if (isset($_POST['attach']) && $_POST['attach']) { $attach = true; $_POST['url'] = $_POST['order_url'] = $_POST['return_url'] = 'attach'; if (!strlen($_POST['fulfillment_id'])) { $_POST['fulfillment_id'] = 0; } } // Uncomment the following line if AJAX validation is needed $this->performAjaxValidation($model); if (isset($_POST['model']) && $_POST['model'] == 'campaigns') { $model->fillFromArray($_POST); $model->user_id_created = $this->user->user_id; $model->user_id_updated = $this->user->user_id; $model->updated = 'NOW():sql'; $model->created = 'NOW():sql'; $model->model_uset_id = $this->user->user_id; if ($model->save()) { $link = AF::link(array('campaigns' => 'update'), array('id' => $model->PkValue)); Message::echoJson('success', array('redirect' => $link)); } else { Message::echoJsonError('Campaign wasn\'t created.'); } die; } $countries = Country::model()->cache()->findAllInArray(); $profiles = Profile::model()->cache()->findAllInArray(); // prepend dry run gateway array_unshift($profiles, array('profile_id' => 0, 'profile_name' => 'DRY RUN GATEWAY')); $fulfillments = Fulfillment::model()->cache()->findAllInArray(); $currencies = Currency::model()->cache()->findAllInArray(); Assets::js('jquery.form'); $this->addToPageTitle('Create campaign'); $this->render('create', array('model' => $model, 'countries' => $countries, 'currencies' => $currencies, 'profiles' => $profiles, 'fulfillments' => $fulfillments)); }
public function createAction() { $model = new Domain(); // Uncomment the following line if AJAX validation is needed $this->performAjaxValidation($model); if (AF::isAjaxRequest() && isset($_POST['model']) && $_POST['model'] == 'Domain') { $model->fillFromArray($_POST); //$model->model_uset_id = $this->user->user_id; if ($model->save()) { $link = AF::link(array('domains' => 'view')); Message::echoJson('success', array('redirect' => $link)); } else { Message::echoJsonError(__('domain_not_created')); } die; } Assets::js('jquery.form'); $this->addToPageTitle(__('create_domain')); $this->render('create', array('model' => $model)); }
public function createAction() { $model = new GatewayLimit(); if (isset($_POST['model'])) { // Add gatewaylimit to gateway if ($_POST['model'] == 'gateway_limit') { $this->performAjaxValidation($model); // Uncomment the line if AJAX validation is needed if (!empty($_POST['limit_id'])) { $model->setIsNewRecord(FALSE); } $model->fillFromArray($_POST, TRUE); if ($model->save()) { $link = AF::link(array('gateways' => 'update'), array('id' => $model->gateway_id)); Message::echoJson('success', array('redirect' => $link)); } else { Message::echoJsonError(__('gateway_limit_not_created') . ' ' . $model->errors2string); } } } }
public function getorder_id_link() { return '<a href="' . AF::link(array('orders' => 'update'), array('id' => $this->order_id)) . '">' . $this->order_id . '</a>'; }
<div <?if($ajax){?>id="af_ajax_table"<?}?>> <form data="af_ajax_table" class="search-form" action="<?php echo AF::link(array('reports' => 'fulfillment')); ?> " method="post" onsubmit="return false;"> <?php $this->widget(new DataPicker(array('name' => 'r_dates', 'value' => array('main' => $filterFields['r_dates'], 'post' => $filterFields['r_dates_post']), 'inputHtml' => array('class' => 'input-smedium', 'placeholder' => __('filter_date'))))); ?> <select name="show_orders" class="chosen-select select-xlarge af_select_ajax"> <option value="0" <?if($filterFields['show_orders']==0){?>selected="" <?}?>><?php echo __('group_by_fulfillments'); ?> </option> <option value="1" <?if($filterFields['show_orders']==1){?>selected="" <?}?>><?php echo __('group_by_orders'); ?> </option> </select> <?if($filterFields['show_orders']==1){?> <select name="from" class="chosen-select select-xlarge af_select_ajax" data-placeholder="<?php echo __('all_type'); ?> "> <option value=""></option> <?foreach(Fulfillment::orderSType() as $itemType){?> <option value="<?php echo $itemType;
<?php $this->includeFile('_menu', array('application', 'views', 'shipping'), array('access' => $access, 'controller' => $controller, 'action' => $action, 'user' => $user)); ?> <?if($access->actionAccess('create')){?> <a class="btn btn-small" href="shipcats/create/"><i class="icon-plus"></i> <?php echo __('add_new'); ?> </a> <?}?> <?if($access->actionAccess('view_table')){?> <form data="af_ajax_table" class="search-form" action="<?php echo AF::link(array('shipcats' => 'view')); ?> " method="post" onsubmit="return false;"> <input class="input-large af-input-field" type="text" name="stext" placeholder="<?php echo __('search_text'); ?> " value="<?php echo $filterFields['stext']; ?> "> <button type="button" class="btn btn-small btn-set ajax_submit_form" ><i class="icon-search"></i> <?php echo __('search'); ?> </button> <button type="button" class="btn btn-small btn-set ajax_clear_form"><i class="icon-remove"></i> <?php echo __('clear_search');
<hr> <?if($access->actionAccess('create')){?> <a class="btn btn-small" href="<?php echo AF::link(array('templates' => 'create')); ?> "><i class="icon-plus"></i> <?php echo __('add_new'); ?> </a> <?}?> <?if($access->actionAccess('view_table')){?> <form data="af_ajax_table" class="search-form" action="<?php echo AF::link(array('templates' => 'view')); ?> " method="post" onsubmit="return false;"> <select data-placeholder="<?php echo __('all_templates'); ?> " name="template_id" data-placeholder="<?php echo __('choose_campaign'); ?> " class="chosen-select select-xlarge af_select_ajax"> <option value=""></option> <?foreach($templates as $value){?> <option value="<?php echo $value['template_id']; ?> " <?if($filterFields['template_id'] == $value['template_id']){?>selected=""<?}?>>[<?php
public function resetPassword() { $this->activkey = md5(microtime()); if (!$this->save()) { return false; } $activeLink = rtrim(Config::get()->url, '/') . AF::link(array('authorization' => 'reset'), array('idUser' => $this->user_id, 'activkey' => $this->activkey, 'reset' => 'true')); $text = __('reset_password_email_text', array('{username}' => $this->name)); $text .= '<br><br><a href="' . $activeLink . '">' . __('reset_password') . '</a>'; $headers = "Content-type: text/html; charset=utf-8 \r\n"; $headers .= 'To: ' . $this->name . ' <' . $this->login . '>' . "\r\n"; $headers .= 'From: Pinnacle CRM <*****@*****.**>' . "\r\n"; mail("{$this->login}", "{__('reset_password_email_subject')}", "{$text}", "{$headers}"); return true; }
?> <?if($access->actionAccess('create')){?> <a class="btn btn-small" href="<?php echo AF::link(array('prodcats' => 'create')); ?> "><i class="icon-plus"></i> <?php echo __('add_new'); ?> </a> <?}?> <?if($access->actionAccess('view_table')){?> <form data="af_ajax_table" class="search-form" action="<?php echo AF::link(array('prodcats' => 'view')); ?> " method="post" onsubmit="return false;"> <input class="input-large af-input-field" type="text" name="stext" placeholder="<?php echo __('search_text'); ?> " value="<?php echo $filterFields['stext']; ?> "> <button type="button" class="btn btn-small btn-set ajax_submit_form" ><i class="icon-search"></i> <?php echo __('search'); ?> </button> <button type="button" class="btn btn-small btn-set ajax_clear_form"><i class="icon-remove"></i> <?php echo __('clear_search');
?> </a> <?}else{?> 0 <?}?> </td> </tr> <tr> <td><b><?php echo __('count_prospects'); ?> :</b> </td> <td> <?if($countProspects){?> <a href="<?php echo AF::link(array('prospects' => 'view'), array('stext' => $email)); ?> "><?php echo $countProspects; ?> </a> <?}else{?> 0 <?}?> </td> </tr> </tbody> </table> <?php $this->widget(new TableView(array('dataProvider' => $dataProvider, 'access' => $access, 'controller' => $controller, 'countItems' => $pagination->countItems, 'fields' => array('order_id_name_link', 'ip_formatted', 'email', 'phone', 'fname', 'lname', 'address1', 'address2', 'city', 'state_id', 'country_id', 'zip'), 'pk' => 'email')));
<div class="form-name"><?php echo __('change_orders_recurring_date'); ?> </div> <form class="aform form-horizontal" id="form_change_orders_recurring_date" method="post"><!--action="<?php echo AF::link(array('orders' => 'view')); ?> "--> <div class="control-group"> <label class="control-label"><?php echo __('orders'); ?> </label> <div class="controls"> <input id="which_orders_1" type="radio" name="which_orders" value="<?php echo Order::RECURRING_ORDERS_ALL; ?> "> <?php echo __('apply_all_search_orders'); ?> <br> <input id="which_orders_2" type="radio" name="which_orders" value="<?php echo Order::RECURRING_ORDERS_SELECTED; ?> "> <?php echo __('checked_orders'); ?> <span class="help-inline"></span> </div>
<?if($access->actionAccess('create')){?> <a class="btn btn-small" href="<?php echo AF::link(array('events' => 'create')); ?> "><i class="icon-plus"></i> <?php echo __('add_new'); ?> </a> <?}?> <?if($access->actionAccess('view_table')){?> <?$FilterFields = $models->getoutFilterFields();?> <form data="af_ajax_table" class="search-form" action="<?php echo AF::link(array('events' => 'view')); ?> " method="post" onsubmit="return false;"> <select name="event_type" class="chosen-select select-large af_select_ajax" data-placeholder="<?php echo __('all_events'); ?> "> <option value=""></option> <?foreach(Event::$eventType as $key => $value){?> <option value="<?php echo $key; ?> " <?if($FilterFields['event_type'] == $key){?>selected="selected"<?}?>><?php echo $value; ?>
public function getcount_cg_2_formatted() { $filterFields = self::$FilterFields; $filterFields['gateway_id'] = $this->gateway_id; $filterFields['group_by'] = 1; $filterFields['campaign_id'] = null; $link = AF::link(array('reports' => 'cg'), $filterFields); return '<a href="' . $link . '">' . $this->count_cg . '</a>'; }
private function createReportAfidLink($data, $url, $from, $params = array()) { $FilterFields = self::$FilterFields; if ($FilterFields) { if ($this->gateway_id && $from == 'decline') { $params['gateway_id'] = $this->gateway_id; } if ($this->method_id && $from == 'decline') { $params['method_id'] = $this->method_id; } if ($this->status_note && $from == 'decline') { $params['reason_id'] = $this->status_note; } if (isset($FilterFields['r_dates_post']) && !empty($FilterFields['r_dates_post'])) { $params['r_dates'] = $FilterFields['r_dates_post']; } if ($from == 'decline' && isset($url['declinedreports']) && $url['declinedreports'] == 'orders') { } } $params['from'] = $from; $link = AF::link($url, $params); unset($FilterFields); return "<a href='{$link}'>{$data}</a>"; }
<h1><?php echo __('reports'); ?> </h1> <?php $this->widget(new BreadCrumbs(array('link' => array(__('decline_report'))))); ?> <hr> <?if($access->actionAccess('affiliate_vew_table')){?> <form data="af_ajax_table" class="search-form" action="<?php echo AF::link(array('declinedreports' => 'affiliates')); ?> " method="post" onsubmit="return false;"> <?php $this->widget(new DataPicker(array('name' => 'dates_r', 'value' => array('main' => $filterFields['r_dates'], 'post' => $filterFields['r_dates_post']), 'inputHtml' => array('class' => 'input-smedium', 'placeholder' => __('filter_date'))))); ?> <select name="gateway_id" class="chosen-select select-xxlarge af_select_ajax" data-placeholder="<?php echo __('choose_gateway'); ?> "> <option value=""></option> <?foreach($gateways as $value){?> <option value="<?php echo $value['gateway_id']; ?> " <?if($filterFields['gateway_id'] == $value['gateway_id']){?>selected="selected"<?}?>>[<?php
<div <?if($ajax){?>id="af_ajax_table"<?}?>> <form data="af_ajax_table" class="search-form" action="<?php echo AF::link(array('reports' => 'cardtype')); ?> " method="post" onsubmit="return false;"> <?php $this->widget(new DataPicker(array('name' => 'r_dates', 'value' => array('main' => $filterFields['r_dates'], 'post' => $filterFields['r_dates_post']), 'inputHtml' => array('class' => 'input-smedium', 'placeholder' => __('filter_date'))))); ?> <select multiple class="chosen-select select-xxlarge af_select_ajax" name="campaign_id" data-placeholder="<?php echo __('all_campaigns'); ?> "> <option value=""></option> <?foreach($campaigns as $value){?> <option value="<?php echo $value['campaign_id']; ?> " <?if( in_array($value['campaign_id'], $filterFields['campaign_id']) ){?>selected="selected"<?}?>>[<?php echo $value['campaign_id']; ?> ] <?php echo $value['campaign_name']; ?> </option> <?}?> </select> <span class="alignment">
public function getgateway_formatted() { $link = AF::link(array('gateways' => 'update'), array('id' => $this->gateway_id)); return '[<a href="' . $link . '">' . $this->gateway_id . '</a>] <a href="' . $link . '">' . $this->gateway_alias . '</a>'; }
public function getpayment_view_link() { $openUrl = AF::link(array('pixelrates' => 'view'), array('campaign_id' => $this->campaign_id, 'method_id' => $this->method_id)); $removeUrl = AF::link(array('pixelrates' => 'delete'), array('campaign_id' => $this->campaign_id, 'method_id' => $this->method_id, 'all_method' => '1')); return "<div class='btn-group'> <a class='btn_t btn-mini' href='{$openUrl}'><i class='icon-folder-open'></i></a> <a onclick=\"return confirm('Are you sure?');\" href='{$removeUrl}' class='btn_t btn-mini'><i class='icon-trash'></i></a></div>"; }
'model' => $model, )); ?> <div class="campship_hidden_campaign_id hide"><?php echo $campaign_id; ?> </div> </div> </div> <?}?> <?if($access->actionAccess('view_table')){?> <form id="taxes_search_form" data="af_ajax_table" class="search-form" action="<?php echo AF::link(array('taxes' => 'view')); ?> " method="post" onsubmit="return false;"> <select name="country_id" data-placeholder="<?php echo __('all_countries'); ?> " class="chosen-select af_select_ajax" style="width: 280px;"> <option value="" ></option> <?foreach($countries as $value){?> <option value="<?php echo $value['country_id']; ?> " <?if($filterFields['country_id'] == $value['country_id']){?>selected=""<?}?>>( <?php echo $value['country_id']; ?>
:</td> <td><?php echo $model->update_by_user_name; ?> <?php echo __('on'); ?> <?php echo $model->last_update_formatted; ?> </td> </tr> </tbody> </table> <form class="form-big edit_model_form" onsubmit="return false;" method="post" action="<?php echo AF::link(array('users' => 'restrictions'), array('id' => $model->user_id)); ?> "> <table class="table table-access"> <thead> <tr> <td><b><?php echo __('field'); ?> </b></td> <td style="text-align: right;"><b><?php echo __('access'); ?> </b></td> </tr> </thead>
private function array2str($item) { if (isset($item['visible']) && !$item['visible']) { return false; } $menuItem = new MenuItem(); $menuItem->class = isset($this->li_attributes['class']) ? $this->li_attributes['class'] : ''; if (isset($item['url'])) { $url = AF::linkArr2linkArr($item['url']); if (!$this->access->actionAccess($url)) { return false; } foreach ($item['url'] as $key => $value) { if ($this->different) { if ($key == $this->controller && $value == $this->action) { $menuItem->class .= ' active'; } } else { if ($key == $this->controller) { $menuItem->class .= ' active'; } } } } $menuItem->visible = isset($item['visible']) && !$item['visible'] ? '0' : '1'; $menuItem->label = isset($item['label']) ? $item['label'] : 'No Lable'; $menuItem->attributes = ' '; $params_url = isset($item['params_url']) ? $item['params_url'] : array(); $menuItem->url = isset($item['url']) ? AF::link($item['url'], $params_url) : '#'; if (isset($item['submenu']) && $item['submenu']) { $subMenu = array(); $active = false; foreach ($item['submenu'] as $itemSubMenu) { if (isset($itemSubMenu['url'])) { foreach ($itemSubMenu['url'] as $key => $value) { if ($key == $this->controller) { $active = true; } if ($this->different) { if ($key == $this->controller && $value == $this->action) { $active = true; } } else { if ($key == $this->controller) { $active = true; } } } } $itemS = $this->array2str($itemSubMenu); if ($itemS) { $subMenu[] = $itemS; } unset($itemS); } if (empty($subMenu)) { return false; } if ($active) { $menuItem->class .= ' active'; } $menuItem->subMenu = $subMenu; unset($subMenu); $menuItem->class .= ' dropdown'; if (isset($item['attributes']['class'])) { $item['attributes']['class'] .= 'dropdown-toggle'; } else { $item['attributes']['class'] = 'dropdown-toggle'; } } if ($item['attributes']) { $tempAttr = ''; foreach ($item['attributes'] as $key => $value) { $tempAttr .= $key . '="' . $value . '" '; } $menuItem->attributes = $tempAttr; unset($tempAttr, $key, $value); } return $menuItem; }
<div class="form-signin"> <h2 class="form-signin-heading">404: Page Not Found!</h2> <p> <?if(isset($_SERVER['HTTP_REFERER'])){?> <a href="<?php echo $_SERVER['HTTP_REFERER']; ?> ">Back</a> | <?}?> <a href="<?php echo Config::get()->url; ?> home" class="brand"><?php echo __('home'); ?> </a> | <a href="<?php echo AF::link(array('authorization' => 'login')); ?> " class="brand"><?php echo __('authorization'); ?> </a> </p> </div>
private function createReportAfidLink($data, $action, $from) { $params = array(); $FilterFields = self::$FilterFields; if ($FilterFields) { if ($this->campaign_id && $from == 'campaign') { $params['campaign_id'] = $this->campaign_id; } if ($this->AFID && $from == 'afids') { $params['AFID'] = $this->AFID; } if (isset($FilterFields['currency']) && !empty($FilterFields['currency'])) { $params['currency'] = implode(',', $FilterFields['currency']); } if (isset($FilterFields['dates']) && !empty($FilterFields['dates'])) { $params['dates'] = $FilterFields['dates']; } } $params['from'] = $from; $link = AF::link(array('reports' => $action), $params); unset($FilterFields); return "<a href='{$link}'>{$data}</a>"; }
<?php $this->includeFile('_menu', array('application', 'views', 'shipping'), array('access' => $access, 'controller' => $controller, 'action' => $action, 'user' => $user)); ?> <?if($access->actionAccess('create')){?> <a class="btn btn-small" href="shipping/create/"><i class="icon-plus"></i> <?php echo __('add_new'); ?> </a> <?}?> <?if($access->actionAccess('view_table')){?> <form data="af_ajax_table" class="search-form" action="<?php echo AF::link(array('shipping' => 'view')); ?> " method="post" onsubmit="return false;"> <select name="shipcat_id" multiple class="chosen-select select-large af_select_ajax" data-placeholder="<?php echo __('choose_shipcat_id'); ?> "> <?foreach($shipcats as $shipcat){?> <option value="<?php echo $shipcat['shipcat_id']; ?> " <?if(in_array($shipcat['shipcat_id'], $filterFields['shipcat_id'])){?>selected=""<?}?>><?php echo $shipcat['shipcat_name']; ?> </option>
function deleteAction() { $id = AF::get($_POST, 'id', 0); $modelsID = explode(',', $id); $errors = FALSE; foreach ($modelsID as $id) { $model = new Tax(); $model->model_uset_id = $this->user->user_id; if ($model->fillFromDbPk($id)) { $model->delete($id); } else { $errors = TRUE; } if ($model->getErrors()) { $errors = TRUE; } unset($model); } if (isset($_POST['ajax'])) { AF::setJsonHeaders('json'); if ($errors) { Message::echoJsonError(__('tax_not_deleted')); } else { $countE = AF::get($_POST, 'countE', 100000); // if the delete request came from an update page, we need to redirect if (count($modelsID) >= $countE || stripos($_SERVER['HTTP_REFERER'], 'taxes/update') !== false) { $link = AF::link(array('taxes' => 'view')); Message::echoJsonRedirect($link); } else { Message::echoJsonSuccess(__('tax_deleted')); } } } $this->redirect('view'); //$this->redirect(); }
<div class="form-name"><?php echo __($action . '_pixel'); ?> </div> <form class="aform form-horizontal" id="pixels_form_send" method="post" action="<?php echo AF::link(array('pixels' => $action), array('id' => $model->pixel_id)); ?> " <?if($ajax){?>onsubmit="return false;"<?}?>> <div class="control-group"> <label class="control-label"><?php echo __('select_pixel_type'); ?> </label> <div class="controls"> <select id="pixels_select_pixel_type" name="pixel_type" class="chosen-select select-xlarge" > <option value=""><?php echo __('choose'); ?> </option> <option value="postback" <?if('postback' == $model->pixel_type){?>selected=""<?}?>>postback</option> <option value="iframe" <?if('iframe' == $model->pixel_type){?>selected=""<?}?>>iframe</option> </select> <span class="help-inline"></span> </div> </div> <?$ff=AF::userAccess()->hasRestrictions('aff_id');?> <?if(!$ff){?> <div class="control-group">