EVOLUTION-NINJA
Edit File: landing_page.php
<?=$this->load->view('user_header')?> <script language="javascript" type="text/javascript" src="<?=base_url();?>js/jquery-latest.pack.js" ></script> <script language="javascript" type="text/javascript" src="<?=base_url();?>js/jquery.lightbox.js" ></script> <script language="javascript" type="text/javascript" src="<?=base_url();?>js/ajaxupload.js" ></script> <script language="javascript" type="text/javascript" src="<?=base_url();?>js/jscolor/jscolor.js" ></script> <!--<script src="<?=base_url()?>js/jquery-1.2.6.min.js" type="text/javascript"></script>--> <script src="<?=base_url()?>js/popup.js" type="text/javascript"></script> <link rel="stylesheet" href="<?=base_url()?>css/general.css" type="text/css" media="screen" /> <script type="text/javascript" > function abc(a_id,id) { document.getElementById(a_id).src='<?=base_url();?>buttons/add_landers/'+id+'.png'; }; </script> <div id="content_div001"> <script type="text/javascript"> function chk_land_name() { var landing_page=document.getElementById('landing_page').value; var niche=document.getElementById('niche_id').value; if(landing_page==''){ document.getElementById('landing_page_error').style.display='block'; return false; } var landing_name=document.getElementById('landing_page').value; //alert(aff_campaign_name); var xmlHttp = jAjaxGetXmlHttpObject() ; var base_url = '<?=base_url()?>' ; var index_page = 'index.php'; var ajaxfile4 = base_url + index_page + "/landing_page_ctrl/land_name_chk/"+landing_name ; //alert(ajaxfile4); function onUpdateStatesArrival4() { if (xmlHttp.readyState == 4) { //alert(xmlHttp.responseText); if(xmlHttp.responseText=='1') { //alert(xmlHttp.responseText); document.getElementById('landing_page_error').style.display='none'; document.getElementById('land_name_exist_error').style.display='block'; document.getElementById('landing_page').value=''; return false; } else if(xmlHttp.responseText=='0') { //alert(xmlHttp.responseText); document.getElementById('landing_page_error').style.display='none'; document.getElementById('land_name_exist_error').style.display='none'; var landing_page=document.getElementById('landing_page').value; var niche=document.getElementById('niche_id').value; if(niche==''){ document.getElementById('niche_error').style.display='block'; return false; } else { cal(); return true; } } } } xmlHttp.onreadystatechange = onUpdateStatesArrival4 ; xmlHttp.open( "GET", ajaxfile4, true ) ; //xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded") xmlHttp.setRequestHeader('Cache-Control', 'no-cache'); xmlHttp.send(/* "value="+value+"&id="+id*/) ; return true; } function confirmDelete(id) { var agree=confirm("Are you sure you want to delete this landing page?"); if (agree) { var base_url = '<?=base_url()?>' ; var index_page = 'index.php'; //var ajaxfile = base_url + index_page +'/landing_pg_c/addd'; var xmlHttp = jAjaxGetXmlHttpObject() ; var ajaxfile01 = base_url + index_page +'/landing_page_ctrl/delete_land/'+id; function onUpdateStatesArrival5() { if (xmlHttp.readyState == 4) { var xx=xmlHttp.responseText; //alert(xx); // document.getElementById('rightdiv').innerHTML = xx ; display_right_div(); } } xmlHttp.onreadystatechange = onUpdateStatesArrival5 ; xmlHttp.open( "GET", ajaxfile01, true ) ; xmlHttp.send( null ) ; return true ; } else return false ; } function toggleNav(objID) { if (!document.getElementById) return; var ob = document.getElementById(objID).style; ob.display = (ob.display == 'block')?'none': 'block'; var head = document.getElementById("to" + objID) if (ob.display == 'block') head.innerHTML = head.innerHTML='<img border="0" src="<?=base_url();?>/images/min.png">'; else head.innerHTML = head.innerHTML = '<img border="0" src="<?=base_url();?>/images/plus.png">'; } </script> <script> function jAjaxGetXmlHttpObject() { var xmlHttp = null ; try { xmlHttp = new XMLHttpRequest() ; } catch( e ) { try { xmlHttp = new ActiveXObject( "Msxml2.XMLHTTP" ) ; } catch( e ) { xmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" ) ; } } return xmlHttp ; } window.onload = on_load; function on_load() { on_niche_change(); } function on_niche_change() { var xmlHttp = jAjaxGetXmlHttpObject() ; var base_url = '<?=base_url()?>'; var index_page = 'index.php'; var ajaxfile = base_url + index_page + "/landing_page_ctrl/get_niche/"; function onUpdateStatesArrival4() { if (xmlHttp.readyState == 4) { document.getElementById('niche_id1').innerHTML = '<select id="niche_id" name="niche_id" onchange="chk_land_name();" class="whiteboxcontant" >'+xmlHttp.responseText +'</select>'; } } xmlHttp.onreadystatechange = onUpdateStatesArrival4 ; xmlHttp.open( "GET", ajaxfile, true ) ; xmlHttp.setRequestHeader('Cache-Control', 'no-cache'); xmlHttp.send(/* "value="+value+"&id="+id*/) ; return true; } function url_val(urlval) { var tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/ if (tomatch.test(urlval)) { // window.alert("URL OK."); var filename = urlval.substring(urlval.lastIndexOf('.')+1); if(filename=='php') { return true; } else { return false; } } else { //document.getElementById('landing_page_url_error').style.display='block'; // window.alert("URL invalid. Try again."); return false; } } function display_right_div() { var xmlHttp = jAjaxGetXmlHttpObject() ; var base_url = '<?=base_url() ?>' ; var index_page = 'index.php'; var ajaxfile03 = base_url + index_page +'/landing_page_ctrl/load_right_div/'; //alert(ajaxfile03) function onUpdateStatesArrival03() { if (xmlHttp.readyState == 4) { var xx=xmlHttp.responseText; //alert(xx); var divIdName = "rightdiv"; document.getElementById(divIdName).innerHTML=xx; //disablePopup(); } } xmlHttp.onreadystatechange = onUpdateStatesArrival03 ; xmlHttp.open( "GET", ajaxfile03, true ) ; xmlHttp.send( null ) ; } function display(val) { if(val=="From Template") { /*document.getElementById('land_div').style.display = 'none'; document.getElementById('selfhost_div').style.display = 'block';*/ var landing_page=document.getElementById('landing_page').value; var niche=document.getElementById('niche_id').value; var base_url = '<?=base_url()?>' ; var index_page = 'index.php'; var data1 = 'landing_page='+landing_page+'&niche='+niche; if(chk_land_name()==true) { window.location=base_url + index_page +'/landing_page_ctrl/load_popup?'+data1; } } if(val=="Self Hosted") { document.getElementById('land_div').style.display = 'block'; document.getElementById('selfhost_div').style.display = 'none'; } } function cal() { document.getElementById('landing_page_error').style.display='none'; document.getElementById('niche_error').style.display='none'; var landing_page=document.getElementById('landing_page').value; var niche=document.getElementById('niche_id').value; if(landing_page==''){ document.getElementById('landing_page_error').style.display='block'; return false;} else if(niche==''){ document.getElementById('niche_error').style.display='block'; return false;} else{ var acc=document.getElementsByName('lp_type'); for(i=0;i<acc.length;i++) { if(acc[i].checked==true) { var landing_page_type=acc[i].value; //alert(landing_page_type); } } if(landing_page_type=="From Template") { ///centerPopup(); //loadPopup(); } } } function check_land_name(name) { var url = '<?=base_url()?>' + "index.php/landing_page_ctrl/land_name_chk/"+name ; result = $.ajax({ url: url, async: false }).responseText; if (result == 0) { /*yeah, it's backwards.*/ return true; } else { return false; } } function copy_template(land_id) { url = '<?=base_url()?>index.php/landing_page_ctrl/copy_template/' + land_id + '/'; question = 'What would you like to name this copy?'; do { newname = prompt(question); question = 'Sorry, ' + newname + ' is taken. What would you like to name this copy?'; } while(newname != null && !check_land_name(newname)); if (newname != null) { url += newname; window.location = url; } return false; } function validate() { if (!chk_land_name()) { return false; } else { return true; } } </script> <form id="form1" name="form1" method="GET" action="<?=base_url()?>index.php/landing_page_ctrl/add_landing_page" onSubmit="return validate();"> <div id="landing_page_div"> <div class="bodycontainer"> <div class="heading">Landing Page Setup <font size="-1"> <?if (isset($script_url)):?> <div id="self_code_div" style="border: solid 1px; background-color:#FFFFFF; margin-left:55px; " > <p align="left" style="text-align:center;">Inbound Landing Page Tracking Code: Put this code in your landing page</p> <input align="left" style="width:100%; color:#000000; text-align:center;" value="<? echo $script_url; ?>"><br /> </div> <?endif?> </font></div> <div class="leftdiv"> <div class="backbox">Add Existing LP's or Create New LP's:</div> <div class="whitebox"> <div class="row_div"> <div class="whiteboxA">LP Name:</div> <div class="text_boxDiv" style="margin-left:2px;"> <input class="whiteboxcontant" id="landing_page" name="landing_page" type="text" onblur="chk_land_name();"></div> </div> <div id="landing_page_error" style="margin-left:135px;font-family:Arial,Helvetica,sans-serif;font-size:11px; margin-top:0px; float:left; display:none; color:#FF0000;">Please Enter Landing Page Name</div> <div id="land_name_exist_error" style="margin-left:135px;font-family:Arial,Helvetica,sans-serif;font-size:11px; margin-top:0px; float:left; display:none; color:#FF0000;">There is an error with the Landing Page name you have chose. Either it already exists or you have included a space in the name. The name cannot contain spaces.</div> <div class="row_div"> <div class="whiteboxA">Select LP Niche:</div> <div class="text_boxDiv" id="niche_id1"> <select id="niche_id" name="niche_id" onchange="chk_land_name();" class="whiteboxcontant" > <option selected="selected">-------</option> </select> </div></div> <div id="niche_error" style="margin-left:135px;font-family:Arial,Helvetica,sans-serif;font-size:11px; margin-top:0px; float:left; display:none; color:#FF0000;">Please Select Niche</div> <div class="row_div"> <div class="whiteboxA">LP Type:</div> <div class="text_boxDiv" style="margin-left:10px;margin-top:10px;"> <input name="lp_type" type="radio" value="Self Hosted" id="lp_type1" checked="checked" onClick="display(this.value);" /> <div style="color:#666666; font-family:Arial,Helvetica,sans-serif;font-size:12px;font-weight:bold; margin-top:-18px; margin-left:23px;">Self Hosted</div><br /> <input name="lp_type" type="radio" value="From Template" id="lp_type2" onClick="display(this.value);chk_land_name();" /> <div style="color:#666666;font-family:Arial,Helvetica,sans-serif;font-size:12px;font-weight:bold; margin-top:-18px; margin-left:23px;">From Template</div> </div></div> <div id="niche_error" style="margin-left:135px;font-family:Arial,Helvetica,sans-serif;font-size:11px; margin-top:0px; float:left; display:none; color:#FF0000;">Please Select Niche</div> <div id="land_div"> <div class="row_div"> <div class="whiteboxA">Landing Page URL:</div> <div class="text_boxDiv" style="margin-left:2px;"> <input style="display: inline;" id="landing_url" name="landing_url" type="text" class="whiteboxcontant"> </div> <div style="margin-left:10px;margin-top:2px; font-size:12px; float:left; font-family:Arial,Helvetica,sans-serif;color:#747373;">Must be a php file. (http://www.squeezepage.com/index.php)</div> </div> <div id="landing_url_error" style="margin-left:135px;font-family:Arial,Helvetica,sans-serif;font-size:11px; margin-top:0px; float:left; display:none; color:#FF0000;">Please Enter Correct Url</div> </div> <!-- Begin Buttons SECTION id=vbUL_z5t77--> <table id="vista-buttons_com_idz5t77" width="0" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding:30px 0px 0px 100px" title ="Add Landing Page"> <input type="image" id="save_a" onMouseOver="abc('save_a','btz5t77_1');" onMouseOut="abc('save_a','btz5t77_0');" src="<?=base_url();?>buttons/add_landers/btz5t77_0.png" width="166" height="30" border="0" alt="Add" /></td></tr></table> <!-- End Buttons SECTION --> <div id="success" style="margin-left:135px;margin-top:0px;font-family:Arial,Helvetica,sans-serif;font-size:11px; float:left; display:none; color:#009900;">Tracking Link generated Successfully</div> </div> <?if (isset($land_url)):?> <div class="row_div" id="code" <? if(isset($land_url)) { ?> style="display:block;" <? } else { ?> style="display:none;" <? } ?> > <div id="success" style="margin: 10px 0 10px 81px; font-family: 'Arial', 'Helvetica', sans-serif; font-size: 12px; float: left; color: #009900; display: block"> Landing Page Successfully Updated <br /><br /><a href="<?=$land_url?>" target="_blank"><?=$land_url?></a> </div> </div> <?endif?> </div> <div class="rightdiv" id="rightdiv"> <div class="rightdivcontant"> <div class="rightdivimage"> <div class="rgttext">My Existing Landing Pages:</div> </div> <? if(!$land_table){?> <div class="rightwhitebox"><div class="rgttext"><font color="#333333">You have not added any Landing Page.</font></div> <? } else { for($i=0;$i<count($nichess);$i++) { $this->db->where('user_id',$user_id); $this->db->where('niche',$nichess[$i]->niche_id); $query = $this->db->get('pd_land'); $lands = $query->result(); ?> <div class="rightwhitebox" id="my<?=$nichess[$i]->niche_id?>Div" > <? if($lands){ ?><div class="rgttext" onclick="toggleNav('<?=$nichess[$i]->niche_id ?>')" style="cursor:pointer;"><font color="#333333" ><div style="width:13px; float:left;" id="to<?=$nichess[$i]->niche_id ?>"><img border="0" src="<?=base_url();?>/images/plus.png"></div> <?=$nichess[$i]->niche_name?> </font></div> <div id="<?=$nichess[$i]->niche_id ?>" style="display:none;" > <? for($k=0;$k<count($lands);$k++) {?> <div class="rghttext2" id="my<?=$lands[$k]->land_id;?>Li"><?=$lands[$k]->landing_page_name;?> . <?=$lands[$k]->landing_page_type; ?> </div> <div class="delatebutton" > <?if($lands[$k]->landing_page_type == 'From Template'):?><a title="copy" onClick="copy_template(<?=$lands[$k]->land_id?>); return false;" href="#"><img border="0" src="<?=base_url();?>/images/copy1.png"></a><?endif?></div> <div class="delatebutton" ><?if ($lands[$k]->landing_page_type == 'From Template'):?><a title="Edit" style="cursor:pointer;" href="<?=base_url()?>index.php/landing_page_ctrl/edit_template/<?=$lands[$k]->land_id;?>" ><img border="0" src="<?=base_url();?>/images/editbutton.png" ></a><?endif?></div> <div class="delatebutton" ><a title="Delete" href="javascript:void(0);" style="cursor:pointer;" onClick="return confirmDelete(<?= $lands[$k]->land_id ?>);"><img border="0" src="<?=base_url();?>/images/delatebutton.png"></a></div> <div class="delatebutton" ><a title="URL" href= "<? echo $lands[$k]->landing_url?>" target="_blank"><img border="0" src="<?=base_url();?>/images/urlbutton1.png"></a></div> <? }?> </div> <? } ?> </div> <? } }?> </div> <!--content_div001 closing--> <div class="rightdivftr"></div> </div> </div> </div> <script> function highlight() { //alert('aa'); var text_val=eval("document.form1.contenttext_code"); //var text_val=document.getElementById('content').value; //alert(text_val); text_val.focus(); text_val.select(); } </script> <style> .color{ background-color:#EDEADC; border:1px solid #999999; float:right; font-family:Arial,Helvetica,sans-serif; margin-right:10px; margin-top:10px; width:180px; } </style> <input type="hidden" id="select_lp" /> <div id="popupContact" style="width:871px; height:550px; top:29.5px;overflow:auto;"> <a id="popupContactClose">x</a> <!--<h1>Login!</h1>--> <p id="contactArea"> <!--<div id="code"> <div class="backbox">Code:</div> <div class="row_div"style="display:block"> <div class="text_boxDiv" style="width:443px;"><textarea name="contenttext" id="content" cols="36" rows="5" class="whiteboxcontant"></textarea></div> </div></div>--> </p> </div> </div> <div id="backgroundPopup"></div> </form> <?=$this->load->view('user_footer')?>