Exemplo n.º 1
0
# echo HEADING_TITLE;
?>
</td>
            <td class="pageHeading" align="right"><?php 
echo oos_draw_separator('trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT);
?>
</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td>

<?php 
if (is_uploaded_file($usrfl['tmp_name'])) {
    oos_get_copy_uploaded_file($usrfl, OOS_UPDATE_PATH);
    echo "<p class=smallText>";
    echo 'File uploaded<br />';
    echo 'Temporary filename:: ' . $usrfl['tmp_name'] . '<br />';
    echo 'User filename: ' . $usrfl['name'] . '<br />';
    echo 'Size: ' . $usrfl['size'] . '<br />';
    echo '<br><br>';
    echo '<br>products_id | products_model | products_name | products_tax_class_id | products_status | products_price';
    echo '<br><br>';
    // get the entire file into an array
    $readed = file(OOS_UPDATE_PATH . $usrfl['name']);
    foreach ($readed as $arr) {
        walk($arr);
        $Counter++;
    }
    echo '<br><br>';
Exemplo n.º 2
0
     $update_sql_data = array('last_modified' => '" . date("Y-m-d H:i:s", time()) . "');
     $sql_data_array = array_merge($sql_data_array, $update_sql_data);
     oos_db_perform($oostable['manufacturers'], $sql_data_array, 'update', "manufacturers_id = '" . oos_db_input($manufacturers_id) . "'");
 }
 $manufacturers_image = oos_get_uploaded_file('manufacturers_image');
 $image_directory = oos_get_local_path(OOS_ABSOLUTE_PATH . OOS_IMAGES);
 if (is_uploaded_file($manufacturers_image['tmp_name'])) {
     if (!is_writeable($image_directory)) {
         if (is_dir($image_directory)) {
             $messageStack->add_session(sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $image_directory), 'error');
         } else {
             $messageStack->add_session(sprintf(ERROR_DIRECTORY_DOES_NOT_EXIST, $image_directory), 'error');
         }
     } else {
         $dbconn->Execute("UPDATE " . $oostable['manufacturers'] . " SET manufacturers_image = '" . $manufacturers_image['name'] . "' WHERE manufacturers_id = '" . oos_db_input($manufacturers_id) . "'");
         oos_get_copy_uploaded_file($manufacturers_image, $image_directory);
     }
 }
 $languages = oos_get_languages();
 for ($i = 0, $n = count($languages); $i < $n; $i++) {
     $manufacturers_url_array = oos_db_prepare_input($_POST['manufacturers_url']);
     $lang_id = $languages[$i]['id'];
     $sql_data_array = array('manufacturers_url' => oos_db_prepare_input($manufacturers_url_array[$lang_id]));
     if ($action == 'insert') {
         $insert_sql_data = array('manufacturers_id' => $manufacturers_id, 'manufacturers_languages_id' => $lang_id);
         $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
         oos_db_perform($oostable['manufacturers_info'], $sql_data_array);
     } elseif ($action == 'save') {
         oos_db_perform($oostable['manufacturers_info'], $sql_data_array, 'update', "manufacturers_id = '" . oos_db_input($manufacturers_id) . "' and manufacturers_languages_id = '" . intval($lang_id) . "'");
     }
 }
