Exemplo n.º 1
0
function AddJobToParcel($table)
{
    UUID();
    $_POST['mmb_parcele16e_parcel_ida'] = $_REQUEST[$_REQUEST['ssc']];
    #Add addictional clause to prevent from adding if already in parcel selected
    if ($_POST['mmb_parcele16e_parcel_ida'] != '') {
        $parcel_id = $_REQUEST[$_REQUEST['ssc']];
        $_POST['mmb_parcel090foke_job_idb'] = $_REQUEST['id'];
        unset($_POST[$_REQUEST['ssc']]);
        AddNewRecord($table);
        if ($table == 'mmb_parcel__bespoke_job_c') {
            $parcel_table = 'mmb_parcel';
        } elseif ($table == 'mmb_parcel_t__bespoke_job_c') {
            $parcel_table = 'mmb_parcel_thailand';
        }
        $parcel_name = FieldValue($parcel_table, 'id', $parcel_id, 'name');
        $_POST = array();
        AddNote("Job added to parcel {$parcel_name}");
    }
}
Exemplo n.º 2
0
if (!empty($_FILES)) {
    $info = pathinfo($_FILES['file']['name']);
    if (in_array(fix_strtolower($info['extension']), $ext)) {
        $tempFile = $_FILES['file']['tmp_name'];
        $targetPath = $storeFolder;
        $targetPathThumb = $storeFolderThumb;
        $_FILES['file']['name'] = fix_filename($_FILES['file']['name'], $transliteration);
        if (file_exists($targetPath . $_FILES['file']['name'])) {
            $i = 1;
            $info = pathinfo($_FILES['file']['name']);
            while (file_exists($targetPath . $info['filename'] . "_" . $i . "." . $info['extension'])) {
                $i++;
            }
            $_FILES['file']['name'] = $info['filename'] . "_" . $i . "." . $info['extension'];
        }
        $unik = UUID();
        $targetFile = $targetPath . $unik . $_FILES['file']['name'];
        $targetFileThumb = $targetPathThumb . $unik . $_FILES['file']['name'];
        if (in_array(fix_strtolower($info['extension']), $ext_img)) {
            $is_img = true;
        } else {
            $is_img = false;
        }
        move_uploaded_file($tempFile, $targetFile);
        // chmod($targetFile, 0755);
        if ($is_img) {
            $memory_error = false;
            if (!create_img_gd($targetFile, $targetFileThumb, 122, 91)) {
                $memory_error = false;
            } else {
                if (!new_thumbnails_creation($targetPath, $targetFile, $_FILES['file']['name'], $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height)) {