public function index($mid = 1)
 {
     $vendorlist = "";
     if (empty($mid)) {
         redirect_to($this->uri->link("error/index"));
         exit;
     }
     $this->loadModel("Subregion");
     $datum = $this->model->getList("", "subregion");
     $this->view->mysubregion = $datum['subregion'];
     $uri = new Url("");
     $vendorlist .= "<table  width='100%'>\n<thead><tr>\n\t<th>S/N</th><th>Area ID</th><th> Name </th><th>Description </th><th>Date Created </th><th>Date Modified </th><th></th><th></th>\n</tr>\n</thead>\n<tbody>";
     if ($this->view->mysubregion) {
         $x = 1;
         foreach ($this->view->mysubregion as $region) {
             $vendorlist .= "<tr>\n    \t<td>{$x}</td><td>{$region->id}</td><td>{$region->name} </td><td>{$region->des}</td><td>{$region->datecreated}</td><td>{$region->datemodified}</td><td><a href='" . $uri->link("subregion/edit/" . $region->id . "") . "'>Edit</a></td><td><a href='" . $uri->link("subregion/doDelete/" . $region->id . "") . "'>Delete</a></td>\n    </tr>";
             $x++;
         }
     } else {
         $vendorlist .= "<tr><td colspan='7'>No record to display</td></tr>";
     }
     $vendorlist .= "</tbody>\n</table>";
     $this->view->myvends = $vendorlist;
     $this->view->render("subregion/index");
 }
 public function index($mid = 1)
 {
     $vendorlist = "";
     if (empty($mid)) {
         redirect_to($this->uri->link("error/index"));
         exit;
     }
     $this->loadModel("Vendors");
     $datum = $this->model->getList("", "Vendors");
     $this->view->myvendors = $datum['vendors'];
     $uri = new Url("");
     $vendorlist .= "<table  width='100%'>\n<thead><tr>\n\t<th>S/N</th><th>Vendor ID</th><th>Vendor Name </th><th>Email </th><th>Telephone </th><th>Date Modified </th><th></th><th></th>\n</tr>\n</thead>\n<tbody>";
     if ($this->view->myvendors) {
         $x = 1;
         foreach ($this->view->myvendors as $vendor) {
             $vendorlist .= "<tr>\n    \t<td>{$x}</td><td>{$vendor->vend_id}</td><td>{$vendor->vend_name} </td><td>{$vendor->vend_email}</td><td>{$vendor->vend_phone}</td><td>{$vendor->vend_datemodified}</td><td><a href='" . $uri->link("vendors/edit/" . $vendor->id . "") . "'>Edit</a></td><td><a href='" . $uri->link("vendors/doDelete/" . $vendor->id . "") . "'>Delete</a></td>\n    </tr>";
             $x++;
         }
     } else {
         $vendorlist .= "<tr><td colspan='7'>No record to display</td></tr>";
     }
     $vendorlist .= "</tbody>\n</table>";
     $this->view->myvends = $vendorlist;
     $this->view->render("vendors/index");
 }
 public function index($mid = 1)
 {
     $itemlist = "";
     if (empty($mid)) {
         redirect_to($this->uri->link("error/index"));
         exit;
     }
     $this->loadModel("Stockitems");
     $datum = $this->model->getList("", "Stockitems");
     $this->view->myitems = $datum['items'];
     $uri = new Url("");
     $itemlist .= "<table  width='100%'>\n<thead><tr>\n\t<th>S/N</th><th>Item ID</th><th>Item Name </th><th>Description </th><th>Qty In Stock </th><th>Date Modified </th><th></th><th></th>\n</tr>\n</thead>\n<tbody>";
     if ($this->view->myitems) {
         $x = 1;
         foreach ($this->view->myitems as $item) {
             $itemlist .= "<tr>\n    \t<td>{$x}</td><td>{$item->item_id}</td><td>{$item->item_name} </td><td>{$item->item_description}</td><td>{$item->item_quantity}</td><td>{$item->item_datemodified}</td><td><a href='" . $uri->link("stockitems/edit/" . $item->id . "") . "'>Edit</a></td><td><a href='" . $uri->link("stockitems/doDelete/" . $item->id . "") . "'>Delete</a></td>\n    </tr>";
             $x++;
         }
     } else {
         $itemlist .= "<tr><td colspan='7'>No record to display</td></tr>";
     }
     $itemlist .= "</tbody>\n</table>";
     $this->view->myitems = $itemlist;
     $this->view->render("stockitems/index");
 }
 public function index($mid = 1)
 {
     $productlist = "";
     if (empty($mid)) {
         redirect_to($this->uri->link("error/index"));
         exit;
     }
     $this->loadModel("Clientproduct");
     $datum = $this->model->getList("", "Clientproduct");
     $this->view->myclientsproducts = $datum['clientproduct'];
     $uri = new Url("");
     $productlist .= "<table  width='100%'>\n            <thead><tr>\n            \t<th>S/N</th><th>Product </th><th>Client</th><th>Location</th><th>City </th><th></th><th></th>\n            </tr>\n            </thead>\n            <tbody>";
     if ($this->view->myclientsproducts) {
         $x = 1;
         foreach ($this->view->myclientsproducts as $products) {
             $productlist .= "<tr>\n                \t<td>{$x}</td><td><a href='" . $uri->link("clientproduct/detail/" . $products->id) . "'>{$products->prod_name}</a> </td><td>{$products->client_name}</td><td>{$products->install_address}</td><td>{$products->install_city}</td><td><a href='" . $uri->link("clientproduct/edit/" . $products->id . "") . "'>Edit</a></td><td><a href='" . $uri->link("clientproduct/doDelete/" . $products->id . "") . "'>Delete</a></td>\n                </tr>";
             $x++;
         }
     } else {
         $productlist .= "<tr><td colspan='7'>No record to display</td></tr>";
     }
     $productlist .= "</tbody>\n            </table>";
     $this->view->myprods = $productlist;
     $this->view->render("clientproduct/index");
 }
 public function index($mid = 1)
 {
     $productlist = "";
     if (empty($mid)) {
         redirect_to($this->uri->link("error/index"));
         exit;
     }
     $this->loadModel("Clientproduct");
     $datum = $this->model->getList("", "Clientproduct");
     $this->view->myclientsproducts = $datum['clientproduct'];
     global $session;
     $uri = new Url("");
     $productlist .= "<table  width='100%'>\n            <thead><tr>\n            \t<th>S/N</th><th>Product </th><th>Client</th><th>Location</th><th>City </th><th></th><th></th>";
     /**
      * check for priviledge
      * for logged in users
      * at table level
      */
     $productlist .= "</tr>\n            </thead>\n            <tbody>";
     if ($this->view->myclientsproducts) {
         $x = 1;
         foreach ($this->view->myclientsproducts as $products) {
             $productlist .= "<tr>\n                \t<td>{$x}</td><td><a href='" . $uri->link("clientproduct/detail/" . $products->id) . "'>{$products->prod_name}</a> </td><td>{$products->client_name}</td><td>{$products->install_address}</td><td>{$products->install_city}</td>";
             foreach ($session->employee_role as $erole) {
                 //$emodule = Modules::find_by_module($erole->module);
                 $grant = array();
                 $grant = explode(",", $erole->access);
                 if ($erole->module == "clientproduct") {
                     if (in_array("Modify", $grant)) {
                         $productlist .= "<td><a href='" . $uri->link("clientproduct/edit/" . $products->id . "") . "'>Edit</a></td>";
                     } else {
                         $productlist .= "<td>";
                         print_r($grant);
                         $productlist .= "</td>";
                     }
                     if (in_array("Modify", $grant)) {
                         $productlist .= "<td><a href='" . $uri->link("clientproduct/doDelete/" . $products->id . "") . "'>Delete</a></td>";
                     } else {
                         $productlist .= "<td></td>";
                     }
                 }
             }
             $productlist .= "</tr>";
             $x++;
         }
     } else {
         $productlist .= "<tr><td colspan='7'>No record to display</td></tr>";
     }
     $productlist .= "</tbody>\n            </table>";
     $this->view->myprods = $productlist;
     $this->view->render("clientproduct/index");
 }
 public function index($mid = 1)
 {
     $vendorlist = "";
     if (empty($mid)) {
         redirect_to($this->uri->link("error/index"));
         exit;
     }
     $this->loadModel("Products");
     $datum = $this->model->getList("", "products");
     $this->view->myproducts = $datum['products'];
     $uri = new Url("");
     $vendorlist .= "<div class='row'><div class='large-12 columns'>" . $datum['mypagin'];
     $vendorlist .= "</div></div><div class='row'><div class='large-12 columns'><table  width='100%'>\n<thead><tr>\n\t<th>S/N</th><th>ProdID</th><th> Name </th><th>Description </th><th>Date Created </th><th>Date Modified </th><th></th><th></th>\n</tr>\n</thead>\n<tbody>";
     if ($this->view->myproducts) {
         $x = 1;
         foreach ($this->view->myproducts as $region) {
             $vendorlist .= "<tr>\n    \t<td>{$x}</td><td>{$region->prod_id}</td><td>{$region->prod_name} </td><td>{$region->prod_desc}</td><td>{$region->prod_created}</td><td>{$region->Prod_modified}</td><td><a href='" . $uri->link("products/edit/" . $region->prod_id . "") . "'>Edit</a></td><td><a class='dataDelete' data-reveal-id='firstModal{$region->prod_id}' href='#'>Delete</a>\n        \n        \n        <div id='firstModal{$region->prod_id}' class='reveal-modal small' style='background-image: linear-gradient(0deg, #f2f9fc, #addcf0 20.0em); border-radius:5px'>\n    <h2>Data Delete Console.</h2>\n    <hr />\n    <p>You are about to delete a record. Any record deleted will not longer be available in the database <br /> Are you sure you want to delete <b>{$region->prod_name}</b> from the database?</p>\n    <p><a href='?url=products/doCheckTransLog/{$region->main_id}' data-reveal-id='secondModal{$region->prod_id}' class='btn button btn-danger' data-reveal-ajax='true'>Yes</a>&nbsp; &nbsp; &nbsp;<a pdid='{$region->prod_id}' class='btn button btn-danger modalclose'>No</a></p>\n    <a class='close-reveal-modal'>&#215;</a>\n  </div>\n\n  <div id='secondModal{$region->prod_id}' class='reveal-modal small' style='background-image: linear-gradient(0deg, #f2f9fc, #addcf0 20.0em); border-radius:5px'>\n    <h2>This is a second modal.</h2>\n    <hr />\n    <p></p>\n    <a class='close-reveal-modal closemodal'>&#215;</a>\n  </div>\n        \n        \n        \n        </td>\n    </tr>";
             $x++;
         }
     } else {
         $vendorlist .= "<tr><td colspan='7'>No record to display</td></tr>";
     }
     $vendorlist .= "</tbody>\n</table></div></div><div class='row'><div class='large-12 columns'>";
     $vendorlist .= $datum['mypagin'] . "</div><p>&nbsp;</p></div>";
     $this->view->myvends = $vendorlist;
     $this->view->render("products/index");
 }
