├── README.md ├── SonyDDEXWebService ├── constant.php ├── cUrl.php ├── ReleaseAvailabilityRequestCall.php ├── SupplyChainStatusCall.php ├── db.sql └── SonyXmlParser.php ├── GenerateLog.php ├── VideoDDEXParser.php ├── SoundRecordingXMLParser.php └── db.sql /README.md: -------------------------------------------------------------------------------- 1 | # DDEXPHPParser 2 | DDEX PHP Parser Can be use for Parsing DDEX XML FILE 3 | 4 | it is been tested on:- 5 | * Sony Music DDEX XML 6 | * Universal Music DDEX XML 7 | * EMI Music DDEX XML 8 | * WARNER Music DDEX XML 9 | * Fox Star DDEX XML 10 | * WB DDEX XML 11 | 12 | * SONY MUSIC WEB SERIVCE BASED DDEX PARSER 13 | 14 | Please find below link for: 15 | 16 | # DDEXPythonParser 17 | https://github.com/nikhilpnik/DDEXPythonParser 18 | -------------------------------------------------------------------------------- /SonyDDEXWebService/constant.php: -------------------------------------------------------------------------------- 1 | $returnCode,"response"=>$return,"error"=>$err); 21 | } 22 | -------------------------------------------------------------------------------- /SonyDDEXWebService/ReleaseAvailabilityRequestCall.php: -------------------------------------------------------------------------------- 1 | array( 5 | 'proxy' => 'http://10.140.65.114:8080', // This needs to be the server and the port of the NTLM Authentication Proxy Server. 6 | 'request_fulluri' => True, 7 | ), 8 | ); 9 | $cxContext = stream_context_create($aContext); 10 | $xml = file_get_contents(SONY_RARCAPI,false,$cxContext); 11 | print_r($xml);exit;*/ 12 | 13 | require_once "cUrl.php"; 14 | require_once "constant.php"; 15 | require_once "SonyXmlParser.php"; 16 | 17 | $request="\r\n\r\n\r\nadadasasdasd\r\n\r\nasdasdadad\r\n\r\nRelease Distributor\r\n\r\n\r\n\r\nasdasdasdas\r\n\r\nRelease Creator\r\n\r\n\r\n2009-11-20T09:30:47.0Z\r\nfalse\r\nNormal\r\n\r\n\r\nsdadasdasd\r\n\r\n"; 18 | 19 | //echo "\n".SONY_RARCAPI; 20 | //echo "\n".SONY_USERNAME; 21 | //echo "\n".SONY_PASSWORD; 22 | $response = cUrl_With_Basic_Authentication(SONY_RARCAPI,array(),SONY_USERNAME,SONY_PASSWORD,$request); 23 | print_r($response); 24 | if($response["HTTP_CODE"]=="200"){ 25 | $xml = $response["response"]; 26 | $obj = new SonyXmlParser(); 27 | $obj->ProcessSonyRawXML($xml); 28 | } 29 | -------------------------------------------------------------------------------- /SonyDDEXWebService/SupplyChainStatusCall.php: -------------------------------------------------------------------------------- 1 | prepare($sql); 11 | $stmt->execute(); 12 | $result = $stmt->fetchAll ( PDO::FETCH_ASSOC ); 13 | foreach($result as $data){ 14 | $request = ' 15 | 17 | 18 | adsasdasdasd 19 | 20 | asdadasd 21 | 22 | Release Distributor 23 | 24 | 25 | 26 | asdasdasd 27 | 28 | Release Creator 29 | 30 | 31 | 2009-11-20T09:30:47.0Z 32 | false 33 | Normal 34 | 35 | 36 | adasdasdadasd 37 | 38 | 39 | '.$data["Grid"].' 40 | 41 | SuccessfullyIngestedByReleaseDistributor 42 | '; 43 | 44 | $response = cUrl_With_Basic_Authentication(SONY_SCSCAPI,array(),SONY_USERNAME,SONY_PASSWORD,$request); 45 | print_r($response); 46 | if($response["HTTP_CODE"]=="200"){ 47 | $update = "UPDATE sony_ws_xmllist SET log_send=1 WHERE srno=:srno"; 48 | $update_data = array(":srno"=>$data["xmlid"]); 49 | $ustmt = $obj->prepare($update); 50 | $ustmt->execute($update_data); 51 | 52 | } 53 | } 54 | ?> 55 | -------------------------------------------------------------------------------- /GenerateLog.php: -------------------------------------------------------------------------------- 1 | mysql_host, $this->mysql_user, $this->mysql_pass,$this->mysql_db); 22 | 23 | if (mysqli_connect_error()) { 24 | die('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error()); 25 | } 26 | 27 | $this->get_iso_693_2_codes(); 28 | } 29 | 30 | 31 | public function get_iso_693_2_codes(){ 32 | $sql = "SELECT * from iso_693_2_codes"; 33 | $result = $this->query($sql); 34 | while($row = $result->fetch_assoc()){ 35 | $this->language[$row['iso_693_1']] = $row['language_name']; 36 | 37 | } 38 | 39 | } 40 | 41 | public function generateResponse(){ 42 | #echo 43 | #$query = "select sony_xmllist.*,sony_albumlist.Grid from sony_xmllist inner join sony_albumlist where sony_xmllist.srno = sony_albumlist.xmlid and total_songs=download_songs and download_images>0 and log_send<>1 and total_songs > 0"; 44 | $query = "select sony_xmllist.*,sony_albumlist.Grid from sony_xmllist inner join sony_albumlist where sony_xmllist.srno = sony_albumlist.xmlid and total_songs=download_songs and log_send<>1 and ((download_images>0 and total_songs > 0) or (sony_xmllist.Process_status=1 and update_indicator='UpdateMessage' and total_songs=0))"; 45 | 46 | #$query = "select sony_xmllist.*,sony_albumlist.Grid from sony_xmllist inner join sony_albumlist where sony_xmllist.srno = sony_albumlist.xmlid and total_songs=download_songs and download_images>0 and total_songs > 0"; 47 | if ($result = $this->query($query)) { 48 | while ($row = $result->fetch_assoc()) { 49 | //print_r($row);exit; 50 | $filename = $row['Grid'].".xml"; 51 | $file = $this->logStorage.$filename; 52 | $myfile = fopen($file, "w") or die("Unable to open file!"); 53 | $xml = ' 54 | 55 | 56 | '.$row['MessageRecipientId'].' 57 | 58 | '.$row['MessageRecipientName'].' 59 | 60 | 61 | 62 | '.$row['MessageSenderId'].' 63 | 64 | '.$row['MessageSenderName'].' 65 | 66 | 67 | '.date(DATE_ATOM).' 68 | 69 | 70 | '.$row['MessageId'].' 71 | '.date(DATE_ATOM).' 72 | 73 | FileOK 74 | '; 75 | fwrite($myfile, $xml); 76 | fclose($myfile); 77 | chmod($file,0755); 78 | echo "\n".$update = "UPDATE sony_xmllist SET log_send=1 where srno=".$row['srno']; 79 | #$update = "UPDATE sony_xmllist SET log_send=1 where srno=".$row['srno']; 80 | if(!($this->query($update))){ 81 | $data = array('query'=>$update,'error'=>$mysqli->error); 82 | file_put_contents('sony_xmllist.log',print_r($data,true),FILE_APPEND); 83 | } 84 | } 85 | } 86 | 87 | } 88 | 89 | } 90 | 91 | if (PHP_SAPI === 'cli') { 92 | $argument1 = $argv[1]; 93 | if($argument1 == "log"){ 94 | $movieTemp = new MovieSonytoTemp(); 95 | $movieTemp->generateResponse(); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /SonyDDEXWebService/db.sql: -------------------------------------------------------------------------------- 1 | -- Adminer 4.2.1 MySQL dump 2 | 3 | SET NAMES utf8; 4 | SET time_zone = '+00:00'; 5 | 6 | DROP TABLE IF EXISTS `iso_693_2_codes`; 7 | CREATE TABLE `iso_693_2_codes` ( 8 | `srno` int(11) NOT NULL AUTO_INCREMENT, 9 | `iso_693_2_5` varchar(10) DEFAULT NULL, 10 | `iso_693_1` varchar(10) DEFAULT NULL, 11 | `language_name` varchar(50) DEFAULT NULL, 12 | `scope` varchar(50) DEFAULT NULL, 13 | `type` varchar(50) DEFAULT NULL, 14 | `iso_693_3` varchar(10) DEFAULT NULL, 15 | PRIMARY KEY (`srno`) 16 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 17 | 18 | 19 | DROP TABLE IF EXISTS `songlist_kaltura`; 20 | CREATE TABLE `songlist_kaltura` ( 21 | `srno` int(11) NOT NULL AUTO_INCREMENT, 22 | `isrc_songlist` varchar(50) DEFAULT NULL, 23 | `isrc_kaltura_all` varchar(50) DEFAULT NULL, 24 | `name` varchar(200) DEFAULT NULL, 25 | `artist` varchar(200) DEFAULT NULL, 26 | `entry_id` varchar(50) DEFAULT NULL, 27 | PRIMARY KEY (`srno`) 28 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 29 | 30 | 31 | DROP TABLE IF EXISTS `sony_albumlist`; 32 | CREATE TABLE `sony_albumlist` ( 33 | `srno` int(11) NOT NULL AUTO_INCREMENT, 34 | `Image_DPID` varchar(100) DEFAULT NULL, 35 | `ImageType` varchar(30) DEFAULT NULL, 36 | `ImageCodecType` varchar(30) DEFAULT NULL, 37 | `ImageHeight` varchar(30) DEFAULT NULL, 38 | `ImageWidth` varchar(30) DEFAULT NULL, 39 | `ImageResolution` varchar(30) DEFAULT NULL, 40 | `ImageURL` text, 41 | `ImageHashSum` varchar(100) DEFAULT NULL, 42 | `Albumname` varchar(100) DEFAULT NULL, 43 | `Grid` varchar(100) DEFAULT NULL, 44 | `ICPN` varchar(100) DEFAULT NULL, 45 | `DPID` varchar(100) DEFAULT NULL, 46 | `IPID` varchar(100) DEFAULT NULL, 47 | `Process_status` char(5) DEFAULT NULL, 48 | `xmlid` int(11) DEFAULT NULL, 49 | `Image_status` char(5) DEFAULT NULL, 50 | `label` varchar(100) DEFAULT NULL, 51 | `release_date` varchar(100) DEFAULT NULL, 52 | `year` varchar(100) DEFAULT NULL, 53 | `language` varchar(100) DEFAULT NULL, 54 | `movie_release_date` varchar(100) DEFAULT NULL, 55 | `albumtype` varchar(100) DEFAULT NULL, 56 | `publisher` varchar(100) DEFAULT NULL, 57 | `genre` varchar(100) DEFAULT NULL, 58 | `music_director` varchar(100) DEFAULT NULL, 59 | `release_type` varchar(100) DEFAULT NULL, 60 | `catalog_number` varchar(100) DEFAULT NULL, 61 | PRIMARY KEY (`srno`), 62 | KEY `xmlid` (`xmlid`) 63 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 64 | 65 | 66 | DROP TABLE IF EXISTS `sony_deallist`; 67 | CREATE TABLE `sony_deallist` ( 68 | `srno` int(11) NOT NULL AUTO_INCREMENT, 69 | `commercial_type` varchar(100) DEFAULT NULL, 70 | `use_type` varchar(100) DEFAULT NULL, 71 | `territory_code` varchar(100) DEFAULT NULL, 72 | `sales_start_date` varchar(100) DEFAULT NULL, 73 | `xmlid` varchar(100) DEFAULT NULL, 74 | PRIMARY KEY (`srno`) 75 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 76 | 77 | 78 | DROP TABLE IF EXISTS `sony_songlist`; 79 | CREATE TABLE `sony_songlist` ( 80 | `srno` int(11) NOT NULL AUTO_INCREMENT, 81 | `ISRC` varchar(20) DEFAULT NULL, 82 | `ResourceReference` char(5) DEFAULT NULL, 83 | `ReferenceTitle` varchar(200) DEFAULT NULL, 84 | `LanguageOfPerformance` varchar(20) DEFAULT NULL, 85 | `Duration` varchar(20) DEFAULT NULL, 86 | `Title` varchar(200) DEFAULT NULL, 87 | `Artist` varchar(100) DEFAULT NULL, 88 | `Producer` varchar(100) DEFAULT NULL, 89 | `Composer` varchar(100) DEFAULT NULL, 90 | `Lyricist` varchar(100) DEFAULT NULL, 91 | `Label` varchar(100) DEFAULT NULL, 92 | `Year` int(11) DEFAULT NULL, 93 | `plinetext` varchar(100) DEFAULT NULL, 94 | `Genre` varchar(30) DEFAULT NULL, 95 | `ParentalWarningType` varchar(30) DEFAULT NULL, 96 | `AudioCodecType` varchar(30) DEFAULT NULL, 97 | `NumberOfChannels` char(5) DEFAULT NULL, 98 | `SamplingRate` varchar(30) DEFAULT NULL, 99 | `IsPreview` char(5) DEFAULT NULL, 100 | `FileURL` text, 101 | `File_status` char(5) DEFAULT NULL, 102 | `HashSum` varchar(100) DEFAULT NULL, 103 | `Grid` varchar(100) DEFAULT NULL, 104 | `ICPN` varchar(100) DEFAULT NULL, 105 | `DPID` varchar(100) DEFAULT NULL, 106 | `IPID` varchar(100) DEFAULT NULL, 107 | `Process_status` char(5) DEFAULT NULL, 108 | `xmlid` int(11) DEFAULT NULL, 109 | `ImageURL` text, 110 | `ImageHashSum` varchar(100) DEFAULT NULL, 111 | `Image_status` char(5) DEFAULT NULL, 112 | `ImageCodecType` varchar(30) DEFAULT NULL, 113 | `ImageHeight` varchar(30) DEFAULT NULL, 114 | `ImageWidth` varchar(30) DEFAULT NULL, 115 | `ImageResolution` varchar(30) DEFAULT NULL, 116 | `wav_status` char(5) DEFAULT '0', 117 | `added_to_cms` int(11) DEFAULT '0', 118 | `Actor` varchar(200) DEFAULT NULL, 119 | PRIMARY KEY (`srno`), 120 | KEY `xmlid` (`xmlid`), 121 | KEY `ISRC` (`ISRC`), 122 | KEY `File_status` (`File_status`) 123 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 124 | 125 | 126 | DROP TABLE IF EXISTS `sony_ws_albumlist`; 127 | CREATE TABLE `sony_ws_albumlist` ( 128 | `srno` int(11) NOT NULL AUTO_INCREMENT, 129 | `Albumname` varchar(100) DEFAULT NULL, 130 | `Grid` varchar(100) DEFAULT NULL, 131 | `ICPN` varchar(100) DEFAULT NULL, 132 | `DPID` varchar(100) DEFAULT NULL, 133 | `IPID` varchar(100) DEFAULT NULL, 134 | `Process_status` char(5) DEFAULT NULL, 135 | `xmlid` int(11) DEFAULT NULL, 136 | `Image_status` char(5) DEFAULT NULL, 137 | `label` varchar(100) DEFAULT NULL, 138 | `release_date` varchar(100) DEFAULT NULL, 139 | `year` varchar(100) DEFAULT NULL, 140 | `language` varchar(100) DEFAULT NULL, 141 | `movie_release_date` varchar(100) DEFAULT NULL, 142 | `albumtype` varchar(100) DEFAULT NULL, 143 | `publisher` varchar(100) DEFAULT NULL, 144 | `genre` varchar(100) DEFAULT NULL, 145 | `music_director` varchar(100) DEFAULT NULL, 146 | `release_type` varchar(100) DEFAULT NULL, 147 | `catalog_number` varchar(100) DEFAULT NULL, 148 | PRIMARY KEY (`srno`), 149 | KEY `xmlid` (`xmlid`) 150 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 151 | 152 | 153 | DROP TABLE IF EXISTS `sony_ws_songlist`; 154 | CREATE TABLE `sony_ws_songlist` ( 155 | `srno` int(11) NOT NULL AUTO_INCREMENT, 156 | `ISRC` varchar(20) DEFAULT NULL, 157 | `ResourceReference` char(5) DEFAULT NULL, 158 | `ReferenceTitle` varchar(200) DEFAULT NULL, 159 | `LanguageOfPerformance` varchar(20) DEFAULT NULL, 160 | `Duration` varchar(20) DEFAULT NULL, 161 | `Title` varchar(200) DEFAULT NULL, 162 | `Artist` varchar(100) DEFAULT NULL, 163 | `Producer` varchar(100) DEFAULT NULL, 164 | `Composer` varchar(100) DEFAULT NULL, 165 | `Lyricist` varchar(100) DEFAULT NULL, 166 | `Label` varchar(100) DEFAULT NULL, 167 | `Year` int(11) DEFAULT NULL, 168 | `plinetext` varchar(100) DEFAULT NULL, 169 | `Genre` varchar(30) DEFAULT NULL, 170 | `ParentalWarningType` varchar(30) DEFAULT NULL, 171 | `AudioCodecType` varchar(30) DEFAULT NULL, 172 | `NumberOfChannels` char(5) DEFAULT NULL, 173 | `SamplingRate` varchar(30) DEFAULT NULL, 174 | `IsPreview` char(5) DEFAULT NULL, 175 | `FileURL` text, 176 | `File_status` char(5) DEFAULT NULL, 177 | `HashSum` varchar(100) DEFAULT NULL, 178 | `Grid` varchar(100) DEFAULT NULL, 179 | `ICPN` varchar(100) DEFAULT NULL, 180 | `DPID` varchar(100) DEFAULT NULL, 181 | `IPID` varchar(100) DEFAULT NULL, 182 | `Process_status` char(5) DEFAULT NULL, 183 | `xmlid` int(11) DEFAULT NULL, 184 | `ImageURL` text, 185 | `ImageHashSum` varchar(100) DEFAULT NULL, 186 | `Image_status` char(5) DEFAULT NULL, 187 | `ImageCodecType` varchar(30) DEFAULT NULL, 188 | `ImageHeight` varchar(30) DEFAULT NULL, 189 | `ImageWidth` varchar(30) DEFAULT NULL, 190 | `ImageResolution` varchar(30) DEFAULT NULL, 191 | `wav_status` char(5) DEFAULT '0', 192 | `added_to_cms` int(11) DEFAULT '0', 193 | `Actor` varchar(200) DEFAULT NULL, 194 | PRIMARY KEY (`srno`), 195 | KEY `xmlid` (`xmlid`), 196 | KEY `ISRC` (`ISRC`), 197 | KEY `File_status` (`File_status`) 198 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 199 | 200 | 201 | DROP TABLE IF EXISTS `sony_ws_xmllist`; 202 | CREATE TABLE `sony_ws_xmllist` ( 203 | `srno` int(11) NOT NULL AUTO_INCREMENT, 204 | `MessageThreadId` varchar(100) DEFAULT NULL, 205 | `MessageId` varchar(100) DEFAULT NULL, 206 | `MessageSenderId` varchar(100) DEFAULT NULL, 207 | `MessageSenderName` varchar(100) DEFAULT NULL, 208 | `MessageRecipientId` varchar(100) DEFAULT NULL, 209 | `MessageRecipientName` varchar(100) DEFAULT NULL, 210 | `MessageCreatedDateTime` varchar(100) DEFAULT NULL, 211 | `Process_status` char(5) DEFAULT NULL, 212 | `Process_date` date DEFAULT NULL, 213 | `total_songs` int(11) DEFAULT '0', 214 | `download_songs` int(11) DEFAULT '0', 215 | `download_images` int(11) DEFAULT '0', 216 | `log_send` int(11) DEFAULT '0', 217 | `update_indicator` varchar(100) DEFAULT NULL, 218 | PRIMARY KEY (`srno`) 219 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 220 | 221 | 222 | DROP TABLE IF EXISTS `sony_xmllist`; 223 | CREATE TABLE `sony_xmllist` ( 224 | `srno` int(11) NOT NULL AUTO_INCREMENT, 225 | `Filename` varchar(30) DEFAULT NULL, 226 | `MessageThreadId` varchar(100) DEFAULT NULL, 227 | `MessageId` varchar(100) DEFAULT NULL, 228 | `MessageSenderId` varchar(100) DEFAULT NULL, 229 | `MessageSenderName` varchar(100) DEFAULT NULL, 230 | `MessageRecipientId` varchar(100) DEFAULT NULL, 231 | `MessageRecipientName` varchar(100) DEFAULT NULL, 232 | `MessageCreatedDateTime` varchar(100) DEFAULT NULL, 233 | `XML_status` char(5) DEFAULT NULL, 234 | `Process_status` char(5) DEFAULT NULL, 235 | `Process_date` date DEFAULT NULL, 236 | `total_songs` int(11) DEFAULT '0', 237 | `download_songs` int(11) DEFAULT '0', 238 | `download_images` int(11) DEFAULT '0', 239 | `log_send` int(11) DEFAULT '0', 240 | `update_indicator` varchar(20) DEFAULT NULL, 241 | PRIMARY KEY (`srno`) 242 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 243 | 244 | 245 | DROP TABLE IF EXISTS `sony_xml_output`; 246 | CREATE TABLE `sony_xml_output` ( 247 | `srno` int(11) NOT NULL AUTO_INCREMENT, 248 | `party_id` varchar(100) DEFAULT NULL, 249 | `catalog_number` varchar(100) DEFAULT NULL, 250 | `ipcn` varchar(100) DEFAULT NULL, 251 | `grid` varchar(100) DEFAULT NULL, 252 | `isrc` varchar(100) DEFAULT NULL, 253 | `artist` varchar(500) DEFAULT NULL, 254 | `title` varchar(100) DEFAULT NULL, 255 | `release_type` varchar(100) DEFAULT NULL, 256 | `commercial_type` varchar(100) DEFAULT NULL, 257 | `use_type` varchar(100) DEFAULT NULL, 258 | `territories` varchar(100) DEFAULT NULL, 259 | `price_value_code` varchar(100) DEFAULT NULL, 260 | `sales_start_date` varchar(100) DEFAULT NULL, 261 | `sales_end_date` varchar(100) DEFAULT NULL, 262 | `xmlid` int(11) DEFAULT NULL, 263 | `inserted_date` datetime DEFAULT NULL, 264 | PRIMARY KEY (`srno`) 265 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 266 | 267 | 268 | DROP TABLE IF EXISTS `sony_xml_output_1`; 269 | CREATE TABLE `sony_xml_output_1` ( 270 | `srno` int(11) NOT NULL AUTO_INCREMENT, 271 | `party_id` varchar(100) DEFAULT NULL, 272 | `catalog_number` varchar(100) DEFAULT NULL, 273 | `ipcn` varchar(100) DEFAULT NULL, 274 | `grid` varchar(100) DEFAULT NULL, 275 | `isrc` varchar(100) DEFAULT NULL, 276 | `artist` varchar(500) DEFAULT NULL, 277 | `title` varchar(100) DEFAULT NULL, 278 | `release_type` varchar(100) DEFAULT NULL, 279 | `commercial_type` varchar(100) DEFAULT NULL, 280 | `use_type` varchar(100) DEFAULT NULL, 281 | `territories` varchar(100) DEFAULT NULL, 282 | `price_value_code` varchar(100) DEFAULT NULL, 283 | `sales_start_date` varchar(100) DEFAULT NULL, 284 | `sales_end_date` varchar(100) DEFAULT NULL, 285 | `xmlid` int(11) DEFAULT NULL, 286 | `inserted_date` datetime DEFAULT NULL, 287 | `updated_date` datetime DEFAULT NULL, 288 | `addedjb` bit(1) DEFAULT b'0', 289 | PRIMARY KEY (`srno`), 290 | KEY `isrc` (`isrc`), 291 | KEY `catalog_number` (`catalog_number`), 292 | KEY `commercial_type` (`commercial_type`) 293 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 294 | 295 | 296 | DROP TABLE IF EXISTS `sony_xml_ws_output_1`; 297 | CREATE TABLE `sony_xml_ws_output_1` ( 298 | `srno` int(11) NOT NULL AUTO_INCREMENT, 299 | `party_id` varchar(100) DEFAULT NULL, 300 | `catalog_number` varchar(100) DEFAULT NULL, 301 | `ipcn` varchar(100) DEFAULT NULL, 302 | `grid` varchar(100) DEFAULT NULL, 303 | `isrc` varchar(100) DEFAULT NULL, 304 | `artist` varchar(500) DEFAULT NULL, 305 | `title` varchar(100) DEFAULT NULL, 306 | `release_type` varchar(100) DEFAULT NULL, 307 | `commercial_type` varchar(100) DEFAULT NULL, 308 | `use_type` varchar(100) DEFAULT NULL, 309 | `territories` varchar(100) DEFAULT NULL, 310 | `price_value_code` varchar(100) DEFAULT NULL, 311 | `sales_start_date` varchar(100) DEFAULT NULL, 312 | `sales_end_date` varchar(100) DEFAULT NULL, 313 | `xmlid` int(11) DEFAULT NULL, 314 | `inserted_date` datetime DEFAULT NULL, 315 | `updated_date` datetime DEFAULT NULL, 316 | PRIMARY KEY (`srno`), 317 | KEY `isrc` (`isrc`), 318 | KEY `catalog_number` (`catalog_number`), 319 | KEY `commercial_type` (`commercial_type`) 320 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 321 | 322 | 323 | DROP TABLE IF EXISTS `unprocessed_xml`; 324 | CREATE TABLE `unprocessed_xml` ( 325 | `xmlid` int(11) NOT NULL, 326 | `grid` varchar(50) DEFAULT NULL, 327 | `icpn` varchar(50) DEFAULT NULL, 328 | `Albumname` varchar(100) DEFAULT NULL, 329 | `ResourceReference` varchar(5) DEFAULT NULL, 330 | `ISRC` varchar(20) NOT NULL, 331 | `SongTitle` varchar(200) DEFAULT NULL, 332 | `Artist` varchar(100) DEFAULT NULL, 333 | `Duration` varchar(20) DEFAULT NULL, 334 | `LanguageOfPerformance` varchar(20) DEFAULT NULL, 335 | `Composer` varchar(100) DEFAULT NULL, 336 | `Lyricist` varchar(100) DEFAULT NULL, 337 | `HashSum` varchar(100) DEFAULT NULL, 338 | `FileUrl` varchar(100) DEFAULT NULL, 339 | `ImageHashSum` varchar(100) DEFAULT NULL, 340 | `ImageURL` text, 341 | `Label` varchar(100) DEFAULT NULL, 342 | `addedtojb` int(11) DEFAULT '0', 343 | `process_status` bit(1) DEFAULT b'0', 344 | `addeddate` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, 345 | `Actor` varchar(200) DEFAULT NULL, 346 | `ReleaseReference` varchar(5) DEFAULT NULL, 347 | `alreadythere` int(11) DEFAULT '0', 348 | PRIMARY KEY (`xmlid`,`ISRC`) 349 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 350 | 351 | 352 | -- 2017-09-19 10:34:26 353 | -------------------------------------------------------------------------------- /SonyDDEXWebService/SonyXmlParser.php: -------------------------------------------------------------------------------- 1 | mysql_host;port=3306;dbname=$this->mysql_db"; 28 | parent::__construct($dns, $this->mysql_user, $this->mysql_pass); 29 | }catch (PDOException $e) { 30 | echo 'Connection failed: ' . $e->getMessage();exit; 31 | } 32 | } 33 | 34 | public function ProcessSonyRawXML($xml){ 35 | //$xml = file_get_contents("ReleaseAvailabilityCall2.xml"); 36 | $objResponse = new SimpleXMLIterator($xml); 37 | $xmlid = 0; 38 | if($objResponse->ReleaseAvailabilityStatus == AVAILABLEFORDSP){ 39 | $ns = $objResponse->getNamespaces(true); 40 | foreach($ns as $key=>$namespace){ 41 | $child = $objResponse->children($namespace); 42 | foreach($child->children() as $key=>$value){ 43 | switch($key){ 44 | case "MessageHeader": 45 | $xmlid = $this->ProcessMessageHeader($value); 46 | $this->MessageSenderPartyId = $value->MessageSender->PartyId; 47 | break; 48 | case "ResourceList": 49 | $this->ResourceList = $value;; 50 | break; 51 | case "ReleaseList": 52 | $this->ReleaseList = $value; 53 | break; 54 | case "DealList": 55 | $this->DealList = $value; 56 | break; 57 | case "UpdateIndicator": 58 | $this->UpdateIndicator= $value; 59 | break; 60 | } 61 | } 62 | } 63 | 64 | } 65 | if(!empty($this->ReleaseList) && !empty($this->ResourceList) && !empty($xmlid) && !empty($this->DealList) && !empty($this->MessageSenderPartyId)){ 66 | $this->ProcessResourceList($this->ReleaseList,$this->ResourceList,$xmlid,$this->DealList); 67 | $update = "UPDATE sony_ws_xmllist SET update_indicator=:update_indicator WHERE srno=:xmlid"; 68 | $stmt = $this->prepare($update); 69 | $stmt->execute(array(":update_indicator"=>$this->UpdateIndicator,":xmlid"=>$xmlid)); 70 | 71 | } 72 | 73 | } 74 | 75 | public function ProcessResourceList($ReleaseList,$ResourceList,$xmlid,$DealList){ 76 | $Release = $this->ProcessReleaseList($ReleaseList); 77 | $Deal = $this->ProcessDealList($ReleaseList,$DealList,$xmlid); 78 | $SoundRecording = $this->ProcessSoundRecording($ResourceList,$xmlid); 79 | $Grid = ""; 80 | $ICPN = ""; 81 | $CatalogNumber= ""; 82 | $TitleText =""; 83 | foreach($Release as $r){ 84 | $Grid = $r["Grid"]; 85 | $ICPN = $r["ICPN"]; 86 | $CatalogNumber = $r["CatalogNumber"]; 87 | $Albumname = $r["TitleText"]; 88 | $insert = "INSERT INTO sony_ws_albumlist(Albumname,Grid,ICPN,xmlid,release_date,year,movie_release_date,genre,release_type,catalog_number) VALUES(:Albumname,:Grid,:ICPN,:xmlid,:release_date,:year,:movie_release_date,:genre,:release_type,:catalog_number)"; 89 | $insert_data = array(":Albumname"=>$Albumname, 90 | ":Grid"=>$Grid, 91 | ":ICPN"=>$ICPN, 92 | ":xmlid"=>$xmlid, 93 | ":release_date"=>$r["GlobalOriginalReleaseDate"], 94 | ":year"=>$r["Year"], 95 | ":movie_release_date"=>$r["GlobalOriginalReleaseDate"], 96 | ":genre"=>$r["Genre"], 97 | ":release_type"=>$r["ReleaseType"], 98 | ":catalog_number"=>$r["CatalogNumber"] 99 | ); 100 | foreach($r["ReleaseResourceReference"] as $ReleaseResourceReference){ 101 | if(!empty($SoundRecording[$ReleaseResourceReference])){ 102 | $song_insert = "INSERT INTO sony_ws_songlist(ISRC,ResourceReference,ReferenceTitle,LanguageOfPerformance,Duration,Title,Artist,Producer,Composer,Lyricist,Label,Year,plinetext,Genre,ParentalWarningType,AudioCodecType,NumberOfChannels,SamplingRate,IsPreview,FileURL,HashSum,Grid,ICPN,xmlid,ImageURL,ImageHashSum,Actor) VALUES(:ISRC,:ResourceReference,:ReferenceTitle,:LanguageOfPerformance,:Duration,:Title,:Artist,:Producer,:Composer,:Lyricist,:Label,:Year,:plinetext,:Genre,:ParentalWarningType,:AudioCodecType,:NumberOfChannels,:SamplingRate,:IsPreview,:FileURL,:HashSum,:Grid,:ICPN,:xmlid,:ImageURL,:ImageHashSum,:Actor)"; 103 | $song_insert_data = array( 104 | ":ISRC"=>$SoundRecording[$ReleaseResourceReference]["ISRC"], 105 | ":ResourceReference"=>$ReleaseResourceReference, 106 | ":ReferenceTitle"=>$SoundRecording[$ReleaseResourceReference]["ReferenceTitle"], 107 | ":LanguageOfPerformance"=>$SoundRecording[$ReleaseResourceReference]["LanguageOfPerformance"], 108 | ":Duration"=>$SoundRecording[$ReleaseResourceReference]["Duration"], 109 | ":Title"=>$SoundRecording[$ReleaseResourceReference]["Title"]["TitleText"], 110 | ":Artist"=>$SoundRecording[$ReleaseResourceReference]["Artist"], 111 | ":Producer"=>$SoundRecording[$ReleaseResourceReference]["Producer"], 112 | ":Composer"=>$SoundRecording[$ReleaseResourceReference]["Composer"], 113 | ":Lyricist"=>$SoundRecording[$ReleaseResourceReference]["Lyricist"], 114 | ":Label"=>$SoundRecording[$ReleaseResourceReference]["Label"], 115 | ":Year"=>$SoundRecording[$ReleaseResourceReference]["Year"], 116 | ":plinetext"=>$SoundRecording[$ReleaseResourceReference]["plinetext"], 117 | ":Genre"=>$SoundRecording[$ReleaseResourceReference]["Genre"], 118 | ":ParentalWarningType"=>$SoundRecording[$ReleaseResourceReference]["ParentalWarningType"], 119 | ":AudioCodecType"=>$SoundRecording[$ReleaseResourceReference]["AudioCodecType"], 120 | ":NumberOfChannels"=>$SoundRecording[$ReleaseResourceReference]["NumberOfChannels"], 121 | ":SamplingRate"=>$SoundRecording[$ReleaseResourceReference]["SamplingRate"], 122 | ":IsPreview"=>$SoundRecording[$ReleaseResourceReference]["IsPreview"], 123 | ":FileURL"=>$SoundRecording[$ReleaseResourceReference]["FileURL"], 124 | ":HashSum"=>$SoundRecording[$ReleaseResourceReference]["HashSum"], 125 | ":Grid"=>$Grid, 126 | ":ICPN"=>$ICPN, 127 | ":xmlid"=>$xmlid, 128 | ":ImageURL"=>$SoundRecording['Image']["ImageFile"], 129 | ":ImageHashSum"=>$SoundRecording['Image']["ImageHash"], 130 | ":Actor"=>$SoundRecording[$ReleaseResourceReference]["Actor"] 131 | ); 132 | $stmt = $this->prepare($song_insert); 133 | $stmt->execute($song_insert_data); 134 | //print_r($stmt->errorInfo()); 135 | 136 | } 137 | } 138 | $stmt2 = $this->prepare($insert); 139 | $stmt2->execute($insert_data); 140 | } 141 | } 142 | 143 | public function ProcessDealList($ReleaseList,$DealList,$xmlid){ 144 | // print_r($DealList);exit; 145 | // print_r($ReleaseList);exit; 146 | $DealArr = array(); 147 | foreach ($DealList as $Deal){ 148 | $DealReleaseReference = $Deal->DealReleaseReference->__toString(); 149 | foreach($Deal->Deal as $DealTerms){ 150 | $CommercialModelType = $DealTerms->DealTerms->CommercialModelType->__toString(); 151 | $DealArr[$DealReleaseReference][$CommercialModelType]['CommercialModelType'] =$CommercialModelType; 152 | 153 | $Usage =$DealTerms->DealTerms->Usage->UseType; 154 | $UsageArr = array(); 155 | foreach($Usage as $u){ 156 | $UsageArr[] = $u; 157 | } 158 | 159 | $DealArr[$DealReleaseReference][$CommercialModelType]['Usage']= implode(" / ",$UsageArr); 160 | $DealArr[$DealReleaseReference][$CommercialModelType]['TerritoryCode'] = $DealTerms->DealTerms->TerritoryCode->__toString(); 161 | $DealArr[$DealReleaseReference][$CommercialModelType]['ValidityPeriod'] =$DealTerms->DealTerms->ValidityPeriod->StartDate->__toString(); 162 | $DealArr[$DealReleaseReference][$CommercialModelType]['TakenDown'] =$DealTerms->DealTerms->TakenDown->__toString(); 163 | if($DealTerms->DealTerms->TakenDown->__toString()){ 164 | $DealArr[$DealReleaseReference][$CommercialModelType]['ValidityEndPeriod'] = $DealTerms->DealTerms->ValidityPeriod->StartDate->__toString(); 165 | }else{ 166 | $DealArr[$DealReleaseReference][$CommercialModelType]['ValidityEndPeriod'] =""; 167 | } 168 | 169 | } 170 | } 171 | 172 | $CatalogNumber = ""; 173 | $ICPN =""; 174 | 175 | foreach ($ReleaseList as $Release){ 176 | $ReleaseReference = $Release->ReleaseReference->__toString(); 177 | $partyid = $this->MessageSenderPartyId->__toString(); 178 | $GRid = $Release->ReleaseId->GRid->__toString(); 179 | $ICPN = !empty($Release->ReleaseId->ICPN->__toString())?$Release->ReleaseId->ICPN->__toString():$ICPN; 180 | $CatalogNumber = !empty($Release->ReleaseId->CatalogNumber->__toString())?$Release->ReleaseId->CatalogNumber->__toString():$CatalogNumber; 181 | $ISRC = $Release->ReleaseId->ISRC->__toString(); 182 | $TitleText = $Release->ReferenceTitle->TitleText->__toString(); 183 | $DisplayArtistName = $Release->ReleaseDetailsByTerritory->DisplayArtistName->__toString(); 184 | $ReleaseType =$Release->ReleaseType->__toString(); 185 | foreach($DealArr as $DealReleaseReference=>$Deal){ 186 | if($ReleaseReference == $DealReleaseReference){ 187 | foreach($Deal as $d){ 188 | $select = "SELECT count(*) as ct FROM sony_xml_ws_output_1 WHERE isrc=:isrc and catalog_number=:catalog_number and commercial_type=:commercial_type"; 189 | $select_data = array( 190 | ":isrc"=>$ISRC, 191 | ":commercial_type"=>$d["CommercialModelType"], 192 | ":catalog_number"=>$CatalogNumber, 193 | ); 194 | $stmt = $this->prepare($select); 195 | $stmt->execute($select_data); 196 | $result = $stmt->fetchAll ( PDO::FETCH_ASSOC ); 197 | $insert_data = array(":party_id"=>$partyid, 198 | ":catalog_number"=>$CatalogNumber, 199 | ":ipcn"=>$ICPN, 200 | ":grid"=>$GRid, 201 | ":isrc"=>$ISRC, 202 | ":artist"=>$DisplayArtistName, 203 | ":title"=>$TitleText, 204 | ":release_type"=>$ReleaseType, 205 | ":commercial_type"=>$d["CommercialModelType"], 206 | ":use_type"=>$d["Usage"], 207 | ":territories"=>$d["TerritoryCode"], 208 | ":price_value_code"=>"", 209 | ":sales_start_date"=>$d["ValidityPeriod"], 210 | ":sales_end_date"=>$d["ValidityEndPeriod"], 211 | ":xmlid"=>$xmlid 212 | ); 213 | 214 | 215 | if(!empty($result[0]["ct"])){ 216 | $update = "UPDATE sony_xml_ws_output_1 SET party_id=:party_id,catalog_number=:catalog_number,ipcn=:ipcn,grid=:grid,isrc=:isrc,artist=:artist,title=:title,release_type=:release_type,commercial_type=:commercial_type,use_type=:use_type,territories=:territories,price_value_code=:price_value_code,sales_start_date=:sales_start_date,sales_end_date=:sales_end_date,xmlid=:xmlid,updated_date=NOW() WHERE isrc=:isrc and catalog_number=:catalog_number and commercial_type=:commercial_type"; 217 | $stmt = $this->prepare($update); 218 | $stmt->execute($insert_data); 219 | //print_r($stmt->rowCount()); 220 | 221 | }else{ 222 | 223 | $insert = "INSERT INTO sony_xml_ws_output_1(party_id,catalog_number,ipcn,grid,isrc,artist,title,release_type,commercial_type,use_type,territories,price_value_code,sales_start_date,sales_end_date,xmlid,inserted_date) VALUE(:party_id,:catalog_number,:ipcn,:grid,:isrc,:artist,:title,:release_type,:commercial_type,:use_type,:territories,:price_value_code,:sales_start_date,:sales_end_date,:xmlid,now())"; 224 | $stmt = $this->prepare($insert); 225 | $stmt->execute($insert_data); 226 | } 227 | } 228 | } 229 | } 230 | 231 | } 232 | } 233 | 234 | public function ProcessSoundRecording($ResourceList,$xmlid){ 235 | $SoundRecordingArr = array(); 236 | if(!empty($ResourceList->Image)){ 237 | if(!empty($ResourceList->Image->ImageDetailsByTerritory->TechnicalImageDetails->File->URL)){ 238 | $ImageFile = $ResourceList->Image->ImageDetailsByTerritory->TechnicalImageDetails->File->URL->__toString(); 239 | $ImageHash = $ResourceList->Image->ImageDetailsByTerritory->TechnicalImageDetails->File->HashSum->HashSum->__toString(); 240 | } 241 | 242 | } 243 | $SoundRecordingArr['Image'] = array("ImageFile"=>$ImageFile,"ImageHash"=>$ImageHash); 244 | 245 | foreach($ResourceList->SoundRecording as $resource){ 246 | $ResourceReference = $resource->ResourceReference->__toString(); 247 | $ISRC = $resource->SoundRecordingId->ISRC->__toString(); 248 | $ReferenceTitle = $resource->ReferenceTitle->TitleText->__toString(); 249 | $LanguageOfPerformance = $resource->LanguageOfPerformance->__toString(); 250 | $Duration = $resource->Duration->__toString(); 251 | $title = array(); 252 | $artistArr = array(); 253 | $RartistArr = array(); 254 | foreach($resource->SoundRecordingDetailsByTerritory as $SoundRecording){ 255 | $TerritoryCode = $SoundRecording->TerritoryCode->__toString(); 256 | foreach($SoundRecording->Title as $t){ 257 | $TitleType = $t->attributes()->TitleType->__toString(); 258 | $TitleText = $t->TitleText->__toString(); 259 | $title = array("TitleType" =>$TitleType , "TitleText" =>$TitleText); 260 | } 261 | $i = 0; 262 | foreach($SoundRecording->DisplayArtist as $artist){ 263 | $FullName = $artist->PartyName->FullName->__toString(); 264 | $DisplayArtist = array(); 265 | foreach($artist->ArtistRole as $role){ 266 | $DisplayArtist[] = $role->__toString(); 267 | } 268 | 269 | $artistArr[$i] = array("FullName" => $FullName, "ArtistRole" =>$DisplayArtist); 270 | $i = $i+1; 271 | } 272 | unset($ArtistRole); 273 | $ArtistRole = array(); 274 | 275 | foreach($artistArr as $resArt){ 276 | $DisPartyName = $resArt["FullName"]; 277 | foreach($resArt['ArtistRole'] as $resRole){ 278 | $ArtistRole[$resRole][] = $DisPartyName; 279 | } 280 | } 281 | 282 | $arrArtist = array(); 283 | if(!empty($ArtistRole['AssociatedPerformer']) || !empty($ArtistRole['MainArtist']) || !empty($ArtistRole['FeaturedArtist'])){ 284 | $arrArtist = array_merge( (array) $ArtistRole['AssociatedPerformer'], (array) $ArtistRole['MainArtist'], (array) $ArtistRole['FeaturedArtist']); 285 | } 286 | 287 | $Artist = ""; 288 | if(!empty($arrArtist)){ 289 | $arrArtist = array_unique($arrArtist); 290 | $Artist .= !empty($arrArtist) ? implode(',', $arrArtist) : null; 291 | } 292 | 293 | foreach($SoundRecording->ResourceContributor as $resource){ 294 | $FullName = $artist->PartyName->FullName->__toString(); 295 | $ResourceArtistRole = array(); 296 | foreach($artist->ResourceContributorRole as $role){ 297 | $ArtistRole[$role->__toString()][] = $FullName; 298 | } 299 | } 300 | $ArtistRole['Producer'] = array_unique($ArtistRole['Producer']); 301 | $ArtistRole['Composer'] = array_unique($ArtistRole['Composer']); 302 | $ArtistRole['Lyricist'] = array_unique($ArtistRole['Lyricist']); 303 | $ArtistRole['Actor'] = array_unique($ArtistRole['Actor']); 304 | 305 | $Actor = ""; 306 | if(!empty($ArtistRole['Actor'])){ 307 | $Actor .= implode(',', $ArtistRole['Actor']); 308 | } 309 | 310 | $Composer = ""; 311 | if(!empty($ArtistRole['Composer'])){ 312 | $Composer .= implode(',', $ArtistRole['Composer']); 313 | } 314 | 315 | $Lyricist = ""; 316 | if(!empty($ArtistRole['Lyricist'])){ 317 | $Lyricist .= implode(',', $ArtistRole['Lyricist']); 318 | } 319 | 320 | $Producer = ""; 321 | if(!empty($ArtistRole['Lyricist'])){ 322 | $Producer .= implode(',', $ArtistRole['Producer']); 323 | } 324 | 325 | 326 | $Label = $SoundRecording->LabelName->__toString(); 327 | $Year = $SoundRecording->PLine->Year->__toString(); 328 | $plinetext = $SoundRecording->PLine->PLineText->__toString(); 329 | $Genre = $SoundRecording->Genre->GenreText->__toString(); 330 | $ParentalWarningType = $SoundRecording->ParentalWarningType->__toString(); 331 | $FileURL = ""; 332 | $HashSum = ""; 333 | $Duration = ""; 334 | $AudioCodecType = ""; 335 | $SamplingRate = ""; 336 | $IsPreview = ""; 337 | foreach($SoundRecording->TechnicalSoundRecordingDetails as $soundRecording){ 338 | if(!empty($soundRecording->File->URL)){ 339 | if($soundRecording->IsPreview == "false"){ 340 | $IsPreview = $soundRecording->IsPreview->__toString(); 341 | $FileURL = $soundRecording->File->URL->__toString(); 342 | $AudioCodecType = $soundRecording->AudioCodecType->__toString(); 343 | $NumberOfChannels = $soundRecording->NumberOfChannels->__toString(); 344 | $SamplingRate = $soundRecording->SamplingRate->__toString(); 345 | $HashSum = $soundRecording->File->HashSum->HashSum->__toString(); 346 | } 347 | 348 | } 349 | 350 | if(!empty( $soundRecording->PreviewDetails->Duration)){ 351 | $Duration = $soundRecording->PreviewDetails->Duration->__toString(); 352 | } 353 | } 354 | 355 | $SoundRecordingArr[$ResourceReference]["ISRC"]= $ISRC; 356 | $SoundRecordingArr[$ResourceReference]["ReferenceTitle"]= $ReferenceTitle; 357 | $SoundRecordingArr[$ResourceReference]["LanguageOfPerformance"]= $LanguageOfPerformance; 358 | $SoundRecordingArr[$ResourceReference]["Duration"]= $Duration; 359 | $SoundRecordingArr[$ResourceReference]["Title"]= $title; 360 | $SoundRecordingArr[$ResourceReference]["Artist"]= $Artist; 361 | $SoundRecordingArr[$ResourceReference]["Producer"]= $Producer; 362 | $SoundRecordingArr[$ResourceReference]["Composer"]= $Composer; 363 | $SoundRecordingArr[$ResourceReference]["Lyricist"]= $Lyricist; 364 | $SoundRecordingArr[$ResourceReference]["Label"]= $Label; 365 | $SoundRecordingArr[$ResourceReference]["Year"]= $Year; 366 | $SoundRecordingArr[$ResourceReference]["plinetext"]= $plinetext; 367 | $SoundRecordingArr[$ResourceReference]["Genre"]= $Genre; 368 | $SoundRecordingArr[$ResourceReference]["ParentalWarningType"]= $ParentalWarningType; 369 | $SoundRecordingArr[$ResourceReference]["AudioCodecType"]= $AudioCodecType; 370 | $SoundRecordingArr[$ResourceReference]["NumberOfChannels"]= $NumberOfChannels; 371 | $SoundRecordingArr[$ResourceReference]["SamplingRate"]= $SamplingRate; 372 | $SoundRecordingArr[$ResourceReference]["IsPreview"]= $IsPreview; 373 | $SoundRecordingArr[$ResourceReference]["FileURL"]= $FileURL; 374 | $SoundRecordingArr[$ResourceReference]["HashSum"]= $HashSum; 375 | $SoundRecordingArr[$ResourceReference]["Process_status"]= $Process_status; 376 | $SoundRecordingArr[$ResourceReference]["xmlid"]= $xmlid; 377 | $SoundRecordingArr[$ResourceReference]["Actor"]= $Actor; 378 | 379 | } 380 | } 381 | 382 | return $SoundRecordingArr; 383 | } 384 | 385 | public function ProcessReleaseList($objXml){ 386 | $ReleaseList = $objXml; 387 | $album = array(); 388 | $ReleaseId = ""; 389 | foreach($ReleaseList->Release as $Release){ 390 | $GRid = $Release->ReleaseId->GRid->__toString(); 391 | $ICPN = $Release->ReleaseId->ICPN->__toString(); 392 | $CatalogNumber = $Release->ReleaseId->CatalogNumber->__toString(); 393 | $TitleText = $Release->ReferenceTitle->TitleText->__toString(); 394 | $ReleaseResourceReference = $Release->ReleaseResourceReferenceList->ReleaseResourceReference; 395 | $ReleaseReference = $Release->ReleaseReference->__toString(); 396 | if(!empty($ICPN)){ 397 | $album[$ReleaseReference]['Grid'] = $GRid; 398 | $album[$ReleaseReference]['ICPN'] = $ICPN; 399 | $album[$ReleaseReference]['CatalogNumber'] = $CatalogNumber; 400 | $album[$ReleaseReference]['TitleText'] = $TitleText; 401 | $album[$ReleaseReference]['GlobalOriginalReleaseDate'] = $Release->GlobalOriginalReleaseDate->__toString(); 402 | $album[$ReleaseReference]['ReleaseResourceReference'] = (array) $ReleaseResourceReference; 403 | $album[$ReleaseReference]['Year'] = $Release->PLine->Year->__toString(); 404 | $album[$ReleaseReference]['Label'] =$Release->PLine->PLineText->__toString(); 405 | $album[$ReleaseReference]['Genre'] =$Release->ReleaseDetailsByTerritory->Genre->GenreText->__toString(); 406 | $album[$ReleaseReference]['ReleaseType'] =$Release->ReleaseType->__toString();; 407 | } 408 | } 409 | return $album; 410 | 411 | } 412 | 413 | public function ProcessMessageHeader($objXml){ 414 | $MessageThreadId = $objXml->MessageThreadId; 415 | $MessageId = $objXml->MessageId; 416 | $MessageSenderPartyId = $objXml->MessageSender->PartyId; 417 | $MessageSenderFullName = $objXml->MessageSender->PartyName->FullName; 418 | $MessageRecipientPartyId = $objXml->MessageRecipient->PartyId; 419 | $MessageRecipientFullName = $objXml->MessageRecipient->PartyName->FullName; 420 | $MessageCreatedDateTime = $objXml->MessageCreatedDateTime; 421 | $MessageControlType = $objXml->MessageControlType; 422 | //echo $MessageThreadId . "---->" .$MessageId . "---->" .$MessageSenderPartyId."---->".$MessageSenderFullName."---->".$MessageRecipientPartyId."---->".$MessageRecipientFullName. "---->" .$MessageCreatedDateTime. "---->".$MessageControlType; 423 | $insert = "INSERT INTO sony_ws_xmllist(MessageThreadId,MessageId,MessageSenderId,MessageSenderName,MessageRecipientId,MessageRecipientName,MessageCreatedDateTime,Process_status,Process_date) VALUES(:MessageThreadId,:MessageId,:MessageSenderId,:MessageSenderName,:MessageRecipientId,:MessageRecipientName,NOW(),:Process_status,NOW())"; 424 | $stmt = $this->prepare($insert); 425 | $stmt->execute(array( 426 | ":MessageThreadId"=>$MessageThreadId, 427 | ":MessageId"=>$MessageId, 428 | ":MessageSenderId"=>$MessageSenderPartyId, 429 | ":MessageSenderName"=>$MessageSenderFullName, 430 | ":MessageRecipientId"=>$MessageRecipientPartyId, 431 | ":MessageRecipientName"=>$MessageRecipientFullName, 432 | ":Process_status"=>"0" 433 | )); 434 | return $this->lastInsertId(); 435 | } 436 | 437 | } 438 | 439 | //$obj = new SonyXmlParser(); 440 | //$obj->ProcessSonyRawXML("ReleaseAvailabilityCall2.xml"); 441 | 442 | -------------------------------------------------------------------------------- /VideoDDEXParser.php: -------------------------------------------------------------------------------- 1 | mysql_host, $this->mysql_user, $this->mysql_pass,$this->mysql_db); 23 | 24 | if (mysqli_connect_error()) { 25 | die('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error()); 26 | } 27 | } 28 | 29 | public function ListXmlFilesRecursively(){ 30 | $ite=new RecursiveDirectoryIterator($this->dirLocation,FilesystemIterator::SKIP_DOTS); 31 | $exclude = array('logs'); 32 | $filter = function ($file, $key, $iterator) use ($exclude) { 33 | if ($iterator->hasChildren() && !in_array($file->getFilename(), $exclude)) { 34 | return true; 35 | } 36 | return $file->isFile(); 37 | }; 38 | $filter = new RecursiveCallbackFilterIterator($ite, $filter); 39 | $Iterator = new RecursiveIteratorIterator($filter); 40 | 41 | //$Directory = new RecursiveDirectoryIterator($this->dirLocation,FilesystemIterator::SKIP_DOTS); 42 | //$Iterator = new RecursiveIteratorIterator($Directory); 43 | $RegexIterator = new RegexIterator($Iterator, '/^.+\.xml$/i', RecursiveRegexIterator::GET_MATCH); 44 | $xmlFiles =array(); 45 | foreach($RegexIterator as $name => $object){ 46 | $dir = $this->destLocation."/".date('Ymd'); 47 | if( is_dir($dir) === false ) { mkdir($dir); } 48 | $info = pathinfo($name); 49 | $newfile = $dir."/".$info['basename']; 50 | if(copy($name, $newfile)){ 51 | $insert = "INSERT INTO sony_xmllist(Filename,XML_status,Process_date,directory) VALUE('".$info['basename']."',1,now(),'".dirname($name)."')"; 52 | $this->query($insert); 53 | unlink($name); 54 | } 55 | //unlink($name); 56 | $xmlFiles[] = $name; 57 | } 58 | 59 | return $xmlFiles; 60 | } 61 | 62 | public function ProcessSonyRawXML(){ 63 | // WHERE Process_status is null" 64 | $query = "SELECT srno,Filename,Process_date FROM sony_xmllist where XML_status=1 and Process_status is null"; 65 | //$query = "SELECT srno,Filename,Process_date FROM sony_xmllist"; //-- For Testing 66 | if ($result = $this->query($query)) { 67 | while ($row = $result->fetch_assoc()) { 68 | $foldername = date('Ymd',strtotime($row['Process_date'])); 69 | $xml = $this->destLocation.$foldername."/".$row['Filename']; 70 | if(is_file($xml)){ 71 | $oXml = new XMLReader(); 72 | $oXml->open($xml); 73 | echo $xml2assoc['Filename'] = $row['Filename']; 74 | $xml2assoc['srno'] = $row['srno']; 75 | $xml2assoc['Process_date'] = $row['Process_date']; 76 | $xml2assoc['xml_data'] = $this->xml2assoc($oXml); 77 | //print_r( $xml2assoc['xml_data']);exit; 78 | if(!empty($xml2assoc['xml_data'][0]['val'])){ 79 | foreach($xml2assoc['xml_data'][0]['val'] as $value){ 80 | 81 | switch($value['name']){ 82 | 83 | case "MessageHeader": 84 | $MessageHeaderData = $value['val']; 85 | $this->InsertMessageHeader($MessageHeaderData,$xml2assoc['srno']); 86 | break; 87 | case "ResourceList": 88 | $ResourceListData = $value['val']; 89 | $this->InsertResourceList($ResourceListData,$xml2assoc['srno'],$row['directory']); 90 | break; 91 | case "ReleaseList": 92 | $ReleaseListData = $value['val']; 93 | $this->InsertReleaseList($ReleaseListData,$xml2assoc['srno']); 94 | break; 95 | case "DealList": 96 | $DealListData = $value['val']; 97 | $this->InsertDealList($DealListData,$MessageHeaderData,$ResourceListData,$ReleaseListData,$xml2assoc['srno']); 98 | break; 99 | case "UpdateIndicator": 100 | $UpdateIndicator = $value['val']; 101 | break; 102 | 103 | } 104 | } 105 | } 106 | 107 | $oXml->close(); 108 | $update ="update sony_xmllist set Process_status=1,update_indicator='$UpdateIndicator' where srno='".$row['srno']."'"; 109 | $this->query($update); 110 | } 111 | } 112 | $result->free(); 113 | } 114 | } 115 | public function InsertDealList($DealListData,$MessageHeaderData,$ResourceListData,$ReleaseListData,$srno){ 116 | //return true; 117 | $party_id = !empty($MessageHeaderData[2]['val'][0]['val'])? $this->real_escape_string($MessageHeaderData[2]['val'][0]['val']):null; 118 | if(!$party_id){ 119 | return false; 120 | } 121 | $sonyDeal = array(); 122 | foreach($DealListData as $key=>$Deal){ 123 | // print_r($Deal); 124 | foreach($Deal['val'] as $innerDeal){ 125 | if($innerDeal['name'] == "DealReleaseReference"){ 126 | $sonyDeal[$key]["DealReleaseReference"][] = $innerDeal['val']; 127 | } 128 | // if($innerDeal['name'] == 'Deal'){ 129 | // foreach($innerDeal['val'][0]['val'] as $DealTerms){ 130 | // $sonyDeal[$key][$DealTerms['name']] = $DealTerms['val']; 131 | // } 132 | // } 133 | if($innerDeal['name'] == 'Deal'){ 134 | foreach($innerDeal['val'][0]['val'] as $DealTerms){ 135 | 136 | // print_r($DealTerms); 137 | $temp_name = $DealTerms['name']; 138 | // echo "name is $temp_name \n"; 139 | // $modelarray = $DealTerms[0]; 140 | if($temp_name == 'Usage') 141 | { 142 | $usagearray = array(); 143 | foreach($DealTerms['val'] as $usage ) 144 | { 145 | echo "hi \n"; 146 | $usagearray[] = $usage['val'] ; 147 | //print_r($usagearray); 148 | } 149 | //print_r($usagearray); 150 | $usagetype = implode(' / ',$usagearray); 151 | 152 | 153 | // $usagearray[] = $DealTerms['val'][0]; 154 | } 155 | if($temp_name == 'CommercialModelType') 156 | { 157 | $commercial = $DealTerms['val']; 158 | } 159 | if($temp_name == 'TerritoryCode') 160 | { 161 | $territory = $DealTerms['val']; 162 | } 163 | if($temp_name == 'ValidityPeriod') 164 | { 165 | $validaityarray = $DealTerms['val']; 166 | } 167 | if($temp_name == 'TakeDown') 168 | { 169 | $takedown = $DealTerms['val']; 170 | } 171 | 172 | // $usagetype = implode(' / ',$usagearray); 173 | 174 | $startdate = $validaityarray[0]['val']; 175 | $data['TerritoryCode']= $territory ; 176 | $data['Usage'] = $usagetype; 177 | $data['StartDate'] = $startdate; 178 | $data['TakeDown'] = $takedown; 179 | 180 | 181 | $final_deal[$commercial] = $data; 182 | 183 | 184 | // $territoryarray = $DealTerms[2]; 185 | // $validityarray = $DealTerms[3]; 186 | // print_r($usagearray); 187 | //$sonyDeal[$key][$DealTerms['name']] = $DealTerms['val']; 188 | $sonyDeal[$key]['Deal'] = $final_deal; 189 | } 190 | } 191 | 192 | 193 | if($innerDeal['name'] == 'EffectiveDate'){ 194 | $sonyDeal[$key]['EffectiveDate'] = $innerDeal['val']; 195 | } 196 | 197 | } 198 | } 199 | // print_r($sonyDeal); 200 | /*foreach($ResourceListData as $Video){ 201 | if($Video['name'] == "Video"){ 202 | foreach($Video['val'] as $val){ 203 | } 204 | } 205 | }*/ 206 | 207 | $Release = array(); 208 | foreach($ReleaseListData as $key=>$RData){ 209 | foreach($RData['val'] as $ReleaseVal){ 210 | if(is_array($ReleaseVal['val'])){ 211 | foreach($ReleaseVal['val'] as $RData2){ 212 | $Release[$key][$RData2['name']] = $RData2['val']; 213 | } 214 | }else{ 215 | $Release[$key][$ReleaseVal['name']] = $ReleaseVal['val']; 216 | } 217 | } 218 | } 219 | 220 | foreach($Release as $insert_data){ 221 | //print_r($insert_data); 222 | //exit; 223 | $catalog_number = $this->real_escape_string($Release[0]['CatalogNumber']); 224 | $ipcn = $this->real_escape_string($Release[0]['ICPN']); 225 | $grid = $this->real_escape_string($insert_data['GRid']); 226 | $isrc = $this->real_escape_string($insert_data['ISRC']); 227 | $artist = $this->real_escape_string($insert_data['DisplayArtistName']); 228 | $title = $this->real_escape_string($insert_data['TitleText']); 229 | $release_type = $this->real_escape_string($insert_data['ReleaseType']); 230 | 231 | $commercial_type = ""; 232 | $use_type =""; 233 | $territories =""; 234 | $price_value_code=""; 235 | $sales_start_date=""; 236 | $sales_end_date=""; 237 | foreach($sonyDeal as $deal){ 238 | if(in_array($insert_data['ReleaseReference'],$deal["DealReleaseReference"])){ 239 | 240 | 241 | $deal_type = $deal['Deal']; 242 | 243 | foreach($deal_type as $key => $deal_basedupon_commercialmodel) 244 | { 245 | // if($catalog_number=='G010000244373P') 246 | // { 247 | 248 | // echo "key is $key \n"; 249 | // print_r($deal_basedupon_commercialmodel); 250 | // } 251 | // echo "$key \n"; 252 | $commercial_type = $key; 253 | $use_type = $deal_basedupon_commercialmodel['Usage']; 254 | $territories = $deal_basedupon_commercialmodel['TerritoryCode']; 255 | $takedown = !empty($deal_basedupon_commercialmodel['TakeDown'])?$deal_basedupon_commercialmodel['TakeDown']:false; 256 | $sales_start_date =$deal_basedupon_commercialmodel['StartDate']; 257 | if($takedown) 258 | { 259 | 260 | $sales_end_date = $sales_start_date; 261 | } 262 | 263 | $xmlid = $srno; 264 | $inserted_date = date('Y-m-d H:i:s'); 265 | 266 | //if(trim($commercial_type)=='') 267 | if($takedown == 'true') 268 | { 269 | // echo "take down is $takedown\n"; 270 | 271 | $update = "update sony_xml_output_1 set party_id='$party_id',catalog_number='$catalog_number',grid='$grid',artist='$artist',title='$title',release_type='$release_type',commercial_type='',use_type='',territories='',price_value_code='$price_value_code',sales_start_date='',sales_end_date='$sales_end_date',updated_date='$inserted_date',xmlid='$xmlid' where isrc='$isrc' and catalog_number='$catalog_number'"; 272 | // echo "$update \n"; 273 | $this->query($update); 274 | //$count = 0; 275 | //$need_to_insert = false; 276 | 277 | } 278 | else 279 | { 280 | $select = "select isrc from sony_xml_output_1 where isrc = '$isrc' and catalog_number='$catalog_number' and commercial_type='$commercial_type'"; 281 | $result = $this->query($select); 282 | $count = $result->num_rows; 283 | // } 284 | if($count > 0 ) 285 | { 286 | $update = "update sony_xml_output_1 set party_id='$party_id',catalog_number='$catalog_number',grid='$grid',artist='$artist',title='$title',release_type='$release_type',commercial_type='$commercial_type',use_type='$use_type',territories='$territories',price_value_code='$price_value_code',sales_start_date='$sales_start_date',sales_end_date='$sales_end_date',updated_date='$inserted_date',xmlid='$xmlid' where isrc='$isrc' and catalog_number='$catalog_number' and commercial_type='$commercial_type'"; 287 | $this->query($update); 288 | 289 | 290 | } 291 | else 292 | { 293 | echo "insert ,takedown is $takedown \n"; 294 | $insert = "INSERT INTO sony_xml_output_1(party_id,catalog_number,ipcn,grid,isrc,artist,title,release_type,commercial_type,use_type,territories,price_value_code,sales_start_date,sales_end_date,xmlid,inserted_date) 295 | values('$party_id','$catalog_number','$ipcn','$grid','$isrc','$artist','$title','$release_type','$commercial_type','$use_type','$territories','$price_value_code','$sales_start_date','$sales_end_date','$xmlid','$inserted_date')"; 296 | $this->query($insert); 297 | 298 | 299 | } 300 | } 301 | 302 | 303 | } 304 | 305 | } 306 | } 307 | // $xmlid = $srno; 308 | // $inserted_date = date('Y-m-d H:i:s'); 309 | // $select = "select isrc from sony_xml_output_1 where isrc = '$isrc' and catalog_number='$catalog_number'"; 310 | // $result = $this->query($select); 311 | // $count = $result->num_rows; 312 | // if($count > 0) 313 | // { 314 | // $update = "update sony_xml_output_1 set party_id='$party_id',catalog_number='$catalog_number',grid='$grid',artist='$artist',title='$title',release_type='$release_type',commercial_type='$commercial_type',use_type='$use_type',territories='$territories',price_value_code='$price_value_code',sales_start_date='$sales_start_date',sales_end_date='$sales_end_date',updated_date='$inserted_date' where isrc='$isrc' and ipcn='$ipcn'"; 315 | // //this->query($update); 316 | // } 317 | // else 318 | // { 319 | // $insert = "INSERT INTO sony_xml_output_1(party_id,catalog_number,ipcn,grid,isrc,artist,title,release_type,commercial_type,use_type,territories,price_value_code,sales_start_date,sales_end_date,xmlid,inserted_date) 320 | // values('$party_id','$catalog_number','$ipcn','$grid','$isrc','$artist','$title','$release_type','$commercial_type','$use_type','$territories','$price_value_code','$sales_start_date','$sales_end_date','$xmlid','$inserted_date')"; 321 | // $this->query($insert); 322 | // } 323 | } 324 | } 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | public function InsertReleaseList($ReleaseListData,$srno){ 341 | //return true; 342 | $temp_count = count($ReleaseListData); 343 | echo "count is $temp_count \n"; 344 | //exit; 345 | //var_dump($ReleaseListData); 346 | //exit; 347 | $AlbumDetails= array(); 348 | $temp = $ReleaseListData[0]['val'] ; 349 | $temp1 = $temp[4]; 350 | $releasetype = !empty( $temp1['val'])? $this->real_escape_string($temp1['val']):null; ; 351 | //var_dump($temp1); 352 | //exit; 353 | foreach($ReleaseListData[0]['val'] as $Release){ 354 | if(is_array($Release['val'])){ 355 | foreach($Release['val'] as $arr){ 356 | if($arr['name']=='CatalogNumber'){ 357 | $AlbumDetails['DPID'] = str_replace("DPID:","",$arr['atr']['Namespace']); 358 | } 359 | $AlbumDetails[$arr['name']] = $arr['val']; 360 | } 361 | }else{ 362 | $AlbumDetails[$Release['name']] = $Release['val']; 363 | } 364 | } 365 | $Albumname = !empty($AlbumDetails['TitleText'])? $this->real_escape_string($AlbumDetails['TitleText']):null; 366 | $Grid = !empty($AlbumDetails['GRid'])? $this->real_escape_string($AlbumDetails['GRid']):null; 367 | $ICPN = !empty($AlbumDetails['ICPN'])? $this->real_escape_string($AlbumDetails['ICPN']):null; 368 | $DPID = !empty($AlbumDetails['DPID'])? $this->real_escape_string($AlbumDetails['DPID']):null; 369 | $IPID = !empty($AlbumDetails['ProprietaryId'])? $this->real_escape_string(str_replace("IPID:","",$AlbumDetails['ProprietaryId'])):null; 370 | $label = !empty($AlbumDetails['LabelName'])? $this->real_escape_string($AlbumDetails['LabelName']):null; 371 | $OriginalReleaseDate = !empty($AlbumDetails['OriginalReleaseDate'])? $this->real_escape_string($AlbumDetails['OriginalReleaseDate']):null; 372 | $Year = !empty($AlbumDetails['Year'])? $this->real_escape_string($AlbumDetails['Year']):null; 373 | $Genre = !empty($AlbumDetails['Genre'][0]['val'])? $this->real_escape_string($AlbumDetails['Genre'][0]['val']):null; 374 | // $release_type = !empty($AlbumDetails[''][0]['val'])? $this->real_escape_string($AlbumDetails['Genre'][0]['val']):null; 375 | $catalog_number = !empty($AlbumDetails['catalognumber'][0]['val'])? $this->real_escape_string($AlbumDetails['Genre'][0]['val']):null; 376 | 377 | $select = "select ICPN from sony_albumlist where ICPN = '$ICPN' and catalog_number='$catalog_number'"; 378 | //echo "select ICPN from sony_albumlist where ICPN = '$ICPN' and catalog_number='$catalog_number' \n"; 379 | $result = $this->query($select); 380 | $count = $result->num_rows; 381 | //echo "echo count is $count \n"; 382 | if($count > 0) 383 | { 384 | $update = "update sony_albumlist set Albumname='$Albumname',Grid='$Grid',DPID='$DPID',IPID='$IPID',xmlid='$srno',label='$label',release_date='$OriginalReleaseDate',movie_release_date='$OriginalReleaseDate',year='$Year',genre='$Genre',release_type='$releasetype' where catalog_number='$catalog_number' and ICPN = '$ICPN'"; 385 | // echo "$update \n"; 386 | if($this->query($update)){ 387 | $data = array('query'=>$update,'error'=>$mysqli->error,"line_number"=>__LINE__); 388 | file_put_contents('sony_xmllist.log',print_r($data,true),FILE_APPEND); 389 | } 390 | 391 | } 392 | else 393 | { 394 | 395 | $insert = "INSERT INTO sony_albumlist(Albumname,Grid,ICPN,DPID,IPID,xmlid,label,release_date,movie_release_date,year,genre,release_type,catalog_number) VALUES('$Albumname','$Grid','$ICPN','$DPID','$IPID','$srno','$label','$OriginalReleaseDate','$OriginalReleaseDate','$Year','$Genre','$releasetype','$catalog_number');"; 396 | if($this->query($insert)){ 397 | $data = array('query'=>$insert,'error'=>$mysqli->error,"line_number"=>__LINE__); 398 | file_put_contents('sony_xmllist.log',print_r($data,true),FILE_APPEND); 399 | } 400 | } 401 | } 402 | 403 | public function InsertMessageHeader($MessageHeaderData,$srno){ 404 | //return true; 405 | //print_r($MessageHeaderData);exit; 406 | $MessageThreadId = !empty($MessageHeaderData[0]['val'])? $this->real_escape_string($MessageHeaderData[0]['val']):null; 407 | $MessageId = !empty($MessageHeaderData[1]['val'])? $this->real_escape_string($MessageHeaderData[1]['val']):null; 408 | $MessageSenderId = !empty($MessageHeaderData[2]['val'][0]['val'])? $this->real_escape_string($MessageHeaderData[2]['val'][0]['val']):null; 409 | $MessageSenderName = !empty($MessageHeaderData[2]['val'][1]['val'][0]['val'])? $this->real_escape_string($MessageHeaderData[2]['val'][1]['val'][0]['val']):null; 410 | $MessageRecipientId = !empty($MessageHeaderData[3]['val'][0]['val'])? $this->real_escape_string($MessageHeaderData[3]['val'][0]['val']):null; 411 | $MessageRecipientName = !empty($MessageHeaderData[3]['val'][1]['val'][0]['val'])? $this->real_escape_string($MessageHeaderData[3]['val'][1]['val'][0]['val']):null; 412 | $MessageCreatedDateTime = !empty($MessageHeaderData[4]['val'])? $this->real_escape_string($MessageHeaderData[4]['val']):null; 413 | 414 | $update = "UPDATE sony_xmllist SET MessageThreadId='".$MessageThreadId."',MessageId='".$MessageId."',MessageSenderId='".$MessageSenderId."',MessageSenderName='".$MessageSenderName."',MessageRecipientId='".$MessageRecipientId."',MessageRecipientName='".$MessageRecipientName."',MessageCreatedDateTime='".$MessageCreatedDateTime."' WHERE srno='".$srno."'"; 415 | if($this->query($update)){ 416 | $data = array('query'=>$update,'error'=>$this->error); 417 | file_put_contents('sony_xmllist.log',print_r($data,true),FILE_APPEND); 418 | } 419 | } 420 | 421 | public function InsertResourceList($ResourceListData,$srno,$dir){ 422 | //return true; 423 | //print_r($ResourceListData);exit; 424 | $VideoType = null; 425 | $ISRC = null; 426 | $ResourceReference = null; 427 | $ReferenceTitle = null; 428 | $LanguageOfPerformance = null; 429 | $Duration = null; 430 | $Title = null; 431 | $Label = null; 432 | $ParentalWarningType = null; 433 | $Genre = null; 434 | $Year = null; 435 | $plinetext =null; 436 | 437 | $i=0; 438 | 439 | foreach($ResourceListData as $Video){ 440 | if($Video['name'] == "Video"){ 441 | foreach($Video['val'] as $val){ 442 | switch($val['name']){ 443 | case 'VideoType': 444 | $VideoType = $this->real_escape_string($val['val']); 445 | break; 446 | case 'VideoId': 447 | $ISRC = !empty($val['val'][0]['val'])? $this->real_escape_string($val['val'][0]['val']):null; 448 | break; 449 | case 'ResourceReference': 450 | $ResourceReference = $this->real_escape_string($val['val']); 451 | break; 452 | case 'ReferenceTitle': 453 | $ReferenceTitle = !empty($val['val'][0]['val'])? $this->real_escape_string($val['val'][0]['val']):null; 454 | break; 455 | case 'LanguageOfPerformance': 456 | $LanguageOfPerformance = $this->real_escape_string($val['val']); 457 | break; 458 | case 'Duration': 459 | $Duration = $this->real_escape_string($val['val']); 460 | break; 461 | case 'VideoDetailsByTerritory': 462 | foreach($val['val'] as $VideoDetails){ 463 | 464 | switch($VideoDetails['name']){ 465 | case "Title": 466 | $Title = !empty($VideoDetails['val'][0]['val'])? $this->real_escape_string($VideoDetails['val'][0]['val']):null; 467 | break; 468 | case "DisplayArtist": 469 | foreach($VideoDetails['val'] as $arrDA){ 470 | if($arrDA['name'] == 'PartyName'){ 471 | $DisplayArtist[$VideoDetails['atr']['SequenceNumber']]['PartyName'] = $arrDA['val'][0]['val']; 472 | } 473 | if($arrDA['name'] == 'ArtistRole'){ 474 | $DisplayArtist[$VideoDetails['atr']['SequenceNumber']]['ArtistRole'][] = $arrDA['val']; 475 | } 476 | } 477 | /*foreach($VideoDetails['val'] as $arrDA){ 478 | if($arrDA['name'] == "PartyName"){ 479 | foreach($arrDA['val'] as $PartyName){ 480 | $DisplayArtist[] = $PartyName["val"]; 481 | } 482 | } 483 | }*/ 484 | /*if(!empty($VideoDetails['val'][0]['val'][0]['val'])){ 485 | $DisplayArtist[] = $VideoDetails['val'][0]['val'][0]['val']; 486 | }*/ 487 | 488 | break; 489 | case "ResourceContributor": 490 | foreach($VideoDetails['val'] as $arrRC){ 491 | if($arrRC['name'] == 'PartyName'){ 492 | $ResourceContributor[$VideoDetails['atr']['SequenceNumber']]['PartyName'] = $arrRC['val'][0]['val']; 493 | } 494 | if($arrRC['name'] == 'ResourceContributorRole'){ 495 | $ResourceContributor[$VideoDetails['atr']['SequenceNumber']]['ResourceContributorRole'][] = !empty($arrRC['atr']['UserDefinedValue'])?$arrRC['atr']['UserDefinedValue']:$arrRC['val']; 496 | } 497 | } 498 | /*if(!empty($VideoDetails['val'][0]['val'][0]['val'])){ 499 | $UserDefinedValue = !empty($VideoDetails['val'][1]['atr']['UserDefinedValue'])? $this->real_escape_string($VideoDetails['val'][1]['atr']['UserDefinedValue']): $VideoDetails['val'][1]['val']; 500 | $ResourceContributor[$UserDefinedValue][] = $VideoDetails['val'][0]['val'][0]['val']; 501 | }*/ 502 | break; 503 | case "LabelName": 504 | $Label = $this->real_escape_string($VideoDetails['val']); 505 | break; 506 | case "ParentalWarningType": 507 | $ParentalWarningType = $this->real_escape_string($VideoDetails['val']); 508 | break; 509 | case "Genre": 510 | $Genre = $this->real_escape_string($VideoDetails['val'][0]['val']); 511 | break; 512 | case "PLine": 513 | $Year = $this->real_escape_string($VideoDetails['val'][0]['val']); 514 | $plinetext = $this->real_escape_string($VideoDetails['val'][1]['val']); 515 | break; 516 | case "TechnicalVideoDetails": 517 | foreach($VideoDetails['val'] as $techDetails){ 518 | $TechnicalVideoDetails[$ISRC][$techDetails['name']] = $techDetails['val']; 519 | } 520 | $i++; 521 | break; 522 | 523 | 524 | } 525 | } 526 | 527 | break; 528 | } 529 | } 530 | 531 | //$DisplayArtist = array_unique($DisplayArtist); 532 | //$Artist = !empty($DisplayArtist) ? $this->real_escape_string(implode(',', $DisplayArtist)) : null; 533 | unset($ArtistRole); 534 | $ArtistRole = array(); 535 | 536 | foreach($DisplayArtist as $resArt){ 537 | $DisPartyName = $resArt['PartyName']; 538 | foreach($resArt['ArtistRole'] as $resRole){ 539 | $ArtistRole[$resRole][] = $DisPartyName; 540 | } 541 | } 542 | 543 | $arrArtist = array(); 544 | if(!empty($ArtistRole['AssociatedPerformer']) || !empty($ArtistRole['MainArtist']) || !empty($ArtistRole['FeaturedArtist'])){ 545 | $arrArtist = array_merge( (array) $ArtistRole['AssociatedPerformer'], (array) $ArtistRole['MainArtist'], (array) $ArtistRole['FeaturedArtist']); 546 | } 547 | 548 | $Artist = ""; 549 | if(!empty($arrArtist)){ 550 | $arrArtist = array_unique($arrArtist); 551 | $Artist .= !empty($arrArtist) ? $this->real_escape_string(implode(',', $arrArtist)) : null; 552 | } 553 | 554 | 555 | foreach($ResourceContributor as $ResValue){ 556 | $ResPartyName = $ResValue['PartyName']; 557 | foreach($ResValue['ResourceContributorRole'] as $resRole){ 558 | $ArtistRole[$resRole][] = $ResPartyName; 559 | } 560 | } 561 | //print_r($ArtistRole);exit; 562 | $ArtistRole['Producer'] = array_unique($ArtistRole['Producer']); 563 | $ArtistRole['Composer'] = array_unique($ArtistRole['Composer']); 564 | $ArtistRole['Lyricist'] = array_unique($ArtistRole['Lyricist']); 565 | $ArtistRole['Actor'] = array_unique($ArtistRole['Actor']); 566 | 567 | $Actor = ""; 568 | if(!empty($ArtistRole['Actor'])){ 569 | $Actor .= !empty($ArtistRole['Actor']) ? $this->real_escape_string(implode(',', $ArtistRole['Actor'])) : null; 570 | } 571 | 572 | $Composer = ""; 573 | if(!empty($ArtistRole['Composer'])){ 574 | $Composer .= !empty($ArtistRole['Composer']) ? $this->real_escape_string(implode(',', $ArtistRole['Composer'])) : null; 575 | } 576 | 577 | $Lyricist = ""; 578 | if(!empty($ArtistRole['Lyricist'])){ 579 | $Lyricist .= !empty($ArtistRole['Lyricist']) ? $this->real_escape_string(implode(',', $ArtistRole['Lyricist'])) : null; 580 | } 581 | 582 | $Producer = ""; 583 | if(!empty($ArtistRole['Lyricist'])){ 584 | $Producer .= !empty($ArtistRole['Producer']) ? $this->real_escape_string(implode(',', $ArtistRole['Producer'])) : null; 585 | } 586 | 587 | $NumberOfChannels = !empty($TechnicalVideoDetails[$ISRC]['NumberOfChannels'])? $this->real_escape_string($TechnicalVideoDetails[$ISRC]['NumberOfChannels']):null; 588 | $SamplingRate = !empty($TechnicalVideoDetails[$ISRC]['SamplingRate'])? $this->real_escape_string($TechnicalVideoDetails[$ISRC]['SamplingRate']):null; 589 | $IsPreview = !empty($TechnicalVideoDetails[$ISRC]['IsPreview'])? $this->real_escape_string($TechnicalVideoDetails[$ISRC]['IsPreview']):null; 590 | $FileURL = !empty($TechnicalVideoDetails[$ISRC]['File'][0]['val'])? $this->real_escape_string($TechnicalVideoDetails[$ISRC]['File'][0]['val']):null; 591 | $HashSum = !empty($TechnicalVideoDetails[$ISRC]['File'][1]['val'][0]['val'])? $this->real_escape_string($TechnicalVideoDetails[$ISRC]['File'][1]['val'][0]['val']):null; 592 | $AudioCodecType =!empty($TechnicalVideoDetails[$ISRC]['AudioCodecType'])? $this->real_escape_string($TechnicalVideoDetails[$ISRC]['AudioCodecType']):null; 593 | 594 | $FileURL = $dir."/".$FilePath.$FileURL; 595 | 596 | $Process_status =0; 597 | $xmlid = $srno; 598 | $select = "select ISRC from sony_songlist where ISRC = '$ISRC' "; 599 | $result = $this->query($select); 600 | $count = $result->num_rows; 601 | echo "echo count is $count \n"; 602 | $count = 0; 603 | if($count > 0) 604 | { 605 | $update = "update sony_songlist set ResourceReference='$ResourceReference',ReferenceTitle='$ReferenceTitle',LanguageOfPerformance='$LanguageOfPerformance',Duration='$Duration',Title='$Title',Artist='$Artist',Producer='$Producer',Composer='$Composer',Lyricist='$Lyricist',Label='$Label',Year='$Year',plinetext='$plinetext',Genre='$Genre',ParentalWarningType='$ParentalWarningType',AudioCodecType='$AudioCodecType',NumberOfChannels='$NumberOfChannels',SamplingRate='$SamplingRate',IsPreview='$IsPreview',xmlid='$xmlid',FileURL='$FileURL',HashSum='$HashSum',Actor='$Actor' where ISRC='$ISRC' "; 606 | echo "$update \n"; 607 | $this->query($update); 608 | }else{ 609 | 610 | if(!empty($FileURL) && !empty($ISRC)){ 611 | $insert ="INSERT INTO sony_songlist(ISRC,ResourceReference,ReferenceTitle,LanguageOfPerformance,Duration,Title,Artist,Producer,Composer,Lyricist,Label,Year,plinetext,Genre,ParentalWarningType,AudioCodecType,NumberOfChannels,SamplingRate,IsPreview,FileURL,HashSum,Process_status,xmlid,Actor ) values ('$ISRC','$ResourceReference','$ReferenceTitle','$LanguageOfPerformance','$Duration','$Title','$Artist','$Producer','$Composer','$Lyricist','$Label','$Year','$plinetext','$Genre','$ParentalWarningType','$AudioCodecType','$NumberOfChannels','$SamplingRate','$IsPreview','$FileURL','$HashSum','$Process_status','$xmlid','$Actor' )"; 612 | if (!$this->query($insert)){ 613 | printf("Errormessage: %s\n", $this->error); 614 | $data = array('query'=>$insert,'error'=>$this->error,"line_number"=>__LINE__); 615 | file_put_contents('sony_xmllist.log',print_r($data,true),FILE_APPEND); 616 | } 617 | } 618 | } 619 | } 620 | if($Video['name'] == "Image"){ 621 | foreach($Video['val'] as $img){ 622 | switch($img["name"]){ 623 | case "ImageType": 624 | $imgarr["ImageType"] = $img['val']; 625 | break; 626 | case "ImageId": 627 | $imgarr["ImageId"] = $img['val'][0]['val']; 628 | break; 629 | case "ImageDetailsByTerritory": 630 | foreach($img['val'] as $ImageDetailsByTerritory){ 631 | switch($ImageDetailsByTerritory["name"]){ 632 | case "TerritoryCode": 633 | $imgarr["TerritoryCode"] = $ImageDetailsByTerritory["val"]; 634 | break; 635 | case "TechnicalImageDetails": 636 | foreach($ImageDetailsByTerritory["val"] as $TechnicalImageDetails){ 637 | $imgarr[$TechnicalImageDetails["name"]] = $TechnicalImageDetails["val"]; 638 | } 639 | 640 | break; 641 | } 642 | } 643 | break; 644 | } 645 | } 646 | 647 | 648 | if(!empty($imgarr['File'][0]['val'])){ 649 | 650 | $ImageURL = $dir."/".$imgarr['File'][1]['val'].$imgarr['File'][0]['val']; 651 | $update ="UPDATE sony_songlist SET ImageURL = '".$ImageURL."',ImageHashSum='".$imgarr['File'][1]['val'][0]['val']."',ImageCodecType='".$imgarr['ImageCodecType']."',ImageHeight='".$imgarr['ImageHeight']."',ImageWidth='".$imgarr['ImageWidth']."',ImageResolution='".$imgarr['ImageResolution']."' where xmlid='".$xmlid."'"; 652 | if (!$this->query($update)){ 653 | printf("Errormessage: %s\n", $mysqli->error); 654 | $data = array('query'=>$update,'error'=>$mysqli->error,"line_number"=>__LINE__); 655 | file_put_contents('sony_xmllist.log',print_r($data,true),FILE_APPEND); 656 | } 657 | 658 | } 659 | } 660 | 661 | } 662 | } 663 | 664 | public function xml2assoc(&$xml){ 665 | $assoc = NULL; 666 | $n = 0; 667 | while($xml->read()){ 668 | if($xml->nodeType == XMLReader::END_ELEMENT) break; 669 | if($xml->nodeType == XMLReader::ELEMENT and !$xml->isEmptyElement){ 670 | $assoc[$n]['name'] = $xml->name; 671 | if($xml->hasAttributes) while($xml->moveToNextAttribute()) $assoc[$n]['atr'][$xml->name] = $xml->value; 672 | $assoc[$n]['val'] = $this->xml2assoc($xml); 673 | $n++; 674 | } 675 | else if($xml->isEmptyElement){ 676 | $assoc[$n]['name'] = $xml->name; 677 | if($xml->hasAttributes) while($xml->moveToNextAttribute()) $assoc[$n]['atr'][$xml->name] = $xml->value; 678 | $assoc[$n]['val'] = ""; 679 | $n++; 680 | } 681 | else if($xml->nodeType == XMLReader::TEXT) $assoc = $xml->value; 682 | } 683 | return $assoc; 684 | } 685 | 686 | 687 | public function OutputXml($complete_xml){ 688 | echo "
";print_r($complete_xml);exit;	
689 | }
690 | 
691 | public function __destruct(){
692 | 	$this->close();
693 | } 
694 | }
695 | 
696 | $xmlParser = new SonyXmlParser();
697 | $xmlFiles = $xmlParser->ListXmlFilesRecursively();
698 | $xmlParser->ProcessSonyRawXML();
699 | 


