Monday, March 29, 2010

linkvalidation

function checkchar(txt)
{
var rt = true;
var iChars = "!@#$%^&*()+=-[]\\\';{}|\":<>?";

for (var i = 0; i < document.getElementById(txt).value.length; i++)
{
if (iChars.indexOf(document.getElementById(txt).value.charAt(i)) != -1)
{
rt = false;
}
}

return rt;
}

function checkurl(txt)
{
var rt = true;
var iChars = "!@#$%^&*()+=[]\\\';{}|\"<>?";

for (var i = 0; i < document.getElementById(txt).value.length; i++)
{
if (iChars.indexOf(document.getElementById(txt).value.charAt(i)) != -1)
{
rt = false;
}
}

return rt;
}
function isValidEmail(strEmail)
{
validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
strEmail = document.getElementById(strEmail).value;

// search email text for regular exp matches
if (strEmail.search(validRegExp) == -1)
{
return false;
}
return true;
}

function disp_alert()
{

var title=document.getElementById('title').value;

if(title.indexOf(" ")== 0)
{
alert("Please Enter valid Title");
return false;
}
else if(document.getElementById('title').value=="")
{
alert("Please Enter Your Title")
document.getElementById('title').focus();
return false;
}
else if (!checkchar('title'))
{
alert("Invalid Title Please re-enter.");
document.getElementById('title').focus();
return (false)
}

var url=document.getElementById('url').value;

if(url.indexOf(" ")== 0 && url.indexOf("http://")!=0)
{
alert("Please Enter valid url 1");
return false;
}
else if(document.getElementById('url').value=="")
{
alert("Please Enter Your URL 2")
document.getElementById('url').focus();
return false;
}
else if (!checkurl('url'))
{
alert("Invalid Url Please re-enter.");
document.getElementById('url').focus();
return (false)
}
if(document.getElementById('category').value=="")
{
alert("Please Select Your Category")
document.getElementById('category').focus();
return false;
}
if(document.getElementById('e_mail').value=="")
{
alert("Please enter your email");
document.getElementById('e_mail').focus();
return false;
}
else if(!isValidEmail('e_mail'))
{
alert("Please enter valid Email");
document.getElementById('e_mail').focus();
return (false)
}


var res_link=document.getElementById('res_link').value;

if(url.indexOf(" ")== 0 && url.indexOf("http://")!=0)
{
alert("Please Enter valid Reciprocal Link");
return false;
}
else if(document.getElementById('res_link').value=="")
{
alert("Please Enter Reciprocal Link")
document.getElementById('res_link').focus();
return false;
}
else if (!checkurl('res_link'))
{
alert("Invalid Res_link Please re-enter.");
document.getElementById('res_link').focus();
return (false)
}
return true;
}


//function alphachk()
//
//{
// if((event.keyCode<65 || event.keyCode>90) && event.keyCode != 190 && event.keyCode != 8 && event.keyCode != 37 && event.keyCode != 38 && event.keyCode != 39 && event.keyCode != 40 && event.keyCode != 46 && event.keyCode != 13 && event.keyCode != 116 && event.keyCode != 16 && (event.keyCode <96 || event.keyCode > 122) && event.keyCode != 9 && event.keyCode != 110) event.returnValue = false
//
// }
//

mail function

<%
function sendmail(emailName)
Dim MyMail
Set CdoConf = Server.CreateObject ("CDO.Configuration")
set MyMail = Server.CreateObject("CDO.Message")
CdoConf.Fields( "http://schemas.microsoft.com/cdo/configuration/smtpserver" ) = "212.227.15.179"
CdoConf.Fields( "http://schemas.microsoft.com/cdo/configuration/smtpserverport" ) = 25
CdoConf.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") ="no-reply@rupizcompare.co.uk"
CdoConf.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="123459876"
CdoConf.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") =1
CdoConf.Fields( "http://schemas.microsoft.com/cdo/configuration/sendusing" ) = 2
CdoConf.Fields( "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout" ) = 60
CdoConf.Fields.Update
'siteurl="http://172.16.0.5/mobile/mobilecentral/ask4phone/"
'siteurl="http://www.ask4phone.co.uk/Images/"
siteurl="http://172.16.0.5/mobile/mobilecentral/ask4phone/Images/Mail/"
'siteurl = "http://193.142.127.129/ask4PhoneImages/"

'errStr ="::: Ask 4 Phone ::: style=""padding:0px; margin:0px;"">
Please provide us following details so that we can provide you Free mobile comparison portal :
Your website URL on which you want to display the Mobile whitelabel
solution.
 
Your Website logo which will be displayed on the top of the header of
the website.
Now, For all your earnings till 31st January, 2009 you would get 20% more
Once you will provide us above mention details . Your website will be online within 24 hrs.
Regards
Ask4phone Team
0870034740
"
'siteurl = "http://193.142.127.129/ask4PhoneImages/"
errStr ="::: Ask 4 Phone ::: style=""padding:0px; margin:0px;"">

