function uppdateplotly($arrayinput, $paramArray)
{
    $joinstring = makestring($arrayinput);
    $data = datamake($joinstring, $paramArray);
    $curl = curl_init();
    // Set some options - we are passing in a useragent too here
    curl_setopt_array($curl, array(CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => 'https://plot.ly/clientresp', CURLOPT_POST => 1, CURLOPT_POSTFIELDS => $data));
    // Send the request & save response to $resp
    $resp = curl_exec($curl);
    // Close request to clear up some resources
    curl_close($curl);
}
Beispiel #2
0
function show_submit_element($action_submit, $align = 'middle')
{
    global $common_html, $_GET;
    global $tablename, $primarykey_index, $print_title;
    $temp_array = explode('_', $_GET['action']);
    $mark = $temp_array[1];
    $action_model_array = explode(',', $action_submit);
    //        var_dump($action_model_array);//by cwf
    for ($i = 0; $i < sizeof($action_model_array); $i++) {
        $index_mid = $action_model_array[$i];
        $index_array = explode('_', $index_mid);
        $index = $index_array[0];
        $index_array = explode(':', $index);
        $index0 = $index_array[0];
        $index1 = $index_array[1];
        if ($index1 != '') {
            $index_name = $index1;
        } else {
            $index_name = $index0;
        }
        switch ($index0) {
            case 'submit':
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'submit';
                $array[$i]['shortcut'] = $index_array[2];
                $array[$i]['name'] = 'submit';
                //                                var_dump($array);//by cwf
                break;
            case 'cancel':
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "if((is_ie && history.length==0) || (!is_ie && history.length==1))  window.close();else history.back();";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'button';
                $array[$i]['shortcut'] = $index_array[2];
                $array[$i]['name'] = 'cancel';
                break;
            case 'return':
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "history.back();";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'button';
                $array[$i]['shortcut'] = $index_array[2];
                break;
                //角色权限时用到MySubmit
            //角色权限时用到MySubmit
            case 'mysubmit':
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "mysubmit();";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'button';
                $array[$i]['shortcut'] = $index_array[2];
                $array[$i]['mysubmit'] = 'mysubmit';
                $array[$i]['name'] = 'mysubmit';
                break;
            case 'userdefine':
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'submit';
                $array[$i]['name'] = 'IsSendMail_Button';
                $array[$i]['shortcut'] = $index_array[2];
                $array[$i]['userdefine'] = 'userdefine';
                break;
            case 'userdefine1':
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "UserDefaultAdd();";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'button';
                $array[$i]['name'] = 'userdefine1';
                $array[$i]['shortcut'] = $index_array[2];
                $array[$i]['userdefine1'] = 'userdefine1';
                break;
            case 'modifyrecord':
                $array[$i]['value'] = $common_html['common_html'][$index_name];
                $array[$i]['title'] = $common_html['common_html'][$index_name];
                $array[$i]['url'] = "window.open('../JXC/modifyrecord_newai.php?" . base64_encode("tablename={$tablename}&keyfield=" . $primarykey_index . "&keyvalue=" . $_GET[$primarykey_index]) . "');";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'button';
                $array[$i]['name'] = 'modifyrecord';
                $array[$i]['shortcut'] = $index_array[2];
                break;
            case 'add':
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "location='?action=" . $index0 . "_" . $mark . "'";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'button';
                $array[$i]['shortcut'] = $index_array[2];
                $array[$i]['name'] = 'add';
                break;
            case 'init':
                //print_R($index_array);
                if ($index_array[3] == 'email' || $index_array[3] == 'sms') {
                    $temp_mark = $index_array[1];
                } else {
                    $temp_mark = $mark;
                }
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "location='?action=" . $index0 . "_" . $temp_mark . "'";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'button';
                $array[$i]['shortcut'] = $index_array[2];
                break;
            case 'delete':
                global $primarykey_index;
                $newarray = returnpagearray();
                $newarray['action'] = 'delete_array';
                //$newarray['returnmodel']='';
                $newarray['pageid'] = $_GET['pageid'] != '' ? $_GET['pageid'] : 1;
                $newarray['selectid'] = $_GET[$primarykey_index] . ",";
                $makestring = makestring($newarray);
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "javascript:if(confirm('" . $common_html['common_html']['reallydelete'] . "'))location='?{$makestring}'";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'button';
                $array[$i]['shortcut'] = $index_array[2];
                break;
            case 'set':
                $return = FormPageAction();
                global $tablename;
                $temp_index = explode(':', $index_mid);
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "location='?action=" . $temp_index[0] . "&table_name={$tablename}&table_action=" . $_GET['action'] . "'";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'button';
                $array[$i]['shortcut'] = $index_array[2];
                break;
            case 'print':
                $return = FormPageAction();
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "print_control();";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'button';
                $array[$i]['shortcut'] = $index_array[2];
                $array[$i]['name'] = 'print';
                break;
            case 'export':
                $return = FormPageAction();
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "XExportToExcel('" . $print_title . "');";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'button';
                $array[$i]['shortcut'] = $index_array[2];
                $array[$i]['name'] = 'export';
                break;
            case 'savelink':
                $return = FormPageAction();
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "form1.action=form1.action+'&addlink=1'";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'submit';
                $array[$i]['shortcut'] = $index_array[2];
                $array[$i]['name'] = 'savelink';
                break;
            case 'reply':
                //$actionValue=explode("_",$_GET['action']);
                $actionValueText = "";
                //for($m=1;$m<sizeof($actionValue);$m++)	{
                //$actionValueText.="_".$actionValue[$m];
                //}
                $actionValueText = "edit_reply";
                $return = FormPageAction("action", $actionValueText);
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "location='?{$return}'";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'button';
                $array[$i]['shortcut'] = $index_array[2];
                break;
            case 'forward':
                //$actionValue=explode("_",$_GET['action']);
                $actionValueText = "";
                //for($m=1;$m<sizeof($actionValue);$m++)	{
                //$actionValueText.="_".$actionValue[$m];
                //}
                $actionValueText = "edit_forward";
                $return = FormPageAction("action", $actionValueText);
                $array[$i]['value'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['title'] = " " . $common_html['common_html'][$index_name] . " ";
                $array[$i]['url'] = "location='?{$return}'";
                $array[$i]['class'] = 'SmallButton';
                $array[$i]['type'] = 'button';
                $array[$i]['shortcut'] = $index_array[2];
                break;
        }
    }
    is_array($array) ? print_submit_element_array($array, $align, 6) : '';
}