--------------------------------------------------------------------------------
/SoundRecordingXMLParser.php:
--------------------------------------------------------------------------------
  1 | mysql_host, $this->mysql_user, $this->mysql_pass,$this->mysql_db);
 23 | 
 24 | 		if (mysqli_connect_error()) {
 25 | 			die('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
 26 | 		}
 27 | 	}
 28 | 
 29 | 	public function ListXmlFilesRecursively(){
 30 | 		$ite=new RecursiveDirectoryIterator($this->dirLocation,FilesystemIterator::SKIP_DOTS);
 31 |  		$exclude = array('logs');
 32 |                 $filter = function ($file, $key, $iterator) use ($exclude) {
 33 |                     if ($iterator->hasChildren() && !in_array($file->getFilename(), $exclude)) {
 34 |                         return true;
 35 |                     }
 36 |                     return $file->isFile();
 37 |                 };
 38 |                 $filter =  new RecursiveCallbackFilterIterator($ite, $filter);
 39 |                 $Iterator = new RecursiveIteratorIterator($filter);
 40 | 
 41 | 		//$Directory = new RecursiveDirectoryIterator($this->dirLocation,FilesystemIterator::SKIP_DOTS);
 42 | 		//$Iterator = new RecursiveIteratorIterator($Directory);
 43 | 		$RegexIterator = new RegexIterator($Iterator, '/^.+\.xml$/i', RecursiveRegexIterator::GET_MATCH);
 44 | 		$xmlFiles =array();
 45 | 		foreach($RegexIterator as $name => $object){
 46 | 			$dir = $this->destLocation."/".date('Ymd');
 47 | 			if( is_dir($dir) === false ) { mkdir($dir); }
 48 | 			$info = pathinfo($name);
 49 | 			$newfile = $dir."/".$info['basename'];
 50 | 			if(copy($name, $newfile)){
 51 | 				$insert = "INSERT INTO sony_xmllist(Filename,XML_status,Process_date) VALUE('".$info['basename']."',1,now())";
 52 | 				$this->query($insert);
 53 | 				unlink($name);
 54 | 			}
 55 | 			//unlink($name);
 56 | 			$xmlFiles[] = $name;
 57 | 		}
 58 | 
 59 | 		return $xmlFiles;
 60 | 	}
 61 | 
 62 | 	public function ProcessSonyRawXML(){
 63 | 		// WHERE Process_status is null"
 64 | 		$query = "SELECT srno,Filename,Process_date  FROM sony_xmllist where XML_status=1 and Process_status is null";
 65 | 		//$query = "SELECT srno,Filename,Process_date  FROM sony_xmllist where XML_status"; //-- For Testing
 66 | 		if ($result = $this->query($query)) {
 67 | 			while ($row = $result->fetch_assoc()) {
 68 | 				$foldername = date('Ymd',strtotime($row['Process_date']));
 69 | 				$xml = $this->destLocation.$foldername."/".$row['Filename'];
 70 | 				if(is_file($xml)){
 71 | 					$oXml = new XMLReader();
 72 | 					$oXml->open($xml);
 73 | 					echo $xml2assoc['Filename'] = $row['Filename'];
 74 | 					$xml2assoc['srno'] = $row['srno'];
 75 | 					$xml2assoc['Process_date'] = $row['Process_date'];
 76 | 					$xml2assoc['xml_data'] = $this->xml2assoc($oXml);
 77 | 					//print_r( $xml2assoc['xml_data']);exit;
 78 | 					if(!empty($xml2assoc['xml_data'][0]['val'])){
 79 | 						foreach($xml2assoc['xml_data'][0]['val'] as  $value){
 80 | 								
 81 | 							switch($value['name']){
 82 | 							       
 83 | 								case "MessageHeader":
 84 | 									$MessageHeaderData = $value['val'];
 85 | 								$this->InsertMessageHeader($MessageHeaderData,$xml2assoc['srno']);
 86 | 								break;
 87 | 								case "ResourceList":
 88 | 									$ResourceListData = $value['val'];
 89 | 								$this->InsertResourceList($ResourceListData,$xml2assoc['srno']);
 90 | 								break;
 91 | 								case "ReleaseList":
 92 | 									$ReleaseListData = $value['val'];
 93 | 								$this->InsertReleaseList($ReleaseListData,$xml2assoc['srno']);	    
 94 | 								break;
 95 | 								case "DealList":
 96 | 									$DealListData = $value['val'];
 97 | 								$this->InsertDealList($DealListData,$MessageHeaderData,$ResourceListData,$ReleaseListData,$xml2assoc['srno']);
 98 | 								break;
 99 | 								case "UpdateIndicator":
100 | 								$UpdateIndicator = $value['val'];
101 | 								break;
102 | 
103 | 							}
104 | 						}
105 | 					}
106 | 
107 | 					$oXml->close();
108 | 					$update ="update sony_xmllist set Process_status=1,update_indicator='$UpdateIndicator' where srno='".$row['srno']."'";
109 | 					$this->query($update);
110 | 				}
111 | 			}
112 | 			$result->free();
113 | 		}
114 | 	}
115 | 	public function InsertDealList($DealListData,$MessageHeaderData,$ResourceListData,$ReleaseListData,$srno){
116 | 		//return true;
117 | 		$party_id = !empty($MessageHeaderData[2]['val'][0]['val'])? $this->real_escape_string($MessageHeaderData[2]['val'][0]['val']):null;
118 | 		if(!$party_id){
119 | 			return false;
120 | 		}
121 | 		$sonyDeal = array();
122 | 		foreach($DealListData as $key=>$Deal){
123 | 			//			print_r($Deal);
124 | 			foreach($Deal['val'] as $innerDeal){
125 | 				if($innerDeal['name'] == "DealReleaseReference"){
126 | 					$sonyDeal[$key]["DealReleaseReference"][] = $innerDeal['val'];
127 | 				}
128 | 				//	if($innerDeal['name'] == 'Deal'){
129 | 				//		foreach($innerDeal['val'][0]['val'] as $DealTerms){
130 | 				//			 $sonyDeal[$key][$DealTerms['name']] = $DealTerms['val'];
131 | 				//		}
132 | 				//	}
133 | 				if($innerDeal['name'] == 'Deal'){
134 | 					foreach($innerDeal['val'][0]['val'] as $DealTerms){
135 | 
136 | 						//			print_r($DealTerms);						
137 | 						$temp_name = $DealTerms['name'];
138 | 						//				echo "name is $temp_name \n";
139 | 						//	$modelarray = $DealTerms[0];
140 | 						if($temp_name == 'Usage')
141 | 						{
142 | 							$usagearray = array();
143 | 							foreach($DealTerms['val'] as $usage  )
144 | 							{
145 | 								echo "hi \n";
146 | 								$usagearray[] = $usage['val'] ;
147 | 								//print_r($usagearray);
148 | 							}
149 | 							//print_r($usagearray);
150 | 							$usagetype = implode(' / ',$usagearray);
151 | 
152 | 
153 | 							//	$usagearray[] = $DealTerms['val'][0];
154 | 						}
155 | 						if($temp_name == 'CommercialModelType')
156 | 						{
157 | 							$commercial = $DealTerms['val'];
158 | 						}
159 | 						if($temp_name == 'TerritoryCode')
160 | 						{
161 | 							$territory = $DealTerms['val'];
162 | 						}
163 | 						if($temp_name == 'ValidityPeriod')
164 | 						{
165 | 							$validaityarray = $DealTerms['val'];
166 | 						}
167 | 						if($temp_name == 'TakeDown')
168 | 						{
169 | 							$takedown = $DealTerms['val'];
170 | 						}
171 | 
172 | 						//						$usagetype = implode(' / ',$usagearray);
173 | 
174 | 						$startdate =  $validaityarray[0]['val'];
175 | 						$data['TerritoryCode']= $territory ;
176 | 						$data['Usage'] = $usagetype;
177 | 						$data['StartDate'] = $startdate;
178 | 						$data['TakeDown'] = $takedown;
179 | 
180 | 
181 | 						$final_deal[$commercial] = $data;
182 | 
183 | 
184 | 						//	$territoryarray = $DealTerms[2];
185 | 						//	$validityarray = $DealTerms[3];
186 | 						//						print_r($usagearray);
187 | 						//$sonyDeal[$key][$DealTerms['name']] = $DealTerms['val'];
188 | 						$sonyDeal[$key]['Deal'] = $final_deal;
189 | 					}
190 | 				}
191 | 
192 | 
193 | 				if($innerDeal['name'] == 'EffectiveDate'){
194 | 					$sonyDeal[$key]['EffectiveDate'] = $innerDeal['val'];
195 | 				}
196 | 
197 | 			}
198 | 		}
199 | 		//		print_r($sonyDeal);
200 | 		/*foreach($ResourceListData as $SoundRecording){
201 | 		  if($SoundRecording['name'] == "SoundRecording"){
202 | 		  foreach($SoundRecording['val'] as $val){
203 | 		  }
204 | 		  }
205 | 		  }*/
206 | 
207 | 		$Release = array();	
208 | 		foreach($ReleaseListData as $key=>$RData){
209 | 			foreach($RData['val'] as $ReleaseVal){
210 | 				if(is_array($ReleaseVal['val'])){
211 | 					foreach($ReleaseVal['val'] as $RData2){
212 | 						$Release[$key][$RData2['name']] = $RData2['val'];
213 | 					}
214 | 				}else{
215 | 					$Release[$key][$ReleaseVal['name']] = $ReleaseVal['val'];
216 | 				}
217 | 			}
218 | 		}
219 | 
220 | 		foreach($Release as $insert_data){
221 | 			//print_r($insert_data);
222 | 			//exit;
223 | 			$catalog_number = $this->real_escape_string($Release[0]['CatalogNumber']);
224 | 			$ipcn = $this->real_escape_string($Release[0]['ICPN']);
225 | 			$grid = $this->real_escape_string($insert_data['GRid']);
226 | 			$isrc = $this->real_escape_string($insert_data['ISRC']);
227 | 			$artist = $this->real_escape_string($insert_data['DisplayArtistName']);
228 | 			$title = $this->real_escape_string($insert_data['TitleText']);
229 | 			$release_type = $this->real_escape_string($insert_data['ReleaseType']);
230 | 
231 | 			$commercial_type = "";
232 | 			$use_type ="";
233 | 			$territories ="";
234 | 			$price_value_code="";
235 | 			$sales_start_date="";
236 | 			$sales_end_date="";
237 | 			foreach($sonyDeal as $deal){
238 | 				if(in_array($insert_data['ReleaseReference'],$deal["DealReleaseReference"])){
239 | 
240 | 
241 | 					$deal_type = $deal['Deal'];
242 | 
243 | 					foreach($deal_type as $key => $deal_basedupon_commercialmodel)
244 | 					{
245 | 						//		if($catalog_number=='G010000244373P')
246 | 						//		{
247 | 
248 | 						//			echo "key is $key \n";
249 | 						//		print_r($deal_basedupon_commercialmodel);
250 | 						//		}
251 | 						//	echo "$key \n";
252 | 						$commercial_type = $key;
253 | 						$use_type = $deal_basedupon_commercialmodel['Usage'];
254 | 						$territories = $deal_basedupon_commercialmodel['TerritoryCode'];
255 | 						$takedown = !empty($deal_basedupon_commercialmodel['TakeDown'])?$deal_basedupon_commercialmodel['TakeDown']:false;
256 | 						$sales_start_date =$deal_basedupon_commercialmodel['StartDate'];
257 | 						if($takedown)
258 | 						{
259 | 
260 | 							$sales_end_date = $sales_start_date;
261 | 						}
262 | 
263 | 						$xmlid = $srno;
264 | 						$inserted_date = date('Y-m-d H:i:s');
265 | 
266 | 						//if(trim($commercial_type)=='')
267 | 						if($takedown == 'true')
268 | 						{
269 | 							//							echo "take down is $takedown\n";
270 | 
271 | 							$update = "update sony_xml_output_1 set party_id='$party_id',catalog_number='$catalog_number',grid='$grid',artist='$artist',title='$title',release_type='$release_type',commercial_type='',use_type='',territories='',price_value_code='$price_value_code',sales_start_date='',sales_end_date='$sales_end_date',updated_date='$inserted_date',xmlid='$xmlid' where isrc='$isrc'  and  catalog_number='$catalog_number'";
272 | 							//							echo "$update \n";
273 | 							$this->query($update);
274 | 							//$count = 0;
275 | 							//$need_to_insert = false;
276 | 
277 | 						}
278 | 						else
279 | 						{
280 | 							$select = "select isrc  from sony_xml_output_1 where isrc = '$isrc' and catalog_number='$catalog_number' and commercial_type='$commercial_type'";
281 | 							$result  = $this->query($select);
282 | 							$count = $result->num_rows;
283 | 							//	}
284 | 							if($count > 0  )
285 | 							{
286 | 								$update = "update sony_xml_output_1 set party_id='$party_id',catalog_number='$catalog_number',grid='$grid',artist='$artist',title='$title',release_type='$release_type',commercial_type='$commercial_type',use_type='$use_type',territories='$territories',price_value_code='$price_value_code',sales_start_date='$sales_start_date',sales_end_date='$sales_end_date',updated_date='$inserted_date',xmlid='$xmlid' where isrc='$isrc' and  catalog_number='$catalog_number' and commercial_type='$commercial_type'";
287 | 								$this->query($update);
288 | 
289 | 
290 | 							}
291 | 							else
292 | 							{
293 | 								echo "insert ,takedown is  $takedown \n";
294 | 								$insert = "INSERT INTO sony_xml_output_1(party_id,catalog_number,ipcn,grid,isrc,artist,title,release_type,commercial_type,use_type,territories,price_value_code,sales_start_date,sales_end_date,xmlid,inserted_date)
295 | 									values('$party_id','$catalog_number','$ipcn','$grid','$isrc','$artist','$title','$release_type','$commercial_type','$use_type','$territories','$price_value_code','$sales_start_date','$sales_end_date','$xmlid','$inserted_date')";
296 | 								$this->query($insert);
297 | 
298 | 
299 | 							}
300 | 					}
301 | 
302 | 
303 | 				}
304 | 
305 | 			}
306 | 		}
307 | 		//	$xmlid = $srno;
308 | 		//	$inserted_date = date('Y-m-d H:i:s');
309 | 		//	$select = "select isrc  from sony_xml_output_1 where isrc = '$isrc' and catalog_number='$catalog_number'";
310 | 		//	$result  = $this->query($select);
311 | 		//	$count = $result->num_rows;	
312 | 		//	if($count > 0)
313 | 		//	{
314 | 		//		$update = "update sony_xml_output_1 set party_id='$party_id',catalog_number='$catalog_number',grid='$grid',artist='$artist',title='$title',release_type='$release_type',commercial_type='$commercial_type',use_type='$use_type',territories='$territories',price_value_code='$price_value_code',sales_start_date='$sales_start_date',sales_end_date='$sales_end_date',updated_date='$inserted_date' where isrc='$isrc' and ipcn='$ipcn'";
315 | 		//	//this->query($update);
316 | 		//	}
317 | 		//		else
318 | 		//		{
319 | 		//		$insert = "INSERT INTO sony_xml_output_1(party_id,catalog_number,ipcn,grid,isrc,artist,title,release_type,commercial_type,use_type,territories,price_value_code,sales_start_date,sales_end_date,xmlid,inserted_date)
320 | 		//		values('$party_id','$catalog_number','$ipcn','$grid','$isrc','$artist','$title','$release_type','$commercial_type','$use_type','$territories','$price_value_code','$sales_start_date','$sales_end_date','$xmlid','$inserted_date')";
321 | 		//	$this->query($insert);
322 | 		//		}
323 | 	}	
324 | }
325 | 
326 | 
327 | 
328 | 
329 | 
330 | 
331 | 
332 | 
333 | 
334 | 
335 | 
336 | 
337 | 
338 | 
339 | 
340 | public function InsertReleaseList($ReleaseListData,$srno){
341 | 	//return true;
342 | 	$temp_count = count($ReleaseListData);
343 | 	echo "count is $temp_count \n";
344 | 	//exit;
345 | 	//var_dump($ReleaseListData);
346 | 	//exit;
347 | 	$AlbumDetails= array();
348 | 	$temp = $ReleaseListData[0]['val'] ;
349 | 	$temp1 =  $temp[4];
350 | 	$releasetype = !empty( $temp1['val'])? $this->real_escape_string($temp1['val']):null; ;
351 | 	//var_dump($temp1);
352 | 	//exit;
353 | 	foreach($ReleaseListData[0]['val'] as $Release){
354 | 		if(is_array($Release['val'])){
355 | 			foreach($Release['val'] as $arr){
356 | 				if($arr['name']=='CatalogNumber'){
357 | 					$AlbumDetails['DPID'] = str_replace("DPID:","",$arr['atr']['Namespace']);
358 | 				}
359 | 				$AlbumDetails[$arr['name']] = $arr['val'];	
360 | 			}
361 | 		}else{
362 | 			$AlbumDetails[$Release['name']] = $Release['val'];
363 | 		}
364 | 	}
365 | 	$Albumname = !empty($AlbumDetails['TitleText'])? $this->real_escape_string($AlbumDetails['TitleText']):null;
366 | 	$Grid = !empty($AlbumDetails['GRid'])? $this->real_escape_string($AlbumDetails['GRid']):null;
367 | 	$ICPN = !empty($AlbumDetails['ICPN'])? $this->real_escape_string($AlbumDetails['ICPN']):null;
368 | 	$DPID = !empty($AlbumDetails['DPID'])? $this->real_escape_string($AlbumDetails['DPID']):null;
369 | 	$IPID = !empty($AlbumDetails['ProprietaryId'])? $this->real_escape_string(str_replace("IPID:","",$AlbumDetails['ProprietaryId'])):null;
370 | 	$label = !empty($AlbumDetails['LabelName'])? $this->real_escape_string($AlbumDetails['LabelName']):null;
371 | 	$OriginalReleaseDate = !empty($AlbumDetails['OriginalReleaseDate'])? $this->real_escape_string($AlbumDetails['OriginalReleaseDate']):null;
372 | 	$Year = !empty($AlbumDetails['Year'])? $this->real_escape_string($AlbumDetails['Year']):null;
373 | 	$Genre = !empty($AlbumDetails['Genre'][0]['val'])? $this->real_escape_string($AlbumDetails['Genre'][0]['val']):null;
374 | 	//		$release_type = !empty($AlbumDetails[''][0]['val'])? $this->real_escape_string($AlbumDetails['Genre'][0]['val']):null;
375 | 	$catalog_number = !empty($AlbumDetails['catalognumber'][0]['val'])? $this->real_escape_string($AlbumDetails['Genre'][0]['val']):null;
376 | 
377 | 	$select = "select ICPN  from sony_albumlist  where ICPN = '$ICPN' and catalog_number='$catalog_number'";
378 | 	//echo "select ICPN  from sony_albumlist  where ICPN = '$ICPN' and catalog_number='$catalog_number' \n";
379 | 	$result  = $this->query($select);
380 | 	$count = $result->num_rows;
381 | 	//echo    "echo count is  $count \n";
382 | 	if($count > 0)
383 | 	{
384 | 		$update = "update sony_albumlist set Albumname='$Albumname',Grid='$Grid',DPID='$DPID',IPID='$IPID',xmlid='$srno',label='$label',release_date='$OriginalReleaseDate',movie_release_date='$OriginalReleaseDate',year='$Year',genre='$Genre',release_type='$releasetype' where catalog_number='$catalog_number' and ICPN = '$ICPN'";
385 | 		//			echo "$update \n";
386 | 		if($this->query($update)){
387 | 			$data = array('query'=>$update,'error'=>$mysqli->error,"line_number"=>__LINE__);
388 | 			file_put_contents('sony_xmllist.log',print_r($data,true),FILE_APPEND);
389 | 		}
390 | 
391 | 	}
392 | 	else
393 | 	{
394 | 
395 | 		$insert = "INSERT INTO sony_albumlist(Albumname,Grid,ICPN,DPID,IPID,xmlid,label,release_date,movie_release_date,year,genre,release_type,catalog_number) VALUES('$Albumname','$Grid','$ICPN','$DPID','$IPID','$srno','$label','$OriginalReleaseDate','$OriginalReleaseDate','$Year','$Genre','$releasetype','$catalog_number');";
396 | 		if($this->query($insert)){
397 | 			$data = array('query'=>$insert,'error'=>$mysqli->error,"line_number"=>__LINE__);
398 | 			file_put_contents('sony_xmllist.log',print_r($data,true),FILE_APPEND);
399 | 		}
400 | 	}
401 | }
402 | 
403 | public function InsertMessageHeader($MessageHeaderData,$srno){
404 | 	//return true;
405 | 	//print_r($MessageHeaderData);exit;
406 | 	$MessageThreadId = !empty($MessageHeaderData[0]['val'])? $this->real_escape_string($MessageHeaderData[0]['val']):null;
407 | 	$MessageId = !empty($MessageHeaderData[1]['val'])? $this->real_escape_string($MessageHeaderData[1]['val']):null;
408 | 	$MessageSenderId = !empty($MessageHeaderData[2]['val'][0]['val'])? $this->real_escape_string($MessageHeaderData[2]['val'][0]['val']):null;
409 | 	$MessageSenderName = !empty($MessageHeaderData[2]['val'][1]['val'][0]['val'])? $this->real_escape_string($MessageHeaderData[2]['val'][1]['val'][0]['val']):null;
410 | 	$MessageRecipientId = !empty($MessageHeaderData[3]['val'][0]['val'])? $this->real_escape_string($MessageHeaderData[3]['val'][0]['val']):null;
411 | 	$MessageRecipientName = !empty($MessageHeaderData[3]['val'][1]['val'][0]['val'])? $this->real_escape_string($MessageHeaderData[3]['val'][1]['val'][0]['val']):null;
412 | 	$MessageCreatedDateTime = !empty($MessageHeaderData[4]['val'])? $this->real_escape_string($MessageHeaderData[4]['val']):null;
413 | 
414 | 	$update = "UPDATE  sony_xmllist SET MessageThreadId='".$MessageThreadId."',MessageId='".$MessageId."',MessageSenderId='".$MessageSenderId."',MessageSenderName='".$MessageSenderName."',MessageRecipientId='".$MessageRecipientId."',MessageRecipientName='".$MessageRecipientName."',MessageCreatedDateTime='".$MessageCreatedDateTime."' WHERE srno='".$srno."'";
415 | 	if($this->query($update)){
416 | 		$data = array('query'=>$update,'error'=>$this->error);
417 | 		file_put_contents('sony_xmllist.log',print_r($data,true),FILE_APPEND);
418 | 	}
419 | }
420 | 
421 | public function InsertResourceList($ResourceListData,$srno){
422 | 	//return true;
423 | 	//print_r($ResourceListData);exit;
424 | 	$SoundRecordingType = null;
425 | 	$ISRC = null;
426 | 	$ResourceReference = null;
427 | 	$ReferenceTitle = null;
428 | 	$LanguageOfPerformance = null;
429 | 	$Duration = null;
430 | 	$Title = null;
431 | 	$Label = null;
432 | 	$ParentalWarningType = null;
433 | 	$Genre = null;
434 | 	$Year = null;
435 | 	$plinetext =null;
436 | 
437 | 	$i=0;
438 | 
439 | 	foreach($ResourceListData as $SoundRecording){
440 | 		if($SoundRecording['name'] == "SoundRecording"){
441 | 			foreach($SoundRecording['val'] as $val){
442 | 				switch($val['name']){
443 | 					case 'SoundRecordingType':
444 | 						$SoundRecordingType = $this->real_escape_string($val['val']); 
445 | 						break;
446 | 					case 'SoundRecordingId':
447 | 						$ISRC = !empty($val['val'][0]['val'])? $this->real_escape_string($val['val'][0]['val']):null;
448 | 						break;
449 | 					case 'ResourceReference':
450 | 						$ResourceReference = $this->real_escape_string($val['val']);
451 | 						break;
452 | 					case 'ReferenceTitle':
453 | 						$ReferenceTitle = !empty($val['val'][0]['val'])? $this->real_escape_string($val['val'][0]['val']):null;
454 | 						break;
455 | 					case 'LanguageOfPerformance':
456 | 						$LanguageOfPerformance = $this->real_escape_string($val['val']);
457 | 						break;
458 | 					case 'Duration':
459 | 						$Duration = $this->real_escape_string($val['val']);
460 | 						break;
461 | 					case 'SoundRecordingDetailsByTerritory':
462 | 						foreach($val['val'] as $SoundRecordingDetails){
463 | 
464 | 							switch($SoundRecordingDetails['name']){
465 | 								case "Title":
466 | 									$Title = !empty($SoundRecordingDetails['val'][0]['val'])? $this->real_escape_string($SoundRecordingDetails['val'][0]['val']):null;
467 | 								break;
468 | 								case "DisplayArtist":
469 | 									foreach($SoundRecordingDetails['val'] as $arrDA){
470 | 										if($arrDA['name'] == 'PartyName'){
471 | 											$DisplayArtist[$SoundRecordingDetails['atr']['SequenceNumber']]['PartyName'] = $arrDA['val'][0]['val'];
472 | 										}
473 | 										if($arrDA['name'] == 'ArtistRole'){
474 | 											$DisplayArtist[$SoundRecordingDetails['atr']['SequenceNumber']]['ArtistRole'][] = $arrDA['val'];
475 | 										}
476 | 									}
477 | 								/*foreach($SoundRecordingDetails['val'] as $arrDA){
478 | 								  if($arrDA['name'] == "PartyName"){
479 | 								  foreach($arrDA['val'] as $PartyName){
480 | 								  $DisplayArtist[] = $PartyName["val"];
481 | 								  }
482 | 								  }
483 | 								  }*/
484 | 								/*if(!empty($SoundRecordingDetails['val'][0]['val'][0]['val'])){
485 | 								  $DisplayArtist[] = $SoundRecordingDetails['val'][0]['val'][0]['val'];
486 | 								  }*/
487 | 
488 | 								break;
489 | 								case "ResourceContributor":
490 | 									foreach($SoundRecordingDetails['val'] as $arrRC){
491 | 										if($arrRC['name'] == 'PartyName'){
492 | 											$ResourceContributor[$SoundRecordingDetails['atr']['SequenceNumber']]['PartyName'] = $arrRC['val'][0]['val'];
493 | 										}
494 | 										if($arrRC['name'] == 'ResourceContributorRole'){
495 | 											$ResourceContributor[$SoundRecordingDetails['atr']['SequenceNumber']]['ResourceContributorRole'][] = !empty($arrRC['atr']['UserDefinedValue'])?$arrRC['atr']['UserDefinedValue']:$arrRC['val'];
496 | 										}
497 | 									}
498 | 								/*if(!empty($SoundRecordingDetails['val'][0]['val'][0]['val'])){
499 | 								  $UserDefinedValue = !empty($SoundRecordingDetails['val'][1]['atr']['UserDefinedValue'])? $this->real_escape_string($SoundRecordingDetails['val'][1]['atr']['UserDefinedValue']): $SoundRecordingDetails['val'][1]['val'];
500 | 								  $ResourceContributor[$UserDefinedValue][] = $SoundRecordingDetails['val'][0]['val'][0]['val'];
501 | 								  }*/
502 | 								break;
503 | 								case "LabelName":
504 | 									$Label = $this->real_escape_string($SoundRecordingDetails['val']);
505 | 								break;
506 | 								case "ParentalWarningType":
507 | 									$ParentalWarningType = $this->real_escape_string($SoundRecordingDetails['val']);
508 | 								break;
509 | 								case "Genre":
510 | 									$Genre = $this->real_escape_string($SoundRecordingDetails['val'][0]['val']);
511 | 								break;
512 | 								case "PLine":
513 | 									$Year = $this->real_escape_string($SoundRecordingDetails['val'][0]['val']);
514 | 								$plinetext = $this->real_escape_string($SoundRecordingDetails['val'][1]['val']);
515 | 								break;
516 | 								case "TechnicalSoundRecordingDetails":
517 | 									foreach($SoundRecordingDetails['val'] as $techDetails){
518 | 										$TechnicalSoundRecordingDetails[$ISRC][$techDetails['name']] = $techDetails['val'];	
519 | 									}
520 | 								$i++;
521 | 								break;
522 | 
523 | 
524 | 							}
525 | 						}
526 | 
527 | 						break;
528 | 				}
529 | 			}
530 | 
531 | 			//$DisplayArtist = array_unique($DisplayArtist);
532 | 			//$Artist = !empty($DisplayArtist) ? $this->real_escape_string(implode(',', $DisplayArtist)) : null;
533 | 			unset($ArtistRole);
534 | 			$ArtistRole = array();
535 | 
536 | 			foreach($DisplayArtist as $resArt){
537 | 				$DisPartyName = $resArt['PartyName'];
538 | 				foreach($resArt['ArtistRole'] as $resRole){
539 | 					$ArtistRole[$resRole][] = $DisPartyName;
540 | 				}
541 | 			}
542 | 
543 | 			$arrArtist = array();
544 | 			if(!empty($ArtistRole['AssociatedPerformer']) || !empty($ArtistRole['MainArtist']) || !empty($ArtistRole['FeaturedArtist'])){
545 | 				$arrArtist = array_merge(   (array) $ArtistRole['AssociatedPerformer'],  (array) $ArtistRole['MainArtist'],  (array) $ArtistRole['FeaturedArtist']);
546 | 			}
547 | 
548 | 			$Artist = "";
549 | 			if(!empty($arrArtist)){
550 | 				$arrArtist = array_unique($arrArtist);
551 | 				$Artist .= !empty($arrArtist) ? $this->real_escape_string(implode(',', $arrArtist)) : null;
552 | 			}
553 | 
554 | 
555 | 			foreach($ResourceContributor as $ResValue){
556 | 				$ResPartyName = $ResValue['PartyName'];
557 | 				foreach($ResValue['ResourceContributorRole'] as $resRole){
558 | 					$ArtistRole[$resRole][] = $ResPartyName;
559 | 				}
560 | 			}
561 | 			//print_r($ArtistRole);exit;
562 | 			$ArtistRole['Producer'] = array_unique($ArtistRole['Producer']);
563 | 			$ArtistRole['Composer'] = array_unique($ArtistRole['Composer']);
564 | 			$ArtistRole['Lyricist'] = array_unique($ArtistRole['Lyricist']);
565 | 			$ArtistRole['Actor'] = array_unique($ArtistRole['Actor']);
566 | 
567 | 			$Actor = "";
568 | 			if(!empty($ArtistRole['Actor'])){
569 | 				$Actor .= !empty($ArtistRole['Actor']) ? $this->real_escape_string(implode(',', $ArtistRole['Actor'])) : null;
570 | 			}
571 | 
572 | 			$Composer = "";
573 | 			if(!empty($ArtistRole['Composer'])){
574 | 				$Composer .= !empty($ArtistRole['Composer']) ? $this->real_escape_string(implode(',', $ArtistRole['Composer'])) : null;
575 | 			}
576 | 
577 | 			$Lyricist = "";
578 | 			if(!empty($ArtistRole['Lyricist'])){
579 | 				$Lyricist .= !empty($ArtistRole['Lyricist']) ? $this->real_escape_string(implode(',', $ArtistRole['Lyricist'])) : null;
580 | 			}
581 | 
582 | 			$Producer = "";
583 | 			if(!empty($ArtistRole['Lyricist'])){
584 | 				$Producer .= !empty($ArtistRole['Producer']) ? $this->real_escape_string(implode(',', $ArtistRole['Producer'])) : null;
585 | 			}
586 | 
587 | 			$NumberOfChannels = !empty($TechnicalSoundRecordingDetails[$ISRC]['NumberOfChannels'])? $this->real_escape_string($TechnicalSoundRecordingDetails[$ISRC]['NumberOfChannels']):null;
588 | 			$SamplingRate  = !empty($TechnicalSoundRecordingDetails[$ISRC]['SamplingRate'])? $this->real_escape_string($TechnicalSoundRecordingDetails[$ISRC]['SamplingRate']):null;
589 | 			$IsPreview  = !empty($TechnicalSoundRecordingDetails[$ISRC]['IsPreview'])? $this->real_escape_string($TechnicalSoundRecordingDetails[$ISRC]['IsPreview']):null;
590 | 			$FileURL  = !empty($TechnicalSoundRecordingDetails[$ISRC]['File'][0]['val'])? $this->real_escape_string($TechnicalSoundRecordingDetails[$ISRC]['File'][0]['val']):null;
591 | 			$HashSum  = !empty($TechnicalSoundRecordingDetails[$ISRC]['File'][1]['val'][0]['val'])? $this->real_escape_string($TechnicalSoundRecordingDetails[$ISRC]['File'][1]['val'][0]['val']):null;
592 | 			$AudioCodecType  =!empty($TechnicalSoundRecordingDetails[$ISRC]['AudioCodecType'])? $this->real_escape_string($TechnicalSoundRecordingDetails[$ISRC]['AudioCodecType']):null; 
593 | 
594 | 			$Process_status =0;
595 | 			$xmlid = $srno;
596 | 			$select = "select  ISRC  from sony_songlist where ISRC = '$ISRC' ";
597 | 			$result  = $this->query($select);
598 | 			$count = $result->num_rows;
599 | 			echo    "echo count is  $count \n";
600 | 			$count = 0;
601 | 			if($count > 0)
602 | 			{
603 | 				$update = "update sony_songlist set ResourceReference='$ResourceReference',ReferenceTitle='$ReferenceTitle',LanguageOfPerformance='$LanguageOfPerformance',Duration='$Duration',Title='$Title',Artist='$Artist',Producer='$Producer',Composer='$Composer',Lyricist='$Lyricist',Label='$Label',Year='$Year',plinetext='$plinetext',Genre='$Genre',ParentalWarningType='$ParentalWarningType',AudioCodecType='$AudioCodecType',NumberOfChannels='$NumberOfChannels',SamplingRate='$SamplingRate',IsPreview='$IsPreview',xmlid='$xmlid',FileURL='$FileURL',HashSum='$HashSum',Actor='$Actor' where ISRC='$ISRC' ";
604 | 				echo "$update \n";
605 | 				$this->query($update);
606 | 			}else{
607 | 
608 | 				if(!empty($FileURL) && !empty($ISRC)){
609 | 					$insert ="INSERT INTO sony_songlist(ISRC,ResourceReference,ReferenceTitle,LanguageOfPerformance,Duration,Title,Artist,Producer,Composer,Lyricist,Label,Year,plinetext,Genre,ParentalWarningType,AudioCodecType,NumberOfChannels,SamplingRate,IsPreview,FileURL,HashSum,Process_status,xmlid,Actor ) values ('$ISRC','$ResourceReference','$ReferenceTitle','$LanguageOfPerformance','$Duration','$Title','$Artist','$Producer','$Composer','$Lyricist','$Label','$Year','$plinetext','$Genre','$ParentalWarningType','$AudioCodecType','$NumberOfChannels','$SamplingRate','$IsPreview','$FileURL','$HashSum','$Process_status','$xmlid','$Actor' )";
610 | 					if (!$this->query($insert)){
611 | 						printf("Errormessage: %s\n", $this->error);
612 | 						$data = array('query'=>$insert,'error'=>$this->error,"line_number"=>__LINE__);
613 | 						file_put_contents('sony_xmllist.log',print_r($data,true),FILE_APPEND);
614 | 					}
615 | 				}
616 | 			}
617 | 		}
618 | 		if($SoundRecording['name'] == "Image"){
619 | 			foreach($SoundRecording['val'] as $img){
620 | 				switch($img["name"]){
621 | 					case "ImageType":
622 | 						$imgarr["ImageType"] = $img['val'];
623 | 					break;
624 | 					case "ImageId":
625 | 						$imgarr["ImageId"] = $img['val'][0]['val'];
626 | 					break;
627 | 					case "ImageDetailsByTerritory":
628 | 						foreach($img['val'] as $ImageDetailsByTerritory){
629 | 							switch($ImageDetailsByTerritory["name"]){
630 | 								case "TerritoryCode":
631 | 									$imgarr["TerritoryCode"] = $ImageDetailsByTerritory["val"];
632 | 								break;
633 | 								case "TechnicalImageDetails":
634 | 									foreach($ImageDetailsByTerritory["val"] as $TechnicalImageDetails){
635 | 										$imgarr[$TechnicalImageDetails["name"]] = $TechnicalImageDetails["val"];			
636 | 									}
637 | 
638 | 								break;
639 | 							}
640 | 						}
641 | 					break;
642 | 				}
643 | 			}
644 | 			if(!empty($imgarr['File'][0]['val'])){
645 | 				$update ="UPDATE sony_songlist SET ImageURL = '".$imgarr['File'][0]['val']."',ImageHashSum='".$imgarr['File'][1]['val'][0]['val']."',ImageCodecType='".$imgarr['ImageCodecType']."',ImageHeight='".$imgarr['ImageHeight']."',ImageWidth='".$imgarr['ImageWidth']."',ImageResolution='".$imgarr['ImageResolution']."' where xmlid='".$xmlid."'";
646 | 				if (!$this->query($update)){
647 | 					printf("Errormessage: %s\n", $mysqli->error);
648 | 					$data = array('query'=>$update,'error'=>$mysqli->error,"line_number"=>__LINE__);
649 | 					file_put_contents('sony_xmllist.log',print_r($data,true),FILE_APPEND);
650 | 				}
651 | 
652 | 			}
653 | 		}
654 | 
655 | 	}
656 | }
657 | 
658 | public function xml2assoc(&$xml){ 
659 | 	$assoc = NULL; 
660 | 	$n = 0; 
661 | 	while($xml->read()){ 
662 | 		if($xml->nodeType == XMLReader::END_ELEMENT) break; 
663 | 		if($xml->nodeType == XMLReader::ELEMENT and !$xml->isEmptyElement){ 
664 | 			$assoc[$n]['name'] = $xml->name; 
665 | 			if($xml->hasAttributes) while($xml->moveToNextAttribute()) $assoc[$n]['atr'][$xml->name] = $xml->value; 
666 | 			$assoc[$n]['val'] = $this->xml2assoc($xml); 
667 | 			$n++; 
668 | 		} 
669 | 		else if($xml->isEmptyElement){ 
670 | 			$assoc[$n]['name'] = $xml->name; 
671 | 			if($xml->hasAttributes) while($xml->moveToNextAttribute()) $assoc[$n]['atr'][$xml->name] = $xml->value; 
672 | 			$assoc[$n]['val'] = ""; 
673 | 			$n++;                
674 | 		} 
675 | 		else if($xml->nodeType == XMLReader::TEXT) $assoc = $xml->value; 
676 | 	} 
677 | 	return $assoc; 
678 | }
679 | 
680 | 
681 | public function OutputXml($complete_xml){
682 | 	echo "
";print_r($complete_xml);exit;	
683 | }
684 | 
685 | public function __destruct(){
686 | 	$this->close();
687 | } 
688 | }
689 | 
690 | $xmlParser = new SonyXmlParser();
691 | $xmlFiles = $xmlParser->ListXmlFilesRecursively();
692 | $xmlParser->ProcessSonyRawXML();
693 | 