Exemple #7
0
 /**
  * Constructor
  *  
  * @param string $template 
  */
 public function __construct($name, $template = NULL, $base_uri = NULL)
 {
     parent::__construct($name);
     cogear()->menu->register($name, $this);
     $template && ($this->template = $template);
     $this->base_uri = rtrim(parse_url($base_uri ? $base_uri : Url::link(), PHP_URL_PATH), '/') . '/';
 }
Exemple #8
0
 /**
  * Render
  */
 public function render()
 {
     $this->getAttributes();
     if ($this->value && ($this->value = Url::link(Url::toUri(UPLOADS . $this->value, ROOT, FALSE)))) {
         $tpl = new Template('Form.file');
         $tpl->assign($this->attributes);
         $tpl->value = $this->value;
         $this->code = $tpl->render();
     }
     return parent::render();
 }
Exemple #9
0
 /**
  * Render
  */
 public function render()
 {
     $this->getAttributes();
     $this->attributes->type = 'file';
     $this->attributes->class = 'ajaxed image';
     $tpl = new Template('Upload_Ajax.image');
     $tpl->assign($this->attributes);
     if ($this->value && ($this->value = Url::link(Url::toUri(UPLOADS . $this->value, ROOT, FALSE)))) {
         $tpl->value = $this->value;
         $tpl->image = $this->image;
     }
     $this->code = $tpl->render();
     return Form_Element_Abstract::render();
 }
Exemple #10
0
 /**
  * Конструктор
  *
  * @param array $options
  */
 public function __construct($options)
 {
     // Принимаем настройки
     parent::__construct($options);
     // Подкрепляем шестеренку Мета в качестве слушателя Listener (паттерн ООП Observer)
     $this->attach(cogear()->Meta);
     // Определяем базовый uri, от которого работает меню
     $this->options->base = rtrim(parse_url($this->options->base ? $this->options->base : Url::link(), PHP_URL_PATH), '/') . '/';
     // Если определен вывод, вешаем хук
     $this->options->render && hook($this->options->render, array($this, 'output'));
     // Регистрируем элементы меню из конфига
     if ($this->options->elements) {
         foreach ($this->options->elements as $item) {
             $this->add($item->toArray());
         }
     }
 }
