Exemplo n.º 1
0
    $accessed = CONST_ACCESS_DESIGNS_MANAGEMENT;
} elseif (strpos($_SERVER['HTTP_REFERER'], 'element-list') !== false) {
    $accessed = CONST_ACCESS_ELEMENT_LIST;
} else {
    $accessed = '';
}
if (!is_null($elements_id) && is_null($element->id)) {
    $messagebox->add("Element ID: <strong>{$elements_id}</strong> not found in database");
}
if (isset($_POST['me_action'])) {
    if (isset($_POST['accessed'])) {
        $accessed = tep_db_prepare_input($_POST['accessed']);
    }
    if ($accessed == CONST_ACCESS_DESIGNS_MANAGEMENT) {
        use_class('design_draft');
        $draft = new design_draft($drafts_id);
    }
    if ($_POST['me_action'] == 'ELEMENTSAVEFIELD') {
        $field_name = tep_db_prepare_input($_POST['field_name']);
        $field_value = tep_db_prepare_input($_POST['field_value']);
        $wgp = '';
        if (is_null($element->id) && $field_name == 'elements_name') {
            if ($accessed == CONST_ACCESS_DESIGNS_MANAGEMENT) {
                $status = tep_db_prepare_input($_GET['status']);
                $sub_status = tep_db_prepare_input($_GET['sub_status']);
                if ($status == '10') {
                    $element = $draft->createElement('', $field_value, 0, '', 0, date('Y-m-d H:i:s'), $session_userinfo['username'], $sub_status);
                }
            } else {
                $element->create('', $field_value, 0, '', 0, date('Y-m-d H:i:s'), $session_userinfo['username'], '', $elements_description);
            }
$content .= '<li><a href="#area-direct-input">Input Directly</a></li>';
$content .= '<li><a href="#area-search">Search Elements</a></li>';
$content .= '<li><a href="#area-copy">Copy from Existing Products</a></li>';
$content .= '</ul>';
$content .= '<div id="area-direct-input">';
$content .= '<div id="di-msg" style="margin:5px 0 10px 0;display:none;" class="bold"></div>';
$content .= '<table border="0" cellpadding="0" cellspacing="0" class="form">';
$content .= '<tr><td>Element ID</td><td>&nbsp;</td><td><input type="text" id="di-elid" onfocus="$(this).select();" /><span class="red" style="margin-left:10px;">use comma "," separated for multi ID\'s</span></td></tr>';
$content .= '<tr><td>Qty</td><td>&nbsp;</td><td><input type="text" id="di-elqty" value="1" style="width:30px;text-align:center;" maxlength="3" onfocus="$(this).select();" /></td></tr>';
$content .= '<tr><td colspan="2">&nbsp;</td>';
if ($is_accessed_from_design_mgmt) {
    use_class('design');
    use_class('design_draft');
    use_class('element');
    $designs_id = isset($_GET['designs_id']) && $_GET['designs_id'] != '' ? $_GET['designs_id'] : '';
    $draft = new design_draft(null, $_GET['pid']);
    $new_elements = $draft->retrieveElements();
    if (count($new_elements) > 0) {
        $content .= '<tr><td>New Elements</td><td>&nbsp;</td><td>';
        foreach ($new_elements as $ne) {
            $element = new element($ne['elements_id']);
            $content .= '<span id="' . $ne['elements_id'] . '" style="float:left;text-align:center;margin-right:5px;">' . webImageWithDetailLink($element->image, IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1, $ne['elements_id'] . ' : ' . $ne['elements_name'], 'img-border') . '<br/>' . $ne['elements_id'] . '&nbsp;<a class="pointer ne-add-el" title="Add this element to product">[+]</a></span>';
        }
        $content .= '</td></tr>';
    }
}
$content .= '<tr><td colspan="2"><input type="button" class="button blue" id="btn-di-add-el" value="Add Element" /></td></tr>';
$content .= '</table>';
$content .= '</div>';
//closed area-direct-input
$content .= '<div id="area-search">';
Exemplo n.º 3
0
 function isReadyForWaxNewElements()
 {
     use_class('design_draft');
     $drafts = $this->retrieveDrafts("approve_status!='R'");
     $ready = true;
     if (count($drafts) > 0) {
         foreach ($drafts as $draft) {
             $draft = new design_draft($draft['drafts_id']);
             $el = $draft->retrieveElements();
             if (count($el) == 0) {
                 return false;
             }
         }
     } else {
         return false;
     }
     return $ready;
 }
Exemplo n.º 4
0
        $result['draft_name'] = $draft_name;
        echo ajaxReturn($result);
        exit;
    } elseif ($_POST['me_action'] == 'UPDATECOLORSREQUEST') {
        $drafts_id = tep_db_prepare_input($_POST['drafts_id']);
        $cr = tep_db_prepare_input($_POST['colors_request']);
        $draft = new design_draft($drafts_id);
        $result = array();
        $result = $draft->updateColorsRequest($session_userinfo['username'], $cr);
        $result['box_target'] = "#dra-{$drafts_id}-colors-request";
        ajaxReturn($result);
        exit;
    } elseif ($_POST['me_action'] == 'REMOVEFROMCOLORSREQUEST') {
        $drafts_id = tep_db_prepare_input($_POST['drafts_id']);
        $cid = tep_db_prepare_input($_POST['color_id']);
        $draft = new design_draft($drafts_id);
        $result = array();
        $result['colors_removed'] = $draft->removeFromColorsRequest($session_userinfo['username'], '', $cid);
        $result['box_target'] = "#dra-{$drafts_id}-colors-request";
        ajaxReturn($result);
        exit;
    }
    if (isset($design)) {
        $design->comments->processPostAction($design->owner, $design->followers);
        $design->followers->processPostAction();
    }
}
if (is_null($design->id)) {
    $content .= '<h3 class="red">No Valid Design ID Specified</h3>';
    $title = 'Design Drafts Management';
} else {
Exemplo n.º 5
0
             }
             //APPLY NAVID's
             $dbq = tep_db_query("SELECT jng_sp_id, navigation, navigation2, navigation3 FROM jng_sp_catalog WHERE products_id={$products_id} ORDER BY jng_sp_id");
             while ($r = tep_db_fetch_array($dbq)) {
                 $nav = $r['navigation'];
                 $nav2 = $r['navigation2'];
                 $nav3 = $r['navigation3'];
                 $class_jc->addProduct($r['jng_sp_id'], $pid);
                 $p_cat = $class_jc->retrieveCatalog($r['jng_sp_id'], "jc.products_id = '{$pid}'");
                 saveCatalog($p_cat[0]['jng_sp_catalog_id'], 'navigation', $nav);
                 saveCatalog($p_cat[0]['jng_sp_catalog_id'], 'navigation2', $nav2);
                 saveCatalog($p_cat[0]['jng_sp_catalog_id'], 'navigation3', $nav3);
             }
         }
     }
     $draft = new design_draft(null, $products_id);
     $draft->detailCompleted($products_id, $session_userinfo['username']);
     echo utf8_encode('UPDATED');
     exit;
 } elseif ($_POST['me_action'] == 'UPDATECATALOG') {
     $dt = array();
     $catalog_id = tep_db_prepare_input($_POST['jcid']);
     $field_name = tep_db_prepare_input($_POST['fieldName']);
     $field_value = tep_db_prepare_input($_POST['fieldValue']);
     saveCatalog($catalog_id, $field_name, $field_value);
     echo "{$field_name}-{$catalog_id}";
     exit;
 } elseif ($_POST['me_action'] == 'UPDATESOPLISTS') {
     $pid = tep_db_prepare_input($_POST['pid']);
     $type = tep_db_prepare_input($_POST['type']);
     $r = getDetailData($pid, $type);
Exemplo n.º 6
0
function drawDraftRow($draft_count, $drafts_id, $rowclass, $status, $sub_status = '', $designs_id = '')
{
    $descoldata = getDesCol($status);
    $descol = $descoldata['cols'];
    $descol_count = $descoldata['count'];
    $draft = new design_draft($drafts_id);
    $products = $draft->retrieveProducts();
    $detail_link = '<a href="?open=designs-draft-detail&amp;id=' . $draft->id . '&amp;hidemenu=true" class="view_webpage">';
    $row .= '<tr id="dra-' . $draft->id . '" class="dra ' . $rowclass . ' desdra-' . $draft->designs_id . '">';
    $new_elements = $draft->retrieveElements();
    $wax_stats = array();
    $wax_stats[] = 'New Wax';
    $wax_stats[] = 'Revision';
    $qwax = "SELECT mu.id, mu.username";
    $qwax .= " FROM minierp_users mu";
    $qwax .= " LEFT JOIN minierp_groups_members mgm ON mgm.minierp_users_id = mu.id";
    $qwax .= " WHERE mgm.minierp_groups_id = '46'";
    $rwax = tep_db_query($qwax);
    $waxers = array();
    while ($r = tep_db_fetch_array($rwax)) {
        $waxers[$r['id']] = $r['username'];
    }
    unset($waxers['137']);
    foreach ($descol as $class => $key) {
        $value = '&nbsp;';
        switch ($key) {
            //                            case 'Lead Time':
            //                                $value = 'DRAFT '.($x+1);
            //                                break;
            case 'ID':
                $value = $draft->id;
                if ($draft->colors_request != '') {
                    $value .= '<br/><img src="images/colors_circle_16x16.png" title="This Draft have Colors Requested" />';
                }
                break;
            case 'Image':
                $weblink = webImageSource($draft->image_1, IMAGE_SIZE_BIG_1, IMAGE_SIZE_BIG_1);
                $value = '<a href="' . $weblink . '" class="view_image">' . webImage($draft->image_1, IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1, $draft->name, 'img-border') . '</a>';
                break;
            case 'Name':
                $value = '<strong>Draft ' . ($draft_count + 1) . '</strong><br />' . ($draft->name == '' ? '<span class="notice">No Name Specified</span>' : '<span>' . $draft->name . '</span>');
                break;
            case 'Products':
                if (count($products) > 0) {
                    $value = '';
                    if ($status <= 5 || $status == 13) {
                        foreach ($products as $p) {
                            $value .= productLinkWithID($p['products_id'], $p['products_name'], '&amp;designs_id=' . $designs_id);
                        }
                    } else {
                        foreach ($products as $p) {
                            $pname = htmlspecialchars($p['products_name']);
                            $link = '<a href="?open=product-detail&amp;products_id=' . $p['products_id'] . '" target="_blank" title="' . $pname . '">';
                            if ($status <= 5) {
                                $link_text = $p['products_id'];
                            } else {
                                $tooltip = $pname;
                                $img_class = '';
                                if ($status == 8) {
                                    $link = '<a href="?open=designs-finalize&amp;id=' . $p['products_id'] . '&amp;hidemenu=true" class="view_webpage">';
                                    if ($p['finalized_time'] != '' && $p['finalized_by'] != '') {
                                        $fint = time() - $p['finalized_time'];
                                        $duration = $fint > 0 ? displayDuration($fint, 1) . ' ago' : 'just now';
                                        $tooltip = 'Finalized by ' . $p['finalized_by'] . ' (' . trim($duration) . ')';
                                        $img_class = 'img-status-ok';
                                    } else {
                                        $img_class = 'img-status-bad';
                                    }
                                } elseif ($status == 7) {
                                    $link = '<a href="?open=designs-details&amp;id=' . $p['products_id'] . '&amp;hidemenu=true" class="view_webpage">';
                                    if ($p['detailed_time'] != '' && $p['detailed_by'] != '') {
                                        $fint = time() - $p['detailed_time'];
                                        $duration = $fint > 0 ? displayDuration($fint, 1) . ' ago' : 'just now';
                                        $tooltip = 'Details Completed by ' . $p['detailed_by'] . ' (' . trim($duration) . ')';
                                        $img_class = 'img-status-ok';
                                    } else {
                                        $img_class = 'img-status-bad';
                                    }
                                } elseif ($status == 6) {
                                    $link = '<a href="?open=designs-graphics&amp;id=' . $p['products_id'] . '&amp;hidemenu=true" class="view_webpage">';
                                }
                                $link_text = webimage($p['products_image'], IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1, $tooltip, $img_class, 'style="margin-bottom:1px;"');
                            }
                            $del = '<div id="delpid-' . $p['products_id'] . '" class="ui-state-default ui-corner-all del-prod" style="width:16px;float:right;" title="Delete Product"><span class="ui-icon ui-icon-close" style="cursor: pointer;"></span></div>';
                            $value .= '<div>' . $del . $link . $link_text . '</a></div>';
                        }
                    }
                }
                break;
            case 'Elements':
                $value = '';
                if (count($new_elements) > 0) {
                    foreach ($new_elements as $ne) {
                        $el_style = '';
                        $el_image = '';
                        $el_class = '';
                        if ($ne['elements_image'] != '') {
                            $el_style = 'margin-bottom:1px;';
                            if ($sub_status == 7) {
                                $el_class = $ne['is_finalized'] == '1' ? 'img-status-ok' : 'img-status-bad';
                            }
                            $el_image = webImage($ne['elements_image'], IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1, '', $el_class);
                        }
                        use_class('element');
                        $e = new element($ne['elements_id']);
                        if ($sub_status == 2) {
                            //SHOW WAX COMPLEXITY ON TAB WAX
                            $wax_complexity = $e->wax_complexity != '' ? " ({$e->wax_complexity})" : '';
                            $wax_complexity_name = $e->wax_complexity != '' ? ' (' . getComplexity($e->wax_complexity) . ' wax complexity)' : '';
                        }
                        $value .= elementLinkWithID($ne['elements_id'], $ne['elements_id'] . " : " . $ne['elements_description'] . $wax_complexity_name, $drafts_id, $el_style, $el_image, "{$wax_complexity}");
                        unset($e);
                        //SET NEW ELEMENTS FINALIZED
                        if ((is_null($ne['finalized_date']) || $ne['finalized_date'] == '') && $ne['is_finalized'] == '1') {
                            $sda = array();
                            $sda['finalized_date'] = date("Y-m-d H:i:s");
                            $sda['finalized_by'] = $session_userinfo['username'];
                            tep_db_perform('designs_elements', $sda, 'update', "designs_id='" . $design->id . "' AND elements_id=" . $ne['elements_id']);
                        }
                    }
                }
                break;
            case 'Action':
                $value = '';
                $value .= '<input type="hidden" name="drafts_id" value="' . $draft->id . '" />';
                $value .= '<input type="hidden" name="status" value="' . $status . '" />';
                $value .= '<input type="hidden" name="sub_status" value="' . $sub_status . '" />';
                $actions = array();
                if ($status == 5) {
                    if ($sub_status == 3) {
                        $ap_class = count($products) > 0 ? ' class="red"' : ' class="green"';
                        $actions[] = '<input type="button" name="AP"' . $ap_class . ' value="&oplus; ADD PRODUCT" title="Add Products to this Draft" />';
                    }
                }
                //                if($status==6 && $draft->products_image_by=='') {
                //                    $actions[] = '<input type="button" name="GD" class="green" value="&reg; SET AS MINE" title="Set Draft as yours (GD Team only)" />';
                //                }
                if ($status == 14 && $draft->products_image_by == '') {
                    if ($sub_status == 1) {
                        $actions[] = '<input type="button" name="GD" class="green" value="&reg; SET AS MINE" title="Set Draft as yours (GD Team only)" />';
                    }
                }
                if ($status == 10 && ($sub_status == '' || $sub_status == 0 || $sub_status == 1)) {
                    $cel_class = count($new_elements) > 0 ? ' class="red"' : ' class="green"';
                    $actions[] = '<input type="button" name="CE"' . $cel_class . ' value="&oplus; CREATE ELEMENT" title="Create New Element for this Draft" />';
                }
                if ($status == 10 && $sub_status == 2) {
                    if ($draft->wax_history_info == '') {
                        $pic_wax = '<div class="pic_wax" style="margin-bottom:5px;float:left;"><strong style="margin-right:5px;">Wax PIC</strong><select id="pic_wax"><option value="0">Show All</option>' . loadComboListFromArray($waxers, null, null, false) . '</select></div>';
                        $pic_wax .= '<div class="wax_status" style="margin-bottom:5px;float:left;"><strong style="margin-right:5px;">Wax Status</strong><select id="wax_status"><option value="0">Show All</option>' . loadComboListFromArray($wax_stats, null, null, false) . '</select></div>';
                        $pic_wax .= '<input class="wax_submit" type="button" name="SW" value="Save WAX" title="Save WAX"/>';
                        $pic_wax .= '<input class="wax_done green" type="button" style="display:none;" name="WD" value="&#10003; WAX DONE" title="Set Wax as done" />';
                    } else {
                        if (substr($draft->wax_history_info, -1) == '|') {
                            $pic_wax = '<div class="pic_wax" style="margin-bottom:5px;float:left;"><strong style="margin-right:5px;">Wax PIC</strong><select id="pic_wax"><option value="0">Show All</option>' . loadComboListFromArray($waxers, null, null, false) . '</select></div>';
                            $pic_wax .= '<div class="wax_status" style="margin-bottom:5px;float:left;"><strong style="margin-right:5px;">Wax Status</strong><select id="wax_status"><option value="0">Show All</option>' . loadComboListFromArray($wax_stats, null, null, false) . '</select></div>';
                            $pic_wax .= '<input class="wax_submit" type="button" name="SW" value="Save WAX" title="Save WAX"/>';
                            $pic_wax .= '<input class="wax_done green" type="button" style="display:none;" name="WD" value="&#10003; WAX DONE" title="Set Wax as done" />';
                        } else {
                            $pic_wax = '<input class="wax_done green" type="button" name="WD" value="&#10003; WAX DONE" title="Set Wax as done" />';
                            $pic_wax .= '<div class="pic_wax" style="margin-bottom:5px;float:left;display:none;"><strong style="margin-right:5px;">Wax PIC</strong><select id="pic_wax"><option value="0">Show All</option>' . loadComboListFromArray($waxers, null, null, false) . '</select></div>';
                            $pic_wax .= '<div class="wax_status" style="margin-bottom:5px;float:left;display:none;"><strong style="margin-right:5px;">Wax Status</strong><select id="wax_status"><option value="0">Show All</option>' . loadComboListFromArray($wax_stats, null, null, false) . '</select></div>';
                            $pic_wax .= '<input class="wax_submit" type="button" style="display:none;" name="SW" value="Save WAX" title="Save WAX"/>';
                        }
                    }
                    $actions[] = $pic_wax;
                }
                if ($status == 12 || $status == 7 || $status == 8) {
                    $acttemp = '';
                    foreach ($products as $p) {
                        $acttemp .= '<div style="height:81px;"><div style="padding-top:40px"><input id="sof-' . $p['products_id'] . '" type="checkbox" name="sample_order"' . ($p['create_sample'] == '1' ? ' checked="checked"' : '') . ' style="width:auto;" title="Check this to auto generate sample order automatically when the product is finalized" /> <label for="sof-' . $p['products_id'] . '">Create <abbr title="Sample Order">SO</abbr></label></div></div>';
                    }
                    $actions[] = $acttemp;
                }
                $clear = '<input type="button" name="DC" value="&times; CLEAR" title="Clear Approval Status" />';
                $kill = '<input type="button" name="DR" class="red" value="&times; Kill" title="Kill Draft" />';
                if ($draft->approve_status == '0') {
                    if ($status == '4') {
                        $actions[] = '<input type="button" name="DA" class="green" value="&hearts; Approve" title="Approve Draft for New Elements" />';
                    }
                    if ($status == '4' || $status == '5' || $status == '10') {
                        $actions[] = $kill;
                    }
                } elseif ($draft->approve_status == 'A') {
                    if ($status < 5) {
                        $actions[] = '<input type="button" class="green" value="&hearts; Approved" disabled="disabled" />';
                    } elseif ($status == '5' || $status == '10') {
                        $actions[] = $kill;
                    }
                    if ($status >= 5) {
                        $clear = '';
                    }
                } elseif ($draft->approve_status == 'R' && $status < 5) {
                    $actions[] = '<input type="button" class="red" value="&hearts; Killed" disabled="disabled" />';
                }
                if ($draft->approve_status != '0') {
                    $actions[] = $clear;
                }
                $value .= implode('<br />', $actions);
                break;
        }
        if ($key == 'ID' || $key == 'Name') {
            $value = $detail_link . $value . '</a>';
        }
        if ($key == 'Name') {
            $showComment = false;
            $showGD = false;
            $showWaxHistory = false;
            if ($status == 10 && $sub_status == 2 && $draft->wax_history_info != '') {
                $showWaxHistory = true;
            }
            if ($draft->comments != '' && $draft->comments_lub != '' && $draft->comments_lut != '') {
                $showComment = true;
            }
            if ($showWaxHistory) {
                $wax_pic = explode('||', $draft->wax_history_info);
                $history_array = array();
                $p = array();
                $history_wax = false;
                $p['pic w100'] = 'PIC';
                $p['start w100'] = 'Start Date';
                $p['end w100'] = 'End Date';
                $p['wax_status w100'] = 'Status';
                $p['lead w100'] = 'Lead Time';
                $table_pic[] = $p;
                foreach ($wax_pic as $text) {
                    list($pics, $wax_status, $start_date, $end_date) = explode('|', $text);
                    if ($end_date == '') {
                        $wax_start = time() - strtotime($start_date);
                        $current_duration = $wax_start > 0 ? displayDuration($wax_start, 1) . ' ago' : 'just now';
                        $value .= '<br /><br /<span style="font-weight:bold;">PIC Wax: ' . $pics . ' (' . $current_duration . ') - ' . $wax_status . '</span>';
                    }
                    if ($end_date != '') {
                        $wax_end = strtotime($end_date) - strtotime($start_date);
                        $p['pic w100'] = $pics;
                        $p['start w100'] = date('d-M-y', strtotime($start_date));
                        $p['end w100'] = date('d-M-y', strtotime($end_date));
                        $p['wax_status w100'] = $wax_status;
                        $p['lead w100'] = displayDuration($wax_end, 1);
                        $table_pic[] = $p;
                        $history_wax = true;
                    }
                }
                if ($history_wax) {
                    $title_pic_wax = tep_draw_table('main_center', $table_pic);
                    $value .= '<br /><div style="float:left;">Wax History</div><span class="ui-icon ui-icon-info"></span><span style="display:none;">' . $title_pic_wax . '</span>';
                }
            }
            if ($status >= 6 && $draft->products_image_by != '' && $draft->products_image_start != '') {
                $showGD = true;
                if ($showComment) {
                    if ($draft->comments_lut < $draft->products_image_start) {
                        $showComment = false;
                    }
                }
            }
            if ($showGD) {
                $gdstart = time() - $draft->products_image_start;
                $duration = $gdstart > 0 ? displayDuration($gdstart, 1) . ' ago' : 'just now';
                $value .= '<br /><br /><span class="red">GD: <strong>' . $draft->products_image_by . '</strong>';
                $value .= ' (' . trim($duration) . ')</span>';
            }
            if ($showComment) {
                $lastcomment = time() - strtotime($draft->comments_lut);
                $duration = $lastcomment > 0 ? displayDuration($lastcomment, 1) . ' ago' : 'just now';
                //if($lastcomment<1*24*60*60) {
                $value .= '<br /><br /><span class="red">Last Comment by <strong>' . $draft->comments_lub . '</strong>';
                $value .= '<br />posted ' . $duration . '</span>';
            }
            $value = '<div>' . $value . '</div>' . drawObjectSocialLine($draft, 'dra');
        }
        $row .= '<td class="' . $class . '">' . $value . '</td>';
    }
    $row .= '</tr>';
    return $row;
}
<?php

use_class('design_draft');
if (isset($_GET['id'])) {
    $id = tep_db_prepare_input($_GET['id']);
}
if (isset($_POST['drafts_id'])) {
    $id = tep_db_prepare_input($_POST['drafts_id']);
}
if (isset($id)) {
    $draft = new design_draft($id);
}
$imgsize = '350';
if (isset($_POST['me_action'])) {
    if (!is_null($draft->id)) {
        $draft->followers->addFollower($session_userinfo['id']);
    }
    if ($_POST['me_action'] == 'UPLOADIMAGE') {
        if (isset($_FILES['image_1'])) {
            $image = $_FILES['image_1'];
            $imgno = '1';
            $img_title = 'Main Image';
        } elseif (isset($_FILES['image_2'])) {
            $image = $_FILES['image_2'];
            $imgno = '2';
            $img_title = 'Alternate Image';
        }
        $uploadedimgsize = @getimagesize($image['tmp_name']);
        if ($uploadedimgsize[0] > $imglimit || $uploadedimgsize[1] > $imglimit) {
            $result = 'File is too big, max width/height allowed is ' . $imglimit . 'px';
        } else {
Exemplo n.º 8
0
 $pkeys = $class_pm->keywordsParseRule($pkeys);
 //$pspoint = tep_db_prepare_input($_POST['pspoint']);
 $addtoamvd = tep_db_prepare_input($_POST['addtoamvd']);
 $amvdcatid = tep_db_prepare_input($_POST['amvdcatid']);
 $improved_image = tep_db_prepare_input($_POST['improved_image']);
 $improved_content = tep_db_prepare_input($_POST['improved_content']);
 $gender = tep_db_prepare_input($_POST['gender']);
 $agegroup = tep_db_prepare_input($_POST['agegroup']);
 $att_colls = tep_db_prepare_input($_POST['att_colls']);
 $att_symbols = tep_db_prepare_input($_POST['att_symbols']);
 $att_topics = tep_db_prepare_input($_POST['att_topics']);
 $att_colls_array = explode(",", $att_colls);
 $att_symbols_array = explode(",", $att_symbols);
 $att_topics_array = explode(",", $att_topics);
 $languages_id = '2';
 $draft = new design_draft(null, $products_id);
 $products_to_update = array();
 $products_to_update[] = $products_id;
 if ($make_template == "1") {
     $uf_products = $draft->retrieveProducts("finalized_time IS NULL AND finalized_by IS NULL");
     foreach ($uf_products as $ufp) {
         if (!in_array($ufp['products_id'], $products_to_update)) {
             $products_to_update[] = $ufp['products_id'];
         }
     }
     foreach ($products_to_update as $pid) {
         if ($att_colls != null) {
             removeProducts($pid, $att_symbols, $att_topics);
             foreach ($att_colls_array as $att_colls_id) {
                 $class_s->addProduct($att_colls_id, $pid, $username);
             }
Exemplo n.º 9
0
     $comments_lut = null;
     $comments_lub = null;
 }
 if ($products_id == '') {
     $products_id = null;
 }
 $design = new design();
 $design->create($session_userinfo['id'], $session_userinfo['username'], $session_userinfo['users_image'], '0', $cat, $procat, $probra, $name, $price, $products_id, $styles_id_L, $styles_id_F, $structure_id, $content_id, $colors_request, $design_copied->followers->list_raw, $comments, $comments_lut, $comments_lub);
 $design_copied->comments->addComment($session_userinfo['username'], "I copied this Design to Design {$design->id}.");
 //ALSO COPY DRAFT IF REQUESTED BY USER
 if ($copy_draft_lists != '') {
     $copy_draft_lists = explode(',', $copy_draft_lists);
 }
 if (is_array($copy_draft_lists) && count($copy_draft_lists) > 0) {
     use_class('design_draft');
     $draft = new design_draft();
     foreach ($copy_draft_lists as $draft_id) {
         $draft_copied = new design_draft($draft_id);
         if (is_object($draft_copied)) {
             $colors_request = $copy_dra_color_request == 'on' ? $draft_copied->colors_request : null;
             if ($copy_dra_comments == 'on') {
                 $dra_comments = $draft_copied->comments->comments;
                 $dra_comments_lut = $draft_copied->comments_lut;
                 $dra_comments_lub = $draft_copied->comments_lub;
             } else {
                 $dra_comments = null;
                 $dra_comments_lut = null;
                 $dra_comments_lub = null;
             }
             //                        echo "$draft->create($design->id, $draft_copied->name, $colors_request, ".$draft_copied->followers->list_raw.", $dra_comments, $dra_comments_lut, $dra_comments_lub);<br/>";
             $draft->create($design->id, $draft_copied->name, $colors_request, $draft_copied->followers->list_raw, $dra_comments, $dra_comments_lut, $dra_comments_lub);