Exemplo n.º 3
0
     $update_sql_data = array('last_modified' => '" . date("Y-m-d H:i:s", time()) . "');
     $sql_data_array = array_merge($update_sql_data, $sql_data_array_sort);
     oos_db_perform($oostable['information'], $sql_data_array, 'update', "information_id = '" . oos_db_input($information_id) . "'");
 }
 $information_image = oos_get_uploaded_file('information_image');
 $image_directory = oos_get_local_path(OOS_ABSOLUTE_PATH . OOS_IMAGES);
 if (is_uploaded_file($information_image['tmp_name'])) {
     if (!is_writeable($image_directory)) {
         if (is_dir($image_directory)) {
             $messageStack->add_session(sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $image_directory), 'error');
         } else {
             $messageStack->add_session(sprintf(ERROR_DIRECTORY_DOES_NOT_EXIST, $image_directory), 'error');
         }
     } else {
         $dbconn->Execute("UPDATE " . $oostable['information'] . " SET information_image = '" . $information_image['name'] . "' WHERE information_id = '" . oos_db_input($information_id) . "'");
         oos_get_copy_uploaded_file($information_image, $image_directory);
     }
 }
 $languages = oos_get_languages();
 for ($i = 0, $n = count($languages); $i < $n; $i++) {
     $information_name_array = $_POST['information_name'];
     $information_url_array = $_POST['information_url'];
     $information_heading_title_array = $_POST['information_heading_title'];
     $information_description_array = $_POST['information_description'];
     $lang_id = $languages[$i]['id'];
     $sql_data_array = array('information_name' => oos_db_prepare_input($information_name_array[$lang_id]));
     $sql_data_array_url = array('information_url' => oos_db_prepare_input($information_url_array[$lang_id]));
     $sql_data_array_head = array('information_heading_title' => oos_db_prepare_input($information_heading_title_array[$lang_id]));
     $sql_data_array_desc = array('information_description' => oos_db_prepare_input($information_description_array[$lang_id]));
     $sql_data_array = array_merge($sql_data_array, $sql_data_array_url, $sql_data_array_desc, $sql_data_array_head);
     if ($action == 'insert') {
Exemplo n.º 4
0
             oos_db_perform($oostable['customers_status'], $sql_data_array, 'update', "customers_status_id = '" . oos_db_input($customers_status_id) . "' and customers_status_languages_id = '" . intval($lang_id) . "'");
         }
     }
     // Changes by Guido Start
     $customers_status_image = oos_get_uploaded_file('customers_status_image');
     $image_directory = oos_get_local_path(OOS_ABSOLUTE_PATH . OOS_IMAGES . 'icons/');
     if (is_uploaded_file($customers_status_image['tmp_name'])) {
         if (!is_writeable($image_directory)) {
             if (is_dir($image_directory)) {
                 $messageStack->add_session(sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $image_directory), 'error');
             } else {
                 $messageStack->add_session(sprintf(ERROR_DIRECTORY_DOES_NOT_EXIST, $image_directory), 'error');
             }
         } else {
             $dbconn->Execute("UPDATE " . $oostable['customers_status'] . " SET customers_status_image = '" . $customers_status_image['name'] . "' WHERE customers_status_id = '" . oos_db_input($customers_status_id) . "'");
             oos_get_copy_uploaded_file($customers_status_image, $image_directory);
         }
     }
     // Changes by Guido END
     if (isset($_POST['default']) && $_POST['default'] == 'on') {
         $dbconn->Execute("UPDATE " . $oostable['configuration'] . " SET configuration_value = '" . oos_db_input($customers_status_id) . "' WHERE configuration_key = 'DEFAULT_CUSTOMERS_STATUS_ID'");
     }
     oos_redirect_admin(oos_href_link_admin($aFilename['customers_status'], 'page=' . $_GET['page'] . '&cID=' . $customers_status_id));
     break;
 case 'deleteconfirm':
     $cID = oos_db_prepare_input($_GET['cID']);
     $customers_status_result = $dbconn->Execute("SELECT configuration_value FROM " . $oostable['configuration'] . " WHERE configuration_key = 'DEFAULT_CUSTOMERS_STATUS_ID'");
     $customers_status = $customers_status_result->fields;
     if ($customers_status['configuration_value'] == $cID) {
         $dbconn->Execute("UPDATE " . $oostable['configuration'] . " SET configuration_value = '' WHERE configuration_key = 'DEFAULT_CUSTOMERS_STATUS_ID'");
     }