Exemple #11
0
 public function admin($action = NULL)
 {
     if ($files = glob($this->dir . DS . 'js/jquery*')) {
         $current_script = reset($files);
         preg_match('#jquery-([\\d.]+)(\\.min)?\\.js#', $current_script, $matches);
         $current_version = $matches[1];
         $code = file_get_contents('http://code.jquery.com/');
         preg_match('#/jquery-([\\d\\.]+)\\.min\\.js#imsU', $code, $matches);
         $server_script = 'http://code.jquery.com' . $matches[0];
         $server_version = $matches[1];
         if (version_compare($server_version, $current_version, '>')) {
             if ($action = 'update') {
                 Filesystem::delete($current_script);
                 copy($server_script, dirname($current_script) . DS . basename($server_script));
                 success(t('jQuery library has been update successfully!'));
             } else {
                 info(t("Notice, jQuery framework has been updated to version <b>%s</b>. Current version is <b>%s</b>.", 'jQuery', $server_version, $current_version) . '<a href="' . Url::link('admin/jquery/update/') . '" class="button">' . t('Update') . '</a>');
             }
         }
     }
 }
Exemple #12
0
 public function index()
 {
     @$this->loadModel("Users");
     $uri = new Url("");
     $datum = array();
     $datum = $this->model->getList("", "users");
     $this->view->pagin = $datum['mypagin'];
     $this->alluser = $datum['myusers'];
     $userlist = "";
     $userlist .= "<table  width='100%' class='table table-bordered'>\n\t\t<thead><tr>\n\t\t\t<th>ID</th><th>Image</th><th>Fullname</th><th>Email</th><th>Telephone</th><th>Date Created</th><th>Last Modified</th><th></th>\n\t\t</tr>\n\t\t</thead>\n\t\t<tbody>";
     if ($this->alluser) {
         foreach ($this->alluser as $user) {
             $userlist .= "<tr>\n\t\t\t<td>{$user->user_id}</td><td>";
             $userlist .= $user->img_url != "" && file_exists("public/uploads/{$user->img_url}") ? "<img src ='public/uploads/{$user->img_url}' width='50' height='48'  />" : "<img src ='public/images/anonymous.jpg' width='50' height='48'  />";
             $userlist .= "</td><td>{$user->fname} {$user->lname}</td><td>{$user->email}</td><td>{$user->phone}</td><td>{$user->date_added}</td><td>{$user->date_added}</td><td><a href='" . $uri->link("users/edit/" . $user->user_id . "") . "'>Edit</a></td>\n\t\t</tr>";
         }
     } else {
         $userlist .= "<tr><td colspan='10'> No record found </td></tr>";
     }
     $userlist .= "</tbody></table>";
     $this->view->myusers = $userlist;
     $this->view->render("users/index");
 }