--------------------------------------------------------------------------------
/db.sql:
--------------------------------------------------------------------------------
  1 | -- Adminer 4.2.1 MySQL dump
  2 | 
  3 | SET NAMES utf8;
  4 | SET time_zone = '+00:00';
  5 | SET foreign_key_checks = 0;
  6 | SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
  7 | 
  8 | DROP TABLE IF EXISTS `iso_693_2_codes`;
  9 | CREATE TABLE `iso_693_2_codes` (
 10 |   `srno` int(11) NOT NULL AUTO_INCREMENT,
 11 |   `iso_693_2_5` varchar(10) DEFAULT NULL,
 12 |   `iso_693_1` varchar(10) DEFAULT NULL,
 13 |   `language_name` varchar(50) DEFAULT NULL,
 14 |   `scope` varchar(50) DEFAULT NULL,
 15 |   `type` varchar(50) DEFAULT NULL,
 16 |   `iso_693_3` varchar(10) DEFAULT NULL,
 17 |   PRIMARY KEY (`srno`)
 18 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 19 | 
 20 | INSERT INTO `iso_693_2_codes` (`srno`, `iso_693_2_5`, `iso_693_1`, `language_name`, `scope`, `type`, `iso_693_3`) VALUES
 21 | (1,	'abk',	'ab',	'Abkhazian',	'Individual',	'Living',	'abk'),
 22 | (2,	'ace',	'',	'Achinese',	'Individual',	'Living',	'ace'),
 23 | (3,	'ach',	'',	'Acoli',	'Individual',	'Living',	'ach'),
 24 | (4,	'ada',	'',	'Adangme',	'Individual',	'Living',	'ada'),
 25 | (5,	'ady',	'',	'Adyghe',	'Individual',	'Living',	'ady'),
 26 | (6,	'aar',	'aa',	'Afar',	'Individual',	'Living',	'aar'),
 27 | (7,	'afh',	'',	'Afrihili',	'Individual',	'Constructed',	'afh'),
 28 | (8,	'afr',	'af',	'Afrikaans',	'Individual',	'Living',	'afr'),
 29 | (9,	'afa',	'',	'Afro-Asiatic languages',	'Collective',	'',	''),
 30 | (10,	'ain',	'',	'Ainu (Japan)',	'Individual',	'Living',	'ain'),
 31 | (11,	'aka',	'ak',	'Akan',	'Macrolanguage',	'Living',	'aka'),
 32 | (12,	'akk',	'',	'Akkadian',	'Individual',	'Ancient',	'akk'),
 33 | (13,	'aqa',	'',	'Alacalufan languages',	'Collective',	'',	''),
 34 | (14,	'alb* / sqi',	'sq',	'Albanian',	'Macrolanguage',	'Living',	'sqi'),
 35 | (15,	'sqi / alb*',	'sq',	'Albanian',	'Macrolanguage',	'Living',	'sqi'),
 36 | (16,	'sqi',	'',	'Albanian languages',	'Collective',	'',	''),
 37 | (17,	'ale',	'',	'Aleut',	'Individual',	'Living',	'ale'),
 38 | (18,	'aql',	'',	'Algic languages',	'Collective',	'',	''),
 39 | (19,	'alg',	'',	'Algonquian languages',	'Collective',	'',	''),
 40 | (20,	'tut',	'',	'Altaic languages',	'Collective',	'',	''),
 41 | (21,	'amh',	'am',	'Amharic',	'Individual',	'Living',	'amh'),
 42 | (22,	'grc',	'',	'Ancient Greek (to 1453)',	'Individual',	'Historical',	'grc'),
 43 | (23,	'anp',	'',	'Angika',	'Individual',	'Living',	'anp'),
 44 | (24,	'apa',	'',	'Apache languages',	'Collective',	'',	''),
 45 | (25,	'ara',	'ar',	'Arabic',	'Macrolanguage',	'Living',	'ara'),
 46 | (26,	'arg',	'an',	'Aragonese',	'Individual',	'Living',	'arg'),
 47 | (27,	'arp',	'',	'Arapaho',	'Individual',	'Living',	'arp'),
 48 | (28,	'auf',	'',	'Arauan languages',	'Collective',	'',	''),
 49 | (29,	'arw',	'',	'Arawak',	'Individual',	'Living',	'arw'),
 50 | (30,	'awd',	'',	'Arawakan languages',	'Collective',	'',	''),
 51 | (31,	'arm* / hye',	'hy',	'Armenian',	'Individual',	'Living',	'hye'),
 52 | (32,	'hye / arm*',	'hy',	'Armenian',	'Individual',	'Living',	'hye'),
 53 | (33,	'hyx',	'',	'Armenian (family)',	'Collective',	'',	''),
 54 | (34,	'art',	'',	'Artificial languages',	'Collective',	'',	''),
 55 | (35,	'asm',	'as',	'Assamese',	'Individual',	'Living',	'asm'),
 56 | (36,	'ast',	'',	'Asturian',	'Individual',	'Living',	'ast'),
 57 | (37,	'ath',	'',	'Athapascan languages',	'Collective',	'',	''),
 58 | (38,	'alv',	'',	'Atlantic-Congo languages',	'Collective',	'',	''),
 59 | (39,	'aus',	'',	'Australian languages',	'Collective',	'',	''),
 60 | (40,	'aav',	'',	'Austro-Asiatic languages',	'Collective',	'',	''),
 61 | (41,	'map',	'',	'Austronesian languages',	'Collective',	'',	''),
 62 | (42,	'ava',	'av',	'Avaric',	'Individual',	'Living',	'ava'),
 63 | (43,	'ave',	'ae',	'Avestan',	'Individual',	'Ancient',	'ave'),
 64 | (44,	'awa',	'',	'Awadhi',	'Individual',	'Living',	'awa'),
 65 | (45,	'aym',	'ay',	'Aymara',	'Macrolanguage',	'Living',	'aym'),
 66 | (46,	'aze',	'az',	'Azerbaijani',	'Macrolanguage',	'Living',	'aze'),
 67 | (47,	'ban',	'',	'Balinese',	'Individual',	'Living',	'ban'),
 68 | (48,	'bat',	'',	'Baltic languages',	'Collective',	'',	''),
 69 | (49,	'bal',	'',	'Baluchi',	'Macrolanguage',	'Living',	'bal'),
 70 | (50,	'bam',	'bm',	'Bambara',	'Individual',	'Living',	'bam'),
 71 | (51,	'bai',	'',	'Bamileke languages',	'Collective',	'',	''),
 72 | (52,	'bad',	'',	'Banda languages',	'Collective',	'',	''),
 73 | (53,	'bnt',	'',	'Bantu languages',	'Collective',	'',	''),
 74 | (54,	'bas',	'',	'Basa (Cameroon)',	'Individual',	'Living',	'bas'),
 75 | (55,	'bak',	'ba',	'Bashkir',	'Individual',	'Living',	'bak'),
 76 | (56,	'baq* / eus',	'eu',	'Basque',	'Individual',	'Living',	'eus'),
 77 | (57,	'eus / baq*',	'eu',	'Basque',	'Individual',	'Living',	'eus'),
 78 | (58,	'euq',	'',	'Basque (family)',	'Collective',	'',	''),
 79 | (59,	'btk',	'',	'Batak languages',	'Collective',	'',	''),
 80 | (60,	'bej',	'',	'Beja',	'Individual',	'Living',	'bej'),
 81 | (61,	'bel',	'be',	'Belarusian',	'Individual',	'Living',	'bel'),
 82 | (62,	'bem',	'',	'Bemba (Zambia)',	'Individual',	'Living',	'bem'),
 83 | (63,	'ben',	'bn',	'Bengali',	'Individual',	'Living',	'ben'),
 84 | (64,	'ber',	'',	'Berber languages',	'Collective',	'',	''),
 85 | (65,	'bho',	'',	'Bhojpuri',	'Individual',	'Living',	'bho'),
 86 | (66,	'bih',	'bh',	'Bihari languages',	'Collective',	'',	''),
 87 | (67,	'bik',	'',	'Bikol',	'Macrolanguage',	'Living',	'bik'),
 88 | (68,	'byn',	'',	'Bilin',	'Individual',	'Living',	'byn'),
 89 | (69,	'bin',	'',	'Bini',	'Individual',	'Living',	'bin'),
 90 | (70,	'bis',	'bi',	'Bislama',	'Individual',	'Living',	'bis'),
 91 | (71,	'zbl',	'',	'Blissymbols',	'Individual',	'Constructed',	'zbl'),
 92 | (72,	'bos',	'bs',	'Bosnian',	'Individual',	'Living',	'bos'),
 93 | (73,	'bra',	'',	'Braj',	'Individual',	'Living',	'bra'),
 94 | (74,	'bre',	'br',	'Breton',	'Individual',	'Living',	'bre'),
 95 | (75,	'bug',	'',	'Buginese',	'Individual',	'Living',	'bug'),
 96 | (76,	'bul',	'bg',	'Bulgarian',	'Individual',	'Living',	'bul'),
 97 | (77,	'bua',	'',	'Buriat',	'Macrolanguage',	'Living',	'bua'),
 98 | (78,	'bur* / mya',	'my',	'Burmese',	'Individual',	'Living',	'mya'),
 99 | (79,	'mya / bur*',	'my',	'Burmese',	'Individual',	'Living',	'mya'),
100 | (80,	'cad',	'',	'Caddo',	'Individual',	'Living',	'cad'),
101 | (81,	'cha',	'ch',	'Chamorro',	'Individual',	'Living',	'cha'),
102 | (82,	'chy',	'',	'Cheyenne',	'Individual',	'Living',	'chy'),
103 | (83,	'chb',	'',	'Chibcha',	'Individual',	'Extinct',	'chb'),
104 | (84,	'cba',	'',	'Chibchan languages',	'Collective',	'',	''),
105 | (85,	'chi* / zho',	'zh',	'Chinese',	'Macrolanguage',	'Living',	'zho'),
106 | (86,	'cho',	'',	'Choctaw',	'Individual',	'Living',	'cho'),
107 | (87,	'sdv',	'',	'Eastern Sudanic languages',	'Collective',	'',	''),
108 | (88,	'efi',	'',	'Efik',	'Individual',	'Living',	'efi'),
109 | (89,	'egy',	'',	'Egyptian (Ancient)',	'Individual',	'Ancient',	'egy'),
110 | (90,	'egx',	'',	'Egyptian languages',	'Collective',	'',	''),
111 | (91,	'eka',	'',	'Ekajuk',	'Individual',	'Living',	'eka'),
112 | (92,	'elx',	'',	'Elamite',	'Individual',	'Ancient',	'elx'),
113 | (93,	'eng',	'en',	'English',	'Individual',	'Living',	'eng'),
114 | (94,	'cpe',	'',	'English based Creoles and pidgins',	'Collective',	'',	''),
115 | (95,	'myv',	'',	'Erzya',	'Individual',	'Living',	'myv'),
116 | (96,	'esx',	'',	'Eskimo-Aleut languages',	'Collective',	'',	''),
117 | (97,	'epo',	'eo',	'Esperanto',	'Individual',	'Constructed',	'epo'),
118 | (98,	'est',	'et',	'Estonian',	'Macrolanguage',	'Living',	'est'),
119 | (99,	'ewe',	'ee',	'Ewe',	'Individual',	'Living',	'ewe'),
120 | (100,	'ewo',	'',	'Ewondo',	'Individual',	'Living',	'ewo'),
121 | (101,	'fan',	'',	'Fang (Equatorial Guinea)',	'Individual',	'Living',	'fan'),
122 | (102,	'fat',	'',	'Fanti',	'Individual',	'Living',	'fat'),
123 | (103,	'fao',	'fo',	'Faroese',	'Individual',	'Living',	'fao'),
124 | (104,	'fij',	'fj',	'Fijian',	'Individual',	'Living',	'fij'),
125 | (105,	'fiu',	'',	'Finno-Ugrian languages',	'Collective',	'',	''),
126 | (106,	'fon',	'',	'Fon',	'Individual',	'Living',	'fon'),
127 | (107,	'fox',	'',	'Formosan languages',	'Collective',	'',	''),
128 | (108,	'fra / fre*',	'fr',	'French',	'Individual',	'Living',	'fra'),
129 | (109,	'fre* / fra',	'fr',	'French',	'Individual',	'Living',	'fra'),
130 | (110,	'cpf',	'',	'French-Based Creoles and pidgins',	'Collective',	'',	''),
131 | (111,	'fur',	'',	'Friulian',	'Individual',	'Living',	'fur'),
132 | (112,	'ful',	'ff',	'Fulah',	'Macrolanguage',	'Living',	'ful'),
133 | (113,	'gaa',	'',	'Ga',	'Individual',	'Living',	'gaa'),
134 | (114,	'car',	'',	'Galibi Carib',	'Individual',	'Living',	'car'),
135 | (115,	'glg',	'gl',	'Galician',	'Individual',	'Living',	'glg'),
136 | (116,	'lug',	'lg',	'Ganda',	'Individual',	'Living',	'lug'),
137 | (117,	'gay',	'',	'Gayo',	'Individual',	'Living',	'gay'),
138 | (118,	'gba',	'',	'Gbaya (Central African Republic)',	'Macrolanguage',	'Living',	'gba'),
139 | (119,	'gez',	'',	'Geez',	'Individual',	'Ancient',	'gez'),
140 | (120,	'geo* / kat',	'ka',	'Georgian',	'Individual',	'Living',	'kat'),
141 | (121,	'kat / geo*',	'ka',	'Georgian',	'Individual',	'Living',	'kat'),
142 | (122,	'deu / ger*',	'de',	'German',	'Individual',	'Living',	'deu'),
143 | (123,	'ger* / deu',	'de',	'German',	'Individual',	'Living',	'deu'),
144 | (124,	'gem',	'',	'Germanic languages',	'Collective',	'',	''),
145 | (125,	'gil',	'',	'Gilbertese',	'Individual',	'Living',	'gil'),
146 | (126,	'gon',	'',	'Gondi',	'Macrolanguage',	'Living',	'gon'),
147 | (127,	'gor',	'',	'Gorontalo',	'Individual',	'Living',	'gor'),
148 | (128,	'got',	'',	'Gothic',	'Individual',	'Ancient',	'got'),
149 | (129,	'grb',	'',	'Grebo',	'Macrolanguage',	'Living',	'grb'),
150 | (130,	'grk',	'',	'Greek languages',	'Collective',	'',	''),
151 | (131,	'grn',	'gn',	'Guarani',	'Macrolanguage',	'Living',	'grn'),
152 | (132,	'guj',	'gu',	'Gujarati',	'Individual',	'Living',	'guj'),
153 | (133,	'gwi',	'',	'Gwich?in',	'Individual',	'Living',	'gwi'),
154 | (134,	'hai',	'',	'Haida',	'Macrolanguage',	'Living',	'hai'),
155 | (135,	'hat',	'ht',	'Haitian',	'Individual',	'Living',	'hat'),
156 | (136,	'hau',	'ha',	'Hausa',	'Individual',	'Living',	'hau'),
157 | (137,	'haw',	'',	'Hawaiian',	'Individual',	'Living',	'haw'),
158 | (138,	'heb',	'he',	'Hebrew',	'Individual',	'Living',	'heb'),
159 | (139,	'her',	'hz',	'Herero',	'Individual',	'Living',	'her'),
160 | (140,	'hil',	'',	'Hiligaynon',	'Individual',	'Living',	'hil'),
161 | (141,	'him',	'',	'Himachali languages',	'Collective',	'',	''),
162 | (142,	'hin',	'hi',	'Hindi',	'Individual',	'Living',	'hin'),
163 | (143,	'hmo',	'ho',	'Hiri Motu',	'Individual',	'Living',	'hmo'),
164 | (144,	'hit',	'',	'Hittite',	'Individual',	'Ancient',	'hit'),
165 | (145,	'hmn',	'',	'Hmong',	'Macrolanguage',	'Living',	'hmn'),
166 | (146,	'hmx',	'',	'Hmong-Mien languages',	'Collective',	'',	''),
167 | (147,	'hok',	'',	'Hokan languages',	'Collective',	'',	''),
168 | (148,	'hun',	'hu',	'Hungarian',	'Individual',	'Living',	'hun'),
169 | (149,	'hup',	'',	'Hupa',	'Individual',	'Living',	'hup'),
170 | (150,	'iba',	'',	'Iban',	'Individual',	'Living',	'iba'),
171 | (151,	'ice* / isl',	'is',	'Icelandic',	'Individual',	'Living',	'isl'),
172 | (152,	'isl / ice*',	'is',	'Icelandic',	'Individual',	'Living',	'isl'),
173 | (153,	'ido',	'io',	'Ido',	'Individual',	'Constructed',	'ido'),
174 | (154,	'ibo',	'ig',	'Igbo',	'Individual',	'Living',	'ibo'),
175 | (155,	'ijo',	'',	'Ijo languages',	'Collective',	'',	''),
176 | (156,	'ilo',	'',	'Iloko',	'Individual',	'Living',	'ilo'),
177 | (157,	'smn',	'',	'Inari Sami',	'Individual',	'Living',	'smn'),
178 | (158,	'inc',	'',	'Indic languages',	'Collective',	'',	''),
179 | (159,	'ine',	'',	'Indo-European languages',	'Collective',	'',	''),
180 | (160,	'iir',	'',	'Indo-Iranian languages',	'Collective',	'',	''),
181 | (161,	'ind',	'id',	'Indonesian',	'Individual',	'Living',	'ind'),
182 | (162,	'inh',	'',	'Ingush',	'Individual',	'Living',	'inh'),
183 | (163,	'ina',	'ia',	'Interlingua (International Auxiliary Language Asso',	'Individual',	'Constructed',	'ina'),
184 | (164,	'kan',	'kn',	'Kannada',	'Individual',	'Living',	'kan'),
185 | (165,	'kas',	'ks',	'Kashmiri',	'Individual',	'Living',	'kas'),
186 | (166,	'csb',	'',	'Kashubian',	'Individual',	'Living',	'csb'),
187 | (167,	'kaw',	'',	'Kawi',	'Individual',	'Ancient',	'kaw'),
188 | (168,	'kua',	'kj',	'Kuanyama',	'Individual',	'Living',	'kua'),
189 | (169,	'kum',	'',	'Kumyk',	'Individual',	'Living',	'kum'),
190 | (170,	'kur',	'ku',	'Kurdish',	'Macrolanguage',	'Living',	'kur'),
191 | (171,	'kru',	'',	'Kurukh',	'Individual',	'Living',	'kru'),
192 | (172,	'kut',	'',	'Kutenai',	'Individual',	'Living',	'kut'),
193 | (173,	'lad',	'',	'Ladino',	'Individual',	'Living',	'lad'),
194 | (174,	'lah',	'',	'Lahnda',	'Macrolanguage',	'Living',	'lah'),
195 | (175,	'lao',	'lo',	'Lao',	'Individual',	'Living',	'lao'),
196 | (176,	'lat',	'la',	'Latin',	'Individual',	'Ancient',	'lat'),
197 | (177,	'lav',	'lv',	'Latvian',	'Macrolanguage',	'Living',	'lav'),
198 | (178,	'jbo',	'',	'Lojban',	'Individual',	'Constructed',	'jbo'),
199 | (179,	'nds',	'',	'Low German',	'Individual',	'Living',	'nds'),
200 | (180,	'dsb',	'',	'Lower Sorbian',	'Individual',	'Living',	'dsb'),
201 | (181,	'loz',	'',	'Lozi',	'Individual',	'Living',	'loz'),
202 | (182,	'lub',	'lu',	'Luba-Katanga',	'Individual',	'Living',	'lub'),
203 | (183,	'lua',	'',	'Luba-Lulua',	'Individual',	'Living',	'lua'),
204 | (184,	'lui',	'',	'Luiseno',	'Individual',	'Living',	'lui'),
205 | (185,	'smj',	'',	'Lule Sami',	'Individual',	'Living',	'smj'),
206 | (186,	'lun',	'',	'Lunda',	'Individual',	'Living',	'lun'),
207 | (187,	'luo',	'',	'Luo (Kenya and Tanzania)',	'Individual',	'Living',	'luo'),
208 | (188,	'lus',	'',	'Lushai',	'Individual',	'Living',	'lus'),
209 | (189,	'ltz',	'lb',	'Luxembourgish',	'Individual',	'Living',	'ltz'),
210 | (190,	'rup',	'',	'Macedo-Romanian',	'Individual',	'Living',	'rup'),
211 | (191,	'mac* / mkd',	'mk',	'Macedonian',	'Individual',	'Living',	'mkd'),
212 | (192,	'poz',	'',	'Malayo-Polynesian languages',	'Collective',	'',	''),
213 | (193,	'mdr',	'',	'Mandar',	'Individual',	'Living',	'mdr'),
214 | (194,	'mni',	'',	'Manipuri',	'Individual',	'Living',	'mni'),
215 | (195,	'mno',	'',	'Manobo languages',	'Collective',	'',	''),
216 | (196,	'glv',	'gv',	'Manx',	'Individual',	'Living',	'glv'),
217 | (197,	'myn',	'',	'Mayan languages',	'Collective',	'',	''),
218 | (198,	'mos',	'',	'Mossi',	'Individual',	'Living',	'mos'),
219 | (199,	'mul',	'',	'Multiple languages',	'Special',	'',	'mul'),
220 | (200,	'nyo',	'',	'Nyoro',	'Individual',	'Living',	'nyo'),
221 | (201,	'nzi',	'',	'Nzima',	'Individual',	'Living',	'nzi'),
222 | (202,	'oci',	'oc',	'Occitan (post 1500)',	'Individual',	'Living',	'oci'),
223 | (203,	'ori',	'or',	'Odiya (macrolanguage)',	'Macrolanguage',	'Living',	'ori'),
224 | (204,	'arc',	'',	'Official Aramaic (700-300 BCE)',	'Individual',	'Ancient',	'arc'),
225 | (205,	'oji',	'oj',	'Ojibwa',	'Macrolanguage',	'Living',	'oji'),
226 | (206,	'ang',	'',	'Old English (ca. 450-1100)',	'Individual',	'Historical',	'ang'),
227 | (207,	'fro',	'',	'Old French (842-ca. 1400)',	'Individual',	'Historical',	'fro'),
228 | (208,	'goh',	'',	'Old High German (ca. 750-1050)',	'Individual',	'Historical',	'goh'),
229 | (209,	'sga',	'',	'Old Irish (to 900)',	'Individual',	'Historical',	'sga'),
230 | (210,	'non',	'',	'Old Norse',	'Individual',	'Historical',	'non'),
231 | (211,	'peo',	'',	'Old Persian (ca. 600-400 B.C.)',	'Individual',	'Historical',	'peo'),
232 | (212,	'pro',	'',	'Old Provençal (to 1500)',	'Individual',	'Historical',	'pro'),
233 | (213,	'omv',	'',	'Omotic languages',	'Collective',	'',	''),
234 | (214,	'orm',	'om',	'Oromo',	'Macrolanguage',	'Living',	'orm'),
235 | (215,	'osa',	'',	'Osage',	'Individual',	'Living',	'osa'),
236 | (216,	'oto',	'',	'Otomian languages',	'Collective',	'',	''),
237 | (217,	'ota',	'',	'Ottoman Turkish (1500-1928)',	'Individual',	'Historical',	'ota'),
238 | (218,	'pal',	'',	'Pahlavi',	'Individual',	'Ancient',	'pal'),
239 | (219,	'pau',	'',	'Palauan',	'Individual',	'Living',	'pau'),
240 | (220,	'pli',	'pi',	'Pali',	'Individual',	'Ancient',	'pli'),
241 | (221,	'pam',	'',	'Pampanga',	'Individual',	'Living',	'pam'),
242 | (222,	'pag',	'',	'Pangasinan',	'Individual',	'Living',	'pag'),
243 | (223,	'pan',	'pa',	'Panjabi',	'Individual',	'Living',	'pan'),
244 | (224,	'pap',	'',	'Papiamento',	'Individual',	'Living',	'pap'),
245 | (225,	'paa',	'',	'Papuan languages',	'Collective',	'',	''),
246 | (226,	'phn',	'',	'Phoenician',	'Individual',	'Ancient',	'phn'),
247 | (227,	'por',	'pt',	'Portuguese',	'Individual',	'Living',	'por'),
248 | (228,	'cpp',	'',	'Portuguese-Based Creoles and pidgins',	'Collective',	'',	''),
249 | (229,	'raj',	'',	'Rajasthani',	'Macrolanguage',	'Living',	'raj'),
250 | (230,	'rap',	'',	'Rapanui',	'Individual',	'Living',	'rap'),
251 | (231,	'rar',	'',	'Rarotongan',	'Individual',	'Living',	'rar'),
252 | (232,	'sal',	'',	'Salishan languages',	'Collective',	'',	''),
253 | (233,	'sam',	'',	'Samaritan Aramaic',	'Individual',	'Extinct',	'sam'),
254 | (234,	'smi',	'',	'Sami languages',	'Collective',	'',	''),
255 | (235,	'smo',	'sm',	'Samoan',	'Individual',	'Living',	'smo'),
256 | (236,	'sag',	'sg',	'Sango',	'Individual',	'Living',	'sag'),
257 | (237,	'san',	'sa',	'Sanskrit',	'Individual',	'Ancient',	'san'),
258 | (238,	'sat',	'',	'Santali',	'Individual',	'Living',	'sat'),
259 | (239,	'srd',	'sc',	'Sardinian',	'Macrolanguage',	'Living',	'srd'),
260 | (240,	'sas',	'',	'Sasak',	'Individual',	'Living',	'sas'),
261 | (241,	'sco',	'',	'Scots',	'Individual',	'Living',	'sco'),
262 | (242,	'gla',	'gd',	'Scottish Gaelic',	'Individual',	'Living',	'gla'),
263 | (243,	'sel',	'',	'Selkup',	'Individual',	'Living',	'sel'),
264 | (244,	'sem',	'',	'Semitic languages',	'Collective',	'',	''),
265 | (245,	'shn',	'',	'Shan',	'Individual',	'Living',	'shn'),
266 | (246,	'sgn',	'',	'Sign languages',	'Collective',	'',	''),
267 | (247,	'bla',	'',	'Siksika',	'Individual',	'Living',	'bla'),
268 | (248,	'sit',	'',	'Sino-Tibetan languages',	'Collective',	'',	''),
269 | (249,	'sio',	'',	'Siouan languages',	'Collective',	'',	''),
270 | (250,	'sms',	'',	'Skolt Sami',	'Individual',	'Living',	'sms'),
271 | (251,	'slk / slo*',	'sk',	'Slovak',	'Individual',	'Living',	'slk'),
272 | (252,	'slv',	'sl',	'Slovenian',	'Individual',	'Living',	'slv'),
273 | (253,	'sog',	'',	'Sogdian',	'Individual',	'Ancient',	'sog'),
274 | (254,	'sus',	'',	'Susu',	'Individual',	'Living',	'sus'),
275 | (255,	'swa',	'sw',	'Swahili (macrolanguage)',	'Macrolanguage',	'Living',	'swa'),
276 | (256,	'syr',	'',	'Syriac',	'Macrolanguage',	'Living',	'syr'),
277 | (257,	'tgl',	'tl',	'Tagalog',	'Individual',	'Living',	'tgl'),
278 | (258,	'tam',	'ta',	'Tamil',	'Individual',	'Living',	'tam'),
279 | (259,	'tat',	'tt',	'Tatar',	'Individual',	'Living',	'tat'),
280 | (260,	'tel',	'te',	'Telugu',	'Individual',	'Living',	'tel'),
281 | (261,	'ter',	'',	'Tereno',	'Individual',	'Living',	'ter'),
282 | (262,	'tet',	'',	'Tetum',	'Individual',	'Living',	'tet'),
283 | (263,	'tha',	'th',	'Thai',	'Individual',	'Living',	'tha'),
284 | (264,	'bod / tib*',	'bo',	'Tibetan',	'Individual',	'Living',	'bod'),
285 | (265,	'tib* / bod',	'bo',	'Tibetan',	'Individual',	'Living',	'bod'),
286 | (266,	'tbq',	'',	'Tibeto-Burman languages',	'Collective',	'',	''),
287 | (267,	'urd',	'ur',	'Urdu',	'Individual',	'Living',	'urd'),
288 | (268,	'vai',	'',	'Vai',	'Individual',	'Living',	'vai'),
289 | (269,	'ven',	've',	'Venda',	'Individual',	'Living',	'ven'),
290 | (270,	'vie',	'vi',	'Vietnamese',	'Individual',	'Living',	'vie'),
291 | (271,	'vol',	'vo',	'Volapük',	'Individual',	'Constructed',	'vol'),
292 | (272,	'vot',	'',	'Votic',	'Individual',	'Living',	'vot'),
293 | (273,	'wak',	'',	'Wakashan languages',	'Collective',	'',	''),
294 | (274,	'wln',	'wa',	'Walloon',	'Individual',	'Living',	'wln'),
295 | (275,	'war',	'',	'Waray (Philippines)',	'Individual',	'Living',	'war'),
296 | (276,	'was',	'',	'Washo',	'Individual',	'Living',	'was'),
297 | (277,	'cym / wel*',	'cy',	'Welsh',	'Individual',	'Living',	'cym'),
298 | (278,	'wel* / cym',	'cy',	'Welsh',	'Individual',	'Living',	'cym'),
299 | (279,	'gmw',	'',	'West Germanic languages',	'Collective',	'',	''),
300 | (280,	'zlw',	'',	'West Slavic languages',	'Collective',	'',	''),
301 | (281,	'fry',	'fy',	'Western Frisian',	'Individual',	'Living',	'fry'),
302 | (282,	'pqw',	'',	'Western Malayo-Polynesian languages',	'Collective',	'',	''),
303 | (283,	'wal',	'',	'Wolaytta',	'Individual',	'Living',	'wal'),
304 | (284,	'wol',	'wo',	'Wolof',	'Individual',	'Living',	'wol'),
305 | (285,	'xho',	'xh',	'Xhosa',	'Individual',	'Living',	'xho'),
306 | (286,	'sah',	'',	'Yakut',	'Individual',	'Living',	'sah'),
307 | (287,	'yao',	'',	'Yao',	'Individual',	'Living',	'yao'),
308 | (288,	'yap',	'',	'Yapese',	'Individual',	'Living',	'yap'),
309 | (289,	'yid',	'yi',	'Yiddish',	'Macrolanguage',	'Living',	'yid'),
310 | (290,	'yor',	'yo',	'Yoruba',	'Individual',	'Living',	'yor'),
311 | (291,	'ypk',	'',	'Yupik languages',	'Collective',	'',	''),
312 | (292,	'znd',	'',	'Zande languages',	'Collective',	'',	''),
313 | (293,	'zap',	'',	'Zapotec',	'Macrolanguage',	'Living',	'zap'),
314 | (294,	'zza',	'',	'Zaza',	'Macrolanguage',	'Living',	'zza'),
315 | (295,	'zen',	'',	'Zenaga',	'Individual',	'Living',	'zen'),
316 | (296,	'zha',	'za',	'Zhuang',	'Macrolanguage',	'Living',	'zha'),
317 | (297,	'zul',	'zu',	'Zulu',	'Individual',	'Living',	'zul'),
318 | (298,	'zun',	'',	'Zuni',	'Individual',	'Living',	'zun'),
319 | (299,	NULL,	'AA',	'Afar',	NULL,	NULL,	NULL),
320 | (300,	NULL,	'AB',	'Abkhazian',	NULL,	NULL,	NULL),
321 | (301,	NULL,	'AE',	'Avestan',	NULL,	NULL,	NULL),
322 | (302,	NULL,	'AF',	'Afrikaans',	NULL,	NULL,	NULL),
323 | (303,	NULL,	'AK',	'Akan',	NULL,	NULL,	NULL),
324 | (304,	NULL,	'AM',	'Amharic',	NULL,	NULL,	NULL),
325 | (305,	NULL,	'AN',	'Aragonese',	NULL,	NULL,	NULL),
326 | (306,	NULL,	'AR',	'Arabic',	NULL,	NULL,	NULL),
327 | (307,	NULL,	'AS',	'Assamese',	NULL,	NULL,	NULL),
328 | (308,	NULL,	'AV',	'Avaric',	NULL,	NULL,	NULL),
329 | (309,	NULL,	'AY',	'Aymara',	NULL,	NULL,	NULL),
330 | (310,	NULL,	'AZ',	'Azerbaijani',	NULL,	NULL,	NULL),
331 | (311,	NULL,	'BA',	'Bashkir',	NULL,	NULL,	NULL),
332 | (312,	NULL,	'BE',	'Belarusian',	NULL,	NULL,	NULL),
333 | (313,	NULL,	'BG',	'Bulgarian',	NULL,	NULL,	NULL),
334 | (314,	NULL,	'BH',	'Bihari',	NULL,	NULL,	NULL),
335 | (315,	NULL,	'BI',	'Bislama',	NULL,	NULL,	NULL),
336 | (316,	NULL,	'BM',	'Bambara',	NULL,	NULL,	NULL),
337 | (317,	NULL,	'BN',	'Bengali',	NULL,	NULL,	NULL),
338 | (318,	NULL,	'BO',	'Tibetan',	NULL,	NULL,	NULL),
339 | (319,	NULL,	'BR',	'Breton',	NULL,	NULL,	NULL),
340 | (320,	NULL,	'BS',	'Bosnian',	NULL,	NULL,	NULL),
341 | (321,	NULL,	'CA',	'Catalan or Valencian',	NULL,	NULL,	NULL),
342 | (322,	NULL,	'CE',	'Chechen',	NULL,	NULL,	NULL),
343 | (323,	NULL,	'CH',	'Chamorro',	NULL,	NULL,	NULL),
344 | (324,	NULL,	'CO',	'Corsican',	NULL,	NULL,	NULL),
345 | (325,	NULL,	'CR',	'Cree',	NULL,	NULL,	NULL),
346 | (326,	NULL,	'CS',	'Czech',	NULL,	NULL,	NULL),
347 | (327,	NULL,	'CU',	'Church Slavic or Old Slavonic or Church Slavonic o',	NULL,	NULL,	NULL),
348 | (328,	NULL,	'CV',	'Chuvash',	NULL,	NULL,	NULL),
349 | (329,	NULL,	'CY',	'Welsh',	NULL,	NULL,	NULL),
350 | (330,	NULL,	'DA',	'Danish',	NULL,	NULL,	NULL),
351 | (331,	NULL,	'DE',	'German',	NULL,	NULL,	NULL),
352 | (332,	NULL,	'DV',	'Divehi or Dhivehi or Maldavian',	NULL,	NULL,	NULL),
353 | (333,	NULL,	'DZ',	'Dzongkha',	NULL,	NULL,	NULL),
354 | (334,	NULL,	'EE',	'Ewe',	NULL,	NULL,	NULL),
355 | (335,	NULL,	'EL',	'Modern Greek (1453-)',	NULL,	NULL,	NULL),
356 | (336,	NULL,	'EN',	'English',	NULL,	NULL,	NULL),
357 | (337,	NULL,	'EO',	'Esperanto',	NULL,	NULL,	NULL),
358 | (338,	NULL,	'ES',	'Spanish or Castilian',	NULL,	NULL,	NULL),
359 | (339,	NULL,	'ET',	'Estonian',	NULL,	NULL,	NULL),
360 | (340,	NULL,	'EU',	'Basque',	NULL,	NULL,	NULL),
361 | (341,	NULL,	'FA',	'Persian',	NULL,	NULL,	NULL),
362 | (342,	NULL,	'FF',	'Fulah',	NULL,	NULL,	NULL),
363 | (343,	NULL,	'FI',	'Finnish',	NULL,	NULL,	NULL),
364 | (344,	NULL,	'FJ',	'Fijian',	NULL,	NULL,	NULL),
365 | (345,	NULL,	'FO',	'Faroese',	NULL,	NULL,	NULL),
366 | (346,	NULL,	'FR',	'French',	NULL,	NULL,	NULL),
367 | (347,	NULL,	'FY',	'Western Frisian',	NULL,	NULL,	NULL),
368 | (348,	NULL,	'GA',	'Irish',	NULL,	NULL,	NULL),
369 | (349,	NULL,	'GD',	'Gaelic or Scottish Gaelic',	NULL,	NULL,	NULL),
370 | (350,	NULL,	'GL',	'Galician',	NULL,	NULL,	NULL),
371 | (351,	NULL,	'GN',	'Guarani',	NULL,	NULL,	NULL),
372 | (352,	NULL,	'GU',	'Gujarati',	NULL,	NULL,	NULL),
373 | (353,	NULL,	'GV',	'Manx',	NULL,	NULL,	NULL),
374 | (354,	NULL,	'HA',	'Hausa',	NULL,	NULL,	NULL),
375 | (355,	NULL,	'HE',	'Hebrew',	NULL,	NULL,	NULL),
376 | (356,	NULL,	'HI',	'Hindi',	NULL,	NULL,	NULL),
377 | (357,	NULL,	'HO',	'Hiri Motu',	NULL,	NULL,	NULL),
378 | (358,	NULL,	'HR',	'Croatian',	NULL,	NULL,	NULL),
379 | (359,	NULL,	'HT',	'Haitian or Haitian Creole',	NULL,	NULL,	NULL),
380 | (360,	NULL,	'HU',	'Hungarian',	NULL,	NULL,	NULL),
381 | (361,	NULL,	'HY',	'Armenian',	NULL,	NULL,	NULL),
382 | (362,	NULL,	'HZ',	'Herero',	NULL,	NULL,	NULL),
383 | (363,	NULL,	'IA',	'Interlingua (International Auxiliary Language Asso',	NULL,	NULL,	NULL),
384 | (364,	NULL,	'ID',	'Indonesian',	NULL,	NULL,	NULL),
385 | (365,	NULL,	'IE',	'Interlingue or Occidental',	NULL,	NULL,	NULL),
386 | (366,	NULL,	'IG',	'Igbo',	NULL,	NULL,	NULL),
387 | (367,	NULL,	'II',	'Sichuan Yi or Nuosu',	NULL,	NULL,	NULL),
388 | (368,	NULL,	'IK',	'Inupiaq',	NULL,	NULL,	NULL),
389 | (369,	NULL,	'MS',	'Malay',	NULL,	NULL,	NULL),
390 | (370,	NULL,	'MT',	'Maltese',	NULL,	NULL,	NULL),
391 | (371,	NULL,	'MY',	'Burmese',	NULL,	NULL,	NULL),
392 | (372,	NULL,	'NA',	'Nauru',	NULL,	NULL,	NULL),
393 | (373,	NULL,	'WO',	'Wolof',	NULL,	NULL,	NULL),
394 | (374,	NULL,	'XH',	'Xhosa',	NULL,	NULL,	NULL),
395 | (375,	NULL,	'YI',	'Yiddish',	NULL,	NULL,	NULL),
396 | (376,	NULL,	'YO',	'Yoruba',	NULL,	NULL,	NULL),
397 | (377,	NULL,	'ZA',	'Zhuang or Chuang',	NULL,	NULL,	NULL),
398 | (378,	NULL,	'ZH',	'Chinese',	NULL,	NULL,	NULL),
399 | (379,	NULL,	'ZU',	'Zulu',	NULL,	NULL,	NULL),
400 | (380,	NULL,	'OJ',	'Ojibwa',	NULL,	NULL,	NULL),
401 | (381,	NULL,	'OM',	'Oromo',	NULL,	NULL,	NULL),
402 | (382,	NULL,	'OR',	'Oriya',	NULL,	NULL,	NULL),
403 | (383,	NULL,	'OS',	'Ossetian or Ossetic',	NULL,	NULL,	NULL),
404 | (384,	NULL,	'PA',	'Panjabi or Punjabi',	NULL,	NULL,	NULL),
405 | (385,	NULL,	'PI',	'Pali',	NULL,	NULL,	NULL),
406 | (386,	NULL,	'PL',	'Polish',	NULL,	NULL,	NULL),
407 | (387,	NULL,	'PS',	'Pushto or Pashto',	NULL,	NULL,	NULL),
408 | (388,	NULL,	'PT',	'Portuguese',	NULL,	NULL,	NULL),
409 | (389,	NULL,	'QU',	'Quechua',	NULL,	NULL,	NULL),
410 | (390,	NULL,	'RM',	'Romansh',	NULL,	NULL,	NULL),
411 | (391,	NULL,	'RN',	'Rundi',	NULL,	NULL,	NULL),
412 | (392,	NULL,	'RO',	'Romanian',	NULL,	NULL,	NULL),
413 | (393,	NULL,	'RU',	'Russian',	NULL,	NULL,	NULL),
414 | (394,	NULL,	'RW',	'Kinyarwanda',	NULL,	NULL,	NULL),
415 | (395,	NULL,	'SA',	'Sanskrit',	NULL,	NULL,	NULL),
416 | (396,	NULL,	'SC',	'Sardinian',	NULL,	NULL,	NULL),
417 | (397,	NULL,	'SD',	'Sindhi',	NULL,	NULL,	NULL),
418 | (398,	NULL,	'SE',	'Northern Sami',	NULL,	NULL,	NULL),
419 | (399,	NULL,	'SG',	'Sango',	NULL,	NULL,	NULL),
420 | (400,	NULL,	'SI',	'Sinhala or Sinhalese',	NULL,	NULL,	NULL),
421 | (401,	NULL,	'SK',	'Slovak',	NULL,	NULL,	NULL),
422 | (402,	NULL,	'SL',	'Slovenian',	NULL,	NULL,	NULL),
423 | (403,	NULL,	'SM',	'Samoan',	NULL,	NULL,	NULL),
424 | (404,	NULL,	'SN',	'Shona',	NULL,	NULL,	NULL),
425 | (405,	NULL,	'SO',	'Somali',	NULL,	NULL,	NULL),
426 | (406,	NULL,	'SQ',	'Albanian',	NULL,	NULL,	NULL),
427 | (407,	NULL,	'SR',	'Serbian',	NULL,	NULL,	NULL),
428 | (408,	NULL,	'SS',	'Swati',	NULL,	NULL,	NULL),
429 | (409,	NULL,	'ST',	'Southern Sotho',	NULL,	NULL,	NULL),
430 | (410,	NULL,	'SU',	'Sundanese',	NULL,	NULL,	NULL),
431 | (411,	NULL,	'SV',	'Swedish',	NULL,	NULL,	NULL),
432 | (412,	NULL,	'SW',	'Swahili',	NULL,	NULL,	NULL),
433 | (413,	NULL,	'TA',	'Tamil',	NULL,	NULL,	NULL),
434 | (414,	NULL,	'TE',	'Telugu',	NULL,	NULL,	NULL),
435 | (415,	NULL,	'TG',	'Tajik',	NULL,	NULL,	NULL),
436 | (416,	NULL,	'TH',	'Thai',	NULL,	NULL,	NULL),
437 | (417,	NULL,	'TI',	'Tigrinya',	NULL,	NULL,	NULL),
438 | (418,	NULL,	'TK',	'Turkmen',	NULL,	NULL,	NULL),
439 | (419,	NULL,	'TL',	'Tagalog',	NULL,	NULL,	NULL),
440 | (420,	NULL,	'TN',	'Tswana',	NULL,	NULL,	NULL),
441 | (421,	NULL,	'TO',	'Tonga',	NULL,	NULL,	NULL),
442 | (422,	NULL,	'TR',	'Turkish',	NULL,	NULL,	NULL),
443 | (423,	NULL,	'TS',	'Tsonga',	NULL,	NULL,	NULL),
444 | (424,	NULL,	'TT',	'Tatar',	NULL,	NULL,	NULL),
445 | (425,	NULL,	'TW',	'Twi',	NULL,	NULL,	NULL),
446 | (426,	NULL,	'TY',	'Tahitian',	NULL,	NULL,	NULL),
447 | (427,	NULL,	'UG',	'Uighur',	NULL,	NULL,	NULL),
448 | (428,	NULL,	'UK',	'Ukrainian',	NULL,	NULL,	NULL),
449 | (429,	NULL,	'UR',	'Urdu',	NULL,	NULL,	NULL),
450 | (430,	NULL,	'UZ',	'Uzbek',	NULL,	NULL,	NULL),
451 | (431,	NULL,	'VE',	'Venda',	NULL,	NULL,	NULL),
452 | (432,	NULL,	'VI',	'Vietnamese',	NULL,	NULL,	NULL),
453 | (433,	NULL,	'VO',	'VolapüT',	NULL,	NULL,	NULL),
454 | (434,	NULL,	'WA',	'Walloon',	NULL,	NULL,	NULL),
455 | (435,	NULL,	'IA',	'Interlingua (International Auxiliary Language Asso',	NULL,	NULL,	NULL);
456 | 
457 | DROP TABLE IF EXISTS `sony_albumlist`;
458 | CREATE TABLE `sony_albumlist` (
459 |   `srno` int(11) NOT NULL AUTO_INCREMENT,
460 |   `Image_DPID` varchar(100) DEFAULT NULL,
461 |   `ImageType` varchar(30) DEFAULT NULL,
462 |   `ImageCodecType` varchar(30) DEFAULT NULL,
463 |   `ImageHeight` varchar(30) DEFAULT NULL,
464 |   `ImageWidth` varchar(30) DEFAULT NULL,
465 |   `ImageResolution` varchar(30) DEFAULT NULL,
466 |   `ImageURL` text,
467 |   `ImageHashSum` varchar(100) DEFAULT NULL,
468 |   `Albumname` varchar(100) DEFAULT NULL,
469 |   `Grid` varchar(100) DEFAULT NULL,
470 |   `ICPN` varchar(100) DEFAULT NULL,
471 |   `DPID` varchar(100) DEFAULT NULL,
472 |   `IPID` varchar(100) DEFAULT NULL,
473 |   `Process_status` char(5) DEFAULT NULL,
474 |   `xmlid` int(11) DEFAULT NULL,
475 |   `Image_status` char(5) DEFAULT NULL,
476 |   `label` varchar(100) DEFAULT NULL,
477 |   `release_date` varchar(100) DEFAULT NULL,
478 |   `year` varchar(100) DEFAULT NULL,
479 |   `language` varchar(100) DEFAULT NULL,
480 |   `movie_release_date` varchar(100) DEFAULT NULL,
481 |   `albumtype` varchar(100) DEFAULT NULL,
482 |   `publisher` varchar(100) DEFAULT NULL,
483 |   `genre` varchar(100) DEFAULT NULL,
484 |   `music_director` varchar(100) DEFAULT NULL,
485 |   `release_type` varchar(100) DEFAULT NULL,
486 |   `catalog_number` varchar(100) DEFAULT NULL,
487 |   PRIMARY KEY (`srno`),
488 |   KEY `xmlid` (`xmlid`)
489 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
490 | 
491 | 
492 | DROP TABLE IF EXISTS `sony_deallist`;
493 | CREATE TABLE `sony_deallist` (
494 |   `srno` int(11) NOT NULL AUTO_INCREMENT,
495 |   `commercial_type` varchar(100) DEFAULT NULL,
496 |   `use_type` varchar(100) DEFAULT NULL,
497 |   `territory_code` varchar(100) DEFAULT NULL,
498 |   `sales_start_date` varchar(100) DEFAULT NULL,
499 |   `xmlid` varchar(100) DEFAULT NULL,
500 |   PRIMARY KEY (`srno`)
501 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
502 | 
503 | 
504 | DROP TABLE IF EXISTS `sony_songlist`;
505 | CREATE TABLE `sony_songlist` (
506 |   `srno` int(11) NOT NULL AUTO_INCREMENT,
507 |   `ISRC` varchar(20) DEFAULT NULL,
508 |   `ResourceReference` char(5) DEFAULT NULL,
509 |   `ReferenceTitle` varchar(200) DEFAULT NULL,
510 |   `LanguageOfPerformance` varchar(20) DEFAULT NULL,
511 |   `Duration` varchar(20) DEFAULT NULL,
512 |   `Title` varchar(200) DEFAULT NULL,
513 |   `Artist` varchar(100) DEFAULT NULL,
514 |   `Producer` varchar(100) DEFAULT NULL,
515 |   `Composer` varchar(100) DEFAULT NULL,
516 |   `Lyricist` varchar(100) DEFAULT NULL,
517 |   `Label` varchar(100) DEFAULT NULL,
518 |   `Year` int(11) DEFAULT NULL,
519 |   `plinetext` varchar(100) DEFAULT NULL,
520 |   `Genre` varchar(30) DEFAULT NULL,
521 |   `ParentalWarningType` varchar(30) DEFAULT NULL,
522 |   `AudioCodecType` varchar(30) DEFAULT NULL,
523 |   `NumberOfChannels` char(5) DEFAULT NULL,
524 |   `SamplingRate` varchar(30) DEFAULT NULL,
525 |   `IsPreview` char(5) DEFAULT NULL,
526 |   `FileURL` text,
527 |   `File_status` char(5) DEFAULT NULL,
528 |   `HashSum` varchar(100) DEFAULT NULL,
529 |   `Grid` varchar(100) DEFAULT NULL,
530 |   `ICPN` varchar(100) DEFAULT NULL,
531 |   `DPID` varchar(100) DEFAULT NULL,
532 |   `IPID` varchar(100) DEFAULT NULL,
533 |   `Process_status` char(5) DEFAULT NULL,
534 |   `xmlid` int(11) DEFAULT NULL,
535 |   `ImageURL` text,
536 |   `ImageHashSum` varchar(100) DEFAULT NULL,
537 |   `Image_status` char(5) DEFAULT NULL,
538 |   `ImageCodecType` varchar(30) DEFAULT NULL,
539 |   `ImageHeight` varchar(30) DEFAULT NULL,
540 |   `ImageWidth` varchar(30) DEFAULT NULL,
541 |   `ImageResolution` varchar(30) DEFAULT NULL,
542 |   `wav_status` char(5) DEFAULT '0',
543 |   `added_to_cms` int(11) DEFAULT '0',
544 |   `Actor` varchar(200) DEFAULT NULL,
545 |   PRIMARY KEY (`srno`),
546 |   KEY `xmlid` (`xmlid`),
547 |   KEY `ISRC` (`ISRC`),
548 |   KEY `File_status` (`File_status`)
549 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
550 | 
551 | 
552 | DROP TABLE IF EXISTS `sony_xmllist`;
553 | CREATE TABLE `sony_xmllist` (
554 |   `srno` int(11) NOT NULL AUTO_INCREMENT,
555 |   `Filename` varchar(30) DEFAULT NULL,
556 |   `MessageThreadId` varchar(100) DEFAULT NULL,
557 |   `MessageId` varchar(100) DEFAULT NULL,
558 |   `MessageSenderId` varchar(100) DEFAULT NULL,
559 |   `MessageSenderName` varchar(100) DEFAULT NULL,
560 |   `MessageRecipientId` varchar(100) DEFAULT NULL,
561 |   `MessageRecipientName` varchar(100) DEFAULT NULL,
562 |   `MessageCreatedDateTime` varchar(100) DEFAULT NULL,
563 |   `XML_status` char(5) DEFAULT NULL,
564 |   `Process_status` char(5) DEFAULT NULL,
565 |   `Process_date` date DEFAULT NULL,
566 |   `total_songs` int(11) DEFAULT '0',
567 |   `download_songs` int(11) DEFAULT '0',
568 |   `download_images` int(11) DEFAULT '0',
569 |   `log_send` int(11) DEFAULT '0',
570 |   `update_indicator` varchar(20) DEFAULT NULL,
571 |   PRIMARY KEY (`srno`)
572 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
573 | 
574 | 
575 | DROP TABLE IF EXISTS `sony_xml_output`;
576 | CREATE TABLE `sony_xml_output` (
577 |   `srno` int(11) NOT NULL AUTO_INCREMENT,
578 |   `party_id` varchar(100) DEFAULT NULL,
579 |   `catalog_number` varchar(100) DEFAULT NULL,
580 |   `ipcn` varchar(100) DEFAULT NULL,
581 |   `grid` varchar(100) DEFAULT NULL,
582 |   `isrc` varchar(100) DEFAULT NULL,
583 |   `artist` varchar(500) DEFAULT NULL,
584 |   `title` varchar(100) DEFAULT NULL,
585 |   `release_type` varchar(100) DEFAULT NULL,
586 |   `commercial_type` varchar(100) DEFAULT NULL,
587 |   `use_type` varchar(100) DEFAULT NULL,
588 |   `territories` varchar(100) DEFAULT NULL,
589 |   `price_value_code` varchar(100) DEFAULT NULL,
590 |   `sales_start_date` varchar(100) DEFAULT NULL,
591 |   `sales_end_date` varchar(100) DEFAULT NULL,
592 |   `xmlid` int(11) DEFAULT NULL,
593 |   `inserted_date` datetime DEFAULT NULL,
594 |   PRIMARY KEY (`srno`)
595 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
596 | 
597 | 
598 | DROP TABLE IF EXISTS `sony_xml_output_1`;
599 | CREATE TABLE `sony_xml_output_1` (
600 |   `srno` int(11) NOT NULL AUTO_INCREMENT,
601 |   `party_id` varchar(100) DEFAULT NULL,
602 |   `catalog_number` varchar(100) DEFAULT NULL,
603 |   `ipcn` varchar(100) DEFAULT NULL,
604 |   `grid` varchar(100) DEFAULT NULL,
605 |   `isrc` varchar(100) DEFAULT NULL,
606 |   `artist` varchar(500) DEFAULT NULL,
607 |   `title` varchar(100) DEFAULT NULL,
608 |   `release_type` varchar(100) DEFAULT NULL,
609 |   `commercial_type` varchar(100) DEFAULT NULL,
610 |   `use_type` varchar(100) DEFAULT NULL,
611 |   `territories` varchar(100) DEFAULT NULL,
612 |   `price_value_code` varchar(100) DEFAULT NULL,
613 |   `sales_start_date` varchar(100) DEFAULT NULL,
614 |   `sales_end_date` varchar(100) DEFAULT NULL,
615 |   `xmlid` int(11) DEFAULT NULL,
616 |   `inserted_date` datetime DEFAULT NULL,
617 |   `updated_date` datetime DEFAULT NULL,
618 |   PRIMARY KEY (`srno`),
619 |   KEY `isrc` (`isrc`),
620 |   KEY `catalog_number` (`catalog_number`),
621 |   KEY `commercial_type` (`commercial_type`)
622 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
623 | 
624 | 
625 | -- 2016-06-01 05:28:19
626 | 


--------------------------------------------------------------------------------