Exemplo n.º 5
0
<?php 
} elseif ($action == 'new_category_preview') {
    if (oos_is_not_null($_POST)) {
        $cInfo = new objectInfo($_POST);
        $categories_name = $_POST['categories_name'];
        $categories_heading_title = $_POST['categories_heading_title'];
        $categories_description = $_POST['categories_description'];
        $categories_description_meta = $_POST['categories_description_meta'];
        $categories_keywords_meta = $_POST['categories_keywords_meta'];
        if ($_POST['categories_image'] != 'none' && isset($_FILES['categories_image'])) {
            $categories_image = oos_get_uploaded_file('categories_image');
            $image_directory = oos_get_local_path(OOS_ABSOLUTE_PATH . OOS_IMAGES);
        }
        // copy image only if modified
        if (is_uploaded_file($categories_image['tmp_name'])) {
            oos_get_copy_uploaded_file($categories_image, $image_directory);
            $categories_image_name = $categories_image['name'];
        } else {
            $categories_image_name = $_POST['categories_previous_image'];
        }
    } else {
        $categoriestable = $oostable['categories'];
        $categories_descriptiontable = $oostable['categories_description'];
        $query = "SELECT c.categories_id, cd.categories_languages_id, cd.categories_name,\r\n                       cd.categories_heading_title, cd.categories_description,\r\n                       cd.categories_description_meta, cd.categories_keywords_meta,\r\n                       c.categories_image, c.access, c.sort_order, c.date_added, c.last_modified\r\n                FROM {$categoriestable} c,\r\n                     {$categories_descriptiontable} cd\r\n                WHERE c.categories_id = cd.categories_id AND\r\n                      c.categories_id = '" . intval($_GET['cID']) . "'";
        $category_result = $dbconn->Execute($query);
        $category = $category_result->fields;
        $cInfo = new objectInfo($category);
        $categories_image_name = $cInfo->categories_image;
    }
    $form_action = $_GET['cID'] ? 'update_category' : 'insert_category';
    echo oos_draw_form($form_action, $aFilename['categories'], 'categories=' . $categories . '&cID=' . $_GET['cID'] . '&action=' . $form_action, 'post', 'enctype="multipart/form-data"');
Exemplo n.º 6
0
         oos_redirect_admin(oos_href_link_admin($aFilename['file_manager'], 'info=' . urlencode($_POST['filename'])));
     }
     break;
 case 'processuploads':
     $_current_path = oos_get_local_path($_SESSION['current_path']);
     if (!is_writeable($_current_path)) {
         if (is_dir($_current_path)) {
             $messageStack->add_session(sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $_current_path), 'error');
         } else {
             $messageStack->add_session(sprintf(ERROR_DIRECTORY_DOES_NOT_EXIST, $_current_path), 'error');
         }
     } else {
         for ($i = 1; $i < 6; $i++) {
             $file = oos_get_uploaded_file('file_' . $i);
             if (is_uploaded_file($file['tmp_name'])) {
                 oos_get_copy_uploaded_file($file, $_current_path);
             }
         }
     }
     oos_redirect_admin(oos_href_link_admin($aFilename['file_manager']));
     break;
 case 'download':
     header('Content-type: application/x-octet-stream');
     header('Content-disposition: attachment; filename=' . urldecode($_GET['filename']));
     readfile($_SESSION['current_path'] . '/' . urldecode($_GET['filename']));
     exit;
     break;
 case 'upload':
 case 'new_folder':
 case 'new_file':
     $directory_writeable = true;