Exemple #13
0
 /**
  * Конструктор
  */
 public function __construct()
 {
     // Вызываем статический класс, чтобы дальше работал его метод-ссылка l();
     $this->host = Url::link();
     $string_filter = array(FILTER_SANITIZE_SPECIAL_CHARS, FILTER_SANITIZE_STRING);
     $path_filter = array(FILTER_SANITIZE_URL, FILTER_FLAG_PATH_REQUIRED);
     $this->server = new Core_ArrayObject($_SERVER);
     foreach (array('HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'REMOTE_ADDR') as $ip) {
         if (isset($this->server[$ip])) {
             $this->ip = $this->server[$ip];
             continue;
         }
     }
     $this->method = $this->server['REQUEST_METHOD'];
     if (!empty($this->server['HTTPS'])) {
         $this->protocol = 'https';
     }
     if (!empty($this->server['HTTP_X_REQUESTED_WITH']) && 'xmlhttprequest' == strtolower($this->server['HTTP_X_REQUESTED_WITH'])) {
         $this->is_ajax = TRUE;
     }
     if (!empty($this->server['HTTP_REFERER'])) {
         $this->referer = $this->server['HTTP_REFERER'];
     }
 }
 public function zmenu_autocomplete()
 {
     $furl = new Url("/", "/");
     $json = array();
     if (isset($this->request->get['filter_name']) || isset($this->request->get['filter_model'])) {
         $this->load->model('catalog/product');
         if (isset($this->request->get['filter_name'])) {
             $filter_name = $this->request->get['filter_name'];
         } else {
             $filter_name = '';
         }
         if (isset($this->request->get['filter_model'])) {
             $filter_model = $this->request->get['filter_model'];
         } else {
             $filter_model = '';
         }
         if (isset($this->request->get['limit'])) {
             $limit = $this->request->get['limit'];
         } else {
             $limit = 20;
         }
         $data = array('filter_name' => $filter_name, 'filter_model' => $filter_model, 'start' => 0, 'limit' => $limit);
         $results = $this->model_catalog_product->getProducts($data);
         foreach ($results as $result) {
             $titles = $this->model_catalog_product->getProductDescriptions($result['product_id']);
             $json[] = array('product_id' => $result['product_id'], 'name' => strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')), 'model' => $result['model'], 'price' => $result['price'], 'titles' => $titles, 'href' => $furl->link('product/product', 'path=' . $result['product_id'], 'SSL'));
         }
     }
     $this->response->setOutput(json_encode($json));
 }
 public function search()
 {
     $this->loadModel("Supportticket");
     $datum = $this->model->search();
     $this->view->mytickets = $datum['Supportticket'];
     $uri = new Url("");
     $ticketlist .= "<table class='table table-bordered'>\n\t\t\t<thead><tr>\n\t\t\t\t<th width='15%'>Date Created</th><th width='10%'>Ticket ID</th><th width='40%'>Subject</th><th width='5%'>Status </th><th width='10%'>Department </th><th width='10%'>Last Reply</th><th width='10%'></th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>";
     if ($this->view->mytickets) {
         $x = 1;
         foreach ($this->view->mytickets as $ticket) {
             $ticketlist .= "<tr>\n\t\t\t\t\t<td>" . date_format(new DateTime($ticket->datecreated), "M d Y g:ia") . "</td><td>{$ticket->id}</td><td>{$ticket->subject} </td><td>{$ticket->status}</td><td>{$ticket->department}</td><td>" . date_format(new DateTime($ticket->datemodified), "M d Y g:ia") . "</td><td><a href='" . $uri->link("supportticket/detail/" . $ticket->id . "") . "'>View Ticket</a></td>\n\t\t\t\t</tr>";
             $x++;
         }
     } else {
         $ticketlist .= "<tr><td colspan='7'>No Result Found</td></tr>";
     }
     $ticketlist .= "</tbody>\n\t\t\t</table>";
     $this->view->myvends = $ticketlist;
     $this->view->render("supportticket/index");
 }
Exemple #16
0
 /**
  * Generate select with links to category, product, information
  * @return string Generated <select> html
  */
 public function link()
 {
     $data = array();
     $url = new Url(HTTP_CATALOG, $this->registry->config->get('config_secure') ? HTTPS_CATALOG : HTTP_CATALOG);
     foreach ($this->getElementModels() as $model) {
         switch (true) {
             case $model == 'category':
                 $this->registry->load->model('catalog/category');
                 $categories = $this->registry->model_catalog_category->getCategories();
                 foreach ($categories as $category) {
                     $link = $url->link('product/category', 'path=' . $category['category_id']);
                     $data['category'][$link] = $category['name'];
                 }
                 break;
             case $model == 'product':
                 $this->registry->load->model('catalog/product');
                 $products = $this->registry->model_catalog_product->getProducts();
                 foreach ($products as $product) {
                     $link = $url->link('product/product', 'product_id=' . $product['product_id']);
                     $data['product'][$link] = $product['name'];
                 }
                 break;
             case $model == 'information':
                 $this->registry->load->model('catalog/information');
                 $informations = $this->registry->model_catalog_information->getInformations();
                 foreach ($informations as $information) {
                     $link = $url->link('information/information', 'information_id=' . $information['information_id']);
                     $data['information'][$link] = $information['title'];
                 }
                 break;
             case $model == 'custom':
                 foreach ($this->getElementCustomLinks() as $link => $title) {
                     $link = $url->link($link);
                     $data['custom'][$link] = $title;
                 }
                 break;
         }
     }
     $this->setElementOptGroups($data);
     return $this->select();
 }
 public function index($result = "")
 {
     //Load the language file for this module
     $this->load->language('module/productify');
     //$this->load->model("module/productify");
     //Set the title from the language file $_['heading_title'] string
     $this->document->setTitle($this->language->get('heading_title'));
     //Load the settings model. You can also add any other models you want to load here.
     $this->load->model('setting/setting');
     //Save the settings if the user has submitted the admin form (ie if someone has pressed save).
     /*if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
     			$this->model_setting_setting->editSetting('productify', $this->request->post);		
     					
     			$this->session->data['success'] = $this->language->get('text_success');
     						
     			$this->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'));
     		}*/
     if (isset($this->request->post['search'])) {
         $url = $this->request->post['url'];
         $this->data['url'] = $url;
         $xml_url = strpos($url, ".xml");
         $http_url = strpos($url, "http");
         if ($http_url === 0 && $xml_url !== false) {
             $file_headers = @get_headers($url);
         }
         if ($xml_url === false) {
             $this->data['error'] = "Please Provide a proper XML feed URL";
         } elseif ($http_url !== 0) {
             $this->data['error'] = "Please Provide a proper XML feed URL";
         } elseif ($file_headers[0] == 'HTTP/1.1 404 Not Found') {
             $this->data['error'] = "The feed URL entered is incorrect. Feed not found or invalid format";
         } elseif (simplexml_load_string(file_get_contents($url))) {
             $xml = simplexml_load_string(file_get_contents($url));
             $feed_validity = 1;
             $test_product = $xml->products->product;
             //echo "<pre>";
             //print_r($test_product);
             if (!isset($test_product->product_code)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->product_name)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->brand)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->short_description)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->detailed_description)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->categories)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->categories->category)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->skus)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->skus->sku)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->skus->sku->id)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->skus->sku->retail_price)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->skus->sku->sale_price)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->skus->sku->ean)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->skus->sku->upc)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->skus->sku->weight)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->skus->sku->stock)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->skus->sku->variants)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->skus->sku->variants->variant)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->media)) {
                 $feed_validity = 0;
             }
             if (!isset($test_product->media->image_url)) {
                 $feed_validity = 0;
             }
             //echo "feed status = ".$feed_validity;echo "</pre>";die();
             if ($feed_validity == 1) {
                 $this->data['xml'] = $xml;
             } else {
                 $this->data['error'] = "The feed URL entered is incorrect. Feed not found or invalid format";
             }
         } else {
             $this->data['error'] = "The feed URL entered is incorrect. Feed not found or invalid format";
             //echo "Failed to load the url<br />Maybe the url you provided is not a xml feed";
             //die();
         }
     }
     if (isset($this->request->post['save_products'])) {
         $this->data['step'] = 4;
         $step = 4;
     }
     if ($result != "") {
         $this->data['step'] = 5;
         $success = 0;
         $failed = 0;
         foreach ($result as $r) {
             if ($r == 1) {
                 $success++;
             } else {
                 $failed++;
             }
         }
         $this->data['success'] = $success;
         $this->data['failure'] = $failed;
     }
     //This is how the language gets pulled through from the language file.
     //
     // If you want to use any extra language items - ie extra text on your admin page for any reason,
     // then just add an extra line to the $text_strings array with the name you want to call the extra text,
     // then add the same named item to the $_[] array in the language file.
     //
     // 'my_module_example' is added here as an example of how to add - see admin/language/english/module/productify.php for the
     // other required part.
     $text_strings = array('heading_title', 'text_enabled', 'text_disabled', 'text_content_top', 'text_content_bottom', 'text_column_left', 'text_column_right', 'entry_layout', 'entry_limit', 'entry_image', 'entry_position', 'entry_status', 'entry_sort_order', 'button_save', 'button_cancel', 'button_add_module', 'button_remove', 'entry_example');
     foreach ($text_strings as $text) {
         $this->data[$text] = $this->language->get($text);
     }
     //END LANGUAGE
     //The following code pulls in the required data from either config files or user
     //submitted data (when the user presses save in admin). Add any extra config data
     // you want to store.
     //
     // NOTE: These must have the same names as the form data in your productify.tpl file
     //
     $config_data = array('my_module_example');
     foreach ($config_data as $conf) {
         if (isset($this->request->post[$conf])) {
             $this->data[$conf] = $this->request->post[$conf];
         } else {
             $this->data[$conf] = $this->config->get($conf);
         }
     }
     //This creates an error message. The error['warning'] variable is set by the call to function validate() in this controller (below)
     if (isset($this->error['warning'])) {
         $this->data['error_warning'] = $this->error['warning'];
     } else {
         $this->data['error_warning'] = '';
     }
     //SET UP BREADCRUMB TRAIL. YOU WILL NOT NEED TO MODIFY THIS UNLESS YOU CHANGE YOUR MODULE NAME.
     $this->data['breadcrumbs'] = array();
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => false);
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('text_module'), 'href' => $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => ' :: ');
     $this->data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('module/productify', 'token=' . $this->session->data['token'], 'SSL'), 'separator' => ' :: ');
     $this->data['action'] = $this->url->link('module/productify', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['cancel'] = $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL');
     $this->data['import_new'] = $this->url->link('module/productify', 'token=' . $this->session->data['token'], 'SSL');
     //This code handles the situation where you have multiple instances of this module, for different layouts.
     $this->data['modules'] = array();
     if (isset($this->request->post['my_module_module'])) {
         $this->data['modules'] = $this->request->post['my_module_module'];
     } elseif ($this->config->get('my_module_module')) {
         $this->data['modules'] = $this->config->get('my_module_module');
     }
     $this->load->model('design/layout');
     $this->data['layouts'] = $this->model_design_layout->getLayouts();
     //Choose which template file will be used to display this request.
     $this->template = 'module/productify.tpl';
     $this->children = array('common/header', 'common/footer');
     if (isset($step)) {
         $url = $this->request->post['url'];
         $skus = array_unique($this->request->post['skus']);
         $import_images = isset($this->request->post['import_images']) ? $this->request->post['import_images'] : 0;
         $active_products = isset($this->request->post['active_products']) ? $this->request->post['active_products'] : 0;
         $email = $this->request->post['email'];
         $total_import = $this->request->post['total_import'];
         //if(1){
         if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
             $xml = simplexml_load_file($url) or die("Could not load the URL file.Please Retry.");
             foreach ($xml->products->product as $prd) {
                 //print_r($prd);
                 //echo "<br />";
                 $product = array();
                 $product = array("product_code" => "{$prd->product_code}", "name" => "{$prd->product_name}", "brand" => "{$prd->brand}", "short_description" => "{$prd->short_description}", "detail_description" => "{$prd->detailed_description}", "warranty" => "{$prd->warranty}", "website_url" => "{$prd->website_url}", "import_images" => $import_images, "enable" => $active_products);
                 $categories = $prd->categories->category;
                 $product['category'] = "{$categories}";
                 $images = array();
                 foreach ($prd->media->image_url as $img) {
                     //print_r($img);
                     $image_default = "false";
                     foreach ($img->attributes() as $a => $b) {
                         $image_default = "{$b}";
                     }
                     $images[] = array("default" => "{$image_default}", "image_url" => "{$img}");
                 }
                 $product['media'] = $images;
                 //echo "<br />";
                 foreach ($prd->skus->sku as $s) {
                     //print_r($s);
                     $prd_sku = "{$s->id}";
                     $sku = array();
                     if (in_array($prd_sku, $skus)) {
                         $weight_units = preg_split('#(?<=\\d)(?=[a-z])#i', $s->weight);
                         //print_r($weight_units);
                         $weight = $weight_units[0];
                         $weight_class = $weight_units[1] == 'g' ? 2 : 1;
                         $sku = array("id" => "{$prd_sku}", "sale_price" => "{$s->sale_price}", "retail_price" => "{$s->retail_price}", "stock" => "{$s->stock}", "ean" => "{$s->ean}", "upc" => "{$s->upc}", "weight" => "{$weight}", "weight_class" => "{$weight_class}");
                         $variants = array();
                         foreach ($s->variants->variant as $var) {
                             foreach ($var->attributes() as $a => $v) {
                                 $variants[] = array("{$v}" => "{$var}");
                             }
                         }
                         $sku['variants'] = $variants;
                         $product['sku'] = $sku;
                         $added[] = $this->addProduct($product);
                     }
                 }
             }
             $success = 0;
             $failed = 0;
             foreach ($added as $r) {
                 if ($r == 1) {
                     $success++;
                 } else {
                     $failed++;
                 }
             }
             $message = "<html>\n                        <head>\n                            <title>Data imported successfully</title>\n                        </head>\n                        <body>\n                            <p>\n                            Hi there,<br /><br />\n                            Your import has been completed.<br /><br />\n                            Import Status: " . $tot_added . " (successful) and " . $tot_failed . " (failed)<br /><br />\n                            Thank you!\n                            </p>\n                        </body>\n                        </html>";
             $to = $email;
             $subject = "Data imported successfully";
             $mail = new Mail();
             $mail->protocol = $this->config->get('config_mail_protocol');
             $mail->parameter = $this->config->get('config_mail_parameter');
             $mail->hostname = $this->config->get('config_smtp_host');
             $mail->username = $this->config->get('config_smtp_username');
             $mail->password = $this->config->get('config_smtp_password');
             $mail->port = $this->config->get('config_smtp_port');
             $mail->timeout = $this->config->get('config_smtp_timeout');
             $mailText = html_entity_decode($message, ENT_QUOTES, 'UTF-8');
             $mail->setFrom('*****@*****.**');
             $mail->setSender('Productify.com');
             $mail->setTo($to);
             $mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
             $mail->setHtml($mailText);
             $mail->send();
             $this->data['message'] = "Import process completed. <br />pleasae make sure to confirm the categories, product options and their images";
             $this->data['step'] = 5;
         } else {
             //$total_import = count($skus);
             $skus = json_encode($skus);
             $this->load->model("module/productify");
             $add_to_import = $this->model_module_productify->add_to_import($url, $skus, $import_images, $active_products, $email, $total_import);
             if ($add_to_import) {
                 $new_url = new Url(HTTP_CATALOG, $this->config->get('config_secure') ? HTTP_CATALOG : HTTPS_CATALOG);
                 $cron_url = $new_url->link("module/productify");
                 //exec("curl --silent $cron_url");
                 $output = shell_exec('crontab -l');
                 if (strpos($output, $cron_url) === false) {
                     file_put_contents('/tmp/crontab.txt', $output . "*/1 * * * * wget -q -O /dev/null {$cron_url}" . PHP_EOL);
                     exec('crontab /tmp/crontab.txt');
                 }
                 $this->data['message'] = "Your import has been added to the cron. It may take many minutes to complete depending upon the number of products you selected to import. You will receive an email when the import process completes.<br />After completion of the process please make sure to confirm the categories, product options and their images.<br />";
                 $this->data['step'] = 5;
             } else {
                 $this->data['message'] = "Failed to add to cron Please Retry";
                 $this->data['step'] = 5;
             }
         }
     }
     //Send the output.
     $this->response->setOutput($this->render());
 }
