<?php
/**
 * Created by PhpStorm.
 * User: varun_2
 * Date: 28-12-2015
 * Time: 08:23
 */

namespace App\Http\Controllers;

use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;

use App\Http\Controllers\Action\Common;


class getCommonInfo extends Controller
{
    public function getfaqs(Request $request)
    {

        if($request->has('appType') && strtoupper($request->input('appType')) == 'CM'){ 
			$all= array(
				[
					"ques" => "What is CoalMint?",
					"ans" => "CoalMint is an independent market research and online information provider on the coal and coke markets."
				],
				[
					"ques" => "What all services do you provide?",
					"ans" => "CoalMint provides a comprehensive spectrum of services that keep industry players not only informed of the ongoing market conditions, but also help in taking prudent business decisions.
				Coal Mint provides:
					• Real-time prices of coal and coke in the Indian as well as key international markets
					• News on the industry, comprising of unbiased coverage on the market conditions, in-depth analysis on demand and supply aspects, price movements and short-term price forecasts
					• Freight rates and logistics information, including vessel line-up and cargo positions at various ports are also exclusively covered
					• Statistics, comprising of production, export and import data, giving you deeper market insights
					• Reports, on weekly and monthly basis, giving you a comprehensive market overview during the periods
					• Tenders, providing information on opportunities to buy/sell"
				],
				[
					"ques" => "How do you provide these updates?",
					"ans" => "The updates are provided through the CoalMint website and app. News, Prices, Statistics, Tenders and Reports are provided through the related sections, while, prices and short updates are also provided through SMS."
				]/* ,
				[
					"ques" => "Do you provide a Free Trial? How can I avail that?",
					"ans" => "Yes. We do provide a Free Trial for 14 days. You can avail the facility by clicking on Trial on the home page."
				] */,
				[
					"ques" => "Do you provide a free trial? How can I avail that?",
					"ans" => "Yes, a free trial is provided for a period of 14 days in order to enable you to assess the various contents of the website. You can avail the facility by clicking on the ‘Trial’ section in the website."
				],
				[
					"ques" => "What are the charges?",
					"ans" => "For subscription charges and other details, call the customer care at +91 9770258888. Alternately, you can also drop a mail to info@coalmint.com."
				],
				[
					"ques" => "How do I become a member?",
					"ans" => "You can become a member by filling up the application form available in the website."
				],
				[
					"ques" => "How do I make payment?",
					"ans" => "You can make payment through debit/credit cards, net banking; or through cheque/ demand draft, or even deposit cash in the company’s account in your nearest bank, according to your convenience."
				],
				[
					"ques" => "What should I do after I have become a member of CoalMint?",
					"ans" => "You can access information in the website by logging into it with your username after receiving the password from CoalMint. For any assistance, feel free to call the customer care at +919770258888."
				],
				[
					"ques" => "Who will benefit from CoalMint information and research?",
					"ans" => "CoalMint’s services are tailored to help the entire spectrum of players engaged in the coal and/or coke industry. The comprehensive, focused and up-to-date information will benefit producers, traders, brokers, importers/exporters, charting agents and analysts in not only staying updated on the prevailing market conditions but also will help in taking prudent decisions for maximizing profits."
				]	 
			);
		}else{
			$all= array(
				[
					"ques" => "What is SteelMint?",
					"ans" => "SteelMint is a research and data provider."
				],
				[
					"ques" => "What all services do you provide?",
					"ans" => "We provide you Steel prices, Steel news, Steel reports, Iron ore prices (export) and updates on Steel industry, information on logistics such as vessel freight, vessel line-up of coal/iron ore, cargo position at different ports etc."
				],
				[
					"ques" => "How do you provide these updates?",
					"ans" => "There are two ways of providing information to you. Through Website:You can access Steel prices, reports, news, logistics, Iron ore fines related updates. Through Mobile APP"
				]/* ,
				[
					"ques" => "Do you provide a Free Trial? How can I avail that?",
					"ans" => "Yes. We do provide a Free Trial for 14 days. You can avail the facility by clicking on Trial on the home page."
				] */,
				[
					"ques" => "What are the charges?",
					"ans" => "For subscription charges and other details you can contact our customer care @ +91 97700 56666"
				],
				[
					"ques" => "How do I become a member?",
					"ans" => "You can become a member by filling up a simple online application form by clicking on ’Become a member’."
				],
				[
					"ques" => "How do I make payment?",
					"ans" => "You can make payment through credit/debit card (online) or by cheque/DD (offline)."
				],
				[
					"ques" => "What should I do after I have become a member of SteelMint?",
					"ans" => "After registration, you can enter the username and password that has been sent to you by SteelMint to access data. This will activate your service. For any other info you can contact our customer care @ +91 97700 56666."
				],
				[
					"ques" => "Who will benefit from SteelMint information and research?",
					"ans" => "SteelMint reports and data are useful for manufacturers, traders, brokers, exporters, chartering agents, analysts and retailers."
				]
			);
		}

        return new JsonResponse( array( "status#" => "1" , "data#" => $all ) );
    }
    public function newFeatures(Request $request)
    {
		if($request->has('appType') && strtoupper($request->input('appType')) == 'CM'){
			$all= array(
				[
					"p_title" => "Recent History in prices section",
					"p_description" => "Whatever prices you click in listing will be displayed under this section. It's like website history in our browsers. This feature can be used by sliding up an arrow placed (at bottom) on prices pages.",
					"p_video_url" => ""
				],
				[
					"p_title" => "Map view in prices",
					"p_description" => "You can see prices for a product in Indian / global Map for better understanding. A 'M' icon is used to show location of which prices are considered. On click of this marker you will see details of prices for that location at bottom. This feature is available at top right corner of 'View All prices' page",
					"p_video_url" => ""
				],
				[
					"p_title" => "GP - global product added in 'View All prices' page ",
					"p_description" => "A new product GP for global is added in 'View All prices' page at products listing combo box.",
					"p_video_url" => ""
				],
				[
					"p_title" => "Show min, max values in price description",
					"p_description" => "On description page of any price row you can now see Min, Max values for that row below the graph",
					"p_video_url" => ""
				],
				[
					"p_title" => "New Category added",
					"p_description" => " 'Raw Material' has been replaced with Iron Ore, Coal, Scrap. Also some changes has been done in categories across the APP.",
					"p_video_url" => ""
				]
			);
		}else{
			$all= array(
				[
					"p_title" => "Recent History in prices section",
					"p_description" => "Whatever prices you click in listing will be displayed under this section. It's like website history in our browsers. This feature can be used by sliding up an arrow placed (at bottom) on prices pages.",
					"p_video_url" => ""
				],
				[
					"p_title" => "Map view in prices",
					"p_description" => "You can see prices for a product in Indian / global Map for better understanding. A 'M' icon is used to show location of which prices are considered. On click of this marker you will see details of prices for that location at bottom. This feature is available at top right corner of 'View All prices' page",
					"p_video_url" => ""
				],
				[
					"p_title" => "GP - global product added in 'View All prices' page ",
					"p_description" => "A new product GP for global is added in 'View All prices' page at products listing combo box.",
					"p_video_url" => ""
				],
				[
					"p_title" => "Show min, max values in price description",
					"p_description" => "On description page of any price row you can now see Min, Max values for that row below the graph",
					"p_video_url" => ""
				],
				[
					"p_title" => "New Category added",
					"p_description" => " 'Raw Material' has been replaced with Iron Ore, Coal, Scrap. Also some changes has been done in categories across the APP.",
					"p_video_url" => ""
				]
			);
		}

        return new JsonResponse( array( "status#" => "1" , "data#" => $all ) );
    }
    public function termsAndConditions()
    {
        if($request->has('appType') && strtoupper($request->input('appType')) == 'CM'){
			$all=  array(
			  [
				  "name" => "INFORMATION ABOUT US",
				  "value" => "We operate the website www.steelmint.com. We, SteelMint Info Services LLP, a limited liability partnership registered in India with our registered office at #301, Jeevan Parisar, Rajeev Nagar, Raipur 492007, Chhattisgarh."
			  ],
				[
					"name" => "YOUR STATUS",
					"value" => "By subscribing to our site, you warrant that:
	<ol>
		<li>you are legally capable of entering into binding contracts; and </li>
		<li>you are at least 18 years old.</li>
	</ol>"
				],
				[
					"name" => "HOW THE CONTRACT IS FORMED BETWEEN YOU AND US",
					"value" => '
	<ol>
		<li>The process of registration or subscription to our site shall conclude upon receipt of the requisite subscription charges as prevalent at the time of such registration. A contract with you for receipt of the services pursuant to subscription to our site will come into effect when we send you an email message confirming your subscription details and not before.</li>
		<li>Unless otherwise agreed in writing, we will charge you in US Dollars or in Indian Rupee. You will also have to pay any applicable taxes levied under any applicable law.</li>
		<li>The updated subscription price is set out in the page on our site, which mentions the subscription process. You can take an annual subscription, which will not automatically renew. We will notify you 15 days in advance regarding the expiry of your subscription along with the prevailing subscription price. You will have to manually renew the subscription by payment of the subscription fee for the extended period. Please be informed that your Internet Service Provider and/or telephone operator may separately charge you for time spent accessing our site in the manner agreed between you and your Internet Service Provider.</li>
	</ol>
	'
				],
				[
					"name" => "WARRANTIES",
					"value" => '
	<ol>
		<li>You hereby warrant that you agree that the registration is for a single user only, unless we agree otherwise in writing.</li>
		<li>You hereby warrant that all the information provided to us during the registration process is true and accurate. If you provide us with an e-mail address that will result in e-mails or SMS messages that we send to you being sent via a computer or telephone network operated or owned by a third party then you warrant that you are entitled to receive those messages. We allow you access to the subscription services on the basis that:</li>
		<ul>
			<li>your user name and password are personal to you and may not be used by anyone else;</li>
			<li>you will not do anything which would assist anyone who is not a registered user to gain access to any registration area of our site;</li>
			<li>you do not maliciously create additional usernames for the purpose of abusing the functionality of our site, or other users; nor do you seek to pass yourself off as another user by adopting a similar username; and</li>
			<li>at all times during the subscription you comply with these Terms.</li>
		</ul>
		<li>If, for any reason, we believe that you have not complied with these requirements or any other provision of these Terms, we may, at our discretion, cancel your access to the Subscription Services. If we wish to terminate your registration, we will do so by emailing you at the address you have registered stating that your registration has been terminated. Your username and password will become invalid immediately.  </li>
	</ol>
	'
				],
				[
					"name" => "COPYRIGHT AND LIMITATIONS ON USE",
					"value" => "
	<ol>
		<li>The content displayed or received by you through the subscription to our site (“Content”) is the property of SteelMint or its licensors, and is protected by copyright and other intellectual property laws. Our site and the Content may be used only for your personal and non-commercial use. Reproduction of part or all of the contents of this site in any form is expressly prohibited. Access to the information on this site shall in no manner imply any right or permission to copy or allow for incorporation of any material or any part therein in any work or publication not limited to any other form. By accessing this/our site, you agree that reproduction, printing, re-transmission, copying, distribution, publishing or selling of any content provided on this site is expressly prohibited. In particular, and without limitation, you expressly agree that you shall not post any content from this site to any mail lists, newsgroups or electronic bulletin boards without the prior written consent of SteelMint. To request consent for matters, you may contact SteelMint at info@steelmint.com. All rights (including Copyright) in relation to the information / content on this site exclusively belong to SteelMint. Any violation(s) by you or any person acting on your behalf shall subject you to legal consequences not limited to damages, fines / penalties and other necessary court action.</li>
		<li>You hereby acknowledge that you have subscribed to our site, in order to receive news, information and understand the Iron & Steel industry, against which you pay a nominal subscription fee. The Content includes facts, views, opinions and recommendations of individuals and organizations deemed of interest. We and our Content licensors are not giving investment advice, tax advice, legal advice, or other professional advice. We and our Content licensors do not guarantee or warrant the accuracy, completeness or timeliness of, or otherwise endorse these views, opinions and recommendations. You should always seek the assistance of a professional for advice on investments, tax, the law, or other professional matters.</li>
	</ol>
					"
				],
				[
					"name" => "PROPRIETARY RIGHTS",
					"value" => "
	<ol>
		<li>The Content is protected by international copyright, database right and other intellectual property rights owned by us or third party licensors. All product and company names and logos mentioned on our site may be trademarks, service marks or trading names of their respective owners, including us.</li>
		<li>You may display the Content to one person electronically on a single computer, download and store one copy of the information in machine readable form, print (but not photocopy) one copy of the information and store such pages for caching purposes only. Except in the case of information you have placed on our site, you may not do any of the following without our prior written consent, or the prior written consent of the owner of the intellectual property rights if different:  </li>
		<ul>
			<li>download, display or store any of the Content otherwise than as permitted above;</li>
			<li>modify, reproduce, transmit, publish, display, copy, distribute, broadcast, adapt, create derivative works of or in any way commercially exploit any of the Content;</li>
			<li>sub-license, rent, lease, transfer or attempt to assign the rights in the Content to any other person, make the materials available on a network, use the information in any manner, or transfer or export the Content or any copies into any country, other than in compliance with these Terms and with applicable laws or allow any other person to use the information other than in accordance with the Terms and the subscription agreement; </li>
			<li>redistribute any of the Content (including using it as part of any library, archive or similar service;</li>
			<li>remove the copyright or trade mark notice(s) from any copies of the Content permitted in accordance with these Terms;</li>
			<li>systematically or regularly download, store or print any of the Content so as to create a database in electronic or paper form; and</li>
			<li>deep link to, frame, spider, harvest or scrape the Content or otherwise access the Content for similar purposes.</li>
		</ul>
	</ol>
					"
				],
			);
		}else{
			$all=  array(
			  [
				  "name" => "INFORMATION ABOUT US",
				  "value" => "We operate the website www.steelmint.com. We, SteelMint Info Services LLP, a limited liability partnership registered in India with our registered office at #301, Jeevan Parisar, Rajeev Nagar, Raipur 492007, Chhattisgarh."
			  ],
				[
					"name" => "YOUR STATUS",
					"value" => "By subscribing to our site, you warrant that:
	<ol>
		<li>you are legally capable of entering into binding contracts; and </li>
		<li>you are at least 18 years old.</li>
	</ol>"
				],
				[
					"name" => "HOW THE CONTRACT IS FORMED BETWEEN YOU AND US",
					"value" => '
	<ol>
		<li>The process of registration or subscription to our site shall conclude upon receipt of the requisite subscription charges as prevalent at the time of such registration. A contract with you for receipt of the services pursuant to subscription to our site will come into effect when we send you an email message confirming your subscription details and not before.</li>
		<li>Unless otherwise agreed in writing, we will charge you in US Dollars or in Indian Rupee. You will also have to pay any applicable taxes levied under any applicable law.</li>
		<li>The updated subscription price is set out in the page on our site, which mentions the subscription process. You can take an annual subscription, which will not automatically renew. We will notify you 15 days in advance regarding the expiry of your subscription along with the prevailing subscription price. You will have to manually renew the subscription by payment of the subscription fee for the extended period. Please be informed that your Internet Service Provider and/or telephone operator may separately charge you for time spent accessing our site in the manner agreed between you and your Internet Service Provider.</li>
	</ol>
	'
				],
				[
					"name" => "WARRANTIES",
					"value" => '
	<ol>
		<li>You hereby warrant that you agree that the registration is for a single user only, unless we agree otherwise in writing.</li>
		<li>You hereby warrant that all the information provided to us during the registration process is true and accurate. If you provide us with an e-mail address that will result in e-mails or SMS messages that we send to you being sent via a computer or telephone network operated or owned by a third party then you warrant that you are entitled to receive those messages. We allow you access to the subscription services on the basis that:</li>
		<ul>
			<li>your user name and password are personal to you and may not be used by anyone else;</li>
			<li>you will not do anything which would assist anyone who is not a registered user to gain access to any registration area of our site;</li>
			<li>you do not maliciously create additional usernames for the purpose of abusing the functionality of our site, or other users; nor do you seek to pass yourself off as another user by adopting a similar username; and</li>
			<li>at all times during the subscription you comply with these Terms.</li>
		</ul>
		<li>If, for any reason, we believe that you have not complied with these requirements or any other provision of these Terms, we may, at our discretion, cancel your access to the Subscription Services. If we wish to terminate your registration, we will do so by emailing you at the address you have registered stating that your registration has been terminated. Your username and password will become invalid immediately.  </li>
	</ol>
	'
				],
				[
					"name" => "COPYRIGHT AND LIMITATIONS ON USE",
					"value" => "
	<ol>
		<li>The content displayed or received by you through the subscription to our site (“Content”) is the property of SteelMint or its licensors, and is protected by copyright and other intellectual property laws. Our site and the Content may be used only for your personal and non-commercial use. Reproduction of part or all of the contents of this site in any form is expressly prohibited. Access to the information on this site shall in no manner imply any right or permission to copy or allow for incorporation of any material or any part therein in any work or publication not limited to any other form. By accessing this/our site, you agree that reproduction, printing, re-transmission, copying, distribution, publishing or selling of any content provided on this site is expressly prohibited. In particular, and without limitation, you expressly agree that you shall not post any content from this site to any mail lists, newsgroups or electronic bulletin boards without the prior written consent of SteelMint. To request consent for matters, you may contact SteelMint at info@steelmint.com. All rights (including Copyright) in relation to the information / content on this site exclusively belong to SteelMint. Any violation(s) by you or any person acting on your behalf shall subject you to legal consequences not limited to damages, fines / penalties and other necessary court action.</li>
		<li>You hereby acknowledge that you have subscribed to our site, in order to receive news, information and understand the Iron & Steel industry, against which you pay a nominal subscription fee. The Content includes facts, views, opinions and recommendations of individuals and organizations deemed of interest. We and our Content licensors are not giving investment advice, tax advice, legal advice, or other professional advice. We and our Content licensors do not guarantee or warrant the accuracy, completeness or timeliness of, or otherwise endorse these views, opinions and recommendations. You should always seek the assistance of a professional for advice on investments, tax, the law, or other professional matters.</li>
	</ol>
					"
				],
				[
					"name" => "PROPRIETARY RIGHTS",
					"value" => "
	<ol>
		<li>The Content is protected by international copyright, database right and other intellectual property rights owned by us or third party licensors. All product and company names and logos mentioned on our site may be trademarks, service marks or trading names of their respective owners, including us.</li>
		<li>You may display the Content to one person electronically on a single computer, download and store one copy of the information in machine readable form, print (but not photocopy) one copy of the information and store such pages for caching purposes only. Except in the case of information you have placed on our site, you may not do any of the following without our prior written consent, or the prior written consent of the owner of the intellectual property rights if different:  </li>
		<ul>
			<li>download, display or store any of the Content otherwise than as permitted above;</li>
			<li>modify, reproduce, transmit, publish, display, copy, distribute, broadcast, adapt, create derivative works of or in any way commercially exploit any of the Content;</li>
			<li>sub-license, rent, lease, transfer or attempt to assign the rights in the Content to any other person, make the materials available on a network, use the information in any manner, or transfer or export the Content or any copies into any country, other than in compliance with these Terms and with applicable laws or allow any other person to use the information other than in accordance with the Terms and the subscription agreement; </li>
			<li>redistribute any of the Content (including using it as part of any library, archive or similar service;</li>
			<li>remove the copyright or trade mark notice(s) from any copies of the Content permitted in accordance with these Terms;</li>
			<li>systematically or regularly download, store or print any of the Content so as to create a database in electronic or paper form; and</li>
			<li>deep link to, frame, spider, harvest or scrape the Content or otherwise access the Content for similar purposes.</li>
		</ul>
	</ol>
					"
				],
			);
		}

//        var_dump($all); die ;
        return new JsonResponse( array( "status#" => "1" , "data#" => $all ) );
    }

    public function getCategories()
    {
        $common = new Common();
        $result = $common->getCategories();

        return new JsonResponse(array("status#"=>"1", "data#"=> $result));
    }
}