/** * return Piece from Pieces Return * * $.ajax({ method:'return', table:'Pieces', barcode:9...9, ...}; * * @return string '' */ function JKY_return_piece($the_data) { $db = Zend_Registry::get('db'); $my_barcode = get_data($the_data, 'barcode'); $my_inspected_by = get_data($the_data, 'inspected_by'); $my_weighed_by = get_data($the_data, 'weighed_by'); $my_remarks = get_data($the_data, 'remarks'); $my_checkin_weight = get_data($the_data, 'checkin_weight'); $my_checkin_location = get_data($the_data, 'checkin_location'); $sql = 'UPDATE Pieces' . ' SET ' . get_updated() . ', status="Check In"' . ', inspected_by= ' . $my_inspected_by . ', weighed_by= ' . $my_weighed_by . ', remarks=\'' . $my_remarks . '\'' . ', checkin_weight= ' . $my_checkin_weight . ', checkin_location=\'' . $my_checkin_location . '\'' . ', checkin_at=\'' . get_time() . '\'' . ' WHERE id =' . $my_barcode; log_sql('Pieces', 'update', $sql); $db->query($sql); insert_changes($db, 'Pieces', $my_barcode); $my_order_id = get_table_value('Pieces', 'order_id', $my_barcode); $my_set = ', produced_at=\'' . get_time() . '\'' . ', produced_pieces = produced_pieces + 1'; if ($my_remarks != 'boa') { $my_set = ', rejected_pieces = rejected_pieces + 1'; } $my_field_name = $my_remarks == 'boa' ? 'produced_pieces' : 'rejected_pieces'; $sql = 'UPDATE Orders' . ' SET ' . get_updated() . $my_set . ' WHERE id = ' . $my_order_id; log_sql('Orders', 'update', $sql); $db->query($sql); insert_changes($db, 'Orders', $my_order_id); return ''; }
function see_video($src, $row) { if (!$row['delivery_key']) { return ''; } if ($row['position'] != 'EM') { return '' . '<a class=image href="' . INDEX . get_session('contr') . '/preview' . get_session('action') . '?id=' . $row['video_number'] . '"' . '>' . image_over($src, 'align=absmiddle') . '</a>'; } // get swf name from Swfs $swf_name = 'OverAllClear'; if ($row['swf_id']) { $swf_id = $row['swf_id']; $status = get_table_value('Swfs', 'status', $swf_id); // if unique swf, video id as swf name if ('U' == $status) { $swf_name = $row['video_number']; } else { $swf_name = get_table_value('Swfs', 'name', $swf_id); } } return image_over($src, ' align=absmiddle' . ' onClick="javascript:popup_play_video(' . '{ swf:\'' . $swf_name . '\'' . ', flv:\'' . $row['delivery_key'] . '\'' . ', width:' . $row['width'] . ', height:' . $row['height'] . ', position:\'' . $row['position'] . '\'' . ', website:\'' . WEB_SITE . '\'' . ' }); return false;"'); }
$draw_type = GRAPH_ITEM_DRAWTYPE_LINE; } if (isset($_REQUEST['yaxisside']) && !empty($_REQUEST['yaxisside'])) { $yaxisside = escapeshellcmd($_REQUEST['yaxisside']); } else { $yaxisside = 1; } if (isset($_REQUEST['select'])) { // get snmp values for oid for "OID data" table if (!$oid || !$mib) { error(_s('Warning. Incorrect value for field "%1$s"', '[mib]')); exit; } $content = get_oid_content($oid); if ($viewtype == 1 || preg_match('/Table$/', $oid)) { $value = get_table_value($community, $server_ip, $snmp_version, $oid); } else { //if (preg_match('/SYNTAX/i', $content)) { //value $value = get_oid_value($community, $server_ip, $snmp_version, $oid, $idx); if ($content == '') { $content = get_oid_content(escapeshellcmd($value['row'][0])); } } // else { // $row = array('','',''); // $value = array('ret' => 0,'row' => $row); // } $json = new CJSON(); echo $json->encode(array('info' => $content, 'value' => $value)); exit;
if (isset($_REQUEST['oids'])) { $oids = $_REQUEST['oids']; } if (isset($_REQUEST['viewtype'])) { $viewtype = $_REQUEST['viewtype']; } //////////////////////////////////////////////// // actions if (isset($_REQUEST['select'])) { if (!$oid || !$mib) { json_error('Missing oid or mib'); exit; } $content = get_oid_content($oid); if ($viewtype == 1 || preg_match('/Table$/', $oid)) { $value = get_table_value($community, $server_ip, $oid); } else { //value $value = get_oid_value($community, $server_ip, $oid, $idx); if ($content == '') { $content = get_oid_content(escapeshellcmd($value['row'][0])); } } $json = json_encode(array('info' => $content, 'value' => $value)); echo $json; exit; } else { if (isset($_REQUEST['save'])) { if (!$oids || !$templateid) { json_error('Missing oid list or templateid'); }