Please provide us with the following details so that we can process your request to offer you our Mobile Comparison Whitelabel Website absolutely Free!!

Domain name if you have one
Your Website logo
Once you will provide us with the above mentioned details. We can process to make your whitelabel website online within 24 hours of time.


Best Regards
Ask4phone Team
0870 034 7403

"

Set MyMail.Configuration = CdoConf
MyMail.From = "info@rupizinfotech.com"
MyMail.To = "y.kumar@rupizinfotech.com"
MyMail.Bcc = "info@free3gmobilephoneoffers.co.uk"
MyMail.Subject = "Ask4Phone"
MyMail.HTMLBody=errStr
MyMail.Send
Set objNewMail = Nothing
end function
%>

js

// Javascript BCMP
// Created By : Uttam Kumar
// Created on : 05th, Nov 2009

var wsUrl = "http://172.16.0.5/mobile/saf/rupizmobilesites/bestcontractmobilephone_test/";
//var wsUrl = "http://www.Bestcontractmobilephone.co.uk/";
function GetHttpObject(){
var xmlHttpObj;
try {
xmlHttpObj = new XMLHttpRequest();
return xmlHttpObj;
}
catch (e){
try{
xmlHttpObj = new ActiveXObject("Msxml2.XMLHTTP");
return xmlHttpObj;
}
catch (e){
try{
xmlHttpObj = new ActiveXObject("Microsoft.XMLHTTP");
return xmlHttpObj;
}
catch (e)
{
alert("Sorry, Your browser does not support AJAX!");
return null;
}
}
}
}

function headerfill(spnId, ctlId){
var xmlHttp;
var url = wsUrl + "ajax/headerfill.asp";
url=url + "?ctlId="+ctlId;
//alert(url);
url = url + "&rnd=" + Math.random();
xmlHttp = GetHttpObject();
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = function(){StateChanged(xmlHttp, spnId)};
xmlHttp.send(null);
}

function StateChanged(xmlHttp, spnId) {
if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete"){
document.getElementById(spnId).innerHTML = xmlHttp.responseText;
}else{
}
}

function headerphone(phonename){
if (phonename !="")
window.location.href="Phone_Deal.asp?Ph="+phonename;
}
function headergift(gift){
//alert(gift)
if(gift!="")
window.location.href="gift_deal.asp?gift="+gift;
}

Tuesday, March 23, 2010

// Javascript OMPS
// Created By : Uttam Kumar
// Created on : 16th, Feb 2010

var wsUrl = "http://172.16.0.5/mobile/saf/rupizmobilesites/ompsadmin/Description/";
//var wsUrl = "http://www.onlinemobilephoneshop.co.uk/admin/Description/";
function GetHttpObject(){
var xmlHttpObj;
try {
xmlHttpObj = new XMLHttpRequest();
return xmlHttpObj;
}
catch (e){
try{
xmlHttpObj = new ActiveXObject("Msxml2.XMLHTTP");
return xmlHttpObj;
}
catch (e){
try{
xmlHttpObj = new ActiveXObject("Microsoft.XMLHTTP");
return xmlHttpObj;
}
catch (e)
{
alert("Sorry, Your browser does not support AJAX!");
return null;
}
}
}
}

function fillrecycle(spnId, ctlId, manu){
var xmlHttp;
var url = wsUrl + "ajax/filldetail.asp";
url=url + "?ctlId="+ctlId;
url=url + "&manu="+manu;
url = url + "&rnd=" + Math.random();
xmlHttp = GetHttpObject();
xmlHttp.onreadystatechange = function(){StateChanged(xmlHttp, spnId)};
xmlHttp.open("GET", url , true);
xmlHttp.send(null);
}
function StateChanged(xmlHttp, spnId) {
if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete"){
document.getElementById(spnId).innerHTML = xmlHttp.responseText;
}else{// For Loading...
}
}

function recylefill(manu){
var xmlHttp;
var url = wsUrl + "ajax/filldetail.asp";
url=url + "?manu="+manu;
//alert(url);
url = url + "&rnd=" + Math.random();
xmlHttp = GetHttpObject();
xmlHttp.onreadystatechange = function(){StateChanged1(xmlHttp)};
xmlHttp.open("GET", url , true);
xmlHttp.send(null);
}

function StateChanged1(xmlHttp) {
if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete"){
document.getElementById("spnRecycleModel").innerHTML = xmlHttp.responseText;
}else{// For Loading...
}
}