Exemplo n.º 7
0
     $sql_data_array = array_merge($sql_data_array, $update_sql_data);
     oos_db_perform($oostable['newsfeed'], $sql_data_array, 'update', "newsfeed_id = '" . oos_db_input($newsfeed_id) . "'");
 }
 $newsfeed_image = oos_get_uploaded_file('newsfeed_image');
 $image_directory = oos_get_local_path(OOS_ABSOLUTE_PATH . OOS_IMAGES);
 if (is_uploaded_file($newsfeed_image['tmp_name'])) {
     if (!is_writeable($image_directory)) {
         if (is_dir($image_directory)) {
             $messageStack->add_session(sprintf(ERROR_DIRECTORY_NOT_WRITEABLE, $image_directory), 'error');
         } else {
             $messageStack->add_session(sprintf(ERROR_DIRECTORY_DOES_NOT_EXIST, $image_directory), 'error');
         }
     } else {
         $newsfeedtable = $oostable['newsfeed'];
         $dbconn->Execute("UPDATE {$newsfeedtable} SET newsfeed_image = '" . $newsfeed_image['name'] . "' WHERE newsfeed_id = '" . oos_db_input($newsfeed_id) . "'");
         oos_get_copy_uploaded_file($newsfeed_image, $image_directory);
     }
 }
 $languages = oos_get_languages();
 for ($i = 0, $n = count($languages); $i < $n; $i++) {
     $newsfeed_name_array = $_POST['newsfeed_name'];
     $newsfeed_title_array = $_POST['newsfeed_title'];
     $newsfeed_description_array = $_POST['newsfeed_description'];
     $lang_id = $languages[$i]['id'];
     $sql_data_array = array('newsfeed_name' => oos_db_prepare_input($newsfeed_name_array[$lang_id]), 'newsfeed_title' => oos_db_prepare_input($newsfeed_title_array[$lang_id]), 'newsfeed_description' => oos_db_prepare_input($newsfeed_description_array[$lang_id]));
     if ($action == 'insert') {
         $insert_sql_data = array('newsfeed_id' => $newsfeed_id, 'newsfeed_languages_id' => $lang_id);
         $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
         oos_db_perform($oostable['newsfeed_info'], $sql_data_array);
     } elseif ($action == 'save') {
         oos_db_perform($oostable['newsfeed_info'], $sql_data_array, 'update', "newsfeed_id = '" . oos_db_input($newsfeed_id) . "' and newsfeed_languages_id = '" . intval($lang_id) . "'");
Exemplo n.º 8
0
 if (isset($banners_image) && $banners_image['name'] != 'none' && is_uploaded_file($banners_image['tmp_name'])) {
     $store_image = false;
     if (!is_writeable($image_directory)) {
         if (is_dir($image_directory)) {
             $messageStack->add(sprintf(ERROR_IMAGE_DIRECTORY_NOT_WRITEABLE, $image_directory), 'error');
         } else {
             $messageStack->add(sprintf(ERROR_IMAGE_DIRECTORY_DOES_NOT_EXIST, $image_directory), 'error');
         }
         $banner_error = true;
     } else {
         $store_image = true;
     }
 }
 if (!$banner_error) {
     if (empty($html_text) && $store_image == true) {
         oos_get_copy_uploaded_file($banners_image, $image_directory);
     }
     $db_image_location = oos_is_not_null($banners_image_local) ? $banners_image_local : $banners_image_target . $banners_image['name'];
     $sql_data_array = array('banners_title' => $banners_title, 'banners_url' => $banners_url, 'banners_image' => $db_image_location, 'banners_group' => $banners_group, 'banners_html_text' => $html_text);
     if ($action == 'insert') {
         $insert_sql_data = array('date_added' => '" . date("Y-m-d H:i:s", time()) . "', 'status' => '1');
         $sql_data_array = array_merge($sql_data_array, $insert_sql_data);
         oos_db_perform($oostable['banners'], $sql_data_array);
         $banners_id = $dbconn->Insert_ID();
         $messageStack->add_session(SUCCESS_BANNER_INSERTED, 'success');
     } elseif ($action == 'update') {
         oos_db_perform($oostable['banners'], $sql_data_array, 'update', 'banners_id = \'' . $banners_id . '\'');
         $messageStack->add_session(SUCCESS_BANNER_UPDATED, 'success');
     }
     if (isset($_POST['expires_date'])) {
         $expires_date = oos_db_prepare_input($_POST['expires_date']);
Exemplo n.º 9
0
        $cleanheader = str_replace('"', '', $header);
        //  echo "Fileheader was $header<br /><br /><br />";
        $filelayout[$cleanheader] = $lll++;
        //
    }
    unset($readed[0]);
    //  we don't want to process the headers with the data
    // now we've got the array broken into parts by the expicit end-of-row marker.
    array_walk($readed, 'walk');
}
if (is_uploaded_file($usrfl) && $split == 1) {
    // move the file to where we can work with it
    $file = oos_get_uploaded_file('usrfl');
    //echo "Trying to move file...";
    if (is_uploaded_file($file['tmp_name'])) {
        oos_get_copy_uploaded_file($file, OOS_ABSOLUTE_PATH . $tempdir);
    }
    $infp = fopen(OOS_ABSOLUTE_PATH . $tempdir . $usrfl['name'], "r");
    //toprow has the field headers
    $toprow = fgets($infp, 32768);
    $filecount = 1;
    echo CREATING_FILE . "EP_Split" . $filecount . ".txt ...  ";
    $tmpfname = OOS_ABSOLUTE_PATH . $tempdir . "EP_Split" . $filecount . ".txt";
    $fp = fopen($tmpfname, "w+");
    fwrite($fp, $toprow);
    $linecount = 0;
    $line = fgets($infp, 32768);
    while ($line) {
        // walking the entire file one row at a time
        // but a line is not necessarily a complete row, we need to split on rows that have "EOREOR" at the end
        $line = str_replace('"EOREOR"', 'EOREOR', $line);