Ejemplo n.º 1
0
         $s_scheduled = $newvalue;
     }
     if (strpos($colname, 'supsdt') !== false) {
         $s_sdt = $newvalue;
     }
     $es->updateDetail($s_name, $s_address, $s_contact, $s_phone, $s_outsourced, $s_scheduled, $s_sdt);
     $result = array();
     $result['esid'] = $esid;
     $result['newvalue'] = str_replace("\n", $newline_separator, $newvalue);
     $result['loadid'] = $_POST['loadid'];
     $result['is_cb'] = $_POST['is_cb'];
     ajaxReturn($result);
 } elseif ($_POST['me_action'] == 'DELETESUPPLIER') {
     $esid = tep_db_prepare_input($_POST['esid']);
     $es = new elements_suppliers($esid);
     $es_con_default = $es->retrieveElementsConnection(true);
     if (count($es_con_default) > 0) {
         $deleted = false;
     } else {
         $es->removeElementConnection('*');
         $es->deleteDetail();
         $deleted = true;
     }
     $result = array();
     $result['esid'] = $esid;
     $result['deleted'] = $deleted ? '1' : '0';
     echo ajaxReturn($result);
     exit;
 } elseif ($_POST['me_action'] == 'CREATENEWSUPPLIER') {
     $s_name = tep_db_prepare_input(utf8_decode($_POST['sname']));
     $s_address = tep_db_prepare_input(utf8_decode($_POST['saddr']));
Ejemplo n.º 2
0
            $row .= '</tr>';
        }
        echo utf8_encode($row);
        exit;
    } elseif ($_POST['me_action'] == 'ELEMENTCONNECTIONDELETE') {
        $esid = tep_db_prepare_input($_POST['esid']);
        $eid = tep_db_prepare_input($_POST['eid']);
        $es = new elements_suppliers($esid);
        $es->removeElementConnection($eid);
        echo utf8_encode('id-' . $eid);
        exit;
    }
}
$esid = tep_db_prepare_input($_GET['id']);
$es = new elements_suppliers($esid);
$list = $es->retrieveElementsConnection();
$listofids = array();
$listofcodes = array();
$listofprices = array();
foreach ($list as $l) {
    $eid = $l['elements_id'];
    if (!in_array($eid, $listofids)) {
        $listofids[] = $eid;
    }
    if (!isset($listofcodes[$eid])) {
        $listofcodes[$eid] = array();
    }
    $listofcodes[$eid][] = $l['item_number'];
    if (!isset($listofprices[$eid])) {
        $listofprices[$eid] = array();
    }