<%
Id=request.QueryString("HandsetId")
conn.open MyDsn
HandsetId = Request.Form("phName")
If Request.Form("submit") <> "" Then
HandsetKeyFeatures = Replace(Request.Form("keyFeature"), "'", "''")
sql="Update tblHandsetKeyFeatures set UpdatedOn='" & now()& "' , HandsetKeyFeature='" & HandsetKeyFeatures & "' where HandsetId="&Id
conn.execute(sql)
response.Redirect("veiwHandsetKeyFeatures.asp?msg=Updated Successfully.")
end if
sql="select * from tblHandsetKeyFeatures where HandsetId="&Id
set rs = conn.execute(sql)

%>







<%=msg%>
Add
New Phone











<%
sql="select ph_name from saf_phone where ph_id="&rs("handsetid")
set rsPh =conn.execute(sql)
%>

<%set rsPh = nothing
%>













Handset Id
name="phid" type="text" class="field" id="phid" value="<%=rs("handsetid")%> " size="40" readonly="readonly"
Handset Name
input name="phname" type="text" class="field" id="phname" value="<%=rsPh("ph_name")%> " size="40" readonly="readonly"
Phone KeyFeatures
 

  




<%
conn.close
set conn = nothing
%>

Thursday, March 18, 2010

viewhadnsetkeyfeatures




<%
if request.QueryString("act")<>"" then
HandsetId=request.QueryString("HandsetId")
sqlid="update tblHandsetKeyFeatures set HKStatus= CASE when HKstatus='True' then 'False' when HKstatus='False' then 'True' end where HandsetId=" & HandsetId
conn.Open MyDsn
conn.execute(sqlid)
conn.close
set conn = nothing
if request.QueryString("act")="True" then
msg= "Phone Deactivated."
else
msg= "Phone Activated."
end if
response.Redirect("veiwHandsetKeyFeatures.asp?msg=" & msg)
end if
sqlrecord="select * from tblHandsetKeyFeatures order by KeyFeatureId"
Dim RecordPagecount,next10,Prev10,CurrPage
set rs = Server.CreateObject("ADODB.Recordset")
ConnectionLess rs, sqlrecord
%>

Admin Pannel :.





















<%
xx=1
Do Until rs.AbsolutePage <> CurrPage OR rs.Eof
xx=xx+1
if xx mod 2=0 then
bgcol="#E5E5E5"
else
bgcol="#FFFFFF"
End If
sql="select ph_name from saf_phone where ph_id="&rs("HandsetId")
Conn.open MyDsn
set rsPh = Conn.execute(sql)
if not rsPh.eof then
ph = rsPh("ph_name")
end if
conn.close
%>

td<%=bgcol%>" class="header4"> <%=rs("HandsetId")%>
td<%=bgcol%>" class="header4"> <%=ph%>
<%=bgcol%>" class="header4"><%=replace(rs("HandsetKeyFeature"),"
",vbcrlf)%>
<%=bgcol%>" class="header4"><%=rs("UpdatedOn")%>
<%=bgcol%>" class="header4"><"veiwHandsetKeyFeatures.asp?act=<%=trim(rs("HKStatus"))%>&psize=<%=psize%>&PageNo=<%=CurrPage%>&HandsetId=<%=rs("HandsetId")%>">
<% if rs("HKStatus")="True" then %>

<% else %>

<% end if %>

<%=bgcol%>"><%=psize%>&PageNo=<%=CurrPage%>&HandsetId=<%=rs("HandsetId")%>" class="header3">Update
<%
rs.movenext
loop
%>







<%=msg%>
HandsetId HandsetName HandsetKeyFeatures UpdatedDateTime Status Update

<%=PageNoShow("veiwHandsetKeyFeatures.asp?")%>   



<%
rs.close
set rs=nothing
set conn = nothing%>

addhandsetkeyfeatures



<%
if session("isadminloggedin")=true then
userid = 1
end if
conn.open MyDsn
Manufacturer = Request.Form("manufact")
HandsetId = Request.Form("phName")
HandsetKeyFeatures = Replace(Request.Form("ph_key"), "'", "''")

If Request.Form("submit") <> "" Then
sql="Exec [dbo].[USP_AddUpdHandsetKeyFeatures] 1,"& HandsetId &",'"& HandsetKeyFeatures &"','" & userid & "',1"
msg="Handset KeyFeatures added successfully for handset id= "& HandsetId
conn.execute sql
End if
%>
Admin Pannel :







<%=msg%>



Add
New Phone
















Manufacturer
Handset name
<%
if Request.form("manufact") <>"" then
sqlPHn="select distinct ph_id, ph_name from saf_phone where ph_id not in (select handsetId from tblHandsetKeyFeatures where manufacturer = '"& manufacturer &"') and manufacturer='"&Request.form("manufact")&"' order by ph_name asc"
else
sqlPHn="select distinct ph_id,ph_name from saf_phone where ph_Id=0"
end if
set rsPhn=conn.execute(sqlPHn)
%>
Phone KeyFeatures
 

  

<%conn.close%>

<% set conn = nothing %>