Exemple #18
0
function redirect($url = NULL)
{
    $url or $url = Url::link();
    cogear()->save();
    header('Location: ' . $url);
    exit;
}
Exemple #19
0
 public function update()
 {
     $product_id = 0;
     // Redirect to product create if product_id is not exists
     if (isset($this->request->get['product_id'])) {
         $product_id = (int) $this->request->get['product_id'];
     } else {
         // Log hack attempt
         $this->security_log->write('Try to get product without product_id param');
         $this->response->redirect($this->url->link('account/product/create'));
     }
     // Redirect to login page if user is not logged
     if (!$this->auth->isLogged()) {
         $this->response->redirect($this->url->link('account/account/login', 'redirect=' . base64_encode($this->url->link('account/product/update', 'product_id=' . $product_id))));
     }
     // Check if user has product
     if (!$this->model_catalog_product->userHasProduct($this->auth->getId(), $product_id)) {
         // Log hack attempt
         $this->security_log->write('Try to get not own\'s product_id #' . $product_id);
         // Redirect to safe page
         $this->response->redirect($this->url->link('account/product'));
     }
     if ('POST' == $this->request->getRequestMethod() && $this->_validateProductForm()) {
         // Start transaction
         $this->db->beginTransaction();
         // Add product
         $this->model_catalog_product->updateProduct($product_id, $this->request->post['category_id'], $this->request->post['currency_id'], $this->request->post['regular_price'], $this->request->post['exclusive_price'], $this->request->post['withdraw_address'], FilterUri::alias($this->request->post['product_description'][DEFAULT_LANGUAGE_ID]['title']), (int) $this->auth->isVerified());
         // Add 301 rule if product has new URI
         $url = new Url($this->db, $this->request, $this->response, URL_BASE);
         $old_url = $this->url->link('catalog/product', 'product_id=' . $product_id);
         $new_url = $url->link('catalog/product', 'product_id=' . $product_id);
         if ($old_url != $new_url) {
             $this->model_common_redirect->createRedirect(301, str_replace(URL_BASE, $old_url), str_replace(URL_BASE, $new_url));
         }
         // Add product description
         $this->model_catalog_product->deleteProductDescriptions($product_id);
         foreach ($this->request->post['product_description'] as $language_id => $product_description) {
             $this->model_catalog_product->createProductDescription($product_id, $language_id, $product_description['title'], $product_description['description']);
         }
         // Add Tags
         $this->model_catalog_product->deleteProductToTagByProductId($product_id);
         foreach ($this->request->post['product_description'] as $language_id => $product_description) {
             if (!empty($product_description['tags'])) {
                 $tags = explode(',', $product_description['tags']);
                 foreach ($tags as $tag) {
                     // Add a new global tag if not exists
                     $tag_id = $this->model_catalog_tag->createTag(mb_strtolower(trim($tag)), $language_id);
                     // Add product to tag relation
                     $this->model_catalog_product->addProductToTag($product_id, $tag_id);
                 }
             }
         }
         // Add file
         $directory = DIR_STORAGE . $this->auth->getId() . DIR_SEPARATOR;
         if ($file_content = file_get_contents($directory . $this->request->post['product_file_id'] . '.' . STORAGE_FILE_EXTENSION)) {
             $this->model_catalog_product->deleteProductFiles($product_id);
             $product_file_id = $this->model_catalog_product->createProductFile($product_id, md5($file_content), sha1($file_content));
             rename($directory . $this->request->post['product_file_id'] . '.' . STORAGE_FILE_EXTENSION, $directory . $product_file_id . '.' . STORAGE_FILE_EXTENSION);
         }
         // Add demos
         $this->model_catalog_product->deleteProductDemos($product_id);
         if (isset($this->request->post['demo'])) {
             foreach ($this->request->post['demo'] as $row => $demo) {
                 $product_demo_id = $this->model_catalog_product->createProductDemo($product_id, $demo['sort_order'], $demo['url'], $this->request->post['main_demo'] == $row ? 1 : 0);
                 foreach ($demo['title'] as $language_id => $title) {
                     $this->model_catalog_product->createProductDemoDescription($product_demo_id, $language_id, $title);
                 }
             }
         }
         // Update images
         $this->model_catalog_product->deleteProductImages($product_id);
         if (isset($this->request->post['image'])) {
             foreach ($this->request->post['image'] as $row => $image) {
                 $product_image_id = $this->model_catalog_product->createProductImage($product_id, $image['sort_order'], $this->request->post['main_image'] == $row ? 1 : 0, isset($image['watermark']) ? 1 : 0);
                 // Generate image titles
                 foreach ($image['title'] as $language_id => $title) {
                     $this->model_catalog_product->createProductImageDescription($product_image_id, $language_id, $title);
                 }
                 // Rename temporary file
                 $directory = DIR_STORAGE . $this->auth->getId() . DIR_SEPARATOR;
                 rename($directory . $image['product_image_id'] . '.' . STORAGE_IMAGE_EXTENSION, $directory . $product_image_id . '.' . STORAGE_IMAGE_EXTENSION);
             }
             // Generate unique image if others images is not exists
         } else {
             $product_image_id = $this->model_catalog_product->createProductImage($product_id, 1, 1, 0, 1);
             // Generate image titles from product title
             foreach ($this->request->post['product_description'] as $language_id => $product_description) {
                 $this->model_catalog_product->createProductImageDescription($product_image_id, $language_id, $product_description['title']);
             }
             $identicon = new Identicon();
             $image = new Image($identicon->generateImageResource(sha1($product_id), PRODUCT_IMAGE_ORIGINAL_WIDTH, PRODUCT_IMAGE_ORIGINAL_HEIGHT), true);
             $image->save(DIR_STORAGE . $this->auth->getId() . DIR_SEPARATOR . $product_image_id . '.' . STORAGE_IMAGE_EXTENSION);
         }
         // Add videos
         $this->model_catalog_product->deleteProductVideos($product_id);
         if (isset($this->request->post['video'])) {
             foreach ($this->request->post['video'] as $video) {
                 $product_video_id = $this->model_catalog_product->createProductVideo($product_id, $video['source'], $video['sort_order'], $video['id']);
                 foreach ($video['title'] as $language_id => $title) {
                     $this->model_catalog_product->createProductVideoDescription($product_video_id, $language_id, $title);
                 }
             }
         }
         // Add audios
         $this->model_catalog_product->deleteProductAudios($product_id);
         if (isset($this->request->post['audio'])) {
             foreach ($this->request->post['audio'] as $audio) {
                 $product_audio_id = $this->model_catalog_product->createProductAudio($product_id, $audio['source'], $audio['sort_order'], $audio['id']);
                 foreach ($audio['title'] as $language_id => $title) {
                     $this->model_catalog_product->createProductAudioDescription($product_audio_id, $language_id, $title);
                 }
             }
         }
         // Add specials
         $this->model_catalog_product->deleteProductSpecials($product_id);
         if (isset($this->request->post['special'])) {
             foreach ($this->request->post['special'] as $special) {
                 $this->model_catalog_product->createProductSpecial($product_id, $special['regular_price'], $special['exclusive_price'], $special['date_start'], $special['date_end'], $special['sort_order']);
             }
         }
         $this->db->commit();
         // Cleaning
         $this->cache->clean($this->auth->getId());
         $this->storage->clean($this->auth->getId());
         // Set success message
         $this->session->setUserMessage(array('success' => tt('Product successfully updated!')));
         // Admin alert if current user is not verified (updated product has been disabled)
         if (!$this->auth->isVerified()) {
             $this->mail->setTo(MAIL_EMAIL_SUPPORT_ADDRESS);
             $this->mail->setSubject(sprintf(tt('Product has been updated - %s'), PROJECT_NAME));
             $this->mail->setText(sprintf(tt('Product ID %s by %s has been updated and waiting for approving!'), $product_id, $this->auth->getUsername()));
             $this->mail->send();
         }
         $this->response->redirect($this->url->link('account/product'));
     }
     $data = $this->_populateForm($this->url->link('account/product/update', 'product_id=' . $product_id));
     $data['footer'] = $this->load->controller('common/footer');
     $data['header'] = $this->load->controller('common/header');
     $data['module_breadcrumbs'] = $this->load->controller('module/breadcrumbs', array(array('name' => tt('Home'), 'href' => $this->url->link('common/home'), 'active' => false), array('name' => tt('Product list'), 'href' => $this->url->link('account/product'), 'active' => false), array('name' => tt('Update product'), 'href' => $this->url->link('account/product/update', 'product_id=' . $product_id), 'active' => true)));
     // Renter the template
     $this->response->setOutput($this->load->view('account/product/product_form.tpl', $data));
 }
    ?>
    <?php 
    if ($sf_user->isAuthenticated()) {
        ?>
        <div id="logout">
            [<?php 
        echo Url::link(I18n::__('messages.labels.logout'), '@logout', array('ajax' => 'action', 'dest' => 'logout'));
        ?>
]
            <?php 
        echo $sf_user->getNickname();
        ?>
        </div>
    <?php 
    }
    ?>
    <div class="clear"></div>
