methods.lzx

<library>
	<!-- FOR DEBUGGING PURPOSES -->
	<method name="handleError">
		Debug.write((new Date())+": Request got an error -- sorry.");
	</method>

	<!-- Our Methods -->
	<method name="getWeePee">			  
		var ds=canvas.datasets.weepeeDS;
		ds.doRequest();
	</method>

	<method name="resellerLogin" args="username,password">			  
		var ds=canvas.datasets.loginDS;    
		var p=new LzParam();
		if (username == undefined) {
		username = "";
		}
		if (password == undefined) {
		password = "";
		}
		p.addValue("username", username,true);       				  	     
		p.addValue("password", password,true);       				  	     
		ds.setQueryString(p);        
		ds.doRequest();
	</method>

	<method name="resellerChangePwd" args="oldpassword,newpassword">			  
		var ds=canvas.datasets.changepwdDS;    
		var p=new LzParam();
		if (username == undefined) {
		username = "";
		}
		if (password == undefined) {
		password = "";
		}
		p.addValue("sid", canvas.sid,true);
		p.addValue("oldpassword", oldpassword,true);       				  	     
		p.addValue("newpassword", newpassword,true);       				  	     
		ds.setQueryString(p);        
		ds.doRequest();
	</method>

	<method name="createAccount" args="proto,lastname,surname,street,city,email">			  
		var ds=canvas.datasets.createaccountDS;    
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		p.addValue("proto", proto,true);       				  	     
		p.addValue("name", lastname,true);       				  	     
		p.addValue("surname", surname,true);       				  	     
		p.addValue("street", street,true);       				  	     
		p.addValue("city", city,true);       				  	     
		p.addValue("email", email,true);       				  	     
		ds.setQueryString(p);        
		ds.doRequest();
		canvas.getLiveData();
	</method>

	<method name="createAgreement" args="lastname,surname,company,street,city,email,vat,autoinvoice,credit,firstaccount">
		var p=new LzParam();            
                p.addValue("name", lastname,true);     
                p.addValue("surname", surname,true);                                
                p.addValue("company", company,true);                                        
                p.addValue("street", street,true);                                      
                p.addValue("city", city,true);                                               
                p.addValue("email", email,true);                 
                p.addValue("vat", vat,true);           
                p.addValue("id", firstaccount,true);           
		var ds=canvas.datasets.loginDS;   
		var dp = ds.getPointer();
		dp.setXPath("loginDS:/dbdata/data/company/text()");
		var resellerCompany = dp.getNodeText();
                p.addValue("rescompany", resellerCompany, true);
		dp.setXPath("loginDS:/dbdata/data/fullname/text()");
		var resellerName = dp.getNodeText();
                p.addValue("resname", resellerName, true);
                dp.setXPath("loginDS:/dbdata/data/postalcity/text()");
                var resellerCity = dp.getNodeText();
                p.addValue("rescity", resellerCity, true);
		lz.Browser.loadURL('http://vapi0.weepee.org/api/contract.php?' + p, '_parent');
	</method>
	
	<method name="addNumberScreened" args="number,accountid">
		var ds=canvas.datasets.addnumberscreenedDS;    
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		p.addValue("number", number,true);       				  	     
		p.addValue("accountid", accountid,true);       				  	     
		ds.setQueryString(p);        
		ds.doRequest();
		canvas.getLiveData();
	</method>

	<method name="addNumber" args="number,accountid">
		var ds=canvas.datasets.addnumberDS;    
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		p.addValue("number", number,true);       				  	     
		p.addValue("accountid", accountid,true);       				  	     
		ds.setQueryString(p);        
		ds.doRequest();
		canvas.getLiveData();
	</method>
	
	<method name="delNumber" args="number,accountid">
		var ds=canvas.datasets.delnumberDS;    
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		p.addValue("number", number,true);       				  	     
		p.addValue("accountid", accountid,true);       				  	     
		ds.setQueryString(p);        
		ds.doRequest();
		canvas.getLiveData();
	</method>
	
	<method name="delAccount" args="accountid">
		var ds=canvas.datasets.delaccountDS;    
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		p.addValue("accountid", accountid,true);       				  	     
		ds.setQueryString(p);        
		ds.doRequest();
		canvas.getLiveData();
	</method>
	
	<method name="undelAccount" args="accountid">
		var ds=canvas.datasets.undelaccountDS;    
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		p.addValue("accountid", accountid,true);       				  	     
		ds.setQueryString(p);        
		ds.doRequest();
		canvas.getLiveData();
	</method>

	<method name="weepeeReload">
		if (canvas.sid != undefined) {
			getLiveData();
			lz.Timer.addTimer(canvas.reload_delegate, 120 * 60000);
		}
	</method>

	<method name="getResellerData">
		var ds=canvas.datasets.sipaccountsDS;
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		ds.setQueryString(p);       				  	     
		ds.doRequest();

		var ds=canvas.datasets.numbersDS;
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		ds.setQueryString(p);       				  	     
		ds.doRequest();

		var ds=canvas.datasets.servicenumbersDS;
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		ds.setQueryString(p);       				  	     
		ds.doRequest();

		var ds=canvas.datasets.faxaccountsDS;
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		ds.setQueryString(p);       				  	     
		ds.doRequest();

                var ds=canvas.datasets.fwdaccountsDS;
                var p=new LzParam();
                p.addValue("sid", canvas.sid,true);
                ds.setQueryString(p);
                ds.doRequest();

		var ds=canvas.datasets.codecbwDS;
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		ds.setQueryString(p);       				  	     
		ds.doRequest();

		var ds=canvas.datasets.postalcodesDS;
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		ds.setQueryString(p);       				  	     
		ds.doRequest();
	</method>

	<method name="getLiveData">
                canvas.searchingsip.open();
		var ds=canvas.datasets.sipaccountsDS;
		ds.doRequest();

                canvas.searchingnumbers.open();
		var ds=canvas.datasets.numbersDS;
		ds.doRequest();

                canvas.searchingservicenumbers.open();
		var ds=canvas.datasets.servicenumbersDS;
		ds.doRequest();

                canvas.searchingfax.open();
		var ds=canvas.datasets.faxaccountsDS;
		ds.doRequest();

                canvas.searchingfwd.open();
                var ds=canvas.datasets.fwdaccountsDS;
                ds.doRequest();

	</method>

	<method name="searchSip" args="search">
                canvas.searchingsip.open();
		var ds=canvas.datasets.sipaccountsDS;
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		p.addValue("search", search,true);
		ds.setQueryString(p);       				  	     
		ds.doRequest();
	</method>
	
	<method name="searchFax" args="search">
                canvas.searchingfax.open();
		var ds=canvas.datasets.faxaccountsDS;
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		p.addValue("search", search,true);
		ds.setQueryString(p);       				  	     
		ds.doRequest();
	</method>

        <method name="searchFwd" args="search">
                canvas.searchingfwd.open();
                var ds=canvas.datasets.fwdaccountsDS;
                var p=new LzParam();
                p.addValue("sid", canvas.sid,true);
                p.addValue("search", search,true);
                ds.setQueryString(p);
                ds.doRequest();
        </method>

	<method name="searchNumbers" args="search">
                canvas.searchingnumbers.open();
		var ds=canvas.datasets.numbersDS;
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		p.addValue("search", search,true);
		ds.setQueryString(p);       				  	     
		ds.doRequest();
	</method>
	
	<method name="searchserviceNumbers" args="search">
                canvas.searchingservicenumbers.open();
		var ds=canvas.datasets.servicenumbersDS;
		var p=new LzParam();
		p.addValue("sid", canvas.sid,true);
		p.addValue("search", search,true);
		ds.setQueryString(p);       				  	     
		ds.doRequest();
	</method>
	
	<method name="searchPostalcodes" args="search">
			var ds=canvas.datasets.postalcodesDS;
			var p=new LzParam();
			p.addValue("sid", canvas.sid,true);
			p.addValue("search", search,true);
			ds.setQueryString(p);       				  	     
			ds.doRequest();
	</method>
	
	<method name="searchKbo" args="search">
			var ds=canvas.datasets.kbosearchDS;
			var p=new LzParam();
			p.addValue("sid", canvas.sid,true);
			p.addValue("search", search,true);
			ds.setQueryString(p);       				  	     
			ds.doRequest();
	</method>

        <method name="checkGridData">
        
                Debug.write("checkGridData");
                if ((canvas.gridservicenumbers == 1) && (canvas.gridnumbers == 1) && (canvas.gridsip == 1) && (canvas.gridfax == 1) && (canvas.gridfwd ==1) ) {
                        loading.setAttribute('visible',false);
                        resellermenu.setAttribute('visible',true);
                }
        
        </method>
</library>

Cross References

Named Instances