Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class controller_defaultact extends controller_base {
- function __construct($sms){
- parent::__construct();
- $this->sms = $sms;
- }
- public function defaultact(){
- return "Уточните код запроса. Пользуйтесь только нашими сервисами!";
- }
- public function defaultout($control_array,$sms){
- echo $sms->get_AnswerText();
- }
- public function get_TextbyId($parametrs){
- $id = unserialize($paramerts);
- $sql = "SELECT `answer`
- FROM `service_answer_text`
- WHERE `id`='$id'
- LIMIT 1";
- if ($this->db->num_rows($sql)){
- $result = $this->db->fetch_rows();
- $answer = $result[0]['answer'];
- } else {
- $answer = $this->defaultact();
- }
- return $answer;
- }
- public function get_SmsKey($parametrs){
- $smskey = $this->generate_password(10);
- $IdServiceMain = $this->sms->get_Service();
- $id_user = $this->getUserId($IdServiceMain,$this->sms->get_PrefixId(),$this->sms->get_SourseNumber());
- $sql = "INSERT INTO `key_keys`(`datetime`, `user_id`, `project_id`, `key`, `count`)
- VALUE (UNIX_TIMESTAMP(),$id_user,$IdServiceMain,$smskey,0)";
- return "Спасибо! Ваш ключ: $smskey";
- }
- public function return_SmsKey($parametrs){
- echo "ENTER";
- $parametrs = array(
- "body"=>array(
- "child"=>array(
- "sms"=>array("attr"=>array("id"=>1),
- "child"=>array(
- "param"=>array("attr"=>array("type"=>"phone","value"=>"987")),//{$this->sms->get_PhoneNumber()}")),
- "param"=>array("attr"=>array("type"=>"text","value"=>"text"))//{$this->sms->get_AnswerText()}"))
- )
- )
- )
- )
- );
- $xml = $this->arr2xml('windows-1251',$parametrs);
- print($xml);// 'xml='.$xml;
- var_dump($xml);
- return $xml;
- }
- }
Add Comment
Please, Sign In to add comment