Current File : /home/inlingua/www/sensoriumpsychologists.com/franchise_between/ajax_handlers_funcs.php |
<?php
require_once("../../../franchise_back/database_func.php");
class ajax_funcs
{
private $validate_obj_inside;
private $to_check;
public function __construct(validate_functions $validateobj_inside)
{
$this->validate_obj_inside=$validateobj_inside;
$this->to_check="undefined";
}
public function set_value($variable_name,$new_value)
{
switch($variable_name)
{
case 'to_check':$this->to_check=$new_value;break;
}
}
public function get_value($variable_name)
{
$to_return="";
switch($variable_name)
{
case 'to_check':$to_return=$this->to_check;break;
}
return $to_return;
}
public function change_theme($theme,$ref_no)
{
$this->validate_obj_inside->check_empty($theme,"Theme");
$this->validate_obj_inside->check_length($theme,"Theme",50);
$this->validate_obj_inside->check_empty($ref_no,"Ref No");
$this->validate_obj_inside->check_length($ref_no,"Ref No",50);
$this->validate_obj_inside->check_is_num($ref_no,"Ref No");
$mysql_obj=new mysql_functions_class;
$mysql_obj->open_connection();
$theme=$mysql_obj->real_escape($theme);
$ref_no=$mysql_obj->real_escape($ref_no);
$prepared_statement="UPDATE shristi_child_details SET theme_class='$theme',theme_datetime=NOW() WHERE table_id='$ref_no'";
$res=$mysql_obj->simply_run_statement_passed($prepared_statement);
$mysql_obj->close_connection();
return "ok";
}
}
?>