</div>
<?php 
    if (sfConfig::get('app_admin_include_path', true)) {
        ?>
<div id="sf_admin_path" class="ui-widget">
    <strong><?php 
        echo Url::link(I18n::__('messages.labels.home'), '@homepage');
        ?>
</strong>
    <div id="breadcrumbs"></div>
</div>
<?php 
    }
}
 public function index($mid = 1)
 {
     $emplist = "";
     if (empty($mid)) {
         redirect_to($this->uri->link("error/index"));
         exit;
     }
     $this->loadModel("Employees");
     $datum = $this->model->getList("", "Employees");
     $this->view->myemployee = $datum['myemployee'];
     $datumo = $this->model->getData();
     //get general array data
     $this->view->state = $datumo['state'];
     //get state of origin from array
     // $this->view->employee    =   $this->model->getById($id);
     $this->view->role = $datumo['role'];
     $this->view->depts = $datumo['departs'];
     $uri = new Url("");
     $emplist .= "<div class='row'><div class='large-12 columns'>";
     $emplist .= "</div></div><div class='row'><div class='large-12 columns'><table id='dt_basic'  width='100%'>\n<thead><tr>\n\t<th>Emp ID</th><th>Fullname </th><th>Department </th><th>Post </th><th>Date Employed </th><th></th><th></th>\n</tr>\n</thead>\n<tbody>";
     if ($this->view->myemployee) {
         $x = 1;
         foreach ($this->view->myemployee as $emp) {
             $emplist .= "<tr>\n    \t<td>{$emp->emp_id}</td><td>{$emp->emp_fname} {$emp->emp_mname} " . strtoupper("{$emp->emp_lname}") . "</td><td>";
             if (!empty($emp->emp_dept)) {
                 if ($this->model->findDepartment($emp->emp_dept)) {
                     $empDept = $this->model->findDepartment($emp->emp_dept);
                     $emplist .= $empDept->dept_name;
                 }
             }
             $emplist .= "</td><td>";
             if (!empty($emp->emp_post)) {
                 if ($this->model->findRole($emp->emp_post)) {
                     $empRole = $this->model->findRole($emp->emp_post);
                     $emplist .= $empRole->role_name;
                 }
             }
             $emplist .= "</td><td>{$emp->emp_date_employed}</td>";
             /**
              * section to set grant and\
              * previledge
              */
             $emplist .= "<td><a href='" . $uri->link("employees/edit/" . $emp->id . "") . "'>Edit</a></td>";
             foreach ($session->employee_role as $erole) {
                 //$emodule = Modules::find_by_module($erole->module);
                 $grant = array();
                 $grant = explode(",", $erole->access);
                 // if($erole->module == "employees" || $erole->module == "itdepartment" ){
                 //if(in_array("Modify",$grant)){
                 // }
                 if (in_array("Delete", $grant)) {
                     $emplist .= "<td><a href='" . $uri->link("employees/doDelete/" . $emp->id . "") . "'>Delete</a></td>";
                 } else {
                     $emplist .= "<td></td>";
                 }
                 // }
             }
             $emplist .= "\n    </tr>";
             $x++;
         }
     } else {
         $emplist .= "<tr><td colspan='7'>No record to display</td></tr>";
     }
     $emplist .= "</tbody>\n</table></div></div><div class='row'><div class='large-12 columns'>";
     $emplist .= "</div><p>&nbsp;</p></div>";
     $this->view->myemployee = $emplist;
     /**
      * the section below is 
      * provided to check for that the 
      * view to render is not called 
      * when doing ajax filter
      */
     // echo $session->empRole;
     if (Session::getRole()) {
         if (in_array(strtolower(get_class($this)), $_SESSION['emp_role_module'])) {
             if (isset($_POST['empname'])) {
                 echo $emplist;
             } elseif (isset($_POST['rec'])) {
                 echo $emplist;
             } else {
                 $this->view->render("employees/index");
             }
         } else {
             $this->view->render("access/restricted");
         }
     }
 }
