1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <form>
- <p>Субномер:</p>
- <input type="text" name="subnumber">
- <input type="submit" value="Отправить">
- </form>
- <?php
- $subnumber = $_REQUEST['subnumber'];
- $time = date('Y-m-d\TH:i:s');
- if ($subnumber) {
- var_dump($subnumber);
- //$params['subnum_section'] = '11360112';//12730149';//2ЭС5К 0275А
- $params['subnum_section'] = $subnumber;
- // $params['placeOfRepair'] = "a84d0a15-08ec-11e5-829d-00155d6cab05"; //Братское
- $params['mes_time'] = $time;//"2019-10-28T13:00:00";
- //var_dump($time);
- TWXrequest($params);
- }
- //11360112 2464928e-d8e9-11e9-80d5-005056011052
- function TWXrequest($params)
- {
- $url = "http://devplatform.digitaldepot.ru:8085/Thingworx/Things/connSmoppLibrary/Services/get_section_info";
- $jsonEncoded = json_encode($params);
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: application/json", "AppKey: 33cd23bb-3b03-4638-afef-7104a13e9211", "Accept:application/json"));
- // curl_setopt($curl, CURLOPT_USERPWD, sprintf('%s:%s', "Smopp", "2050.Digital"));
- curl_setopt($curl, CURLOPT_TIMEOUT, 60);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($curl, CURLOPT_POST, 1);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonEncoded);
- curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
- curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
- // var_dump($jsonEncoded);
- $result = curl_exec($curl);
- //016 11360336 e6b6b19d-d9c3-11e9-80d5-005056011052
- //016 11360328 e6b6b19e-d9c3-11e9-80d5-005056011052
- // $uuid = json_decode($result)->RemarkId;
- // echo "uuid ".$uuid;
- // curl_close($curl);
- var_dump($result);
- // var_dump($result);
- }
- ?>
|