コード例 #1
0
ファイル: main.php プロジェクト: rajeshb001/itpl_loaded7
function get_dropdown_list_array($type)
{
    global $lC_Language;
    $list_arr = array();
    switch ($type) {
        case 'manufacturer':
            $list_str = $lC_Language->get('text_select_manufacturers');
            $list_arr = lC_Manufacturers_Admin::getManufacturersArray();
            break;
        case 'supplier':
            $list_str = $lC_Language->get('text_select_supplier');
            // $list_arr = lC_Orders_Admin::getOrderStatusArray();
            break;
        case 'order_status':
            // $list_str = $lC_Language->get('text_statuses');
            $list_arr = lC_Orders_Admin::getOrderStatusArray();
            break;
    }
    $i = 0;
    if ($list_str != '') {
        $i = 1;
        $return_arr[0] = array('id' => '', 'text' => $list_str);
    }
    if (is_array($list_arr) && count($list_arr) > 0) {
        foreach ($list_arr as $k => $arr) {
            $return_arr[$k + $i] = $arr;
        }
    }
    return $return_arr;
}
コード例 #2
0
ファイル: rpc.php プロジェクト: abhiesa-tolexo/loaded7
 public static function batchDeleteEntries()
 {
     $result = array();
     $deleted = lC_Manufacturers_Admin::batchDelete($_GET['batch']);
     if ($deleted) {
         $result['rpcStatus'] = RPC_STATUS_SUCCESS;
     }
     echo json_encode($result);
 }
コード例 #3
0
 function __construct()
 {
     global $lC_Language, $lC_Image;
     $this->_page_title = $lC_Language->get('heading_title');
     if (!isset($_GET['action'])) {
         $_GET['action'] = '';
     }
     // check if the manufacturers image directory exists
     if (is_dir('../images/manufacturers')) {
         if (!is_writeable('../images/manufacturers')) {
             $_SESSION['error'] = true;
             $_SESSION['errmsg'] = sprintf($lC_Language->get('ms_error_image_directory_not_writable'), realpath('../images/manufacturers'));
         }
     } else {
         $_SESSION['error'] = true;
         $_SESSION['errmsg'] = sprintf($lC_Language->get('ms_error_image_directory_non_existant'), realpath('../images/manufacturers'));
     }
     $lC_Image = new lC_Image_Admin();
     if (!empty($_GET['action'])) {
         switch ($_GET['action']) {
             case 'save':
                 /*
                  * Save the manufacturer information
                  *
                  * @param integer $_GET['mID'] The manufacturer id
                  * @param array $data The manufacturer information
                  * @access public
                  * @return boolean
                  */
                 $data = array('name' => $_POST['manufacturers_name'], 'image' => isset($_FILES['image']) ? $_FILES['image'] : null, 'url' => $_POST['manufacturers_url']);
                 if (lC_Manufacturers_Admin::save(isset($_GET['mID']) && is_numeric($_GET['mID']) ? $_GET['mID'] : null, $data)) {
                     lc_redirect_admin(lc_href_link_admin(FILENAME_DEFAULT, $this->_module));
                 } else {
                     $_SESSION['error'] = true;
                     $_SESSION['errmsg'] = $lC_Language->get('ms_error_action_not_performed');
                 }
                 break;
         }
     }
 }
コード例 #4
0
 public static function batchDelete($batch)
 {
     foreach ($batch as $id) {
         lC_Manufacturers_Admin::delete($id);
     }
     return true;
 }