Exemple #22
0
$response->addHeader('Content-Type: text/html; charset=utf-8');
$response->setCompression(GZIP_COMPRESSION_LEVEL);
// Init URL
$url = new Url($db, $request, $response, URL_BASE);
// Init sitemap
$sitemap = new Sitemap(URL_BASE);
$sitemap->setPath(DIR_BASE . DIR_SEPARATOR . 'public' . DIR_SEPARATOR);
// Get alt languages
$statement = $db->query('SELECT * FROM `language`');
$languages = array();
foreach ($statement->fetchAll() as $language) {
    $languages[$language->language_id] = $language->code;
}
// Add information Pages
foreach ($languages as $language_id => $language_code) {
    $sitemap->addItem(canonical($language_id, $language_code, $url->link('common/information/about')), '1.0', 'monthly');
    $sitemap->addItem(canonical($language_id, $language_code, $url->link('common/information/team')), '1.0', 'monthly');
    $sitemap->addItem(canonical($language_id, $language_code, $url->link('common/information/terms')), '1.0', 'monthly');
    $sitemap->addItem(canonical($language_id, $language_code, $url->link('common/information/licenses')), '1.0', 'monthly');
    $sitemap->addItem(canonical($language_id, $language_code, $url->link('common/information/faq')), '1.0', 'monthly');
    $sitemap->addItem(canonical($language_id, $language_code, $url->link('common/information/bitcoin')), '1.0', 'monthly');
    $sitemap->addItem(canonical($language_id, $language_code, $url->link('common/information/promo')), '1.0', 'monthly');
    $sitemap->addItem(canonical($language_id, $language_code, $url->link('common/contact')), '1.0', 'yearly');
    $sitemap->addItem(canonical($language_id, $language_code, $url->link('account/account/login')), '1.0', 'yearly');
    $sitemap->addItem(canonical($language_id, $language_code, $url->link('account/account/create')), '1.0', 'yearly');
}
// Generate categories
$statement = $db->query('SELECT `c`.`category_id`,
                                (SELECT MAX(`p`.`date_modified`) FROM `product` AS `p` WHERE `p`.`category_id` = `c`.`category_id` AND `p`.`status` = 1) AS `date_modified`
                                FROM `category` AS `c`
                                HAVING `date_modified` IS NOT NULL');
Exemple #23
0
 /**
  * Logout
  */
 public function logout_action()
 {
     $this->logout();
     redirect(Url::link());
 }
 private function oauth2_redirect_uri(Url $url, $adapter)
 {
     return $url->link(urlencode('account/social_media_login/oauth2'), "oa2_action=connecting&oa2_adapter={$adapter}&oa2_state=oc_sml_0");
 }
                ?>
            <li class="item<?php 
                echo isset($item['class']) ? ' ' . $item['class'] : '';
                ?>
">
                <?php 
                echo Url::link('<sub></sub>' . I18n::__('menu.labels.item.' . $title), $item['url'], array('ajax' => 'action', 'onfocus' => 'blur()'));
                ?>
            </li>
            <?php 
            }
            ?>
        </ul>
    </li>
    <?php 
        } else {
            ?>
    <li class="node">
        <?php 
            echo Url::link(I18n::__('menu.labels.category.' . $name), $category['url'], array('ajax' => 'action'));
            ?>
    </li>
    <?php 
        }
        ?>
    <?php 
    }
    ?>
</ul>
<?php 
}
Exemple #26
0
 	<div class="large-12 columns no-bg no-padding">
<div id="wrap">
    <header id="header">
      <div class="inner relative">
        <div class="wrapper">
          <a class="logo" href="#"><img src="public/img/logo.png" alt="fresh design web"></a>
          <a id="menu-toggle" class="button dark" href="#">MENU</a>

            <div class="welcome">
              <img src="public/img/user.png" alt=""/>
              Welcome, <b><?php 
global $session;
echo $_SESSION['fullname'];
?>
              </b>! | <a href="<?php 
echo $uri->link("dashboard/doLogout");
?>
">Logout</a>
            </div><!--welcome-->
        </div>

      <nav id="navigation">
        <div class="wrapper">
          <ul id="main-menu">
            <li class="current-menu-item"><a href="<?php 
echo $uri->link("dashboard/index");
?>
">Home</a></li>
            <li class="current-menu-item"><a href="<?php 
echo $uri->link("employees/index");
?>
Exemple #27
0
 /**
  * Get url
  * 
  * @return  string
  */
 public function getUrl()
 {
     $link = str_replace(array('<id>', '<url>'), array($this->id, $this->url), config('pages.url', Pages_Gear::DEFAULT_PAGE_URL));
     $link = Url::link($link);
     return $link;
 }
Exemple #28
0
function l($url = '', $absolute_flag = FALSE, $protocol = 'http')
{
    return Url::link($url, $absolute_flag, $protocol);
}
Exemple #29
0
 public function scheduleList()
 {
     $schedulelisting = "";
     global $session;
     $this->loadModel("Support");
     $datum = $this->model->getScheduleList("", "support");
     $this->view->schedules = $datum['schedules'];
     $uri = new Url("");
     $schedulelisting .= "<div class='row'><div class='large-12 columns'><table id='dt_basic'  width='100%'>\n        <thead><tr>\n            <th>S/N</th><th>Product/Machine</th><th>Term. ID</th><th>Client</th><th>Status</th><th>Technician</th><th>Issue</th><th>Date Generated </th><th>Work Sheet</th><th>Action</th>\n        </tr>\n        </thead>\n        <tbody>";
     if ($this->view->schedules) {
         $x = 1;
         foreach ($this->view->schedules as $schedule) {
             $schedulelisting .= "<tr>\n    \t<td>{$x}</td><td>";
             $cprod = $this->model->getClientProdByID($schedule->prod_id);
             $schedulelisting .= $cprod->prod_name . " " . $cprod->install_address . " " . $cprod->install_city;
             $schedulelisting .= "</td><td>{$cprod->terminal_id}</td><td>";
             $client = $this->model->getClientByID($schedule->client_id);
             $schedulelisting .= $client->name;
             $schedulelisting .= "</td><td>";
             if (strtolower($schedule->status) == 'open') {
                 $schedulelisting .= "<span class='label bg-red' style='padding:5px'>{$schedule->status}";
             } elseif (strtolower($schedule->status) == "closed") {
                 $schedulelisting .= "<span class='label bg-green' style='padding:5px'>{$schedule->status}";
             } elseif (strtolower($schedule->status) == "in progress") {
                 $schedulelisting .= "<span class='label bg-blue' style='padding:5px'>In Progress";
             }
             $schedulelisting .= "</td><td><input type='hidden' class='empid'  /> {$schedule->emp_name}</td><td>{$schedule->issue}</td><td>" . date_format(date_create($schedule->datecreated), "M d Y H:i:s") . "</td><td>";
             if ($schedule->status === "Open") {
                 $schedulelisting .= "<a href='" . $uri->link("support/addworksheet/" . $schedule->id . "") . "'>Get Work Sheet</a>";
             }
             /*else{
                   $schedulelisting .="<a href='".$uri->link("support/taskdetail/".$schedule->id."")."'>View Detail</a>";
               }*/
             $schedulelisting .= "</td><td>";
             if ($schedule->status === "Open" || $schedule->status == "In Progress") {
                 $schedulelisting .= "<select sid='{$schedule->id}' class='cschedule'><option values='0'>Open</option><option values='1'>Closed</option><option values='2'>In Progress</option></select>  ";
             }
             $schedulelisting .= "</td></tr>";
             $x++;
         }
     } else {
         $schedulelisting .= "<tr><td colspan='7'>No record to display</td></tr>";
     }
     $schedulelisting .= "</tbody>\n</table></div></div>";
     $this->view->myvends = $schedulelisting;
     if (isset($_POST['clientid'])) {
         echo $schedulelisting;
     } elseif (isset($_POST['rec'])) {
         echo $schedulelisting;
     } else {
         $this->view->render("support/taskmanager");
     }
 }
Exemple #30
0
 /**
  * Get base uri
  * 
  * @return string 
  */
 public function getBaseUri()
 {
     return $this->base_uri ? $this->base_uri : Url::link();
 }